@@ -604,37 +604,36 @@ RTLIB::Libcall RTLIB::getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize) {
604
604
ISD::CondCode TargetLoweringBase::getSoftFloatCmpLibcallPredicate (
605
605
RTLIB::LibcallImpl Impl) const {
606
606
switch (Impl) {
607
- case RTLIB::__aeabi_dcmpeq__ne:
608
- return ISD::SETNE;
609
607
case RTLIB::__aeabi_dcmpeq__eq:
608
+ case RTLIB::__aeabi_fcmpeq__eq:
609
+ // Usage in the eq case, so we have to invert the comparison.
610
610
return ISD::SETEQ;
611
- case RTLIB::__aeabi_dcmplt:
611
+ case RTLIB::__aeabi_dcmpeq__ne:
612
+ case RTLIB::__aeabi_fcmpeq__ne:
613
+ // Normal comparison to boolean value.
612
614
return ISD::SETNE;
615
+ case RTLIB::__aeabi_dcmplt:
613
616
case RTLIB::__aeabi_dcmple:
614
- return ISD::SETNE;
615
617
case RTLIB::__aeabi_dcmpge:
616
- return ISD::SETNE;
617
618
case RTLIB::__aeabi_dcmpgt:
618
- return ISD::SETNE;
619
619
case RTLIB::__aeabi_dcmpun:
620
- return ISD::SETNE;
621
- case RTLIB::__aeabi_fcmpeq__ne:
622
- return ISD::SETNE;
623
- case RTLIB::__aeabi_fcmpeq__eq:
624
- return ISD::SETEQ;
625
620
case RTLIB::__aeabi_fcmplt:
626
- return ISD::SETNE;
627
621
case RTLIB::__aeabi_fcmple:
628
- return ISD::SETNE;
629
622
case RTLIB::__aeabi_fcmpge:
630
- return ISD::SETNE;
631
623
case RTLIB::__aeabi_fcmpgt:
624
+ // / The AEABI versions return a typical boolean value, so we can compare
625
+ // / against the integer result as simply != 0.
632
626
return ISD::SETNE;
633
627
default :
634
628
break ;
635
629
}
636
630
637
- // Assume libgcc/compiler-rt behavior
631
+ // Assume libgcc/compiler-rt behavior. Most of the cases are really aliases of
632
+ // each other, and return a 3-way comparison style result of -1, 0, or 1
633
+ // depending on lt/eq/gt.
634
+ //
635
+ // FIXME: It would be cleaner to directly express this as a 3-way comparison
636
+ // soft FP libcall instead of individual compares.
638
637
RTLIB::Libcall LC = RTLIB::RuntimeLibcallsInfo::getLibcallFromImpl (Impl);
639
638
switch (LC) {
640
639
case RTLIB::OEQ_F32:
0 commit comments