summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-11-16 09:40:03 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-11-16 09:40:03 -0800
commitbcf9f2a08b6aa26ceb526078f06734e5dcc5a82e (patch)
treeb040bbaada535429e012fcfb9fce3655c5ce0cd2
parent3136d48212fdbcff131b84514ecdd6e111c139fc (diff)
parent3cb0e8c052a672424eaf59a021f0dbfb6ef205b8 (diff)
downloadnasm-bcf9f2a08b6aa26ceb526078f06734e5dcc5a82e.tar.gz
Merge branch 'nasm-2.09.xx'
-rw-r--r--assemble.c2
-rw-r--r--test/br3109604.asm9
2 files changed, 10 insertions, 1 deletions
diff --git a/assemble.c b/assemble.c
index bb2911ae..1a7dc8e0 100644
--- a/assemble.c
+++ b/assemble.c
@@ -1152,7 +1152,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
errfunc(ERR_NONFATAL, "invalid operands in non-64-bit mode");
return -1;
}
- if (ins->vex_cm != 1 || (ins->rex & (REX_W|REX_R|REX_B)))
+ if (ins->vex_cm != 1 || (ins->rex & (REX_W|REX_X|REX_B)))
length += 3;
else
length += 2;
diff --git a/test/br3109604.asm b/test/br3109604.asm
new file mode 100644
index 00000000..9032e8d5
--- /dev/null
+++ b/test/br3109604.asm
@@ -0,0 +1,9 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obr3109604.bin; Files=stdout stderr br3109604.bin
+;Testname=optimized; Arguments=-Ox -fbin -obr3109604.bin; Files=stdout stderr br3109604.bin
+
+ bits 64
+b0: vmovd xmm2, [rdx+r9]
+e0:
+
+ section .data
+len: dd e0 - b0 ; Should be 6