graphene-config.h 2.2 KB

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