SA_Support
Sapphire's Suite's C++ Support library.
Loading...
Searching...
No Matches
Intrinsics.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 Sapphire's Suite. All Rights Reserved.
2
3#pragma once
4
5#ifndef SAPPHIRE_SUPPORT_INTRINSICS_GUARD
6#define SAPPHIRE_SUPPORT_INTRINSICS_GUARD
7
12
25#if SA_DEBUG
26
31 #define SA_INTRISC 0
32
33#else
34
36 #define SA_INTRISC 1
37
38#endif
39
40
41#if SA_INTRISC || defined(DOXYGEN)
42
43 // SSE / SSE2.
44 #if SA_x64
45
47 #define SA_INTRISC_SSE 1
48
49 #include <immintrin.h>
50
51 #else
52
54 #define SA_INTRISC_SSE 0
55
56 #endif
57
58 // AVX.
59 #if __AVX__
60
62 #define SA_INTRISC_AVX 1
63
64 #if SA_CLANG || SA_GNU
65
66 #include <avxintrin.h>
67
68 #endif
69
70 #else
71
73 #define SA_INTRISC_AVX 0
74
75 #endif
76
77
78 // AVX2.
79 #if __AVX2__
80
82 #define SA_INTRISC_AVX2 1
83
84 #if SA_CLANG || SA_GNU
85
86 #include <avx2intrin.h>
87
88 #endif
89
90 #else
91
93 #define SA_INTRISC_AVX2 0
94
95 #endif
96
97
98 // SVML.
99 #if SA_MSVC && !SA_CLANG // Not supported on clang-cl.
100
102 #define SA_INTRISC_SVML 1
103
104 #else
105
107 #define SA_INTRISC_SVML 0
108
109 #endif
110
111#endif
112
113
116#endif // GUARD
Architecture support definition file.
Compiler support definition file.
Debug support definition file.
API Module support definition file.