-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharm_detail.h
44 lines (35 loc) · 1.06 KB
/
arm_detail.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* SPDX-License-Identifier: GPL-3.0-or-later WITH GCC-exception-3.1 */
/* Copyright © 2023–2025 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
* Matthias Kretz <[email protected]>
*/
#ifndef PROTOTYPE_ARM_DETAIL_H_
#define PROTOTYPE_ARM_DETAIL_H_
#include "detail.h"
#if _GLIBCXX_SIMD_HAVE_NEON or _GLIBCXX_SIMD_HAVE_SVE
namespace std::__detail
{
struct _ArchFlags
{
uint64_t _M_flags = (_GLIBCXX_SIMD_HAVE_NEON << 0)
| (_GLIBCXX_SIMD_HAVE_NEON_A32 << 1)
| (_GLIBCXX_SIMD_HAVE_NEON_A64 << 2)
| (_GLIBCXX_SIMD_HAVE_SVE << 3);
constexpr bool
_M_test(int __bit) const
{ return ((_M_flags >> __bit) & 1) == 1; }
constexpr bool
_M_have_neon() const
{ return _M_test(0); }
constexpr bool
_M_have_neon_a32() const
{ return _M_test(1); }
constexpr bool
_M_have_neon_a64() const
{ return _M_test(2); }
constexpr bool
_M_have_sve() const
{ return _M_test(3); }
};
}
#endif
#endif // PROTOTYPE_ARM_DETAIL_H_