diff options
| -rw-r--r-- | llvm/lib/Target/BPF/BPF.td | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/BPF/BPFSubtarget.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/BPF/BPFSubtarget.h | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/BPF/BPF.td b/llvm/lib/Target/BPF/BPF.td index 2d0c22a3a51..b8c2298584c 100644 --- a/llvm/lib/Target/BPF/BPF.td +++ b/llvm/lib/Target/BPF/BPF.td @@ -26,6 +26,9 @@ def : Proc<"probe", []>; def DummyFeature : SubtargetFeature<"dummy", "isDummyMode", "true", "unused feature">; +def ALU32 : SubtargetFeature<"alu32", "HasAlu32", "true", + "Enable ALU32 instructions">; + def BPFInstPrinter : AsmWriter { string AsmWriterClassName = "InstPrinter"; bit isMCAsmWriter = 1; diff --git a/llvm/lib/Target/BPF/BPFSubtarget.cpp b/llvm/lib/Target/BPF/BPFSubtarget.cpp index 42ca87f9ef6..2bb07032304 100644 --- a/llvm/lib/Target/BPF/BPFSubtarget.cpp +++ b/llvm/lib/Target/BPF/BPFSubtarget.cpp @@ -30,11 +30,13 @@ BPFSubtarget &BPFSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) { initializeEnvironment(); initSubtargetFeatures(CPU, FS); + ParseSubtargetFeatures(CPU, FS); return *this; } void BPFSubtarget::initializeEnvironment() { HasJmpExt = false; + HasAlu32 = false; } void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { diff --git a/llvm/lib/Target/BPF/BPFSubtarget.h b/llvm/lib/Target/BPF/BPFSubtarget.h index fa1f24443bc..4fbd4b00181 100644 --- a/llvm/lib/Target/BPF/BPFSubtarget.h +++ b/llvm/lib/Target/BPF/BPFSubtarget.h @@ -47,6 +47,9 @@ protected: // whether the cpu supports jmp ext bool HasJmpExt; + // whether the cpu supports alu32 instructions. + bool HasAlu32; + public: // This constructor initializes the data members to match that // of the specified triple. @@ -59,6 +62,7 @@ public: // subtarget options. Definition of function is auto generated by tblgen. void ParseSubtargetFeatures(StringRef CPU, StringRef FS); bool getHasJmpExt() const { return HasJmpExt; } + bool getHasAlu32() const { return HasAlu32; } const BPFInstrInfo *getInstrInfo() const override { return &InstrInfo; } const BPFFrameLowering *getFrameLowering() const override { |

