On Wed, Nov 20, 2019 at 04:35:24PM +0000, Richard Sandiford wrote: > Actually, this doesn't work because *_operators want rtxes rather > than codes. I can get around that by passing op0 and op1 for > the existing rtxes. For the conversion at the end, I can do: > > machine_mode compared_mode = GET_MODE (XEXP (op0, 0)); > > if (code == ORDERED && INTEGRAL_MODE_P (compared_mode)) > return const_true_rtx;
This should be all !HONOR_NANS? Also LTGT should be turned into NE, under that same condition. So something like if (!HONOR_NANS (mode)) { /* UNORDERED cannot happen without NaNs. */ mask &= ~1; /* LTGT is written as NE, and ORDERED just is always true, without NaNs. */ if (mask == 12 || mask == 14) mask |= 1; } before returning true for 15. > if (is_unsigned) > code = unsigned_condition (code); > > Or I can add signed_comparison_p and unsigned_comparison_p functions > that take codes instead of rtxes. That may be easier, dunno. Thanks, Segher