mozglue/tests/ShowSSEConfig.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial