https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128643
Roger Sayle <roger at nextmovesoftware dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |roger at
nextmovesoftware dot com
Status|NEW |ASSIGNED
CC| |roger at nextmovesoftware dot
com
--- Comment #2 from Roger Sayle <roger at nextmovesoftware dot com> ---
Created attachment 66167
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66167&action=edit
proposed patch
Proposed patch. I believe I have the logic correct.
UINT128_MAX overflows float and becomes +Inf. prec is 128, float->emax is 128.
Both INT128_MAX and INT128_MIN can be represented by float.
For FP16 (ieee_half) emax is 16, so unsigned short can produce +Inf,
but conversion from a signed short must be finite.
For the time being, the smallest decimal float is Decimal32 which has emax of
97.
This would require a binary value with more than 290 bits to overflow.