On 2020/2/22 上午12:18, Paolo Bonzini wrote: > On 21/02/20 15:09, Chen Gang wrote: >>> - /* XXX: test fptags too */ >>> + if (env->fptags[env->fpstt]) { >>> + env->fpus |= 0x4100; /* Empty */ >>> + return; >>> + } >>> + >> For fpop overflow, this fix is enough, but for me, we still need >> foverflow to check fpush/fld*_ST0 overflow. >> >> Don't you think we need check fpush/f[i]ld*_ST0 overflow? > > After fld/fild or any other push, FXAM ST0 should not return empty in my > opinion. >
OK, it sounds reasonable. After check the intel document for f[i]ld* instructions, it says: "Set C1 to 1 if stack overflow occurred; set to 0 otherwise". In helper_fxam_ST0, I guess, we need "env->fpus |= 0x200" (but I don't know wheter it will be conflict with SIGND(temp)). And we have to still need foverflow, because all env->fptags being 0 doesn't mean overflow. Thanks.