summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-28 21:44:33 +0000
committerChris Lattner <sabre@nondot.org>2005-04-28 21:44:33 +0000
commit9d6fa98ec7aec3ebaa0a795d2224658986274e1c (patch)
tree8b57ed738ae076e866ad7333399cad22ac642c5e /llvm/lib/CodeGen
parent2f82d2d58a929fb28e135ac8ecca1bec8caf7e99 (diff)
downloadbcm5719-llvm-9d6fa98ec7aec3ebaa0a795d2224658986274e1c.tar.gz
bcm5719-llvm-9d6fa98ec7aec3ebaa0a795d2224658986274e1c.zip
Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21606
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 20912583d71..b8d07d0cbf5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -990,6 +990,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
// Unary operators
case ISD::FABS:
case ISD::FNEG:
+ case ISD::FSQRT:
+ case ISD::FSIN:
+ case ISD::FCOS:
Tmp1 = LegalizeOp(Node->getOperand(0));
switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
case TargetLowering::Legal:
@@ -1335,6 +1338,16 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
// precision, and these operations don't modify precision at all.
break;
+ case ISD::FSQRT:
+ case ISD::FSIN:
+ case ISD::FCOS:
+ Tmp1 = PromoteOp(Node->getOperand(0));
+ assert(Tmp1.getValueType() == NVT);
+ Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1);
+ if(NoExcessFPPrecision)
+ Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result, VT);
+ break;
+
case ISD::AND:
case ISD::OR:
case ISD::XOR:
OpenPOWER on IntegriCloud