From b052050f3cf697baf22528012829c5539bf27ca0 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 30 Dec 2019 17:21:46 -0600 Subject: [PATCH] i386: round before checking for exceptions (nw) --- src/devices/cpu/i386/x87ops.hxx | 12 ++++-------- src/devices/machine/i8087.cpp | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/devices/cpu/i386/x87ops.hxx b/src/devices/cpu/i386/x87ops.hxx index 31789dbf0d7..1f2bdc4564a 100644 --- a/src/devices/cpu/i386/x87ops.hxx +++ b/src/devices/cpu/i386/x87ops.hxx @@ -2943,11 +2943,9 @@ void i386_device::x87_fst_m32real(uint8_t modrm) value = ST(0); } + uint32_t m32real = floatx80_to_float32(value); if (x87_check_exceptions(true)) - { - uint32_t m32real = floatx80_to_float32(value); WRITE32(ea, m32real); - } CYCLES(7); } @@ -2970,11 +2968,9 @@ void i386_device::x87_fst_m64real(uint8_t modrm) value = ST(0); } + uint64_t m64real = floatx80_to_float64(value); if (x87_check_exceptions(true)) - { - uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); - } CYCLES(8); } @@ -3024,9 +3020,9 @@ void i386_device::x87_fstp_m32real(uint8_t modrm) value = ST(0); } + uint32_t m32real = floatx80_to_float32(value); if (x87_check_exceptions(true)) { - uint32_t m32real = floatx80_to_float32(value); WRITE32(ea, m32real); x87_inc_stack(); } @@ -3053,9 +3049,9 @@ void i386_device::x87_fstp_m64real(uint8_t modrm) uint32_t ea = Getx87EA(modrm, 1); + uint64_t m64real = floatx80_to_float64(value); if (x87_check_exceptions(true)) { - uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); x87_inc_stack(); } diff --git a/src/devices/machine/i8087.cpp b/src/devices/machine/i8087.cpp index e203ee82d4e..b0b1bce08fc 100644 --- a/src/devices/machine/i8087.cpp +++ b/src/devices/machine/i8087.cpp @@ -2769,11 +2769,9 @@ void i8087_device::fst_m32real(u8 modrm) value = ST(0); } + u32 m32real = floatx80_to_float32(value); if (check_exceptions(true)) - { - u32 m32real = floatx80_to_float32(value); WRITE32(ea, m32real); - } CYCLES(7); } @@ -2794,11 +2792,9 @@ void i8087_device::fst_m64real(u8 modrm) value = ST(0); } + u64 m64real = floatx80_to_float64(value); if (check_exceptions(true)) - { - uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); - } CYCLES(8); } @@ -2841,9 +2837,9 @@ void i8087_device::fstp_m32real(u8 modrm) value = ST(0); } + u32 m32real = floatx80_to_float32(value); if (check_exceptions(true)) { - u32 m32real = floatx80_to_float32(value); WRITE32(ea, m32real); inc_stack(); } @@ -2868,9 +2864,9 @@ void i8087_device::fstp_m64real(u8 modrm) u32 ea = m_ea; + u64 m64real = floatx80_to_float64(value); if (check_exceptions(true)) { - uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); inc_stack(); }