aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2008-01-15 01:37:56 +0000
committerH.J. Lu <hjl.tools@gmail.com>2008-01-15 01:37:56 +0000
commit5c07affcae1a9698e488eefae0b1eb30d9743657 (patch)
treeb9e29cc4c40d8db0ca2ae4a1a11a9028e2f00d13 /gas
parent787daa7a0b1c68d0c52bdccd8747a12198ec9d75 (diff)
downloadgdb-5c07affcae1a9698e488eefae0b1eb30d9743657.zip
gdb-5c07affcae1a9698e488eefae0b1eb30d9743657.tar.gz
gdb-5c07affcae1a9698e488eefae0b1eb30d9743657.tar.bz2
gas/
2008-01-14 H.J. Lu <hongjiu.lu@intel.com> * config/tc-i386.c (match_reg_size): New. (match_mem_size): Likewise. (operand_size_match): Likewise. (operand_type_match): Also clear all size fields. (match_template): Skip Intel syntax when in AT&T syntax. Call operand_size_match to check operand size. (i386_att_operand): Set the mem field to 1 for memory operand. (i386_intel_operand): Likewise. gas/testsuite/ 2008-01-14 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/i386.s: Add tests for movsx, movzx and movnti. * gas/i386/inval.s: Likewise. * gas/i386/x86_64.s: Likewise. * gas/i386/x86-64-inval.s: Likewise. * gas/i386/i386.d: Updated. * gas/i386/inval.l: Likewise. * gas/i386/x86_64.d: Likewise. * gas/i386/x86-64-inval.l: Likewise. opcodes/ 2008-01-14 H.J. Lu <hongjiu.lu@intel.com> * i386-gen.c (opcode_modifiers): Add IntelSyntax. (operand_types): Add Mem. * i386-opc.h (IntelSyntax): New. * i386-opc.h (Mem): New. (Byte): Updated. (Opcode_Modifier_Max): Updated. (i386_opcode_modifier): Add intelsyntax. (i386_operand_type): Add mem. * i386-opc.tbl: Remove Reg16 from movnti. Add sizes to more instructions. * i386-reg.tbl: Add size for accumulator. * i386-init.h: Regenerated. * i386-tbl.h: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog12
-rw-r--r--gas/config/tc-i386.c159
-rw-r--r--gas/testsuite/ChangeLog12
-rw-r--r--gas/testsuite/gas/i386/i386.d9
-rw-r--r--gas/testsuite/gas/i386/i386.s12
-rw-r--r--gas/testsuite/gas/i386/inval.l62
-rw-r--r--gas/testsuite/gas/i386/inval.s13
-rw-r--r--gas/testsuite/gas/i386/x86-64-inval.l76
-rw-r--r--gas/testsuite/gas/i386/x86-64-inval.s19
-rw-r--r--gas/testsuite/gas/i386/x86_64.d23
-rw-r--r--gas/testsuite/gas/i386/x86_64.s30
11 files changed, 341 insertions, 86 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5afae86..f789380 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,15 @@
+2008-01-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/tc-i386.c (match_reg_size): New.
+ (match_mem_size): Likewise.
+ (operand_size_match): Likewise.
+ (operand_type_match): Also clear all size fields.
+ (match_template): Skip Intel syntax when in AT&T syntax.
+ Call operand_size_match to check operand size.
+ (i386_att_operand): Set the mem field to 1 for memory
+ operand.
+ (i386_intel_operand): Likewise.
+
2008-01-12 H.J. Lu <hongjiu.lu@intel.com>
PR gas/5534
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 58d56f3..e7bbdc2 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1147,6 +1147,102 @@ operand_type_check (i386_operand_type t, enum operand_type c)
}
}
+/* Return 1 if there is no conflict in 8bit/16bit/32bit/64bit on
+ operand J for instruction template T. */
+
+static INLINE int
+match_reg_size (const template *t, unsigned int j)
+{
+ return !((i.types[j].bitfield.byte
+ && !t->operand_types[j].bitfield.byte)
+ || (i.types[j].bitfield.word
+ && !t->operand_types[j].bitfield.word)
+ || (i.types[j].bitfield.dword
+ && !t->operand_types[j].bitfield.dword)
+ || (i.types[j].bitfield.qword
+ && !t->operand_types[j].bitfield.qword));
+}
+
+/* Return 1 if there is no conflict in any size on operand J for
+ instruction template T. */
+
+static INLINE int
+match_mem_size (const template *t, unsigned int j)
+{
+ return (match_reg_size (t, j)
+ && !((i.types[j].bitfield.unspecified
+ && !t->operand_types[j].bitfield.unspecified)
+ || (i.types[j].bitfield.fword
+ && !t->operand_types[j].bitfield.fword)
+ || (i.types[j].bitfield.tbyte
+ && !t->operand_types[j].bitfield.tbyte)
+ || (i.types[j].bitfield.xmmword
+ && !t->operand_types[j].bitfield.xmmword)));
+}
+
+/* Return 1 if there is no size conflict on any operands for
+ instruction template T. */
+
+static INLINE int
+operand_size_match (const template *t)
+{
+ unsigned int j;
+ int match = 1;
+
+ /* Don't check jump instructions. */
+ if (t->opcode_modifier.jump
+ || t->opcode_modifier.jumpbyte
+ || t->opcode_modifier.jumpdword
+ || t->opcode_modifier.jumpintersegment)
+ return match;
+
+ /* Check memory and accumulator operand size. */
+ for (j = 0; j < i.operands; j++)
+ {
+ if (t->operand_types[j].bitfield.anysize)
+ continue;
+
+ if (t->operand_types[j].bitfield.acc && !match_reg_size (t, j))
+ {
+ match = 0;
+ break;
+ }
+
+ if (i.types[j].bitfield.mem && !match_mem_size (t, j))
+ {
+ match = 0;
+ break;
+ }
+ }
+
+ if (match
+ || (!t->opcode_modifier.d && !t->opcode_modifier.floatd))
+ return match;
+
+ /* Check reverse. */
+ assert (i.operands == 2);
+
+ match = 1;
+ for (j = 0; j < 2; j++)
+ {
+ if (t->operand_types[j].bitfield.acc
+ && !match_reg_size (t, j ? 0 : 1))
+ {
+ match = 0;
+ break;
+ }
+
+ if (i.types[j].bitfield.mem
+ && !match_mem_size (t, j ? 0 : 1))
+ {
+ match = 0;
+ break;
+ }
+ }
+
+ return match;
+}
+
static INLINE int
operand_type_match (i386_operand_type overlap,
i386_operand_type given)
@@ -1155,6 +1251,13 @@ operand_type_match (i386_operand_type overlap,
temp.bitfield.jumpabsolute = 0;
temp.bitfield.unspecified = 0;
+ temp.bitfield.byte = 0;
+ temp.bitfield.word = 0;
+ temp.bitfield.dword = 0;
+ temp.bitfield.fword = 0;
+ temp.bitfield.qword = 0;
+ temp.bitfield.tbyte = 0;
+ temp.bitfield.xmmword = 0;
if (UINTS_ALL_ZERO (temp))
return 0;
@@ -2970,7 +3073,6 @@ match_template (void)
unsigned int j;
unsigned int found_cpu_match;
unsigned int check_register;
- unsigned int size_match;
#if MAX_OPERANDS != 4
# error "MAX_OPERANDS must be 4."
@@ -3014,8 +3116,9 @@ match_template (void)
if (intel_mnemonic && t->opcode_modifier.attmnemonic)
continue;
- /* Check Intel syntax. */
- if (intel_syntax && t->opcode_modifier.attsyntax)
+ /* Check AT&T syntax Intel syntax. */
+ if ((intel_syntax && t->opcode_modifier.attsyntax)
+ || (!intel_syntax && t->opcode_modifier.intelsyntax))
continue;
/* Check the suffix, except for some instructions in intel mode. */
@@ -3028,52 +3131,12 @@ match_template (void)
|| (t->opcode_modifier.no_ldsuf && suffix_check.no_ldsuf)))
continue;
- size_match = 1;
- for (j = 0; j < MAX_OPERANDS; j++)
- {
- operand_types[j] = t->operand_types[j];
-
- /* Check memory and accumulator operand size. We check
- operand_types for accumulator, and both operand_types
- and i.types for memory. */
- if (j < i.operands
- && !operand_types[j].bitfield.anysize
- && ((operand_types[j].bitfield.acc
- && ((i.types[j].bitfield.byte
- && !operand_types[j].bitfield.byte)
- || (i.types[j].bitfield.word
- && !operand_types[j].bitfield.word)
- || (i.types[j].bitfield.dword
- && !operand_types[j].bitfield.dword)
- || (i.types[j].bitfield.qword
- && !operand_types[j].bitfield.qword)))
- || (operand_types[j].bitfield.baseindex
- && i.types[j].bitfield.baseindex
- && ((i.types[j].bitfield.unspecified
- && !operand_types[j].bitfield.unspecified)
- || (i.types[j].bitfield.byte
- && !operand_types[j].bitfield.byte)
- || (i.types[j].bitfield.word
- && !operand_types[j].bitfield.word)
- || (i.types[j].bitfield.dword
- && !operand_types[j].bitfield.dword)
- || (i.types[j].bitfield.fword
- && !operand_types[j].bitfield.fword)
- || (i.types[j].bitfield.qword
- && !operand_types[j].bitfield.qword)
- || (i.types[j].bitfield.tbyte
- && !operand_types[j].bitfield.tbyte)
- || (i.types[j].bitfield.xmmword
- && !operand_types[j].bitfield.xmmword)))))
- {
- size_match = 0;
- break;
- }
- }
-
- if (!size_match)
+ if (!operand_size_match (t))
continue;
+ for (j = 0; j < MAX_OPERANDS; j++)
+ operand_types[j] = t->operand_types[j];
+
/* In general, don't allow 64-bit operands in 32-bit mode. */
if (i.suffix == QWORD_MNEM_SUFFIX
&& flag_code != CODE_64BIT
@@ -6364,6 +6427,7 @@ i386_att_operand (char *operand_string)
if (i386_index_check (operand_string) == 0)
return 0;
+ i.types[this_operand].bitfield.mem = 1;
i.mem_operands++;
}
else
@@ -7845,6 +7909,7 @@ i386_intel_operand (char *operand_string, int got_a_float)
else
{
char *s = intel_parser.disp;
+ i.types[this_operand].bitfield.mem = 1;
i.mem_operands++;
if (!quiet_warnings && intel_parser.is_mem < 0)
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 60c8fee..ec623c0 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2008-01-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gas/i386/i386.s: Add tests for movsx, movzx and movnti.
+ * gas/i386/inval.s: Likewise.
+ * gas/i386/x86_64.s: Likewise.
+ * gas/i386/x86-64-inval.s: Likewise.
+
+ * gas/i386/i386.d: Updated.
+ * gas/i386/inval.l: Likewise.
+ * gas/i386/x86_64.d: Likewise.
+ * gas/i386/x86-64-inval.l: Likewise.
+
2008-01-12 H.J. Lu <hongjiu.lu@intel.com>
PR gas/5534
diff --git a/gas/testsuite/gas/i386/i386.d b/gas/testsuite/gas/i386/i386.d
index d5a23c1..cb4eca0 100644
--- a/gas/testsuite/gas/i386/i386.d
+++ b/gas/testsuite/gas/i386/i386.d
@@ -23,6 +23,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f b6 10 movzbl \(%eax\),%edx
[ ]*[a-f0-9]+: 66 0f b6 10 movzbw \(%eax\),%dx
[ ]*[a-f0-9]+: 0f b7 10 movzwl \(%eax\),%edx
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%eax\)
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%eax\)
[ ]*[a-f0-9]+: df e0 fnstsw %ax
[ ]*[a-f0-9]+: df e0 fnstsw %ax
[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
@@ -37,4 +39,11 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f3 0f 7e 0c 24 movq \(%esp\),%xmm1
[ ]*[a-f0-9]+: 66 0f d6 0c 24 movq %xmm1,\(%esp\)
[ ]*[a-f0-9]+: 66 0f d6 0c 24 movq %xmm1,\(%esp\)
+[ ]*[a-f0-9]+: 66 0f be 00 movsbw \(%eax\),%ax
+[ ]*[a-f0-9]+: 0f be 00 movsbl \(%eax\),%eax
+[ ]*[a-f0-9]+: 0f bf 00 movswl \(%eax\),%eax
+[ ]*[a-f0-9]+: 66 0f b6 00 movzbw \(%eax\),%ax
+[ ]*[a-f0-9]+: 0f b6 00 movzbl \(%eax\),%eax
+[ ]*[a-f0-9]+: 0f b7 00 movzwl \(%eax\),%eax
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%eax\)
#pass
diff --git a/gas/testsuite/gas/i386/i386.s b/gas/testsuite/gas/i386/i386.s
index cee44a6..5d5bda9 100644
--- a/gas/testsuite/gas/i386/i386.s
+++ b/gas/testsuite/gas/i386/i386.s
@@ -21,6 +21,9 @@
movzbw (%eax), %dx
movzwl (%eax), %edx
+ movnti %eax, (%eax)
+ movntil %eax, (%eax)
+
.intel_syntax noprefix
fnstsw
fnstsw ax
@@ -39,3 +42,12 @@
movq xmm1,[esp]
movq QWORD PTR [esp],xmm1
movq [esp],xmm1
+
+movsx ax, byte ptr [eax]
+movsx eax, byte ptr [eax]
+movsx eax, word ptr [eax]
+movzx ax, byte ptr [eax]
+movzx eax, byte ptr [eax]
+movzx eax, word ptr [eax]
+
+movnti dword ptr [eax], eax
diff --git a/gas/testsuite/gas/i386/inval.l b/gas/testsuite/gas/i386/inval.l
index 53616b8..4a13a15 100644
--- a/gas/testsuite/gas/i386/inval.l
+++ b/gas/testsuite/gas/i386/inval.l
@@ -53,12 +53,10 @@
.*:54: Error: .*
.*:55: Error: .*
.*:56: Error: .*
+.*:58: Error: .*
.*:59: Error: .*
-.*:60: Error: .*
.*:61: Error: .*
.*:62: Error: .*
-.*:63: Error: .*
-.*:64: Error: .*
.*:65: Error: .*
.*:66: Error: .*
.*:67: Error: .*
@@ -69,6 +67,17 @@
.*:72: Error: .*
.*:73: Error: .*
.*:74: Error: .*
+.*:75: Error: .*
+.*:76: Error: .*
+.*:77: Error: .*
+.*:78: Error: .*
+.*:79: Error: .*
+.*:80: Error: .*
+.*:82: Error: .*
+.*:83: Error: .*
+.*:84: Error: .*
+.*:85: Error: .*
+.*:87: Error: .*
GAS LISTING .*
@@ -132,20 +141,33 @@ GAS LISTING .*
GAS LISTING .*
-[ ]*58[ ]+\.intel_syntax noprefix
-[ ]*59[ ]+cvtsi2ss xmm1,QWORD PTR \[eax\]
-[ ]*60[ ]+cvtsi2sd xmm1,QWORD PTR \[eax\]
-[ ]*61[ ]+cvtsi2ssq xmm1,QWORD PTR \[eax\]
-[ ]*62[ ]+cvtsi2sdq xmm1,QWORD PTR \[eax\]
-[ ]*63[ ]+movq xmm1, XMMWORD PTR \[esp\]
-[ ]*64[ ]+movq xmm1, DWORD PTR \[esp\]
-[ ]*65[ ]+movq xmm1, WORD PTR \[esp\]
-[ ]*66[ ]+movq xmm1, BYTE PTR \[esp\]
-[ ]*67[ ]+movq XMMWORD PTR \[esp\],xmm1
-[ ]*68[ ]+movq DWORD PTR \[esp\],xmm1
-[ ]*69[ ]+movq WORD PTR \[esp\],xmm1
-[ ]*70[ ]+movq BYTE PTR \[esp\],xmm1
-[ ]*71[ ]+fnstsw eax
-[ ]*72[ ]+fnstsw al
-[ ]*73[ ]+fstsw eax
-[ ]*74[ ]+fstsw al
+[ ]*58[ ]+movsxw \(%eax\),%eax
+[ ]*59[ ]+movzxw \(%eax\),%eax
+[ ]*60[ ]+
+[ ]*61[ ]+movnti %ax, \(%eax\)
+[ ]*62[ ]+movntiw %ax, \(%eax\)
+[ ]*63[ ]+
+[ ]*64[ ]+\.intel_syntax noprefix
+[ ]*65[ ]+cvtsi2ss xmm1,QWORD PTR \[eax\]
+[ ]*66[ ]+cvtsi2sd xmm1,QWORD PTR \[eax\]
+[ ]*67[ ]+cvtsi2ssq xmm1,QWORD PTR \[eax\]
+[ ]*68[ ]+cvtsi2sdq xmm1,QWORD PTR \[eax\]
+[ ]*69[ ]+movq xmm1, XMMWORD PTR \[esp\]
+[ ]*70[ ]+movq xmm1, DWORD PTR \[esp\]
+[ ]*71[ ]+movq xmm1, WORD PTR \[esp\]
+[ ]*72[ ]+movq xmm1, BYTE PTR \[esp\]
+[ ]*73[ ]+movq XMMWORD PTR \[esp\],xmm1
+[ ]*74[ ]+movq DWORD PTR \[esp\],xmm1
+[ ]*75[ ]+movq WORD PTR \[esp\],xmm1
+[ ]*76[ ]+movq BYTE PTR \[esp\],xmm1
+[ ]*77[ ]+fnstsw eax
+[ ]*78[ ]+fnstsw al
+[ ]*79[ ]+fstsw eax
+[ ]*80[ ]+fstsw al
+[ ]*81[ ]+
+[ ]*82[ ]+movsx ax, \[eax\]
+[ ]*83[ ]+movsx eax, \[eax\]
+[ ]*84[ ]+movzx ax, \[eax\]
+[ ]*85[ ]+movzx eax, \[eax\]
+[ ]*86[ ]+
+[ ]*87[ ]+movnti word ptr \[eax\], ax
diff --git a/gas/testsuite/gas/i386/inval.s b/gas/testsuite/gas/i386/inval.s
index b966af3..7047f86 100644
--- a/gas/testsuite/gas/i386/inval.s
+++ b/gas/testsuite/gas/i386/inval.s
@@ -55,6 +55,12 @@ foo: jaw foo
fstsw %eax
fstsw %al
+movsxw (%eax),%eax
+movzxw (%eax),%eax
+
+movnti %ax, (%eax)
+movntiw %ax, (%eax)
+
.intel_syntax noprefix
cvtsi2ss xmm1,QWORD PTR [eax]
cvtsi2sd xmm1,QWORD PTR [eax]
@@ -72,3 +78,10 @@ foo: jaw foo
fnstsw al
fstsw eax
fstsw al
+
+movsx ax, [eax]
+movsx eax, [eax]
+movzx ax, [eax]
+movzx eax, [eax]
+
+movnti word ptr [eax], ax
diff --git a/gas/testsuite/gas/i386/x86-64-inval.l b/gas/testsuite/gas/i386/x86-64-inval.l
index c567a13..1aafd6e 100644
--- a/gas/testsuite/gas/i386/x86-64-inval.l
+++ b/gas/testsuite/gas/i386/x86-64-inval.l
@@ -55,6 +55,8 @@
.*:56: Error: .*
.*:57: Error: .*
.*:58: Error: .*
+.*:59: Error: .*
+.*:60: Error: .*
.*:61: Error: .*
.*:62: Error: .*
.*:63: Error: .*
@@ -65,11 +67,28 @@
.*:68: Error: .*
.*:69: Error: .*
.*:70: Error: .*
-.*:71: Error: .*
-.*:72: Error: .*
.*:73: Error: .*
.*:74: Error: .*
.*:75: Error: .*
+.*:76: Error: .*
+.*:77: Error: .*
+.*:78: Error: .*
+.*:79: Error: .*
+.*:80: Error: .*
+.*:81: Error: .*
+.*:82: Error: .*
+.*:83: Error: .*
+.*:84: Error: .*
+.*:85: Error: .*
+.*:86: Error: .*
+.*:87: Error: .*
+.*:88: Error: .*
+.*:89: Error: .*
+.*:90: Error: .*
+.*:91: Error: .*
+.*:92: Error: .*
+.*:93: Error: .*
+.*:94: Error: .*
GAS LISTING .*
@@ -134,20 +153,39 @@ GAS LISTING .*
[ ]*58[ ]+out %rax,\$8
-[ ]*59[ ]+
-[ ]*60[ ]+\.intel_syntax noprefix
-[ ]*61[ ]+cmpxchg16b dword ptr \[rax\] \# Must be oword
-[ ]*62[ ]+movq xmm1, XMMWORD PTR \[rsp\]
-[ ]*63[ ]+movq xmm1, DWORD PTR \[rsp\]
-[ ]*64[ ]+movq xmm1, WORD PTR \[rsp\]
-[ ]*65[ ]+movq xmm1, BYTE PTR \[rsp\]
-[ ]*66[ ]+movq XMMWORD PTR \[rsp\],xmm1
-[ ]*67[ ]+movq DWORD PTR \[rsp\],xmm1
-[ ]*68[ ]+movq WORD PTR \[rsp\],xmm1
-[ ]*69[ ]+movq BYTE PTR \[rsp\],xmm1
-[ ]*70[ ]+fnstsw eax
-[ ]*71[ ]+fnstsw al
-[ ]*72[ ]+fstsw eax
-[ ]*73[ ]+fstsw al
-[ ]*74[ ]+in rax,8
-[ ]*75[ ]+out 8,rax
+[ ]*59[ ]+movsxb \(%rax\),%eax
+[ ]*60[ ]+movsxb \(%rax\),%rax
+[ ]*61[ ]+movsxw \(%rax\),%eax
+[ ]*62[ ]+movsxw \(%rax\),%rax
+[ ]*63[ ]+movsxl \(%rax\),%rax
+[ ]*64[ ]+movzxb \(%rax\),%eax
+[ ]*65[ ]+movzxb \(%rax\),%rax
+[ ]*66[ ]+movzxw \(%rax\),%eax
+[ ]*67[ ]+movzxw \(%rax\),%rax
+[ ]*68[ ]+movzxl \(%rax\),%rax
+[ ]*69[ ]+movnti %ax, \(%rax\)
+[ ]*70[ ]+movntiw %ax, \(%rax\)
+[ ]*71[ ]+
+[ ]*72[ ]+\.intel_syntax noprefix
+[ ]*73[ ]+cmpxchg16b dword ptr \[rax\] \# Must be oword
+[ ]*74[ ]+movq xmm1, XMMWORD PTR \[rsp\]
+[ ]*75[ ]+movq xmm1, DWORD PTR \[rsp\]
+[ ]*76[ ]+movq xmm1, WORD PTR \[rsp\]
+[ ]*77[ ]+movq xmm1, BYTE PTR \[rsp\]
+[ ]*78[ ]+movq XMMWORD PTR \[rsp\],xmm1
+[ ]*79[ ]+movq DWORD PTR \[rsp\],xmm1
+[ ]*80[ ]+movq WORD PTR \[rsp\],xmm1
+[ ]*81[ ]+movq BYTE PTR \[rsp\],xmm1
+[ ]*82[ ]+fnstsw eax
+[ ]*83[ ]+fnstsw al
+[ ]*84[ ]+fstsw eax
+[ ]*85[ ]+fstsw al
+[ ]*86[ ]+in rax,8
+[ ]*87[ ]+out 8,rax
+[ ]*88[ ]+movsx ax, \[rax\]
+[ ]*89[ ]+movsx eax, \[rax\]
+[ ]*90[ ]+movsx rax, \[rax\]
+[ ]*91[ ]+movzx ax, \[rax\]
+[ ]*92[ ]+movzx eax, \[rax\]
+[ ]*93[ ]+movzx rax, \[rax\]
+[ ]*94[ ]+movnti word ptr \[rax\], ax
diff --git a/gas/testsuite/gas/i386/x86-64-inval.s b/gas/testsuite/gas/i386/x86-64-inval.s
index 30407e8..cc3d38f 100644
--- a/gas/testsuite/gas/i386/x86-64-inval.s
+++ b/gas/testsuite/gas/i386/x86-64-inval.s
@@ -56,6 +56,18 @@ foo: jcxz foo # No prefix exists to select CX as a counter
fstsw %al
in $8,%rax
out %rax,$8
+movsxb (%rax),%eax
+movsxb (%rax),%rax
+movsxw (%rax),%eax
+movsxw (%rax),%rax
+movsxl (%rax),%rax
+movzxb (%rax),%eax
+movzxb (%rax),%rax
+movzxw (%rax),%eax
+movzxw (%rax),%rax
+movzxl (%rax),%rax
+movnti %ax, (%rax)
+movntiw %ax, (%rax)
.intel_syntax noprefix
cmpxchg16b dword ptr [rax] # Must be oword
@@ -73,3 +85,10 @@ foo: jcxz foo # No prefix exists to select CX as a counter
fstsw al
in rax,8
out 8,rax
+movsx ax, [rax]
+movsx eax, [rax]
+movsx rax, [rax]
+movzx ax, [rax]
+movzx eax, [rax]
+movzx rax, [rax]
+movnti word ptr [rax], ax
diff --git a/gas/testsuite/gas/i386/x86_64.d b/gas/testsuite/gas/i386/x86_64.d
index 4e9536c..6875c50 100644
--- a/gas/testsuite/gas/i386/x86_64.d
+++ b/gas/testsuite/gas/i386/x86_64.d
@@ -199,4 +199,27 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: df e0 fnstsw %ax
[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
+[ ]*[a-f0-9]+: 66 0f be 00 movsbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f be 00 movsbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f be 00 movsbq \(%rax\),%rax
+[ ]*[a-f0-9]+: 48 63 00 movslq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f b6 00 movzbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f b6 00 movzbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f b6 00 movzbq \(%rax\),%rax
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%rax\)
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%rax\)
+[ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\)
+[ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\)
+[ ]*[a-f0-9]+: 66 0f be 00 movsbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f be 00 movsbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 0f bf 00 movswl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f bf 00 movswq \(%rax\),%rax
+[ ]*[a-f0-9]+: 48 63 00 movslq \(%rax\),%rax
+[ ]*[a-f0-9]+: 48 63 00 movslq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f b6 00 movzbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f b6 00 movzbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 0f b7 00 movzwl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f b7 00 movzwq \(%rax\),%rax
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%rax\)
+[ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\)
#pass
diff --git a/gas/testsuite/gas/i386/x86_64.s b/gas/testsuite/gas/i386/x86_64.s
index d107b12..06a75b6 100644
--- a/gas/testsuite/gas/i386/x86_64.s
+++ b/gas/testsuite/gas/i386/x86_64.s
@@ -244,3 +244,33 @@ cmpxchg16b oword ptr [rax]
fnstsw ax
fstsw
fstsw ax
+
+.att_syntax
+movsx (%rax),%ax
+movsx (%rax),%eax
+movsx (%rax),%rax
+movsxd (%rax),%rax
+movzx (%rax),%ax
+movzx (%rax),%eax
+movzx (%rax),%rax
+
+movnti %eax, (%rax)
+movntil %eax, (%rax)
+movnti %rax, (%rax)
+movntiq %rax, (%rax)
+
+.intel_syntax noprefix
+
+movsx ax, BYTE PTR [rax]
+movsx eax, BYTE PTR [rax]
+movsx eax, WORD PTR [rax]
+movsx rax, WORD PTR [rax]
+movsx rax, DWORD PTR [rax]
+movsxd rax, [rax]
+movzx ax, BYTE PTR [rax]
+movzx eax, BYTE PTR [rax]
+movzx eax, WORD PTR [rax]
+movzx rax, WORD PTR [rax]
+
+movnti dword ptr [rax], eax
+movnti qword ptr [rax], rax