/*************************************************************************** * 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_REGISTER_HPP #define XSIMD_REGISTER_HPP #include namespace xsimd { namespace types { template struct has_simd_register : std::false_type { }; template struct simd_register { struct register_type { }; }; #define XSIMD_DECLARE_SIMD_REGISTER(SCALAR_TYPE, ISA, VECTOR_TYPE) \ template <> \ struct simd_register \ { \ using register_type = VECTOR_TYPE; \ register_type data; \ inline operator register_type() const noexcept \ { \ return data; \ } \ }; \ template <> \ struct has_simd_register : std::true_type \ { \ } #define XSIMD_DECLARE_INVALID_SIMD_REGISTER(SCALAR_TYPE, ISA) \ template <> \ struct has_simd_register : std::false_type \ { \ } #define XSIMD_DECLARE_SIMD_REGISTER_ALIAS(ISA, ISA_BASE) \ template \ struct simd_register : simd_register \ { \ using register_type = typename simd_register::register_type; \ simd_register(register_type reg) noexcept \ : simd_register { reg } \ { \ } \ simd_register() = default; \ }; \ template \ struct has_simd_register : has_simd_register \ { \ } template struct get_bool_simd_register { using type = simd_register; }; template using get_bool_simd_register_t = typename get_bool_simd_register::type; } namespace kernel { template // makes requires_arch equal to A const&, using type_traits functions using requires_arch = typename std::add_lvalue_reference::type>::type; template struct convert { }; } } #endif