Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions include/xsimd/arch/xsimd_fma3_avx2_128.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* Copyright (c) Serge Guelton *
* Copyright (c) Marco Barbone *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

#ifndef XSIMD_FMA3_AVX2_128_HPP
#define XSIMD_FMA3_AVX2_128_HPP

#include "../types/xsimd_fma3_avx2_128_register.hpp"

// Allow inclusion of xsimd_fma3_sse.hpp
#ifdef XSIMD_FMA3_SSE_HPP
#undef XSIMD_FMA3_SSE_HPP
#define XSIMD_FORCE_FMA3_SSE_HPP
#endif

// Disallow inclusion of ./xsimd_fma3_sse_register.hpp
#ifndef XSIMD_FMA3_SSE_REGISTER_HPP
#define XSIMD_FMA3_SSE_REGISTER_HPP
#define XSIMD_FORCE_FMA3_SSE_REGISTER_HPP
#endif

// Include ./xsimd_fma3_sse.hpp but s/sse4_2/avx2_128
#define sse4_2 avx2_128
#include "./xsimd_fma3_sse.hpp"
#undef sse4_2
#undef XSIMD_FMA3_SSE_HPP

// Carefully restore guards
#ifdef XSIMD_FORCE_FMA3_SSE_HPP
#define XSIMD_FMA3_SSE_HPP
#undef XSIMD_FORCE_FMA3_SSE_HPP
#endif

#ifdef XSIMD_FORCE_FMA3_SSE_REGISTER_HPP
#undef XSIMD_FMA3_SSE_REGISTER_HPP
#undef XSIMD_FORCE_FMA3_SSE_REGISTER_HPP
#endif

#endif
2 changes: 2 additions & 0 deletions include/xsimd/arch/xsimd_isa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Martin Renou *
* Copyright (c) QuantStack *
* Copyright (c) Serge Guelton *
* Copyright (c) Marco Barbone *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
Expand Down Expand Up @@ -72,6 +73,7 @@

#if XSIMD_WITH_FMA3_AVX2
#include "./xsimd_fma3_avx2.hpp"
#include "./xsimd_fma3_avx2_128.hpp"
#endif

#if XSIMD_WITH_AVX512F
Expand Down
2 changes: 2 additions & 0 deletions include/xsimd/types/xsimd_all_registers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Martin Renou *
* Copyright (c) QuantStack *
* Copyright (c) Serge Guelton *
* Copyright (c) Marco Barbone *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
Expand All @@ -24,6 +25,7 @@
#include "./xsimd_avx512vnni_avx512vbmi2_register.hpp"
#include "./xsimd_avx_register.hpp"
#include "./xsimd_avxvnni_register.hpp"
#include "./xsimd_fma3_avx2_128_register.hpp"
#include "./xsimd_fma3_avx2_register.hpp"
#include "./xsimd_fma3_avx_register.hpp"
#include "./xsimd_fma3_sse_register.hpp"
Expand Down
4 changes: 3 additions & 1 deletion include/xsimd/types/xsimd_avx512vl_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Martin Renou *
* Copyright (c) QuantStack *
* Copyright (c) Serge Guelton *
* Copyright (c) Marco Barbone *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
Expand All @@ -13,6 +14,7 @@
#define XSIMD_AVX512VL_REGISTER_HPP

#include "./xsimd_avx512cd_register.hpp"
#include "./xsimd_fma3_avx2_128_register.hpp"

namespace xsimd
{
Expand All @@ -34,7 +36,7 @@ namespace xsimd
*
* AVX512VL instructions extension for 128 bits registers
*/
struct avx512vl_128 : avx2_128
struct avx512vl_128 : fma3<avx2_128>
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VL; }
static constexpr bool available() noexcept { return true; }
Expand Down
1 change: 1 addition & 0 deletions include/xsimd/types/xsimd_avxvnni_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Martin Renou *
* Copyright (c) QuantStack *
* Copyright (c) Serge Guelton *
* Copyright (c) Marco Barbone *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
Expand Down
51 changes: 51 additions & 0 deletions include/xsimd/types/xsimd_fma3_avx2_128_register.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* Copyright (c) Serge Guelton *
* Copyright (c) Marco Barbone *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

#ifndef XSIMD_FMA3_AVX2_128_REGISTER_HPP
#define XSIMD_FMA3_AVX2_128_REGISTER_HPP

#include "./xsimd_avx2_register.hpp"

namespace xsimd
{
template <typename arch>
struct fma3;

/**
* @ingroup architectures
*
* AVX2 + FMA instructions, for 128 bits registers
*/
template <>
struct fma3<avx2_128> : avx2_128
{
static constexpr bool supported() noexcept { return XSIMD_WITH_FMA3_AVX2; }
static constexpr bool available() noexcept { return true; }
static constexpr char const* name() noexcept { return "fma3+avx2/128"; }
};

#if XSIMD_WITH_FMA3_AVX2

#if !XSIMD_WITH_AVX2
#error "architecture inconsistency: fma3+avx2/128 requires avx2"
#endif

namespace types
{

XSIMD_DECLARE_SIMD_REGISTER_ALIAS(fma3<avx2_128>, avx2_128);

}
#endif

}
#endif
Loading