mirror of https://github.com/encounter/SDL.git
* Support for intrinsics in MSW + Clang scenario.
Utility polyfill is provided, removed the no-longer-needed conditionals.
This commit is contained in:
parent
89b6209313
commit
50db4a59b8
|
@ -778,11 +778,6 @@ if(ASSEMBLY)
|
||||||
set(HAVE_SSE3 TRUE)
|
set(HAVE_SSE3 TRUE)
|
||||||
set(SDL_ASSEMBLY_ROUTINES 1)
|
set(SDL_ASSEMBLY_ROUTINES 1)
|
||||||
endif()
|
endif()
|
||||||
# TODO:
|
|
||||||
#else()
|
|
||||||
# if(USE_GCC OR USE_CLANG)
|
|
||||||
# list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-sse3" "-mno-mmx")
|
|
||||||
# endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
|
# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
|
||||||
|
@ -2526,7 +2521,11 @@ if (ASAN)
|
||||||
asan_check_add_debug_flag("undefined")
|
asan_check_add_debug_flag("undefined")
|
||||||
asan_check_add_debug_flag("vla-bound")
|
asan_check_add_debug_flag("vla-bound")
|
||||||
asan_check_add_debug_flag("leak")
|
asan_check_add_debug_flag("leak")
|
||||||
asan_check_add_debug_flag("object-size")
|
# The object size sanitizer has no effect on unoptimized builds on Clang,
|
||||||
|
# but causes warnings.
|
||||||
|
if((NOT USE_CLANG) OR (CMAKE_BUILD_TYPE STREQUAL ""))
|
||||||
|
asan_check_add_debug_flag("object-size")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##### Tests #####
|
##### Tests #####
|
||||||
|
|
|
@ -34,11 +34,20 @@
|
||||||
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */
|
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
||||||
#undef __MMX__
|
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
||||||
#undef __SSE__
|
|
||||||
#undef __SSE2__
|
#ifndef __PRFCHWINTRIN_H
|
||||||
#else
|
#define __PRFCHWINTRIN_H
|
||||||
|
|
||||||
|
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||||
|
_m_prefetch(void *__P)
|
||||||
|
{
|
||||||
|
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __PRFCHWINTRIN_H */
|
||||||
|
#endif /* __clang__ */
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#ifndef _WIN64
|
#ifndef _WIN64
|
||||||
#ifndef __MMX__
|
#ifndef __MMX__
|
||||||
|
@ -54,7 +63,6 @@
|
||||||
#ifndef __SSE2__
|
#ifndef __SSE2__
|
||||||
#define __SSE2__
|
#define __SSE2__
|
||||||
#endif
|
#endif
|
||||||
#endif /* __clang__ */
|
|
||||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
#elif defined(__MINGW64_VERSION_MAJOR)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON)
|
#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON)
|
||||||
|
@ -82,6 +90,8 @@
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* compiler version */
|
||||||
|
|
||||||
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
||||||
#include <mm3dnow.h>
|
#include <mm3dnow.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -101,7 +111,6 @@
|
||||||
#include <pmmintrin.h>
|
#include <pmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
#endif /* HAVE_IMMINTRIN_H */
|
#endif /* HAVE_IMMINTRIN_H */
|
||||||
#endif /* compiler version */
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
|
|
@ -30,7 +30,23 @@
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#ifdef _MSC_VER
|
||||||
|
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
||||||
|
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#ifndef __PRFCHWINTRIN_H
|
||||||
|
#define __PRFCHWINTRIN_H
|
||||||
|
|
||||||
|
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||||
|
_m_prefetch(void *__P)
|
||||||
|
{
|
||||||
|
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __PRFCHWINTRIN_H */
|
||||||
|
#endif /* __clang__ */
|
||||||
|
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue