[PATCH] D15711: [X86][PKU] Add {RD,WR}PKRU encoding
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 24 00:28:28 PST 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL256366: [X86][PKU] Add {RD,WR}PKRU encoding (authored by abadouh).
Changed prior to commit:
http://reviews.llvm.org/D15711?vs=43527&id=43587#toc
Repository:
rL LLVM
http://reviews.llvm.org/D15711
Files:
llvm/trunk/include/llvm/IR/IntrinsicsX86.td
llvm/trunk/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
llvm/trunk/lib/Target/X86/X86InstrSystem.td
llvm/trunk/test/MC/X86/X86_64-pku.s
llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp
Index: llvm/trunk/include/llvm/IR/IntrinsicsX86.td
===================================================================
--- llvm/trunk/include/llvm/IR/IntrinsicsX86.td
+++ llvm/trunk/include/llvm/IR/IntrinsicsX86.td
@@ -3897,6 +3897,14 @@
}
//===----------------------------------------------------------------------===//
+// Support protection key
+let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
+ def int_x86_rdpkru : GCCBuiltin <"__builtin_ia32_rdpkru">,
+ Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>;
+ def int_x86_wrpkru : GCCBuiltin<"__builtin_ia32_wrpkru">,
+ Intrinsic<[], [llvm_i32_ty], [IntrNoMem]>;
+}
+//===----------------------------------------------------------------------===//
// Half float conversion
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
Index: llvm/trunk/test/MC/X86/X86_64-pku.s
===================================================================
--- llvm/trunk/test/MC/X86/X86_64-pku.s
+++ llvm/trunk/test/MC/X86/X86_64-pku.s
@@ -0,0 +1,8 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown -mattr=+pku --show-encoding < %s | FileCheck %s
+// CHECK: rdpkru
+// CHECK: encoding: [0x0f,0x01,0xee]
+ rdpkru
+
+// CHECK: wrpkru
+// CHECK: encoding: [0x0f,0x01,0xef]
+ wrpkru
\ No newline at end of file
Index: llvm/trunk/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
===================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
@@ -707,12 +707,12 @@
case X86II::MRM_E3: case X86II::MRM_E4: case X86II::MRM_E5:
case X86II::MRM_E8: case X86II::MRM_E9: case X86II::MRM_EA:
case X86II::MRM_EB: case X86II::MRM_EC: case X86II::MRM_ED:
- case X86II::MRM_EE: case X86II::MRM_F0: case X86II::MRM_F1:
- case X86II::MRM_F2: case X86II::MRM_F3: case X86II::MRM_F4:
- case X86II::MRM_F5: case X86II::MRM_F6: case X86II::MRM_F7:
- case X86II::MRM_F8: case X86II::MRM_F9: case X86II::MRM_FA:
- case X86II::MRM_FB: case X86II::MRM_FC: case X86II::MRM_FD:
- case X86II::MRM_FE: case X86II::MRM_FF:
+ case X86II::MRM_EE: case X86II::MRM_EF: case X86II::MRM_F0:
+ case X86II::MRM_F1: case X86II::MRM_F2: case X86II::MRM_F3:
+ case X86II::MRM_F4: case X86II::MRM_F5: case X86II::MRM_F6:
+ case X86II::MRM_F7: case X86II::MRM_F8: case X86II::MRM_F9:
+ case X86II::MRM_FA: case X86II::MRM_FB: case X86II::MRM_FC:
+ case X86II::MRM_FD: case X86II::MRM_FE: case X86II::MRM_FF:
return -1;
}
}
Index: llvm/trunk/lib/Target/X86/X86InstrSystem.td
===================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSystem.td
+++ llvm/trunk/lib/Target/X86/X86InstrSystem.td
@@ -549,6 +549,12 @@
}
let Defs = [RAX, RDX, RSI], Uses = [RAX, RSI] in
def MONTMUL : I<0xa6, MRM_C0, (outs), (ins), "montmul", []>, TB;
+//==-----------------------------------------------------------------------===//
+// PKU - enable protection key
+let Defs = [EAX, EDX], Uses = [ECX] in
+ def RDPKRU : I<0x01, MRM_EE, (outs), (ins), "rdpkru", []>, TB;
+let Uses = [EAX, ECX, EDX] in
+ def WRPKRU : I<0x01, MRM_EF, (outs), (ins), "wrpkru", []>, TB;
//===----------------------------------------------------------------------===//
// FS/GS Base Instructions
Index: llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp
===================================================================
--- llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp
+++ llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp
@@ -796,12 +796,12 @@
case X86Local::MRM_E3: case X86Local::MRM_E4: case X86Local::MRM_E5:
case X86Local::MRM_E8: case X86Local::MRM_E9: case X86Local::MRM_EA:
case X86Local::MRM_EB: case X86Local::MRM_EC: case X86Local::MRM_ED:
- case X86Local::MRM_EE: case X86Local::MRM_F0: case X86Local::MRM_F1:
- case X86Local::MRM_F2: case X86Local::MRM_F3: case X86Local::MRM_F4:
- case X86Local::MRM_F5: case X86Local::MRM_F6: case X86Local::MRM_F7:
- case X86Local::MRM_F9: case X86Local::MRM_FA: case X86Local::MRM_FB:
- case X86Local::MRM_FC: case X86Local::MRM_FD: case X86Local::MRM_FE:
- case X86Local::MRM_FF:
+ case X86Local::MRM_EE: case X86Local::MRM_EF: case X86Local::MRM_F0:
+ case X86Local::MRM_F1: case X86Local::MRM_F2: case X86Local::MRM_F3:
+ case X86Local::MRM_F4: case X86Local::MRM_F5: case X86Local::MRM_F6:
+ case X86Local::MRM_F7: case X86Local::MRM_F9: case X86Local::MRM_FA:
+ case X86Local::MRM_FB: case X86Local::MRM_FC: case X86Local::MRM_FD:
+ case X86Local::MRM_FE: case X86Local::MRM_FF:
// Ignored.
break;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15711.43587.patch
Type: text/x-patch
Size: 4669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151224/914b186e/attachment.bin>
More information about the llvm-commits
mailing list