]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
softfloat: copy mod/rem quotient through uint64_t
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Sun, 31 May 2026 07:32:30 +0000 (00:32 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Sun, 31 May 2026 07:32:30 +0000 (00:32 -0700)
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

index baa1ffda5c384dc259a8ff6dc0cd006f384e5e87..e647cb126b5431aee78eb31c0d6a40a39496f273 100644 (file)
@@ -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, &quotient, 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, &quotient, s, &fs);
+       *q = quotient;
 }
 static void fp_scale(fpdata *a, fpdata *b)
 {