[0/3] Improve x86 rounding implementation when FE_INEXACT trap is enabled

Message ID 20240403193919.1533786-1-adhemerval.zanella@linaro.org
Headers
Series Improve x86 rounding implementation when FE_INEXACT trap is enabled |

Message

Adhemerval Zanella Netto April 3, 2024, 7:39 p.m. UTC
  Some x86 rounding implementation that uses 387 raises invalid
floating point exceptions when traps are enabled. This is a GNU
extension outside the scope of the C standard.

Adhemerval Zanella (3):
  math: math: x86 ceill traps when FE_INEXACT is enabled (BZ 31600)
  math: math: x86 floor traps when FE_INEXACT is enabled (BZ 31601)
  math: math: x86 trunc traps when FE_INEXACT is enabled (BZ 31603)

 math/Makefile                                 |  7 ++
 math/test-ceil-except-2.c                     | 67 +++++++++++++++++++
 math/test-floor-except-2.c                    | 67 +++++++++++++++++++
 math/test-trunc-except-2.c                    | 67 +++++++++++++++++++
 sysdeps/i386/fpu/s_ceil.S                     | 34 ----------
 sysdeps/i386/fpu/s_ceil.c                     | 25 +++++++
 sysdeps/i386/fpu/s_ceilf.S                    | 34 ----------
 sysdeps/i386/fpu/s_ceilf.c                    | 25 +++++++
 sysdeps/i386/fpu/s_ceill.S                    | 39 -----------
 sysdeps/i386/fpu/s_floor.S                    | 34 ----------
 sysdeps/i386/fpu/s_floor.c                    | 25 +++++++
 sysdeps/i386/fpu/s_floorf.S                   | 34 ----------
 sysdeps/i386/fpu/s_floorf.c                   | 25 +++++++
 sysdeps/i386/fpu/s_floorl.S                   | 39 -----------
 sysdeps/i386/fpu/{s_trunc.S => s_trunc.c}     | 24 ++-----
 sysdeps/i386/fpu/{s_truncf.S => s_truncf.c}   | 24 ++-----
 .../fpu/s_truncl.S => x86/fpu/s_ceill.c}      | 29 ++------
 sysdeps/x86/fpu/s_floorl.c                    | 25 +++++++
 sysdeps/x86/fpu/s_nearestint_387_template.c   | 36 ++++++++++
 .../fpu/s_truncl.S => x86/fpu/s_truncl.c}     | 23 ++-----
 sysdeps/x86_64/fpu/s_ceill.S                  | 34 ----------
 sysdeps/x86_64/fpu/s_floorl.S                 | 33 ---------
 22 files changed, 394 insertions(+), 356 deletions(-)
 create mode 100644 math/test-ceil-except-2.c
 create mode 100644 math/test-floor-except-2.c
 create mode 100644 math/test-trunc-except-2.c
 delete mode 100644 sysdeps/i386/fpu/s_ceil.S
 create mode 100644 sysdeps/i386/fpu/s_ceil.c
 delete mode 100644 sysdeps/i386/fpu/s_ceilf.S
 create mode 100644 sysdeps/i386/fpu/s_ceilf.c
 delete mode 100644 sysdeps/i386/fpu/s_ceill.S
 delete mode 100644 sysdeps/i386/fpu/s_floor.S
 create mode 100644 sysdeps/i386/fpu/s_floor.c
 delete mode 100644 sysdeps/i386/fpu/s_floorf.S
 create mode 100644 sysdeps/i386/fpu/s_floorf.c
 delete mode 100644 sysdeps/i386/fpu/s_floorl.S
 rename sysdeps/i386/fpu/{s_trunc.S => s_trunc.c} (69%)
 rename sysdeps/i386/fpu/{s_truncf.S => s_truncf.c} (68%)
 rename sysdeps/{i386/fpu/s_truncl.S => x86/fpu/s_ceill.c} (63%)
 create mode 100644 sysdeps/x86/fpu/s_floorl.c
 create mode 100644 sysdeps/x86/fpu/s_nearestint_387_template.c
 rename sysdeps/{x86_64/fpu/s_truncl.S => x86/fpu/s_truncl.c} (70%)
 delete mode 100644 sysdeps/x86_64/fpu/s_ceill.S
 delete mode 100644 sysdeps/x86_64/fpu/s_floorl.S