1 | /* graphene-config.h |
2 | * |
3 | * This is a generated file, DO NOT EDIT. |
4 | * |
5 | * SPDX-License-Identifier: MIT |
6 | */ |
7 | |
8 | #pragma once |
9 | |
10 | #ifdef __cplusplus |
11 | extern "C" { |
12 | #endif |
13 | |
14 | #ifndef __GI_SCANNER__ |
15 | # ifndef GRAPHENE_SIMD_BENCHMARK |
16 | |
17 | # if defined(__SSE__) || \ |
18 | (defined(_M_X64) && (_M_X64 > 0)) |
19 | #define GRAPHENE_HAS_SSE 1 |
20 | # endif |
21 | |
22 | # if defined(__ARM_NEON__) || defined (_M_ARM64) |
23 | /* #undef GRAPHENE_HAS_ARM_NEON */ |
24 | # endif |
25 | |
26 | # if defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 9) && !defined(__arm__) |
27 | #define GRAPHENE_HAS_GCC 1 |
28 | # endif |
29 | |
30 | # define GRAPHENE_HAS_SCALAR 1 |
31 | # endif /* GRAPHENE_SIMD_BENCHMARK */ |
32 | |
33 | # if defined(GRAPHENE_HAS_SSE) |
34 | # define GRAPHENE_USE_SSE |
35 | # define GRAPHENE_SIMD_S "sse" |
36 | # elif defined(GRAPHENE_HAS_ARM_NEON) |
37 | # define GRAPHENE_USE_ARM_NEON |
38 | # define GRAPHENE_SIMD_S "neon" |
39 | # elif defined(GRAPHENE_HAS_GCC) |
40 | # define GRAPHENE_USE_GCC |
41 | # define GRAPHENE_SIMD_S "gcc" |
42 | # elif defined(GRAPHENE_HAS_SCALAR) |
43 | # define GRAPHENE_USE_SCALAR |
44 | # define GRAPHENE_SIMD_S "scalar" |
45 | # else |
46 | # error "Unsupported platform." |
47 | # endif |
48 | |
49 | # if defined(GRAPHENE_USE_SSE) |
50 | # include <xmmintrin.h> |
51 | # include <emmintrin.h> |
52 | # if defined(_M_IX86_FP) |
53 | # if _M_IX86_FP >= 2 |
54 | # define GRAPHENE_USE_SSE4_1 |
55 | # endif |
56 | # elif defined(__SSE4_1__) |
57 | # define GRAPHENE_USE_SSE4_1 |
58 | # elif defined(_MSC_VER) |
59 | # define GRAPHENE_USE_SSE4_1 |
60 | # endif |
61 | # if defined(GRAPHENE_USE_SSE4_1) |
62 | # include <smmintrin.h> |
63 | # endif |
64 | typedef __m128 graphene_simd4f_t; |
65 | # elif defined(GRAPHENE_USE_ARM_NEON) |
66 | # include <arm_neon.h> |
67 | typedef float32x4_t graphene_simd4f_t; |
68 | # elif defined(GRAPHENE_USE_GCC) |
69 | typedef float graphene_simd4f_t __attribute__((vector_size(16))); |
70 | # elif defined(GRAPHENE_USE_SCALAR) |
71 | typedef struct { |
72 | /*< private >*/ |
73 | float x, y, z, w; |
74 | } graphene_simd4f_t; |
75 | # else |
76 | # error "Unsupported platform." |
77 | # endif |
78 | #else /* __GI_SCANNER__ */ |
79 | /* The gobject-introspection scanner has issues parsing the |
80 | * system headers with SIMD built-ins, so we fall back to |
81 | * scalars; it does not really matter, as we wrap them in |
82 | * our public API, and introspection cannot use the SIMD API |
83 | * directly anyway. |
84 | */ |
85 | # define GRAPHENE_USE_SCALAR |
86 | |
87 | typedef struct { |
88 | /*< private >*/ |
89 | float x, y, z, w; |
90 | } graphene_simd4f_t; |
91 | #endif /* __GI_SCANNER__ */ |
92 | |
93 | typedef struct { |
94 | /*< private >*/ |
95 | graphene_simd4f_t x, y, z, w; |
96 | } graphene_simd4x4f_t; |
97 | |
98 | #ifdef __cplusplus |
99 | } |
100 | #endif |
101 | |