diff options
author | Hal Finkel <hfinkel@anl.gov> | 2016-03-29 01:36:01 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2016-03-29 01:36:01 +0000 |
commit | fa7057a415d5de8bec0063b2e9c96836c08468ab (patch) | |
tree | f4059fd8b058380a901d047a9d53260025550240 /llvm/lib/Target/PowerPC/PPCSubtarget.h | |
parent | 5e241b11ed541145bb13759793d85485bdd73808 (diff) | |
download | bcm5719-llvm-fa7057a415d5de8bec0063b2e9c96836c08468ab.tar.gz bcm5719-llvm-fa7057a415d5de8bec0063b2e9c96836c08468ab.zip |
[PowerPC] Refactor popcnt[dw] target features
Instead of using two feature bits, one to indicate the availability of the
popcnt[dw] instructions, and another to indicate whether or not they're fast,
use a single enum. This allows more consistent control via target attribute
strings, and via Clang's command line.
llvm-svn: 264690
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.h')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCSubtarget.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.h b/llvm/lib/Target/PowerPC/PPCSubtarget.h index fc4ba3f7cc3..a91cdd07b27 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.h +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.h @@ -64,6 +64,13 @@ class GlobalValue; class TargetMachine; class PPCSubtarget : public PPCGenSubtargetInfo { +public: + enum POPCNTDKind { + POPCNTD_Unavailable, + POPCNTD_Slow, + POPCNTD_Fast + }; + protected: /// TargetTriple - What processor and OS we're targeting. Triple TargetTriple; @@ -103,7 +110,6 @@ protected: bool HasFPRND; bool HasFPCVT; bool HasISEL; - bool HasPOPCNTD; bool HasBPERMD; bool HasExtDiv; bool HasCMPB; @@ -124,7 +130,8 @@ protected: bool HasHTM; bool HasFusion; bool HasFloat128; - bool SlowPOPCNTD; + + POPCNTDKind HasPOPCNTD; /// When targeting QPX running a stock PPC64 Linux kernel where the stack /// alignment has not been changed, we need to keep the 16-byte alignment @@ -237,7 +244,6 @@ public: bool hasP9Altivec() const { return HasP9Altivec; } bool hasMFOCRF() const { return HasMFOCRF; } bool hasISEL() const { return HasISEL; } - bool hasPOPCNTD() const { return HasPOPCNTD; } bool hasBPERMD() const { return HasBPERMD; } bool hasExtDiv() const { return HasExtDiv; } bool hasCMPB() const { return HasCMPB; } @@ -249,7 +255,6 @@ public: bool isE500() const { return IsE500; } bool isFeatureMFTB() const { return FeatureMFTB; } bool isDeprecatedDST() const { return DeprecatedDST; } - bool isPOPCNTDSlow() const { return SlowPOPCNTD; } bool hasICBT() const { return HasICBT; } bool hasInvariantFunctionDescriptors() const { return HasInvariantFunctionDescriptors; @@ -268,6 +273,8 @@ public: bool hasFusion() const { return HasFusion; } bool hasFloat128() const { return HasFloat128; } + POPCNTDKind hasPOPCNTD() const { return HasPOPCNTD; } + const Triple &getTargetTriple() const { return TargetTriple; } /// isDarwin - True if this is any darwin platform. |