qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/4] target/m68k: fix FPSR quotient byte for fmod and frem


From: Mark Cave-Ayland
Subject: [PATCH 0/4] target/m68k: fix FPSR quotient byte for fmod and frem
Date: Sun, 1 Jan 2023 14:43:34 +0000

This series is taken from my MacOS branch and fixes setting the FPSR quotient
byte for the fmod and frem instructions which was causing the MacOS _Pack5
SANE trancendentals implementation to return incorrect values for sin() and
cos().

The first 2 patches update make_quotient() to take separate sign and value
parameters so that it can be used for both floatx80_modrem() and a manual
division calculation, whilst the last 2 patches fix the value of the quotient
byte for both the fmod and frem instructions. This series has been validated
against the fmod and frem results using a custom test program which has been
run on a real 68040 Mac.

Many thanks to the mac68k folk for their help debugging this, in particular
SolraBizna for narrowing down the issue to the transcendentals and writing
the custom test program, and also treellama and Cat7 for running the test
program on real hardware and uploading the generated results file for
further analysis.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (4):
  target/m68k: pass quotient directly into make_quotient()
  target/m68k: pass sign directly into make_quotient()
  target/m68k: fix FPSR quotient byte for fmod instruction
  target/m68k: fix FPSR quotient byte for frem instruction

 target/m68k/fpu_helper.c | 43 ++++++++++++++++++++++++----------------
 1 file changed, 26 insertions(+), 17 deletions(-)

-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]