David Rubin
938efe4aab
compiler-rt: fix f80 ceil/floor optimization
...
Our implementation did the classic add-sub rounding trick `(y = x +/- C =+ C - x)`
with `C = 1 / eps(T) = 2^(mantissa - 1)`. This approach only works for values whose
magnitude is below the rounding capacity of the constant. For a 64-bit mantissa
(like f80 has), `C = 2^63` only rounds for `|x| < 2^63`. Before we allowed this to
be ran on `e < bias + 64` aka `|x| < 2^64`. And because it isn't large enough,
we lose a bit to rounding.
For reference, the musl implementation does the same thing, using `mantissa - 1`:
https://git.musl-libc.org/cgit/musl/tree/src/math/ceill.c#n18
where `LDBL_MANT_DIG` is 64 for `long double` on x86.
This commit also combines the floor and ceil implementations into one generic one.
2026-01-08 00:45:52 +01:00
..
2024-01-06 16:49:41 -08:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2025-11-22 22:42:38 +00:00
2025-04-02 05:53:22 +01:00
2025-11-29 21:09:08 +01:00
2025-06-16 13:22:19 +03:30
2025-09-20 18:33:00 -07:00
2025-06-16 13:22:19 +03:30
2025-09-20 18:51:26 -07:00
2025-09-18 12:42:14 +02:00
2025-07-30 09:56:38 +01:00
2025-11-22 22:42:38 +00:00
2025-11-22 22:42:38 +00:00
2025-12-16 06:23:06 +01:00
2025-07-22 19:43:47 -07:00
2025-06-16 13:22:19 +03:30
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-06-16 13:22:19 +03:30
2025-11-22 22:42:38 +00:00
2025-09-05 19:44:54 -07:00
2025-11-22 22:42:38 +00:00
2025-08-09 13:27:45 +03:30
2025-07-22 19:43:47 -07:00
2025-07-26 21:39:50 -04:00
2024-05-11 02:17:24 -07:00
2025-07-28 09:03:17 -07:00
2025-06-16 13:22:19 +03:30
2025-06-16 13:22:19 +03:30
2024-06-13 02:20:47 -07:00
2025-12-07 07:21:15 +01:00
2025-12-07 07:20:59 +01:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2024-08-27 00:44:35 +01:00
2025-10-02 17:44:52 -04:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:57:03 +00:00
2025-10-02 17:44:52 -04:00
2025-12-07 07:21:15 +01:00
2023-10-23 17:28:10 -07:00
2026-01-08 00:45:52 +01:00
2024-06-13 02:20:47 -07:00
2025-06-16 13:22:19 +03:30
2025-11-22 22:42:38 +00:00
2025-07-22 19:43:47 -07:00
2025-11-22 22:42:38 +00:00
2025-09-20 18:33:00 -07:00
2025-06-16 13:22:19 +03:30
2022-03-11 12:59:20 -07:00
2025-07-22 19:43:47 -07:00
2025-10-02 17:44:52 -04:00
2025-07-07 13:39:48 -07:00
2024-06-13 02:20:47 -07:00
2025-07-26 21:39:50 -04:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-10-02 17:44:52 -04:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-10-29 19:31:44 -04:00
2024-06-13 02:20:47 -07:00
2025-07-22 19:43:47 -07:00
2025-10-02 17:44:52 -04:00
2025-06-16 13:22:19 +03:30
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-10-30 09:31:30 +00:00
2025-07-22 19:43:47 -07:00
2025-09-20 18:33:01 -07:00
2025-09-05 19:44:54 -07:00
2025-09-20 18:58:32 -07:00
2025-07-22 19:43:47 -07:00
2025-06-16 13:22:19 +03:30
2025-07-26 14:54:04 +01:00
2025-08-09 13:27:45 +03:30
2025-06-16 13:22:19 +03:30
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-26 17:31:04 -04:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-11-22 22:42:38 +00:00
2024-02-04 19:09:33 +01:00
2026-01-05 11:24:48 +01:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2025-07-28 09:03:17 -07:00
2026-01-05 11:24:48 +01:00
2025-11-22 22:42:38 +00:00
2025-09-20 18:33:01 -07:00
2025-07-28 09:03:17 -07:00
2025-07-22 19:43:47 -07:00
2025-11-22 22:42:38 +00:00
2025-07-22 19:43:47 -07:00
2025-11-14 11:33:35 +01:00
2025-07-22 19:43:47 -07:00
2025-09-20 18:33:01 -07:00
2025-07-22 19:43:47 -07:00
2025-11-22 22:42:38 +00:00
2025-07-22 19:43:47 -07:00
2025-11-29 11:55:36 +00:00
2025-07-22 19:43:47 -07:00
2025-07-22 19:43:47 -07:00
2024-06-13 02:20:47 -07:00
2025-12-07 07:21:15 +01:00
2025-11-14 11:33:35 +01:00
2025-12-07 07:21:15 +01:00
2025-07-22 19:43:47 -07:00
2024-05-11 02:17:24 -07:00
2025-07-27 08:01:07 -04:00
2025-07-22 19:43:47 -07:00
2025-06-16 13:22:19 +03:30
2025-06-19 18:41:12 -04:00
2024-02-22 12:33:53 -08:00
2025-04-02 05:53:22 +01:00