23 |
|
|
24 |
#include "Features.h" |
#include "Features.h" |
25 |
|
|
26 |
#if ARCH_X86 |
#if CONFIG_ASM && ARCH_X86 |
27 |
bool Features::bMMX(false); |
bool Features::bMMX(false); |
28 |
bool Features::bSSE(false); |
bool Features::bSSE(false); |
29 |
bool Features::bSSE2(false); |
bool Features::bSSE2(false); |
55 |
} |
} |
56 |
#else |
#else |
57 |
void Features::detect() {} |
void Features::detect() {} |
58 |
#endif // ARCH_X86 |
#endif // CONFIG_ASM && ARCH_X86 |
59 |
|
|
60 |
void Features::enableDenormalsAreZeroMode() { |
void Features::enableDenormalsAreZeroMode() { |
61 |
#if ARCH_X86 |
#if CONFIG_ASM && ARCH_X86 |
62 |
if (supportsSSE2()) { |
if (supportsSSE2()) { |
63 |
int x; |
int x; |
64 |
__asm__ __volatile__ ( |
__asm__ __volatile__ ( |
71 |
: "%eax" |
: "%eax" |
72 |
); |
); |
73 |
} |
} |
74 |
#endif // ARCH_X86 |
#endif // CONFIG_ASM && ARCH_X86 |
75 |
} |
} |
76 |
|
|
77 |
String Features::featuresAsString() { |
String Features::featuresAsString() { |
78 |
String sFeatures = "none"; |
String sFeatures = "none"; |
79 |
#if ARCH_X86 |
#if CONFIG_ASM && ARCH_X86 |
80 |
if (supportsMMX()) sFeatures = "MMX"; |
if (supportsMMX()) sFeatures = "MMX"; |
81 |
if (supportsSSE()) sFeatures += " SSE"; |
if (supportsSSE()) sFeatures += " SSE"; |
82 |
if (supportsSSE2()) sFeatures += " SSE2"; |
if (supportsSSE2()) sFeatures += " SSE2"; |
83 |
#endif // ARCH_X86 |
#else |
84 |
|
sFeatures = "disabled at compile time"; |
85 |
|
#endif // CONFIG_ASM && ARCH_X86 |
86 |
return sFeatures; |
return sFeatures; |
87 |
} |
} |