All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] target/m68k: fix FPSR quotient byte for fmod and frem
@ 2023-01-04 13:45 Mark Cave-Ayland
  2023-01-04 13:45 ` [PATCH v2 1/4] target/m68k: pass quotient directly into make_quotient() Mark Cave-Ayland
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Mark Cave-Ayland @ 2023-01-04 13:45 UTC (permalink / raw)
  To: laurent, qemu-devel

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>

v2:
- Add Laurent's R-B tags to patches 1, 3 and 4
- Rework patch 2 as suggested by Richard


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 | 46 +++++++++++++++++++++++++---------------
 1 file changed, 29 insertions(+), 17 deletions(-)

-- 
2.30.2



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-01-09  1:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 13:45 [PATCH v2 0/4] target/m68k: fix FPSR quotient byte for fmod and frem Mark Cave-Ayland
2023-01-04 13:45 ` [PATCH v2 1/4] target/m68k: pass quotient directly into make_quotient() Mark Cave-Ayland
2023-01-04 17:37   ` Richard Henderson
2023-01-04 13:45 ` [PATCH v2 2/4] target/m68k: pass sign " Mark Cave-Ayland
2023-01-04 16:04   ` Laurent Vivier
2023-01-04 17:38   ` Richard Henderson
2023-01-04 13:45 ` [PATCH v2 3/4] target/m68k: fix FPSR quotient byte for fmod instruction Mark Cave-Ayland
2023-01-04 17:59   ` Richard Henderson
2023-01-04 13:45 ` [PATCH v2 4/4] target/m68k: fix FPSR quotient byte for frem instruction Mark Cave-Ayland
2023-01-04 18:04   ` Richard Henderson
2023-01-07 23:00     ` Mark Cave-Ayland
2023-01-09  1:55       ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.