From 9d5707ebd4d64ae0123ba64e1a18d3b219b89438 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sun, 31 May 2026 00:32:30 -0700 Subject: [PATCH] softfloat: copy mod/rem quotient through uint64_t floatx80_mod() and floatx80_rem() take a uint64_t quotient pointer, while the FPU wrapper stores the quotient in uae_u64. Copy through a temporary so the call does not depend on those typedefs being the same type on every host. --- fpp_softfloat.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fpp_softfloat.cpp b/fpp_softfloat.cpp index baa1ffda..e647cb12 100644 --- a/fpp_softfloat.cpp +++ b/fpp_softfloat.cpp @@ -350,7 +350,9 @@ static void fp_getman(fpdata *a, fpdata *b) } static void fp_mod(fpdata *a, fpdata *b, uae_u64 *q, uae_u8 *s) { - a->fpx = floatx80_mod(a->fpx, b->fpx, q, s, &fs); + uint64_t quotient = *q; + a->fpx = floatx80_mod(a->fpx, b->fpx, "ient, s, &fs); + *q = quotient; } static void fp_sgldiv(fpdata *a, fpdata *b) { @@ -362,7 +364,9 @@ static void fp_sglmul(fpdata *a, fpdata *b) } static void fp_rem(fpdata *a, fpdata *b, uae_u64 *q, uae_u8 *s) { - a->fpx = floatx80_rem(a->fpx, b->fpx, q, s, &fs); + uint64_t quotient = *q; + a->fpx = floatx80_rem(a->fpx, b->fpx, "ient, s, &fs); + *q = quotient; } static void fp_scale(fpdata *a, fpdata *b) { -- 2.47.3