Reverting r117031 to cleanup valgrind errors.
It doesn't look like anything is wrong with the checkin,
but the new test cases expose a mem bug in AsmParser.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117087 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 975d46f..4aad817 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -703,7 +703,6 @@
     .Case("fwait", "wait")
     .Case("movzx", "movzb")  // FIXME: Not correct.
     .Case("fildq", "fildll")
-    .Case("ud2a", "ud2")
     .Default(Name);
 
   // FIXME: Hack to recognize cmp<comparison code>{ss,sd,ps,pd}.
@@ -1176,10 +1175,9 @@
 
   // First, handle aliases that expand to multiple instructions.
   // FIXME: This should be replaced with a real .td file alias mechanism.
-  if (Op->getToken() == "fstsw" || Op->getToken() == "fstsww" ||
-      Op->getToken() == "fstcw" || Op->getToken() == "fstcww" ||
+  if (Op->getToken() == "fstsw" || Op->getToken() == "fstcw" ||
       Op->getToken() == "finit" || Op->getToken() == "fsave" ||
-      Op->getToken() == "fstenv" || Op->getToken() == "fclex") {
+      Op->getToken() == "fstenv") {
     MCInst Inst;
     Inst.setOpcode(X86::WAIT);
     Out.EmitInstruction(Inst);
@@ -1189,11 +1187,8 @@
         .Case("finit", "fninit")
         .Case("fsave", "fnsave")
         .Case("fstcw", "fnstcw")
-        .Case("fstcww", "fnstcw")
         .Case("fstenv", "fnstenv")
         .Case("fstsw", "fnstsw")
-        .Case("fstsww", "fnstsw")
-        .Case("fclex", "fnclex")
         .Default(0);
     assert(Repl && "Unknown wait-prefixed instruction");
     delete Operands[0];
diff --git a/lib/Target/X86/X86InstrFPStack.td b/lib/Target/X86/X86InstrFPStack.td
index 57634d3..0087e48 100644
--- a/lib/Target/X86/X86InstrFPStack.td
+++ b/lib/Target/X86/X86InstrFPStack.td
@@ -340,7 +340,7 @@
 
 def FRSTORm  : FPI<0xDD, MRM4m, (outs f32mem:$dst), (ins), "frstor\t$dst">;
 def FSAVEm   : FPI<0xDD, MRM6m, (outs f32mem:$dst), (ins), "fnsave\t$dst">;
-def FNSTSWm  : FPI<0xDD, MRM7m, (outs f32mem:$dst), (ins), "fnstsw{w}\t$dst">;
+def FNSTSWm  : FPI<0xDD, MRM7m, (outs f32mem:$dst), (ins), "fnstsw\t$dst">;
 
 def FICOM16m : FPI<0xDE, MRM2m, (outs), (ins i16mem:$src), "ficom{s}\t$src">;
 def FICOMP16m: FPI<0xDE, MRM3m, (outs), (ins i16mem:$src), "ficomp{s}\t$src">;
@@ -600,12 +600,12 @@
                   (outs), (ins), "fnstsw %ax", []>, DF;
 
 def FNSTCW16m : I<0xD9, MRM7m,                   // [mem16] = X87 control world
-                  (outs), (ins i16mem:$dst), "fnstcw{w}\t$dst",
+                  (outs), (ins i16mem:$dst), "fnstcw\t$dst",
                   [(X86fp_cwd_get16 addr:$dst)]>;
                   
 let mayLoad = 1 in
 def FLDCW16m  : I<0xD9, MRM5m,                   // X87 control world = [mem16]
-                  (outs), (ins i16mem:$dst), "fldcw{w}\t$dst", []>;
+                  (outs), (ins i16mem:$dst), "fldcw\t$dst", []>;
 
 // FPU control instructions
 def FNINIT : I<0xE3, RawFrm, (outs), (ins), "fninit", []>, DB;
diff --git a/lib/Target/X86/X86InstrSystem.td b/lib/Target/X86/X86InstrSystem.td
index 835794d..48b6d6e 100644
--- a/lib/Target/X86/X86InstrSystem.td
+++ b/lib/Target/X86/X86InstrSystem.td
@@ -310,13 +310,13 @@
 
 
 def VERRr : I<0x00, MRM4r, (outs), (ins GR16:$seg),
-              "verr{w}\t$seg", []>, TB;
+              "verr\t$seg", []>, TB;
 def VERRm : I<0x00, MRM4m, (outs), (ins i16mem:$seg),
-              "verr{w}\t$seg", []>, TB;
+              "verr\t$seg", []>, TB;
 def VERWr : I<0x00, MRM5r, (outs), (ins GR16:$seg),
-              "verw{w}\t$seg", []>, TB;
+              "verw\t$seg", []>, TB;
 def VERWm : I<0x00, MRM5m, (outs), (ins i16mem:$seg),
-              "verw{w}\t$seg", []>, TB;
+              "verw\t$seg", []>, TB;
 
 //===----------------------------------------------------------------------===//
 // Descriptor-table support instructions
diff --git a/test/MC/X86/x86-32-coverage.s b/test/MC/X86/x86-32-coverage.s
index 856a59d..f97fc4b 100644
--- a/test/MC/X86/x86-32-coverage.s
+++ b/test/MC/X86/x86-32-coverage.s
@@ -474,10 +474,10 @@
 // CHECK: 	fabs
         	fabs
 
-// CHECK: 	fldcww	3735928559(%ebx,%ecx,8)
+// CHECK: 	fldcw	3735928559(%ebx,%ecx,8)
         	fldcw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: 	fnstcww	3735928559(%ebx,%ecx,8)
+// CHECK: 	fnstcw	3735928559(%ebx,%ecx,8)
         	fnstcw	0xdeadbeef(%ebx,%ecx,8)
 
 // CHECK: 	rdtsc
@@ -3702,35 +3702,35 @@
 // CHECK:  encoding: [0x0f,0x00,0x0d,0xed,0x7e,0x00,0x00]
         	strw	0x7eed
 
-// CHECK: verrw	%bx
+// CHECK: verr	%bx
 // CHECK:  encoding: [0x0f,0x00,0xe3]
         	verr	%bx
 
-// CHECK: verrw	3735928559(%ebx,%ecx,8)
+// CHECK: verr	3735928559(%ebx,%ecx,8)
 // CHECK:  encoding: [0x0f,0x00,0xa4,0xcb,0xef,0xbe,0xad,0xde]
         	verr	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: verrw	3133065982
+// CHECK: verr	3133065982
 // CHECK:  encoding: [0x0f,0x00,0x25,0xfe,0xca,0xbe,0xba]
         	verr	0xbabecafe
 
-// CHECK: verrw	305419896
+// CHECK: verr	305419896
 // CHECK:  encoding: [0x0f,0x00,0x25,0x78,0x56,0x34,0x12]
         	verr	0x12345678
 
-// CHECK: verww	%bx
+// CHECK: verw	%bx
 // CHECK:  encoding: [0x0f,0x00,0xeb]
         	verw	%bx
 
-// CHECK: verww	3735928559(%ebx,%ecx,8)
+// CHECK: verw	3735928559(%ebx,%ecx,8)
 // CHECK:  encoding: [0x0f,0x00,0xac,0xcb,0xef,0xbe,0xad,0xde]
         	verw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: verww	3133065982
+// CHECK: verw	3133065982
 // CHECK:  encoding: [0x0f,0x00,0x2d,0xfe,0xca,0xbe,0xba]
         	verw	0xbabecafe
 
-// CHECK: verww	305419896
+// CHECK: verw	305419896
 // CHECK:  encoding: [0x0f,0x00,0x2d,0x78,0x56,0x34,0x12]
         	verw	0x12345678
 
@@ -4290,39 +4290,39 @@
 // CHECK:  encoding: [0xdb,0xe3]
         	fninit
 
-// CHECK: fldcww	3735928559(%ebx,%ecx,8)
+// CHECK: fldcw	3735928559(%ebx,%ecx,8)
 // CHECK:  encoding: [0xd9,0xac,0xcb,0xef,0xbe,0xad,0xde]
         	fldcw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: fldcww	3133065982
+// CHECK: fldcw	3133065982
 // CHECK:  encoding: [0xd9,0x2d,0xfe,0xca,0xbe,0xba]
         	fldcw	0xbabecafe
 
-// CHECK: fldcww	305419896
+// CHECK: fldcw	305419896
 // CHECK:  encoding: [0xd9,0x2d,0x78,0x56,0x34,0x12]
         	fldcw	0x12345678
 
-// CHECK: fnstcww	3735928559(%ebx,%ecx,8)
+// CHECK: fnstcw	3735928559(%ebx,%ecx,8)
 // CHECK:  encoding: [0xd9,0xbc,0xcb,0xef,0xbe,0xad,0xde]
         	fnstcw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: fnstcww	3133065982
+// CHECK: fnstcw	3133065982
 // CHECK:  encoding: [0xd9,0x3d,0xfe,0xca,0xbe,0xba]
         	fnstcw	0xbabecafe
 
-// CHECK: fnstcww	305419896
+// CHECK: fnstcw	305419896
 // CHECK:  encoding: [0xd9,0x3d,0x78,0x56,0x34,0x12]
         	fnstcw	0x12345678
 
-// CHECK: fnstsww	3735928559(%ebx,%ecx,8)
+// CHECK: fnstsw	3735928559(%ebx,%ecx,8)
 // CHECK:  encoding: [0xdd,0xbc,0xcb,0xef,0xbe,0xad,0xde]
         	fnstsw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: fnstsww	3133065982
+// CHECK: fnstsw	3133065982
 // CHECK:  encoding: [0xdd,0x3d,0xfe,0xca,0xbe,0xba]
         	fnstsw	0xbabecafe
 
-// CHECK: fnstsww	305419896
+// CHECK: fnstsw	305419896
 // CHECK:  encoding: [0xdd,0x3d,0x78,0x56,0x34,0x12]
         	fnstsw	0x12345678
 
@@ -13553,28 +13553,28 @@
 // CHECK: 	strw	32493
         	strw	0x7eed
 
-// CHECK: 	verrw	%bx
+// CHECK: 	verr	%bx
         	verr	%bx
 
-// CHECK: 	verrw	3735928559(%ebx,%ecx,8)
+// CHECK: 	verr	3735928559(%ebx,%ecx,8)
         	verr	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: 	verrw	3133065982
+// CHECK: 	verr	3133065982
         	verr	0xbabecafe
 
-// CHECK: 	verrw	305419896
+// CHECK: 	verr	305419896
         	verr	0x12345678
 
-// CHECK: 	verww	%bx
+// CHECK: 	verw	%bx
         	verw	%bx
 
-// CHECK: 	verww	3735928559(%ebx,%ecx,8)
+// CHECK: 	verw	3735928559(%ebx,%ecx,8)
         	verw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: 	verww	3133065982
+// CHECK: 	verw	3133065982
         	verw	0xbabecafe
 
-// CHECK: 	verww	305419896
+// CHECK: 	verw	305419896
         	verw	0x12345678
 
 // CHECK: 	fld	%st(2)
@@ -14012,31 +14012,31 @@
 // CHECK: 	fninit
         	fninit
 
-// CHECK: 	fldcww	3735928559(%ebx,%ecx,8)
+// CHECK: 	fldcw	3735928559(%ebx,%ecx,8)
         	fldcw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: 	fldcww	3133065982
+// CHECK: 	fldcw	3133065982
         	fldcw	0xbabecafe
 
-// CHECK: 	fldcww	305419896
+// CHECK: 	fldcw	305419896
         	fldcw	0x12345678
 
-// CHECK: 	fnstcww	3735928559(%ebx,%ecx,8)
+// CHECK: 	fnstcw	3735928559(%ebx,%ecx,8)
         	fnstcw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: 	fnstcww	3133065982
+// CHECK: 	fnstcw	3133065982
         	fnstcw	0xbabecafe
 
-// CHECK: 	fnstcww	305419896
+// CHECK: 	fnstcw	305419896
         	fnstcw	0x12345678
 
-// CHECK: 	fnstsww	3735928559(%ebx,%ecx,8)
+// CHECK: 	fnstsw	3735928559(%ebx,%ecx,8)
         	fnstsw	0xdeadbeef(%ebx,%ecx,8)
 
-// CHECK: 	fnstsww	3133065982
+// CHECK: 	fnstsw	3133065982
         	fnstsw	0xbabecafe
 
-// CHECK: 	fnstsww	305419896
+// CHECK: 	fnstsw	305419896
         	fnstsw	0x12345678
 
 // CHECK: 	fnclex
diff --git a/test/MC/X86/x86-32.s b/test/MC/X86/x86-32.s
index 4c59aa7..c474b1c 100644
--- a/test/MC/X86/x86-32.s
+++ b/test/MC/X86/x86-32.s
@@ -702,67 +702,3 @@
 // CHECK: sidt	4(%eax)
 // CHECK:  encoding: [0x0f,0x01,0x48,0x04]
         	sidtl	4(%eax)
-
-// CHECK: verrw	2(%eax)
-// CHECK:  encoding: [0x0f,0x00,0x60,0x02]
-        	verrw	2(%eax)
-
-// CHECK: verrw	2(%eax)
-// CHECK:  encoding: [0x0f,0x00,0x60,0x02]
-        	verr	2(%eax)
-
-// CHECK: verrw	%bx
-// CHECK:  encoding: [0x0f,0x00,0xe3]
-        	verrw	%bx
-
-// CHECK: verrw	%bx
-// CHECK:  encoding: [0x0f,0x00,0xe3]
-        	verr	%bx
-
-// CHECK: verww	2(%eax)
-// CHECK:  encoding: [0x0f,0x00,0x68,0x02]
-        	verww	2(%eax)
-
-// CHECK: verww	2(%eax)
-// CHECK:  encoding: [0x0f,0x00,0x68,0x02]
-        	verw	2(%eax)
-
-// CHECK: verww	%bx
-// CHECK:  encoding: [0x0f,0x00,0xeb]
-        	verww	%bx
-
-// CHECK: verww	%bx
-// CHECK:  encoding: [0x0f,0x00,0xeb]
-        	verw	%bx
-
-// CHECK: fldcww	6(%ecx)
-// CHECK:  encoding: [0xd9,0x69,0x06]
-        	fldcw	6(%ecx)
-
-// CHECK: fldcww	6(%ecx)
-// CHECK:  encoding: [0xd9,0x69,0x06]
-        	fldcww	6(%ecx)
-
-// CHECK: fnstcww	6(%ecx)
-// CHECK:  encoding: [0xd9,0x79,0x06]
-        	fnstcw	6(%ecx)
-
-// CHECK: fnstcww	6(%ecx)
-// CHECK:  encoding: [0xd9,0x79,0x06]
-        	fnstcww	6(%ecx)
-
-// CHECK: wait
-// CHECK:  encoding: [0x9b]
-        	fstsw	%ax
-
-// CHECK: wait
-// CHECK:  encoding: [0x9b]
-        	fstsww	0x7eed
-
-// CHECK: wait
-// CHECK:  encoding: [0x9b]
-        	fclex
-
-// CHECK: ud2
-// CHECK:  encoding: [0x0f,0x0b]
-        	ud2a
diff --git a/test/MC/X86/x86-64.s b/test/MC/X86/x86-64.s
index 2df3d13..a115b34 100644
--- a/test/MC/X86/x86-64.s
+++ b/test/MC/X86/x86-64.s
@@ -427,17 +427,17 @@
 // CHECK: fnstsw %ax
 fstsw (%rax)
 // CHECK: wait
-// CHECK: fnstsww (%rax)
+// CHECK: fnstsw (%rax)
 
 // PR8259
 fstcw (%rsp)
 // CHECK: wait
-// CHECK: fnstcww (%rsp)
+// CHECK: fnstcw (%rsp)
 
 // PR8259
 fstcw (%rsp)
 // CHECK: wait
-// CHECK: fnstcww (%rsp)
+// CHECK: fnstcw (%rsp)
 
 // PR8258
 finit