aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppdefault.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-08-05 09:42:58 +0200
committerMarc Poulhiès <poulhies@adacore.com>2022-09-06 09:14:20 +0200
commite9bac0faa1e55c6673296d7618df77044ef406ca (patch)
tree8195ca78c40c933033f8b833a0d7025ba76d2d2a /gcc/cppdefault.cc
parent8b9bbdc362efe420633e43850092d01f467aa6d8 (diff)
downloadgcc-e9bac0faa1e55c6673296d7618df77044ef406ca.zip
gcc-e9bac0faa1e55c6673296d7618df77044ef406ca.tar.gz
gcc-e9bac0faa1e55c6673296d7618df77044ef406ca.tar.bz2
[Ada] Correctly round Value attribute for floating point in more cases
This provides correct rounding in the IEEE 754 sense for the Value attribute of floating-point types in more cases, by switching from tables of powers of 10 to tables of powers of 5 for precomputed values, thus making it possible to use a single divide for denormals and normalized numbers just above them. Although this significantly increases the size of the tables, object files for them are still quite small (1, 2 and 4 KB respectively on x86-64). gcc/ada/ * libgnat/s-powflt.ads (Powfive): New constant array. * libgnat/s-powlfl.ads (Powfive): Likewise. (Powfive_100): New constant. (Powfive_200): Likewise. (Powfive_300): Likewise. * libgnat/s-powllf.ads (Powfive): New constant array. (Powfive_100): New constant. (Powfive_200): Likewise. (Powfive_300): Likewise. * libgnat/s-valflt.ads (Impl): Replace Powten with Powfive and pass Null_Address for the address of large constants. * libgnat/s-vallfl.ads (Impl): Replace Powten with Powfive and pass the address of large constants. * libgnat/s-valllf.ads (Impl): Likewise. * libgnat/s-valrea.ads (System.Val_Real): Replace Powten_Address with Powfive_Address and add Powfive_{1,2,3}00_Address parameters. * libgnat/s-valrea.adb (Is_Large_Type): New boolean constant. (Is_Very_Large_Type): Likewise. (Maxexp32): Change value of 10 to that of 5. (Maxexp64): Likewise. (Maxexp80): Likewise. (Integer_to_Real): Use a combination of tables of powers of 5 and scaling if the base is 10. (Large_Powten): Rename into... (Large_Powfive): ...this. Add support for large constants. (Large_Powfive): New overloaded function for very large exponents.
Diffstat (limited to 'gcc/cppdefault.cc')
0 files changed, 0 insertions, 0 deletions