mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 13:13:40 +00:00
[UCRT] Fix GCC/Clang build of SSE2/AVX code
On GCC the code using extended ISA cannot be inlined and must either be marked with a function attribute or compiled with the proper target options ('-mavx2' on the command line or '#pragma GCC target("avx2")' inside the code)
This commit is contained in:
parent
51e6ce3aa7
commit
97e20ef342
2 changed files with 25 additions and 1 deletions
|
@ -18,6 +18,24 @@
|
|||
|
||||
#if defined _CRT_SIMD_SUPPORT_AVAILABLE
|
||||
|
||||
#if defined(__clang__)
|
||||
#define _UCRT_ENABLE_EXTENDED_ISA \
|
||||
_Pragma("clang attribute push(__attribute__((target(\"sse2,avx,avx2\"))), apply_to=function)")
|
||||
#define _UCRT_RESTORE_DEFAULT_ISA \
|
||||
_Pragma("clang attribute pop")
|
||||
#elif defined(__GNUC__)
|
||||
#define _UCRT_ENABLE_EXTENDED_ISA \
|
||||
_Pragma("GCC push_options") \
|
||||
_Pragma("GCC target(\"avx2\")")
|
||||
#define _UCRT_RESTORE_DEFAULT_ISA \
|
||||
_Pragma("GCC pop_options")
|
||||
#else
|
||||
#define _UCRT_ENABLE_EXTENDED_ISA
|
||||
#define _UCRT_RESTORE_DEFAULT_ISA
|
||||
#endif
|
||||
|
||||
_UCRT_ENABLE_EXTENDED_ISA
|
||||
|
||||
extern "C" int __isa_available;
|
||||
|
||||
enum class __crt_simd_isa
|
||||
|
@ -155,4 +173,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
_UCRT_RESTORE_DEFAULT_ISA
|
||||
|
||||
#endif // _CRT_SIMD_SUPPORT_AVAILABLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue