qemu-e2k/tests/tcg
Paolo Bonzini 60c7dd22e1 target/i386: fix ADOX followed by ADCX
When ADCX is followed by ADOX or vice versa, the second instruction's
carry comes from EFLAGS and the condition codes use the CC_OP_ADCOX
operation.  Retrieving the carry from EFLAGS is handled by this bit
of gen_ADCOX:

        tcg_gen_extract_tl(carry_in, cpu_cc_src,
            ctz32(cc_op == CC_OP_ADCX ? CC_C : CC_O), 1);

Unfortunately, in this case cc_op has been overwritten by the previous
"if" statement to CC_OP_ADCOX.  This works by chance when the first
instruction is ADCX; however, if the first instruction is ADOX,
ADCX will incorrectly take its carry from OF instead of CF.

Fix by moving the computation of the new cc_op at the end of the function.
The included exhaustive test case fails without this patch and passes
afterwards.

Because ADCX/ADOX need not be invoked through the VEX prefix, this
regression bisects to commit 16fc5726a6 ("target/i386: reimplement
0x0f 0x38, add AVX", 2022-10-18).  However, the mistake happened a
little earlier, when BMI instructions were rewritten using the new
decoder framework.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1471
Reported-by: Paul Jolly <https://gitlab.com/myitcv>
Fixes: 1d0b926150 ("target/i386: move scalar 0F 38 and 0F 3A instruction to new decoder", 2022-10-18)
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-02-11 09:07:25 +01:00
..
aarch64 tests/tcg: add memory-sve test for aarch64 2023-02-02 11:48:20 +00:00
alpha
arm tests/tcg: clean up calls to run-test 2022-10-06 11:53:40 +01:00
cris tests/tcg: clean up calls to run-test 2022-10-06 11:53:40 +01:00
hexagon Hexagon (target/hexagon) implement mutability mask for GPRs 2023-01-05 09:19:02 -08:00
hppa
i386 target/i386: fix ADOX followed by ADCX 2023-02-11 09:07:25 +01:00
loongarch64 target/loongarch: Remove cpu_fcsr0 2022-08-08 19:42:53 -07:00
m68k
minilib
mips
multiarch tests/tcg: skip the vma-pthread test on CI 2023-02-02 10:44:23 +00:00
nios2 tests/tcg/nios2: Tweak 10m50-ghrd.ld 2022-10-31 20:37:58 +00:00
openrisc
ppc
ppc64 tests/tcg: move compiler tests to Makefiles 2022-10-06 11:53:40 +01:00
ppc64le tests/tcg: unify ppc64 and ppc64le Makefiles 2022-10-06 11:53:40 +01:00
riscv64 target/riscv: Set pc_succ_insn for !rvc illegal insn 2023-01-06 10:42:55 +10:00
s390x target/s390x: Use a single return for helper_divs64/u64 2023-02-04 06:19:42 -10:00
sh4 tests/tcg: re-enable threadcount for sh4 2022-10-31 20:37:59 +00:00
sparc64
tricore tests/tcg/tricore: Add test for ld.h 2023-02-08 10:02:46 +01:00
x86_64 target/i386: fix cmpxchg with 32-bit register destination 2022-11-15 09:34:42 +10:00
xtensa
Makefile.target tests/tcg: Use SIGKILL for timeout 2023-02-02 10:44:23 +00:00
README

This directory contains various interesting guest programs for
regression testing. Tests are either multi-arch, meaning they can be
built for all guest architectures that support linux-user executable,
or they are architecture specific.

CRIS
====
The testsuite for CRIS is in tests/tcg/cris.  You can run it
with "make test-cris".