diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-10-27 19:56:55 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-10-27 19:56:55 +0000 |
commit | eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321d (patch) | |
tree | ad532e623f4f409af02ef9eef7d576ad8184978b /lib/Target/Alpha/AlphaISelLowering.cpp | |
parent | f3b0d1a555eaa46931e4ec1b11e434e8cba2b5d7 (diff) |
Do away with addLegalFPImmediate. Add a target hook isFPImmLegal which returns true if the fp immediate can be natively codegened by target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaISelLowering.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp index b3f865cf4a..b2b738db2e 100644 --- a/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/lib/Target/Alpha/AlphaISelLowering.cpp @@ -157,11 +157,6 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) setStackPointerRegisterToSaveRestore(Alpha::R30); - addLegalFPImmediate(APFloat(+0.0)); //F31 - addLegalFPImmediate(APFloat(+0.0f)); //F31 - addLegalFPImmediate(APFloat(-0.0)); //-F31 - addLegalFPImmediate(APFloat(-0.0f)); //-F31 - setJumpBufSize(272); setJumpBufAlignment(16); @@ -919,3 +914,11 @@ AlphaTargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const { // The Alpha target isn't yet aware of offsets. return false; } + +bool AlphaTargetLowering::isFPImmLegal(const APFloat &Imm) const { + // +0.0 F31 + // +0.0f F31 + // -0.0 -F31 + // -0.0f -F31 + return Imm.isZero() || Imm.isNegZero(); +} |