1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mozglue/tests/ShowSSEConfig.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,123 @@ 1.4 +/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "mozilla/SSE.h" 1.10 +#include <stdio.h> 1.11 + 1.12 +int main() 1.13 +{ 1.14 + printf("CPUID detection present: %s\n", 1.15 +#ifdef MOZILLA_SSE_HAVE_CPUID_DETECTION 1.16 + "yes" 1.17 +#else 1.18 + "no" 1.19 +#endif 1.20 + ); 1.21 + 1.22 +#ifdef MOZILLA_COMPILE_WITH_MMX 1.23 +#define COMPILE_MMX_STRING "Y" 1.24 +#else 1.25 +#define COMPILE_MMX_STRING "-" 1.26 +#endif 1.27 +#ifdef MOZILLA_PRESUME_MMX 1.28 +#define PRESUME_MMX_STRING "Y" 1.29 +#else 1.30 +#define PRESUME_MMX_STRING "-" 1.31 +#endif 1.32 + 1.33 +#ifdef MOZILLA_COMPILE_WITH_SSE 1.34 +#define COMPILE_SSE_STRING "Y" 1.35 +#else 1.36 +#define COMPILE_SSE_STRING "-" 1.37 +#endif 1.38 +#ifdef MOZILLA_PRESUME_SSE 1.39 +#define PRESUME_SSE_STRING "Y" 1.40 +#else 1.41 +#define PRESUME_SSE_STRING "-" 1.42 +#endif 1.43 + 1.44 +#ifdef MOZILLA_COMPILE_WITH_SSE2 1.45 +#define COMPILE_SSE2_STRING "Y" 1.46 +#else 1.47 +#define COMPILE_SSE2_STRING "-" 1.48 +#endif 1.49 +#ifdef MOZILLA_PRESUME_SSE2 1.50 +#define PRESUME_SSE2_STRING "Y" 1.51 +#else 1.52 +#define PRESUME_SSE2_STRING "-" 1.53 +#endif 1.54 + 1.55 +#ifdef MOZILLA_COMPILE_WITH_SSE3 1.56 +#define COMPILE_SSE3_STRING "Y" 1.57 +#else 1.58 +#define COMPILE_SSE3_STRING "-" 1.59 +#endif 1.60 +#ifdef MOZILLA_PRESUME_SSE3 1.61 +#define PRESUME_SSE3_STRING "Y" 1.62 +#else 1.63 +#define PRESUME_SSE3_STRING "-" 1.64 +#endif 1.65 + 1.66 +#ifdef MOZILLA_COMPILE_WITH_SSSE3 1.67 +#define COMPILE_SSSE3_STRING "Y" 1.68 +#else 1.69 +#define COMPILE_SSSE3_STRING "-" 1.70 +#endif 1.71 +#ifdef MOZILLA_PRESUME_SSSE3 1.72 +#define PRESUME_SSSE3_STRING "Y" 1.73 +#else 1.74 +#define PRESUME_SSSE3_STRING "-" 1.75 +#endif 1.76 + 1.77 +#ifdef MOZILLA_COMPILE_WITH_SSE4A 1.78 +#define COMPILE_SSE4A_STRING "Y" 1.79 +#else 1.80 +#define COMPILE_SSE4A_STRING "-" 1.81 +#endif 1.82 +#ifdef MOZILLA_PRESUME_SSE4A 1.83 +#define PRESUME_SSE4A_STRING "Y" 1.84 +#else 1.85 +#define PRESUME_SSE4A_STRING "-" 1.86 +#endif 1.87 + 1.88 +#ifdef MOZILLA_COMPILE_WITH_SSE4_1 1.89 +#define COMPILE_SSE4_1_STRING "Y" 1.90 +#else 1.91 +#define COMPILE_SSE4_1_STRING "-" 1.92 +#endif 1.93 +#ifdef MOZILLA_PRESUME_SSE4_1 1.94 +#define PRESUME_SSE4_1_STRING "Y" 1.95 +#else 1.96 +#define PRESUME_SSE4_1_STRING "-" 1.97 +#endif 1.98 + 1.99 +#ifdef MOZILLA_COMPILE_WITH_SSE4_2 1.100 +#define COMPILE_SSE4_2_STRING "Y" 1.101 +#else 1.102 +#define COMPILE_SSE4_2_STRING "-" 1.103 +#endif 1.104 +#ifdef MOZILLA_PRESUME_SSE4_2 1.105 +#define PRESUME_SSE4_2_STRING "Y" 1.106 +#else 1.107 +#define PRESUME_SSE4_2_STRING "-" 1.108 +#endif 1.109 + 1.110 + printf("Feature Presume Compile Support Use\n"); 1.111 +#define SHOW_INFO(featurelc_, featureuc_) \ 1.112 + printf( "%7s %1s %1s %1s\n", \ 1.113 + #featurelc_, \ 1.114 + PRESUME_##featureuc_##_STRING, \ 1.115 + COMPILE_##featureuc_##_STRING, \ 1.116 + (mozilla::supports_##featurelc_() ? "Y" : "-")); 1.117 + SHOW_INFO(mmx, MMX) 1.118 + SHOW_INFO(sse, SSE) 1.119 + SHOW_INFO(sse2, SSE2) 1.120 + SHOW_INFO(sse3, SSE3) 1.121 + SHOW_INFO(ssse3, SSSE3) 1.122 + SHOW_INFO(sse4a, SSE4A) 1.123 + SHOW_INFO(sse4_1, SSE4_1) 1.124 + SHOW_INFO(sse4_2, SSE4_2) 1.125 + return 0; 1.126 +}