]> sourceware.org Git - newlib-cygwin.git/commit
newlib: Fix long double for unsupported rounding modes and exceptions
authorCraig Blackmore <craig.blackmore@embecosm.com>
Wed, 20 Dec 2023 20:32:24 +0000 (20:32 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Wed, 20 Dec 2023 21:54:22 +0000 (16:54 -0500)
commit73bce6597c3de790750b80c2b705bf20172516d4
tree997b0acf970691e5e2cb2869d85975a81b52eb03
parentb639245932726602394ddf91f60883184191a643
newlib: Fix long double for unsupported rounding modes and exceptions

RISC-V newlib fails to build for soft float multilibs since long double
support was enabled in:

  commit 04798b7bb69571452d2cfc7e0b052a9bbd3b619d
  Author: Kito Cheng <kito.cheng@sifive.com>
  Date:   Mon Dec 4 15:41:39 2023 +0800

      RISC-V: Support long double math

      Long double for RISC-V is using 128 bit IEEE 754 format like Aarch64,
      so we reference AArch64 to support that.

The RISC-V soft floating point environment only supports the
FE_TONEAREST rounding mode and does not support exceptions.  Guard long
double rounding and exception support with ifdefs based on the presence
of the relevant rounding modes and exceptions.

Tested on gcc/g++ testsuite using RISC-V GNU Newlib Toolchain built by
riscv-gnu-toolchain with multilibs:

    riscv-sim/-march=rv32i/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32iac/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32im/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32imac/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32imafc/-mabi=ilp32f/-mcmodel=medlow
    riscv-sim/-march=rv64imac/-mabi=lp64/-mcmodel=medlow

Co-authored-by: Simon Cook <simon.cook@embecosm.com>
newlib/libm/ld/s_fmal.c
newlib/libm/ld/s_lrint.c
newlib/libm/ld/s_lround.c
This page took 0.027674 seconds and 5 git commands to generate.