mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-03 16:21:41 +00:00
Reinitialize the ivars in the subtarget so that they can be reset with the new features.
llvm-svn: 175336
This commit is contained in:
parent
1062ec80b5
commit
fb87157cc8
lib/Target
test/CodeGen/X86
@ -45,51 +45,55 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
|
|||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: ARMGenSubtargetInfo(TT, CPU, FS)
|
: ARMGenSubtargetInfo(TT, CPU, FS)
|
||||||
, ARMProcFamily(Others)
|
, ARMProcFamily(Others)
|
||||||
, HasV4TOps(false)
|
|
||||||
, HasV5TOps(false)
|
|
||||||
, HasV5TEOps(false)
|
|
||||||
, HasV6Ops(false)
|
|
||||||
, HasV6T2Ops(false)
|
|
||||||
, HasV7Ops(false)
|
|
||||||
, HasVFPv2(false)
|
|
||||||
, HasVFPv3(false)
|
|
||||||
, HasVFPv4(false)
|
|
||||||
, HasNEON(false)
|
|
||||||
, UseNEONForSinglePrecisionFP(false)
|
|
||||||
, UseMulOps(UseFusedMulOps)
|
|
||||||
, SlowFPVMLx(false)
|
|
||||||
, HasVMLxForwarding(false)
|
|
||||||
, SlowFPBrcc(false)
|
|
||||||
, InThumbMode(false)
|
|
||||||
, HasThumb2(false)
|
|
||||||
, IsMClass(false)
|
|
||||||
, NoARM(false)
|
|
||||||
, PostRAScheduler(false)
|
|
||||||
, IsR9Reserved(ReserveR9)
|
|
||||||
, UseMovt(false)
|
|
||||||
, SupportsTailCall(false)
|
|
||||||
, HasFP16(false)
|
|
||||||
, HasD16(false)
|
|
||||||
, HasHardwareDivide(false)
|
|
||||||
, HasHardwareDivideInARM(false)
|
|
||||||
, HasT2ExtractPack(false)
|
|
||||||
, HasDataBarrier(false)
|
|
||||||
, Pref32BitThumb(false)
|
|
||||||
, AvoidCPSRPartialUpdate(false)
|
|
||||||
, AvoidMOVsShifterOperand(false)
|
|
||||||
, HasRAS(false)
|
|
||||||
, HasMPExtension(false)
|
|
||||||
, FPOnlySP(false)
|
|
||||||
, AllowsUnalignedMem(false)
|
|
||||||
, Thumb2DSP(false)
|
|
||||||
, UseNaClTrap(false)
|
|
||||||
, stackAlignment(4)
|
, stackAlignment(4)
|
||||||
, CPUString(CPU)
|
, CPUString(CPU)
|
||||||
, TargetTriple(TT)
|
, TargetTriple(TT)
|
||||||
, TargetABI(ARM_ABI_APCS) {
|
, TargetABI(ARM_ABI_APCS) {
|
||||||
|
initializeEnvironment();
|
||||||
resetSubtargetFeatures(CPU, FS);
|
resetSubtargetFeatures(CPU, FS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ARMSubtarget::initializeEnvironment() {
|
||||||
|
HasV4TOps = false;
|
||||||
|
HasV5TOps = false;
|
||||||
|
HasV5TEOps = false;
|
||||||
|
HasV6Ops = false;
|
||||||
|
HasV6T2Ops = false;
|
||||||
|
HasV7Ops = false;
|
||||||
|
HasVFPv2 = false;
|
||||||
|
HasVFPv3 = false;
|
||||||
|
HasVFPv4 = false;
|
||||||
|
HasNEON = false;
|
||||||
|
UseNEONForSinglePrecisionFP = false;
|
||||||
|
UseMulOps = UseFusedMulOps;
|
||||||
|
SlowFPVMLx = false;
|
||||||
|
HasVMLxForwarding = false;
|
||||||
|
SlowFPBrcc = false;
|
||||||
|
InThumbMode = false;
|
||||||
|
HasThumb2 = false;
|
||||||
|
IsMClass = false;
|
||||||
|
NoARM = false;
|
||||||
|
PostRAScheduler = false;
|
||||||
|
IsR9Reserved = ReserveR9;
|
||||||
|
UseMovt = false;
|
||||||
|
SupportsTailCall = false;
|
||||||
|
HasFP16 = false;
|
||||||
|
HasD16 = false;
|
||||||
|
HasHardwareDivide = false;
|
||||||
|
HasHardwareDivideInARM = false;
|
||||||
|
HasT2ExtractPack = false;
|
||||||
|
HasDataBarrier = false;
|
||||||
|
Pref32BitThumb = false;
|
||||||
|
AvoidCPSRPartialUpdate = false;
|
||||||
|
AvoidMOVsShifterOperand = false;
|
||||||
|
HasRAS = false;
|
||||||
|
HasMPExtension = false;
|
||||||
|
FPOnlySP = false;
|
||||||
|
AllowsUnalignedMem = false;
|
||||||
|
Thumb2DSP = false;
|
||||||
|
UseNaClTrap = false;
|
||||||
|
}
|
||||||
|
|
||||||
void ARMSubtarget::resetSubtargetFeatures(const MachineFunction *MF) {
|
void ARMSubtarget::resetSubtargetFeatures(const MachineFunction *MF) {
|
||||||
AttributeSet FnAttrs = MF->getFunction()->getAttributes();
|
AttributeSet FnAttrs = MF->getFunction()->getAttributes();
|
||||||
Attribute CPUAttr = FnAttrs.getAttribute(AttributeSet::FunctionIndex,
|
Attribute CPUAttr = FnAttrs.getAttribute(AttributeSet::FunctionIndex,
|
||||||
@ -100,8 +104,10 @@ void ARMSubtarget::resetSubtargetFeatures(const MachineFunction *MF) {
|
|||||||
!CPUAttr.hasAttribute(Attribute::None) ?CPUAttr.getValueAsString() : "";
|
!CPUAttr.hasAttribute(Attribute::None) ?CPUAttr.getValueAsString() : "";
|
||||||
std::string FS =
|
std::string FS =
|
||||||
!FSAttr.hasAttribute(Attribute::None) ? FSAttr.getValueAsString() : "";
|
!FSAttr.hasAttribute(Attribute::None) ? FSAttr.getValueAsString() : "";
|
||||||
if (!FS.empty())
|
if (!FS.empty()) {
|
||||||
|
initializeEnvironment();
|
||||||
resetSubtargetFeatures(CPU, FS);
|
resetSubtargetFeatures(CPU, FS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
|
void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
|
||||||
|
@ -204,8 +204,10 @@ protected:
|
|||||||
|
|
||||||
/// \brief Reset the features for the X86 target.
|
/// \brief Reset the features for the X86 target.
|
||||||
virtual void resetSubtargetFeatures(const MachineFunction *MF);
|
virtual void resetSubtargetFeatures(const MachineFunction *MF);
|
||||||
|
private:
|
||||||
|
void initializeEnvironment();
|
||||||
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
||||||
|
public:
|
||||||
void computeIssueWidth();
|
void computeIssueWidth();
|
||||||
|
|
||||||
bool hasV4TOps() const { return HasV4TOps; }
|
bool hasV4TOps() const { return HasV4TOps; }
|
||||||
|
@ -336,8 +336,10 @@ void X86Subtarget::resetSubtargetFeatures(const MachineFunction *MF) {
|
|||||||
!CPUAttr.hasAttribute(Attribute::None) ?CPUAttr.getValueAsString() : "";
|
!CPUAttr.hasAttribute(Attribute::None) ?CPUAttr.getValueAsString() : "";
|
||||||
std::string FS =
|
std::string FS =
|
||||||
!FSAttr.hasAttribute(Attribute::None) ? FSAttr.getValueAsString() : "";
|
!FSAttr.hasAttribute(Attribute::None) ? FSAttr.getValueAsString() : "";
|
||||||
if (!FS.empty())
|
if (!FS.empty()) {
|
||||||
|
initializeEnvironment();
|
||||||
resetSubtargetFeatures(CPU, FS);
|
resetSubtargetFeatures(CPU, FS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void X86Subtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
|
void X86Subtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
|
||||||
@ -417,46 +419,50 @@ void X86Subtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
|
|||||||
stackAlignment = 16;
|
stackAlignment = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void X86Subtarget::initializeEnvironment() {
|
||||||
|
X86SSELevel = NoMMXSSE;
|
||||||
|
X863DNowLevel = NoThreeDNow;
|
||||||
|
HasCMov = false;
|
||||||
|
HasX86_64 = false;
|
||||||
|
HasPOPCNT = false;
|
||||||
|
HasSSE4A = false;
|
||||||
|
HasAES = false;
|
||||||
|
HasPCLMUL = false;
|
||||||
|
HasFMA = false;
|
||||||
|
HasFMA4 = false;
|
||||||
|
HasXOP = false;
|
||||||
|
HasMOVBE = false;
|
||||||
|
HasRDRAND = false;
|
||||||
|
HasF16C = false;
|
||||||
|
HasFSGSBase = false;
|
||||||
|
HasLZCNT = false;
|
||||||
|
HasBMI = false;
|
||||||
|
HasBMI2 = false;
|
||||||
|
HasRTM = false;
|
||||||
|
HasADX = false;
|
||||||
|
IsBTMemSlow = false;
|
||||||
|
IsUAMemFast = false;
|
||||||
|
HasVectorUAMem = false;
|
||||||
|
HasCmpxchg16b = false;
|
||||||
|
UseLeaForSP = false;
|
||||||
|
HasSlowDivide = false;
|
||||||
|
PostRAScheduler = false;
|
||||||
|
PadShortFunctions = false;
|
||||||
|
stackAlignment = 4;
|
||||||
|
// FIXME: this is a known good value for Yonah. How about others?
|
||||||
|
MaxInlineSizeThreshold = 128;
|
||||||
|
}
|
||||||
|
|
||||||
X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
||||||
const std::string &FS,
|
const std::string &FS,
|
||||||
unsigned StackAlignOverride, bool is64Bit)
|
unsigned StackAlignOverride, bool is64Bit)
|
||||||
: X86GenSubtargetInfo(TT, CPU, FS)
|
: X86GenSubtargetInfo(TT, CPU, FS)
|
||||||
, X86ProcFamily(Others)
|
, X86ProcFamily(Others)
|
||||||
, PICStyle(PICStyles::None)
|
, PICStyle(PICStyles::None)
|
||||||
, X86SSELevel(NoMMXSSE)
|
|
||||||
, X863DNowLevel(NoThreeDNow)
|
|
||||||
, HasCMov(false)
|
|
||||||
, HasX86_64(false)
|
|
||||||
, HasPOPCNT(false)
|
|
||||||
, HasSSE4A(false)
|
|
||||||
, HasAES(false)
|
|
||||||
, HasPCLMUL(false)
|
|
||||||
, HasFMA(false)
|
|
||||||
, HasFMA4(false)
|
|
||||||
, HasXOP(false)
|
|
||||||
, HasMOVBE(false)
|
|
||||||
, HasRDRAND(false)
|
|
||||||
, HasF16C(false)
|
|
||||||
, HasFSGSBase(false)
|
|
||||||
, HasLZCNT(false)
|
|
||||||
, HasBMI(false)
|
|
||||||
, HasBMI2(false)
|
|
||||||
, HasRTM(false)
|
|
||||||
, HasADX(false)
|
|
||||||
, IsBTMemSlow(false)
|
|
||||||
, IsUAMemFast(false)
|
|
||||||
, HasVectorUAMem(false)
|
|
||||||
, HasCmpxchg16b(false)
|
|
||||||
, UseLeaForSP(false)
|
|
||||||
, HasSlowDivide(false)
|
|
||||||
, PostRAScheduler(false)
|
|
||||||
, PadShortFunctions(false)
|
|
||||||
, stackAlignment(4)
|
|
||||||
// FIXME: this is a known good value for Yonah. How about others?
|
|
||||||
, MaxInlineSizeThreshold(128)
|
|
||||||
, TargetTriple(TT)
|
, TargetTriple(TT)
|
||||||
, StackAlignOverride(StackAlignOverride)
|
, StackAlignOverride(StackAlignOverride)
|
||||||
, In64BitMode(is64Bit) {
|
, In64BitMode(is64Bit) {
|
||||||
|
initializeEnvironment();
|
||||||
resetSubtargetFeatures(CPU, FS);
|
resetSubtargetFeatures(CPU, FS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,8 +201,10 @@ public:
|
|||||||
|
|
||||||
/// \brief Reset the features for the X86 target.
|
/// \brief Reset the features for the X86 target.
|
||||||
virtual void resetSubtargetFeatures(const MachineFunction *MF);
|
virtual void resetSubtargetFeatures(const MachineFunction *MF);
|
||||||
|
private:
|
||||||
|
void initializeEnvironment();
|
||||||
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
||||||
|
public:
|
||||||
/// Is this x86_64? (disregarding specific ABI / programming model)
|
/// Is this x86_64? (disregarding specific ABI / programming model)
|
||||||
bool is64Bit() const {
|
bool is64Bit() const {
|
||||||
return In64BitMode;
|
return In64BitMode;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
; RUN: llc < %s -march=x86-64 | FileCheck %s
|
; RUN: llc < %s -march=x86-64 | FileCheck %s
|
||||||
; XFAIL: *
|
|
||||||
|
|
||||||
; This should not generate SSE instructions:
|
; This should not generate SSE instructions:
|
||||||
;
|
;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user