[llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelPattern.cpp

Duraid Madina duraid at octopus.com.au
Sat Apr 2 02:34:04 PST 2005



Changes in directory llvm/lib/Target/IA64:

IA64ISelPattern.cpp updated: 1.9 -> 1.10
---
Log message:

support IDEF, fnegabs (thanks sampo)



---
Diffs of the changes:  (+14 -2)

 IA64ISelPattern.cpp |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelPattern.cpp
diff -u llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.9 llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.10
--- llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.9	Fri Apr  1 23:18:38 2005
+++ llvm/lib/Target/IA64/IA64ISelPattern.cpp	Sat Apr  2 04:33:53 2005
@@ -609,6 +609,11 @@
 
   return Result;
   }
+
+  case ISD::UNDEF: {
+    BuildMI(BB, IA64::IDEF, 0, Result);
+    return Result;
+  }
     
   case ISD::GlobalAddress: {
     GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
@@ -799,9 +804,16 @@
   }
  
   case ISD::FNEG: {
-    Tmp1 = SelectExpr(N.getOperand(0));
     assert(DestType == MVT::f64 && "trying to fneg something other than f64?");
-    BuildMI(BB, IA64::FNEG, 1, Result).addReg(Tmp1);
+
+    if (ISD::FABS == N.getOperand(0).getOpcode()) { // && hasOneUse()? 
+      Tmp1 = SelectExpr(N.getOperand(0).getOperand(0));
+      BuildMI(BB, IA64::FNEGABS, 1, Result).addReg(Tmp1); // fold in abs
+    } else {
+      Tmp1 = SelectExpr(N.getOperand(0));
+      BuildMI(BB, IA64::FNEG, 1, Result).addReg(Tmp1); // plain old fneg
+    }
+
     return Result;
   }
       	 






More information about the llvm-commits mailing list