|
1 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "mozilla/SSE.h" |
|
7 #include <stdio.h> |
|
8 |
|
9 int main() |
|
10 { |
|
11 printf("CPUID detection present: %s\n", |
|
12 #ifdef MOZILLA_SSE_HAVE_CPUID_DETECTION |
|
13 "yes" |
|
14 #else |
|
15 "no" |
|
16 #endif |
|
17 ); |
|
18 |
|
19 #ifdef MOZILLA_COMPILE_WITH_MMX |
|
20 #define COMPILE_MMX_STRING "Y" |
|
21 #else |
|
22 #define COMPILE_MMX_STRING "-" |
|
23 #endif |
|
24 #ifdef MOZILLA_PRESUME_MMX |
|
25 #define PRESUME_MMX_STRING "Y" |
|
26 #else |
|
27 #define PRESUME_MMX_STRING "-" |
|
28 #endif |
|
29 |
|
30 #ifdef MOZILLA_COMPILE_WITH_SSE |
|
31 #define COMPILE_SSE_STRING "Y" |
|
32 #else |
|
33 #define COMPILE_SSE_STRING "-" |
|
34 #endif |
|
35 #ifdef MOZILLA_PRESUME_SSE |
|
36 #define PRESUME_SSE_STRING "Y" |
|
37 #else |
|
38 #define PRESUME_SSE_STRING "-" |
|
39 #endif |
|
40 |
|
41 #ifdef MOZILLA_COMPILE_WITH_SSE2 |
|
42 #define COMPILE_SSE2_STRING "Y" |
|
43 #else |
|
44 #define COMPILE_SSE2_STRING "-" |
|
45 #endif |
|
46 #ifdef MOZILLA_PRESUME_SSE2 |
|
47 #define PRESUME_SSE2_STRING "Y" |
|
48 #else |
|
49 #define PRESUME_SSE2_STRING "-" |
|
50 #endif |
|
51 |
|
52 #ifdef MOZILLA_COMPILE_WITH_SSE3 |
|
53 #define COMPILE_SSE3_STRING "Y" |
|
54 #else |
|
55 #define COMPILE_SSE3_STRING "-" |
|
56 #endif |
|
57 #ifdef MOZILLA_PRESUME_SSE3 |
|
58 #define PRESUME_SSE3_STRING "Y" |
|
59 #else |
|
60 #define PRESUME_SSE3_STRING "-" |
|
61 #endif |
|
62 |
|
63 #ifdef MOZILLA_COMPILE_WITH_SSSE3 |
|
64 #define COMPILE_SSSE3_STRING "Y" |
|
65 #else |
|
66 #define COMPILE_SSSE3_STRING "-" |
|
67 #endif |
|
68 #ifdef MOZILLA_PRESUME_SSSE3 |
|
69 #define PRESUME_SSSE3_STRING "Y" |
|
70 #else |
|
71 #define PRESUME_SSSE3_STRING "-" |
|
72 #endif |
|
73 |
|
74 #ifdef MOZILLA_COMPILE_WITH_SSE4A |
|
75 #define COMPILE_SSE4A_STRING "Y" |
|
76 #else |
|
77 #define COMPILE_SSE4A_STRING "-" |
|
78 #endif |
|
79 #ifdef MOZILLA_PRESUME_SSE4A |
|
80 #define PRESUME_SSE4A_STRING "Y" |
|
81 #else |
|
82 #define PRESUME_SSE4A_STRING "-" |
|
83 #endif |
|
84 |
|
85 #ifdef MOZILLA_COMPILE_WITH_SSE4_1 |
|
86 #define COMPILE_SSE4_1_STRING "Y" |
|
87 #else |
|
88 #define COMPILE_SSE4_1_STRING "-" |
|
89 #endif |
|
90 #ifdef MOZILLA_PRESUME_SSE4_1 |
|
91 #define PRESUME_SSE4_1_STRING "Y" |
|
92 #else |
|
93 #define PRESUME_SSE4_1_STRING "-" |
|
94 #endif |
|
95 |
|
96 #ifdef MOZILLA_COMPILE_WITH_SSE4_2 |
|
97 #define COMPILE_SSE4_2_STRING "Y" |
|
98 #else |
|
99 #define COMPILE_SSE4_2_STRING "-" |
|
100 #endif |
|
101 #ifdef MOZILLA_PRESUME_SSE4_2 |
|
102 #define PRESUME_SSE4_2_STRING "Y" |
|
103 #else |
|
104 #define PRESUME_SSE4_2_STRING "-" |
|
105 #endif |
|
106 |
|
107 printf("Feature Presume Compile Support Use\n"); |
|
108 #define SHOW_INFO(featurelc_, featureuc_) \ |
|
109 printf( "%7s %1s %1s %1s\n", \ |
|
110 #featurelc_, \ |
|
111 PRESUME_##featureuc_##_STRING, \ |
|
112 COMPILE_##featureuc_##_STRING, \ |
|
113 (mozilla::supports_##featurelc_() ? "Y" : "-")); |
|
114 SHOW_INFO(mmx, MMX) |
|
115 SHOW_INFO(sse, SSE) |
|
116 SHOW_INFO(sse2, SSE2) |
|
117 SHOW_INFO(sse3, SSE3) |
|
118 SHOW_INFO(ssse3, SSSE3) |
|
119 SHOW_INFO(sse4a, SSE4A) |
|
120 SHOW_INFO(sse4_1, SSE4_1) |
|
121 SHOW_INFO(sse4_2, SSE4_2) |
|
122 return 0; |
|
123 } |