mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Break out subtarget initialization that dependent variables need into
a separate function and clean up calling convention for helper function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212153 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
110493f99d
commit
290a59d9ec
@ -60,11 +60,9 @@ Mips16ConstantIslands(
|
|||||||
|
|
||||||
/// Select the Mips CPU for the given triple and cpu name.
|
/// Select the Mips CPU for the given triple and cpu name.
|
||||||
/// FIXME: Merge with the copy in MipsMCTargetDesc.cpp
|
/// FIXME: Merge with the copy in MipsMCTargetDesc.cpp
|
||||||
static inline StringRef selectMipsCPU(StringRef TT, StringRef CPU) {
|
static StringRef selectMipsCPU(Triple TT, StringRef CPU) {
|
||||||
if (CPU.empty() || CPU == "generic") {
|
if (CPU.empty() || CPU == "generic") {
|
||||||
Triple TheTriple(TT);
|
if (TT.getArch() == Triple::mips || TT.getArch() == Triple::mipsel)
|
||||||
if (TheTriple.getArch() == Triple::mips ||
|
|
||||||
TheTriple.getArch() == Triple::mipsel)
|
|
||||||
CPU = "mips32";
|
CPU = "mips32";
|
||||||
else
|
else
|
||||||
CPU = "mips64";
|
CPU = "mips64";
|
||||||
@ -86,10 +84,8 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
|
|||||||
InMicroMipsMode(false), HasDSP(false), HasDSPR2(false),
|
InMicroMipsMode(false), HasDSP(false), HasDSPR2(false),
|
||||||
AllowMixed16_32(Mixed16_32 | Mips_Os16), Os16(Mips_Os16), HasMSA(false),
|
AllowMixed16_32(Mixed16_32 | Mips_Os16), Os16(Mips_Os16), HasMSA(false),
|
||||||
RM(_RM), OverrideMode(NoOverride), TM(_TM), TargetTriple(TT), JITInfo() {
|
RM(_RM), OverrideMode(NoOverride), TM(_TM), TargetTriple(TT), JITInfo() {
|
||||||
std::string CPUName = selectMipsCPU(TT, CPU);
|
|
||||||
|
|
||||||
// Parse features string.
|
initializeSubtargetDependencies(CPU, FS);
|
||||||
ParseSubtargetFeatures(CPUName, FS);
|
|
||||||
|
|
||||||
if (InMips16Mode && !TM->Options.UseSoftFloat) {
|
if (InMips16Mode && !TM->Options.UseSoftFloat) {
|
||||||
// Hard float for mips16 means essentially to compile as soft float
|
// Hard float for mips16 means essentially to compile as soft float
|
||||||
@ -103,9 +99,6 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
|
|||||||
|
|
||||||
PreviousInMips16Mode = InMips16Mode;
|
PreviousInMips16Mode = InMips16Mode;
|
||||||
|
|
||||||
// Initialize scheduling itinerary for the specified CPU.
|
|
||||||
InstrItins = getInstrItineraryForCPU(CPUName);
|
|
||||||
|
|
||||||
// Don't even attempt to generate code for MIPS-I, MIPS-II, MIPS-III, and
|
// Don't even attempt to generate code for MIPS-I, MIPS-II, MIPS-III, and
|
||||||
// MIPS-V. They have not been tested and currently exist for the integrated
|
// MIPS-V. They have not been tested and currently exist for the integrated
|
||||||
// assembler only.
|
// assembler only.
|
||||||
@ -166,6 +159,17 @@ MipsSubtarget::enablePostRAScheduler(CodeGenOpt::Level OptLevel,
|
|||||||
return OptLevel >= CodeGenOpt::Aggressive;
|
return OptLevel >= CodeGenOpt::Aggressive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MipsSubtarget &MipsSubtarget::initializeSubtargetDependencies(StringRef CPU,
|
||||||
|
StringRef FS) {
|
||||||
|
std::string CPUName = selectMipsCPU(TargetTriple, CPU);
|
||||||
|
|
||||||
|
// Parse features string.
|
||||||
|
ParseSubtargetFeatures(CPUName, FS);
|
||||||
|
// Initialize scheduling itinerary for the specified CPU.
|
||||||
|
InstrItins = getInstrItineraryForCPU(CPUName);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//FIXME: This logic for reseting the subtarget along with
|
//FIXME: This logic for reseting the subtarget along with
|
||||||
// the helper classes can probably be simplified but there are a lot of
|
// the helper classes can probably be simplified but there are a lot of
|
||||||
// cases so we will defer rewriting this to later.
|
// cases so we will defer rewriting this to later.
|
||||||
|
@ -245,6 +245,8 @@ public:
|
|||||||
/// \brief Reset the subtarget for the Mips target.
|
/// \brief Reset the subtarget for the Mips target.
|
||||||
void resetSubtarget(MachineFunction *MF);
|
void resetSubtarget(MachineFunction *MF);
|
||||||
|
|
||||||
|
MipsSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
|
||||||
|
|
||||||
/// Does the system support unaligned memory access.
|
/// Does the system support unaligned memory access.
|
||||||
///
|
///
|
||||||
/// MIPS32r6/MIPS64r6 require full unaligned access support but does not
|
/// MIPS32r6/MIPS64r6 require full unaligned access support but does not
|
||||||
|
Loading…
Reference in New Issue
Block a user