[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSubtarget.cpp PPCSubtarget.h
Jim Laskey
jlaskey at apple.com
Wed Oct 26 10:30:47 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPCSubtarget.cpp updated: 1.13 -> 1.14
PPCSubtarget.h updated: 1.8 -> 1.9
---
Log message:
Give full control of subtarget features over to table generated code.
---
Diffs of the changes: (+19 -10)
PPCSubtarget.cpp | 21 ++++++++++++---------
PPCSubtarget.h | 8 +++++++-
2 files changed, 19 insertions(+), 10 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp
diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.13 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.14
--- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.13 Tue Oct 25 10:15:28 2005
+++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp Wed Oct 26 12:30:34 2005
@@ -68,22 +68,25 @@
}
#endif
+
PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS)
- : StackAlignment(16), IsGigaProcessor(false), IsAIX(false), IsDarwin(false) {
+ : StackAlignment(16)
+ , IsGigaProcessor(false)
+ , Is64Bit(false)
+ , Has64BitRegs(false)
+ , HasAltivec(false)
+ , HasFSQRT(false)
+ , IsAIX(false)
+ , IsDarwin(false) {
// Determine default and user specified characteristics
std::string CPU = "generic";
#if defined(__APPLE__)
CPU = GetCurrentPowerPCCPU();
#endif
- SubtargetFeatures Features(FS);
- Features.setCPUIfNone(CPU);
- uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize,
- FeatureKV, FeatureKVSize);
- IsGigaProcessor = (Bits & FeatureGPUL ) != 0;
- Is64Bit = (Bits & Feature64Bit) != 0;
- HasFSQRT = (Bits & FeatureFSqrt) != 0;
- Has64BitRegs = (Bits & Feature64BitRegs) != 0;
+
+ // Parse features string.
+ ParseSubtargetFeatures(FS, CPU);
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.
Index: llvm/lib/Target/PowerPC/PPCSubtarget.h
diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.8 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.9
--- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.8 Mon Oct 17 19:56:42 2005
+++ llvm/lib/Target/PowerPC/PPCSubtarget.h Wed Oct 26 12:30:34 2005
@@ -31,6 +31,7 @@
bool IsGigaProcessor;
bool Is64Bit;
bool Has64BitRegs;
+ bool HasAltivec;
bool HasFSQRT;
bool IsAIX;
bool IsDarwin;
@@ -39,6 +40,10 @@
/// of the specified module.
///
PPCSubtarget(const Module &M, const std::string &FS);
+
+ /// ParseSubtargetFeatures - Parses features string setting specified
+ /// subtarget options. Definition of function is usto generated by tblgen.
+ void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
/// getStackAlignment - Returns the minimum alignment known to hold of the
/// stack frame on entry to the function and which must be maintained by every
@@ -46,11 +51,12 @@
unsigned getStackAlignment() const { return StackAlignment; }
bool hasFSQRT() const { return HasFSQRT; }
+ bool has64BitRegs() const { return Has64BitRegs; }
+ bool hasAltivec() const { return HasAltivec; }
bool isAIX() const { return IsAIX; }
bool isDarwin() const { return IsDarwin; }
bool is64Bit() const { return Is64Bit; }
- bool has64BitRegs() const { return Has64BitRegs; }
bool isGigaProcessor() const { return IsGigaProcessor; }
};
} // End llvm namespace
More information about the llvm-commits
mailing list