target/i386: make cc_op handling more explicit for repeated string instructions.
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 15 Dec 2024 09:06:07 +0000 (10:06 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Jan 2025 10:35:33 +0000 (11:35 +0100)
commit6986cf003226ddf7e5af36a9f4f033cb16c8636c
treecf6f1c567f53acc646034fa796596671bcf606ce
parent0d82d9e84644ecee3e626bdf204e9847ffe10bce
target/i386: make cc_op handling more explicit for repeated string instructions.

Since the cost of gen_update_cc_op() must be paid anyway, it's easier
to place them manually and not rely on spilling that is buried under
multiple levels of function calls.  While at it, clarify the circumstances
in which the gen_update_cc_op() is needed, and why it is not for REPxx
SCAS and REPxx CMPS.

And since cc_op will have been spilled at the point of a fault, just
make the whole insn CC_OP_DYNAMIC.  Once repz_opt is reintroduced,
a fault could happen either before or after the first execution of
CMPS/SCAS, and CC_OP_DYNAMIC sidesteps the complicated matter of what
x86_restore_state_to_opc would do.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20241215090613.89588-9-pbonzini@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/translate.c