target/m68k: fix FPSR quotient byte for frem instruction
commit1a282f60a971aa86e3cdd1b7ca000790e43bb310
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sat, 14 Jan 2023 23:29:59 +0000 (14 23:29 +0000)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 16 Jan 2023 08:47:31 +0000 (16 09:47 +0100)
tree085450f7e196237764503a8f259c0e1a08ec5b7c
parentad6dae3b3369433ab43a1b190bb3a8aacabb1bbf
target/m68k: fix FPSR quotient byte for frem instruction

The FPSR quotient byte should be set to the value of the quotient and not the
result. Manually calculate the quotient in the frem helper in round to nearest
even mode (note this is different from the quotient calculated internally for
fmod), and use it to set the quotient byte accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1314
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230114232959.118224-5-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
target/m68k/fpu_helper.c