From e23f91a412cd4b9b702dad7aa3522daf8a4e2e1b Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 29 Aug 2017 23:13:36 +0000 Subject: [PATCH] [X86] Finish the subtarget and predicate implementation of CLWB. We don't have an intrinsic implemented for this instruction yet, but it looked odd that we were missing the accessor method from the subtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312064 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrInfo.td | 4 ++++ lib/Target/X86/X86Subtarget.h | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index f20841bd02e..1c7e84de522 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -872,6 +872,7 @@ def FPStackf32 : Predicate<"!Subtarget->hasSSE1()">; def FPStackf64 : Predicate<"!Subtarget->hasSSE2()">; def HasMPX : Predicate<"Subtarget->hasMPX()">; def HasCLFLUSHOPT : Predicate<"Subtarget->hasCLFLUSHOPT()">; +def HasCLWB : Predicate<"Subtarget->hasCLWB()">; def HasCmpxchg16b: Predicate<"Subtarget->hasCmpxchg16b()">; def Not64BitMode : Predicate<"!Subtarget->is64Bit()">, AssemblerPredicate<"!Mode64Bit", "Not 64-bit mode">; @@ -2718,6 +2719,9 @@ let Predicates = [HasTBM] in { let Predicates = [HasCLFLUSHOPT] in def CLFLUSHOPT : I<0xAE, MRM7m, (outs), (ins i8mem:$src), "clflushopt\t$src", [(int_x86_clflushopt addr:$src)]>, PD; + +// TODO: Add an instrincis for this. +let Predicates = [HasCLWB] in def CLWB : I<0xAE, MRM6m, (outs), (ins i8mem:$src), "clwb\t$src", []>, PD; diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h index e1e1cdfb8da..8b869022d76 100644 --- a/lib/Target/X86/X86Subtarget.h +++ b/lib/Target/X86/X86Subtarget.h @@ -507,6 +507,7 @@ public: bool hasPKU() const { return HasPKU; } bool hasMPX() const { return HasMPX; } bool hasCLFLUSHOPT() const { return HasCLFLUSHOPT; } + bool hasCLWB() const { return HasCLWB; } bool isXRaySupported() const override { return is64Bit(); } -- 2.50.1