mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
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:
4 files changed
+311
-32
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user