[llvm-commits] [llvm] r55499 - in /llvm/trunk: lib/Target/PowerPC/PPCISelLowering.cpp test/CodeGen/PowerPC/fnegsel.ll
Mon P Wang
wangmp at apple.com
Thu Aug 28 14:04:05 PDT 2008
Author: wangmp
Date: Thu Aug 28 16:04:05 2008
New Revision: 55499
URL: http://llvm.org/viewvc/llvm-project?rev=55499&view=rev
Log:
In lowering SELECT_CC, removed cases where we can't flip the true and false when the compare value has a NaN
Modified:
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/test/CodeGen/PowerPC/fnegsel.ll
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=55499&r1=55498&r2=55499&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Aug 28 16:04:05 2008
@@ -2734,20 +2734,16 @@
switch (CC) {
default: break; // SETUO etc aren't handled by fsel.
case ISD::SETULT:
- case ISD::SETOLT:
case ISD::SETLT:
std::swap(TV, FV); // fsel is natively setge, swap operands for setlt
- case ISD::SETUGE:
case ISD::SETOGE:
case ISD::SETGE:
if (LHS.getValueType() == MVT::f32) // Comparison is always 64-bits
LHS = DAG.getNode(ISD::FP_EXTEND, MVT::f64, LHS);
return DAG.getNode(PPCISD::FSEL, ResVT, LHS, TV, FV);
case ISD::SETUGT:
- case ISD::SETOGT:
case ISD::SETGT:
std::swap(TV, FV); // fsel is natively setge, swap operands for setlt
- case ISD::SETULE:
case ISD::SETOLE:
case ISD::SETLE:
if (LHS.getValueType() == MVT::f32) // Comparison is always 64-bits
@@ -2760,13 +2756,11 @@
switch (CC) {
default: break; // SETUO etc aren't handled by fsel.
case ISD::SETULT:
- case ISD::SETOLT:
case ISD::SETLT:
Cmp = DAG.getNode(ISD::FSUB, CmpVT, LHS, RHS);
if (Cmp.getValueType() == MVT::f32) // Comparison is always 64-bits
Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, FV, TV);
- case ISD::SETUGE:
case ISD::SETOGE:
case ISD::SETGE:
Cmp = DAG.getNode(ISD::FSUB, CmpVT, LHS, RHS);
@@ -2774,13 +2768,11 @@
Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, TV, FV);
case ISD::SETUGT:
- case ISD::SETOGT:
case ISD::SETGT:
Cmp = DAG.getNode(ISD::FSUB, CmpVT, RHS, LHS);
if (Cmp.getValueType() == MVT::f32) // Comparison is always 64-bits
Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, FV, TV);
- case ISD::SETULE:
case ISD::SETOLE:
case ISD::SETLE:
Cmp = DAG.getNode(ISD::FSUB, CmpVT, RHS, LHS);
Modified: llvm/trunk/test/CodeGen/PowerPC/fnegsel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/fnegsel.ll?rev=55499&r1=55498&r2=55499&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/fnegsel.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/fnegsel.ll Thu Aug 28 16:04:05 2008
@@ -2,7 +2,7 @@
define double @test_FNEG_sel(double %A, double %B, double %C) {
%D = sub double -0.000000e+00, %A ; <double> [#uses=1]
- %Cond = fcmp ogt double %D, -0.000000e+00 ; <i1> [#uses=1]
+ %Cond = fcmp ugt double %D, -0.000000e+00 ; <i1> [#uses=1]
%E = select i1 %Cond, double %B, double %C ; <double> [#uses=1]
ret double %E
}
More information about the llvm-commits
mailing list