std/softfloat: compare non-negative, non-NaN operands directly

The f64 and f32 comparison, min and max functions now compare the bit
patterns directly when neither operand is negative or a NaN, and call
the unchanged general code (now f64_cmp_slow and f32_cmp_slow)
otherwise. Results are unchanged: the ops harness and the old-vs-new
differential test report zero mismatches.
This commit is contained in:
Claude committed 2026-10-27 10:30:04 +00:00
1 parent ab5930ffbb
commit 44a9ca086c
4 files changed
+311 -32

No files matched your search

+5
View File
@@ -118,6 +118,11 @@ Newsletter, 1995). The tests confirm this against hardware, including for
subnormal `f32` results. The fast paths never produce a NaN, so NaN results
(and their payloads) are exactly those of the "via `f64`" computation.
The comparison functions (`f64_cmp`, `f64_lt`, `f64_min`, etc. and their `f32`
counterparts) compare the bit patterns directly when neither operand is
negative or a NaN (when `a | b` is at most the bit pattern of `+inf`), and
otherwise call `f64_cmp_slow` or `f32_cmp_slow`.
## log2