LCOV - code coverage report
Current view: directory - xpcom/tests - ShowSSEConfig.cpp (source / functions) Found Hit Coverage
Test: app.info Lines: 12 12 100.0 %
Date: 2012-06-02 Functions: 1 1 100.0 %

       1                 : /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
       2                 : /* ***** BEGIN LICENSE BLOCK *****
       3                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       4                 :  *
       5                 :  * The contents of this file are subject to the Mozilla Public License Version
       6                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       7                 :  * the License. You may obtain a copy of the License at
       8                 :  * http://www.mozilla.org/MPL/
       9                 :  *
      10                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      11                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      12                 :  * for the specific language governing rights and limitations under the
      13                 :  * License.
      14                 :  *
      15                 :  * The Original Code is ShowSSEConfig.cpp.
      16                 :  *
      17                 :  * The Initial Developer of the Original Code is the Mozilla Foundation.
      18                 :  * Portions created by the Initial Developer are Copyright (C) 2009
      19                 :  * the Initial Developer. All Rights Reserved.
      20                 :  *
      21                 :  * Contributor(s):
      22                 :  *   L. David Baron <dbaron@dbaron.org>, Mozilla Corporation (original author)
      23                 :  *
      24                 :  * Alternatively, the contents of this file may be used under the terms of
      25                 :  * either the GNU General Public License Version 2 or later (the "GPL"), or
      26                 :  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      27                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      28                 :  * of those above. If you wish to allow use of your version of this file only
      29                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      30                 :  * use your version of this file under the terms of the MPL, indicate your
      31                 :  * decision by deleting the provisions above and replace them with the notice
      32                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      33                 :  * the provisions above, a recipient may use your version of this file under
      34                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      35                 :  *
      36                 :  * ***** END LICENSE BLOCK ***** */
      37                 : 
      38                 : #include "mozilla/SSE.h"
      39                 : #include <stdio.h>
      40                 : 
      41               1 : int main()
      42                 : {
      43                 :   printf("CPUID detection present: %s\n",
      44                 : #ifdef MOZILLA_SSE_HAVE_CPUID_DETECTION
      45                 :          "yes"
      46                 : #else
      47                 :          "no"
      48                 : #endif
      49               1 :         );
      50                 : 
      51                 : #ifdef MOZILLA_COMPILE_WITH_MMX
      52                 : #define COMPILE_MMX_STRING "Y"
      53                 : #else
      54                 : #define COMPILE_MMX_STRING "-"
      55                 : #endif
      56                 : #ifdef MOZILLA_PRESUME_MMX
      57                 : #define PRESUME_MMX_STRING "Y"
      58                 : #else
      59                 : #define PRESUME_MMX_STRING "-"
      60                 : #endif
      61                 : 
      62                 : #ifdef MOZILLA_COMPILE_WITH_SSE
      63                 : #define COMPILE_SSE_STRING "Y"
      64                 : #else
      65                 : #define COMPILE_SSE_STRING "-"
      66                 : #endif
      67                 : #ifdef MOZILLA_PRESUME_SSE
      68                 : #define PRESUME_SSE_STRING "Y"
      69                 : #else
      70                 : #define PRESUME_SSE_STRING "-"
      71                 : #endif
      72                 : 
      73                 : #ifdef MOZILLA_COMPILE_WITH_SSE2
      74                 : #define COMPILE_SSE2_STRING "Y"
      75                 : #else
      76                 : #define COMPILE_SSE2_STRING "-"
      77                 : #endif
      78                 : #ifdef MOZILLA_PRESUME_SSE2
      79                 : #define PRESUME_SSE2_STRING "Y"
      80                 : #else
      81                 : #define PRESUME_SSE2_STRING "-"
      82                 : #endif
      83                 : 
      84                 : #ifdef MOZILLA_COMPILE_WITH_SSE3
      85                 : #define COMPILE_SSE3_STRING "Y"
      86                 : #else
      87                 : #define COMPILE_SSE3_STRING "-"
      88                 : #endif
      89                 : #ifdef MOZILLA_PRESUME_SSE3
      90                 : #define PRESUME_SSE3_STRING "Y"
      91                 : #else
      92                 : #define PRESUME_SSE3_STRING "-"
      93                 : #endif
      94                 : 
      95                 : #ifdef MOZILLA_COMPILE_WITH_SSSE3
      96                 : #define COMPILE_SSSE3_STRING "Y"
      97                 : #else
      98                 : #define COMPILE_SSSE3_STRING "-"
      99                 : #endif
     100                 : #ifdef MOZILLA_PRESUME_SSSE3
     101                 : #define PRESUME_SSSE3_STRING "Y"
     102                 : #else
     103                 : #define PRESUME_SSSE3_STRING "-"
     104                 : #endif
     105                 : 
     106                 : #ifdef MOZILLA_COMPILE_WITH_SSE4A
     107                 : #define COMPILE_SSE4A_STRING "Y"
     108                 : #else
     109                 : #define COMPILE_SSE4A_STRING "-"
     110                 : #endif
     111                 : #ifdef MOZILLA_PRESUME_SSE4A
     112                 : #define PRESUME_SSE4A_STRING "Y"
     113                 : #else
     114                 : #define PRESUME_SSE4A_STRING "-"
     115                 : #endif
     116                 : 
     117                 : #ifdef MOZILLA_COMPILE_WITH_SSE4_1
     118                 : #define COMPILE_SSE4_1_STRING "Y"
     119                 : #else
     120                 : #define COMPILE_SSE4_1_STRING "-"
     121                 : #endif
     122                 : #ifdef MOZILLA_PRESUME_SSE4_1
     123                 : #define PRESUME_SSE4_1_STRING "Y"
     124                 : #else
     125                 : #define PRESUME_SSE4_1_STRING "-"
     126                 : #endif
     127                 : 
     128                 : #ifdef MOZILLA_COMPILE_WITH_SSE4_2
     129                 : #define COMPILE_SSE4_2_STRING "Y"
     130                 : #else
     131                 : #define COMPILE_SSE4_2_STRING "-"
     132                 : #endif
     133                 : #ifdef MOZILLA_PRESUME_SSE4_2
     134                 : #define PRESUME_SSE4_2_STRING "Y"
     135                 : #else
     136                 : #define PRESUME_SSE4_2_STRING "-"
     137                 : #endif
     138                 : 
     139               1 :   printf("Feature Presume Compile Support  Use\n");
     140                 : #define SHOW_INFO(featurelc_, featureuc_)                                     \
     141                 :   printf(    "%7s    %1s       %1s       %1s\n",                              \
     142                 :          #featurelc_,                                                         \
     143                 :          PRESUME_##featureuc_##_STRING,                                       \
     144                 :          COMPILE_##featureuc_##_STRING,                                       \
     145                 :          (mozilla::supports_##featurelc_() ? "Y" : "-"));
     146               1 :   SHOW_INFO(mmx, MMX)
     147               1 :   SHOW_INFO(sse, SSE)
     148               1 :   SHOW_INFO(sse2, SSE2)
     149               1 :   SHOW_INFO(sse3, SSE3)
     150               1 :   SHOW_INFO(ssse3, SSSE3)
     151               1 :   SHOW_INFO(sse4a, SSE4A)
     152               1 :   SHOW_INFO(sse4_1, SSE4_1)
     153               1 :   SHOW_INFO(sse4_2, SSE4_2)
     154               1 :   return 0;
     155                 : }

Generated by: LCOV version 1.7