This is the mail archive of the
mailing list for the GCC project.
Re: Rewrite some jump.c routines to use flags
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Jul 2019 10:53:03 +0100
- Subject: Re: Rewrite some jump.c routines to use flags
- References: <firstname.lastname@example.org> <3970490.yAij4KOnj2@polaris>
Eric Botcazou <email@example.com> writes:
>> +/* Invoke T (CODE, ORDER, SIGNEDNESS, CAN_TRAP) for each comparison, where:
>> + - CODE is the rtl comparison code
>> + - ORDER is the OR of the conditions under which CODE returns true
>> + - SIGNEDNESS is the signedness of COND, or 0 if it is sign-agnostic
>> + - CAN_TRAP is true if CODE can trap on some forms of NaN. */
> Are you talking about any NaNs here or just quiet NaNs? If the former, what's
> the point to encode anything for signaling NaNs?
Yeah, the former, so...
>> +#define FOR_MAPPING(T) \
>> + T (EQ, FLAGS_EQ, 0, true) \
>> + T (NE, ~FLAGS_EQ, 0, true) \
> This doesn't look correct: EQ and NE do not trap on quiet NaNs, unlike GT/LT.
...trapping on signalling NaNs is enough for the field to be true.
At least AIUI, __builtin_isunordered etc. don't raise an exception even
for signalling NaNs.