1 /*! @header
2  *  This header defines fixed size vector types that are useful both for
3  *  graphics and geometry, and for software vectorization without
4  *  architecture-specific intrinsics.
5  *
6  *  These types are based on a clang feature called "Extended vector types"
7  *  or "OpenCL vector types" (despite the name, these types work just fine
8  *  in C, Objective-C, and C++). There are a few tricks that make these
9  *  types nicer to work with than traditional simd intrinsic types:
10  *
11  *    - Basic arithmetic operators are overloaded to perform lanewise
12  *      operations with these types, including both vector-vector and
13  *      vector-scalar operations.
14  *
15  *    - It is possible to access vector components both via array-style
16  *      subscripting and by using the "." operator with component names
17  *      "x", "y", "z", "w", and permutations thereof.
18  *
19  *    - There are also some named subvectors: .lo and .hi are the first
20  *      and second halves of a vector, and .even and .odd are the even-
21  *      and odd-indexed elements of a vector.
22  *
23  *    - Clang provides some useful builtins that operate on these vector
24  *      types: __builtin_shufflevector and __builtin_convertvector.
25  *
26  *    - The <simd/simd.h> headers define a large assortment of vector and
27  *      matrix operations that work on these types.
28  *
29  *    - You can also use the simd types with the architecture-specific
30  *      intrinsics defined in <immintrin.h> and <arm_neon.h>.
31  *
32  *  The following vector types are defined by this header:
33  *
34  *    simd_charN   where N is 1, 2, 3, 4, 8, 16, 32, or 64.
35  *    simd_ucharN  where N is 1, 2, 3, 4, 8, 16, 32, or 64.
36  *    simd_shortN  where N is 1, 2, 3, 4, 8, 16, or 32.
37  *    simd_ushortN where N is 1, 2, 3, 4, 8, 16, or 32.
38  *    simd_intN    where N is 1, 2, 3, 4, 8, or 16.
39  *    simd_uintN   where N is 1, 2, 3, 4, 8, or 16.
40  *    simd_floatN  where N is 1, 2, 3, 4, 8, or 16.
41  *    simd_longN   where N is 1, 2, 3, 4, or 8.
42  *    simd_ulongN  where N is 1, 2, 3, 4, or 8.
43  *    simd_doubleN where N is 1, 2, 3, 4, or 8.
44  *
45  *  These types generally have greater alignment than the underlying scalar
46  *  type; they are aligned to either the size of the vector[1] or 16 bytes,
47  *  whichever is smaller.
48  *
49  *    [1] Note that sizeof a three-element vector is the same as sizeof the
50  *    corresponding four-element vector, because three-element vectors have
51  *    a hidden lane of padding.
52  *
53  *  In earlier versions of the simd library, the alignment of vectors could
54  *  be larger than 16B, up to the "architectural vector size" of 16, 32, or
55  *  64B, depending on what options were passed on the command line when
56  *  compiling. This super-alignment does not interact well with malloc, and
57  *  makes it difficult for libraries to provide a stable API, while conferring
58  *  relatively little performance benefit, so it has been relaxed.
59  *
60  *  For each simd_typeN type where N is not 1 or 3, there is also a
61  *  corresponding simd_packed_typeN type that requires only the alignment
62  *  matching that of the underlying scalar type. Use this if you need to
63  *  work with pointers-to or arrays-of scalar values:
64  *
65  *    void myFunction(float *pointerToFourFloats) {
66  *      // This is a bug, because `pointerToFourFloats` does not satisfy
67  *      // the alignment requirements of the `simd_float4` type; attempting
68  *      // to dereference (load from) `vecptr` is likely to crash at runtime.
69  *      simd_float4 *vecptr = (simd_float4 *)pointerToFourFloats;
70  *
71  *      // Instead, convert to `simd_packed_float4`:
72  *      simd_packed_float4 *vecptr = (simd_packed_float4 *)pointerToFourFloats;
73  *      // The `simd_packed_float4` type has the same alignment requirements
74  *      // as `float`, so this conversion is safe, and lets us load a vector.
75  *      // Note that `simd_packed_float4` can be assigned to `simd_float4`
76  *      // without any conversion; they types only behave differently as
77  *      // pointers or arrays.
78  *      simd_float4 vector = vecptr[0];
79  *    }
80  *
81  *  All of the simd_-prefixed types are also available in the C++ simd::
82  *  namespace; simd_char4 can be used as simd::char4, for example. These types
83  *  largely match the Metal shader language vector types, except that there
84  *  are no vector types larger than 4 elements in Metal.
85  *
86  *  @copyright 2014-2017 Apple, Inc. All rights reserved.
87  *  @unsorted                                                                 */
88 
89 #ifndef SIMD_VECTOR_TYPES
90 #define SIMD_VECTOR_TYPES
91 
92 # include <simd/base.h>
93 # if SIMD_COMPILER_HAS_REQUIRED_FEATURES
94 
95 /*  MARK: Basic vector types                                                  */
96 
97 /*! @group C and Objective-C vector types
98  *  @discussion These are the basic types that underpin the simd library.     */
99 
100 /*! @abstract A scalar 8-bit signed (twos-complement) integer.                */
101 typedef char simd_char1;
102 
103 /*! @abstract A vector of two 8-bit signed (twos-complement) integers.
104  *  @description In C++ and Metal, this type is also available as
105  *  simd::char2. The alignment of this type is greater than the alignment of
106  *  char; if you need to operate on data buffers that may not be suitably
107  *  aligned, you should access them using simd_packed_char2 instead.          */
108 typedef __attribute__((__ext_vector_type__(2))) char simd_char2;
109 
110 /*! @abstract A vector of three 8-bit signed (twos-complement) integers.
111  *  @description In C++ and Metal, this type is also available as
112  *  simd::char3. Note that vectors of this type are padded to have the same
113  *  size and alignment as simd_char4.                                         */
114 typedef __attribute__((__ext_vector_type__(3))) char simd_char3;
115 
116 /*! @abstract A vector of four 8-bit signed (twos-complement) integers.
117  *  @description In C++ and Metal, this type is also available as
118  *  simd::char4. The alignment of this type is greater than the alignment of
119  *  char; if you need to operate on data buffers that may not be suitably
120  *  aligned, you should access them using simd_packed_char4 instead.          */
121 typedef __attribute__((__ext_vector_type__(4))) char simd_char4;
122 
123 /*! @abstract A vector of eight 8-bit signed (twos-complement) integers.
124  *  @description In C++ this type is also available as simd::char8. This
125  *  type is not available in Metal. The alignment of this type is greater
126  *  than the alignment of char; if you need to operate on data buffers that
127  *  may not be suitably aligned, you should access them using
128  *  simd_packed_char8 instead.                                                */
129 typedef __attribute__((__ext_vector_type__(8))) char simd_char8;
130 
131 /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers.
132  *  @description In C++ this type is also available as simd::char16. This
133  *  type is not available in Metal. The alignment of this type is greater
134  *  than the alignment of char; if you need to operate on data buffers that
135  *  may not be suitably aligned, you should access them using
136  *  simd_packed_char16 instead.                                               */
137 typedef __attribute__((__ext_vector_type__(16))) char simd_char16;
138 
139 /*! @abstract A vector of thirty-two 8-bit signed (twos-complement)
140  *  integers.
141  *  @description In C++ this type is also available as simd::char32. This
142  *  type is not available in Metal. The alignment of this type is greater
143  *  than the alignment of char; if you need to operate on data buffers that
144  *  may not be suitably aligned, you should access them using
145  *  simd_packed_char32 instead.                                               */
146 typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) char simd_char32;
147 
148 /*! @abstract A vector of sixty-four 8-bit signed (twos-complement)
149  *  integers.
150  *  @description In C++ this type is also available as simd::char64. This
151  *  type is not available in Metal. The alignment of this type is greater
152  *  than the alignment of char; if you need to operate on data buffers that
153  *  may not be suitably aligned, you should access them using
154  *  simd_packed_char64 instead.                                               */
155 typedef __attribute__((__ext_vector_type__(64),__aligned__(16))) char simd_char64;
156 
157 /*! @abstract A scalar 8-bit unsigned integer.                                */
158 typedef unsigned char simd_uchar1;
159 
160 /*! @abstract A vector of two 8-bit unsigned integers.
161  *  @description In C++ and Metal, this type is also available as
162  *  simd::uchar2. The alignment of this type is greater than the alignment
163  *  of unsigned char; if you need to operate on data buffers that may not be
164  *  suitably aligned, you should access them using simd_packed_uchar2
165  *  instead.                                                                  */
166 typedef __attribute__((__ext_vector_type__(2))) unsigned char simd_uchar2;
167 
168 /*! @abstract A vector of three 8-bit unsigned integers.
169  *  @description In C++ and Metal, this type is also available as
170  *  simd::uchar3. Note that vectors of this type are padded to have the same
171  *  size and alignment as simd_uchar4.                                        */
172 typedef __attribute__((__ext_vector_type__(3))) unsigned char simd_uchar3;
173 
174 /*! @abstract A vector of four 8-bit unsigned integers.
175  *  @description In C++ and Metal, this type is also available as
176  *  simd::uchar4. The alignment of this type is greater than the alignment
177  *  of unsigned char; if you need to operate on data buffers that may not be
178  *  suitably aligned, you should access them using simd_packed_uchar4
179  *  instead.                                                                  */
180 typedef __attribute__((__ext_vector_type__(4))) unsigned char simd_uchar4;
181 
182 /*! @abstract A vector of eight 8-bit unsigned integers.
183  *  @description In C++ this type is also available as simd::uchar8. This
184  *  type is not available in Metal. The alignment of this type is greater
185  *  than the alignment of unsigned char; if you need to operate on data
186  *  buffers that may not be suitably aligned, you should access them using
187  *  simd_packed_uchar8 instead.                                               */
188 typedef __attribute__((__ext_vector_type__(8))) unsigned char simd_uchar8;
189 
190 /*! @abstract A vector of sixteen 8-bit unsigned integers.
191  *  @description In C++ this type is also available as simd::uchar16. This
192  *  type is not available in Metal. The alignment of this type is greater
193  *  than the alignment of unsigned char; if you need to operate on data
194  *  buffers that may not be suitably aligned, you should access them using
195  *  simd_packed_uchar16 instead.                                              */
196 typedef __attribute__((__ext_vector_type__(16))) unsigned char simd_uchar16;
197 
198 /*! @abstract A vector of thirty-two 8-bit unsigned integers.
199  *  @description In C++ this type is also available as simd::uchar32. This
200  *  type is not available in Metal. The alignment of this type is greater
201  *  than the alignment of unsigned char; if you need to operate on data
202  *  buffers that may not be suitably aligned, you should access them using
203  *  simd_packed_uchar32 instead.                                              */
204 typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned char simd_uchar32;
205 
206 /*! @abstract A vector of sixty-four 8-bit unsigned integers.
207  *  @description In C++ this type is also available as simd::uchar64. This
208  *  type is not available in Metal. The alignment of this type is greater
209  *  than the alignment of unsigned char; if you need to operate on data
210  *  buffers that may not be suitably aligned, you should access them using
211  *  simd_packed_uchar64 instead.                                              */
212 typedef __attribute__((__ext_vector_type__(64),__aligned__(16))) unsigned char simd_uchar64;
213 
214 /*! @abstract A scalar 16-bit signed (twos-complement) integer.               */
215 typedef short simd_short1;
216 
217 /*! @abstract A vector of two 16-bit signed (twos-complement) integers.
218  *  @description In C++ and Metal, this type is also available as
219  *  simd::short2. The alignment of this type is greater than the alignment
220  *  of short; if you need to operate on data buffers that may not be
221  *  suitably aligned, you should access them using simd_packed_short2
222  *  instead.                                                                  */
223 typedef __attribute__((__ext_vector_type__(2))) short simd_short2;
224 
225 /*! @abstract A vector of three 16-bit signed (twos-complement) integers.
226  *  @description In C++ and Metal, this type is also available as
227  *  simd::short3. Note that vectors of this type are padded to have the same
228  *  size and alignment as simd_short4.                                        */
229 typedef __attribute__((__ext_vector_type__(3))) short simd_short3;
230 
231 /*! @abstract A vector of four 16-bit signed (twos-complement) integers.
232  *  @description In C++ and Metal, this type is also available as
233  *  simd::short4. The alignment of this type is greater than the alignment
234  *  of short; if you need to operate on data buffers that may not be
235  *  suitably aligned, you should access them using simd_packed_short4
236  *  instead.                                                                  */
237 typedef __attribute__((__ext_vector_type__(4))) short simd_short4;
238 
239 /*! @abstract A vector of eight 16-bit signed (twos-complement) integers.
240  *  @description In C++ this type is also available as simd::short8. This
241  *  type is not available in Metal. The alignment of this type is greater
242  *  than the alignment of short; if you need to operate on data buffers that
243  *  may not be suitably aligned, you should access them using
244  *  simd_packed_short8 instead.                                               */
245 typedef __attribute__((__ext_vector_type__(8))) short simd_short8;
246 
247 /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers.
248  *  @description In C++ this type is also available as simd::short16. This
249  *  type is not available in Metal. The alignment of this type is greater
250  *  than the alignment of short; if you need to operate on data buffers that
251  *  may not be suitably aligned, you should access them using
252  *  simd_packed_short16 instead.                                              */
253 typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) short simd_short16;
254 
255 /*! @abstract A vector of thirty-two 16-bit signed (twos-complement)
256  *  integers.
257  *  @description In C++ this type is also available as simd::short32. This
258  *  type is not available in Metal. The alignment of this type is greater
259  *  than the alignment of short; if you need to operate on data buffers that
260  *  may not be suitably aligned, you should access them using
261  *  simd_packed_short32 instead.                                              */
262 typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) short simd_short32;
263 
264 /*! @abstract A scalar 16-bit unsigned integer.                               */
265 typedef unsigned short simd_ushort1;
266 
267 /*! @abstract A vector of two 16-bit unsigned integers.
268  *  @description In C++ and Metal, this type is also available as
269  *  simd::ushort2. The alignment of this type is greater than the alignment
270  *  of unsigned short; if you need to operate on data buffers that may not
271  *  be suitably aligned, you should access them using simd_packed_ushort2
272  *  instead.                                                                  */
273 typedef __attribute__((__ext_vector_type__(2))) unsigned short simd_ushort2;
274 
275 /*! @abstract A vector of three 16-bit unsigned integers.
276  *  @description In C++ and Metal, this type is also available as
277  *  simd::ushort3. Note that vectors of this type are padded to have the
278  *  same size and alignment as simd_ushort4.                                  */
279 typedef __attribute__((__ext_vector_type__(3))) unsigned short simd_ushort3;
280 
281 /*! @abstract A vector of four 16-bit unsigned integers.
282  *  @description In C++ and Metal, this type is also available as
283  *  simd::ushort4. The alignment of this type is greater than the alignment
284  *  of unsigned short; if you need to operate on data buffers that may not
285  *  be suitably aligned, you should access them using simd_packed_ushort4
286  *  instead.                                                                  */
287 typedef __attribute__((__ext_vector_type__(4))) unsigned short simd_ushort4;
288 
289 /*! @abstract A vector of eight 16-bit unsigned integers.
290  *  @description In C++ this type is also available as simd::ushort8. This
291  *  type is not available in Metal. The alignment of this type is greater
292  *  than the alignment of unsigned short; if you need to operate on data
293  *  buffers that may not be suitably aligned, you should access them using
294  *  simd_packed_ushort8 instead.                                              */
295 typedef __attribute__((__ext_vector_type__(8))) unsigned short simd_ushort8;
296 
297 /*! @abstract A vector of sixteen 16-bit unsigned integers.
298  *  @description In C++ this type is also available as simd::ushort16. This
299  *  type is not available in Metal. The alignment of this type is greater
300  *  than the alignment of unsigned short; if you need to operate on data
301  *  buffers that may not be suitably aligned, you should access them using
302  *  simd_packed_ushort16 instead.                                             */
303 typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned short simd_ushort16;
304 
305 /*! @abstract A vector of thirty-two 16-bit unsigned integers.
306  *  @description In C++ this type is also available as simd::ushort32. This
307  *  type is not available in Metal. The alignment of this type is greater
308  *  than the alignment of unsigned short; if you need to operate on data
309  *  buffers that may not be suitably aligned, you should access them using
310  *  simd_packed_ushort32 instead.                                             */
311 typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned short simd_ushort32;
312 
313 /*! @abstract A scalar 32-bit signed (twos-complement) integer.               */
314 typedef int simd_int1;
315 
316 /*! @abstract A vector of two 32-bit signed (twos-complement) integers.
317  *  @description In C++ and Metal, this type is also available as
318  *  simd::int2. The alignment of this type is greater than the alignment of
319  *  int; if you need to operate on data buffers that may not be suitably
320  *  aligned, you should access them using simd_packed_int2 instead.           */
321 typedef __attribute__((__ext_vector_type__(2))) int simd_int2;
322 
323 /*! @abstract A vector of three 32-bit signed (twos-complement) integers.
324  *  @description In C++ and Metal, this type is also available as
325  *  simd::int3. Note that vectors of this type are padded to have the same
326  *  size and alignment as simd_int4.                                          */
327 typedef __attribute__((__ext_vector_type__(3))) int simd_int3;
328 
329 /*! @abstract A vector of four 32-bit signed (twos-complement) integers.
330  *  @description In C++ and Metal, this type is also available as
331  *  simd::int4. The alignment of this type is greater than the alignment of
332  *  int; if you need to operate on data buffers that may not be suitably
333  *  aligned, you should access them using simd_packed_int4 instead.           */
334 typedef __attribute__((__ext_vector_type__(4))) int simd_int4;
335 
336 /*! @abstract A vector of eight 32-bit signed (twos-complement) integers.
337  *  @description In C++ this type is also available as simd::int8. This type
338  *  is not available in Metal. The alignment of this type is greater than
339  *  the alignment of int; if you need to operate on data buffers that may
340  *  not be suitably aligned, you should access them using simd_packed_int8
341  *  instead.                                                                  */
342 typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) int simd_int8;
343 
344 /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers.
345  *  @description In C++ this type is also available as simd::int16. This
346  *  type is not available in Metal. The alignment of this type is greater
347  *  than the alignment of int; if you need to operate on data buffers that
348  *  may not be suitably aligned, you should access them using
349  *  simd_packed_int16 instead.                                                */
350 typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) int simd_int16;
351 
352 /*! @abstract A scalar 32-bit unsigned integer.                               */
353 typedef unsigned int simd_uint1;
354 
355 /*! @abstract A vector of two 32-bit unsigned integers.
356  *  @description In C++ and Metal, this type is also available as
357  *  simd::uint2. The alignment of this type is greater than the alignment of
358  *  unsigned int; if you need to operate on data buffers that may not be
359  *  suitably aligned, you should access them using simd_packed_uint2
360  *  instead.                                                                  */
361 typedef __attribute__((__ext_vector_type__(2))) unsigned int simd_uint2;
362 
363 /*! @abstract A vector of three 32-bit unsigned integers.
364  *  @description In C++ and Metal, this type is also available as
365  *  simd::uint3. Note that vectors of this type are padded to have the same
366  *  size and alignment as simd_uint4.                                         */
367 typedef __attribute__((__ext_vector_type__(3))) unsigned int simd_uint3;
368 
369 /*! @abstract A vector of four 32-bit unsigned integers.
370  *  @description In C++ and Metal, this type is also available as
371  *  simd::uint4. The alignment of this type is greater than the alignment of
372  *  unsigned int; if you need to operate on data buffers that may not be
373  *  suitably aligned, you should access them using simd_packed_uint4
374  *  instead.                                                                  */
375 typedef __attribute__((__ext_vector_type__(4))) unsigned int simd_uint4;
376 
377 /*! @abstract A vector of eight 32-bit unsigned integers.
378  *  @description In C++ this type is also available as simd::uint8. This
379  *  type is not available in Metal. The alignment of this type is greater
380  *  than the alignment of unsigned int; if you need to operate on data
381  *  buffers that may not be suitably aligned, you should access them using
382  *  simd_packed_uint8 instead.                                                */
383 typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) unsigned int simd_uint8;
384 
385 /*! @abstract A vector of sixteen 32-bit unsigned integers.
386  *  @description In C++ this type is also available as simd::uint16. This
387  *  type is not available in Metal. The alignment of this type is greater
388  *  than the alignment of unsigned int; if you need to operate on data
389  *  buffers that may not be suitably aligned, you should access them using
390  *  simd_packed_uint16 instead.                                               */
391 typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned int simd_uint16;
392 
393 /*! @abstract A scalar 32-bit floating-point number.                          */
394 typedef float simd_float1;
395 
396 /*! @abstract A vector of two 32-bit floating-point numbers.
397  *  @description In C++ and Metal, this type is also available as
398  *  simd::float2. The alignment of this type is greater than the alignment
399  *  of float; if you need to operate on data buffers that may not be
400  *  suitably aligned, you should access them using simd_packed_float2
401  *  instead.                                                                  */
402 typedef __attribute__((__ext_vector_type__(2))) float simd_float2;
403 
404 /*! @abstract A vector of three 32-bit floating-point numbers.
405  *  @description In C++ and Metal, this type is also available as
406  *  simd::float3. Note that vectors of this type are padded to have the same
407  *  size and alignment as simd_float4.                                        */
408 typedef __attribute__((__ext_vector_type__(3))) float simd_float3;
409 
410 /*! @abstract A vector of four 32-bit floating-point numbers.
411  *  @description In C++ and Metal, this type is also available as
412  *  simd::float4. The alignment of this type is greater than the alignment
413  *  of float; if you need to operate on data buffers that may not be
414  *  suitably aligned, you should access them using simd_packed_float4
415  *  instead.                                                                  */
416 typedef __attribute__((__ext_vector_type__(4))) float simd_float4;
417 
418 /*! @abstract A vector of eight 32-bit floating-point numbers.
419  *  @description In C++ this type is also available as simd::float8. This
420  *  type is not available in Metal. The alignment of this type is greater
421  *  than the alignment of float; if you need to operate on data buffers that
422  *  may not be suitably aligned, you should access them using
423  *  simd_packed_float8 instead.                                               */
424 typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) float simd_float8;
425 
426 /*! @abstract A vector of sixteen 32-bit floating-point numbers.
427  *  @description In C++ this type is also available as simd::float16. This
428  *  type is not available in Metal. The alignment of this type is greater
429  *  than the alignment of float; if you need to operate on data buffers that
430  *  may not be suitably aligned, you should access them using
431  *  simd_packed_float16 instead.                                              */
432 typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) float simd_float16;
433 
434 /*! @abstract A scalar 64-bit signed (twos-complement) integer.               */
435 #if defined __LP64__
436 typedef long simd_long1;
437 #else
438 typedef long long simd_long1;
439 #endif
440 
441 /*! @abstract A vector of two 64-bit signed (twos-complement) integers.
442  *  @description In C++ and Metal, this type is also available as
443  *  simd::long2. The alignment of this type is greater than the alignment of
444  *  simd_long1; if you need to operate on data buffers that may not be
445  *  suitably aligned, you should access them using simd_packed_long2
446  *  instead.                                                                  */
447 typedef __attribute__((__ext_vector_type__(2))) simd_long1 simd_long2;
448 
449 /*! @abstract A vector of three 64-bit signed (twos-complement) integers.
450  *  @description In C++ and Metal, this type is also available as
451  *  simd::long3. Note that vectors of this type are padded to have the same
452  *  size and alignment as simd_long4.                                         */
453 typedef __attribute__((__ext_vector_type__(3),__aligned__(16))) simd_long1 simd_long3;
454 
455 /*! @abstract A vector of four 64-bit signed (twos-complement) integers.
456  *  @description In C++ and Metal, this type is also available as
457  *  simd::long4. The alignment of this type is greater than the alignment of
458  *  simd_long1; if you need to operate on data buffers that may not be
459  *  suitably aligned, you should access them using simd_packed_long4
460  *  instead.                                                                  */
461 typedef __attribute__((__ext_vector_type__(4),__aligned__(16))) simd_long1 simd_long4;
462 
463 /*! @abstract A vector of eight 64-bit signed (twos-complement) integers.
464  *  @description In C++ this type is also available as simd::long8. This
465  *  type is not available in Metal. The alignment of this type is greater
466  *  than the alignment of simd_long1; if you need to operate on data buffers
467  *  that may not be suitably aligned, you should access them using
468  *  simd_packed_long8 instead.                                                */
469 typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) simd_long1 simd_long8;
470 
471 /*! @abstract A scalar 64-bit unsigned integer.                               */
472 #if defined __LP64__
473 typedef unsigned long simd_ulong1;
474 #else
475 typedef unsigned long long simd_ulong1;
476 #endif
477 
478 /*! @abstract A vector of two 64-bit unsigned integers.
479  *  @description In C++ and Metal, this type is also available as
480  *  simd::ulong2. The alignment of this type is greater than the alignment
481  *  of simd_ulong1; if you need to operate on data buffers that may not be
482  *  suitably aligned, you should access them using simd_packed_ulong2
483  *  instead.                                                                  */
484 typedef __attribute__((__ext_vector_type__(2))) simd_ulong1 simd_ulong2;
485 
486 /*! @abstract A vector of three 64-bit unsigned integers.
487  *  @description In C++ and Metal, this type is also available as
488  *  simd::ulong3. Note that vectors of this type are padded to have the same
489  *  size and alignment as simd_ulong4.                                        */
490 typedef __attribute__((__ext_vector_type__(3),__aligned__(16))) simd_ulong1 simd_ulong3;
491 
492 /*! @abstract A vector of four 64-bit unsigned integers.
493  *  @description In C++ and Metal, this type is also available as
494  *  simd::ulong4. The alignment of this type is greater than the alignment
495  *  of simd_ulong1; if you need to operate on data buffers that may not be
496  *  suitably aligned, you should access them using simd_packed_ulong4
497  *  instead.                                                                  */
498 typedef __attribute__((__ext_vector_type__(4),__aligned__(16))) simd_ulong1 simd_ulong4;
499 
500 /*! @abstract A vector of eight 64-bit unsigned integers.
501  *  @description In C++ this type is also available as simd::ulong8. This
502  *  type is not available in Metal. The alignment of this type is greater
503  *  than the alignment of simd_ulong1; if you need to operate on data
504  *  buffers that may not be suitably aligned, you should access them using
505  *  simd_packed_ulong8 instead.                                               */
506 typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) simd_ulong1 simd_ulong8;
507 
508 /*! @abstract A scalar 64-bit floating-point number.                          */
509 typedef double simd_double1;
510 
511 /*! @abstract A vector of two 64-bit floating-point numbers.
512  *  @description In C++ and Metal, this type is also available as
513  *  simd::double2. The alignment of this type is greater than the alignment
514  *  of double; if you need to operate on data buffers that may not be
515  *  suitably aligned, you should access them using simd_packed_double2
516  *  instead.                                                                  */
517 typedef __attribute__((__ext_vector_type__(2))) double simd_double2;
518 
519 /*! @abstract A vector of three 64-bit floating-point numbers.
520  *  @description In C++ and Metal, this type is also available as
521  *  simd::double3. Note that vectors of this type are padded to have the
522  *  same size and alignment as simd_double4.                                  */
523 typedef __attribute__((__ext_vector_type__(3),__aligned__(16))) double simd_double3;
524 
525 /*! @abstract A vector of four 64-bit floating-point numbers.
526  *  @description In C++ and Metal, this type is also available as
527  *  simd::double4. The alignment of this type is greater than the alignment
528  *  of double; if you need to operate on data buffers that may not be
529  *  suitably aligned, you should access them using simd_packed_double4
530  *  instead.                                                                  */
531 typedef __attribute__((__ext_vector_type__(4),__aligned__(16))) double simd_double4;
532 
533 /*! @abstract A vector of eight 64-bit floating-point numbers.
534  *  @description In C++ this type is also available as simd::double8. This
535  *  type is not available in Metal. The alignment of this type is greater
536  *  than the alignment of double; if you need to operate on data buffers
537  *  that may not be suitably aligned, you should access them using
538  *  simd_packed_double8 instead.                                              */
539 typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) double simd_double8;
540 
541 /*  MARK: C++ vector types                                                    */
542 #if defined __cplusplus
543 /*! @group C++ and Metal vector types
544  *  @discussion Shorter type names available within the simd:: namespace.
545  *  Each of these types is interchangable with the corresponding C type
546  *  with the `simd_` prefix.                                                  */
547 namespace simd {
548   /*! @abstract A scalar 8-bit signed (twos-complement) integer.
549    *  @discussion In C and Objective-C, this type is available as
550    *  simd_char1.                                                             */
551 typedef ::simd_char1 char1;
552 
553   /*! @abstract A vector of two 8-bit signed (twos-complement) integers.
554    *  @description In C or Objective-C, this type is available as
555    *  simd_char2. The alignment of this type is greater than the alignment
556    *  of char; if you need to operate on data buffers that may not be
557    *  suitably aligned, you should access them using simd::packed_char2
558    *  instead.                                                                */
559 typedef ::simd_char2 char2;
560 
561   /*! @abstract A vector of three 8-bit signed (twos-complement) integers.
562    *  @description In C or Objective-C, this type is available as
563    *  simd_char3. Vectors of this type are padded to have the same size and
564    *  alignment as simd_char4.                                                */
565 typedef ::simd_char3 char3;
566 
567   /*! @abstract A vector of four 8-bit signed (twos-complement) integers.
568    *  @description In C or Objective-C, this type is available as
569    *  simd_char4. The alignment of this type is greater than the alignment
570    *  of char; if you need to operate on data buffers that may not be
571    *  suitably aligned, you should access them using simd::packed_char4
572    *  instead.                                                                */
573 typedef ::simd_char4 char4;
574 
575   /*! @abstract A vector of eight 8-bit signed (twos-complement) integers.
576    *  @description This type is not available in Metal. In C or Objective-C,
577    *  this type is available as simd_char8. The alignment of this type is
578    *  greater than the alignment of char; if you need to operate on data
579    *  buffers that may not be suitably aligned, you should access them using
580    *  simd::packed_char8 instead.                                             */
581 typedef ::simd_char8 char8;
582 
583   /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers.
584    *  @description This type is not available in Metal. In C or Objective-C,
585    *  this type is available as simd_char16. The alignment of this type is
586    *  greater than the alignment of char; if you need to operate on data
587    *  buffers that may not be suitably aligned, you should access them using
588    *  simd::packed_char16 instead.                                            */
589 typedef ::simd_char16 char16;
590 
591   /*! @abstract A vector of thirty-two 8-bit signed (twos-complement)
592    *  integers.
593    *  @description This type is not available in Metal. In C or Objective-C,
594    *  this type is available as simd_char32. The alignment of this type is
595    *  greater than the alignment of char; if you need to operate on data
596    *  buffers that may not be suitably aligned, you should access them using
597    *  simd::packed_char32 instead.                                            */
598 typedef ::simd_char32 char32;
599 
600   /*! @abstract A vector of sixty-four 8-bit signed (twos-complement)
601    *  integers.
602    *  @description This type is not available in Metal. In C or Objective-C,
603    *  this type is available as simd_char64. The alignment of this type is
604    *  greater than the alignment of char; if you need to operate on data
605    *  buffers that may not be suitably aligned, you should access them using
606    *  simd::packed_char64 instead.                                            */
607 typedef ::simd_char64 char64;
608 
609   /*! @abstract A scalar 8-bit unsigned integer.
610    *  @discussion In C and Objective-C, this type is available as
611    *  simd_uchar1.                                                            */
612 typedef ::simd_uchar1 uchar1;
613 
614   /*! @abstract A vector of two 8-bit unsigned integers.
615    *  @description In C or Objective-C, this type is available as
616    *  simd_uchar2. The alignment of this type is greater than the alignment
617    *  of unsigned char; if you need to operate on data buffers that may not
618    *  be suitably aligned, you should access them using simd::packed_uchar2
619    *  instead.                                                                */
620 typedef ::simd_uchar2 uchar2;
621 
622   /*! @abstract A vector of three 8-bit unsigned integers.
623    *  @description In C or Objective-C, this type is available as
624    *  simd_uchar3. Vectors of this type are padded to have the same size and
625    *  alignment as simd_uchar4.                                               */
626 typedef ::simd_uchar3 uchar3;
627 
628   /*! @abstract A vector of four 8-bit unsigned integers.
629    *  @description In C or Objective-C, this type is available as
630    *  simd_uchar4. The alignment of this type is greater than the alignment
631    *  of unsigned char; if you need to operate on data buffers that may not
632    *  be suitably aligned, you should access them using simd::packed_uchar4
633    *  instead.                                                                */
634 typedef ::simd_uchar4 uchar4;
635 
636   /*! @abstract A vector of eight 8-bit unsigned integers.
637    *  @description This type is not available in Metal. In C or Objective-C,
638    *  this type is available as simd_uchar8. The alignment of this type is
639    *  greater than the alignment of unsigned char; if you need to operate on
640    *  data buffers that may not be suitably aligned, you should access them
641    *  using simd::packed_uchar8 instead.                                      */
642 typedef ::simd_uchar8 uchar8;
643 
644   /*! @abstract A vector of sixteen 8-bit unsigned integers.
645    *  @description This type is not available in Metal. In C or Objective-C,
646    *  this type is available as simd_uchar16. The alignment of this type is
647    *  greater than the alignment of unsigned char; if you need to operate on
648    *  data buffers that may not be suitably aligned, you should access them
649    *  using simd::packed_uchar16 instead.                                     */
650 typedef ::simd_uchar16 uchar16;
651 
652   /*! @abstract A vector of thirty-two 8-bit unsigned integers.
653    *  @description This type is not available in Metal. In C or Objective-C,
654    *  this type is available as simd_uchar32. The alignment of this type is
655    *  greater than the alignment of unsigned char; if you need to operate on
656    *  data buffers that may not be suitably aligned, you should access them
657    *  using simd::packed_uchar32 instead.                                     */
658 typedef ::simd_uchar32 uchar32;
659 
660   /*! @abstract A vector of sixty-four 8-bit unsigned integers.
661    *  @description This type is not available in Metal. In C or Objective-C,
662    *  this type is available as simd_uchar64. The alignment of this type is
663    *  greater than the alignment of unsigned char; if you need to operate on
664    *  data buffers that may not be suitably aligned, you should access them
665    *  using simd::packed_uchar64 instead.                                     */
666 typedef ::simd_uchar64 uchar64;
667 
668   /*! @abstract A scalar 16-bit signed (twos-complement) integer.
669    *  @discussion In C and Objective-C, this type is available as
670    *  simd_short1.                                                            */
671 typedef ::simd_short1 short1;
672 
673   /*! @abstract A vector of two 16-bit signed (twos-complement) integers.
674    *  @description In C or Objective-C, this type is available as
675    *  simd_short2. The alignment of this type is greater than the alignment
676    *  of short; if you need to operate on data buffers that may not be
677    *  suitably aligned, you should access them using simd::packed_short2
678    *  instead.                                                                */
679 typedef ::simd_short2 short2;
680 
681   /*! @abstract A vector of three 16-bit signed (twos-complement) integers.
682    *  @description In C or Objective-C, this type is available as
683    *  simd_short3. Vectors of this type are padded to have the same size and
684    *  alignment as simd_short4.                                               */
685 typedef ::simd_short3 short3;
686 
687   /*! @abstract A vector of four 16-bit signed (twos-complement) integers.
688    *  @description In C or Objective-C, this type is available as
689    *  simd_short4. The alignment of this type is greater than the alignment
690    *  of short; if you need to operate on data buffers that may not be
691    *  suitably aligned, you should access them using simd::packed_short4
692    *  instead.                                                                */
693 typedef ::simd_short4 short4;
694 
695   /*! @abstract A vector of eight 16-bit signed (twos-complement) integers.
696    *  @description This type is not available in Metal. In C or Objective-C,
697    *  this type is available as simd_short8. The alignment of this type is
698    *  greater than the alignment of short; if you need to operate on data
699    *  buffers that may not be suitably aligned, you should access them using
700    *  simd::packed_short8 instead.                                            */
701 typedef ::simd_short8 short8;
702 
703   /*! @abstract A vector of sixteen 16-bit signed (twos-complement)
704    *  integers.
705    *  @description This type is not available in Metal. In C or Objective-C,
706    *  this type is available as simd_short16. The alignment of this type is
707    *  greater than the alignment of short; if you need to operate on data
708    *  buffers that may not be suitably aligned, you should access them using
709    *  simd::packed_short16 instead.                                           */
710 typedef ::simd_short16 short16;
711 
712   /*! @abstract A vector of thirty-two 16-bit signed (twos-complement)
713    *  integers.
714    *  @description This type is not available in Metal. In C or Objective-C,
715    *  this type is available as simd_short32. The alignment of this type is
716    *  greater than the alignment of short; if you need to operate on data
717    *  buffers that may not be suitably aligned, you should access them using
718    *  simd::packed_short32 instead.                                           */
719 typedef ::simd_short32 short32;
720 
721   /*! @abstract A scalar 16-bit unsigned integer.
722    *  @discussion In C and Objective-C, this type is available as
723    *  simd_ushort1.                                                           */
724 typedef ::simd_ushort1 ushort1;
725 
726   /*! @abstract A vector of two 16-bit unsigned integers.
727    *  @description In C or Objective-C, this type is available as
728    *  simd_ushort2. The alignment of this type is greater than the alignment
729    *  of unsigned short; if you need to operate on data buffers that may not
730    *  be suitably aligned, you should access them using simd::packed_ushort2
731    *  instead.                                                                */
732 typedef ::simd_ushort2 ushort2;
733 
734   /*! @abstract A vector of three 16-bit unsigned integers.
735    *  @description In C or Objective-C, this type is available as
736    *  simd_ushort3. Vectors of this type are padded to have the same size
737    *  and alignment as simd_ushort4.                                          */
738 typedef ::simd_ushort3 ushort3;
739 
740   /*! @abstract A vector of four 16-bit unsigned integers.
741    *  @description In C or Objective-C, this type is available as
742    *  simd_ushort4. The alignment of this type is greater than the alignment
743    *  of unsigned short; if you need to operate on data buffers that may not
744    *  be suitably aligned, you should access them using simd::packed_ushort4
745    *  instead.                                                                */
746 typedef ::simd_ushort4 ushort4;
747 
748   /*! @abstract A vector of eight 16-bit unsigned integers.
749    *  @description This type is not available in Metal. In C or Objective-C,
750    *  this type is available as simd_ushort8. The alignment of this type is
751    *  greater than the alignment of unsigned short; if you need to operate
752    *  on data buffers that may not be suitably aligned, you should access
753    *  them using simd::packed_ushort8 instead.                                */
754 typedef ::simd_ushort8 ushort8;
755 
756   /*! @abstract A vector of sixteen 16-bit unsigned integers.
757    *  @description This type is not available in Metal. In C or Objective-C,
758    *  this type is available as simd_ushort16. The alignment of this type is
759    *  greater than the alignment of unsigned short; if you need to operate
760    *  on data buffers that may not be suitably aligned, you should access
761    *  them using simd::packed_ushort16 instead.                               */
762 typedef ::simd_ushort16 ushort16;
763 
764   /*! @abstract A vector of thirty-two 16-bit unsigned integers.
765    *  @description This type is not available in Metal. In C or Objective-C,
766    *  this type is available as simd_ushort32. The alignment of this type is
767    *  greater than the alignment of unsigned short; if you need to operate
768    *  on data buffers that may not be suitably aligned, you should access
769    *  them using simd::packed_ushort32 instead.                               */
770 typedef ::simd_ushort32 ushort32;
771 
772   /*! @abstract A scalar 32-bit signed (twos-complement) integer.
773    *  @discussion In C and Objective-C, this type is available as simd_int1.  */
774 typedef ::simd_int1 int1;
775 
776   /*! @abstract A vector of two 32-bit signed (twos-complement) integers.
777    *  @description In C or Objective-C, this type is available as simd_int2.
778    *  The alignment of this type is greater than the alignment of int; if
779    *  you need to operate on data buffers that may not be suitably aligned,
780    *  you should access them using simd::packed_int2 instead.                 */
781 typedef ::simd_int2 int2;
782 
783   /*! @abstract A vector of three 32-bit signed (twos-complement) integers.
784    *  @description In C or Objective-C, this type is available as simd_int3.
785    *  Vectors of this type are padded to have the same size and alignment as
786    *  simd_int4.                                                              */
787 typedef ::simd_int3 int3;
788 
789   /*! @abstract A vector of four 32-bit signed (twos-complement) integers.
790    *  @description In C or Objective-C, this type is available as simd_int4.
791    *  The alignment of this type is greater than the alignment of int; if
792    *  you need to operate on data buffers that may not be suitably aligned,
793    *  you should access them using simd::packed_int4 instead.                 */
794 typedef ::simd_int4 int4;
795 
796   /*! @abstract A vector of eight 32-bit signed (twos-complement) integers.
797    *  @description This type is not available in Metal. In C or Objective-C,
798    *  this type is available as simd_int8. The alignment of this type is
799    *  greater than the alignment of int; if you need to operate on data
800    *  buffers that may not be suitably aligned, you should access them using
801    *  simd::packed_int8 instead.                                              */
802 typedef ::simd_int8 int8;
803 
804   /*! @abstract A vector of sixteen 32-bit signed (twos-complement)
805    *  integers.
806    *  @description This type is not available in Metal. In C or Objective-C,
807    *  this type is available as simd_int16. The alignment of this type is
808    *  greater than the alignment of int; if you need to operate on data
809    *  buffers that may not be suitably aligned, you should access them using
810    *  simd::packed_int16 instead.                                             */
811 typedef ::simd_int16 int16;
812 
813   /*! @abstract A scalar 32-bit unsigned integer.
814    *  @discussion In C and Objective-C, this type is available as
815    *  simd_uint1.                                                             */
816 typedef ::simd_uint1 uint1;
817 
818   /*! @abstract A vector of two 32-bit unsigned integers.
819    *  @description In C or Objective-C, this type is available as
820    *  simd_uint2. The alignment of this type is greater than the alignment
821    *  of unsigned int; if you need to operate on data buffers that may not
822    *  be suitably aligned, you should access them using simd::packed_uint2
823    *  instead.                                                                */
824 typedef ::simd_uint2 uint2;
825 
826   /*! @abstract A vector of three 32-bit unsigned integers.
827    *  @description In C or Objective-C, this type is available as
828    *  simd_uint3. Vectors of this type are padded to have the same size and
829    *  alignment as simd_uint4.                                                */
830 typedef ::simd_uint3 uint3;
831 
832   /*! @abstract A vector of four 32-bit unsigned integers.
833    *  @description In C or Objective-C, this type is available as
834    *  simd_uint4. The alignment of this type is greater than the alignment
835    *  of unsigned int; if you need to operate on data buffers that may not
836    *  be suitably aligned, you should access them using simd::packed_uint4
837    *  instead.                                                                */
838 typedef ::simd_uint4 uint4;
839 
840   /*! @abstract A vector of eight 32-bit unsigned integers.
841    *  @description This type is not available in Metal. In C or Objective-C,
842    *  this type is available as simd_uint8. The alignment of this type is
843    *  greater than the alignment of unsigned int; if you need to operate on
844    *  data buffers that may not be suitably aligned, you should access them
845    *  using simd::packed_uint8 instead.                                       */
846 typedef ::simd_uint8 uint8;
847 
848   /*! @abstract A vector of sixteen 32-bit unsigned integers.
849    *  @description This type is not available in Metal. In C or Objective-C,
850    *  this type is available as simd_uint16. The alignment of this type is
851    *  greater than the alignment of unsigned int; if you need to operate on
852    *  data buffers that may not be suitably aligned, you should access them
853    *  using simd::packed_uint16 instead.                                      */
854 typedef ::simd_uint16 uint16;
855 
856   /*! @abstract A scalar 32-bit floating-point number.
857    *  @discussion In C and Objective-C, this type is available as
858    *  simd_float1.                                                            */
859 typedef ::simd_float1 float1;
860 
861   /*! @abstract A vector of two 32-bit floating-point numbers.
862    *  @description In C or Objective-C, this type is available as
863    *  simd_float2. The alignment of this type is greater than the alignment
864    *  of float; if you need to operate on data buffers that may not be
865    *  suitably aligned, you should access them using simd::packed_float2
866    *  instead.                                                                */
867 typedef ::simd_float2 float2;
868 
869   /*! @abstract A vector of three 32-bit floating-point numbers.
870    *  @description In C or Objective-C, this type is available as
871    *  simd_float3. Vectors of this type are padded to have the same size and
872    *  alignment as simd_float4.                                               */
873 typedef ::simd_float3 float3;
874 
875   /*! @abstract A vector of four 32-bit floating-point numbers.
876    *  @description In C or Objective-C, this type is available as
877    *  simd_float4. The alignment of this type is greater than the alignment
878    *  of float; if you need to operate on data buffers that may not be
879    *  suitably aligned, you should access them using simd::packed_float4
880    *  instead.                                                                */
881 typedef ::simd_float4 float4;
882 
883   /*! @abstract A vector of eight 32-bit floating-point numbers.
884    *  @description This type is not available in Metal. In C or Objective-C,
885    *  this type is available as simd_float8. The alignment of this type is
886    *  greater than the alignment of float; if you need to operate on data
887    *  buffers that may not be suitably aligned, you should access them using
888    *  simd::packed_float8 instead.                                            */
889 typedef ::simd_float8 float8;
890 
891   /*! @abstract A vector of sixteen 32-bit floating-point numbers.
892    *  @description This type is not available in Metal. In C or Objective-C,
893    *  this type is available as simd_float16. The alignment of this type is
894    *  greater than the alignment of float; if you need to operate on data
895    *  buffers that may not be suitably aligned, you should access them using
896    *  simd::packed_float16 instead.                                           */
897 typedef ::simd_float16 float16;
898 
899   /*! @abstract A scalar 64-bit signed (twos-complement) integer.
900    *  @discussion In C and Objective-C, this type is available as
901    *  simd_long1.                                                             */
902 typedef ::simd_long1 long1;
903 
904   /*! @abstract A vector of two 64-bit signed (twos-complement) integers.
905    *  @description In C or Objective-C, this type is available as
906    *  simd_long2. The alignment of this type is greater than the alignment
907    *  of simd_long1; if you need to operate on data buffers that may not be
908    *  suitably aligned, you should access them using simd::packed_long2
909    *  instead.                                                                */
910 typedef ::simd_long2 long2;
911 
912   /*! @abstract A vector of three 64-bit signed (twos-complement) integers.
913    *  @description In C or Objective-C, this type is available as
914    *  simd_long3. Vectors of this type are padded to have the same size and
915    *  alignment as simd_long4.                                                */
916 typedef ::simd_long3 long3;
917 
918   /*! @abstract A vector of four 64-bit signed (twos-complement) integers.
919    *  @description In C or Objective-C, this type is available as
920    *  simd_long4. The alignment of this type is greater than the alignment
921    *  of simd_long1; if you need to operate on data buffers that may not be
922    *  suitably aligned, you should access them using simd::packed_long4
923    *  instead.                                                                */
924 typedef ::simd_long4 long4;
925 
926   /*! @abstract A vector of eight 64-bit signed (twos-complement) integers.
927    *  @description This type is not available in Metal. In C or Objective-C,
928    *  this type is available as simd_long8. The alignment of this type is
929    *  greater than the alignment of simd_long1; if you need to operate on
930    *  data buffers that may not be suitably aligned, you should access them
931    *  using simd::packed_long8 instead.                                       */
932 typedef ::simd_long8 long8;
933 
934   /*! @abstract A scalar 64-bit unsigned integer.
935    *  @discussion In C and Objective-C, this type is available as
936    *  simd_ulong1.                                                            */
937 typedef ::simd_ulong1 ulong1;
938 
939   /*! @abstract A vector of two 64-bit unsigned integers.
940    *  @description In C or Objective-C, this type is available as
941    *  simd_ulong2. The alignment of this type is greater than the alignment
942    *  of simd_ulong1; if you need to operate on data buffers that may not be
943    *  suitably aligned, you should access them using simd::packed_ulong2
944    *  instead.                                                                */
945 typedef ::simd_ulong2 ulong2;
946 
947   /*! @abstract A vector of three 64-bit unsigned integers.
948    *  @description In C or Objective-C, this type is available as
949    *  simd_ulong3. Vectors of this type are padded to have the same size and
950    *  alignment as simd_ulong4.                                               */
951 typedef ::simd_ulong3 ulong3;
952 
953   /*! @abstract A vector of four 64-bit unsigned integers.
954    *  @description In C or Objective-C, this type is available as
955    *  simd_ulong4. The alignment of this type is greater than the alignment
956    *  of simd_ulong1; if you need to operate on data buffers that may not be
957    *  suitably aligned, you should access them using simd::packed_ulong4
958    *  instead.                                                                */
959 typedef ::simd_ulong4 ulong4;
960 
961   /*! @abstract A vector of eight 64-bit unsigned integers.
962    *  @description This type is not available in Metal. In C or Objective-C,
963    *  this type is available as simd_ulong8. The alignment of this type is
964    *  greater than the alignment of simd_ulong1; if you need to operate on
965    *  data buffers that may not be suitably aligned, you should access them
966    *  using simd::packed_ulong8 instead.                                      */
967 typedef ::simd_ulong8 ulong8;
968 
969   /*! @abstract A scalar 64-bit floating-point number.
970    *  @discussion In C and Objective-C, this type is available as
971    *  simd_double1.                                                           */
972 typedef ::simd_double1 double1;
973 
974   /*! @abstract A vector of two 64-bit floating-point numbers.
975    *  @description In C or Objective-C, this type is available as
976    *  simd_double2. The alignment of this type is greater than the alignment
977    *  of double; if you need to operate on data buffers that may not be
978    *  suitably aligned, you should access them using simd::packed_double2
979    *  instead.                                                                */
980 typedef ::simd_double2 double2;
981 
982   /*! @abstract A vector of three 64-bit floating-point numbers.
983    *  @description In C or Objective-C, this type is available as
984    *  simd_double3. Vectors of this type are padded to have the same size
985    *  and alignment as simd_double4.                                          */
986 typedef ::simd_double3 double3;
987 
988   /*! @abstract A vector of four 64-bit floating-point numbers.
989    *  @description In C or Objective-C, this type is available as
990    *  simd_double4. The alignment of this type is greater than the alignment
991    *  of double; if you need to operate on data buffers that may not be
992    *  suitably aligned, you should access them using simd::packed_double4
993    *  instead.                                                                */
994 typedef ::simd_double4 double4;
995 
996   /*! @abstract A vector of eight 64-bit floating-point numbers.
997    *  @description This type is not available in Metal. In C or Objective-C,
998    *  this type is available as simd_double8. The alignment of this type is
999    *  greater than the alignment of double; if you need to operate on data
1000    *  buffers that may not be suitably aligned, you should access them using
1001    *  simd::packed_double8 instead.                                           */
1002 typedef ::simd_double8 double8;
1003 
1004 } /* namespace simd::                                                         */
1005 #endif /* __cplusplus                                                         */
1006 
1007 /*  MARK: Deprecated vector types                                             */
1008 /*! @group Deprecated vector types
1009  *  @discussion These are the original types used by earlier versions of the
1010  *  simd library; they are provided here for compatability with existing source
1011  *  files. Use the new ("simd_"-prefixed) types for future development.       */
1012 
1013 /*! @abstract A vector of two 8-bit signed (twos-complement) integers.
1014  *  @description This type is deprecated; you should use simd_char2 or
1015  *  simd::char2 instead.                                                      */
1016 typedef simd_char2 vector_char2;
1017 
1018 /*! @abstract A vector of three 8-bit signed (twos-complement) integers.
1019  *  @description This type is deprecated; you should use simd_char3 or
1020  *  simd::char3 instead.                                                      */
1021 typedef simd_char3 vector_char3;
1022 
1023 /*! @abstract A vector of four 8-bit signed (twos-complement) integers.
1024  *  @description This type is deprecated; you should use simd_char4 or
1025  *  simd::char4 instead.                                                      */
1026 typedef simd_char4 vector_char4;
1027 
1028 /*! @abstract A vector of eight 8-bit signed (twos-complement) integers.
1029  *  @description This type is deprecated; you should use simd_char8 or
1030  *  simd::char8 instead.                                                      */
1031 typedef simd_char8 vector_char8;
1032 
1033 /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers.
1034  *  @description This type is deprecated; you should use simd_char16 or
1035  *  simd::char16 instead.                                                     */
1036 typedef simd_char16 vector_char16;
1037 
1038 /*! @abstract A vector of thirty-two 8-bit signed (twos-complement)
1039  *  integers.
1040  *  @description This type is deprecated; you should use simd_char32 or
1041  *  simd::char32 instead.                                                     */
1042 typedef simd_char32 vector_char32;
1043 
1044 /*! @abstract A vector of two 8-bit unsigned integers.
1045  *  @description This type is deprecated; you should use simd_uchar2 or
1046  *  simd::uchar2 instead.                                                     */
1047 typedef simd_uchar2 vector_uchar2;
1048 
1049 /*! @abstract A vector of three 8-bit unsigned integers.
1050  *  @description This type is deprecated; you should use simd_uchar3 or
1051  *  simd::uchar3 instead.                                                     */
1052 typedef simd_uchar3 vector_uchar3;
1053 
1054 /*! @abstract A vector of four 8-bit unsigned integers.
1055  *  @description This type is deprecated; you should use simd_uchar4 or
1056  *  simd::uchar4 instead.                                                     */
1057 typedef simd_uchar4 vector_uchar4;
1058 
1059 /*! @abstract A vector of eight 8-bit unsigned integers.
1060  *  @description This type is deprecated; you should use simd_uchar8 or
1061  *  simd::uchar8 instead.                                                     */
1062 typedef simd_uchar8 vector_uchar8;
1063 
1064 /*! @abstract A vector of sixteen 8-bit unsigned integers.
1065  *  @description This type is deprecated; you should use simd_uchar16 or
1066  *  simd::uchar16 instead.                                                    */
1067 typedef simd_uchar16 vector_uchar16;
1068 
1069 /*! @abstract A vector of thirty-two 8-bit unsigned integers.
1070  *  @description This type is deprecated; you should use simd_uchar32 or
1071  *  simd::uchar32 instead.                                                    */
1072 typedef simd_uchar32 vector_uchar32;
1073 
1074 /*! @abstract A vector of two 16-bit signed (twos-complement) integers.
1075  *  @description This type is deprecated; you should use simd_short2 or
1076  *  simd::short2 instead.                                                     */
1077 typedef simd_short2 vector_short2;
1078 
1079 /*! @abstract A vector of three 16-bit signed (twos-complement) integers.
1080  *  @description This type is deprecated; you should use simd_short3 or
1081  *  simd::short3 instead.                                                     */
1082 typedef simd_short3 vector_short3;
1083 
1084 /*! @abstract A vector of four 16-bit signed (twos-complement) integers.
1085  *  @description This type is deprecated; you should use simd_short4 or
1086  *  simd::short4 instead.                                                     */
1087 typedef simd_short4 vector_short4;
1088 
1089 /*! @abstract A vector of eight 16-bit signed (twos-complement) integers.
1090  *  @description This type is deprecated; you should use simd_short8 or
1091  *  simd::short8 instead.                                                     */
1092 typedef simd_short8 vector_short8;
1093 
1094 /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers.
1095  *  @description This type is deprecated; you should use simd_short16 or
1096  *  simd::short16 instead.                                                    */
1097 typedef simd_short16 vector_short16;
1098 
1099 /*! @abstract A vector of thirty-two 16-bit signed (twos-complement)
1100  *  integers.
1101  *  @description This type is deprecated; you should use simd_short32 or
1102  *  simd::short32 instead.                                                    */
1103 typedef simd_short32 vector_short32;
1104 
1105 /*! @abstract A vector of two 16-bit unsigned integers.
1106  *  @description This type is deprecated; you should use simd_ushort2 or
1107  *  simd::ushort2 instead.                                                    */
1108 typedef simd_ushort2 vector_ushort2;
1109 
1110 /*! @abstract A vector of three 16-bit unsigned integers.
1111  *  @description This type is deprecated; you should use simd_ushort3 or
1112  *  simd::ushort3 instead.                                                    */
1113 typedef simd_ushort3 vector_ushort3;
1114 
1115 /*! @abstract A vector of four 16-bit unsigned integers.
1116  *  @description This type is deprecated; you should use simd_ushort4 or
1117  *  simd::ushort4 instead.                                                    */
1118 typedef simd_ushort4 vector_ushort4;
1119 
1120 /*! @abstract A vector of eight 16-bit unsigned integers.
1121  *  @description This type is deprecated; you should use simd_ushort8 or
1122  *  simd::ushort8 instead.                                                    */
1123 typedef simd_ushort8 vector_ushort8;
1124 
1125 /*! @abstract A vector of sixteen 16-bit unsigned integers.
1126  *  @description This type is deprecated; you should use simd_ushort16 or
1127  *  simd::ushort16 instead.                                                   */
1128 typedef simd_ushort16 vector_ushort16;
1129 
1130 /*! @abstract A vector of thirty-two 16-bit unsigned integers.
1131  *  @description This type is deprecated; you should use simd_ushort32 or
1132  *  simd::ushort32 instead.                                                   */
1133 typedef simd_ushort32 vector_ushort32;
1134 
1135 /*! @abstract A vector of two 32-bit signed (twos-complement) integers.
1136  *  @description This type is deprecated; you should use simd_int2 or
1137  *  simd::int2 instead.                                                       */
1138 typedef simd_int2 vector_int2;
1139 
1140 /*! @abstract A vector of three 32-bit signed (twos-complement) integers.
1141  *  @description This type is deprecated; you should use simd_int3 or
1142  *  simd::int3 instead.                                                       */
1143 typedef simd_int3 vector_int3;
1144 
1145 /*! @abstract A vector of four 32-bit signed (twos-complement) integers.
1146  *  @description This type is deprecated; you should use simd_int4 or
1147  *  simd::int4 instead.                                                       */
1148 typedef simd_int4 vector_int4;
1149 
1150 /*! @abstract A vector of eight 32-bit signed (twos-complement) integers.
1151  *  @description This type is deprecated; you should use simd_int8 or
1152  *  simd::int8 instead.                                                       */
1153 typedef simd_int8 vector_int8;
1154 
1155 /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers.
1156  *  @description This type is deprecated; you should use simd_int16 or
1157  *  simd::int16 instead.                                                      */
1158 typedef simd_int16 vector_int16;
1159 
1160 /*! @abstract A vector of two 32-bit unsigned integers.
1161  *  @description This type is deprecated; you should use simd_uint2 or
1162  *  simd::uint2 instead.                                                      */
1163 typedef simd_uint2 vector_uint2;
1164 
1165 /*! @abstract A vector of three 32-bit unsigned integers.
1166  *  @description This type is deprecated; you should use simd_uint3 or
1167  *  simd::uint3 instead.                                                      */
1168 typedef simd_uint3 vector_uint3;
1169 
1170 /*! @abstract A vector of four 32-bit unsigned integers.
1171  *  @description This type is deprecated; you should use simd_uint4 or
1172  *  simd::uint4 instead.                                                      */
1173 typedef simd_uint4 vector_uint4;
1174 
1175 /*! @abstract A vector of eight 32-bit unsigned integers.
1176  *  @description This type is deprecated; you should use simd_uint8 or
1177  *  simd::uint8 instead.                                                      */
1178 typedef simd_uint8 vector_uint8;
1179 
1180 /*! @abstract A vector of sixteen 32-bit unsigned integers.
1181  *  @description This type is deprecated; you should use simd_uint16 or
1182  *  simd::uint16 instead.                                                     */
1183 typedef simd_uint16 vector_uint16;
1184 
1185 /*! @abstract A vector of two 32-bit floating-point numbers.
1186  *  @description This type is deprecated; you should use simd_float2 or
1187  *  simd::float2 instead.                                                     */
1188 typedef simd_float2 vector_float2;
1189 
1190 /*! @abstract A vector of three 32-bit floating-point numbers.
1191  *  @description This type is deprecated; you should use simd_float3 or
1192  *  simd::float3 instead.                                                     */
1193 typedef simd_float3 vector_float3;
1194 
1195 /*! @abstract A vector of four 32-bit floating-point numbers.
1196  *  @description This type is deprecated; you should use simd_float4 or
1197  *  simd::float4 instead.                                                     */
1198 typedef simd_float4 vector_float4;
1199 
1200 /*! @abstract A vector of eight 32-bit floating-point numbers.
1201  *  @description This type is deprecated; you should use simd_float8 or
1202  *  simd::float8 instead.                                                     */
1203 typedef simd_float8 vector_float8;
1204 
1205 /*! @abstract A vector of sixteen 32-bit floating-point numbers.
1206  *  @description This type is deprecated; you should use simd_float16 or
1207  *  simd::float16 instead.                                                    */
1208 typedef simd_float16 vector_float16;
1209 
1210 /*! @abstract A scalar 64-bit signed (twos-complement) integer.
1211  *  @description This type is deprecated; you should use simd_long1 or
1212  *  simd::long1 instead.                                                      */
1213 typedef simd_long1 vector_long1;
1214 
1215 /*! @abstract A vector of two 64-bit signed (twos-complement) integers.
1216  *  @description This type is deprecated; you should use simd_long2 or
1217  *  simd::long2 instead.                                                      */
1218 typedef simd_long2 vector_long2;
1219 
1220 /*! @abstract A vector of three 64-bit signed (twos-complement) integers.
1221  *  @description This type is deprecated; you should use simd_long3 or
1222  *  simd::long3 instead.                                                      */
1223 typedef simd_long3 vector_long3;
1224 
1225 /*! @abstract A vector of four 64-bit signed (twos-complement) integers.
1226  *  @description This type is deprecated; you should use simd_long4 or
1227  *  simd::long4 instead.                                                      */
1228 typedef simd_long4 vector_long4;
1229 
1230 /*! @abstract A vector of eight 64-bit signed (twos-complement) integers.
1231  *  @description This type is deprecated; you should use simd_long8 or
1232  *  simd::long8 instead.                                                      */
1233 typedef simd_long8 vector_long8;
1234 
1235 /*! @abstract A scalar 64-bit unsigned integer.
1236  *  @description This type is deprecated; you should use simd_ulong1 or
1237  *  simd::ulong1 instead.                                                     */
1238 typedef simd_ulong1 vector_ulong1;
1239 
1240 /*! @abstract A vector of two 64-bit unsigned integers.
1241  *  @description This type is deprecated; you should use simd_ulong2 or
1242  *  simd::ulong2 instead.                                                     */
1243 typedef simd_ulong2 vector_ulong2;
1244 
1245 /*! @abstract A vector of three 64-bit unsigned integers.
1246  *  @description This type is deprecated; you should use simd_ulong3 or
1247  *  simd::ulong3 instead.                                                     */
1248 typedef simd_ulong3 vector_ulong3;
1249 
1250 /*! @abstract A vector of four 64-bit unsigned integers.
1251  *  @description This type is deprecated; you should use simd_ulong4 or
1252  *  simd::ulong4 instead.                                                     */
1253 typedef simd_ulong4 vector_ulong4;
1254 
1255 /*! @abstract A vector of eight 64-bit unsigned integers.
1256  *  @description This type is deprecated; you should use simd_ulong8 or
1257  *  simd::ulong8 instead.                                                     */
1258 typedef simd_ulong8 vector_ulong8;
1259 
1260 /*! @abstract A vector of two 64-bit floating-point numbers.
1261  *  @description This type is deprecated; you should use simd_double2 or
1262  *  simd::double2 instead.                                                    */
1263 typedef simd_double2 vector_double2;
1264 
1265 /*! @abstract A vector of three 64-bit floating-point numbers.
1266  *  @description This type is deprecated; you should use simd_double3 or
1267  *  simd::double3 instead.                                                    */
1268 typedef simd_double3 vector_double3;
1269 
1270 /*! @abstract A vector of four 64-bit floating-point numbers.
1271  *  @description This type is deprecated; you should use simd_double4 or
1272  *  simd::double4 instead.                                                    */
1273 typedef simd_double4 vector_double4;
1274 
1275 /*! @abstract A vector of eight 64-bit floating-point numbers.
1276  *  @description This type is deprecated; you should use simd_double8 or
1277  *  simd::double8 instead.                                                    */
1278 typedef simd_double8 vector_double8;
1279 
1280 # endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
1281 #endif