mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
Decouple fsqrt from gpul optimizations, implementing fsqrt.ll.
Remove the -enable-gpopt option which is subsumed by feature flags. llvm-svn: 23218
This commit is contained in:
parent
ed22d99214
commit
813a73e8e9
@ -54,7 +54,7 @@ PPC32TargetLowering::PPC32TargetLowering(TargetMachine &TM)
|
|||||||
setOperationAction(ISD::SREM , MVT::f32, Expand);
|
setOperationAction(ISD::SREM , MVT::f32, Expand);
|
||||||
|
|
||||||
// If we're enabling GP optimizations, use hardware square root
|
// If we're enabling GP optimizations, use hardware square root
|
||||||
if (!TM.getSubtarget<PPCSubtarget>().isGigaProcessor()) {
|
if (!TM.getSubtarget<PPCSubtarget>().hasFSQRT()) {
|
||||||
setOperationAction(ISD::FSQRT, MVT::f64, Expand);
|
setOperationAction(ISD::FSQRT, MVT::f64, Expand);
|
||||||
setOperationAction(ISD::FSQRT, MVT::f32, Expand);
|
setOperationAction(ISD::FSQRT, MVT::f32, Expand);
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,10 @@ namespace llvm {
|
|||||||
PPCTargetArg(cl::desc("Force generation of code for a specific PPC target:"),
|
PPCTargetArg(cl::desc("Force generation of code for a specific PPC target:"),
|
||||||
cl::values(
|
cl::values(
|
||||||
clEnumValN(TargetAIX, "aix", " Enable AIX codegen"),
|
clEnumValN(TargetAIX, "aix", " Enable AIX codegen"),
|
||||||
clEnumValN(TargetDarwin,"darwin"," Enable Darwin codegen"),
|
clEnumValN(TargetDarwin,"darwin",
|
||||||
|
" Enable Darwin codegen"),
|
||||||
clEnumValEnd),
|
clEnumValEnd),
|
||||||
cl::location(PPCTarget), cl::init(TargetDefault));
|
cl::location(PPCTarget), cl::init(TargetDefault));
|
||||||
cl::opt<bool> EnableGPOPT("enable-gpopt", cl::Hidden,
|
|
||||||
cl::desc("Enable optimizations for GP cpus"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PowerPCFeature {
|
enum PowerPCFeature {
|
||||||
@ -126,7 +125,8 @@ PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS)
|
|||||||
SubtargetFeatures::Parse(FS, CPU,
|
SubtargetFeatures::Parse(FS, CPU,
|
||||||
PowerPCSubTypeKV, PowerPCSubTypeKVSize,
|
PowerPCSubTypeKV, PowerPCSubTypeKVSize,
|
||||||
PowerPCFeatureKV, PowerPCFeatureKVSize);
|
PowerPCFeatureKV, PowerPCFeatureKVSize);
|
||||||
IsGigaProcessor = (Bits & PowerPCFeatureGPUL) != 0;
|
IsGigaProcessor = (Bits & PowerPCFeatureGPUL ) != 0;
|
||||||
|
HasFSQRT = (Bits & PowerPCFeatureFSqrt) != 0;
|
||||||
|
|
||||||
// Set the boolean corresponding to the current target triple, or the default
|
// Set the boolean corresponding to the current target triple, or the default
|
||||||
// if one cannot be determined, to true.
|
// if one cannot be determined, to true.
|
||||||
@ -140,7 +140,4 @@ PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS)
|
|||||||
IsDarwin = true;
|
IsDarwin = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// If GP opts are forced on by the commandline, do so now.
|
|
||||||
if (EnableGPOPT) IsGigaProcessor = true;
|
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ protected:
|
|||||||
|
|
||||||
/// Used by the ISel to turn in optimizations for POWER4-derived architectures
|
/// Used by the ISel to turn in optimizations for POWER4-derived architectures
|
||||||
bool IsGigaProcessor;
|
bool IsGigaProcessor;
|
||||||
|
bool HasFSQRT;
|
||||||
bool IsAIX;
|
bool IsAIX;
|
||||||
bool IsDarwin;
|
bool IsDarwin;
|
||||||
public:
|
public:
|
||||||
@ -42,6 +43,8 @@ public:
|
|||||||
/// function for this subtarget.
|
/// function for this subtarget.
|
||||||
unsigned getStackAlignment() const { return StackAlignment; }
|
unsigned getStackAlignment() const { return StackAlignment; }
|
||||||
|
|
||||||
|
bool hasFSQRT() const { return HasFSQRT; }
|
||||||
|
|
||||||
bool isAIX() const { return IsAIX; }
|
bool isAIX() const { return IsAIX; }
|
||||||
bool isDarwin() const { return IsDarwin; }
|
bool isDarwin() const { return IsDarwin; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user