mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-23 18:10:59 +00:00
4a1de154ef
In commit 7073fbada733c8d10992f00772c9b9299d740e9b, the `andn` instruction was implemented via `tcg_gen_andc` but passes the operands in the wrong order: - X86 defines `andn dest,src1,src2` as: dest = ~src1 & src2 - TCG defines `andc dest,src1,src2` as: dest = src1 & ~src2 The following simple test shows the issue: int main(void) { uint32_t ret = 0; __asm ( "mov $0xFF00, %%ecx\n" "mov $0x0F0F, %%eax\n" "andn %%ecx, %%eax, %%ecx\n" "mov %%ecx, %0\n" : "=r" (ret)); printf("%08X\n", ret); return 0; } This patch fixes the problem by simply swapping the order of the two last arguments in `tcg_gen_andc_tl`. Backports commit 5cd10051c2e02b7a86eae49919d6c65a87dbea46 from qemu |
||
---|---|---|
.. | ||
arm | ||
i386 | ||
m68k | ||
mips | ||
sparc |