+2018-02-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * optabs.c (prepare_cmp_insn): Try harder to emit a direct comparison
+ instead of a libcall for UNORDERED.
+
2018-02-09 Tamar Christina <tamar.christina@arm.com>
PR target/82641
if (methods != OPTAB_LIB_WIDEN)
goto fail;
- if (!SCALAR_FLOAT_MODE_P (mode))
+ if (SCALAR_FLOAT_MODE_P (mode))
+ {
+ /* Small trick if UNORDERED isn't implemented by the hardware. */
+ if (comparison == UNORDERED && rtx_equal_p (x, y))
+ {
+ prepare_cmp_insn (x, y, UNLT, NULL_RTX, unsignedp, OPTAB_WIDEN,
+ ptest, pmode);
+ if (*ptest)
+ return;
+ }
+
+ prepare_float_lib_cmp (x, y, comparison, ptest, pmode);
+ }
+ else
{
rtx result;
machine_mode ret_mode;
prepare_cmp_insn (x, y, comparison, NULL_RTX, unsignedp, methods,
ptest, pmode);
}
- else
- prepare_float_lib_cmp (x, y, comparison, ptest, pmode);
return;