zig/test
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
..
behavior compiler-rt: fix f80 ceil/floor optimization 2026-01-08 00:45:52 +01:00
c_abi test: fix up c3ee8078b4 2025-12-16 09:01:51 +01:00
cases update test cases 2025-12-23 22:15:12 -08:00
cli/options test: move standalone/options/ to cli/options/ 2025-10-04 21:55:39 +02:00
incremental update all incremental tests to new std API 2025-12-23 22:15:11 -08:00
link std: move child process APIs to std.Io 2026-01-04 00:27:08 -08:00
src test: add openbsd targets to module test matrix 2026-01-05 16:50:46 +01:00
standalone test-standalone: update cases from posix.getrandom 2026-01-07 11:03:37 -08:00
behavior.zig delete behavior test that depends on std.fmt 2025-08-31 12:49:18 -07:00
cases.zig test: remove ad-hoc nvptx tests 2025-10-04 20:51:07 +02:00
compile_errors.zig compiler: refactor Zcu.File and path representation 2025-05-18 17:37:02 +01:00
error_traces.zig test: disable an error trace test on optimized powerpc64le 2025-12-16 06:22:46 +01:00
gen_h.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
libc.zig libc-test: disable utime.c 2025-10-15 10:58:30 +02:00
llvm_ir.zig test: Add some basic LLVM IR tests for atomics, volatile, and allowzero. 2025-05-12 17:07:50 +02:00
llvm_targets.zig test: remove some nonsensical openbsd targets from llvm_targets 2025-12-16 06:25:32 +01:00
stack_traces.zig std: back out the StackTrace byval changes 2025-10-29 06:20:50 -07:00
tests.zig test: add openbsd targets to module test matrix 2026-01-05 16:50:46 +01:00