Skip to content

Commit fb63978

Browse files
committed
Fix comisd memory operand size: xmmword -> qword
Before: comisd xmm15, xmmword ptr [r8] After: comisd xmm15, qword ptr [r8] The new one is correct, according to binutils-gdb. Closes capstone-engine#2748.
1 parent 717d8b0 commit fb63978

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

arch/X86/X86IntelInstPrinter.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ static void printf64mem(MCInst *MI, unsigned OpNo, SStream *O)
237237
MI->x86opsize = 8;
238238
break;
239239
case X86_MOVPQI2QImr:
240-
case X86_COMISDrm:
241240
SStream_concat0(O, "xmmword ptr ");
242241
MI->x86opsize = 16;
243242
break;

tests/details/x86.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,3 +1344,36 @@ test_cases:
13441344
sib_scale: 0
13451345
regs_read: [ rsp ]
13461346
regs_write: [ rsp, rip ]
1347+
-
1348+
input:
1349+
bytes: [ 0x66, 0x45, 0x0f, 0x2f, 0x38 ]
1350+
arch: "x86"
1351+
options: [ CS_OPT_DETAIL, CS_MODE_64 ]
1352+
address: 0x0
1353+
expected:
1354+
insns:
1355+
-
1356+
asm_text: "comisd xmm15, qword ptr [r8]"
1357+
details:
1358+
x86:
1359+
prefix: [ X86_PREFIX_0, X86_PREFIX_0, X86_PREFIX_OPSIZE, X86_PREFIX_0 ]
1360+
opcode: [ 0x0f, 0x2f, 0x00, 0x00 ]
1361+
rex: 0x45
1362+
addr_size: 8
1363+
modrm: 0x38
1364+
disp: 0x0
1365+
sib: 0x0
1366+
sib_scale: 0
1367+
operands:
1368+
-
1369+
type: X86_OP_REG
1370+
reg: xmm15
1371+
size: 16
1372+
access: CS_AC_READ
1373+
-
1374+
type: X86_OP_MEM
1375+
mem_base: r8
1376+
size: 8
1377+
access: CS_AC_READ
1378+
regs_read: [ xmm15, r8 ]
1379+
regs_write: [ rflags ]

tests/issues/issues.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ test_cases:
18131813
expected:
18141814
insns:
18151815
-
1816-
asm_text: "comisd xmm0, xmmword ptr [eax]"
1816+
asm_text: "comisd xmm0, qword ptr [eax]"
18171817
-
18181818
input:
18191819
name: "issue 1456 ARM printPKHASRShiftImm"

0 commit comments

Comments
 (0)