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
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
21template <typename T> struct make_signed;
22
24template <> struct make_signed<uint8x16_t> { using type = int8x16_t; };
25template <> struct make_signed<int8x16_t> { using type = int8x16_t; };
26template <> struct make_signed<uint16x8_t> { using type = int16x8_t; };
27template <> struct make_signed<int16x8_t> { using type = int16x8_t; };
28template <> struct make_signed<uint32x4_t> { using type = int32x4_t; };
29template <> struct make_signed<int32x4_t> { using type = int32x4_t; };
30template <> struct make_signed<uint64x2_t> { using type = int64x2_t; };
31template <> struct make_signed<int64x2_t> { using type = int64x2_t; };
32
33#ifndef ARGON_PLATFORM_MVE
34template <> struct make_signed<uint8x8_t> { using type = int8x8_t; };
35template <> struct make_signed<int8x8_t> { using type = int8x8_t; };
36template <> struct make_signed<uint16x4_t> { using type = int16x4_t; };
37template <> struct make_signed<int16x4_t> { using type = int16x4_t; };
38template <> struct make_signed<uint32x2_t> { using type = int32x2_t; };
39template <> struct make_signed<int32x2_t> { using type = int32x2_t; };
40template <> struct make_signed<uint64x1_t> { using type = int64x1_t; };
41template <> struct make_signed<int64x1_t> { using type = int64x1_t; };
42#endif
44
47template <typename T> using make_signed_t = typename make_signed<T>::type;
48// clang-format on
49} // namespace simd
50#undef simd
Header file for SIMD features and platform detection.
Helper template to get the signed type of a SIMD vector type.
Definition make_signed.hpp:21