]> granicus.if.org Git - yasm/commitdiff
Fix iretq, stosq, etc, which were properly setting the opersize but the REX
authorPeter Johnson <peter@tortall.net>
Fri, 1 Aug 2003 03:52:35 +0000 (03:52 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 1 Aug 2003 03:52:35 +0000 (03:52 -0000)
generation code wasn't seeing it because it wasn't looking at the modified
opersize.

Bug noticed by: Antoine Leca <antoine64leca@unknown> (x86-64 discuss ML)

svn path=/trunk/yasm/; revision=1022

modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/iret.asm [new file with mode: 0644]
modules/arch/x86/tests/iret.errwarn [new file with mode: 0644]
modules/arch/x86/tests/iret.hex [new file with mode: 0644]
modules/arch/x86/tests/stos.asm [new file with mode: 0644]
modules/arch/x86/tests/stos.errwarn [new file with mode: 0644]
modules/arch/x86/tests/stos.hex [new file with mode: 0644]
modules/arch/x86/x86id.re

index 0c8a3a13b46017ddf028801823a9c5c0f336dcd4..26a6814a1495343ce922006bd23fe77cbb8e0e0e 100644 (file)
@@ -30,6 +30,9 @@ EXTRA_DIST += modules/arch/x86/tests/fwdequ64.hex
 EXTRA_DIST += modules/arch/x86/tests/genopcode.asm
 EXTRA_DIST += modules/arch/x86/tests/genopcode.errwarn
 EXTRA_DIST += modules/arch/x86/tests/genopcode.hex
+EXTRA_DIST += modules/arch/x86/tests/iret.asm
+EXTRA_DIST += modules/arch/x86/tests/iret.errwarn
+EXTRA_DIST += modules/arch/x86/tests/iret.hex
 EXTRA_DIST += modules/arch/x86/tests/jmp64-1.asm
 EXTRA_DIST += modules/arch/x86/tests/jmp64-1.errwarn
 EXTRA_DIST += modules/arch/x86/tests/jmp64-1.hex
@@ -83,6 +86,9 @@ EXTRA_DIST += modules/arch/x86/tests/segmov.hex
 EXTRA_DIST += modules/arch/x86/tests/shift.asm
 EXTRA_DIST += modules/arch/x86/tests/shift.errwarn
 EXTRA_DIST += modules/arch/x86/tests/shift.hex
+EXTRA_DIST += modules/arch/x86/tests/stos.asm
+EXTRA_DIST += modules/arch/x86/tests/stos.errwarn
+EXTRA_DIST += modules/arch/x86/tests/stos.hex
 EXTRA_DIST += modules/arch/x86/tests/twobytemem.asm
 EXTRA_DIST += modules/arch/x86/tests/twobytemem.errwarn
 EXTRA_DIST += modules/arch/x86/tests/twobytemem.hex
diff --git a/modules/arch/x86/tests/iret.asm b/modules/arch/x86/tests/iret.asm
new file mode 100644 (file)
index 0000000..2521f58
--- /dev/null
@@ -0,0 +1,13 @@
+[bits 16]
+iret
+iretw
+iretd
+[bits 32]
+iret
+iretw
+iretd
+[bits 64]
+iret
+iretw
+iretd
+iretq
diff --git a/modules/arch/x86/tests/iret.errwarn b/modules/arch/x86/tests/iret.errwarn
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/modules/arch/x86/tests/iret.hex b/modules/arch/x86/tests/iret.hex
new file mode 100644 (file)
index 0000000..571c637
--- /dev/null
@@ -0,0 +1,14 @@
+cf 
+cf 
+66 
+cf 
+cf 
+66 
+cf 
+cf 
+cf 
+66 
+cf 
+cf 
+48 
+cf 
diff --git a/modules/arch/x86/tests/stos.asm b/modules/arch/x86/tests/stos.asm
new file mode 100644 (file)
index 0000000..4e9682b
--- /dev/null
@@ -0,0 +1,13 @@
+[bits 16]
+stosb
+stosw
+stosd
+[bits 32]
+stosb
+stosw
+stosd
+[bits 64]
+stosb
+stosw
+stosd
+stosq
diff --git a/modules/arch/x86/tests/stos.errwarn b/modules/arch/x86/tests/stos.errwarn
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/modules/arch/x86/tests/stos.hex b/modules/arch/x86/tests/stos.hex
new file mode 100644 (file)
index 0000000..b495827
--- /dev/null
@@ -0,0 +1,14 @@
+aa 
+ab 
+66 
+ab 
+aa 
+66 
+ab 
+ab 
+aa 
+66 
+ab 
+ab 
+48 
+ab 
index 8aea141e8bbb04b083156b2cc619bf5af844d508..e86cdf7f1de6be36c8fd359d52bb1453c14c182e 100644 (file)
@@ -1919,7 +1919,6 @@ yasm_x86__parse_insn(const unsigned long data[4], int num_operands,
     d.op[1] = info->opcode[1];
     d.op[2] = info->opcode[2];
     d.spare = info->spare;
-    d.rex = (yasm_x86_LTX_mode_bits == 64 && info->opersize == 64) ? 0x48: 0;
     d.im_len = 0;
     d.im_sign = 0;
     d.shift_op = 0;
@@ -1957,6 +1956,8 @@ yasm_x86__parse_insn(const unsigned long data[4], int num_operands,
        /*mod_data >>= 8;*/
     }
 
+    d.rex = (yasm_x86_LTX_mode_bits == 64 && d.opersize == 64) ? 0x48: 0;
+
     /* Go through operands and assign */
     if (operands) {
        for(i = 0, op = yasm_ops_first(operands); op && i<info->num_operands;