diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-26 21:10:55 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-26 21:10:55 +0000 |
commit | 7f1076becdf8b689d869472f3dd14dbc24d4cc75 (patch) | |
tree | 06b7051c461a692f5f9d05ffea3ba6b0a29d5d40 | |
parent | 4780e3f85849e6d5a7683320c3ac5c92f65e2914 (diff) | |
download | external_llvm-7f1076becdf8b689d869472f3dd14dbc24d4cc75.zip external_llvm-7f1076becdf8b689d869472f3dd14dbc24d4cc75.tar.gz external_llvm-7f1076becdf8b689d869472f3dd14dbc24d4cc75.tar.bz2 |
Enable codegen for long double abs, sin, cos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42368 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 14691ee..f582c8f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2996,7 +2996,8 @@ void SelectionDAGLowering::visitCall(CallInst &I) { } } else if (NameStr[0] == 'f' && ((NameLen == 4 && !strcmp(NameStr, "fabs")) || - (NameLen == 5 && !strcmp(NameStr, "fabsf")))) { + (NameLen == 5 && !strcmp(NameStr, "fabsf")) || + (NameLen == 5 && !strcmp(NameStr, "fabsl")))) { if (I.getNumOperands() == 2 && // Basic sanity checks. I.getOperand(1)->getType()->isFloatingPoint() && I.getType() == I.getOperand(1)->getType()) { @@ -3006,7 +3007,8 @@ void SelectionDAGLowering::visitCall(CallInst &I) { } } else if (NameStr[0] == 's' && ((NameLen == 3 && !strcmp(NameStr, "sin")) || - (NameLen == 4 && !strcmp(NameStr, "sinf")))) { + (NameLen == 4 && !strcmp(NameStr, "sinf")) || + (NameLen == 4 && !strcmp(NameStr, "sinl")))) { if (I.getNumOperands() == 2 && // Basic sanity checks. I.getOperand(1)->getType()->isFloatingPoint() && I.getType() == I.getOperand(1)->getType()) { @@ -3016,7 +3018,8 @@ void SelectionDAGLowering::visitCall(CallInst &I) { } } else if (NameStr[0] == 'c' && ((NameLen == 3 && !strcmp(NameStr, "cos")) || - (NameLen == 4 && !strcmp(NameStr, "cosf")))) { + (NameLen == 4 && !strcmp(NameStr, "cosf")) || + (NameLen == 4 && !strcmp(NameStr, "cosl")))) { if (I.getNumOperands() == 2 && // Basic sanity checks. I.getOperand(1)->getType()->isFloatingPoint() && I.getType() == I.getOperand(1)->getType()) { diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index f4e1cb1..48f4f15 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -418,6 +418,10 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM) setOperationAction(ISD::UNDEF, MVT::f80, Expand); setOperationAction(ISD::FCOPYSIGN, MVT::f80, Expand); setOperationAction(ISD::ConstantFP, MVT::f80, Expand); + if (!UnsafeFPMath) { + setOperationAction(ISD::FSIN , MVT::f80 , Expand); + setOperationAction(ISD::FCOS , MVT::f80 , Expand); + } // First set operation action for all vector types to expand. Then we // will selectively turn on ones that can be effectively codegen'd. |