fpip x64 fxsave working with using hflags to check CPU mode

This commit is contained in:
mothran 2015-08-30 18:56:55 -07:00
parent 912faf2c3c
commit 4cd5fa3811

View file

@ -986,6 +986,21 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32)
}
}
}
#ifdef TARGET_X86_64
// DFLAG enum: tcg.h, case here to int
if (env->hflags & HF_CS64_MASK) {
printf("HELLO\n");
cpu_stl_data(env, ptr, env->fpuc);
cpu_stl_data(env, ptr + 4, fpus);
cpu_stl_data(env, ptr + 8, fptag);
cpu_stl_data(env, ptr + 12, env->fpip); /* fpip */
cpu_stl_data(env, ptr + 20, 0); /* fpcs */
cpu_stl_data(env, ptr + 24, 0); /* fpoo */
cpu_stl_data(env, ptr + 28, 0); /* fpos */
}
#endif
if (!(env->hflags & HF_CS64_MASK))
{
if (data32) {
/* 32 bit */
cpu_stl_data(env, ptr, env->fpuc);
@ -1005,6 +1020,7 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32)
cpu_stw_data(env, ptr + 10, 0);
cpu_stw_data(env, ptr + 12, 0);
}
}
void helper_fldenv(CPUX86State *env, target_ulong ptr, int data32)