mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 06:25:12 +00:00
target-i386: xsave: Simplify CPUID[0xD,0].{EAX,EDX} calculation
Instead of assigning individual bits in a loop, just copy the values from ena_mask. Backports commit 8057c621b1b17cbcb35fe67d1a09ada9055873a9 from qemu
This commit is contained in:
parent
c7195afd32
commit
c35e9eb9af
|
@ -2550,15 +2550,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
|||
for (i = 2; i < ARRAY_SIZE(x86_ext_save_areas); i++) {
|
||||
const ExtSaveArea *esa = &x86_ext_save_areas[i];
|
||||
if ((ena_mask >> i) & 1) {
|
||||
if (i < 32) {
|
||||
*eax |= 1u << i;
|
||||
} else {
|
||||
*edx |= 1u << (i - 32);
|
||||
}
|
||||
*ecx = MAX(*ecx, esa->offset + esa->size);
|
||||
}
|
||||
}
|
||||
*eax |= ena_mask & (XSTATE_FP_MASK | XSTATE_SSE_MASK);
|
||||
*eax = ena_mask;
|
||||
*edx = ena_mask >> 32;
|
||||
*ebx = *ecx;
|
||||
} else if (count == 1) {
|
||||
*eax = env->features[FEAT_XSAVE];
|
||||
|
|
Loading…
Reference in a new issue