Tweaks to X86 instructions to allow the 'w' suffix in places it makes
authorKevin Enderby <enderby@apple.com>
Wed, 27 Oct 2010 02:32:19 +0000 (02:32 +0000)
committerKevin Enderby <enderby@apple.com>
Wed, 27 Oct 2010 02:32:19 +0000 (02:32 +0000)
sense, when the instruction takes the 16-bit ax register or m16 memory
location.  These changes to llvm-mc matches what the darwin assembler
allows for these instructions.  Done differently than in r117031 that
caused a valgrind error which was later reverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117433 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/X86/x86-32.s

index 9bf0f6415eb2b147ce42bf4f368aa1670b7b66a9..2890cb1dee582c4ee3fbc9a292e423de816115c1 100644 (file)
@@ -705,6 +705,12 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
     .Case("fildq", "fildll")
     .Case("fcompi", "fcomip")
     .Case("fucompi", "fucomip")
+    .Case("fldcww", "fldcw")
+    .Case("fnstcww", "fnstcw")
+    .Case("fstcww", "fstcw")
+    .Case("fnstsww", "fnstsw")
+    .Case("fstsww", "fstsw")
+    .Case("verrw", "verr")
     .Default(Name);
 
   // FIXME: Hack to recognize cmp<comparison code>{ss,sd,ps,pd}.
index 9bce1a8da29fab00ef13abc238e062aa6ee9c4c8..590f9681c3e9651a7906a6c5d2248c3e53539e69 100644 (file)
@@ -726,3 +726,51 @@ pshufw $90, %mm4, %mm0
 // CHECK: fucomip      %st(1), %st(0)
 // CHECK:  encoding: [0xdf,0xe9]
                fucompi
+
+// CHECK: fldcw        32493
+// CHECK:  encoding: [0xd9,0x2d,0xed,0x7e,0x00,0x00]
+               fldcww  0x7eed
+
+// CHECK: fldcw        32493
+// CHECK:  encoding: [0xd9,0x2d,0xed,0x7e,0x00,0x00]
+               fldcw   0x7eed
+
+// CHECK: fnstcw       32493
+// CHECK:  encoding: [0xd9,0x3d,0xed,0x7e,0x00,0x00]
+               fnstcww 0x7eed
+
+// CHECK: fnstcw       32493
+// CHECK:  encoding: [0xd9,0x3d,0xed,0x7e,0x00,0x00]
+               fnstcw  0x7eed
+
+// CHECK: wait
+// CHECK:  encoding: [0x9b]
+               fstcww  0x7eed
+
+// CHECK: wait
+// CHECK:  encoding: [0x9b]
+               fstcw   0x7eed
+
+// CHECK: fnstsw       32493
+// CHECK:  encoding: [0xdd,0x3d,0xed,0x7e,0x00,0x00]
+               fnstsww 0x7eed
+
+// CHECK: fnstsw       32493
+// CHECK:  encoding: [0xdd,0x3d,0xed,0x7e,0x00,0x00]
+               fnstsw  0x7eed
+
+// CHECK: wait
+// CHECK:  encoding: [0x9b]
+               fstsww  0x7eed
+
+// CHECK: wait
+// CHECK:  encoding: [0x9b]
+               fstsw   0x7eed
+
+// CHECK: verr 32493
+// CHECK:  encoding: [0x0f,0x00,0x25,0xed,0x7e,0x00,0x00]
+               verrw   0x7eed
+
+// CHECK: verr 32493
+// CHECK:  encoding: [0x0f,0x00,0x25,0xed,0x7e,0x00,0x00]
+               verr    0x7eed