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
4 tests from spec/testsuite/conversions.wast and spec/testsuite/simd_conversions.wast fail on ppc64le #8626
Floating-point promotion
A prvalue of type float can be converted to a prvalue of type double. The value does not change.
In the case of NaNs, the value (NaN) is preserved regardless of the particular NaN that is picked, so we have no guarantee of the bitwise representation. And for double -> float:
If the conversion is listed under floating-point promotions, it is a promotion and not a conversion.
If the source value can be represented exactly in the destination type, it does not change.
If the source value is between two representable values of the destination type, the result is one of those two values (it is implementation-defined which one, although if IEEE arithmetic is supported, rounding defaults to nearest).
Otherwise, the behavior is undefined.
I assume NaN conversions again fall under case 1 meaning that the "value" (NaN) is preserved but not the bitwise representation. Or if not, it must be case 3 in which case converting a double NaN to a float NaN is UB (!).
Activity
rathann commentedon Apr 20, 2026
Looks like #8528 and #8472 are related to this.
kripken commentedon Apr 20, 2026
cc @stevenfontanella based on the linked issues
stevenfontanella commentedon Apr 23, 2026
Sent #8645 for this. Copying over my explanation:
The bug is due to the fact that C++ doesn't guarantee a bitwise representation for NaNs that are casted from double -> float or vice versa. From https://en.cppreference.com/cpp/language/implicit_conversion:
In the case of NaNs, the value (NaN) is preserved regardless of the particular NaN that is picked, so we have no guarantee of the bitwise representation. And for double -> float:
I assume NaN conversions again fall under case 1 meaning that the "value" (NaN) is preserved but not the bitwise representation. Or if not, it must be case 3 in which case converting a double NaN to a float NaN is UB (!).
Canonicalize NaNs when casting between float and double (WebAssembly#…