From 3623cb9785a1c7b593ebc65c42c23a4db981ada4 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 31 Mar 2022 09:11:54 +0200 Subject: Improved test17 (sse), and fixed NAN bordercase for PSQRTPD opcode --- src/emu/x64run660f.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c index 148c99eb..09354192 100644 --- a/src/emu/x64run660f.c +++ b/src/emu/x64run660f.c @@ -794,8 +794,14 @@ int Run660F(x64emu_t *emu, rex_t rex) nextop = F8; GETEX(0); GETGX; - GX->d[0] = sqrt(EX->d[0]); - GX->d[1] = sqrt(EX->d[1]); + for (int i=0; i<2; ++i) { + #ifndef NOALIGN + if(EX->d[i]<0.0) // on x86, default nan are negative + GX->d[i] = -NAN; + else + #endif + GX->d[i] = sqrt(EX->d[i]); + } break; case 0x54: /* ANDPD Gx, Ex */ -- cgit 1.4.1