diff options
| author | 2026-03-10 06:07:01 +1100 | |
|---|---|---|
| committer | 2026-03-10 06:07:01 +1100 | |
| commit | 9d61c9b15fe82f0ce35946830cf90832ce266595 (patch) | |
| tree | b58b401685f262a3aba1e49e1562a3be9d8e8360 /src/devices/cpu | |
| parent | 08cc625c92ddac7f8c266b78f03c2c30559db880 (diff) | |
cpu/sharc/compute.hxx: Fixed saturation without resorting to comparisons.
Diffstat (limited to 'src/devices/cpu')
| -rw-r--r-- | src/devices/cpu/sharc/compute.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/cpu/sharc/compute.hxx b/src/devices/cpu/sharc/compute.hxx index 77fbc935559..2271d2eec37 100644 --- a/src/devices/cpu/sharc/compute.hxx +++ b/src/devices/cpu/sharc/compute.hxx @@ -23,7 +23,7 @@ #define SET_FLAG_MU(r) do { m_core->astat |= (((uint32_t((r) >> 32) == 0) && (uint32_t(r)) != 0) ? MU : 0); } while (false) // saturate overflowed result -inline void SATURATE(uint32_t &r) { r = (r ^ 0x80000000) | 0x7fffffff; } +inline void SATURATE(uint32_t &r) { r = uint32_t((int32_t(r) >> 31) ^ 0x80000000); } constexpr bool IS_FLOAT_ZERO(uint32_t r) { return (r & (FLOAT_EXPONENT_MASK | FLOAT_MANTISSA_MASK)) == 0; } constexpr bool IS_FLOAT_DENORMAL(uint32_t r) { return ((r & FLOAT_EXPONENT_MASK) == 0) && ((r & FLOAT_MANTISSA_MASK) != 0); } |
