mirror of
https://github.com/ptitSeb/box64.git
synced 2025-05-08 16:18:30 +08:00
[INTERP] Improved NAN handling for some (V)SQRTS[S/D] opcodes
This commit is contained in:
parent
ab70523b39
commit
7b2e084170
@ -188,6 +188,8 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step)
|
||||
GETGX; GETVX; GETGY;
|
||||
if(EX->d[0]<0.0 )
|
||||
GX->d[0] = -NAN;
|
||||
else if(isnan(EX->d[0]))
|
||||
GX->d[0] = EX->d[0];
|
||||
else
|
||||
GX->d[0] = sqrt(EX->d[0]);
|
||||
GX->q[1] = VX->q[1];
|
||||
|
@ -210,6 +210,8 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step)
|
||||
GETGX; GETVX; GETGY;
|
||||
if(EX->f[0]<0.0 )
|
||||
GX->f[0] = -NAN;
|
||||
else if(isnanf(EX->f[0]))
|
||||
GX->f[0] = EX->f[0];
|
||||
else
|
||||
GX->f[0] = sqrt(EX->f[0]);
|
||||
if(GX!=VX) {
|
||||
|
@ -209,6 +209,8 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
|
||||
GETGX;
|
||||
if(EX->d[0]<0.0 )
|
||||
GX->d[0] = -NAN;
|
||||
else if(isnan(EX->d[0]))
|
||||
GX->d[0] = EX->d[0];
|
||||
else
|
||||
GX->d[0] = sqrt(EX->d[0]);
|
||||
break;
|
||||
|
@ -214,8 +214,12 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
NAN_PROPAGATION(GX->f[0], EX->f[0], break);
|
||||
GX->f[0] = sqrtf(EX->f[0]);
|
||||
if (EX->f[0]<0)
|
||||
GX->f[0] = -NAN;
|
||||
else if (isnanf(EX->f[0]))
|
||||
GX->f[0] = EX->f[0];
|
||||
else
|
||||
GX->f[0] = sqrtf(EX->f[0]);
|
||||
break;
|
||||
case 0x52: /* RSQRTSS Gx, Ex */
|
||||
nextop = F8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user