Skip to content

Commit 42d885c

Browse files
Provide stub for avx512 ifma and vbmi architectures
1 parent a948664 commit 42d885c

File tree

8 files changed

+178
-2
lines changed

8 files changed

+178
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/***************************************************************************
2+
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3+
* Martin Renou *
4+
* Copyright (c) QuantStack *
5+
* Copyright (c) Serge Guelton *
6+
* *
7+
* Distributed under the terms of the BSD 3-Clause License. *
8+
* *
9+
* The full license is in the file LICENSE, distributed with this software. *
10+
****************************************************************************/
11+
12+
#ifndef XSIMD_AVX512VBMI_HPP
13+
#define XSIMD_AVX512VBMI_HPP
14+
15+
#include <array>
16+
#include <type_traits>
17+
18+
#include "../types/xsimd_avx512vbmi_register.hpp"
19+
20+
#endif
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/***************************************************************************
2+
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3+
* Martin Renou *
4+
* Copyright (c) QuantStack *
5+
* Copyright (c) Serge Guelton *
6+
* *
7+
* Distributed under the terms of the BSD 3-Clause License. *
8+
* *
9+
* The full license is in the file LICENSE, distributed with this software. *
10+
****************************************************************************/
11+
12+
#ifndef XSIMD_AVX512VBMI_HPP
13+
#define XSIMD_AVX512VBMI_HPP
14+
15+
#include <array>
16+
#include <type_traits>
17+
18+
#include "../types/xsimd_avx512vbmi_register.hpp"
19+
20+
#endif

include/xsimd/arch/xsimd_isa.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@
7676
#include "./xsimd_avx512pf.hpp"
7777
#endif
7878

79+
#if XSIMD_WITH_AVX512IFMA
80+
#include "./xsimd_avx512ifma.hpp"
81+
#endif
82+
83+
#if XSIMD_WITH_AVX512VBMI
84+
#include "./xsimd_avx512vbmi.hpp"
85+
#endif
86+
7987
#if XSIMD_WITH_NEON
8088
#include "./xsimd_neon.hpp"
8189
#endif

include/xsimd/config/xsimd_config.hpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,28 @@
266266
#define XSIMD_WITH_AVX512PF 0
267267
#endif
268268

269+
/**
270+
* @ingroup xsimd_config_macro
271+
*
272+
* Set to 1 if AVX512IFMA is available at compile-time, to 0 otherwise.
273+
*/
274+
#ifdef __AVX512IFMA__
275+
#define XSIMD_WITH_AVX512IFMA XSIMD_WITH_AVX512F
276+
#else
277+
#define XSIMD_WITH_AVX512IFMA 0
278+
#endif
279+
280+
/**
281+
* @ingroup xsimd_config_macro
282+
*
283+
* Set to 1 if AVX512VBMI is available at compile-time, to 0 otherwise.
284+
*/
285+
#ifdef __AVX512VBMI__
286+
#define XSIMD_WITH_AVX512VBMI XSIMD_WITH_AVX512F
287+
#else
288+
#define XSIMD_WITH_AVX512VBMI 0
289+
#endif
290+
269291
#ifdef __ARM_NEON
270292

