20 #include "libpbd-config.h"
22 #define _XOPEN_SOURCE 600
28 #ifdef PLATFORM_WINDOWS
42 unsigned long cpuflags = 0;
46 #if !( (defined __x86_64__) || (defined __i386__) || (defined _M_X64) || (defined _M_IX86) ) // !ARCH_X86
50 #ifdef PLATFORM_WINDOWS
57 cpuflags = cpuInfo[3];
74 :
"%eax",
"%ecx",
"%edx"
93 :
"%rax",
"%rbx",
"%rcx",
"%rdx"
99 if (cpuflags & (1<<25)) {
100 _flags =
Flags (_flags | (HasSSE|HasFlushToZero));
103 if (cpuflags & (1<<26)) {
104 _flags =
Flags (_flags | HasSSE2);
107 if (cpuflags & (1 << 24)) {
121 #ifndef HAVE_POSIX_MEMALIGN
122 # ifdef PLATFORM_WINDOWS
123 fxbuf = (
char **) _aligned_malloc (
sizeof (
char *), 16);
125 *fxbuf = (
char *) _aligned_malloc (512, 16);
128 # warning using default malloc for aligned memory
129 fxbuf = (
char **) malloc (
sizeof (
char *));
131 *fxbuf = (
char *) malloc (512);
135 (void) posix_memalign ((
void **) &fxbuf, 16,
sizeof (
char *));
137 (void) posix_memalign ((
void **) fxbuf, 16, 512);
141 memset (*fxbuf, 0, 512);
158 uint32_t mxcsr_mask = *((uint32_t*) &((*fxbuf)[28]));
162 if (mxcsr_mask == 0) {
166 if (mxcsr_mask & (1<<6)) {
167 _flags =
Flags (_flags | HasDenormalsAreZero);
170 #if !defined HAVE_POSIX_MEMALIGN && defined PLATFORM_WINDOWS
171 _aligned_free (*fxbuf);
172 _aligned_free (fxbuf);