OLD | NEW |
1 //===- subzero/crosstest/vectors.h - Common SIMD vector utilies -*- C++ -*-===// | 1 //===- subzero/crosstest/vectors.h - Common SIMD vector utilies -*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file provides declarations for PNaCl portable SIMD vector types. In | 10 // This file provides declarations for PNaCl portable SIMD vector types. In |
11 // addition, this file provides utilies that may be useful for crosstesting | 11 // addition, this file provides utilies that may be useful for crosstesting |
12 // vector code. | 12 // vector code. |
13 // | 13 // |
14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
15 | 15 |
16 #ifndef VECTORS_H | 16 #ifndef VECTORS_H |
17 #define VECTORS_H | 17 #define VECTORS_H |
18 | 18 |
19 #include <stdint.h> | 19 #include <stdint.h> |
20 #include <string> | 20 #include <string> |
21 #include <sstream> | 21 #include <sstream> |
22 | 22 |
| 23 // The driver and the test program may be compiled by different |
| 24 // versions of clang, with different standard libraries that have |
| 25 // different definitions of int8_t. Specifically, int8_t may be |
| 26 // typedef'd as either 'char' or 'signed char', which mangle to |
| 27 // different strings. Avoid int8_t and use an explicit myint8_t. |
| 28 typedef signed char myint8_t; |
| 29 |
23 #include "vectors.def" | 30 #include "vectors.def" |
24 | 31 |
25 // PNaCl portable vector types | 32 // PNaCl portable vector types |
26 // Types declared: v4si32, v4ui32, v8si16, v8ui16, v16si8, v16ui8, v4f32 | 33 // Types declared: v4si32, v4ui32, v8si16, v8ui16, v16si8, v16ui8, v4f32 |
27 #define X(ty, eltty, castty) typedef eltty ty __attribute__((vector_size(16))); | 34 #define X(ty, eltty, castty) typedef eltty ty __attribute__((vector_size(16))); |
28 VECTOR_TYPE_TABLE | 35 VECTOR_TYPE_TABLE |
29 #undef X | 36 #undef X |
30 | 37 |
31 // i1 vector types are not native C++ SIMD vector types. Instead, for | 38 // i1 vector types are not native C++ SIMD vector types. Instead, for |
32 // testing, they are expanded by the test code into native 128 bit | 39 // testing, they are expanded by the test code into native 128 bit |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return State; | 108 return State; |
102 } | 109 } |
103 | 110 |
104 private: | 111 private: |
105 uint32_t State; | 112 uint32_t State; |
106 }; | 113 }; |
107 | 114 |
108 } // end anonymous namespace | 115 } // end anonymous namespace |
109 | 116 |
110 #endif // VECTORS_H | 117 #endif // VECTORS_H |
OLD | NEW |