271293
/**
@@ -389,7 +411,7 @@
389411

390412
#endif
391413

392-
#if !XSIMD_WITH_SSE2 && !XSIMD_WITH_SSE3 && !XSIMD_WITH_SSSE3 && !XSIMD_WITH_SSE4_1 && !XSIMD_WITH_SSE4_2 && !XSIMD_WITH_AVX && !XSIMD_WITH_AVX2 && !XSIMD_WITH_FMA3_SSE && !XSIMD_WITH_FMA4 && !XSIMD_WITH_FMA3_AVX && !XSIMD_WITH_FMA3_AVX2 && !XSIMD_WITH_AVX512F && !XSIMD_WITH_AVX512CD && !XSIMD_WITH_AVX512DQ && !XSIMD_WITH_AVX512BW && !XSIMD_WITH_AVX512ER && !XSIMD_WITH_AVX512PF && !XSIMD_WITH_NEON && !XSIMD_WITH_NEON64 && !XSIMD_WITH_SVE && !XSIMD_WITH_RVV && !XSIMD_WITH_WASM
414+
#if !XSIMD_WITH_SSE2 && !XSIMD_WITH_SSE3 && !XSIMD_WITH_SSSE3 && !XSIMD_WITH_SSE4_1 && !XSIMD_WITH_SSE4_2 && !XSIMD_WITH_AVX && !XSIMD_WITH_AVX2 && !XSIMD_WITH_FMA3_SSE && !XSIMD_WITH_FMA4 && !XSIMD_WITH_FMA3_AVX && !XSIMD_WITH_FMA3_AVX2 && !XSIMD_WITH_AVX512F && !XSIMD_WITH_AVX512CD && !XSIMD_WITH_AVX512DQ && !XSIMD_WITH_AVX512BW && !XSIMD_WITH_AVX512ER && !XSIMD_WITH_AVX512PF && !XSIMD_WITH_AVX512IFMA && !XSIMD_WITH_AVX512VBMI && !XSIMD_WITH_NEON && !XSIMD_WITH_NEON64 && !XSIMD_WITH_SVE && !XSIMD_WITH_RVV && !XSIMD_WITH_WASM
393415
#endif
394416

395417
#endif

include/xsimd/config/xsimd_cpuid.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ namespace xsimd
5252
unsigned avx512bw : 1;
5353
unsigned avx512er : 1;
5454
unsigned avx512pf : 1;
55+
unsigned avx512ifma : 1;
56+
unsigned avx512vbmi : 1;
5557
unsigned neon : 1;
5658
unsigned neon64 : 1;
5759
unsigned sve : 1;
@@ -199,6 +201,11 @@ namespace xsimd
199201
avx512pf = regs7[1] >> 26 & 1;
200202
best = std::max(best, avx512pf::version() * avx512pf * avx512er * avx512cd * avx512f);
201203

204+
avx512ifma = regs7[1] >> 21 & 1;
205+
best = std::max(best, avx512ifma::version() * avx512ifma * avx512bw * avx512dq * avx512cd * avx512f);
206+
207+
avx512vbmi = regs7[2] >> 1 & 1;
208+
best = std::max(best, avx512vbmi::version() * avx512vbmi * avx512ifma * avx512bw * avx512dq * avx512cd * avx512f);
202209
#endif
203210
}
204211
};

include/xsimd/types/xsimd_all_registers.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
#include "xsimd_fma3_avx2_register.hpp"
2222
#include "xsimd_fma3_avx_register.hpp"
2323

24-
#include "xsimd_avx512pf_register.hpp"
24+
#include "xsimd_avx512ifma_register.hpp"
25+
#include "xsimd_avx512vbmi_register.hpp"
26+
2527
#include "xsimd_avx512er_register.hpp"
28+
#include "xsimd_avx512pf_register.hpp"
2629

2730
#include "xsimd_avx512bw_register.hpp"
2831
#include "xsimd_avx512cd_register.hpp"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/***************************************************************************
2+
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3+
* Martin Renou *
4+
* Copyright (c) QuantStack *
5+
* Copyright (c) Serge Guelton *
6+
* *
7+
* Distributed under the terms of the BSD 3-Clause License. *
8+
* *
9+
* The full license is in the file LICENSE, distributed with this software. *
10+
****************************************************************************/
11+
12+
#ifndef XSIMD_AVX512IFMA_REGISTER_HPP
13+
#define XSIMD_AVX512IFMA_REGISTER_HPP
14+
15+
#include "./xsimd_avx512dq_register.hpp"
16+
17+
namespace xsimd
18+
{
19+
20+
/**
21+
* @ingroup architectures
22+
*
23+
* AVX512IFMA instructions
24+
*/
25+
struct avx512ifma : avx512dq
26+
{
27+
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512IFMA; }
28+
static constexpr bool available() noexcept { return true; }
29+
static constexpr unsigned version() noexcept { return generic::version(3, 4, 0); }
30+
static constexpr char const* name() noexcept { return "avx512ifma"; }
31+
};
32+
33+
#if XSIMD_WITH_AVX512IFMA
34+
35+
namespace types
36+
{
37+
template <class T>
38+
struct get_bool_simd_register<T, avx512ifma>
39+
{
40+
using type = simd_avx512_bool_register<T>;
41+
};
42+
43+
XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx512ifma, avx512dq);
44+
45+
}
46+
#endif
47+
}
48+
#endif
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/***************************************************************************
2+
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3+
* Martin Renou *
4+
* Copyright (c) QuantStack *
5+
* Copyright (c) Serge Guelton *
6+
* *
7+
* Distributed under the terms of the BSD 3-Clause License. *
8+
* *
9+
* The full license is in the file LICENSE, distributed with this software. *
10+
****************************************************************************/
11+
12+
#ifndef XSIMD_AVX512VBMI_REGISTER_HPP
13+
#define XSIMD_AVX512VBMI_REGISTER_HPP
14+
15+
#include "./xsimd_avx512ifma_register.hpp"
16+
17+
namespace xsimd
18+
{
19+
20+
/**
21+
* @ingroup architectures
22+
*
23+
* AVX512VBMI instructions
24+
*/
25+
struct avx512vbmi : avx512ifma
26+
{
27+
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VBMI; }
28+
static constexpr bool available() noexcept { return true; }
29+
static constexpr unsigned version() noexcept { return generic::version(3, 5, 0); }
30+
static constexpr char const* name() noexcept { return "avx512vbmi"; }
31+
};
32+
33+
#if XSIMD_WITH_AVX512VBMI
34+
35+
namespace types
36+
{
37+
template <class T>
38+
struct get_bool_simd_register<T, avx512vbmi>
39+
{
40+
using type = simd_avx512_bool_register<T>;
41+
};
42+
43+
XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx512vbmi, avx512ifma);
44+
45+
}
46+
#endif
47+
}
48+
#endif

0 commit comments

Comments
 (0)