]> granicus.if.org Git - llvm/commitdiff
[X86] Add RDPID instruction for assembler and disassembler.
authorCraig Topper <craig.topper@intel.com>
Mon, 23 Oct 2017 15:53:16 +0000 (15:53 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 23 Oct 2017 15:53:16 +0000 (15:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316332 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrSystem.td
test/MC/Disassembler/X86/simple-tests.txt
test/MC/Disassembler/X86/x86-32.txt
test/MC/X86/x86-32.s
test/MC/X86/x86-64.s

index 2cde6c02e95cd608974c23b4555207ff606945c5..05e47163c6866c0e642d52ca9400a13732e20f26 100644 (file)
@@ -2195,13 +2195,13 @@ let Predicates = [HasRDRAND], Defs = [EFLAGS] in {
 let Predicates = [HasRDSEED], Defs = [EFLAGS] in {
   def RDSEED16r : I<0xC7, MRM7r, (outs GR16:$dst), (ins),
                     "rdseed{w}\t$dst",
-                    [(set GR16:$dst, EFLAGS, (X86rdseed))]>, OpSize16, TB;
+                    [(set GR16:$dst, EFLAGS, (X86rdseed))]>, OpSize16, PS;
   def RDSEED32r : I<0xC7, MRM7r, (outs GR32:$dst), (ins),
                     "rdseed{l}\t$dst",
-                    [(set GR32:$dst, EFLAGS, (X86rdseed))]>, OpSize32, TB;
+                    [(set GR32:$dst, EFLAGS, (X86rdseed))]>, OpSize32, PS;
   def RDSEED64r : RI<0xC7, MRM7r, (outs GR64:$dst), (ins),
                      "rdseed{q}\t$dst",
-                     [(set GR64:$dst, EFLAGS, (X86rdseed))]>, TB;
+                     [(set GR64:$dst, EFLAGS, (X86rdseed))]>, PS;
 }
 
 //===----------------------------------------------------------------------===//
index e9b6c6785bc9cc23ced0400cc249eaf4a3bf636c..c95aa28615207ca03ab629a9efcbfbc3903d546a 100644 (file)
@@ -635,3 +635,12 @@ let Defs = [EFLAGS] in {
 let Uses = [RAX, RBX, RCX, RDX], Defs = [RAX, RBX, RCX] in {
   def GETSEC : I<0x37, RawFrm, (outs), (ins), "getsec", []>, TB;
 }
+
+//===----------------------------------------------------------------------===//
+// RDPID Instruction
+def RDPID32 : I<0xC7, MRM7r, (outs GR32:$src), (ins),
+              "rdpid\t$src", []>, XS,
+              Requires<[Not64BitMode]>;
+def RDPID64 : I<0xC7, MRM7r, (outs GR64:$src), (ins),
+              "rdpid\t$src", []>, XS,
+              Requires<[In64BitMode]>;
index 620f249197031a219746fec4d88fe66b682516f8..86d9f92fbbfa423dcb7010bddd8f07cc2e7093fe 100644 (file)
 0x8f 0xe9 0x78 0x80 0x09
 # CHECK: vfrczps %ymm2, %ymm4
 0x8f 0xe9 0x7c 0x80 0xe2
+
+# CHECK: rdpid %rax
+0xf3 0x0f 0xc7 0xf8
index bf73338ed4f914843c3605795c9564b9ae114964..b069de2fd515d348b5cc403b01a656dbdc0a848b 100644 (file)
 0x2e 0x67 0x66 0x89 0x1c
 # CHECK: movw    %bx, %cs:(%si)
 0x2e 0x66 0x67 0x89 0x1c
+
+# CHECK: rdpid %eax
+0xf3 0x0f 0xc7 0xf8
index 6cba31adbb4802da9a0602ebf83619dc201044e0..80acbba6ce8d651db045403e776a6493f0e38889 100644 (file)
@@ -1097,3 +1097,7 @@ data16
 // CHECK: lgdtl 4(%eax)
 // CHECK:  encoding: [0x0f,0x01,0x50,0x04]
 data16 lgdt 4(%eax)
+
+// CHECK: rdpid %eax
+// CHECK: encoding: [0xf3,0x0f,0xc7,0xf8]
+rdpid %eax
index d697428a2c0ee7e66883e2040a31e8ac17cb637c..96d775270b5d0106c05f9c15cffd70e84c0ceb96 100644 (file)
@@ -1527,3 +1527,7 @@ nopq      0xdeadbeef(%rbx,%rcx,8)
 // CHECK: nopq %rax
 // CHECK:  encoding: [0x48,0x0f,0x1f,0xc0]
 nopq   %rax
+
+// CHECK: rdpid %rax
+// CHECK: encoding: [0xf3,0x0f,0xc7,0xf8]
+rdpid %rax