Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:48:05

0001 /*
0002 Copyright Charly Chevalier 2015
0003 Copyright Joel Falcou 2015
0004 Distributed under the Boost Software License, Version 1.0.
0005 (See accompanying file LICENSE_1_0.txt or copy at
0006 http://www.boost.org/LICENSE_1_0.txt)
0007 */
0008 
0009 #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H
0010 #define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H
0011 
0012 #include <boost/predef/version_number.h>
0013 #include <boost/predef/hardware/simd/x86_amd/versions.h>
0014 
0015 /* tag::reference[]
0016 = `BOOST_HW_SIMD_X86_AMD`
0017 
0018 The SIMD extension for x86 (AMD) (*if detected*).
0019 Version number depends on the most recent detected extension.
0020 
0021 [options="header"]
0022 |===
0023 | {predef_symbol} | {predef_version}
0024 
0025 | `+__SSE4A__+` | {predef_detection}
0026 
0027 | `+__FMA4__+` | {predef_detection}
0028 
0029 | `+__XOP__+` | {predef_detection}
0030 
0031 | `BOOST_HW_SIMD_X86` | {predef_detection}
0032 |===
0033 
0034 [options="header"]
0035 |===
0036 | {predef_symbol} | {predef_version}
0037 
0038 | `+__SSE4A__+` | BOOST_HW_SIMD_X86_SSE4A_VERSION
0039 
0040 | `+__FMA4__+` | BOOST_HW_SIMD_X86_FMA4_VERSION
0041 
0042 | `+__XOP__+` | BOOST_HW_SIMD_X86_XOP_VERSION
0043 
0044 | `BOOST_HW_SIMD_X86` | BOOST_HW_SIMD_X86
0045 |===
0046 
0047 NOTE: This predef includes every other x86 SIMD extensions and also has other
0048 more specific extensions (FMA4, XOP, SSE4a). You should use this predef
0049 instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have
0050 been detected.
0051 
0052 */ // end::reference[]
0053 
0054 #define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
0055 
0056 // AMD CPUs also use x86 architecture. We first try to detect if any AMD
0057 // specific extension are detected, if yes, then try to detect more recent x86
0058 // common extensions.
0059 
0060 #undef BOOST_HW_SIMD_X86_AMD
0061 #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__)
0062 #   define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION
0063 #endif
0064 #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__FMA4__)
0065 #   define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_FMA4_VERSION
0066 #endif
0067 #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__)
0068 #   define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION
0069 #endif
0070 
0071 #if !defined(BOOST_HW_SIMD_X86_AMD)
0072 #   define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
0073 #else
0074     // At this point, we know that we have an AMD CPU, we do need to check for
0075     // other x86 extensions to determine the final version number.
0076 #   include <boost/predef/hardware/simd/x86.h>
0077 #   if BOOST_HW_SIMD_X86 > BOOST_HW_SIMD_X86_AMD
0078 #      undef BOOST_HW_SIMD_X86_AMD
0079 #      define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86
0080 #   endif
0081 #   define BOOST_HW_SIMD_X86_AMD_AVAILABLE
0082 #endif
0083 
0084 #define BOOST_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD"
0085 
0086 #endif
0087 
0088 #include <boost/predef/detail/test.h>
0089 BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AMD, BOOST_HW_SIMD_X86_AMD_NAME)