MessagePack for C
include
msgpack
predef
hardware
simd
x86_amd.h
Go to the documentation of this file.
1
/*
2
Copyright Charly Chevalier 2015
3
Copyright Joel Falcou 2015
4
Distributed under the Boost Software License, Version 1.0.
5
(See accompanying file LICENSE_1_0.txt or copy at
6
http://www.boost.org/LICENSE_1_0.txt)
7
*/
8
9
#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_X86_AMD_H
10
#define MSGPACK_PREDEF_HARDWARE_SIMD_X86_AMD_H
11
12
#include <
msgpack/predef/version_number.h
>
13
#include <
msgpack/predef/hardware/simd/x86_amd/versions.h
>
14
15
/*`
16
[heading `MSGPACK_HW_SIMD_X86_AMD`]
17
18
The SIMD extension for x86 (AMD) (*if detected*).
19
Version number depends on the most recent detected extension.
20
21
[table
22
[[__predef_symbol__] [__predef_version__]]
23
24
[[`__SSE4A__`] [__predef_detection__]]
25
26
[[`__FMA4__`] [__predef_detection__]]
27
28
[[`__XOP__`] [__predef_detection__]]
29
30
[[`MSGPACK_HW_SIMD_X86`] [__predef_detection__]]
31
]
32
33
[table
34
[[__predef_symbol__] [__predef_version__]]
35
36
[[`__SSE4A__`] [MSGPACK_HW_SIMD_X86_SSE4A_VERSION]]
37
38
[[`__FMA4__`] [MSGPACK_HW_SIMD_X86_FMA4_VERSION]]
39
40
[[`__XOP__`] [MSGPACK_HW_SIMD_X86_XOP_VERSION]]
41
42
[[`MSGPACK_HW_SIMD_X86`] [MSGPACK_HW_SIMD_X86]]
43
]
44
45
[note This predef includes every other x86 SIMD extensions and also has other
46
more specific extensions (FMA4, XOP, SSE4a). You should use this predef
47
instead of `MSGPACK_HW_SIMD_X86` to test if those specific extensions have
48
been detected.]
49
50
*/
51
52
#define MSGPACK_HW_SIMD_X86_AMD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
53
54
// AMD CPUs also use x86 architecture. We first try to detect if any AMD
55
// specific extension are detected, if yes, then try to detect more recent x86
56
// common extensions.
57
58
#undef MSGPACK_HW_SIMD_X86_AMD
59
#if !defined(MSGPACK_HW_SIMD_X86_AMD) && defined(__XOP__)
60
# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86_AMD_XOP_VERSION
61
#endif
62
#if !defined(MSGPACK_HW_SIMD_X86_AMD) && defined(__FMA4__)
63
# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86_AMD_FMA4_VERSION
64
#endif
65
#if !defined(MSGPACK_HW_SIMD_X86_AMD) && defined(__SSE4A__)
66
# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86_AMD_SSE4A_VERSION
67
#endif
68
69
#if !defined(MSGPACK_HW_SIMD_X86_AMD)
70
# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
71
#else
72
// At this point, we know that we have an AMD CPU, we do need to check for
73
// other x86 extensions to determine the final version number.
74
# include <
msgpack/predef/hardware/simd/x86.h
>
75
# if MSGPACK_HW_SIMD_X86 > MSGPACK_HW_SIMD_X86_AMD
76
# undef MSGPACK_HW_SIMD_X86_AMD
77
# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86
78
# endif
79
# define MSGPACK_HW_SIMD_X86_AMD_AVAILABLE
80
#endif
81
82
#define MSGPACK_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD"
83
84
#endif
85
86
#include <
msgpack/predef/detail/test.h
>
87
MSGPACK_PREDEF_DECLARE_TEST
(
MSGPACK_HW_SIMD_X86_AMD
,
MSGPACK_HW_SIMD_X86_AMD_NAME
)
MSGPACK_HW_SIMD_X86_AMD
#define MSGPACK_HW_SIMD_X86_AMD
Definition:
x86_amd.h:70
versions.h
version_number.h
x86.h
test.h
MSGPACK_HW_SIMD_X86_AMD_NAME
#define MSGPACK_HW_SIMD_X86_AMD_NAME
Definition:
x86_amd.h:82
MSGPACK_PREDEF_DECLARE_TEST
#define MSGPACK_PREDEF_DECLARE_TEST(x, s)
Definition:
test.h:13
Generated by
1.8.17