From dce22585dd60c6b0d0219849954bb58e5c1371e3 Mon Sep 17 00:00:00 2001 From: As9xm <197338912+As9xm@users.noreply.github.com> Date: Thu, 10 Sep 2026 21:20:11 +0300 Subject: [PATCH] Fix CVTTPS2PI low lane using high lane for lower-bound check Case 0x2C (CVTTPS2PI Gm,Ex) validated GM.sd[0] against EX->f[1] for the negative-overflow test instead of EX->f[0]. The high lane just above correctly tests f[1] twice, and CVTPS2PI just below loops per-lane with f[i]. A low lane in range paired with an out-of-range high lane (e.g. f0=1.0, f1=-3e9) wrongly produced the 0x80000000 indefinite value, and a truly underflowing low lane could slip through. Test the low lane against itself. --- src/emu/x86run0f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/x86run0f.c b/src/emu/x86run0f.c index 6a04c4e3c..6bccf387c 100755 --- a/src/emu/x86run0f.c +++ b/src/emu/x86run0f.c @@ -270,7 +270,7 @@ uintptr_t Run0F(x86emu_t *emu, uintptr_t addr, int *step) GM.sd[1] = 0x80000000; else GM.sd[1] = EX->f[1]; - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x80000000U || EX->f[1]<-(float)0x80000000U) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x80000000U || EX->f[0]<-(float)0x80000000U) GM.sd[0] = 0x80000000; else GM.sd[0] = EX->f[0];