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/SystemZ/SystemZISelLowering.cpp | |
parent | f3b0d1a555eaa46931e4ec1b11e434e8cba2b5d7 (diff) | |
download | llvm-eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321d.tar.gz llvm-eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321d.tar.bz2 llvm-eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321d.tar.xz |
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/SystemZ/SystemZISelLowering.cpp')
-rw-r--r-- | lib/Target/SystemZ/SystemZISelLowering.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Target/SystemZ/SystemZISelLowering.cpp b/lib/Target/SystemZ/SystemZISelLowering.cpp index 07e0d83058..eb4d250504 100644 --- a/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -53,11 +53,6 @@ SystemZTargetLowering::SystemZTargetLowering(SystemZTargetMachine &tm) : if (!UseSoftFloat) { addRegisterClass(MVT::f32, SystemZ::FP32RegisterClass); addRegisterClass(MVT::f64, SystemZ::FP64RegisterClass); - - addLegalFPImmediate(APFloat(+0.0)); // lzer - addLegalFPImmediate(APFloat(+0.0f)); // lzdr - addLegalFPImmediate(APFloat(-0.0)); // lzer + lner - addLegalFPImmediate(APFloat(-0.0f)); // lzdr + lndr } // Compute derived properties from the register classes @@ -169,6 +164,17 @@ SDValue SystemZTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) { } } +bool SystemZTargetLowering::isFPImmLegal(const APFloat &Imm) const { + if (UseSoftFloat) + return false; + + // +0.0 lzer + // +0.0f lzdr + // -0.0 lzer + lner + // -0.0f lzdr + lndr + return Imm.isZero() || Imm.isNegZero(); +} + //===----------------------------------------------------------------------===// // SystemZ Inline Assembly Support //===----------------------------------------------------------------------===// |