-
Notifications
You must be signed in to change notification settings - Fork 301
Tentative support for avx512vl extensions to 256 bit registers #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /*************************************************************************** | ||
| * 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_AVX512VL_HPP | ||
| #define XSIMD_AVX512VL_HPP | ||
|
|
||
| #include "../types/xsimd_avx512vl_register.hpp" | ||
|
|
||
| // no 512-bit operation with avx512-vl, it only provides 128 et 256 bits ones. | ||
|
|
||
| #endif |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -895,6 +895,8 @@ namespace xsimd | |
|
|
||
| inline bool avx512vl() const noexcept { return avx512_enabled() && leaf7().all_bits_set<x86_cpuid_leaf7::ebx::avx512vl>(); } | ||
|
|
||
| inline bool avx512vl_256() const noexcept { return avx_enabled() && leaf7().all_bits_set<x86_cpuid_leaf7::ebx::avx512vl>(); } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should check OPMASK XSAVE.
|
||
|
|
||
| inline bool avx512vbmi() const noexcept { return avx512_enabled() && leaf7().all_bits_set<x86_cpuid_leaf7::ecx::avx512vbmi>(); } | ||
|
|
||
| inline bool avx512vbmi2() const noexcept { return avx512_enabled() && leaf7().all_bits_set<x86_cpuid_leaf7::ecx::avx512vbmi2>(); } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /*************************************************************************** | ||
| * 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_AVX512VL_REGISTER_HPP | ||
| #define XSIMD_AVX512VL_REGISTER_HPP | ||
|
|
||
| #include "./xsimd_avx512cd_register.hpp" | ||
|
|
||
| namespace xsimd | ||
| { | ||
|
|
||
| /** | ||
| * @ingroup architectures | ||
| * | ||
| * AVX512DQ instructions | ||
| */ | ||
| struct avx512vl : avx512cd | ||
| { | ||
| static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VL; } | ||
| static constexpr bool available() noexcept { return true; } | ||
| static constexpr char const* name() noexcept { return "avx512vl"; } | ||
| }; | ||
|
|
||
| /** | ||
| * @ingroup architectures | ||
| * | ||
| * AVX512VL instructions extension for 256 bits registers | ||
| */ | ||
| struct avx512vl_256 : fma3<avx2> | ||
| { | ||
| static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VL; } | ||
| static constexpr bool available() noexcept { return true; } | ||
| static constexpr char const* name() noexcept { return "avx512vl/256"; } | ||
| }; | ||
|
|
||
| #if XSIMD_WITH_AVX512VL | ||
|
|
||
| #if !XSIMD_WITH_AVX512CD | ||
| #error "architecture inconsistency: avx512vl requires avx512cd" | ||
| #endif | ||
|
|
||
| namespace types | ||
| { | ||
| template <class T> | ||
| struct get_bool_simd_register<T, avx512vl> | ||
| { | ||
| using type = simd_avx512_bool_register<T>; | ||
| }; | ||
|
|
||
| XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx512vl, avx512cd); | ||
|
|
||
| template <class T> | ||
| struct get_bool_simd_register<T, avx512vl_256> | ||
| { | ||
| using type = simd_avx512_bool_register<T>; | ||
| }; | ||
| XSIMD_DECLARE_SIMD_REGISTER_ALIAS(avx512vl_256, avx2); | ||
|
|
||
| } | ||
| #endif | ||
| } | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The matrix passes
-DXSIMD_DEFAULT_ARCH=avx512f_256but the build system only references that variable inside the emulated path (test/CMakeLists.txt:50). For a non-emulated build CMake emits: