1 #define _XOPEN_SOURCE 600
15 unsigned long cpuflags = 0;
24 #ifndef USE_X86_64_ASM
33 : "%eax", "%ecx", "%edx", "memory"
46 : "%rax", "%rcx", "%rdx", "memory"
49 #endif /* USE_X86_64_ASM */
51 if (cpuflags & (1<<25)) {
52 _flags = Flags (_flags | (HasSSE|HasFlushToZero));
55 if (cpuflags & (1<<26)) {
56 _flags = Flags (_flags | HasSSE2);
59 if (cpuflags & (1 << 24)) {
63 #ifdef NO_POSIX_MEMALIGN
64 if ((fxbuf = (char *) malloc(512)) == 0)
66 if (posix_memalign ((void**)&fxbuf, 16, 512))
69 error << _("cannot allocate 16 byte aligned buffer for h/w feature detection") << endmsg;
79 uint32_t mxcsr_mask = *((uint32_t*) &fxbuf[28]);
81 /* if the mask is zero, set its default value (from intel specs) */
83 if (mxcsr_mask == 0) {
87 if (mxcsr_mask & (1<<6)) {
88 _flags = Flags (_flags | HasDenormalsAreZero);