]> git.ipfire.org Git - thirdparty/qemu.git/commit
m68k: fix CAS2 writeback when Dc1==Dc2
authorLaurent Vivier <laurent@vivier.eu>
Fri, 26 Dec 2025 21:37:07 +0000 (22:37 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 12 Jan 2026 15:24:29 +0000 (16:24 +0100)
commit11dac41f2e830bcd7ba74969dc50f5740e3ce7e7
treea6f36ac7018d99d166f2cd4c5564274f65c048c7
parentb254e486242466dad881fc2bbfa215f1b67cd30f
m68k: fix CAS2 writeback when Dc1==Dc2

According to Programmer's Reference Manual, if Dc1 and Dc2 specify the
same data register and the comparison fails, memory operand 1 is stored
in the data register.

The current helpers wrote Dc1 then Dc2, leaving operand 2 in the shared
register.

Swap the writeback order for cas2w/cas2l so memory operand 1 wins.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20251226213707.331741-1-laurent@vivier.eu>
target/m68k/op_helper.c