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