Skip to content

Commit a948664

Browse files
Provide stub for avx512 er and pf architectures
1 parent 33aafd8 commit a948664

File tree

8 files changed

+178
-1
lines changed

8 files changed

+178
-1
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_AVX512ER_HPP
13+
#define XSIMD_AVX512ER_HPP
14+
15+
#include <array>
16+
#include <type_traits>
17+
18+
#include "../types/xsimd_avx512er_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_AVX512PF_HPP
13+
#define XSIMD_AVX512PF_HPP
14+
15+
#include <array>
16+
#include <type_traits>
17+
18+
#include "../types/xsimd_avx512pf_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
@@ -68,6 +68,14 @@
6868
#include "./xsimd_avx512bw.hpp"
6969
#endif
7070

71+
#if XSIMD_WITH_AVX512ER
72+
#include "./xsimd_avx512er.hpp"
73+
#endif
74+
75+
#if XSIMD_WITH_AVX512PF
76+
#include "./xsimd_avx512pf.hpp"
77+
#endif
78+
7179
#if XSIMD_WITH_NEON
7280
#include "./xsimd_neon.hpp"
7381
#endif

include/xsimd/config/xsimd_config.hpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,28 @@
244244
#define XSIMD_WITH_AVX512BW 0
245245
#endif
246246

247+
/**
248+
* @ingroup xsimd_config_macro
249+
*
250+
* Set to 1 if AVX512ER is available at compile-time, to 0 otherwise.
251+
*/
252+
#ifdef __AVX512ER__
253+
#define XSIMD_WITH_AVX512ER XSIMD_WITH_AVX512F
254+
#else
255+
#define XSIMD_WITH_AVX512ER 0
256+
#endif
257+
258+
/**
259+
* @ingroup xsimd_config_macro
260+
*
261+
* Set to 1 if AVX512PF is available at compile-time, to 0 otherwise.
262+
*/
263+
#ifdef __AVX512PF__
264+
#define XSIMD_WITH_AVX512PF XSIMD_WITH_AVX512F
265+
#else
266+
#define XSIMD_WITH_AVX512PF 0
267+
#endif
268+
247269
#ifdef __ARM_NEON
248270

249271
/**
@@ -367,7 +389,7 @@
367389

368390
#endif
369391

370-
#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_NEON && !XSIMD_WITH_NEON64 && !XSIMD_WITH_SVE && !XSIMD_WITH_RVV && !XSIMD_WITH_WASM
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
371393
#endif
372394

373395
#endif

include/xsimd/config/xsimd_cpuid.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ namespace xsimd
5050
unsigned avx512cd : 1;
5151
unsigned avx512dq : 1;
5252
unsigned avx512bw : 1;
53+
unsigned avx512er : 1;
54+
unsigned avx512pf : 1;
5355
unsigned neon : 1;
5456
unsigned neon64 : 1;
5557
unsigned sve : 1;
@@ -191,6 +193,12 @@ namespace xsimd
191193
avx512bw = regs7[1] >> 30 & 1;
192194
best = std::max(best, avx512bw::version() * avx512bw * avx512dq * avx512cd * avx512f);
193195

196+
avx512er = regs7[1] >> 27 & 1;
197+
best = std::max(best, avx512er::version() * avx512er * avx512cd * avx512f);
198+
199+
avx512pf = regs7[1] >> 26 & 1;
200+
best = std::max(best, avx512pf::version() * avx512pf * avx512er * avx512cd * avx512f);
201+
194202
#endif
195203
}
196204
};

include/xsimd/types/xsimd_all_registers.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "xsimd_fma3_avx2_register.hpp"
2222
#include "xsimd_fma3_avx_register.hpp"
2323

24+
#include "xsimd_avx512pf_register.hpp"
25+
#include "xsimd_avx512er_register.hpp"
26+
2427
#include "xsimd_avx512bw_register.hpp"
2528
#include "xsimd_avx512cd_register.hpp"
2629
#include "xsimd_avx512dq_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_AVX512ER_REGISTER_HPP
13+
#define XSIMD_AVX512ER_REGISTER_HPP
14+
15+
#include "./xsimd_avx512dq_register.hpp"
16+
17+
namespace xsimd
18+
{
19+
20+
/**
21+
* @ingroup architectures
22+
*
23+
* AVX512ER instructions
24+
*/
25+
struct avx512er : avx512cd
26+
{
27+
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512ER; }
28+
static constexpr bool available() noexcept { return true; }
29+
static constexpr unsigned version() noexcept { return generic::version(3, 3, 1); }
30+
static constexpr char const* name() noexcept { return "avx512er"; }
31+
};
32+
33+
#if XSIMD_WITH_AVX512ER
34+
35+
namespace types
36+
{
37+
template <class T>
38+
struct get_bool_simd_register<T, avx512er>
39+
{
40+
using type = simd_avx512_bool_register<T>;
41+
};
42+
43+
XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx512er, avx512cd);
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_AVX512PF_REGISTER_HPP
13+
#define XSIMD_AVX512PF_REGISTER_HPP
14+
15+
#include "./xsimd_avx512er_register.hpp"
16+
17+
namespace xsimd
18+
{
19+
20+
/**
21+
* @ingroup architectures
22+
*
23+
* AVX512BW instructions
24+
*/
25+
struct avx512pf : avx512er
26+
{
27+
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512PF; }
28+
static constexpr bool available() noexcept { return true; }
29+
static constexpr unsigned version() noexcept { return generic::version(3, 4, 1); }
30+
static constexpr char const* name() noexcept { return "avx512pf"; }
31+
};
32+
33+
#if XSIMD_WITH_AVX512PF
34+
35+
namespace types
36+
{
37+
template <class T>
38+
struct get_bool_simd_register<T, avx512pf>
39+
{
40+
using type = simd_avx512_bool_register<T>;
41+
};
42+
43+
XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx512pf, avx512er);
44+
45+
}
46+
#endif
47+
}
48+
#endif

0 commit comments

Comments
 (0)