From cc00260202bb1af39c54968cee1f1a76f5ad1e70 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 7 Jul 2015 16:15:40 +0200 Subject: [PATCH 01/58] Add default tree structure for hardware simd support --- include/boost/predef/hardware.h | 14 ++++++++++ include/boost/predef/hardware/simd.h | 16 +++++++++++ include/boost/predef/hardware/simd/arm.h | 14 ++++++++++ include/boost/predef/hardware/simd/arm/neon.h | 12 +++++++++ include/boost/predef/hardware/simd/ppc.h | 17 ++++++++++++ include/boost/predef/hardware/simd/ppc/qpx.h | 12 +++++++++ include/boost/predef/hardware/simd/ppc/vmx.h | 12 +++++++++ include/boost/predef/hardware/simd/ppc/vsx.h | 12 +++++++++ include/boost/predef/hardware/simd/x86.h | 27 +++++++++++++++++++ include/boost/predef/hardware/simd/x86/avx.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/avx2.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/fma3.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/fma4.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/mic.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/sse.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/sse2.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/sse3.h | 12 +++++++++ .../boost/predef/hardware/simd/x86/sse4_1.h | 12 +++++++++ .../boost/predef/hardware/simd/x86/sse4_2.h | 12 +++++++++ .../boost/predef/hardware/simd/x86/sse4a.h | 12 +++++++++ .../boost/predef/hardware/simd/x86/ssse3.h | 12 +++++++++ include/boost/predef/hardware/simd/x86/xop.h | 12 +++++++++ 22 files changed, 292 insertions(+) create mode 100644 include/boost/predef/hardware.h create mode 100644 include/boost/predef/hardware/simd.h create mode 100644 include/boost/predef/hardware/simd/arm.h create mode 100644 include/boost/predef/hardware/simd/arm/neon.h create mode 100644 include/boost/predef/hardware/simd/ppc.h create mode 100644 include/boost/predef/hardware/simd/ppc/qpx.h create mode 100644 include/boost/predef/hardware/simd/ppc/vmx.h create mode 100644 include/boost/predef/hardware/simd/ppc/vsx.h create mode 100644 include/boost/predef/hardware/simd/x86.h create mode 100644 include/boost/predef/hardware/simd/x86/avx.h create mode 100644 include/boost/predef/hardware/simd/x86/avx2.h create mode 100644 include/boost/predef/hardware/simd/x86/fma3.h create mode 100644 include/boost/predef/hardware/simd/x86/fma4.h create mode 100644 include/boost/predef/hardware/simd/x86/mic.h create mode 100644 include/boost/predef/hardware/simd/x86/sse.h create mode 100644 include/boost/predef/hardware/simd/x86/sse2.h create mode 100644 include/boost/predef/hardware/simd/x86/sse3.h create mode 100644 include/boost/predef/hardware/simd/x86/sse4_1.h create mode 100644 include/boost/predef/hardware/simd/x86/sse4_2.h create mode 100644 include/boost/predef/hardware/simd/x86/sse4a.h create mode 100644 include/boost/predef/hardware/simd/x86/ssse3.h create mode 100644 include/boost/predef/hardware/simd/x86/xop.h diff --git a/include/boost/predef/hardware.h b/include/boost/predef/hardware.h new file mode 100644 index 0000000..a0cea74 --- /dev/null +++ b/include/boost/predef/hardware.h @@ -0,0 +1,14 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_H +#define BOOST_PREDEF_HARDWARE_H + +#include + +#endif diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h new file mode 100644 index 0000000..947c15c --- /dev/null +++ b/include/boost/predef/hardware/simd.h @@ -0,0 +1,16 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_H +#define BOOST_PREDEF_HARDWARE_SIMD_H + +#include +#include +#include + +#endif diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h new file mode 100644 index 0000000..9458600 --- /dev/null +++ b/include/boost/predef/hardware/simd/arm.h @@ -0,0 +1,14 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_H +#define BOOST_PREDEF_HARDWARE_SIMD_ARM_H + +#include + +#endif diff --git a/include/boost/predef/hardware/simd/arm/neon.h b/include/boost/predef/hardware/simd/arm/neon.h new file mode 100644 index 0000000..9c57f57 --- /dev/null +++ b/include/boost/predef/hardware/simd/arm/neon.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_NEON_H +#define BOOST_PREDEF_HARDWARE_SIMD_ARM_NEON_H + +#endif diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h new file mode 100644 index 0000000..c6cd782 --- /dev/null +++ b/include/boost/predef/hardware/simd/ppc.h @@ -0,0 +1,17 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_H +#define BOOST_PREDEF_HARDWARE_SIMD_PPC_H + +// from the newest to the oldest +#include +#include +#include + +#endif diff --git a/include/boost/predef/hardware/simd/ppc/qpx.h b/include/boost/predef/hardware/simd/ppc/qpx.h new file mode 100644 index 0000000..9c6d5df --- /dev/null +++ b/include/boost/predef/hardware/simd/ppc/qpx.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_QPX_H +#define BOOST_PREDEF_HARDWARE_SIMD_PPC_QPX_H + +#endif diff --git a/include/boost/predef/hardware/simd/ppc/vmx.h b/include/boost/predef/hardware/simd/ppc/vmx.h new file mode 100644 index 0000000..bfd4ba3 --- /dev/null +++ b/include/boost/predef/hardware/simd/ppc/vmx.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VMX_H +#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VMX_H + +#endif diff --git a/include/boost/predef/hardware/simd/ppc/vsx.h b/include/boost/predef/hardware/simd/ppc/vsx.h new file mode 100644 index 0000000..3da16a2 --- /dev/null +++ b/include/boost/predef/hardware/simd/ppc/vsx.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VSX_H +#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VSX_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h new file mode 100644 index 0000000..86bcd36 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86.h @@ -0,0 +1,27 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_H + +// from the newest to the oldest +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/predef/hardware/simd/x86/avx.h b/include/boost/predef/hardware/simd/x86/avx.h new file mode 100644 index 0000000..c49383c --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/avx.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AVX_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_AVX_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h new file mode 100644 index 0000000..6171459 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/avx2.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AVX2_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_AVX2_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h new file mode 100644 index 0000000..3e90eba --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA3_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA3_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h new file mode 100644 index 0000000..d44798e --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h new file mode 100644 index 0000000..dbf2f4d --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/mic.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_MIC_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_MIC_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h new file mode 100644 index 0000000..6db6a1f --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/sse.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h new file mode 100644 index 0000000..7eaa3dd --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/sse2.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE2_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE2_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h new file mode 100644 index 0000000..3ffbdb7 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/sse3.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE3_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE3_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h new file mode 100644 index 0000000..efd4489 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/sse4_1.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_1_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_1_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h new file mode 100644 index 0000000..add11f8 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/sse4_2.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_2_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_2_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h new file mode 100644 index 0000000..13c3710 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4A_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4A_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h new file mode 100644 index 0000000..59afa14 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/ssse3.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSSE3_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSSE3_H + +#endif diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h new file mode 100644 index 0000000..b6456bf --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/xop.h @@ -0,0 +1,12 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_XOP_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_XOP_H + +#endif From 0b0e4d78bf0f43377d87de2342daa16309d3d273 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 10:13:49 +0200 Subject: [PATCH 02/58] x86: Add MMX predef --- include/boost/predef/hardware/simd/x86.h | 1 + include/boost/predef/hardware/simd/x86/mmx.h | 45 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 include/boost/predef/hardware/simd/x86/mmx.h diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 86bcd36..7d32174 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -23,5 +23,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #endif diff --git a/include/boost/predef/hardware/simd/x86/mmx.h b/include/boost/predef/hardware/simd/x86/mmx.h new file mode 100644 index 0000000..f0476bb --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/mmx.h @@ -0,0 +1,45 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_MMX_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_MMX_H + +#include + +/*` + [heading `BOOST_HW_SIMD_X86_MMX`] + + [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension. + Version number is: 0.99.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__MMX__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_MMX BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MMX__) +# undef BOOST_HW_SIMD_X86_MMX +# define BOOST_HW_SIMD_X86_MMX BOOST_VERSION_NUMBER(0, 99, 0) +# define BOOST_HW_SIMD_X86_MMX_AVAILABLE +#endif + +#define BOOST_HW_SIMD_X86_MMX_NAME "MMX" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_MMX_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MMX +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_MMX_NAME +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_MMX, BOOST_HW_SIMD_X86_MMX_NAME) From cc9c5cdcf564f3a0aea25a1aff713dc4646e0fb2 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 14:13:28 +0200 Subject: [PATCH 03/58] x86: Add SSE(1) predef --- include/boost/predef/hardware/simd/x86/sse.h | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h index 6db6a1f..bb4f103 100644 --- a/include/boost/predef/hardware/simd/x86/sse.h +++ b/include/boost/predef/hardware/simd/x86/sse.h @@ -9,4 +9,43 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSE`] + + [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension. + Version number is: 1.0.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE__`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + [[`_M_IX86_FP >= 1`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1 +# undef BOOST_HW_SIMD_X86_SSE +# define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER(1, 0, 0) +# define BOOST_HW_SIMD_X86_SSE_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSE_NAME "SSE(1)" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_SSE_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE, BOOST_HW_SIMD_X86_SSE_NAME) From 67250ecae28d427950e81cb5a0282336bcfc99a8 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 14:32:32 +0200 Subject: [PATCH 04/58] x86: Add SSE2 predef --- include/boost/predef/hardware/simd/x86/sse2.h | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h index 7eaa3dd..915d4ae 100644 --- a/include/boost/predef/hardware/simd/x86/sse2.h +++ b/include/boost/predef/hardware/simd/x86/sse2.h @@ -9,4 +9,43 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE2_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE2_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSE2`] + + [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension. + Version number is: 2.0.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE2__`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + [[`_M_IX86_FP >= 2`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2 +# undef BOOST_HW_SIMD_X86_SSE2 +# define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER(2, 0, 0) +# define BOOST_HW_SIMD_X86_SSE2_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSE2_NAME "SSE2" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE2_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2 +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE2_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_SSE2_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE2, BOOST_HW_SIMD_X86_SSE2_NAME) From bce7e9ba5625aa89d01af820b0b4d14191360e2f Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 14:40:50 +0200 Subject: [PATCH 05/58] x86: Add SSE3 predef --- include/boost/predef/hardware/simd/x86/sse3.h | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h index 3ffbdb7..30c22c7 100644 --- a/include/boost/predef/hardware/simd/x86/sse3.h +++ b/include/boost/predef/hardware/simd/x86/sse3.h @@ -9,4 +9,41 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE3_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE3_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSE3`] + + [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension. + Version number is: 3.0.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE3__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSE3__) +# undef BOOST_HW_SIMD_X86_SSE3 +# define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER(3, 0, 0) +# define BOOST_HW_SIMD_X86_SSE3_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSE3_NAME "SSE3" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3 +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE3_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE3, BOOST_HW_SIMD_X86_SSE3_NAME) From 4f6352e14013c5818e29e3dea27c039b6205a86f Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 14:43:13 +0200 Subject: [PATCH 06/58] x86: Add SSSE3 predef --- .../boost/predef/hardware/simd/x86/ssse3.h | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h index 59afa14..ab2aa78 100644 --- a/include/boost/predef/hardware/simd/x86/ssse3.h +++ b/include/boost/predef/hardware/simd/x86/ssse3.h @@ -9,4 +9,41 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSSE3_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSSE3_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSSE3`] + + [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension. + Version number is: 3.1.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSSE3__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSSE3__) +# undef BOOST_HW_SIMD_X86_SSSE3 +# define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER(3, 1, 0) +# define BOOST_HW_SIMD_X86_SSSE3_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSSE3_NAME "SSSE3" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSSE3_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSSE3 +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSSE3_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_SSSE3_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSSE3, BOOST_HW_SIMD_X86_SSSE3_NAME) From a01ebb6605926046faf1e152b349a5634f77474d Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 16:52:45 +0200 Subject: [PATCH 07/58] x86: Add SSE4.1 predef --- .../boost/predef/hardware/simd/x86/sse4_1.h | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h index efd4489..2f4b0a8 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_1.h +++ b/include/boost/predef/hardware/simd/x86/sse4_1.h @@ -9,4 +9,41 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_1_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_1_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSE4_1`] + + [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension. + Version number is: 4.1.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4_1__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSE4_1__) +# undef BOOST_HW_SIMD_X86_SSE4_1 +# define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER(4, 1, 0) +# define BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSE4_1_NAME "SSE4.1" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_1 +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE4_1_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE4_1, BOOST_HW_SIMD_X86_SSE4_1_NAME) From e29bfedc3e0ec635772952d77d0b48faad0d1f98 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 16:53:17 +0200 Subject: [PATCH 08/58] x86: Add SSE4.2 predef --- .../boost/predef/hardware/simd/x86/sse4_2.h | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h index add11f8..281d2bd 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_2.h +++ b/include/boost/predef/hardware/simd/x86/sse4_2.h @@ -9,4 +9,41 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_2_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_2_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSE4_2`] + + [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension. + Version number is: 4.1.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4_2__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSE4_2__) +# undef BOOST_HW_SIMD_X86_SSE4_2 +# define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER(4, 2, 0) +# define BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSE4_2_NAME "SSE4.2" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2 +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE4_2_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE4_2, BOOST_HW_SIMD_X86_SSE4_2_NAME) From b8d6e7b645f673970cdf5339a5ece5e9b2bf4b6a Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 16:53:59 +0200 Subject: [PATCH 09/58] x86: Add AVX predef --- include/boost/predef/hardware/simd/x86/avx.h | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/avx.h b/include/boost/predef/hardware/simd/x86/avx.h index c49383c..1a0bf50 100644 --- a/include/boost/predef/hardware/simd/x86/avx.h +++ b/include/boost/predef/hardware/simd/x86/avx.h @@ -9,4 +9,45 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AVX_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_AVX_H +#include +#include + +/*` + [heading `BOOST_HW_SIMD_X86_AVX`] + + [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86 extension. + Version number is: 5.0.0. Not available for version of MSVC below 16.00.40219. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__AVX__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_AVX BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__AVX__) +# undef BOOST_HW_SIMD_X86_AVX +# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(16, 0, 40219)\ + || !defined(BOOST_COMP_MSVC_AVAILABLE) +# define BOOST_HW_SIMD_X86_AVX BOOST_VERSION_NUMBER(5, 0, 0) +# define BOOST_HW_SIMD_X86_AVX_AVAILABLE +# endif #endif + +#define BOOST_HW_SIMD_X86_AVX_NAME "AVX" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_AVX_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_AVX_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_AVX_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AVX, BOOST_HW_SIMD_X86_AVX_NAME) From f6d6fd1d08885381f020f0e4a9d2e312cc5078ed Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 16:54:35 +0200 Subject: [PATCH 10/58] x86: Add AVX2 predef --- include/boost/predef/hardware/simd/x86/avx2.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h index 6171459..a370dcb 100644 --- a/include/boost/predef/hardware/simd/x86/avx2.h +++ b/include/boost/predef/hardware/simd/x86/avx2.h @@ -9,4 +9,45 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AVX2_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_AVX2_H +#include +#include + +/*` + [heading `BOOST_HW_SIMD_X86_AVX2`] + + [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] x86 extension. + Version number is: 5.2.0. Not available for version of MSVC below 17.00. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__AVX2__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__AVX2__) +# undef BOOST_HW_SIMD_X86_AVX2 +# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0)\ + || !defined(BOOST_COMP_MSVC_AVAILABLE) +# define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER(5, 2, 0) +# define BOOST_HW_SIMD_X86_AVX2_AVAILABLE +# endif #endif + +#define BOOST_HW_SIMD_X86_AVX2_NAME "AVX2" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_AVX2_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2 +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_AVX2_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_AVX2_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AVX2, BOOST_HW_SIMD_X86_AVX2_NAME) From 3275f7ba3093d0c1f4831f1824830b0f83a94341 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 16:58:06 +0200 Subject: [PATCH 11/58] x86: Add MIC (Xeon Phi) predef --- include/boost/predef/hardware/simd/x86/mic.h | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h index dbf2f4d..7ec6f1d 100644 --- a/include/boost/predef/hardware/simd/x86/mic.h +++ b/include/boost/predef/hardware/simd/x86/mic.h @@ -9,4 +9,41 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_MIC_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_MIC_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_MIC`] + + [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension. + Version number is: 4.1.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__MIC__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MIC__) +# undef BOOST_HW_SIMD_X86_MIC +# define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER(6, 0, 0) +# define BOOST_HW_SIMD_X86_MIC_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_MIC_NAME "MIC (Xeon Phi)" + +#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_MIC_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MIC +# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_MIC_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_MIC_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_MIC, BOOST_HW_SIMD_X86_MIC_NAME) From da88635350fd51a5b85a6036f2af170f5d766868 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 17:27:03 +0200 Subject: [PATCH 12/58] x86: Add SSE4a predef --- .../boost/predef/hardware/simd/x86/sse4a.h | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h index 13c3710..348d229 100644 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -9,4 +9,42 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4A_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4A_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_SSE4A`] + + [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension. + Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. + + This extension is only available on particular CPUs. It does imply + SSE3, but it is not implied by extensions newer than SSE3. For example, + SSE4.1 does not imply it. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4A__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SSE4A__) +# undef BOOST_HW_SIMD_X86_SSE4A +/* We do not give a valid version for this one, since it not always + * available if newer extension than SSE3 are enabled. */ +# define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_SSE4A_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_SSE4A_NAME "SSE4a" + +#if defined(BOOST_HW_SIMD_X86_SSE4A_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE4A, BOOST_HW_SIMD_X86_SSE4A_NAME) From 87a602008c5a29d0a4d629de18ed533f565a6741 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 17:27:23 +0200 Subject: [PATCH 13/58] x86: Add FMA3 predef --- include/boost/predef/hardware/simd/x86/fma3.h | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h index 3e90eba..71170b9 100644 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -9,4 +9,46 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA3_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA3_H +#include +#include + +/*` + [heading `BOOST_HW_SIMD_X86_FMA3`] + + [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension. + Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. + + This extension is only available on particular CPUs. It does imply + AVX, but it is not implied by extensions newer than SSE3. For example, + AVX2 does not imply it. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__FMA__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__FMA__) +# undef BOOST_HW_SIMD_X86_FMA3 +/* We do not give a valid version for this one, since it not always + * available if newer extension than AVX are enabled. */ +# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC < BOOST_VERSION_NUMBER(17, 0, 0)\ + || !defined(BOOST_COMP_MSVC_AVAILABLE) +# define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_FMA3_AVAILABLE +# endif #endif + +#define BOOST_HW_SIMD_X86_FMA3_NAME "FMA3" + +#if defined(BOOST_HW_SIMD_X86_FMA3_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_FMA3, BOOST_HW_SIMD_X86_FMA3_NAME) From e39e6ec7f8bd72f60590c686eb4f15c8915ae31a Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 17:27:37 +0200 Subject: [PATCH 14/58] x86: Add FMA4 predef --- include/boost/predef/hardware/simd/x86/fma4.h | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index d44798e..79c9721 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -9,4 +9,42 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_FMA4`] + + [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA4] x86 extension. + Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. + + This extension is only available on particular CPUs. It does imply + AVX and SSE4a, but it is not implied by extensions newer than SSE3. + For example, AVX2 does not imply it. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__FMA4__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__FMA4__) +# undef BOOST_HW_SIMD_X86_FMA4 +/* We do not give a valid version for this one, since it not always + * available if newer extension than AVX are enabled. */ +# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_FMA4_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_FMA4_NAME "FMA4" + +#if defined(BOOST_HW_SIMD_X86_FMA4_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_FMA4, BOOST_HW_SIMD_X86_FMA4_NAME) From 93b58e679978666bc331666284edda0d5c993888 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 17:27:55 +0200 Subject: [PATCH 15/58] x86: Add XOP predef --- include/boost/predef/hardware/simd/x86/xop.h | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h index b6456bf..bab193a 100644 --- a/include/boost/predef/hardware/simd/x86/xop.h +++ b/include/boost/predef/hardware/simd/x86/xop.h @@ -9,4 +9,37 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_XOP_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_XOP_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_XOP`] + + [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension. + Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. + + This extension is only available on particular CPUs. It does imply + FMA4, please see its documentation to see what else is implied. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__XOP__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__XOP__) +# undef BOOST_HW_SIMD_X86_XOP +/* We do not give a valid version for this one, since it not always + * available if newer extension than AVX (FMA4 implies AVX) are enabled. */ +# define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_XOP_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_XOP_NAME "XOP" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_XOP, BOOST_HW_SIMD_X86_XOP_NAME) From 132509ee5dac9e2105a4ae00b502135856f11fab Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 16:10:36 +0200 Subject: [PATCH 16/58] Add doc + _AVAILABLE for simd/x86.h --- include/boost/predef/hardware/simd/x86.h | 33 ++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 7d32174..e9b5761 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -9,20 +9,43 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_H -// from the newest to the oldest +/*` + [heading `BOOST_HW_SIMD_X86`] + + The SIMD extension for x86 (if detected). + Version number depends on the detected extension. + + BOOST_HW_SIMD_X86 is defined by the first detected extension. They are + checked from the newest to the oldest. (AVX2 -> AVX -> ... -> SSE2 -> SSE) + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`BOOST_HW_SIMD_X86`] [__predef_detection__]] + [[`BOOST_HW_SIMD_X86`] [V.R.P]] + ] + */ + +// From the newest to the oldest #include #include -#include -#include -#include #include #include #include #include -#include #include #include #include #include +// Those ones are more like options than real extensions +#include +#include +#include +#include + +#if defined(BOOST_HW_SIMD_X86) +# define BOOST_HW_SIMD_X86_AVAILABLE +#endif + #endif From 29a0d1155303410a6dd8c3d8a9d7afe7434ae0c8 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 10:01:56 +0200 Subject: [PATCH 17/58] PPC: Add VMX predef --- include/boost/predef/hardware/simd/ppc/vmx.h | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/boost/predef/hardware/simd/ppc/vmx.h b/include/boost/predef/hardware/simd/ppc/vmx.h index bfd4ba3..dd936ac 100644 --- a/include/boost/predef/hardware/simd/ppc/vmx.h +++ b/include/boost/predef/hardware/simd/ppc/vmx.h @@ -9,4 +9,38 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VMX_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_VMX_H +#include + +/*` + [heading `BOOST_HW_SIMD_PPC_VMX`] + + [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension. + Version number is: 1.0.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__ALTIVEC__`] [__predef_detection__]] + [[`__VEC__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__ALTIVEC__) || defined(__VEC__) +# undef BOOST_HW_SIMD_PPC_VMX +# define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER(1, 0, 0) +# define BOOST_HW_SIMD_PPC_VMX_AVAILABLE #endif + +#define BOOST_HW_SIMD_PPC_VMX_NAME "VMX" + +#if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_VMX_AVAILABLE) +# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VMX +# define BOOST_HW_SIMD_PPC_NAME BOOST_HW_SIMD_PPC_VMX_NAME +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC_VMX, BOOST_HW_SIMD_PPC_VMX_NAME) From 4b45a0faf14fbb432a411248e9e8579eb1d83c98 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 10:02:20 +0200 Subject: [PATCH 18/58] PPC: Add VSX predef --- include/boost/predef/hardware/simd/ppc/vsx.h | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/boost/predef/hardware/simd/ppc/vsx.h b/include/boost/predef/hardware/simd/ppc/vsx.h index 3da16a2..d96ad40 100644 --- a/include/boost/predef/hardware/simd/ppc/vsx.h +++ b/include/boost/predef/hardware/simd/ppc/vsx.h @@ -9,4 +9,37 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VSX_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_VSX_H +#include + +/*` + [heading `BOOST_HW_SIMD_PPC_VSX`] + + [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension. + Version number is: 1.1.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__VSX__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__VSX__) +# undef BOOST_HW_SIMD_PPC_VSX +# define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER(1, 1, 0) +# define BOOST_HW_SIMD_PPC_VSX_AVAILABLE #endif + +#define BOOST_HW_SIMD_PPC_VSX_NAME "VSX" + +#if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_VSX_AVAILABLE) +# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VSX +# define BOOST_HW_SIMD_PPC_NAME BOOST_HW_SIMD_PPC_VSX_NAME +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC_VSX, BOOST_HW_SIMD_PPC_VSX_NAME) From 1cc8ecc57990bf83ec446a635ec81338af42b953 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 10:02:47 +0200 Subject: [PATCH 19/58] PPC: Add QPX predef --- include/boost/predef/hardware/simd/ppc/qpx.h | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/boost/predef/hardware/simd/ppc/qpx.h b/include/boost/predef/hardware/simd/ppc/qpx.h index 9c6d5df..908100f 100644 --- a/include/boost/predef/hardware/simd/ppc/qpx.h +++ b/include/boost/predef/hardware/simd/ppc/qpx.h @@ -9,4 +9,37 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_QPX_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_QPX_H +#include + +/*` + [heading `BOOST_HW_SIMD_PPC_QPX`] + + QPX powerpc extension. + Version number is: 2.0.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__VECTOR4DOUBLE__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__VECTOR4DOUBLE__) +# undef BOOST_HW_SIMD_PPC_QPX +# define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER(2, 0, 0) +# define BOOST_HW_SIMD_PPC_QPX_AVAILABLE #endif + +#define BOOST_HW_SIMD_PPC_QPX_NAME "QPX" + +#if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_QPX_AVAILABLE) +# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_QPX +# define BOOST_HW_SIMD_PPC_NAME BOOST_HW_SIMD_PPC_QPX_NAME +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC_QPX, BOOST_HW_SIMD_PPC_QPX_NAME) From 9b66cddaf69b716353b48a779b536a07f2e570e1 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 16:12:02 +0200 Subject: [PATCH 20/58] Add doc + _AVAILABLE for simd/ppc.h --- include/boost/predef/hardware/simd/ppc.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index c6cd782..eb4f045 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -9,9 +9,30 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_H -// from the newest to the oldest +/*` + [heading `BOOST_HW_SIMD_PPC`] + + The SIMD extension for x86 (if detected). + Version number depends on the detected extension. + + BOOST_HW_SIMD_PPC is defined by the first detected extension. They are + checked from the newest to the oldest. (QPX -> VSX -> VMX) + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`BOOST_HW_SIMD_PPC`] [__predef_detection__]] + [[`BOOST_HW_SIMD_PPC`] [V.R.P]] + ] + */ + +// From the newest to the oldest #include #include #include +#if defined(BOOST_HW_SIMD_PPC) +# define BOOST_HW_SIMD_PPC_AVAILABLE +#endif + #endif From 5ce2ff09f8c0e6cd2550ce808c485123e486476f Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 10:11:57 +0200 Subject: [PATCH 21/58] ARM: Add NEON predef --- include/boost/predef/hardware/simd/arm/neon.h | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/boost/predef/hardware/simd/arm/neon.h b/include/boost/predef/hardware/simd/arm/neon.h index 9c57f57..df454d9 100644 --- a/include/boost/predef/hardware/simd/arm/neon.h +++ b/include/boost/predef/hardware/simd/arm/neon.h @@ -9,4 +9,39 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_NEON_H #define BOOST_PREDEF_HARDWARE_SIMD_ARM_NEON_H +#include + +/*` + [heading `BOOST_HW_SIMD_ARM_NEON`] + + [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON] ARM extension. + Version number is: 1.0.0. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__ARM_NEON__`] [__predef_detection__]] + [[`__aarch64__`] [__predef_detection__]] + [[`_M_ARM`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) +# undef BOOST_HW_SIMD_ARM_NEON +# define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER(1, 0, 0) +# define BOOST_HW_SIMD_ARM_NEON_AVAILABLE #endif + +#define BOOST_HW_SIMD_ARM_NEON_NAME "NEON" + +#if !defined(BOOST_HW_SIMD_ARM) && defined(BOOST_HW_SIMD_ARM_NEON_AVAILABLE) +# define BOOST_HW_SIMD_ARM BOOST_HW_SIMD_ARM_NEON +# define BOOST_HW_SIMD_ARM_NAME BOOST_HW_SIMD_ARM_NEON_NAME +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_ARM_NEON, BOOST_HW_SIMD_ARM_NEON_NAME) From f0a0af764c0fca31800b5b4ae8cd5a524c504b61 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 16:11:43 +0200 Subject: [PATCH 22/58] Add doc + _AVAILABLE for simd/arm.h --- include/boost/predef/hardware/simd/arm.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index 9458600..5b0d3bc 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -9,6 +9,26 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_H #define BOOST_PREDEF_HARDWARE_SIMD_ARM_H +/*` + [heading `BOOST_HW_SIMD_ARM`] + + The SIMD extension for ARM (if detected). + Version number depends on the detected extension. + + BOOST_HW_SIMD_ARM is defined by the first detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`BOOST_HW_SIMD_ARM`] [__predef_detection__]] + [[`BOOST_HW_SIMD_ARM`] [V.R.P]] + ] + */ + #include +#if defined(BOOST_HW_SIMD_ARM) +# define BOOST_HW_SIMD_ARM_AVAILABLE +#endif + #endif From 298f2fe6633905ca21079e5ee52ecfd0ba19b4ff Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 9 Jul 2015 16:13:10 +0200 Subject: [PATCH 23/58] Add doc + _AVAILABLE for simd.h --- include/boost/predef/hardware/simd.h | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index 947c15c..e09db1a 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -9,8 +9,51 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_H #define BOOST_PREDEF_HARDWARE_SIMD_H +/*` + [heading `BOOST_HW_SIMD`] + + The SIMD extension detected for a specific architectures. + Version number depends on the detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`BOOST_HW_SIMD_ARM_AVAILABLE`] [__predef_detection__]] + [[`BOOST_HW_SIMD_PPC_AVAILABLE`] [__predef_detection__]] + [[`BOOST_HW_SIMD_X86_AVAILABLE`] [__predef_detection__]] + ] + */ + #include #include #include +// We check if SIMD extension of multiples architectures have been detected, +// if yes, then this is an error! +#if \ + BOOST_HW_SIMD_ARM && BOOST_HW_SIMD_PPC ||\ + BOOST_HW_SIMD_ARM && BOOST_HW_SIMD_X86 ||\ + BOOST_HW_SIMD_PPC && BOOST_HW_SIMD_X86 +# error "Multiple SIMD architectures detected, this cannot happen!" +#endif + +#if defined(BOOST_HW_SIMD_X86_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +# define BOOST_HW_SIMD_NAME BOOST_HW_SIMD_X86_NAME +#endif + +#if defined(BOOST_HW_SIMD_ARM_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_ARM +# define BOOST_HW_SIMD_NAME BOOST_HW_SIMD_ARM_NAME +#endif + +#if defined(BOOST_HW_SIMD_PPC_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_PPC +# define BOOST_HW_SIMD_NAME BOOST_HW_SIMD_PPC_NAME +#endif + +#if defined(BOOST_HW_SIMD) +# define BOOST_HW_SIMD_AVAILABLE +#endif + #endif From 5ba0a2c5ab673bc9a2be421f090eba3df33bcb6f Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 10 Jul 2015 16:55:50 +0200 Subject: [PATCH 24/58] Add default version + name for {simd,arm,ppc,x86}.h tags --- include/boost/predef/hardware/simd.h | 5 +++++ include/boost/predef/hardware/simd/arm.h | 5 +++++ include/boost/predef/hardware/simd/ppc.h | 5 +++++ include/boost/predef/hardware/simd/x86.h | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index e09db1a..ba9c57a 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -9,6 +9,8 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_H #define BOOST_PREDEF_HARDWARE_SIMD_H +#include + /*` [heading `BOOST_HW_SIMD`] @@ -54,6 +56,9 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(BOOST_HW_SIMD) # define BOOST_HW_SIMD_AVAILABLE +#else +# define BOOST_HW_SIMD BOOST_VERSION_NUMBER_NOT_AVAILABLE +# define BOOST_HW_SIMD_NAME "(not found)" #endif #endif diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index 5b0d3bc..e0e82a3 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -9,6 +9,8 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_H #define BOOST_PREDEF_HARDWARE_SIMD_ARM_H +#include + /*` [heading `BOOST_HW_SIMD_ARM`] @@ -29,6 +31,9 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(BOOST_HW_SIMD_ARM) # define BOOST_HW_SIMD_ARM_AVAILABLE +#else +# define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE +# define BOOST_HW_SIMD_ARM_NAME "(not found)" #endif #endif diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index eb4f045..91bceb4 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -9,6 +9,8 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_H +#include + /*` [heading `BOOST_HW_SIMD_PPC`] @@ -33,6 +35,9 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(BOOST_HW_SIMD_PPC) # define BOOST_HW_SIMD_PPC_AVAILABLE +#else +# define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE +# define BOOST_HW_SIMD_PPC_NAME "(not found)" #endif #endif diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index e9b5761..5cb351c 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -9,6 +9,8 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_H +#include + /*` [heading `BOOST_HW_SIMD_X86`] @@ -46,6 +48,9 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(BOOST_HW_SIMD_X86) # define BOOST_HW_SIMD_X86_AVAILABLE +#else +# define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE +# define BOOST_HW_SIMD_X86_NAME "(not found)" #endif #endif From 3626c9b9052945153ef8b289ad577fece3ca29d9 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 10 Jul 2015 16:58:49 +0200 Subject: [PATCH 25/58] SIMD: Use _AVAILABLE instead of tag when detecting multiple architectures --- include/boost/predef/hardware/simd.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index ba9c57a..253ca57 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -32,10 +32,9 @@ http://www.boost.org/LICENSE_1_0.txt) // We check if SIMD extension of multiples architectures have been detected, // if yes, then this is an error! -#if \ - BOOST_HW_SIMD_ARM && BOOST_HW_SIMD_PPC ||\ - BOOST_HW_SIMD_ARM && BOOST_HW_SIMD_X86 ||\ - BOOST_HW_SIMD_PPC && BOOST_HW_SIMD_X86 +#if defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_PPC_AVAILABLE) ||\ + defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE) ||\ + defined(BOOST_HW_SIMD_PPC_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE) # error "Multiple SIMD architectures detected, this cannot happen!" #endif From 0e6e579e6e53b4f6c3caf3acb0077eaa9a9632d1 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 10 Jul 2015 17:04:06 +0200 Subject: [PATCH 26/58] Remove intrinsics headers --- include/boost/predef/hardware/simd/x86/avx.h | 4 ---- include/boost/predef/hardware/simd/x86/avx2.h | 4 ---- include/boost/predef/hardware/simd/x86/fma3.h | 4 ---- include/boost/predef/hardware/simd/x86/fma4.h | 4 ---- include/boost/predef/hardware/simd/x86/mic.h | 4 ---- include/boost/predef/hardware/simd/x86/sse.h | 4 ---- include/boost/predef/hardware/simd/x86/sse2.h | 4 ---- include/boost/predef/hardware/simd/x86/sse3.h | 4 ---- include/boost/predef/hardware/simd/x86/sse4_1.h | 4 ---- include/boost/predef/hardware/simd/x86/sse4_2.h | 4 ---- include/boost/predef/hardware/simd/x86/sse4a.h | 4 ---- include/boost/predef/hardware/simd/x86/ssse3.h | 4 ---- 12 files changed, 48 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86/avx.h b/include/boost/predef/hardware/simd/x86/avx.h index 1a0bf50..bd5c328 100644 --- a/include/boost/predef/hardware/simd/x86/avx.h +++ b/include/boost/predef/hardware/simd/x86/avx.h @@ -43,10 +43,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_AVX_NAME #endif -#if defined(BOOST_HW_SIMD_X86_AVX_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h index a370dcb..15ed4bd 100644 --- a/include/boost/predef/hardware/simd/x86/avx2.h +++ b/include/boost/predef/hardware/simd/x86/avx2.h @@ -43,10 +43,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_AVX2_NAME #endif -#if defined(BOOST_HW_SIMD_X86_AVX2_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h index 71170b9..ef9f0e8 100644 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -44,10 +44,6 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_HW_SIMD_X86_FMA3_NAME "FMA3" -#if defined(BOOST_HW_SIMD_X86_FMA3_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index 79c9721..5b0e760 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -40,10 +40,6 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_HW_SIMD_X86_FMA4_NAME "FMA4" -#if defined(BOOST_HW_SIMD_X86_FMA4_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h index 7ec6f1d..c0eabcb 100644 --- a/include/boost/predef/hardware/simd/x86/mic.h +++ b/include/boost/predef/hardware/simd/x86/mic.h @@ -39,10 +39,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_MIC_NAME #endif -#if defined(BOOST_HW_SIMD_X86_MIC_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h index bb4f103..5459f27 100644 --- a/include/boost/predef/hardware/simd/x86/sse.h +++ b/include/boost/predef/hardware/simd/x86/sse.h @@ -41,10 +41,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE_NAME #endif -#if defined(BOOST_HW_SIMD_X86_SSE_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h index 915d4ae..178f594 100644 --- a/include/boost/predef/hardware/simd/x86/sse2.h +++ b/include/boost/predef/hardware/simd/x86/sse2.h @@ -41,10 +41,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE2_NAME #endif -#if defined(BOOST_HW_SIMD_X86_SSE2_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h index 30c22c7..c827292 100644 --- a/include/boost/predef/hardware/simd/x86/sse3.h +++ b/include/boost/predef/hardware/simd/x86/sse3.h @@ -39,10 +39,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE3_NAME #endif -#if defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h index 2f4b0a8..8713d09 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_1.h +++ b/include/boost/predef/hardware/simd/x86/sse4_1.h @@ -39,10 +39,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE4_1_NAME #endif -#if defined(BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h index 281d2bd..c56eae4 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_2.h +++ b/include/boost/predef/hardware/simd/x86/sse4_2.h @@ -39,10 +39,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE4_2_NAME #endif -#if defined(BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h index 348d229..f804b70 100644 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -40,10 +40,6 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_HW_SIMD_X86_SSE4A_NAME "SSE4a" -#if defined(BOOST_HW_SIMD_X86_SSE4A_AVAILABLE) -# include -#endif - #endif #include diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h index ab2aa78..08856c4 100644 --- a/include/boost/predef/hardware/simd/x86/ssse3.h +++ b/include/boost/predef/hardware/simd/x86/ssse3.h @@ -39,10 +39,6 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSSE3_NAME #endif -#if defined(BOOST_HW_SIMD_X86_SSSE3_AVAILABLE) -# include -#endif - #endif #include From 481f1a198ccb0aea76c3324c3729d43694151a6c Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 10:27:45 +0200 Subject: [PATCH 27/58] Update number versions for x86 family + More specific documentations --- include/boost/predef/hardware/simd/x86.h | 12 +++++------- include/boost/predef/hardware/simd/x86/avx2.h | 4 ++-- include/boost/predef/hardware/simd/x86/fma3.h | 10 ++-------- include/boost/predef/hardware/simd/x86/fma4.h | 12 +++--------- include/boost/predef/hardware/simd/x86/mic.h | 2 +- include/boost/predef/hardware/simd/x86/sse4a.h | 12 +++--------- include/boost/predef/hardware/simd/x86/xop.h | 11 +++-------- 7 files changed, 19 insertions(+), 44 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 5cb351c..1bc4e43 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -29,23 +29,21 @@ http://www.boost.org/LICENSE_1_0.txt) */ // From the newest to the oldest -#include +#include // XEON Phi specific #include +#include +#include // AMD specific +#include // AMD specific #include #include #include +#include // AMD specific #include #include #include #include #include -// Those ones are more like options than real extensions -#include -#include -#include -#include - #if defined(BOOST_HW_SIMD_X86) # define BOOST_HW_SIMD_X86_AVAILABLE #else diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h index 15ed4bd..5b79a23 100644 --- a/include/boost/predef/hardware/simd/x86/avx2.h +++ b/include/boost/predef/hardware/simd/x86/avx2.h @@ -16,7 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt) [heading `BOOST_HW_SIMD_X86_AVX2`] [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] x86 extension. - Version number is: 5.2.0. Not available for version of MSVC below 17.00. + Version number is: 5.3.0. Not available for version of MSVC below 17.00. [table [[__predef_symbol__] [__predef_version__]] @@ -31,7 +31,7 @@ http://www.boost.org/LICENSE_1_0.txt) # undef BOOST_HW_SIMD_X86_AVX2 # if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0)\ || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER(5, 2, 0) +# define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER(5, 3, 0) # define BOOST_HW_SIMD_X86_AVX2_AVAILABLE # endif #endif diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h index ef9f0e8..e27678f 100644 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -16,11 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt) [heading `BOOST_HW_SIMD_X86_FMA3`] [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension. - Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. - - This extension is only available on particular CPUs. It does imply - AVX, but it is not implied by extensions newer than SSE3. For example, - AVX2 does not imply it. + Version number is: 5.2.0. Not available for version of MSVC below 17.00. [table [[__predef_symbol__] [__predef_version__]] @@ -33,11 +29,9 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(__FMA__) # undef BOOST_HW_SIMD_X86_FMA3 -/* We do not give a valid version for this one, since it not always - * available if newer extension than AVX are enabled. */ # if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC < BOOST_VERSION_NUMBER(17, 0, 0)\ || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER(5, 2, 0) # define BOOST_HW_SIMD_X86_FMA3_AVAILABLE # endif #endif diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index 5b0e760..5c2e926 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -14,12 +14,8 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_X86_FMA4`] - [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA4] x86 extension. - Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. - - This extension is only available on particular CPUs. It does imply - AVX and SSE4a, but it is not implied by extensions newer than SSE3. - For example, AVX2 does not imply it. + [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA4] x86 extension (AMD specific). + Version number is: 5.1.0. [table [[__predef_symbol__] [__predef_version__]] @@ -32,9 +28,7 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(__FMA4__) # undef BOOST_HW_SIMD_X86_FMA4 -/* We do not give a valid version for this one, since it not always - * available if newer extension than AVX are enabled. */ -# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER(5, 1, 0) # define BOOST_HW_SIMD_X86_FMA4_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h index c0eabcb..87de8ed 100644 --- a/include/boost/predef/hardware/simd/x86/mic.h +++ b/include/boost/predef/hardware/simd/x86/mic.h @@ -15,7 +15,7 @@ http://www.boost.org/LICENSE_1_0.txt) [heading `BOOST_HW_SIMD_X86_MIC`] [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension. - Version number is: 4.1.0. + Version number is: 6.0.0. [table [[__predef_symbol__] [__predef_version__]] diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h index f804b70..59aaf58 100644 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -14,12 +14,8 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_X86_SSE4A`] - [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension. - Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. - - This extension is only available on particular CPUs. It does imply - SSE3, but it is not implied by extensions newer than SSE3. For example, - SSE4.1 does not imply it. + [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). + Version number is: 4.0.0. [table [[__predef_symbol__] [__predef_version__]] @@ -32,9 +28,7 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(__SSE4A__) # undef BOOST_HW_SIMD_X86_SSE4A -/* We do not give a valid version for this one, since it not always - * available if newer extension than SSE3 are enabled. */ -# define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER(4, 0, 0) # define BOOST_HW_SIMD_X86_SSE4A_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h index bab193a..d4482be 100644 --- a/include/boost/predef/hardware/simd/x86/xop.h +++ b/include/boost/predef/hardware/simd/x86/xop.h @@ -14,11 +14,8 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_X86_XOP`] - [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension. - Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. - - This extension is only available on particular CPUs. It does imply - FMA4, please see its documentation to see what else is implied. + [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). + Version number is: 5.1.1. [table [[__predef_symbol__] [__predef_version__]] @@ -31,9 +28,7 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(__XOP__) # undef BOOST_HW_SIMD_X86_XOP -/* We do not give a valid version for this one, since it not always - * available if newer extension than AVX (FMA4 implies AVX) are enabled. */ -# define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER(5, 1, 1) # define BOOST_HW_SIMD_X86_XOP_AVAILABLE #endif From e6daa340d56d5b4255c3918680268dcd5beab2ef Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 13:44:35 +0200 Subject: [PATCH 28/58] x86: Use *real* versions as default version number --- include/boost/predef/hardware/simd/x86/avx.h | 4 +--- include/boost/predef/hardware/simd/x86/avx2.h | 4 +--- include/boost/predef/hardware/simd/x86/fma3.h | 4 +--- include/boost/predef/hardware/simd/x86/fma4.h | 4 +--- include/boost/predef/hardware/simd/x86/mic.h | 4 +--- include/boost/predef/hardware/simd/x86/mmx.h | 4 +--- include/boost/predef/hardware/simd/x86/sse.h | 4 +--- include/boost/predef/hardware/simd/x86/sse2.h | 4 +--- include/boost/predef/hardware/simd/x86/sse3.h | 4 +--- include/boost/predef/hardware/simd/x86/sse4_1.h | 4 +--- include/boost/predef/hardware/simd/x86/sse4_2.h | 4 +--- include/boost/predef/hardware/simd/x86/sse4a.h | 4 +--- include/boost/predef/hardware/simd/x86/ssse3.h | 4 +--- include/boost/predef/hardware/simd/x86/xop.h | 4 +--- 14 files changed, 14 insertions(+), 42 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86/avx.h b/include/boost/predef/hardware/simd/x86/avx.h index bd5c328..b9d2ad4 100644 --- a/include/boost/predef/hardware/simd/x86/avx.h +++ b/include/boost/predef/hardware/simd/x86/avx.h @@ -25,13 +25,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_AVX BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_AVX BOOST_VERSION_NUMBER(5, 0, 0) #if defined(__AVX__) -# undef BOOST_HW_SIMD_X86_AVX # if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(16, 0, 40219)\ || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_AVX BOOST_VERSION_NUMBER(5, 0, 0) # define BOOST_HW_SIMD_X86_AVX_AVAILABLE # endif #endif diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h index 5b79a23..f2774a4 100644 --- a/include/boost/predef/hardware/simd/x86/avx2.h +++ b/include/boost/predef/hardware/simd/x86/avx2.h @@ -25,13 +25,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER(5, 3, 0) #if defined(__AVX2__) -# undef BOOST_HW_SIMD_X86_AVX2 # if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0)\ || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER(5, 3, 0) # define BOOST_HW_SIMD_X86_AVX2_AVAILABLE # endif #endif diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h index e27678f..112102a 100644 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -25,13 +25,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER(5, 2, 0) #if defined(__FMA__) -# undef BOOST_HW_SIMD_X86_FMA3 # if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC < BOOST_VERSION_NUMBER(17, 0, 0)\ || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER(5, 2, 0) # define BOOST_HW_SIMD_X86_FMA3_AVAILABLE # endif #endif diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index 5c2e926..8e09d17 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER(5, 1, 0) #if defined(__FMA4__) -# undef BOOST_HW_SIMD_X86_FMA4 -# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER(5, 1, 0) # define BOOST_HW_SIMD_X86_FMA4_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h index 87de8ed..6604063 100644 --- a/include/boost/predef/hardware/simd/x86/mic.h +++ b/include/boost/predef/hardware/simd/x86/mic.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER(6, 0, 0) #if defined(__MIC__) -# undef BOOST_HW_SIMD_X86_MIC -# define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER(6, 0, 0) # define BOOST_HW_SIMD_X86_MIC_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/mmx.h b/include/boost/predef/hardware/simd/x86/mmx.h index f0476bb..6eac54a 100644 --- a/include/boost/predef/hardware/simd/x86/mmx.h +++ b/include/boost/predef/hardware/simd/x86/mmx.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_MMX BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_MMX BOOST_VERSION_NUMBER(0, 99, 0) #if defined(__MMX__) -# undef BOOST_HW_SIMD_X86_MMX -# define BOOST_HW_SIMD_X86_MMX BOOST_VERSION_NUMBER(0, 99, 0) # define BOOST_HW_SIMD_X86_MMX_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h index 5459f27..55d3edb 100644 --- a/include/boost/predef/hardware/simd/x86/sse.h +++ b/include/boost/predef/hardware/simd/x86/sse.h @@ -26,11 +26,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER(1, 0, 0) #if defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1 -# undef BOOST_HW_SIMD_X86_SSE -# define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER(1, 0, 0) # define BOOST_HW_SIMD_X86_SSE_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h index 178f594..a9f0614 100644 --- a/include/boost/predef/hardware/simd/x86/sse2.h +++ b/include/boost/predef/hardware/simd/x86/sse2.h @@ -26,11 +26,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER(2, 0, 0) #if defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2 -# undef BOOST_HW_SIMD_X86_SSE2 -# define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER(2, 0, 0) # define BOOST_HW_SIMD_X86_SSE2_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h index c827292..86d0bfd 100644 --- a/include/boost/predef/hardware/simd/x86/sse3.h +++ b/include/boost/predef/hardware/simd/x86/sse3.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER(3, 0, 0) #if defined(__SSE3__) -# undef BOOST_HW_SIMD_X86_SSE3 -# define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER(3, 0, 0) # define BOOST_HW_SIMD_X86_SSE3_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h index 8713d09..8e7e804 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_1.h +++ b/include/boost/predef/hardware/simd/x86/sse4_1.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER(4, 1, 0) #if defined(__SSE4_1__) -# undef BOOST_HW_SIMD_X86_SSE4_1 -# define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER(4, 1, 0) # define BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h index c56eae4..57717d6 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_2.h +++ b/include/boost/predef/hardware/simd/x86/sse4_2.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER(4, 2, 0) #if defined(__SSE4_2__) -# undef BOOST_HW_SIMD_X86_SSE4_2 -# define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER(4, 2, 0) # define BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h index 59aaf58..fced0b7 100644 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER(4, 0, 0) #if defined(__SSE4A__) -# undef BOOST_HW_SIMD_X86_SSE4A -# define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER(4, 0, 0) # define BOOST_HW_SIMD_X86_SSE4A_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h index 08856c4..fa35b53 100644 --- a/include/boost/predef/hardware/simd/x86/ssse3.h +++ b/include/boost/predef/hardware/simd/x86/ssse3.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER(3, 1, 0) #if defined(__SSSE3__) -# undef BOOST_HW_SIMD_X86_SSSE3 -# define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER(3, 1, 0) # define BOOST_HW_SIMD_X86_SSSE3_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h index d4482be..e91ef7b 100644 --- a/include/boost/predef/hardware/simd/x86/xop.h +++ b/include/boost/predef/hardware/simd/x86/xop.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER(5, 1, 1) #if defined(__XOP__) -# undef BOOST_HW_SIMD_X86_XOP -# define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER(5, 1, 1) # define BOOST_HW_SIMD_X86_XOP_AVAILABLE #endif From b917db985011f190098cb704548cc330ce78f559 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 13:48:12 +0200 Subject: [PATCH 29/58] ARM: Use *real* versions as default version number --- include/boost/predef/hardware/simd/arm/neon.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/boost/predef/hardware/simd/arm/neon.h b/include/boost/predef/hardware/simd/arm/neon.h index df454d9..550e99e 100644 --- a/include/boost/predef/hardware/simd/arm/neon.h +++ b/include/boost/predef/hardware/simd/arm/neon.h @@ -26,11 +26,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER(1, 0, 0) #if defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) -# undef BOOST_HW_SIMD_ARM_NEON -# define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER(1, 0, 0) # define BOOST_HW_SIMD_ARM_NEON_AVAILABLE #endif From 4c2c48967ef90d0c26de8a18c7d4f862cf404f1b Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 13:49:08 +0200 Subject: [PATCH 30/58] PPC: Use *real* versions as default version number --- include/boost/predef/hardware/simd/ppc/qpx.h | 4 +--- include/boost/predef/hardware/simd/ppc/vmx.h | 4 +--- include/boost/predef/hardware/simd/ppc/vsx.h | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/boost/predef/hardware/simd/ppc/qpx.h b/include/boost/predef/hardware/simd/ppc/qpx.h index 908100f..d1d0a15 100644 --- a/include/boost/predef/hardware/simd/ppc/qpx.h +++ b/include/boost/predef/hardware/simd/ppc/qpx.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER(2, 0, 0) #if defined(__VECTOR4DOUBLE__) -# undef BOOST_HW_SIMD_PPC_QPX -# define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER(2, 0, 0) # define BOOST_HW_SIMD_PPC_QPX_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/ppc/vmx.h b/include/boost/predef/hardware/simd/ppc/vmx.h index dd936ac..2a49f5d 100644 --- a/include/boost/predef/hardware/simd/ppc/vmx.h +++ b/include/boost/predef/hardware/simd/ppc/vmx.h @@ -25,11 +25,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER(1, 0, 0) #if defined(__ALTIVEC__) || defined(__VEC__) -# undef BOOST_HW_SIMD_PPC_VMX -# define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER(1, 0, 0) # define BOOST_HW_SIMD_PPC_VMX_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/ppc/vsx.h b/include/boost/predef/hardware/simd/ppc/vsx.h index d96ad40..75b0b16 100644 --- a/include/boost/predef/hardware/simd/ppc/vsx.h +++ b/include/boost/predef/hardware/simd/ppc/vsx.h @@ -24,11 +24,9 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER(1, 1, 0) #if defined(__VSX__) -# undef BOOST_HW_SIMD_PPC_VSX -# define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER(1, 1, 0) # define BOOST_HW_SIMD_PPC_VSX_AVAILABLE #endif From eb5bb281ab2f7fbf1a5854da68f40a099b78cdbf Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 15:25:48 +0200 Subject: [PATCH 31/58] Add hardware.h to predef.h --- include/boost/predef.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/predef.h b/include/boost/predef.h index 36d731f..4965337 100644 --- a/include/boost/predef.h +++ b/include/boost/predef.h @@ -17,6 +17,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #include From 40144e5c2b9586d8edb8f6d80c6ceb1586091b10 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 15:53:31 +0200 Subject: [PATCH 32/58] Update predef.qbk with SIMD heading/examples --- doc/predef.qbk | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/doc/predef.qbk b/doc/predef.qbk index 6558d19..1f3eeab 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -143,6 +143,8 @@ macros of a particular prefix: * `BOOST_OS_` for the operating system we are compiling to. * `BOOST_PLAT_` for platforms on top of operating system or compilers. * `BOOST_ENDIAN_` for endianness of the os and architecture combination. +* `BOOST_HW_` for hardware specific features. +* `BOOST_HW_SIMD` for SIMD (Single Instruction Multiple Data) detection. [note The detected definitions are for the configuration one is targeting during the compile. In particular in a cross-compile this means the target @@ -223,6 +225,93 @@ detected. I.e. a definition equivalent to: Also for each aspect there is a macro defined with a descriptive name of what the detection is. +[heading The `BOOST_HW_SIMD_*` predefs] + +SIMD predefs depend on compiler options. For example, you will have to add the +option `-msse3` to clang or gcc to enable SSE3. SIMD predefs are also inclusive. +This means that if SSE3 is enabled, then every other extensions with a lower +version number will implicitly be enabled and detected. However, some extensions +are CPU specific, they may not be detected nor enabled when an upper version is +enabled. + +[note SSE(1) and SSE2 are automatically enabled by default when using x86-64 +architecture.] + +To check if any SIMD extension has been enabled, you can use: + +`` + #include + #include + + int main() + { +#if defined(BOOST_HW_SIMD_AVAILABLE) + std::cout << "SIMD detected!" << std::endl; +#endif + return 0; + } +`` + +When writing SIMD specific code, you may want to check if a particular extension +has been detected. To do so you have to use the right architecture predef and +compare it. Those predef are of the form `BOOST_HW_SIMD_"ARCH"` (where `"ARCH"` +is either `ARM`, `PPC`, or `X86`). For example, if you compile code for x86 +architecture, you will have to use `BOOST_HW_SIMD_x86`. Its value will be the +version number of the most recent SIMD extension detected for the architecture. + +To check if an extension has been enabled: + +`` + #include + #include + + int main() + { +#if defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) + std::cout << "This is SSE3!" << std::endl; +#endif + return 0; + } +`` + +To "stricly" check the most recent detected extension: + +`` + #include + #include + + int main() + { +#if BOOST_HW_SIMD_X86 == BOOST_HW_SIMD_X86_SSE3 + std::cout << "This is SSE3 and this is the most recent enabled extension!" + << std::endl; +#endif + return 0; + } +`` + +Because of the version systems of predefs and of the inclusive property of SIMD +extensions macros, you can easily check for ranges of supported extensions: + +`` + #include + #include + + int main() + { +#if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2 &&\ + BOOST_HW_SIMD_X86 <= BOOST_HW_SIMD_X86_SSSE3 + std::cout << "This is SSE2, SSE3 and SSSE3!" << std::endl; +#endif + return 0; + } +`` + +[note Unlike gcc and clang, Visual Studio does not allow you to specify precisely +the SSE variants you want to use, the only detections that will take place are +SSE, SSE2, AVX and AVX2. For more informations, +see [@https://msdn.microsoft.com/en-us/library/b0084kay.aspx here]. + [heading The `*_EMULATED` macros] Predef definitions are guaranteed to be uniquely detected within one category. From d8e85aad163e152eea02a78c382035366f7ed7af Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 21:16:04 +0200 Subject: [PATCH 33/58] Fix includes to prevent testing system to fail --- include/boost/predef/hardware.h | 2 ++ include/boost/predef/hardware/simd.h | 8 +++--- include/boost/predef/hardware/simd/arm.h | 5 ++-- include/boost/predef/hardware/simd/ppc.h | 10 ++++---- include/boost/predef/hardware/simd/x86.h | 32 ++++++++++++------------ 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/include/boost/predef/hardware.h b/include/boost/predef/hardware.h index a0cea74..972b73a 100644 --- a/include/boost/predef/hardware.h +++ b/include/boost/predef/hardware.h @@ -6,8 +6,10 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ +#if !defined(BOOST_PREDEF_HARDWARE_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_HARDWARE_H #define BOOST_PREDEF_HARDWARE_H +#endif #include diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index 253ca57..174eb37 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -6,6 +6,10 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ +#include +#include +#include + #ifndef BOOST_PREDEF_HARDWARE_SIMD_H #define BOOST_PREDEF_HARDWARE_SIMD_H @@ -26,10 +30,6 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#include -#include -#include - // We check if SIMD extension of multiples architectures have been detected, // if yes, then this is an error! #if defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_PPC_AVAILABLE) ||\ diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index e0e82a3..fd4d362 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -6,6 +6,9 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ +// From the newest to the oldest +#include + #ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_H #define BOOST_PREDEF_HARDWARE_SIMD_ARM_H @@ -27,8 +30,6 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#include - #if defined(BOOST_HW_SIMD_ARM) # define BOOST_HW_SIMD_ARM_AVAILABLE #else diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index 91bceb4..1611582 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -6,6 +6,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ +// From the newest to the oldest +#include +#include +#include + #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_H @@ -28,11 +33,6 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -// From the newest to the oldest -#include -#include -#include - #if defined(BOOST_HW_SIMD_PPC) # define BOOST_HW_SIMD_PPC_AVAILABLE #else diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 1bc4e43..6c281e2 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -6,6 +6,22 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ +// From the newest to the oldest +#include // XEON Phi specific +#include +#include +#include // AMD specific +#include // AMD specific +#include +#include +#include +#include // AMD specific +#include +#include +#include +#include +#include + #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_H @@ -28,22 +44,6 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -// From the newest to the oldest -#include // XEON Phi specific -#include -#include -#include // AMD specific -#include // AMD specific -#include -#include -#include -#include // AMD specific -#include -#include -#include -#include -#include - #if defined(BOOST_HW_SIMD_X86) # define BOOST_HW_SIMD_X86_AVAILABLE #else From cf37f904295b10c9f8b8f2c25a34e7aa9c6538cf Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 21:18:00 +0200 Subject: [PATCH 34/58] Fix typo (_x86 -> _X86) --- doc/predef.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/predef.qbk b/doc/predef.qbk index 1f3eeab..0ee645f 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -256,7 +256,7 @@ When writing SIMD specific code, you may want to check if a particular extension has been detected. To do so you have to use the right architecture predef and compare it. Those predef are of the form `BOOST_HW_SIMD_"ARCH"` (where `"ARCH"` is either `ARM`, `PPC`, or `X86`). For example, if you compile code for x86 -architecture, you will have to use `BOOST_HW_SIMD_x86`. Its value will be the +architecture, you will have to use `BOOST_HW_SIMD_X86`. Its value will be the version number of the most recent SIMD extension detected for the architecture. To check if an extension has been enabled: From 2e241dbd8e82237f9982b78021ecb8754795dcbd Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 22:07:27 +0200 Subject: [PATCH 35/58] Better naming for BOOST_HW_* --- include/boost/predef/hardware/simd.h | 2 +- include/boost/predef/hardware/simd/arm.h | 2 +- include/boost/predef/hardware/simd/arm/neon.h | 2 +- include/boost/predef/hardware/simd/ppc.h | 2 +- include/boost/predef/hardware/simd/ppc/qpx.h | 2 +- include/boost/predef/hardware/simd/ppc/vmx.h | 2 +- include/boost/predef/hardware/simd/ppc/vsx.h | 2 +- include/boost/predef/hardware/simd/x86.h | 2 +- include/boost/predef/hardware/simd/x86/avx.h | 2 +- include/boost/predef/hardware/simd/x86/avx2.h | 2 +- include/boost/predef/hardware/simd/x86/fma3.h | 2 +- include/boost/predef/hardware/simd/x86/fma4.h | 2 +- include/boost/predef/hardware/simd/x86/sse.h | 2 +- include/boost/predef/hardware/simd/x86/sse2.h | 2 +- include/boost/predef/hardware/simd/x86/sse3.h | 2 +- include/boost/predef/hardware/simd/x86/sse4_1.h | 2 +- include/boost/predef/hardware/simd/x86/sse4_2.h | 2 +- include/boost/predef/hardware/simd/x86/sse4a.h | 2 +- include/boost/predef/hardware/simd/x86/ssse3.h | 2 +- include/boost/predef/hardware/simd/x86/xop.h | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index 174eb37..bc4e010 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -57,7 +57,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_AVAILABLE #else # define BOOST_HW_SIMD BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_NAME "(not found)" +# define BOOST_HW_SIMD_NAME "Hardware SIMD" #endif #endif diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index fd4d362..78b2551 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -34,7 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_ARM_AVAILABLE #else # define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_ARM_NAME "(not found)" +# define BOOST_HW_SIMD_PPC_NAME "ARM SIMD" #endif #endif diff --git a/include/boost/predef/hardware/simd/arm/neon.h b/include/boost/predef/hardware/simd/arm/neon.h index 550e99e..1a9e173 100644 --- a/include/boost/predef/hardware/simd/arm/neon.h +++ b/include/boost/predef/hardware/simd/arm/neon.h @@ -32,7 +32,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_ARM_NEON_AVAILABLE #endif -#define BOOST_HW_SIMD_ARM_NEON_NAME "NEON" +#define BOOST_HW_SIMD_ARM_NEON_NAME "ARM SIMD NEON" #if !defined(BOOST_HW_SIMD_ARM) && defined(BOOST_HW_SIMD_ARM_NEON_AVAILABLE) # define BOOST_HW_SIMD_ARM BOOST_HW_SIMD_ARM_NEON diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index 1611582..dbbcdd7 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -37,7 +37,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_PPC_AVAILABLE #else # define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_PPC_NAME "(not found)" +# define BOOST_HW_SIMD_PPC_NAME "PowerPC SIMD" #endif #endif diff --git a/include/boost/predef/hardware/simd/ppc/qpx.h b/include/boost/predef/hardware/simd/ppc/qpx.h index d1d0a15..d65b74f 100644 --- a/include/boost/predef/hardware/simd/ppc/qpx.h +++ b/include/boost/predef/hardware/simd/ppc/qpx.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_PPC_QPX_AVAILABLE #endif -#define BOOST_HW_SIMD_PPC_QPX_NAME "QPX" +#define BOOST_HW_SIMD_PPC_QPX_NAME "PowerPC SIMD QPX" #if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_QPX_AVAILABLE) # define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_QPX diff --git a/include/boost/predef/hardware/simd/ppc/vmx.h b/include/boost/predef/hardware/simd/ppc/vmx.h index 2a49f5d..6569444 100644 --- a/include/boost/predef/hardware/simd/ppc/vmx.h +++ b/include/boost/predef/hardware/simd/ppc/vmx.h @@ -31,7 +31,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_PPC_VMX_AVAILABLE #endif -#define BOOST_HW_SIMD_PPC_VMX_NAME "VMX" +#define BOOST_HW_SIMD_PPC_VMX_NAME "PowerPC SIMD VMX" #if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_VMX_AVAILABLE) # define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VMX diff --git a/include/boost/predef/hardware/simd/ppc/vsx.h b/include/boost/predef/hardware/simd/ppc/vsx.h index 75b0b16..69b0f3d 100644 --- a/include/boost/predef/hardware/simd/ppc/vsx.h +++ b/include/boost/predef/hardware/simd/ppc/vsx.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_PPC_VSX_AVAILABLE #endif -#define BOOST_HW_SIMD_PPC_VSX_NAME "VSX" +#define BOOST_HW_SIMD_PPC_VSX_NAME "PowerPC SIMD VSX" #if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_VSX_AVAILABLE) # define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VSX diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 6c281e2..8fb0698 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -48,7 +48,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_AVAILABLE #else # define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_X86_NAME "(not found)" +# define BOOST_HW_SIMD_X86_NAME "x86 SIMD" #endif #endif diff --git a/include/boost/predef/hardware/simd/x86/avx.h b/include/boost/predef/hardware/simd/x86/avx.h index b9d2ad4..f24015b 100644 --- a/include/boost/predef/hardware/simd/x86/avx.h +++ b/include/boost/predef/hardware/simd/x86/avx.h @@ -34,7 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) # endif #endif -#define BOOST_HW_SIMD_X86_AVX_NAME "AVX" +#define BOOST_HW_SIMD_X86_AVX_NAME "x86 SIMD AVX" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_AVX_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h index f2774a4..1479c4c 100644 --- a/include/boost/predef/hardware/simd/x86/avx2.h +++ b/include/boost/predef/hardware/simd/x86/avx2.h @@ -34,7 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) # endif #endif -#define BOOST_HW_SIMD_X86_AVX2_NAME "AVX2" +#define BOOST_HW_SIMD_X86_AVX2_NAME "x86 SIMD AVX2" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_AVX2_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2 diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h index 112102a..1e20e46 100644 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -34,7 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) # endif #endif -#define BOOST_HW_SIMD_X86_FMA3_NAME "FMA3" +#define BOOST_HW_SIMD_X86_FMA3_NAME "x86 SIMD FMA3" #endif diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index 8e09d17..5f383a4 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_FMA4_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_FMA4_NAME "FMA4" +#define BOOST_HW_SIMD_X86_FMA4_NAME "x86 (AMD) SIMD FMA4" #endif diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h index 55d3edb..f12b1ef 100644 --- a/include/boost/predef/hardware/simd/x86/sse.h +++ b/include/boost/predef/hardware/simd/x86/sse.h @@ -32,7 +32,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSE_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSE_NAME "SSE(1)" +#define BOOST_HW_SIMD_X86_SSE_NAME "x86 SIMD SSE(1)" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h index a9f0614..b47d398 100644 --- a/include/boost/predef/hardware/simd/x86/sse2.h +++ b/include/boost/predef/hardware/simd/x86/sse2.h @@ -32,7 +32,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSE2_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSE2_NAME "SSE2" +#define BOOST_HW_SIMD_X86_SSE2_NAME "x86 SIMD SSE2" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE2_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2 diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h index 86d0bfd..cef43bc 100644 --- a/include/boost/predef/hardware/simd/x86/sse3.h +++ b/include/boost/predef/hardware/simd/x86/sse3.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSE3_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSE3_NAME "SSE3" +#define BOOST_HW_SIMD_X86_SSE3_NAME "x86 SIMD SSE3" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3 diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h index 8e7e804..50b1ae5 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_1.h +++ b/include/boost/predef/hardware/simd/x86/sse4_1.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSE4_1_NAME "SSE4.1" +#define BOOST_HW_SIMD_X86_SSE4_1_NAME "x86 SIMD SSE4.1" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_1 diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h index 57717d6..80a944e 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_2.h +++ b/include/boost/predef/hardware/simd/x86/sse4_2.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSE4_2_NAME "SSE4.2" +#define BOOST_HW_SIMD_X86_SSE4_2_NAME "x86 SIMD SSE4.2" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2 diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h index fced0b7..cbffba2 100644 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSE4A_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSE4A_NAME "SSE4a" +#define BOOST_HW_SIMD_X86_SSE4A_NAME "x86 (AMD) SIMD SSE4a" #endif diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h index fa35b53..ace2396 100644 --- a/include/boost/predef/hardware/simd/x86/ssse3.h +++ b/include/boost/predef/hardware/simd/x86/ssse3.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_SSSE3_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_SSSE3_NAME "SSSE3" +#define BOOST_HW_SIMD_X86_SSSE3_NAME "x86 SIMD SSSE3" #if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSSE3_AVAILABLE) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSSE3 diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h index e91ef7b..e1a9d02 100644 --- a/include/boost/predef/hardware/simd/x86/xop.h +++ b/include/boost/predef/hardware/simd/x86/xop.h @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86_XOP_AVAILABLE #endif -#define BOOST_HW_SIMD_X86_XOP_NAME "XOP" +#define BOOST_HW_SIMD_X86_XOP_NAME "x86 (AMD) SIMD XOP" #endif From ce9519cf7bdce7f3ca6ea9484ffbd17a0c6175a4 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 22:13:43 +0200 Subject: [PATCH 36/58] Update copyrights in main documentation --- doc/predef.qbk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/predef.qbk b/doc/predef.qbk index 0ee645f..7fa914c 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -3,6 +3,8 @@ [version 1.3] [authors [Rivera, Rene]] [copyright 2005, 2008-2015 Rene Rivera] + [copyright 2015 Charly Chevalier] + [copyright 2015 Joel Falcou] [purpose Identification and specification of predefined macros.] [license Distributed under the Boost Software License, Version 1.0. From 2e1caabff4a2ea66b0a13aff6c8a2687212811a6 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 23:07:10 +0200 Subject: [PATCH 37/58] Add unit tests for SIMD family predefs --- include/boost/predef/hardware/simd.h | 3 +++ include/boost/predef/hardware/simd/arm.h | 3 +++ include/boost/predef/hardware/simd/ppc.h | 3 +++ include/boost/predef/hardware/simd/x86.h | 3 +++ 4 files changed, 12 insertions(+) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index bc4e010..bb91a7a 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -61,3 +61,6 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD, BOOST_HW_SIMD_NAME) diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index 78b2551..0725784 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -38,3 +38,6 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_ARM, BOOST_HW_SIMD_ARM_NAME) diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index dbbcdd7..e664dce 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -41,3 +41,6 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC, BOOST_HW_SIMD_PPC_NAME) diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 8fb0698..7bb6e6f 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -52,3 +52,6 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86, BOOST_HW_SIMD_X86_NAME) From 5758f35ffc1cec87a88e42a92f9c7eea5e5a4e73 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 15 Jul 2015 23:14:04 +0200 Subject: [PATCH 38/58] Fix predef redefinition of BOOST_HW_SIMD_PPC_NAME It was invalidly named BOOST_HW_SIMD_PPC_NAME instead of BOOST_HW_SIMD_ARM_NAME --- include/boost/predef/hardware/simd/arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index 0725784..e827938 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -34,7 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_ARM_AVAILABLE #else # define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_PPC_NAME "ARM SIMD" +# define BOOST_HW_SIMD_ARM_NAME "ARM SIMD" #endif #endif From 5ea2f20dc72fafedd018cea406dded84320a51d8 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 16 Jul 2015 11:57:10 +0200 Subject: [PATCH 39/58] Make every SIMD predefs zero valued --- include/boost/predef/hardware/simd/arm/neon.h | 4 +++- include/boost/predef/hardware/simd/ppc/qpx.h | 4 +++- include/boost/predef/hardware/simd/ppc/vmx.h | 4 +++- include/boost/predef/hardware/simd/ppc/vsx.h | 4 +++- include/boost/predef/hardware/simd/x86/fma3.h | 4 +++- include/boost/predef/hardware/simd/x86/fma4.h | 4 +++- include/boost/predef/hardware/simd/x86/mic.h | 4 +++- include/boost/predef/hardware/simd/x86/sse.h | 4 +++- include/boost/predef/hardware/simd/x86/sse2.h | 4 +++- include/boost/predef/hardware/simd/x86/sse3.h | 4 +++- include/boost/predef/hardware/simd/x86/sse4_1.h | 4 +++- include/boost/predef/hardware/simd/x86/sse4_2.h | 4 +++- include/boost/predef/hardware/simd/x86/sse4a.h | 4 +++- include/boost/predef/hardware/simd/x86/ssse3.h | 4 +++- include/boost/predef/hardware/simd/x86/xop.h | 4 +++- 15 files changed, 45 insertions(+), 15 deletions(-) diff --git a/include/boost/predef/hardware/simd/arm/neon.h b/include/boost/predef/hardware/simd/arm/neon.h index 1a9e173..4c96482 100644 --- a/include/boost/predef/hardware/simd/arm/neon.h +++ b/include/boost/predef/hardware/simd/arm/neon.h @@ -26,9 +26,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER(1, 0, 0) +#define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) +# undef BOOST_HW_SIMD_ARM_NEON +# define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER(1, 0, 0) # define BOOST_HW_SIMD_ARM_NEON_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/ppc/qpx.h b/include/boost/predef/hardware/simd/ppc/qpx.h index d65b74f..ff65141 100644 --- a/include/boost/predef/hardware/simd/ppc/qpx.h +++ b/include/boost/predef/hardware/simd/ppc/qpx.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER(2, 0, 0) +#define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__VECTOR4DOUBLE__) +# undef BOOST_HW_SIMD_PPC_QPX +# define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER(2, 0, 0) # define BOOST_HW_SIMD_PPC_QPX_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/ppc/vmx.h b/include/boost/predef/hardware/simd/ppc/vmx.h index 6569444..176cc24 100644 --- a/include/boost/predef/hardware/simd/ppc/vmx.h +++ b/include/boost/predef/hardware/simd/ppc/vmx.h @@ -25,9 +25,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER(1, 0, 0) +#define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__ALTIVEC__) || defined(__VEC__) +# undef BOOST_HW_SIMD_PPC_VMX +# define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER(1, 0, 0) # define BOOST_HW_SIMD_PPC_VMX_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/ppc/vsx.h b/include/boost/predef/hardware/simd/ppc/vsx.h index 69b0f3d..c708ab5 100644 --- a/include/boost/predef/hardware/simd/ppc/vsx.h +++ b/include/boost/predef/hardware/simd/ppc/vsx.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER(1, 1, 0) +#define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__VSX__) +# undef BOOST_HW_SIMD_PPC_VSX +# define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER(1, 1, 0) # define BOOST_HW_SIMD_PPC_VSX_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h index 1e20e46..d069280 100644 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ b/include/boost/predef/hardware/simd/x86/fma3.h @@ -25,11 +25,13 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER(5, 2, 0) +#define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__FMA__) # if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC < BOOST_VERSION_NUMBER(17, 0, 0)\ || !defined(BOOST_COMP_MSVC_AVAILABLE) +# undef BOOST_HW_SIMD_X86_FMA3 +# define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER(5, 2, 0) # define BOOST_HW_SIMD_X86_FMA3_AVAILABLE # endif #endif diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index 5f383a4..a886de0 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER(5, 1, 0) +#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__FMA4__) +# undef BOOST_HW_SIMD_X86_FMA4 +# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER(5, 1, 0) # define BOOST_HW_SIMD_X86_FMA4_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h index 6604063..87de8ed 100644 --- a/include/boost/predef/hardware/simd/x86/mic.h +++ b/include/boost/predef/hardware/simd/x86/mic.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER(6, 0, 0) +#define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__MIC__) +# undef BOOST_HW_SIMD_X86_MIC +# define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER(6, 0, 0) # define BOOST_HW_SIMD_X86_MIC_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h index f12b1ef..17e823b 100644 --- a/include/boost/predef/hardware/simd/x86/sse.h +++ b/include/boost/predef/hardware/simd/x86/sse.h @@ -26,9 +26,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER(1, 0, 0) +#define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1 +# undef BOOST_HW_SIMD_X86_SSE +# define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER(1, 0, 0) # define BOOST_HW_SIMD_X86_SSE_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h index b47d398..35fec9d 100644 --- a/include/boost/predef/hardware/simd/x86/sse2.h +++ b/include/boost/predef/hardware/simd/x86/sse2.h @@ -26,9 +26,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER(2, 0, 0) +#define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2 +# undef BOOST_HW_SIMD_X86_SSE2 +# define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER(2, 0, 0) # define BOOST_HW_SIMD_X86_SSE2_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h index cef43bc..cd9b96f 100644 --- a/include/boost/predef/hardware/simd/x86/sse3.h +++ b/include/boost/predef/hardware/simd/x86/sse3.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER(3, 0, 0) +#define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSE3__) +# undef BOOST_HW_SIMD_X86_SSE3 +# define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER(3, 0, 0) # define BOOST_HW_SIMD_X86_SSE3_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h index 50b1ae5..667eff9 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_1.h +++ b/include/boost/predef/hardware/simd/x86/sse4_1.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER(4, 1, 0) +#define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSE4_1__) +# undef BOOST_HW_SIMD_X86_SSE4_1 +# define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER(4, 1, 0) # define BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h index 80a944e..5da5a37 100644 --- a/include/boost/predef/hardware/simd/x86/sse4_2.h +++ b/include/boost/predef/hardware/simd/x86/sse4_2.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER(4, 2, 0) +#define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSE4_2__) +# undef BOOST_HW_SIMD_X86_SSE4_2 +# define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER(4, 2, 0) # define BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h index cbffba2..b0eed86 100644 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ b/include/boost/predef/hardware/simd/x86/sse4a.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER(4, 0, 0) +#define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSE4A__) +# undef BOOST_HW_SIMD_X86_SSE4A +# define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER(4, 0, 0) # define BOOST_HW_SIMD_X86_SSE4A_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h index ace2396..9b395ac 100644 --- a/include/boost/predef/hardware/simd/x86/ssse3.h +++ b/include/boost/predef/hardware/simd/x86/ssse3.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER(3, 1, 0) +#define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__SSSE3__) +# undef BOOST_HW_SIMD_X86_SSSE3 +# define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER(3, 1, 0) # define BOOST_HW_SIMD_X86_SSSE3_AVAILABLE #endif diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h index e1a9d02..3139fc9 100644 --- a/include/boost/predef/hardware/simd/x86/xop.h +++ b/include/boost/predef/hardware/simd/x86/xop.h @@ -24,9 +24,11 @@ http://www.boost.org/LICENSE_1_0.txt) ] */ -#define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER(5, 1, 1) +#define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__XOP__) +# undef BOOST_HW_SIMD_X86_XOP +# define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER(5, 1, 1) # define BOOST_HW_SIMD_X86_XOP_AVAILABLE #endif From e2d5a46cac9c85de4f66ae0f1fa2bb2171c1503d Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 20 Jul 2015 10:49:00 +0200 Subject: [PATCH 40/58] Refactor x86 SIMD detection + Add _VERSION(s) for x86 family --- include/boost/predef/hardware/simd/x86.h | 129 ++++++++++++++---- include/boost/predef/hardware/simd/x86/avx.h | 47 ------- include/boost/predef/hardware/simd/x86/avx2.h | 47 ------- include/boost/predef/hardware/simd/x86/fma3.h | 44 ------ include/boost/predef/hardware/simd/x86/fma4.h | 40 ------ include/boost/predef/hardware/simd/x86/mic.h | 45 ------ include/boost/predef/hardware/simd/x86/mmx.h | 43 ------ include/boost/predef/hardware/simd/x86/sse.h | 47 ------- include/boost/predef/hardware/simd/x86/sse2.h | 47 ------- include/boost/predef/hardware/simd/x86/sse3.h | 45 ------ .../boost/predef/hardware/simd/x86/sse4_1.h | 45 ------ .../boost/predef/hardware/simd/x86/sse4_2.h | 45 ------ .../boost/predef/hardware/simd/x86/sse4a.h | 40 ------ .../boost/predef/hardware/simd/x86/ssse3.h | 45 ------ .../boost/predef/hardware/simd/x86/versions.h | 111 +++++++++++++++ include/boost/predef/hardware/simd/x86/xop.h | 40 ------ 16 files changed, 213 insertions(+), 647 deletions(-) delete mode 100644 include/boost/predef/hardware/simd/x86/avx.h delete mode 100644 include/boost/predef/hardware/simd/x86/avx2.h delete mode 100644 include/boost/predef/hardware/simd/x86/fma3.h delete mode 100644 include/boost/predef/hardware/simd/x86/fma4.h delete mode 100644 include/boost/predef/hardware/simd/x86/mic.h delete mode 100644 include/boost/predef/hardware/simd/x86/mmx.h delete mode 100644 include/boost/predef/hardware/simd/x86/sse.h delete mode 100644 include/boost/predef/hardware/simd/x86/sse2.h delete mode 100644 include/boost/predef/hardware/simd/x86/sse3.h delete mode 100644 include/boost/predef/hardware/simd/x86/sse4_1.h delete mode 100644 include/boost/predef/hardware/simd/x86/sse4_2.h delete mode 100644 include/boost/predef/hardware/simd/x86/sse4a.h delete mode 100644 include/boost/predef/hardware/simd/x86/ssse3.h create mode 100644 include/boost/predef/hardware/simd/x86/versions.h delete mode 100644 include/boost/predef/hardware/simd/x86/xop.h diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 7bb6e6f..9856c63 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -6,50 +6,125 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -// From the newest to the oldest -#include // XEON Phi specific -#include -#include -#include // AMD specific -#include // AMD specific -#include -#include -#include -#include // AMD specific -#include -#include -#include -#include -#include - #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_H #include +#include +#include /*` [heading `BOOST_HW_SIMD_X86`] The SIMD extension for x86 (if detected). - Version number depends on the detected extension. - - BOOST_HW_SIMD_X86 is defined by the first detected extension. They are - checked from the newest to the oldest. (AVX2 -> AVX -> ... -> SSE2 -> SSE) + Version number depends on the most recent detected extension. [table [[__predef_symbol__] [__predef_version__]] - [[`BOOST_HW_SIMD_X86`] [__predef_detection__]] - [[`BOOST_HW_SIMD_X86`] [V.R.P]] + + [[`__SSE__`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + [[`_M_IX86_FP >= 1`] [__predef_detection__]] + + [[`__SSE2__`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + [[`_M_IX86_FP >= 2`] [__predef_detection__]] + + [[`__SSE3__`] [__predef_detection__]] + + [[`__SSSE3__`] [__predef_detection__]] + + [[`__SSE4_1__`] [__predef_detection__]] + + [[`__SSE4_2__`] [__predef_detection__]] + + [[`__AVX__`] [__predef_detection__]] + + [[`__FMA__`] [__predef_detection__]] + + [[`__AVX2__`] [__predef_detection__]] + + + [[`__SSE__`] [BOOST_HW_SIMD_X86_SSE_VERSION]] + [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE_VERSION]] + [[`_M_IX86_FP >= 1`] [BOOST_HW_SIMD_X86_SSE_VERSION]] + + [[`__SSE2__`] [BOOST_HW_SIMD_X86_SSE2_VERSION]] + [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE2_VERSION]] + [[`_M_IX86_FP >= 2`] [BOOST_HW_SIMD_X86_SSE2_VERSION]] + + [[`__SSE3__`] [BOOST_HW_SIMD_X86_SSE3_VERSION]] + + [[`__SSSE3__`] [BOOST_HW_SIMD_X86_SSSE3_VERSION]] + + [[`__SSE4_1__`] [BOOST_HW_SIMD_X86_SSE4_1_VERSION]] + + [[`__SSE4_2__`] [BOOST_HW_SIMD_X86_SSE4_2_VERSION]] + + [[`__AVX__`] [BOOST_HW_SIMD_X86_AVX_VERSION]] + + [[`__FMA__`] [BOOST_HW_SIMD_X86_FMA3_VERSION]] + + [[`__AVX2__`] [BOOST_HW_SIMD_x86_AVX2_VERSION]] ] + + [include x86/versions.h] */ -#if defined(BOOST_HW_SIMD_X86) -# define BOOST_HW_SIMD_X86_AVAILABLE -#else -# define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_X86_NAME "x86 SIMD" +#define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#undef BOOST_HW_SIMD_X86 +#if !defined(BOOST_HW_SIMD_X86) && defined(__MIC__) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MIC_VERSION #endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__AVX2__) +# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0) ||\ + !defined(BOOST_COMP_MSVC_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2_VERSION +# endif +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__AVX__) +# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(16, 0, 40219) ||\ + !defined(BOOST_COMP_MSVC_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX_VERSION +# endif +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__FMA__) +# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0) ||\ + !defined(BOOST_COMP_MSVC_AVAILABLE) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_FMA_VERSION +# endif +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_2__) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_1__) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_1_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__SSSE3__) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSSE3_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE3__) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86) && defined(__MMX__) +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MMX_VERSION +#endif + +#if !defined(BOOST_HW_SIMD_X86) +# define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE +#else +# define BOOST_HW_SIMD_X86_AVAILABLE +#endif + +#define BOOST_HW_SIMD_X86_NAME "x86 SIMD" #endif diff --git a/include/boost/predef/hardware/simd/x86/avx.h b/include/boost/predef/hardware/simd/x86/avx.h deleted file mode 100644 index f24015b..0000000 --- a/include/boost/predef/hardware/simd/x86/avx.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AVX_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_AVX_H - -#include -#include - -/*` - [heading `BOOST_HW_SIMD_X86_AVX`] - - [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86 extension. - Version number is: 5.0.0. Not available for version of MSVC below 16.00.40219. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__AVX__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_AVX BOOST_VERSION_NUMBER(5, 0, 0) - -#if defined(__AVX__) -# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(16, 0, 40219)\ - || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_AVX_AVAILABLE -# endif -#endif - -#define BOOST_HW_SIMD_X86_AVX_NAME "x86 SIMD AVX" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_AVX_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_AVX_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AVX, BOOST_HW_SIMD_X86_AVX_NAME) diff --git a/include/boost/predef/hardware/simd/x86/avx2.h b/include/boost/predef/hardware/simd/x86/avx2.h deleted file mode 100644 index 1479c4c..0000000 --- a/include/boost/predef/hardware/simd/x86/avx2.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AVX2_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_AVX2_H - -#include -#include - -/*` - [heading `BOOST_HW_SIMD_X86_AVX2`] - - [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] x86 extension. - Version number is: 5.3.0. Not available for version of MSVC below 17.00. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__AVX2__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_AVX2 BOOST_VERSION_NUMBER(5, 3, 0) - -#if defined(__AVX2__) -# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0)\ - || !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86_AVX2_AVAILABLE -# endif -#endif - -#define BOOST_HW_SIMD_X86_AVX2_NAME "x86 SIMD AVX2" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_AVX2_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2 -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_AVX2_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AVX2, BOOST_HW_SIMD_X86_AVX2_NAME) diff --git a/include/boost/predef/hardware/simd/x86/fma3.h b/include/boost/predef/hardware/simd/x86/fma3.h deleted file mode 100644 index d069280..0000000 --- a/include/boost/predef/hardware/simd/x86/fma3.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA3_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA3_H - -#include -#include - -/*` - [heading `BOOST_HW_SIMD_X86_FMA3`] - - [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension. - Version number is: 5.2.0. Not available for version of MSVC below 17.00. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__FMA__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__FMA__) -# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC < BOOST_VERSION_NUMBER(17, 0, 0)\ - || !defined(BOOST_COMP_MSVC_AVAILABLE) -# undef BOOST_HW_SIMD_X86_FMA3 -# define BOOST_HW_SIMD_X86_FMA3 BOOST_VERSION_NUMBER(5, 2, 0) -# define BOOST_HW_SIMD_X86_FMA3_AVAILABLE -# endif -#endif - -#define BOOST_HW_SIMD_X86_FMA3_NAME "x86 SIMD FMA3" - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_FMA3, BOOST_HW_SIMD_X86_FMA3_NAME) diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h deleted file mode 100644 index a886de0..0000000 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_FMA4`] - - [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA4] x86 extension (AMD specific). - Version number is: 5.1.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__FMA4__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__FMA4__) -# undef BOOST_HW_SIMD_X86_FMA4 -# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER(5, 1, 0) -# define BOOST_HW_SIMD_X86_FMA4_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_FMA4_NAME "x86 (AMD) SIMD FMA4" - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_FMA4, BOOST_HW_SIMD_X86_FMA4_NAME) diff --git a/include/boost/predef/hardware/simd/x86/mic.h b/include/boost/predef/hardware/simd/x86/mic.h deleted file mode 100644 index 87de8ed..0000000 --- a/include/boost/predef/hardware/simd/x86/mic.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_MIC_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_MIC_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_MIC`] - - [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension. - Version number is: 6.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__MIC__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__MIC__) -# undef BOOST_HW_SIMD_X86_MIC -# define BOOST_HW_SIMD_X86_MIC BOOST_VERSION_NUMBER(6, 0, 0) -# define BOOST_HW_SIMD_X86_MIC_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_MIC_NAME "MIC (Xeon Phi)" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_MIC_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MIC -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_MIC_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_MIC, BOOST_HW_SIMD_X86_MIC_NAME) diff --git a/include/boost/predef/hardware/simd/x86/mmx.h b/include/boost/predef/hardware/simd/x86/mmx.h deleted file mode 100644 index 6eac54a..0000000 --- a/include/boost/predef/hardware/simd/x86/mmx.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_MMX_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_MMX_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_MMX`] - - [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension. - Version number is: 0.99.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__MMX__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_MMX BOOST_VERSION_NUMBER(0, 99, 0) - -#if defined(__MMX__) -# define BOOST_HW_SIMD_X86_MMX_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_MMX_NAME "MMX" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_MMX_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MMX -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_MMX_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_MMX, BOOST_HW_SIMD_X86_MMX_NAME) diff --git a/include/boost/predef/hardware/simd/x86/sse.h b/include/boost/predef/hardware/simd/x86/sse.h deleted file mode 100644 index 17e823b..0000000 --- a/include/boost/predef/hardware/simd/x86/sse.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSE`] - - [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension. - Version number is: 1.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSE__`] [__predef_detection__]] - [[`_M_X64`] [__predef_detection__]] - [[`_M_IX86_FP >= 1`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1 -# undef BOOST_HW_SIMD_X86_SSE -# define BOOST_HW_SIMD_X86_SSE BOOST_VERSION_NUMBER(1, 0, 0) -# define BOOST_HW_SIMD_X86_SSE_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSE_NAME "x86 SIMD SSE(1)" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE, BOOST_HW_SIMD_X86_SSE_NAME) diff --git a/include/boost/predef/hardware/simd/x86/sse2.h b/include/boost/predef/hardware/simd/x86/sse2.h deleted file mode 100644 index 35fec9d..0000000 --- a/include/boost/predef/hardware/simd/x86/sse2.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE2_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE2_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSE2`] - - [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension. - Version number is: 2.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSE2__`] [__predef_detection__]] - [[`_M_X64`] [__predef_detection__]] - [[`_M_IX86_FP >= 2`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2 -# undef BOOST_HW_SIMD_X86_SSE2 -# define BOOST_HW_SIMD_X86_SSE2 BOOST_VERSION_NUMBER(2, 0, 0) -# define BOOST_HW_SIMD_X86_SSE2_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSE2_NAME "x86 SIMD SSE2" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE2_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2 -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE2_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE2, BOOST_HW_SIMD_X86_SSE2_NAME) diff --git a/include/boost/predef/hardware/simd/x86/sse3.h b/include/boost/predef/hardware/simd/x86/sse3.h deleted file mode 100644 index cd9b96f..0000000 --- a/include/boost/predef/hardware/simd/x86/sse3.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE3_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE3_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSE3`] - - [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension. - Version number is: 3.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSE3__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSE3__) -# undef BOOST_HW_SIMD_X86_SSE3 -# define BOOST_HW_SIMD_X86_SSE3 BOOST_VERSION_NUMBER(3, 0, 0) -# define BOOST_HW_SIMD_X86_SSE3_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSE3_NAME "x86 SIMD SSE3" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3 -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE3_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE3, BOOST_HW_SIMD_X86_SSE3_NAME) diff --git a/include/boost/predef/hardware/simd/x86/sse4_1.h b/include/boost/predef/hardware/simd/x86/sse4_1.h deleted file mode 100644 index 667eff9..0000000 --- a/include/boost/predef/hardware/simd/x86/sse4_1.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_1_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_1_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSE4_1`] - - [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension. - Version number is: 4.1.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSE4_1__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSE4_1__) -# undef BOOST_HW_SIMD_X86_SSE4_1 -# define BOOST_HW_SIMD_X86_SSE4_1 BOOST_VERSION_NUMBER(4, 1, 0) -# define BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSE4_1_NAME "x86 SIMD SSE4.1" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE4_1_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_1 -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE4_1_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE4_1, BOOST_HW_SIMD_X86_SSE4_1_NAME) diff --git a/include/boost/predef/hardware/simd/x86/sse4_2.h b/include/boost/predef/hardware/simd/x86/sse4_2.h deleted file mode 100644 index 5da5a37..0000000 --- a/include/boost/predef/hardware/simd/x86/sse4_2.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_2_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4_2_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSE4_2`] - - [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension. - Version number is: 4.1.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSE4_2__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSE4_2__) -# undef BOOST_HW_SIMD_X86_SSE4_2 -# define BOOST_HW_SIMD_X86_SSE4_2 BOOST_VERSION_NUMBER(4, 2, 0) -# define BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSE4_2_NAME "x86 SIMD SSE4.2" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSE4_2_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2 -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSE4_2_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE4_2, BOOST_HW_SIMD_X86_SSE4_2_NAME) diff --git a/include/boost/predef/hardware/simd/x86/sse4a.h b/include/boost/predef/hardware/simd/x86/sse4a.h deleted file mode 100644 index b0eed86..0000000 --- a/include/boost/predef/hardware/simd/x86/sse4a.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4A_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSE4A_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSE4A`] - - [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). - Version number is: 4.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSE4A__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSE4A__) -# undef BOOST_HW_SIMD_X86_SSE4A -# define BOOST_HW_SIMD_X86_SSE4A BOOST_VERSION_NUMBER(4, 0, 0) -# define BOOST_HW_SIMD_X86_SSE4A_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSE4A_NAME "x86 (AMD) SIMD SSE4a" - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSE4A, BOOST_HW_SIMD_X86_SSE4A_NAME) diff --git a/include/boost/predef/hardware/simd/x86/ssse3.h b/include/boost/predef/hardware/simd/x86/ssse3.h deleted file mode 100644 index 9b395ac..0000000 --- a/include/boost/predef/hardware/simd/x86/ssse3.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_SSSE3_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_SSSE3_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_SSSE3`] - - [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension. - Version number is: 3.1.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__SSSE3__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__SSSE3__) -# undef BOOST_HW_SIMD_X86_SSSE3 -# define BOOST_HW_SIMD_X86_SSSE3 BOOST_VERSION_NUMBER(3, 1, 0) -# define BOOST_HW_SIMD_X86_SSSE3_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_SSSE3_NAME "x86 SIMD SSSE3" - -#if !defined(BOOST_HW_SIMD_X86) && defined(BOOST_HW_SIMD_X86_SSSE3_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSSE3 -# define BOOST_HW_SIMD_X86_NAME BOOST_HW_SIMD_X86_SSSE3_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_SSSE3, BOOST_HW_SIMD_X86_SSSE3_NAME) diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h new file mode 100644 index 0000000..98ab909 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -0,0 +1,111 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H + +#include + +/*` + [heading `BOOST_HW_SIMD_X86_*_VERSION`] + + [note Those defines represent x86 SIMD extensions versions. You can + compare them with the predef BOOST_HW_SIMD_X86.] + */ + +// --------------------------------- + +/*` + [heading `BOOST_HW_SIMD_X86_MMX`] + + [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension. + Version number is: 0.99.0. + */ +#define BOOST_HW_SIMD_X86_MMX_VERSION BOOST_VERSION_NUMBER(0, 99, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_SSE_VERSION`] + + [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension. + Version number is: 1.0.0. + */ +#define BOOST_HW_SIMD_X86_SSE_VERSION BOOST_VERSION_NUMBER(1, 0, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_SSE2`] + + [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension. + Version number is: 2.0.0. + */ +#define BOOST_HW_SIMD_X86_SSE2_VERSION BOOST_VERSION_NUMBER(2, 0, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_SSE3`] + + [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension. + Version number is: 3.0.0. + */ +#define BOOST_HW_SIMD_X86_SSE3_VERSION BOOST_VERSION_NUMBER(3, 0, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_SSSE3`] + + [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension. + Version number is: 3.1.0. + */ +#define BOOST_HW_SIMD_X86_SSSE3_VERSION BOOST_VERSION_NUMBER(3, 1, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_SSE4_1`] + + [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension. + Version number is: 4.1.0. + */ +#define BOOST_HW_SIMD_X86_SSE4_1_VERSION BOOST_VERSION_NUMBER(4, 1, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_SSE4_2`] + + [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension. + Version number is: 4.1.0. + */ +#define BOOST_HW_SIMD_X86_SSE4_2_VERSION BOOST_VERSION_NUMBER(4, 2, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_AVX`] + + [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86 extension. + Version number is: 5.0.0. Not available for version of MSVC below 16.00.40219. + */ +#define BOOST_HW_SIMD_X86_AVX_VERSION BOOST_VERSION_NUMBER(5, 0, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_FMA3`] + + [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension. + Version number is: 5.2.0. Not available for version of MSVC below 17.00. + */ +#define BOOST_HW_SIMD_X86_FMA3_VERSION BOOST_VERSION_NUMBER(5, 2, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_AVX2`] + + [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] x86 extension. + Version number is: 5.3.0. Not available for version of MSVC below 17.00. + */ +#define BOOST_HW_SIMD_x86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_MIC`] + + [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension. + Version number is: 6.0.0. + */ +#define BOOST_HW_SIMD_x86_MIC_VERSION BOOST_VERSION_NUMBER(99, 999, 999) + +#endif diff --git a/include/boost/predef/hardware/simd/x86/xop.h b/include/boost/predef/hardware/simd/x86/xop.h deleted file mode 100644 index 3139fc9..0000000 --- a/include/boost/predef/hardware/simd/x86/xop.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_XOP_H -#define BOOST_PREDEF_HARDWARE_SIMD_X86_XOP_H - -#include - -/*` - [heading `BOOST_HW_SIMD_X86_XOP`] - - [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). - Version number is: 5.1.1. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__XOP__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__XOP__) -# undef BOOST_HW_SIMD_X86_XOP -# define BOOST_HW_SIMD_X86_XOP BOOST_VERSION_NUMBER(5, 1, 1) -# define BOOST_HW_SIMD_X86_XOP_AVAILABLE -#endif - -#define BOOST_HW_SIMD_X86_XOP_NAME "x86 (AMD) SIMD XOP" - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_XOP, BOOST_HW_SIMD_X86_XOP_NAME) From 4aa12a8965660afa940dc27286ad0a90cca6f8fb Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 20 Jul 2015 11:02:21 +0200 Subject: [PATCH 41/58] Refactor x86 (AMD) SIMD detection + Add _VERSION(s) for x86 (AMD) family --- include/boost/predef/hardware/simd/x86_amd.h | 76 +++++++++++++++++++ .../predef/hardware/simd/x86_amd/versions.h | 48 ++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 include/boost/predef/hardware/simd/x86_amd.h create mode 100644 include/boost/predef/hardware/simd/x86_amd/versions.h diff --git a/include/boost/predef/hardware/simd/x86_amd.h b/include/boost/predef/hardware/simd/x86_amd.h new file mode 100644 index 0000000..7fea531 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86_amd.h @@ -0,0 +1,76 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H + +#include +#include +#include + +/*` + [heading `BOOST_HW_SIMD_X86_AMD`] + + The SIMD extension for x86 (AMD) (if detected). + Version number depends on the most recent detected extension. + + [note This predef includes every other x86 SIMD extensions and also has other + more specific extensions (FMA4, XOP, SSE4a). You should use this predef + instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have + been detected.] + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4A__`] [BOOST_HW_SIMD_x86_SSE4A_VERSION]] + + [[`__FMA4__`] [BOOST_HW_SIMD_x86_FMA4_VERSION]] + + [[`__XOP__`] [BOOST_HW_SIMD_x86_XOP_VERSION]] + + [[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_x86]] + ] + + [include x86_amd/versions.h] + */ + +#define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE + +// AMD CPUs also use x86 architecture. We first try to detect if any AMD +// specific extension are detected, if yes, then try to detect more recent x86 +// common extensions. + +#undef BOOST_HW_SIMD_X86_AMD +#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__) +# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__FMA4__) +# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_FMA4_VERSION +#endif +#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__) +# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION +#endif + +#if !defined(BOOST_HW_SIMD_X86_AMD) +# define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE +#else + // At this point, we know that we have an AMD CPU, we do need to check for + // other x86 extensions to determine the final version number. +# include +# if BOOST_HW_SIMD_X86 > BOOST_HW_SIMD_X86_AMD +# undef BOOST_HW_SIMD_X86_AMD +# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86 +# endif +#endif + +#define BOOST_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AMD, BOOST_HW_SIMD_X86_AMD_NAME) diff --git a/include/boost/predef/hardware/simd/x86_amd/versions.h b/include/boost/predef/hardware/simd/x86_amd/versions.h new file mode 100644 index 0000000..4e430b5 --- /dev/null +++ b/include/boost/predef/hardware/simd/x86_amd/versions.h @@ -0,0 +1,48 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_VERSIONS_H +#define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_VERSIONS_H + +#include + +/*` + [heading `BOOST_HW_SIMD_X86_AMD_*_VERSION`] + + [note Those defines represent x86 (AMD specific) SIMD extensions versions. You + can compare them with the predef BOOST_HW_SIMD_X86_AMD.] + */ + +// --------------------------------- + +/*` + [heading `BOOST_HW_SIMD_X86_SSE4A`] + + [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). + Version number is: 4.0.0. + */ +#define BOOST_HW_SIMD_x86_AMD_SSE4A_VERSION BOOST_VERSION_NUMBER(4, 0, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_XOP`] + + [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). + Version number is: 5.1.1. + */ +#define BOOST_HW_SIMD_x86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0) + +/*` + [heading `BOOST_HW_SIMD_X86_XOP`] + + [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). + Version number is: 5.1.1. + */ +#define BOOST_HW_SIMD_x86_AMD_XOP_VERSION BOOST_VERSION_NUMBER(5, 1, 1) + + +#endif From 7399d0169dd969c62ca74a917971b2c6a7115dad Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 20 Jul 2015 11:03:05 +0200 Subject: [PATCH 42/58] Refactor ARM SIMD detection + Add _VERSION(s) for ARM family --- include/boost/predef/hardware/simd/arm.h | 37 ++++++++++----- include/boost/predef/hardware/simd/arm/neon.h | 47 ------------------- .../boost/predef/hardware/simd/arm/versions.h | 31 ++++++++++++ 3 files changed, 55 insertions(+), 60 deletions(-) delete mode 100644 include/boost/predef/hardware/simd/arm/neon.h create mode 100644 include/boost/predef/hardware/simd/arm/versions.h diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index e827938..a2b802a 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -6,37 +6,48 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -// From the newest to the oldest -#include - #ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_H #define BOOST_PREDEF_HARDWARE_SIMD_ARM_H #include +#include /*` [heading `BOOST_HW_SIMD_ARM`] The SIMD extension for ARM (if detected). - Version number depends on the detected extension. - - BOOST_HW_SIMD_ARM is defined by the first detected extension. + Version number depends on the most recent detected extension. [table [[__predef_symbol__] [__predef_version__]] - [[`BOOST_HW_SIMD_ARM`] [__predef_detection__]] - [[`BOOST_HW_SIMD_ARM`] [V.R.P]] + + [[__predef_detection__] [__predef_detection__]] + [[`__aarch64__`] [__predef_detection__]] + [[`_M_ARM`] [__predef_detection__]] + + + [[`__ARM_NEON__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] + [[`__aarch64__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] + [[`_M_ARM`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] ] */ -#if defined(BOOST_HW_SIMD_ARM) -# define BOOST_HW_SIMD_ARM_AVAILABLE -#else -# define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_ARM_NAME "ARM SIMD" +#define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#undef BOOST_HW_SIMD_ARM +#if !defined(BOOST_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM)) +# define BOOST_HW_SIMD_ARM BOOST_HW_SIMD_ARM_NEON_VERSION #endif +#if !defined(BOOST_HW_SIMD_ARM) +# define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE +#else +# define BOOST_HW_SIMD_ARM_AVAILABLE +#endif + +#define BOOST_HW_SIMD_ARM_NAME "ARM SIMD" + #endif #include diff --git a/include/boost/predef/hardware/simd/arm/neon.h b/include/boost/predef/hardware/simd/arm/neon.h deleted file mode 100644 index 4c96482..0000000 --- a/include/boost/predef/hardware/simd/arm/neon.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_NEON_H -#define BOOST_PREDEF_HARDWARE_SIMD_ARM_NEON_H - -#include - -/*` - [heading `BOOST_HW_SIMD_ARM_NEON`] - - [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON] ARM extension. - Version number is: 1.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__ARM_NEON__`] [__predef_detection__]] - [[`__aarch64__`] [__predef_detection__]] - [[`_M_ARM`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) -# undef BOOST_HW_SIMD_ARM_NEON -# define BOOST_HW_SIMD_ARM_NEON BOOST_VERSION_NUMBER(1, 0, 0) -# define BOOST_HW_SIMD_ARM_NEON_AVAILABLE -#endif - -#define BOOST_HW_SIMD_ARM_NEON_NAME "ARM SIMD NEON" - -#if !defined(BOOST_HW_SIMD_ARM) && defined(BOOST_HW_SIMD_ARM_NEON_AVAILABLE) -# define BOOST_HW_SIMD_ARM BOOST_HW_SIMD_ARM_NEON -# define BOOST_HW_SIMD_ARM_NAME BOOST_HW_SIMD_ARM_NEON_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_ARM_NEON, BOOST_HW_SIMD_ARM_NEON_NAME) diff --git a/include/boost/predef/hardware/simd/arm/versions.h b/include/boost/predef/hardware/simd/arm/versions.h new file mode 100644 index 0000000..ad15931 --- /dev/null +++ b/include/boost/predef/hardware/simd/arm/versions.h @@ -0,0 +1,31 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_ARM_VERSIONS_H +#define BOOST_PREDEF_HARDWARE_SIMD_ARM_VERSIONS_H + +#include + +/*` + [heading `BOOST_HW_SIMD_ARM_*_VERSION`] + + [note Those defines represent ARM SIMD extensions versions. You can + compare them with the predef BOOST_HW_SIMD_ARM.] + */ + +// --------------------------------- + +/*` + [heading `BOOST_HW_SIMD_ARM_NEON`] + + [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON] ARM extension. + Version number is: 1.0.0. + */ +#define BOOST_HW_SIMD_ARM_NEON_VERSION BOOST_VERSION_NUMBER(1, 0, 0) + +#endif From 9a0d1235ebdaf5191c0c1596c4fd0b5669e25d50 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 20 Jul 2015 11:04:06 +0200 Subject: [PATCH 43/58] Refactor PPC SIMD detection + Add _VERSION(s) for PPC family --- include/boost/predef/hardware/simd/ppc.h | 53 +++++++++++++------ include/boost/predef/hardware/simd/ppc/qpx.h | 45 ---------------- .../boost/predef/hardware/simd/ppc/versions.h | 47 ++++++++++++++++ include/boost/predef/hardware/simd/ppc/vmx.h | 46 ---------------- include/boost/predef/hardware/simd/ppc/vsx.h | 45 ---------------- 5 files changed, 83 insertions(+), 153 deletions(-) delete mode 100644 include/boost/predef/hardware/simd/ppc/qpx.h create mode 100644 include/boost/predef/hardware/simd/ppc/versions.h delete mode 100644 include/boost/predef/hardware/simd/ppc/vmx.h delete mode 100644 include/boost/predef/hardware/simd/ppc/vsx.h diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index e664dce..4815d7a 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -6,11 +6,6 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -// From the newest to the oldest -#include -#include -#include - #ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_H #define BOOST_PREDEF_HARDWARE_SIMD_PPC_H @@ -19,26 +14,50 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_PPC`] - The SIMD extension for x86 (if detected). - Version number depends on the detected extension. - - BOOST_HW_SIMD_PPC is defined by the first detected extension. They are - checked from the newest to the oldest. (QPX -> VSX -> VMX) + The SIMD extension for PowerPC (if detected). + Version number depends on the most recent detected extension. [table [[__predef_symbol__] [__predef_version__]] - [[`BOOST_HW_SIMD_PPC`] [__predef_detection__]] - [[`BOOST_HW_SIMD_PPC`] [V.R.P]] + + [[`__VECTOR4DOUBLE__`] [__predef_detection__]] + + [[`__ALTIVEC__`] [__predef_detection__]] + [[`__VEC__`] [__predef_detection__]] + + [[`__VSX__`] [__predef_detection__]] + + + [[`__VECTOR4DOUBLE__`] [BOOST_HW_SIMD_PPC_QPX_VERSION]] + + [[`__ALTIVEC__`] [BOOST_HW_SIMD_PPC_VMX_VERSION]] + [[`__VEC__`] [BOOST_HW_SIMD_PPC_VMX_VERSION]] + + [[`__VSX__`] [BOOST_HW_SIMD_PPC_VSX_VERSION]] ] */ -#if defined(BOOST_HW_SIMD_PPC) -# define BOOST_HW_SIMD_PPC_AVAILABLE -#else -# define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_PPC_NAME "PowerPC SIMD" +#define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#undef BOOST_HW_SIMD_PPC +#if !defined(BOOST_HW_SIMD_PPC) && defined(__VECTOR4DOUBLE__) +# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_QPX_VERSION #endif +#if !defined(BOOST_HW_SIMD_PPC) && defined(__VSX__) +# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VSX_VERSION +#endif +#if !defined(BOOST_HW_SIMD_PPC) && (defined(__ALTIVEC__) || defined(__VEC__)) +# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VMX_VERSION +#endif + +#if !defined(BOOST_HW_SIMD_PPC) +# define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE +#else +# define BOOST_HW_SIMD_PPC_AVAILABLE +#endif + +#define BOOST_HW_SIMD_PPC_NAME "PPC SIMD" #endif diff --git a/include/boost/predef/hardware/simd/ppc/qpx.h b/include/boost/predef/hardware/simd/ppc/qpx.h deleted file mode 100644 index ff65141..0000000 --- a/include/boost/predef/hardware/simd/ppc/qpx.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_QPX_H -#define BOOST_PREDEF_HARDWARE_SIMD_PPC_QPX_H - -#include - -/*` - [heading `BOOST_HW_SIMD_PPC_QPX`] - - QPX powerpc extension. - Version number is: 2.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__VECTOR4DOUBLE__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__VECTOR4DOUBLE__) -# undef BOOST_HW_SIMD_PPC_QPX -# define BOOST_HW_SIMD_PPC_QPX BOOST_VERSION_NUMBER(2, 0, 0) -# define BOOST_HW_SIMD_PPC_QPX_AVAILABLE -#endif - -#define BOOST_HW_SIMD_PPC_QPX_NAME "PowerPC SIMD QPX" - -#if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_QPX_AVAILABLE) -# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_QPX -# define BOOST_HW_SIMD_PPC_NAME BOOST_HW_SIMD_PPC_QPX_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC_QPX, BOOST_HW_SIMD_PPC_QPX_NAME) diff --git a/include/boost/predef/hardware/simd/ppc/versions.h b/include/boost/predef/hardware/simd/ppc/versions.h new file mode 100644 index 0000000..3570e7a --- /dev/null +++ b/include/boost/predef/hardware/simd/ppc/versions.h @@ -0,0 +1,47 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H +#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H + +#include + +/*` + [heading `BOOST_HW_SIMD_PPC_*_VERSION`] + + [note Those defines represent Power PC SIMD extensions versions. You can + compare them with the predef BOOST_HW_SIMD_PPC.] + */ + +// --------------------------------- + +/*` + [heading `BOOST_HW_SIMD_PPC_VMX`] + + [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension. + Version number is: 1.0.0. + */ +#define BOOST_HW_SIMD_PPC_VMX_VERSION BOOST_VERSION_NUMBER(1, 0, 0) + +/*` + [heading `BOOST_HW_SIMD_PPC_VSX`] + + [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension. + Version number is: 1.1.0. + */ +#define BOOST_HW_SIMD_PPC_VSX_VERSION BOOST_VERSION_NUMBER(1, 1, 0) + +/*` + [heading `BOOST_HW_SIMD_PPC_QPX`] + + QPX powerpc extension. + Version number is: 2.0.0. + */ +#define BOOST_HW_SIMD_PPC_QPX_VERSION BOOST_VERSION_NUMBER(2, 0, 0) + +#endif diff --git a/include/boost/predef/hardware/simd/ppc/vmx.h b/include/boost/predef/hardware/simd/ppc/vmx.h deleted file mode 100644 index 176cc24..0000000 --- a/include/boost/predef/hardware/simd/ppc/vmx.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VMX_H -#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VMX_H - -#include - -/*` - [heading `BOOST_HW_SIMD_PPC_VMX`] - - [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension. - Version number is: 1.0.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__ALTIVEC__`] [__predef_detection__]] - [[`__VEC__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__ALTIVEC__) || defined(__VEC__) -# undef BOOST_HW_SIMD_PPC_VMX -# define BOOST_HW_SIMD_PPC_VMX BOOST_VERSION_NUMBER(1, 0, 0) -# define BOOST_HW_SIMD_PPC_VMX_AVAILABLE -#endif - -#define BOOST_HW_SIMD_PPC_VMX_NAME "PowerPC SIMD VMX" - -#if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_VMX_AVAILABLE) -# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VMX -# define BOOST_HW_SIMD_PPC_NAME BOOST_HW_SIMD_PPC_VMX_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC_VMX, BOOST_HW_SIMD_PPC_VMX_NAME) diff --git a/include/boost/predef/hardware/simd/ppc/vsx.h b/include/boost/predef/hardware/simd/ppc/vsx.h deleted file mode 100644 index c708ab5..0000000 --- a/include/boost/predef/hardware/simd/ppc/vsx.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright Charly Chevalier 2015 -Copyright Joel Falcou 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VSX_H -#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VSX_H - -#include - -/*` - [heading `BOOST_HW_SIMD_PPC_VSX`] - - [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension. - Version number is: 1.1.0. - - [table - [[__predef_symbol__] [__predef_version__]] - - [[`__VSX__`] [__predef_detection__]] - ] - */ - -#define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER_NOT_AVAILABLE - -#if defined(__VSX__) -# undef BOOST_HW_SIMD_PPC_VSX -# define BOOST_HW_SIMD_PPC_VSX BOOST_VERSION_NUMBER(1, 1, 0) -# define BOOST_HW_SIMD_PPC_VSX_AVAILABLE -#endif - -#define BOOST_HW_SIMD_PPC_VSX_NAME "PowerPC SIMD VSX" - -#if !defined(BOOST_HW_SIMD_PPC) && defined(BOOST_HW_SIMD_PPC_VSX_AVAILABLE) -# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VSX -# define BOOST_HW_SIMD_PPC_NAME BOOST_HW_SIMD_PPC_VSX_NAME -#endif - -#endif - -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC_VSX, BOOST_HW_SIMD_PPC_VSX_NAME) From afaad7f56bbb3a6be3d35bde0bb548c5ce1522a2 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 10:05:21 +0200 Subject: [PATCH 44/58] Better format for versions documentation --- .../boost/predef/hardware/simd/arm/versions.h | 8 +- .../boost/predef/hardware/simd/ppc/versions.h | 23 +++-- .../boost/predef/hardware/simd/x86/versions.h | 89 ++++++++++++------- .../predef/hardware/simd/x86_amd/versions.h | 15 ++-- 4 files changed, 85 insertions(+), 50 deletions(-) diff --git a/include/boost/predef/hardware/simd/arm/versions.h b/include/boost/predef/hardware/simd/arm/versions.h index ad15931..962a174 100644 --- a/include/boost/predef/hardware/simd/arm/versions.h +++ b/include/boost/predef/hardware/simd/arm/versions.h @@ -21,10 +21,12 @@ http://www.boost.org/LICENSE_1_0.txt) // --------------------------------- /*` - [heading `BOOST_HW_SIMD_ARM_NEON`] + [heading `BOOST_HW_SIMD_ARM_NEON_VERSION`] - [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON] ARM extension. - Version number is: 1.0.0. + The [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON] + ARM extension version number. + + Version number is: *1.0.0*. */ #define BOOST_HW_SIMD_ARM_NEON_VERSION BOOST_VERSION_NUMBER(1, 0, 0) diff --git a/include/boost/predef/hardware/simd/ppc/versions.h b/include/boost/predef/hardware/simd/ppc/versions.h index 3570e7a..ad9c61d 100644 --- a/include/boost/predef/hardware/simd/ppc/versions.h +++ b/include/boost/predef/hardware/simd/ppc/versions.h @@ -21,26 +21,31 @@ http://www.boost.org/LICENSE_1_0.txt) // --------------------------------- /*` - [heading `BOOST_HW_SIMD_PPC_VMX`] + [heading `BOOST_HW_SIMD_PPC_VMX_VERSION`] - [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension. - Version number is: 1.0.0. + The [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension + version number. + + Version number is: *1.0.0*. */ #define BOOST_HW_SIMD_PPC_VMX_VERSION BOOST_VERSION_NUMBER(1, 0, 0) /*` - [heading `BOOST_HW_SIMD_PPC_VSX`] + [heading `BOOST_HW_SIMD_PPC_VSX_VERSION`] - [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension. - Version number is: 1.1.0. + The [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension version + number. + + Version number is: *1.1.0*. */ #define BOOST_HW_SIMD_PPC_VSX_VERSION BOOST_VERSION_NUMBER(1, 1, 0) /*` - [heading `BOOST_HW_SIMD_PPC_QPX`] + [heading `BOOST_HW_SIMD_PPC_QPX_VERSION`] - QPX powerpc extension. - Version number is: 2.0.0. + The QPX powerpc extension version number. + + Version number is: *2.0.0*. */ #define BOOST_HW_SIMD_PPC_QPX_VERSION BOOST_VERSION_NUMBER(2, 0, 0) diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h index 98ab909..43c24f4 100644 --- a/include/boost/predef/hardware/simd/x86/versions.h +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -21,90 +21,115 @@ http://www.boost.org/LICENSE_1_0.txt) // --------------------------------- /*` - [heading `BOOST_HW_SIMD_X86_MMX`] + [heading `BOOST_HW_SIMD_X86_MMX_VERSION`] - [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension. - Version number is: 0.99.0. + The [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension + version number. + + Version number is: *0.99.0*. */ #define BOOST_HW_SIMD_X86_MMX_VERSION BOOST_VERSION_NUMBER(0, 99, 0) /*` [heading `BOOST_HW_SIMD_X86_SSE_VERSION`] - [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension. - Version number is: 1.0.0. + The [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension + version number. + + Version number is: *1.0.0*. */ #define BOOST_HW_SIMD_X86_SSE_VERSION BOOST_VERSION_NUMBER(1, 0, 0) /*` - [heading `BOOST_HW_SIMD_X86_SSE2`] + [heading `BOOST_HW_SIMD_X86_SSE2_VERSION`] - [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension. - Version number is: 2.0.0. + The [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension version number. + + Version number is: *2.0.0*. */ #define BOOST_HW_SIMD_X86_SSE2_VERSION BOOST_VERSION_NUMBER(2, 0, 0) /*` - [heading `BOOST_HW_SIMD_X86_SSE3`] + [heading `BOOST_HW_SIMD_X86_SSE3_VERSION`] - [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension. - Version number is: 3.0.0. + The [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension version number. + + Version number is: *3.0.0*. */ #define BOOST_HW_SIMD_X86_SSE3_VERSION BOOST_VERSION_NUMBER(3, 0, 0) /*` - [heading `BOOST_HW_SIMD_X86_SSSE3`] + [heading `BOOST_HW_SIMD_X86_SSSE3_VERSION`] - [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension. - Version number is: 3.1.0. + The [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension version number. + + Version number is: *3.1.0*. */ #define BOOST_HW_SIMD_X86_SSSE3_VERSION BOOST_VERSION_NUMBER(3, 1, 0) /*` - [heading `BOOST_HW_SIMD_X86_SSE4_1`] + [heading `BOOST_HW_SIMD_X86_SSE4_1_VERSION`] - [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension. - Version number is: 4.1.0. + The [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension version + number. + + Version number is: *4.1.0*. */ #define BOOST_HW_SIMD_X86_SSE4_1_VERSION BOOST_VERSION_NUMBER(4, 1, 0) /*` - [heading `BOOST_HW_SIMD_X86_SSE4_2`] + [heading `BOOST_HW_SIMD_X86_SSE4_2_VERSION`] - [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension. - Version number is: 4.1.0. + The [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension version + number. + + Version number is: *4.1.0*. */ #define BOOST_HW_SIMD_X86_SSE4_2_VERSION BOOST_VERSION_NUMBER(4, 2, 0) /*` - [heading `BOOST_HW_SIMD_X86_AVX`] + [heading `BOOST_HW_SIMD_X86_AVX_VERSION`] - [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86 extension. - Version number is: 5.0.0. Not available for version of MSVC below 16.00.40219. + The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86 + extension version number. + + Version number is: *5.0.0*. + + [note Not available for versions of MSVC below 16.00.40219.] */ #define BOOST_HW_SIMD_X86_AVX_VERSION BOOST_VERSION_NUMBER(5, 0, 0) /*` - [heading `BOOST_HW_SIMD_X86_FMA3`] + [heading `BOOST_HW_SIMD_X86_FMA3_VERSION`] - [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension. - Version number is: 5.2.0. Not available for version of MSVC below 17.00. + The [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension + version number. + + Version number is: *5.2.0*. + + [note Not available for versions of MSVC below 17.00.] */ #define BOOST_HW_SIMD_X86_FMA3_VERSION BOOST_VERSION_NUMBER(5, 2, 0) /*` - [heading `BOOST_HW_SIMD_X86_AVX2`] + [heading `BOOST_HW_SIMD_X86_AVX2_VERSION`] - [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] x86 extension. - Version number is: 5.3.0. Not available for version of MSVC below 17.00. + The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] + x86 extension version number. + + Version number is: *5.3.0*. + + [note Not available for versions of MSVC below 17.00.] */ #define BOOST_HW_SIMD_x86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0) /*` - [heading `BOOST_HW_SIMD_X86_MIC`] + [heading `BOOST_HW_SIMD_X86_MIC_VERSION`] - [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension. - Version number is: 6.0.0. + The [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension + version number. + + Version number is: *99.999.999*. */ #define BOOST_HW_SIMD_x86_MIC_VERSION BOOST_VERSION_NUMBER(99, 999, 999) diff --git a/include/boost/predef/hardware/simd/x86_amd/versions.h b/include/boost/predef/hardware/simd/x86_amd/versions.h index 4e430b5..4e1a727 100644 --- a/include/boost/predef/hardware/simd/x86_amd/versions.h +++ b/include/boost/predef/hardware/simd/x86_amd/versions.h @@ -21,26 +21,29 @@ http://www.boost.org/LICENSE_1_0.txt) // --------------------------------- /*` - [heading `BOOST_HW_SIMD_X86_SSE4A`] + [heading `BOOST_HW_SIMD_X86_SSE4A_VERSION`] [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). - Version number is: 4.0.0. + + Version number is: *4.0.0*. */ #define BOOST_HW_SIMD_x86_AMD_SSE4A_VERSION BOOST_VERSION_NUMBER(4, 0, 0) /*` - [heading `BOOST_HW_SIMD_X86_XOP`] + [heading `BOOST_HW_SIMD_X86_XOP_VERSION`] [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). - Version number is: 5.1.1. + + Version number is: *5.1.1*. */ #define BOOST_HW_SIMD_x86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0) /*` - [heading `BOOST_HW_SIMD_X86_XOP`] + [heading `BOOST_HW_SIMD_X86_XOP_VERSION`] [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). - Version number is: 5.1.1. + + Version number is: *5.1.1*. */ #define BOOST_HW_SIMD_x86_AMD_XOP_VERSION BOOST_VERSION_NUMBER(5, 1, 1) From 3d96ad842f27b4bdff92783b9f4efc49f9f0c13d Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 10:07:53 +0200 Subject: [PATCH 45/58] Better formatting of tables + Improve brief SIMD family description --- include/boost/predef/hardware/simd.h | 3 ++- include/boost/predef/hardware/simd/arm.h | 9 +++++--- .../boost/predef/hardware/simd/arm/versions.h | 5 ++-- include/boost/predef/hardware/simd/ppc.h | 7 ++++-- .../boost/predef/hardware/simd/ppc/versions.h | 5 ++-- include/boost/predef/hardware/simd/x86.h | 6 +++-- .../boost/predef/hardware/simd/x86/versions.h | 5 ++-- include/boost/predef/hardware/simd/x86_amd.h | 23 ++++++++++++++----- .../predef/hardware/simd/x86_amd/versions.h | 6 ++--- 9 files changed, 43 insertions(+), 26 deletions(-) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index bb91a7a..3a41b60 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -24,9 +24,10 @@ http://www.boost.org/LICENSE_1_0.txt) [table [[__predef_symbol__] [__predef_version__]] + [[`BOOST_HW_SIMD_X86_AVAILABLE`] [__predef_detection__]] + [[`BOOST_HW_SIMD_X86_AMD_AVAILABLE`] [__predef_detection__]] [[`BOOST_HW_SIMD_ARM_AVAILABLE`] [__predef_detection__]] [[`BOOST_HW_SIMD_PPC_AVAILABLE`] [__predef_detection__]] - [[`BOOST_HW_SIMD_X86_AVAILABLE`] [__predef_detection__]] ] */ diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index a2b802a..d067c93 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -15,22 +15,25 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_ARM`] - The SIMD extension for ARM (if detected). + The SIMD extension for ARM (*if detected*). Version number depends on the most recent detected extension. [table [[__predef_symbol__] [__predef_version__]] - - [[__predef_detection__] [__predef_detection__]] + [[`__ARM_NEON__`] [__predef_detection__]] [[`__aarch64__`] [__predef_detection__]] [[`_M_ARM`] [__predef_detection__]] + ] + [table + [[__predef_symbol__] [__predef_version__]] [[`__ARM_NEON__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] [[`__aarch64__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] [[`_M_ARM`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] ] + */ #define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE diff --git a/include/boost/predef/hardware/simd/arm/versions.h b/include/boost/predef/hardware/simd/arm/versions.h index 962a174..8425b31 100644 --- a/include/boost/predef/hardware/simd/arm/versions.h +++ b/include/boost/predef/hardware/simd/arm/versions.h @@ -12,10 +12,9 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` - [heading `BOOST_HW_SIMD_ARM_*_VERSION`] + Those defines represent ARM SIMD extensions versions. - [note Those defines represent ARM SIMD extensions versions. You can - compare them with the predef BOOST_HW_SIMD_ARM.] + [note You *MUST* compare them with the predef `BOOST_HW_SIMD_ARM`.] */ // --------------------------------- diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index 4815d7a..f5d0564 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -14,20 +14,22 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_PPC`] - The SIMD extension for PowerPC (if detected). + The SIMD extension for PowerPC (*if detected*). Version number depends on the most recent detected extension. [table [[__predef_symbol__] [__predef_version__]] - [[`__VECTOR4DOUBLE__`] [__predef_detection__]] [[`__ALTIVEC__`] [__predef_detection__]] [[`__VEC__`] [__predef_detection__]] [[`__VSX__`] [__predef_detection__]] + ] + [table + [[__predef_symbol__] [__predef_version__]] [[`__VECTOR4DOUBLE__`] [BOOST_HW_SIMD_PPC_QPX_VERSION]] @@ -36,6 +38,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__VSX__`] [BOOST_HW_SIMD_PPC_VSX_VERSION]] ] + */ #define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE diff --git a/include/boost/predef/hardware/simd/ppc/versions.h b/include/boost/predef/hardware/simd/ppc/versions.h index ad9c61d..ffe3f0b 100644 --- a/include/boost/predef/hardware/simd/ppc/versions.h +++ b/include/boost/predef/hardware/simd/ppc/versions.h @@ -12,10 +12,9 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` - [heading `BOOST_HW_SIMD_PPC_*_VERSION`] + Those defines represent Power PC SIMD extensions versions. - [note Those defines represent Power PC SIMD extensions versions. You can - compare them with the predef BOOST_HW_SIMD_PPC.] + [note You *MUST* compare them with the predef `BOOST_HW_SIMD_PPC`.] */ // --------------------------------- diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 9856c63..bbb0b40 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -16,13 +16,12 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_X86`] - The SIMD extension for x86 (if detected). + The SIMD extension for x86 (*if detected*). Version number depends on the most recent detected extension. [table [[__predef_symbol__] [__predef_version__]] - [[`__SSE__`] [__predef_detection__]] [[`_M_X64`] [__predef_detection__]] [[`_M_IX86_FP >= 1`] [__predef_detection__]] @@ -44,7 +43,10 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__FMA__`] [__predef_detection__]] [[`__AVX2__`] [__predef_detection__]] + ] + [table + [[__predef_symbol__] [__predef_version__]] [[`__SSE__`] [BOOST_HW_SIMD_X86_SSE_VERSION]] [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE_VERSION]] diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h index 43c24f4..5a9ce31 100644 --- a/include/boost/predef/hardware/simd/x86/versions.h +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -12,10 +12,9 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` - [heading `BOOST_HW_SIMD_X86_*_VERSION`] + Those defines represent x86 SIMD extensions versions. - [note Those defines represent x86 SIMD extensions versions. You can - compare them with the predef BOOST_HW_SIMD_X86.] + [note You *MUST* compare them with the predef `BOOST_HW_SIMD_X86`.] */ // --------------------------------- diff --git a/include/boost/predef/hardware/simd/x86_amd.h b/include/boost/predef/hardware/simd/x86_amd.h index 7fea531..ff0dd3f 100644 --- a/include/boost/predef/hardware/simd/x86_amd.h +++ b/include/boost/predef/hardware/simd/x86_amd.h @@ -16,13 +16,20 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_HW_SIMD_X86_AMD`] - The SIMD extension for x86 (AMD) (if detected). + The SIMD extension for x86 (AMD) (*if detected*). Version number depends on the most recent detected extension. - [note This predef includes every other x86 SIMD extensions and also has other - more specific extensions (FMA4, XOP, SSE4a). You should use this predef - instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have - been detected.] + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4A__`] [__predef_detection__]] + + [[`__FMA4__`] [__predef_detection__]] + + [[`__XOP__`] [__predef_detection__]] + + [[`BOOST_HW_SIMD_X86`] [__predef_detection__]] + ] [table [[__predef_symbol__] [__predef_version__]] @@ -36,7 +43,11 @@ http://www.boost.org/LICENSE_1_0.txt) [[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_x86]] ] - [include x86_amd/versions.h] + [note This predef includes every other x86 SIMD extensions and also has other + more specific extensions (FMA4, XOP, SSE4a). You should use this predef + instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have + been detected.] + */ #define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE diff --git a/include/boost/predef/hardware/simd/x86_amd/versions.h b/include/boost/predef/hardware/simd/x86_amd/versions.h index 4e1a727..cb4c59e 100644 --- a/include/boost/predef/hardware/simd/x86_amd/versions.h +++ b/include/boost/predef/hardware/simd/x86_amd/versions.h @@ -12,12 +12,12 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` - [heading `BOOST_HW_SIMD_X86_AMD_*_VERSION`] + Those defines represent x86 (AMD specific) SIMD extensions versions. - [note Those defines represent x86 (AMD specific) SIMD extensions versions. You - can compare them with the predef BOOST_HW_SIMD_X86_AMD.] + [note You *MUST* compare them with the predef `BOOST_HW_SIMD_X86_AMD`.] */ + // --------------------------------- /*` From adc3dbd4e2fa197574aa02d97c0341a4f653f392 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 10:15:35 +0200 Subject: [PATCH 46/58] Add main documentation The SIMD documentation is in the BOOST_HW_SIMD_* reference instead of in the main page --- doc/hardware_simd.qbk | 89 ++++++++++++++++++++++++ doc/predef.qbk | 89 ++---------------------- include/boost/predef/hardware/simd.h | 34 +++++++++ include/boost/predef/hardware/simd/x86.h | 1 - 4 files changed, 127 insertions(+), 86 deletions(-) create mode 100644 doc/hardware_simd.qbk diff --git a/doc/hardware_simd.qbk b/doc/hardware_simd.qbk new file mode 100644 index 0000000..c613310 --- /dev/null +++ b/doc/hardware_simd.qbk @@ -0,0 +1,89 @@ +SIMD predefs depend on compiler options. For example, you will have to add the +option `-msse3` to clang or gcc to enable SSE3. SIMD predefs are also inclusive. +This means that if SSE3 is enabled, then every other extensions with a lower +version number will implicitly be enabled and detected. However, some extensions +are CPU specific, they may not be detected nor enabled when an upper version is +enabled. + +[note SSE(1) and SSE2 are automatically enabled by default when using x86-64 +architecture.] + +To check if any SIMD extension has been enabled, you can use: + +`` +#include +#include + +int main() +{ +#if defined(BOOST_HW_SIMD_AVAILABLE) + std::cout << "SIMD detected!" << std::endl; +#endif + return 0; +} +`` + +When writing SIMD specific code, you may want to check if a particular extension +has been detected. To do so you have to use the right architecture predef and +compare it. Those predef are of the form `BOOST_HW_SIMD_"ARCH"` (where `"ARCH"` +is either `ARM`, `PPC`, or `X86`). For example, if you compile code for x86 +architecture, you will have to use `BOOST_HW_SIMD_X86`. Its value will be the +version number of the most recent SIMD extension detected for the architecture. + +To check if an extension has been enabled: + +`` +#include +#include + +int main() +{ +#if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE3_VERSION + std::cout << "This is SSE3!" << std::endl; +#endif + return 0; +} +`` + +[note The *_VERSION* defines that map version number to actual real +identifiers. This way it is easier to write comparisons without messing up with +version numbers.] + +To *"stricly"* check the most recent detected extension: + +`` +#include +#include + +int main() +{ +#if BOOST_HW_SIMD_X86 == BOOST_HW_SIMD_X86_SSE3_VERSION + std::cout << "This is SSE3 and this is the most recent enabled extension!" + << std::endl; +#endif + return 0; +} +`` + +Because of the version systems of predefs and of the inclusive property of SIMD +extensions macros, you can easily check for ranges of supported extensions: + +`` +#include +#include + +int main() +{ +#if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION &&\ + BOOST_HW_SIMD_X86 <= BOOST_HW_SIMD_X86_SSSE3_VERSION + std::cout << "This is SSE2, SSE3 and SSSE3!" << std::endl; +#endif + return 0; +} +`` + +[note Unlike gcc and clang, Visual Studio does not allow you to specify precisely +the SSE variants you want to use, the only detections that will take place are +SSE, SSE2, AVX and AVX2. For more informations, + see [@https://msdn.microsoft.com/en-us/library/b0084kay.aspx here].] + diff --git a/doc/predef.qbk b/doc/predef.qbk index 7fa914c..bca255d 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -229,91 +229,6 @@ name of what the detection is. [heading The `BOOST_HW_SIMD_*` predefs] -SIMD predefs depend on compiler options. For example, you will have to add the -option `-msse3` to clang or gcc to enable SSE3. SIMD predefs are also inclusive. -This means that if SSE3 is enabled, then every other extensions with a lower -version number will implicitly be enabled and detected. However, some extensions -are CPU specific, they may not be detected nor enabled when an upper version is -enabled. - -[note SSE(1) and SSE2 are automatically enabled by default when using x86-64 -architecture.] - -To check if any SIMD extension has been enabled, you can use: - -`` - #include - #include - - int main() - { -#if defined(BOOST_HW_SIMD_AVAILABLE) - std::cout << "SIMD detected!" << std::endl; -#endif - return 0; - } -`` - -When writing SIMD specific code, you may want to check if a particular extension -has been detected. To do so you have to use the right architecture predef and -compare it. Those predef are of the form `BOOST_HW_SIMD_"ARCH"` (where `"ARCH"` -is either `ARM`, `PPC`, or `X86`). For example, if you compile code for x86 -architecture, you will have to use `BOOST_HW_SIMD_X86`. Its value will be the -version number of the most recent SIMD extension detected for the architecture. - -To check if an extension has been enabled: - -`` - #include - #include - - int main() - { -#if defined(BOOST_HW_SIMD_X86_SSE3_AVAILABLE) - std::cout << "This is SSE3!" << std::endl; -#endif - return 0; - } -`` - -To "stricly" check the most recent detected extension: - -`` - #include - #include - - int main() - { -#if BOOST_HW_SIMD_X86 == BOOST_HW_SIMD_X86_SSE3 - std::cout << "This is SSE3 and this is the most recent enabled extension!" - << std::endl; -#endif - return 0; - } -`` - -Because of the version systems of predefs and of the inclusive property of SIMD -extensions macros, you can easily check for ranges of supported extensions: - -`` - #include - #include - - int main() - { -#if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2 &&\ - BOOST_HW_SIMD_X86 <= BOOST_HW_SIMD_X86_SSSE3 - std::cout << "This is SSE2, SSE3 and SSSE3!" << std::endl; -#endif - return 0; - } -`` - -[note Unlike gcc and clang, Visual Studio does not allow you to specify precisely -the SSE variants you want to use, the only detections that will take place are -SSE, SSE2, AVX and AVX2. For more informations, -see [@https://msdn.microsoft.com/en-us/library/b0084kay.aspx here]. - [heading The `*_EMULATED` macros] Predef definitions are guaranteed to be uniquely detected within one category. @@ -638,6 +553,10 @@ and "Y", "M", "D" for dates. [include ../include/boost/predef/platform/*.h] [endsect] +[section `BOOST_HW_SIMD` hardware SIMD macros] +[include ../include/boost/predef/hardware/simd.h] +[endsect] + [section Other macros] [include ../include/boost/predef/other/*.h] [endsect] diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index 3a41b60..b98f60c 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -16,6 +16,14 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` + [section Using the `BOOST_HW_SIMD_*` predefs] + [include ../doc/hardware_simd.qbk] + [endsect] + + [/ --------------------------- ] + + [section `BOOST_HW_SIMD_*`] + [heading `BOOST_HW_SIMD`] The SIMD extension detected for a specific architectures. @@ -29,6 +37,32 @@ http://www.boost.org/LICENSE_1_0.txt) [[`BOOST_HW_SIMD_ARM_AVAILABLE`] [__predef_detection__]] [[`BOOST_HW_SIMD_PPC_AVAILABLE`] [__predef_detection__]] ] + + [include ../include/boost/predef/hardware/simd/x86.h] + [include ../include/boost/predef/hardware/simd/x86_amd.h] + [include ../include/boost/predef/hardware/simd/arm.h] + [include ../include/boost/predef/hardware/simd/ppc.h] + + [endsect] + + [/ --------------------------- ] + + [section `BOOST_HW_SIMD_X86_*_VERSION`] + [include ../include/boost/predef/hardware/simd/x86/versions.h] + [endsect] + + [section `BOOST_HW_SIMD_X86_AMD_*_VERSION`] + [include ../include/boost/predef/hardware/simd/x86_amd/versions.h] + [endsect] + + [section `BOOST_HW_SIMD_ARM_*_VERSION`] + [include ../include/boost/predef/hardware/simd/arm/versions.h] + [endsect] + + [section `BOOST_HW_SIMD_PPC_*_VERSION`] + [include ../include/boost/predef/hardware/simd/ppc/versions.h] + [endsect] + */ // We check if SIMD extension of multiples architectures have been detected, diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index bbb0b40..2c8db0f 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -71,7 +71,6 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__AVX2__`] [BOOST_HW_SIMD_x86_AVX2_VERSION]] ] - [include x86/versions.h] */ #define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE From a4b32af636fe3c1a014061901ef11d2697bacf53 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 14:50:54 +0200 Subject: [PATCH 47/58] Add missing x86_amd.h to simd.h --- include/boost/predef/hardware/simd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index b98f60c..b961a82 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -7,6 +7,7 @@ http://www.boost.org/LICENSE_1_0.txt) */ #include +#include #include #include From 0b90b9f19b1f7cedaf8ef948d6335c7dff0802b0 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 14:51:31 +0200 Subject: [PATCH 48/58] Add missing ppc/versions.h to ppc.h --- include/boost/predef/hardware/simd/ppc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/predef/hardware/simd/ppc.h b/include/boost/predef/hardware/simd/ppc.h index f5d0564..eef25c2 100644 --- a/include/boost/predef/hardware/simd/ppc.h +++ b/include/boost/predef/hardware/simd/ppc.h @@ -10,6 +10,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_HARDWARE_SIMD_PPC_H #include +#include /*` [heading `BOOST_HW_SIMD_PPC`] From 2ae1123abfcc92122f4505ed0ca4914dfc1d95f2 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 14:51:58 +0200 Subject: [PATCH 49/58] x86 -> X86 (in macro names) --- include/boost/predef/hardware/simd/x86/versions.h | 4 ++-- include/boost/predef/hardware/simd/x86_amd/versions.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h index 5a9ce31..77dc104 100644 --- a/include/boost/predef/hardware/simd/x86/versions.h +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -120,7 +120,7 @@ http://www.boost.org/LICENSE_1_0.txt) [note Not available for versions of MSVC below 17.00.] */ -#define BOOST_HW_SIMD_x86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0) +#define BOOST_HW_SIMD_X86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0) /*` [heading `BOOST_HW_SIMD_X86_MIC_VERSION`] @@ -130,6 +130,6 @@ http://www.boost.org/LICENSE_1_0.txt) Version number is: *99.999.999*. */ -#define BOOST_HW_SIMD_x86_MIC_VERSION BOOST_VERSION_NUMBER(99, 999, 999) +#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER(99, 999, 999) #endif diff --git a/include/boost/predef/hardware/simd/x86_amd/versions.h b/include/boost/predef/hardware/simd/x86_amd/versions.h index cb4c59e..835a998 100644 --- a/include/boost/predef/hardware/simd/x86_amd/versions.h +++ b/include/boost/predef/hardware/simd/x86_amd/versions.h @@ -27,7 +27,7 @@ http://www.boost.org/LICENSE_1_0.txt) Version number is: *4.0.0*. */ -#define BOOST_HW_SIMD_x86_AMD_SSE4A_VERSION BOOST_VERSION_NUMBER(4, 0, 0) +#define BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION BOOST_VERSION_NUMBER(4, 0, 0) /*` [heading `BOOST_HW_SIMD_X86_XOP_VERSION`] @@ -36,7 +36,7 @@ http://www.boost.org/LICENSE_1_0.txt) Version number is: *5.1.1*. */ -#define BOOST_HW_SIMD_x86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0) +#define BOOST_HW_SIMD_X86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0) /*` [heading `BOOST_HW_SIMD_X86_XOP_VERSION`] @@ -45,7 +45,7 @@ http://www.boost.org/LICENSE_1_0.txt) Version number is: *5.1.1*. */ -#define BOOST_HW_SIMD_x86_AMD_XOP_VERSION BOOST_VERSION_NUMBER(5, 1, 1) +#define BOOST_HW_SIMD_X86_AMD_XOP_VERSION BOOST_VERSION_NUMBER(5, 1, 1) #endif From e566ad33ce4331b0ee9e8f24cfa6eb6cfce94d08 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 14:53:12 +0200 Subject: [PATCH 50/58] Reorder x86 AMD SIMD extension detection --- include/boost/predef/hardware/simd/x86_amd.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86_amd.h b/include/boost/predef/hardware/simd/x86_amd.h index ff0dd3f..b46c949 100644 --- a/include/boost/predef/hardware/simd/x86_amd.h +++ b/include/boost/predef/hardware/simd/x86_amd.h @@ -57,14 +57,14 @@ http://www.boost.org/LICENSE_1_0.txt) // common extensions. #undef BOOST_HW_SIMD_X86_AMD -#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__) -# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION +#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__) +# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION #endif #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__FMA4__) # define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_FMA4_VERSION #endif -#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__) -# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION +#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__) +# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION #endif #if !defined(BOOST_HW_SIMD_X86_AMD) From 10601dbaf83df465ceb39c8bec137fac78e64f86 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 14:55:56 +0200 Subject: [PATCH 51/58] Includes clean up --- include/boost/predef/hardware/simd/x86_amd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/boost/predef/hardware/simd/x86_amd.h b/include/boost/predef/hardware/simd/x86_amd.h index b46c949..30f8f54 100644 --- a/include/boost/predef/hardware/simd/x86_amd.h +++ b/include/boost/predef/hardware/simd/x86_amd.h @@ -11,7 +11,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include -#include /*` [heading `BOOST_HW_SIMD_X86_AMD`] From 557649450073a9a0c11219894b37d25f46f6fb7b Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 14:56:12 +0200 Subject: [PATCH 52/58] Add missing BOOST_HW_SIMD_X86_AMD_AVAILABLE predef --- include/boost/predef/hardware/simd/x86_amd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/predef/hardware/simd/x86_amd.h b/include/boost/predef/hardware/simd/x86_amd.h index 30f8f54..60fd448 100644 --- a/include/boost/predef/hardware/simd/x86_amd.h +++ b/include/boost/predef/hardware/simd/x86_amd.h @@ -76,6 +76,7 @@ http://www.boost.org/LICENSE_1_0.txt) # undef BOOST_HW_SIMD_X86_AMD # define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86 # endif +# define BOOST_HW_SIMD_X86_AMD_AVAILABLE #endif #define BOOST_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD" From 5fd655b198aca0537e9ec82d5356ced13544f630 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 15:27:37 +0200 Subject: [PATCH 53/58] Remove superfluous (old) documentation --- doc/predef.qbk | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/predef.qbk b/doc/predef.qbk index bca255d..debd1aa 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -227,8 +227,6 @@ detected. I.e. a definition equivalent to: Also for each aspect there is a macro defined with a descriptive name of what the detection is. -[heading The `BOOST_HW_SIMD_*` predefs] - [heading The `*_EMULATED` macros] Predef definitions are guaranteed to be uniquely detected within one category. From e3e95a59ee3342e0f8eb3e12b0f40844341cd490 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 15:35:43 +0200 Subject: [PATCH 54/58] Update doc (BOOST_HW_SIMD section -> BOOST_HW section) --- doc/predef.qbk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/predef.qbk b/doc/predef.qbk index debd1aa..2eb5ecc 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -551,8 +551,8 @@ and "Y", "M", "D" for dates. [include ../include/boost/predef/platform/*.h] [endsect] -[section `BOOST_HW_SIMD` hardware SIMD macros] -[include ../include/boost/predef/hardware/simd.h] +[section `BOOST_HW` hardware macros] +[include ../include/boost/predef/hardware/*.h] [endsect] [section Other macros] From 93833f6e9e2627e7ac69ae91c54ba7f9707886f3 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 20:04:40 +0200 Subject: [PATCH 55/58] Fix wrong version numbers --- include/boost/predef/hardware/simd/x86/versions.h | 6 +++--- include/boost/predef/hardware/simd/x86_amd/versions.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h index 77dc104..b7eb48e 100644 --- a/include/boost/predef/hardware/simd/x86/versions.h +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -82,7 +82,7 @@ http://www.boost.org/LICENSE_1_0.txt) The [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension version number. - Version number is: *4.1.0*. + Version number is: *4.2.0*. */ #define BOOST_HW_SIMD_X86_SSE4_2_VERSION BOOST_VERSION_NUMBER(4, 2, 0) @@ -128,8 +128,8 @@ http://www.boost.org/LICENSE_1_0.txt) The [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension version number. - Version number is: *99.999.999*. + Version number is: *99.99.99999*. */ -#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER(99, 999, 999) +#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER_MAX #endif diff --git a/include/boost/predef/hardware/simd/x86_amd/versions.h b/include/boost/predef/hardware/simd/x86_amd/versions.h index 835a998..a0a9e91 100644 --- a/include/boost/predef/hardware/simd/x86_amd/versions.h +++ b/include/boost/predef/hardware/simd/x86_amd/versions.h @@ -34,7 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). - Version number is: *5.1.1*. + Version number is: *5.1.0*. */ #define BOOST_HW_SIMD_X86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0) From 7fefba479cf074c1a211b5ba88c14f7988f489c1 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 21 Jul 2015 20:29:25 +0200 Subject: [PATCH 56/58] Update BOOST_HW_SIMD_X86_MIC_VERSION version number (max -> 9.0.0) --- include/boost/predef/hardware/simd/x86/versions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h index b7eb48e..3c64ea5 100644 --- a/include/boost/predef/hardware/simd/x86/versions.h +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -128,8 +128,8 @@ http://www.boost.org/LICENSE_1_0.txt) The [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension version number. - Version number is: *99.99.99999*. + Version number is: *9.0.0*. */ -#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER_MAX +#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER(9, 0, 0) #endif From 1af46e66dfccd2fbeb9640b68415c3c57050f196 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 31 Jul 2015 10:53:45 +0200 Subject: [PATCH 57/58] Add missing _X86_AMD detection for BOOST_HW_SIMD + Unique name --- include/boost/predef/hardware/simd.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index b961a82..4de1e70 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -68,6 +68,9 @@ http://www.boost.org/LICENSE_1_0.txt) // We check if SIMD extension of multiples architectures have been detected, // if yes, then this is an error! +// +// NOTE: _X86_AMD implies _X86, so there is no need to check for it here! +// #if defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_PPC_AVAILABLE) ||\ defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE) ||\ defined(BOOST_HW_SIMD_PPC_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE) @@ -76,26 +79,28 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(BOOST_HW_SIMD_X86_AVAILABLE) # define BOOST_HW_SIMD BOOST_HW_SIMD_X86 -# define BOOST_HW_SIMD_NAME BOOST_HW_SIMD_X86_NAME +#endif + +#if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD #endif #if defined(BOOST_HW_SIMD_ARM_AVAILABLE) # define BOOST_HW_SIMD BOOST_HW_SIMD_ARM -# define BOOST_HW_SIMD_NAME BOOST_HW_SIMD_ARM_NAME #endif #if defined(BOOST_HW_SIMD_PPC_AVAILABLE) # define BOOST_HW_SIMD BOOST_HW_SIMD_PPC -# define BOOST_HW_SIMD_NAME BOOST_HW_SIMD_PPC_NAME #endif #if defined(BOOST_HW_SIMD) # define BOOST_HW_SIMD_AVAILABLE #else # define BOOST_HW_SIMD BOOST_VERSION_NUMBER_NOT_AVAILABLE -# define BOOST_HW_SIMD_NAME "Hardware SIMD" #endif +#define BOOST_HW_SIMD_NAME "Hardware SIMD" + #endif #include From 3dc66cd71f4eb932be39337237336f572f729a1e Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 4 Aug 2015 11:57:06 +0200 Subject: [PATCH 58/58] Remove extra check (of MSVC version) for FMA/AVX/AVX2 for now --- include/boost/predef/hardware/simd/x86.h | 16 +++------------- .../boost/predef/hardware/simd/x86/versions.h | 6 ------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/include/boost/predef/hardware/simd/x86.h b/include/boost/predef/hardware/simd/x86.h index 2c8db0f..0874bc4 100644 --- a/include/boost/predef/hardware/simd/x86.h +++ b/include/boost/predef/hardware/simd/x86.h @@ -11,7 +11,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include -#include /*` [heading `BOOST_HW_SIMD_X86`] @@ -80,22 +79,13 @@ http://www.boost.org/LICENSE_1_0.txt) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MIC_VERSION #endif #if !defined(BOOST_HW_SIMD_X86) && defined(__AVX2__) -# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0) ||\ - !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2_VERSION -# endif +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2_VERSION #endif #if !defined(BOOST_HW_SIMD_X86) && defined(__AVX__) -# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(16, 0, 40219) ||\ - !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX_VERSION -# endif +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX_VERSION #endif #if !defined(BOOST_HW_SIMD_X86) && defined(__FMA__) -# if defined(BOOST_COMP_MSVC_AVAILABLE) && BOOST_COMP_MSVC > BOOST_VERSION_NUMBER(17, 0, 0) ||\ - !defined(BOOST_COMP_MSVC_AVAILABLE) -# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_FMA_VERSION -# endif +# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_FMA_VERSION #endif #if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_2__) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2_VERSION diff --git a/include/boost/predef/hardware/simd/x86/versions.h b/include/boost/predef/hardware/simd/x86/versions.h index 3c64ea5..0c7a4d3 100644 --- a/include/boost/predef/hardware/simd/x86/versions.h +++ b/include/boost/predef/hardware/simd/x86/versions.h @@ -93,8 +93,6 @@ http://www.boost.org/LICENSE_1_0.txt) extension version number. Version number is: *5.0.0*. - - [note Not available for versions of MSVC below 16.00.40219.] */ #define BOOST_HW_SIMD_X86_AVX_VERSION BOOST_VERSION_NUMBER(5, 0, 0) @@ -105,8 +103,6 @@ http://www.boost.org/LICENSE_1_0.txt) version number. Version number is: *5.2.0*. - - [note Not available for versions of MSVC below 17.00.] */ #define BOOST_HW_SIMD_X86_FMA3_VERSION BOOST_VERSION_NUMBER(5, 2, 0) @@ -117,8 +113,6 @@ http://www.boost.org/LICENSE_1_0.txt) x86 extension version number. Version number is: *5.3.0*. - - [note Not available for versions of MSVC below 17.00.] */ #define BOOST_HW_SIMD_X86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0)