900643afc792218b2ffc46206a821b8b733f0b20
9 // On Intel set FZ (Flush to Zero) and DAZ (Denormals Are Zero)
10 // flags to avoid costly denormals
12 #include <xmmintrin.h>
14 #define AVOIDDENORMALS _mm_setcsr(_mm_getcsr() | 0x8040)
16 #define AVOIDDENORMALS _mm_setcsr(_mm_getcsr() | 0x8000)
19 #define AVOIDDENORMALS
22 struct XXXX_Meta
: std::map
<const char*, const char*>
24 void declare (const char* key
, const char* value
) { (*this)[key
]=value
; }
29 virtual void declare (const char* key
, const char* value
) = 0;
32 struct MY_Meta
: Meta
, std::map
<const char*, const char*>
34 void declare (const char* key
, const char* value
) { (*this)[key
]=value
; }
37 #define max(x,y) (((x)>(y)) ? (x) : (y))
38 #define min(x,y) (((x)<(y)) ? (x) : (y))
40 inline int lsr (int x
, int n
) { return int(((unsigned int)x
) >> n
); }
41 inline int int2pow2 (int x
) { int r
=0; while ((1<<r
)<x
) r
++; return r
; }
43 long lopt(char *argv
[], const char *name
, long def
)
46 for (i
= 0; argv
[i
]; i
++) if (!strcmp(argv
[i
], name
)) return atoi(argv
[i
+1]);
50 char* lopts(char *argv
[], const char *name
, char* def
)
53 for (i
= 0; argv
[i
]; i
++) if (!strcmp(argv
[i
], name
)) return argv
[i
+1];