diff --git a/include/xsimd/arch/xsimd_imm8_neon64.hpp b/include/xsimd/arch/xsimd_imm8_neon64.hpp new file mode 100644 index 000000000..59fba7d3c --- /dev/null +++ b/include/xsimd/arch/xsimd_imm8_neon64.hpp @@ -0,0 +1,17 @@ +/*************************************************************************** + * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and * + * Martin Renou * + * Copyright (c) QuantStack * + * Copyright (c) Serge Guelton * + * * + * Distributed under the terms of the BSD 3-Clause License. * + * * + * The full license is in the file LICENSE, distributed with this software. * + ****************************************************************************/ + +#ifndef XSIMD_IMM8_NEON64_HPP +#define XSIMD_IMM8_NEON64_HPP + +#include "../types/xsimd_imm8_neon64_register.hpp" + +#endif diff --git a/include/xsimd/config/xsimd_arch.hpp b/include/xsimd/config/xsimd_arch.hpp index 575459a00..d6b3a6352 100644 --- a/include/xsimd/config/xsimd_arch.hpp +++ b/include/xsimd/config/xsimd_arch.hpp @@ -194,7 +194,7 @@ namespace xsimd using all_sve_architectures = arch_list, detail::sve<256>, detail::sve<128>>; using all_rvv_architectures = arch_list, detail::rvv<256>, detail::rvv<128>>; - using all_arm_architectures = typename detail::join>::type; + using all_arm_architectures = typename detail::join, neon64, neon>>::type; using all_riscv_architectures = all_rvv_architectures; using all_wasm_architectures = arch_list; using all_architectures = typename detail::join::type; diff --git a/include/xsimd/config/xsimd_cpuid.hpp b/include/xsimd/config/xsimd_cpuid.hpp index 5c8b1f38d..85977a0b7 100644 --- a/include/xsimd/config/xsimd_cpuid.hpp +++ b/include/xsimd/config/xsimd_cpuid.hpp @@ -66,6 +66,7 @@ namespace xsimd ARCH_FIELD_EX(avx512vnni<::xsimd::avx512vbmi>, avx512vnni_vbmi) ARCH_FIELD(neon) ARCH_FIELD(neon64) + ARCH_FIELD(imm8_neon64) ARCH_FIELD(sve) ARCH_FIELD(rvv) ARCH_FIELD(wasm) @@ -83,6 +84,9 @@ namespace xsimd #if defined(__aarch64__) || defined(_M_ARM64) neon = 1; neon64 = 1; +#if defined(__linux__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 18) + imm8_neon64 = bool(getauxval(AT_HWCAP2) & HWCAP2_I8MM); +#endif #elif defined(__ARM_NEON) || defined(_M_ARM) #if defined(__linux__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 18) diff --git a/include/xsimd/types/xsimd_imm8_neon64_register.hpp b/include/xsimd/types/xsimd_imm8_neon64_register.hpp new file mode 100644 index 000000000..d9e542f56 --- /dev/null +++ b/include/xsimd/types/xsimd_imm8_neon64_register.hpp @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and * + * Martin Renou * + * Copyright (c) QuantStack * + * Copyright (c) Serge Guelton * + * * + * Distributed under the terms of the BSD 3-Clause License. * + * * + * The full license is in the file LICENSE, distributed with this software. * + ****************************************************************************/ + +#ifndef XSIMD_IMM8_NEON64_REGISTER_HPP +#define XSIMD_IMM8_NEON64_REGISTER_HPP + +#include "./xsimd_neon64_register.hpp" + +namespace xsimd +{ + template + struct imm8; + + /** + * @ingroup architectures + * + * Neon64 + imm8 instructions + */ + template <> + struct imm8 : neon64 + { + static constexpr bool supported() noexcept { return XSIMD_WITH_IMM8_NEON64; } + static constexpr bool available() noexcept { return true; } + static constexpr unsigned version() noexcept { return generic::version(8, 2, 0); } + static constexpr char const* name() noexcept { return "imm8+neon64"; } + }; + +#if XSIMD_WITH_IMM8_NEON64 + namespace types + { + + XSIMD_DECLARE_SIMD_REGISTER_ALIAS(imm8, neon64); + + } +#endif + +} +#endif