common/fp/op/FPConvert: Amend off-by one in double NaN case in FPConvertNaN
Avoids potentially clobbering the intended sign bit value during conversions to double-precision values. The other conversion types are already properly handled, so those don't need to be addressed.
This commit is contained in:
parent
29e1a024c7
commit
36e739ba9b
@ -35,7 +35,7 @@ FPT_TO FPConvertNaN(FPT_FROM op) {
|
||||
const u64 exponent = Common::Ones<u64>(dest_bit_size - FPInfo<FPT_TO>::explicit_mantissa_width);
|
||||
|
||||
if constexpr (sizeof(FPT_TO) == sizeof(u64)) {
|
||||
return FPT_TO(shifted_sign | exponent << 52 | frac);
|
||||
return FPT_TO(shifted_sign | exponent << 51 | frac);
|
||||
} else if constexpr (sizeof(FPT_TO) == sizeof(u32)) {
|
||||
return FPT_TO(shifted_sign | exponent << 22 | Common::Bits<29, 50>(frac));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user