diff options
Diffstat (limited to 'test/arch/x86')
| -rw-r--r-- | test/arch/x86/arch.py | 8 | ||||
| -rw-r--r-- | test/arch/x86/qemu/testqemu.py | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py index 5721d72a..7d6260a2 100644 --- a/test/arch/x86/arch.py +++ b/test/arch/x86/arch.py @@ -832,6 +832,14 @@ reg_tests = [ "0fb000"), (m32, "00000000 CMPXCHG DWORD PTR [EAX], EAX", "0fb100"), + (m16, "00000000 CMPXCHG8B QWORD PTR [SI+0x24]", + "0fc74c24"), + (m32, "00000000 CMPXCHG8B QWORD PTR [ESP+0x8]", + "0fc74c2408"), + (m64, "00000000 CMPXCHG8B QWORD PTR [RSP+0x8]", + "0fc74c2408"), + (m64, "00000000 CMPXCHG16B QWORD PTR [RSP+0x8]", + "480fc74c2408"), (m32, "00000000 CDQ", "99"), diff --git a/test/arch/x86/qemu/testqemu.py b/test/arch/x86/qemu/testqemu.py index 7cf2ab75..a7df4fe4 100644 --- a/test/arch/x86/qemu/testqemu.py +++ b/test/arch/x86/qemu/testqemu.py @@ -45,6 +45,7 @@ def xxx___printf_chk(jitter): fmt = get_str_ansi(jitter, args.format) # Manage llx fmt = fmt.replace("llx", "lx") + fmt = fmt.replace("%016lx", "%016z") fmt_a = parse_fmt(fmt) esp = jitter.cpu.ESP @@ -61,11 +62,16 @@ def xxx___printf_chk(jitter): a2 = upck32(jitter.vm.get_mem(esp + 8 + 4*(i+1), 4)) a = struct.unpack("d", struct.pack("Q", a2 << 32 | a))[0] i += 1 + elif x.lower() == 'z': + a2 = upck32(jitter.vm.get_mem(esp + 8 + 4*(i+1), 4)) + a = a2 << 32 | a + i += 1 else: raise RuntimeError("Not implemented format") args.append(a) i += 1 + fmt = fmt.replace("%016z", "%016lx") output = fmt%(tuple(args)) # NaN bad repr in Python output = output.replace("nan", "-nan") |