aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuraid Madina <duraid@octopus.com.au>2005-04-02 10:33:53 +0000
committerDuraid Madina <duraid@octopus.com.au>2005-04-02 10:33:53 +0000
commit75c9fcbdcc414c271d7a030ffb9dfaa0e3ba5a7b (patch)
tree273f4542a0ddbf756d65b8f444742bfc59c9c91c
parent5c156b747322242d68ed05d43117af5363f4762f (diff)
support IDEF, fnegabs (thanks sampo)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21023 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/IA64/IA64ISelPattern.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Target/IA64/IA64ISelPattern.cpp b/lib/Target/IA64/IA64ISelPattern.cpp
index 7b976fce3d..599f2891e1 100644
--- a/lib/Target/IA64/IA64ISelPattern.cpp
+++ b/lib/Target/IA64/IA64ISelPattern.cpp
@@ -609,6 +609,11 @@ unsigned ISel::SelectExpr(SDOperand N) {
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 @@ assert(0 && "hmm, ISD::SIGN_EXTEND: shouldn't ever be reached. bad luck!\n");
}
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;
}