Argon 0.1.0
Loading...
Searching...
No Matches
make_signed.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
12#define simd neon
13#endif
14
15namespace simd {
16// clang-format off
17
20template <typename T> struct make_signed;
21
23template <> struct make_signed<uint8x16_t> { using type = int8x16_t; };
24template <> struct make_signed<int8x16_t> { using type = int8x16_t; };
25template <> struct make_signed<uint16x8_t> { using type = int16x8_t; };
26template <> struct make_signed<int16x8_t> { using type = int16x8_t; };
27template <> struct make_signed<uint32x4_t> { using type = int32x4_t; };
28template <> struct make_signed<int32x4_t> { using type = int32x4_t; };
29template <> struct make_signed<uint64x2_t> { using type = int64x2_t; };
30template <> struct make_signed<int64x2_t> { using type = int64x2_t; };
31
32#ifndef ARGON_PLATFORM_MVE
33template <> struct make_signed<uint8x8_t> { using type = int8x8_t; };
34template <> struct make_signed<int8x8_t> { using type = int8x8_t; };
35template <> struct make_signed<uint16x4_t> { using type = int16x4_t; };
36template <> struct make_signed<int16x4_t> { using type = int16x4_t; };
37template <> struct make_signed<uint32x2_t> { using type = int32x2_t; };
38template <> struct make_signed<int32x2_t> { using type = int32x2_t; };
39template <> struct make_signed<uint64x1_t> { using type = int64x1_t; };
40template <> struct make_signed<int64x1_t> { using type = int64x1_t; };
41#endif
43
46template <typename T> using make_signed_t = typename make_signed<T>::type;
47// clang-format on
48} // namespace simd
49#undef simd
Header file for SIMD features and platform detection.
SIMDe's NEON implementation (x86 and other non-Arm hosts) under the NEON intrinsic names.
Helper template to get the signed type of a SIMD vector type.
Definition make_signed.hpp:20