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