Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 09:11:39

0001 /***************************************************************************
0002  * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and         *
0003  * Martin Renou                                                             *
0004  * Copyright (c) QuantStack                                                 *
0005  * Copyright (c) Serge Guelton                                              *
0006  *                                                                          *
0007  * Distributed under the terms of the BSD 3-Clause License.                 *
0008  *                                                                          *
0009  * The full license is in the file LICENSE, distributed with this software. *
0010  ****************************************************************************/
0011 
0012 #ifndef XSIMD_AVX512F_REGISTER_HPP
0013 #define XSIMD_AVX512F_REGISTER_HPP
0014 
0015 #include "./xsimd_generic_arch.hpp"
0016 
0017 namespace xsimd
0018 {
0019 
0020     /**
0021      * @ingroup architectures
0022      *
0023      * AVX512F instructions
0024      */
0025     struct avx512f : generic
0026     {
0027         static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512F; }
0028         static constexpr bool available() noexcept { return true; }
0029         static constexpr std::size_t alignment() noexcept { return 64; }
0030         static constexpr bool requires_alignment() noexcept { return true; }
0031         static constexpr char const* name() noexcept { return "avx512f"; }
0032     };
0033 
0034 #if XSIMD_WITH_AVX512F
0035 
0036     namespace types
0037     {
0038         template <class T>
0039         struct simd_avx512_bool_register
0040         {
0041             using register_type = typename std::conditional<
0042                 (sizeof(T) < 4), std::conditional<(sizeof(T) == 1), __mmask64, __mmask32>,
0043                 std::conditional<(sizeof(T) == 4), __mmask16, __mmask8>>::type::type;
0044             register_type data;
0045             simd_avx512_bool_register() = default;
0046             simd_avx512_bool_register(register_type r) { data = r; }
0047             operator register_type() const noexcept { return data; }
0048         };
0049         template <class T>
0050         struct get_bool_simd_register<T, avx512f>
0051         {
0052             using type = simd_avx512_bool_register<T>;
0053         };
0054 
0055         XSIMD_DECLARE_SIMD_REGISTER(signed char, avx512f, __m512i);
0056         XSIMD_DECLARE_SIMD_REGISTER(unsigned char, avx512f, __m512i);
0057         XSIMD_DECLARE_SIMD_REGISTER(char, avx512f, __m512i);
0058         XSIMD_DECLARE_SIMD_REGISTER(unsigned short, avx512f, __m512i);
0059         XSIMD_DECLARE_SIMD_REGISTER(short, avx512f, __m512i);
0060         XSIMD_DECLARE_SIMD_REGISTER(unsigned int, avx512f, __m512i);
0061         XSIMD_DECLARE_SIMD_REGISTER(int, avx512f, __m512i);
0062         XSIMD_DECLARE_SIMD_REGISTER(unsigned long int, avx512f, __m512i);
0063         XSIMD_DECLARE_SIMD_REGISTER(long int, avx512f, __m512i);
0064         XSIMD_DECLARE_SIMD_REGISTER(unsigned long long int, avx512f, __m512i);
0065         XSIMD_DECLARE_SIMD_REGISTER(long long int, avx512f, __m512i);
0066         XSIMD_DECLARE_SIMD_REGISTER(float, avx512f, __m512);
0067         XSIMD_DECLARE_SIMD_REGISTER(double, avx512f, __m512d);
0068 
0069     }
0070 #endif
0071 }
0072 
0073 #endif