Argon 0.1.0
Loading...
Searching...
No Matches
vec128.hpp
1
2#pragma once
3#include "argon/features.h"
4
5#ifdef __ARM_NEON
6#include <arm_neon.h>
7#define simd neon
8#elifdef __ARM_FEATURE_MVE
9#include <arm_mve.h>
10#define simd mve
11#else
12#define SIMDE_ENABLE_NATIVE_ALIASES
13#include <arm/neon.h>
14#define simd neon
15#endif
16
17namespace simd {
18// clang-format off
19
22template <typename T> struct Vec128;
23
25template <> struct Vec128<int8_t> {using type = int8x16_t; };
26template <> struct Vec128<uint8_t> {using type = uint8x16_t; };
27template <> struct Vec128<int16_t> {using type = int16x8_t; };
28template <> struct Vec128<uint16_t> {using type = uint16x8_t; };
29template <> struct Vec128<int32_t> {using type = int32x4_t; };
30template <> struct Vec128<uint32_t> {using type = uint32x4_t; };
31template <> struct Vec128<int64_t> {using type = int64x2_t; };
32template <> struct Vec128<uint64_t> {using type = uint64x2_t; };
33
34#if ARGON_HAS_HALF_FLOAT
35template <> struct Vec128<float16_t> {using type = float16x8_t; };
36#endif
37
38#if ARGON_HAS_SINGLE_FLOAT
39template <> struct Vec128<float> {using type = float32x4_t; };
40#endif
41
42#if ARGON_HAS_DOUBLE_FLOAT
43template <> struct Vec128<double> {using type = float64x2_t; };
44#endif
46
49template <typename T>
50using Vec128_t = typename Vec128<std::remove_cv_t<T>>::type;
51
52// clang-format on
53} // namespace simd
54#undef simd
Header file for SIMD features and platform detection.
Helper template to get the SIMD quad-word vector type for a given scalar type.
Definition vec128.hpp:22