diff options
| author | Dan Gohman <gohman@apple.com> | 2007-10-12 00:01:22 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2007-10-12 00:01:22 +0000 |
| commit | be37007e64bda723c5991648b0df335a893aa91f (patch) | |
| tree | 68842cae60c8ba19c1722ad769ab0ff1afab0a38 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 2a7de4168212d47f2181af6178420cf327e70683 (diff) | |
| download | bcm5719-llvm-be37007e64bda723c5991648b0df335a893aa91f.tar.gz bcm5719-llvm-be37007e64bda723c5991648b0df335a893aa91f.zip | |
Add intrinsics for sin, cos, and pow. These use llvm_anyfloat_ty, and so
may be overloaded with vector types. And add a testcase for codegen for
these.
llvm-svn: 42885
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index b1bf475c473..d636e8b98f4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2807,6 +2807,22 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { getValue(I.getOperand(1)), getValue(I.getOperand(2)))); return 0; + case Intrinsic::sin: + setValue(&I, DAG.getNode(ISD::FSIN, + getValue(I.getOperand(1)).getValueType(), + getValue(I.getOperand(1)))); + return 0; + case Intrinsic::cos: + setValue(&I, DAG.getNode(ISD::FCOS, + getValue(I.getOperand(1)).getValueType(), + getValue(I.getOperand(1)))); + return 0; + case Intrinsic::pow: + setValue(&I, DAG.getNode(ISD::FPOW, + getValue(I.getOperand(1)).getValueType(), + getValue(I.getOperand(1)), + getValue(I.getOperand(2)))); + return 0; case Intrinsic::pcmarker: { SDOperand Tmp = getValue(I.getOperand(1)); DAG.setRoot(DAG.getNode(ISD::PCMARKER, MVT::Other, getRoot(), Tmp)); |

