Lurie97 wrote:
@arsenm Reworked to scale with `__clc_ldexp` directly, matching the ocml
`expF_base.h` flow, and dropped the fixup path.
- **Normal results unchanged:** `ldexp(y, p)` is bit-identical to the old
`as_int(y) + (p << 23)` for normal results; only the subnormal range
changes.
- **`llim`:** `exp` uses `ln(2^-149)`, `exp2` uses `-149` — the smallest
subnormal, rounded so the boundary input isn't flushed (no off-by-one).
- **Clamp `[-151, 129]`:** representable `p ∈ [-149, 128]` for both, so the
clamp only catches inputs already saturated to inf/zero by the ulim/llim
selects. Without it, extreme inputs made `ldexp` return NaN.
Verified on i.MX95 Mali-G310 (FTZ device): CTS `math_brute_force` exp/exp2
pass
6/6. Re-requested your review — happy to make the clamp bounds named
constants.
https://github.com/llvm/llvm-project/pull/212696
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits