[PATCH] libgcc/m68k: Fixes for soft float
commite0c1476d5d7c450b1b16a40364cea4e91237ea93
authorKeith Packard <keithp@keithp.com>
Fri, 10 Nov 2023 23:41:19 +0000 (10 16:41 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 10 Nov 2023 23:47:22 +0000 (10 16:47 -0700)
treec40f92bbbf2880981a097d185c574d7f94cba35e
parentb42dd1379048fd9cc7eb7039b9dfee02d6884df7
[PATCH] libgcc/m68k: Fixes for soft float

Check for non-zero denorm in __adddf3. Need to check both the upper and
lower 32-bit chunks of a 64-bit float for a non-zero value when
checking to see if the value is -0.

Fix __addsf3 when the sum exponent is exactly 0xff to ensure that
produces infinity and not nan.

Handle converting NaN/inf values between formats.

Handle underflow and overflow when truncating.

Write a replacement for __fixxfsi so that it does not raise extra
exceptions during an extra conversion from long double to double.

libgcc/
* config/m68k/lb1sf68.S (__adddf3): Properly check for non-zero denorm.
(__divdf3): Restore sign bit properly.
(__addsf3): Correct exponent check.
* config/m68k/fpgnulib.c (EXPMASK): Define.
(__extendsfdf2): Handle Inf and NaN properly.
(__truncdfsf2): Handle underflow and overflow correctly.
(__extenddfxf2): Handle underflow, denorms, Inf and NaN correctly.
(__truncxfdf2): Handle underflow and denorms correctly.
(__fixxfsi): Reimplement.
libgcc/config/m68k/fpgnulib.c
libgcc/config/m68k/lb1sf68.S