diff options
Diffstat (limited to 'llvm/lib/Target/MBlaze')
-rw-r--r-- | llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeSubtarget.h | 6 | ||||
-rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeTargetMachine.h | 2 |
5 files changed, 17 insertions, 12 deletions
diff --git a/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp b/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp index 190379657f4..15965964452 100644 --- a/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp +++ b/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp @@ -86,8 +86,9 @@ namespace { : MBlazeBaseAsmLexer(T, MAI) { std::string tripleString("mblaze-unknown-unknown"); std::string featureString; + std::string CPU; OwningPtr<const TargetMachine> - targetMachine(T.createTargetMachine(tripleString, featureString)); + targetMachine(T.createTargetMachine(tripleString, CPU, featureString)); InitRegisterMap(targetMachine->getRegisterInfo()); } }; diff --git a/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp b/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp index a80744a4769..034b5ce49c1 100644 --- a/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp +++ b/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp @@ -18,18 +18,22 @@ #include "llvm/Support/CommandLine.h" using namespace llvm; -MBlazeSubtarget::MBlazeSubtarget(const std::string &TT, const std::string &FS): +MBlazeSubtarget::MBlazeSubtarget(const std::string &TT, + const std::string &CPU, + const std::string &FS): HasBarrel(false), HasDiv(false), HasMul(false), HasPatCmp(false), HasFPU(false), HasMul64(false), HasSqrt(false) { // Parse features string. - std::string CPU = "mblaze"; - CPU = ParseSubtargetFeatures(FS, CPU); + std::string CPUName = CPU; + if (CPUName.empty()) + CPUName = "mblaze"; + ParseSubtargetFeatures(FS, CPUName); // Only use instruction scheduling if the selected CPU has an instruction // itinerary (the default CPU is the only one that doesn't). - HasItin = CPU != "mblaze"; - DEBUG(dbgs() << "CPU " << CPU << "(" << HasItin << ")\n"); + HasItin = CPUName != "mblaze"; + DEBUG(dbgs() << "CPU " << CPUName << "(" << HasItin << ")\n"); // Compute the issue width of the MBlaze itineraries computeIssueWidth(); diff --git a/llvm/lib/Target/MBlaze/MBlazeSubtarget.h b/llvm/lib/Target/MBlaze/MBlazeSubtarget.h index 342b2fb65d7..f5e0b4ce9b3 100644 --- a/llvm/lib/Target/MBlaze/MBlazeSubtarget.h +++ b/llvm/lib/Target/MBlaze/MBlazeSubtarget.h @@ -38,12 +38,12 @@ public: /// This constructor initializes the data members to match that /// of the specified triple. - MBlazeSubtarget(const std::string &TT, const std::string &FS); + MBlazeSubtarget(const std::string &TT, const std::string &CPU, + const std::string &FS); /// ParseSubtargetFeatures - Parses features string setting specified /// subtarget options. Definition of function is auto generated by tblgen. - std::string ParseSubtargetFeatures(const std::string &FS, - const std::string &CPU); + void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU); /// Compute the number of maximum number of issues per cycle for the /// MBlaze scheduling itineraries. diff --git a/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp b/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp index df34a83e33a..1cbd2d413b1 100644 --- a/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp +++ b/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp @@ -80,9 +80,9 @@ extern "C" void LLVMInitializeMBlazeTarget() { // an easier handling. MBlazeTargetMachine:: MBlazeTargetMachine(const Target &T, const std::string &TT, - const std::string &FS): + const std::string &CPU, const std::string &FS): LLVMTargetMachine(T, TT), - Subtarget(TT, FS), + Subtarget(TT, CPU, FS), DataLayout("E-p:32:32:32-i8:8:8-i16:16:16"), InstrInfo(*this), FrameLowering(Subtarget), diff --git a/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h b/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h index 48ce37a482f..cd6caafbf30 100644 --- a/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h +++ b/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h @@ -42,7 +42,7 @@ namespace llvm { public: MBlazeTargetMachine(const Target &T, const std::string &TT, - const std::string &FS); + const std::string &CPU, const std::string &FS); virtual const MBlazeInstrInfo *getInstrInfo() const { return &InstrInfo; } |