target/i386: split eflags computation out of gen_compute_eflags
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Oct 2023 14:20:20 +0000 (16:20 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Dec 2023 21:03:50 +0000 (22:03 +0100)
commit80e55f54ac186e01a74a69d51f225ab6afefb4c6
treec4d11f4a4cf376b831c9b75a6ddaa1b570ab6d4c
parentc0099cd40e368d8a8505c93813bffdd752c2b859
target/i386: split eflags computation out of gen_compute_eflags

The new x86 decoder wants the gen_* functions to compute EFLAGS before
writeback, which can be an issue for instructions with a memory
destination such as ARPL or shifts.

Extract code to compute the EFLAGS without clobbering CC_SRC, in case
the memory write causes a fault.  The flags writeback mechanism will
take care of copying the result to CC_SRC.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/translate.c