Fixed incorrect sqrt results on 32bit targets using x87 math

Cleaner implementation of FSWAP
This commit is contained in:
tevador
2019-05-15 13:23:50 +02:00
parent 1aa7865619
commit afaeff6066
3 changed files with 33 additions and 13 deletions

View File

@@ -127,6 +127,9 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
void rx_reset_float_state() {
setRoundMode_(FE_TONEAREST);
#ifdef RANDOMX_USE_X87
_control87(_PC_53, _MCW_PC); //set x87 precision to 53 bits
#endif
}
void rx_set_rounding_mode(uint32_t mode) {