summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-10-27 19:56:55 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-10-27 19:56:55 +0000
commit16993aa30bee48a0d2fe06c6e334db7a4b57d80b (patch)
tree7187d4fd9c7143ed38e8c988816949d78b6765e7 /llvm/lib/Target/X86/X86ISelLowering.cpp
parentb5044ce5a9a3baeead95b6da07d9b2b48c3337ed (diff)
downloadbcm5719-llvm-16993aa30bee48a0d2fe06c6e334db7a4b57d80b.tar.gz
bcm5719-llvm-16993aa30bee48a0d2fe06c6e334db7a4b57d80b.zip
Do away with addLegalFPImmediate. Add a target hook isFPImmLegal which returns true if the fp immediate can be natively codegened by target.
llvm-svn: 85281
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index e5e7bc8bb75..83ede5dd4aa 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -2310,6 +2310,17 @@ static bool hasFPCMov(unsigned X86CC) {
}
}
+/// isFPImmLegal - Returns true if the target can instruction select the
+/// specified FP immediate natively. If false, the legalizer will
+/// materialize the FP immediate as a load from a constant pool.
+bool X86TargetLowering::isFPImmLegal(const APFloat &Imm) const {
+ for (unsigned i = 0, e = LegalFPImmediates.size(); i != e; ++i) {
+ if (Imm.bitwiseIsEqual(LegalFPImmediates[i]))
+ return true;
+ }
+ return false;
+}
+
/// isUndefOrInRange - Return true if Val is undef or if its value falls within
/// the specified range (L, H].
static bool isUndefOrInRange(int Val, int Low, int Hi) {
OpenPOWER on IntegriCloud