You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent results for -Float32x4.zero().clamp #40426
The fuzzer caught a bug where clamping -Float32x4.zero() would result in different results depending on whether or not the Float32x4.clamp() operation had been optimized.
In addition, the C implementation of the clamp operation will produce different results from intrinsics for both:
On arm64 for F32x4/F64x2 and arm32 F32x4 there's no value at all to having a clamp intrinsic as the assembly is identical to before.
On x86, we used hardware min/max which is not IEEE, now it will be IEEE all around and correct and we will be able to enable the fuzzer on it* and fix this issue.
* the fuzzer was disabled on reciprocal and reciprocalSqrt not here
Activity
[ DartFuzz ] Disable floating point operations when comparing differe…
aam commentedon May 10, 2022
Underlying issue with dart vm producing inconsistent clamp results around zero and negative zero is still relevant, still have to be fixed.
[vm/sim/simd] Fix vmin/vmax implementation on simulator.
[vm] Fix clamp runtime entries zero sign on arm and arm64
modulovalue commentedon Sep 11, 2026
@lrhn @mkustermann We've solved min/max in #63962 but we haven't solved clamp.
There are 3 different min/max versions specified for SIMD value types in wasm:
The clamp intrinsic doesn't seem to carry its weight.
Someone could want min -> max, pmin -> pmax or relaxed min -> relaxed max. Or maybe a mix, maybe they want to use the intermediate min results?
I'd like to propose the following new fixed implementation of clamp:
On arm64 for F32x4/F64x2 and arm32 F32x4 there's no value at all to having a clamp intrinsic as the assembly is identical to before.
On x86, we used hardware min/max which is not IEEE, now it will be IEEE all around and correct and we will be able to
enable the fuzzer on it*and fix this issue.* the fuzzer was disabled on reciprocal and reciprocalSqrt not here
[typed_data] Implement Float32x4 and Float64x2 clamp with min and max