aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-15 04:45:10 +0000
committerChris Lattner <sabre@nondot.org>2010-09-15 04:45:10 +0000
commit6c1b3b1e32f960f44e47d8484510f5c5f8e5343f (patch)
tree88c7e0e42673a698a114f3d1ae8ea269c60b0713
parentcfad564043021c7276ce19725f43bcde233fa549 (diff)
fix the encoding of sldt GR16 to have the 0x66 prefix, and
add sldt GR32, which isn't documented in the intel manual but which gas accepts. Part of rdar://8418316 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113938 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.td4
-rw-r--r--test/MC/AsmParser/X86/x86_instructions.s11
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 216d0f10e7..462acb681e 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -4359,9 +4359,11 @@ def SGDTm : I<0x01, MRM0m, (outs opaque48mem:$dst), (ins),
def SIDTm : I<0x01, MRM1m, (outs opaque48mem:$dst), (ins),
"sidt\t$dst", []>, TB;
def SLDT16r : I<0x00, MRM0r, (outs GR16:$dst), (ins),
- "sldt{w}\t$dst", []>, TB;
+ "sldt{w}\t$dst", []>, TB, OpSize;
def SLDT16m : I<0x00, MRM0m, (outs i16mem:$dst), (ins),
"sldt{w}\t$dst", []>, TB;
+def SLDT32r : I<0x00, MRM0r, (outs GR32:$dst), (ins),
+ "sldt{l}\t$dst", []>, TB;
def LGDTm : I<0x01, MRM2m, (outs), (ins opaque48mem:$src),
"lgdt\t$src", []>, TB;
def LIDTm : I<0x01, MRM3m, (outs), (ins opaque48mem:$src),
diff --git a/test/MC/AsmParser/X86/x86_instructions.s b/test/MC/AsmParser/X86/x86_instructions.s
index 0f0c1ed76a..16b1aac619 100644
--- a/test/MC/AsmParser/X86/x86_instructions.s
+++ b/test/MC/AsmParser/X86/x86_instructions.s
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -triple x86_64-unknown-unknown %s > %t 2> %t.err
+// RUN: llvm-mc -triple x86_64-unknown-unknown -show-encoding %s > %t 2> %t.err
// RUN: FileCheck < %t %s
// RUN: FileCheck --check-prefix=CHECK-STDERR < %t.err %s
@@ -279,3 +279,12 @@ shld %bx,%bx
shld $1, %bx,%bx
shrd %bx,%bx
shrd $1, %bx,%bx
+
+// CHECK: sldtl %ecx
+// CHECK: encoding: [0x0f,0x00,0xc1]
+// CHECK: sldtw %cx
+// CHECK: encoding: [0x66,0x0f,0x00,0xc1]
+
+sldt %ecx
+sldt %cx
+