[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelPattern.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Apr 28 15:07:35 PDT 2005
Changes in directory llvm/lib/Target/X86:
X86ISelPattern.cpp updated: 1.108 -> 1.109
---
Log message:
Add support for FSQRT node, patch contributed by Morten Ofstad
---
Diffs of the changes: (+8 -4)
X86ISelPattern.cpp | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
Index: llvm/lib/Target/X86/X86ISelPattern.cpp
diff -u llvm/lib/Target/X86/X86ISelPattern.cpp:1.108 llvm/lib/Target/X86/X86ISelPattern.cpp:1.109
--- llvm/lib/Target/X86/X86ISelPattern.cpp:1.108 Wed Apr 27 15:10:01 2005
+++ llvm/lib/Target/X86/X86ISelPattern.cpp Thu Apr 28 17:07:18 2005
@@ -1830,12 +1830,16 @@
return Result;
case ISD::FABS:
- Tmp1 = SelectExpr(Node->getOperand(0));
- BuildMI(BB, X86::FABS, 1, Result).addReg(Tmp1);
- return Result;
case ISD::FNEG:
+ case ISD::FSQRT:
+ assert(N.getValueType()==MVT::f64 && "Illegal type for this operation");
Tmp1 = SelectExpr(Node->getOperand(0));
- BuildMI(BB, X86::FCHS, 1, Result).addReg(Tmp1);
+ switch (N.getOpcode()) {
+ default: assert(0 && "Unreachable!");
+ case ISD::FABS: BuildMI(BB, X86::FABS, 1, Result).addReg(Tmp1); break;
+ case ISD::FNEG: BuildMI(BB, X86::FCHS, 1, Result).addReg(Tmp1); break;
+ case ISD::FSQRT: BuildMI(BB, X86::FSQRT, 1, Result).addReg(Tmp1); break;
+ }
return Result;
case ISD::MULHU:
More information about the llvm-commits
mailing list