mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Propagate CPU string out of SubtargetFeatures
llvm-svn: 72335
This commit is contained in:
parent
ccae25d83b
commit
34fc85e2ee
@ -86,6 +86,9 @@ public:
|
||||
/// Setting CPU string only if no string is set.
|
||||
void setCPUIfNone(const std::string &String);
|
||||
|
||||
/// Returns current CPU string.
|
||||
const std::string & getCPU() const;
|
||||
|
||||
/// Adding Features.
|
||||
void AddFeature(const std::string &String, bool IsEnabled = true);
|
||||
|
||||
|
@ -23,14 +23,13 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
|
||||
, UseThumbBacktraces(false)
|
||||
, IsR9Reserved(false)
|
||||
, stackAlignment(4)
|
||||
, CPUString("generic")
|
||||
, TargetType(isELF) // Default to ELF unless otherwise specified.
|
||||
, TargetABI(ARM_ABI_APCS) {
|
||||
|
||||
// Determine default and user specified characteristics
|
||||
std::string CPU = "generic";
|
||||
|
||||
// Parse features string.
|
||||
ParseSubtargetFeatures(FS, CPU);
|
||||
CPUString = ParseSubtargetFeatures(FS, CPUString);
|
||||
|
||||
// Set the boolean corresponding to the current target triple, or the default
|
||||
// if one cannot be determined, to true.
|
||||
|
@ -47,6 +47,9 @@ protected:
|
||||
/// entry to the function and which must be maintained by every function.
|
||||
unsigned stackAlignment;
|
||||
|
||||
/// CPUString - String name of used CPU.
|
||||
std::string CPUString;
|
||||
|
||||
public:
|
||||
enum {
|
||||
isELF, isDarwin
|
||||
@ -71,7 +74,8 @@ protected:
|
||||
}
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
bool hasV4TOps() const { return ARMArchVersion >= V4T; }
|
||||
bool hasV5TOps() const { return ARMArchVersion >= V5T; }
|
||||
@ -91,6 +95,8 @@ protected:
|
||||
bool useThumbBacktraces() const { return UseThumbBacktraces; }
|
||||
bool isR9Reserved() const { return IsR9Reserved; }
|
||||
|
||||
const std::string & getCPUString() const { return CPUString; }
|
||||
|
||||
/// getStackAlignment - Returns the minimum alignment known to hold of the
|
||||
/// stack frame on entry to the function and which must be maintained by every
|
||||
/// function for this subtarget.
|
||||
|
@ -37,7 +37,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
bool hasCT() const { return HasCT; }
|
||||
};
|
||||
|
@ -59,7 +59,8 @@ namespace llvm {
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
/// SetJITMode - This is called to inform the subtarget info that we are
|
||||
/// producing code for the JIT.
|
||||
|
@ -33,7 +33,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
};
|
||||
} // End llvm namespace
|
||||
|
||||
|
@ -109,7 +109,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
bool hasMips2Ops() const { return MipsArchVersion >= Mips2; }
|
||||
|
||||
|
@ -37,7 +37,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
};
|
||||
} // End llvm namespace
|
||||
|
||||
|
@ -86,7 +86,9 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
|
||||
/// SetJITMode - This is called to inform the subtarget info that we are
|
||||
/// producing code for the JIT.
|
||||
|
@ -33,7 +33,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
};
|
||||
|
||||
|
@ -199,6 +199,13 @@ void SubtargetFeatures::setCPUIfNone(const std::string &String) {
|
||||
if (Features[0].empty()) setCPU(String);
|
||||
}
|
||||
|
||||
/// getCPU - Returns current CPU.
|
||||
///
|
||||
const std::string & SubtargetFeatures::getCPU() const {
|
||||
return Features[0];
|
||||
}
|
||||
|
||||
|
||||
/// SetImpliedBits - For each feature that is (transitively) implied by this
|
||||
/// feature, set it.
|
||||
///
|
||||
|
@ -108,7 +108,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
|
||||
/// AutoDetectSubtargetFeatures - Auto-detect CPU features using CPUID
|
||||
/// instruction.
|
||||
|
@ -38,7 +38,8 @@ public:
|
||||
|
||||
/// ParseSubtargetFeatures - Parses features string setting specified
|
||||
/// subtarget options. Definition of function is auto generated by tblgen.
|
||||
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||
const std::string &CPU);
|
||||
};
|
||||
} // End llvm namespace
|
||||
|
||||
|
@ -451,7 +451,7 @@ void SubtargetEmitter::ParseFeaturesFunction(std::ostream &OS) {
|
||||
|
||||
OS << "// ParseSubtargetFeatures - Parses features string setting specified\n"
|
||||
<< "// subtarget options.\n"
|
||||
<< "void llvm::";
|
||||
<< "std::string llvm::";
|
||||
OS << Target;
|
||||
OS << "Subtarget::ParseSubtargetFeatures(const std::string &FS,\n"
|
||||
<< " const std::string &CPU) {\n"
|
||||
@ -482,7 +482,8 @@ void SubtargetEmitter::ParseFeaturesFunction(std::ostream &OS) {
|
||||
<< " InstrItins = InstrItineraryData(Stages, Itinerary);\n";
|
||||
}
|
||||
|
||||
OS << "}\n";
|
||||
OS << " return Features.getCPU();\n"
|
||||
<< "}\n";
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user