[PATCH 5/8] ntdll: Add detection for PF_SSE_DAZ_MODE_AVAILABLE

Chris Robinson chris.kcat at gmail.com
Sat Oct 20 20:06:41 CDT 2012


On 10/20/2012 05:40 PM, James Eder wrote:
> +    /* Intel says we need a zeroed 16-byte aligned buffer */
> +    char buffer[512 + 16];
> +    XMM_SAVE_AREA32 *state = (XMM_SAVE_AREA32 *)(((ULONG_PTR)buffer + 15) & ~15);
> +    memset(buffer, 0, sizeof(buffer));
> +
> +    __asm__ __volatile__( "fxsave %0" : "=m" (*state) : "m" (*state) );

Wouldn't this be simpler?

DECLSPEC_ALIGN(16) XMM_SAVE_AREA32 state;
memset(state, 0, sizeof(state));
__asm__ __volatile__("fxsave %0" : "=m" (*&state) : "m" (*&state));

May also want to make sure the two structs are packed.



More information about the wine-devel mailing list