cmake: Allow build system to disable loongarch intrinsics
parent
99b8313eb1
commit
46de6241d7
|
@ -1020,6 +1020,14 @@ if(NOT HAVE_SSE3)
|
|||
set(SDL_DISABLE_SSE3 1)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_LSX)
|
||||
set(SDL_DISABLE_LSX 1)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_LASX)
|
||||
set(SDL_DISABLE_LASX 1)
|
||||
endif()
|
||||
|
||||
# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
|
||||
# anything.
|
||||
if(SDL_LIBC)
|
||||
|
|
|
@ -93,13 +93,11 @@ _m_prefetch(void *__P)
|
|||
#endif
|
||||
#endif /* compiler version */
|
||||
|
||||
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
|
||||
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX)
|
||||
#include <lsxintrin.h>
|
||||
#define __LSX__
|
||||
#endif
|
||||
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
|
||||
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX)
|
||||
#include <lasxintrin.h>
|
||||
#define __LASX__
|
||||
#endif
|
||||
#if defined(__AVX__) && !defined(SDL_DISABLE_AVX)
|
||||
#include <immintrin.h>
|
||||
|
|
|
@ -592,5 +592,7 @@ typedef unsigned int uintptr_t;
|
|||
#cmakedefine SDL_DISABLE_SSE3 1
|
||||
#cmakedefine SDL_DISABLE_AVX 1
|
||||
#cmakedefine SDL_DISABLE_MMX 1
|
||||
#cmakedefine SDL_DISABLE_LSX 1
|
||||
#cmakedefine SDL_DISABLE_LASX 1
|
||||
|
||||
#endif /* SDL_build_config_h_ */
|
||||
|
|
|
@ -211,6 +211,14 @@
|
|||
#define HAVE_AVX_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX)
|
||||
#define HAVE_LSX_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX)
|
||||
#define HAVE_LASX_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined __clang__
|
||||
#if (!__has_attribute(target))
|
||||
#undef HAVE_AVX_INTRINSICS
|
||||
|
|
|
@ -419,7 +419,7 @@ static SDL_bool yuv_rgb_lsx(
|
|||
Uint8 *rgb, Uint32 rgb_stride,
|
||||
YCbCrType yuv_type)
|
||||
{
|
||||
#ifdef __loongarch_sx
|
||||
#if HAVE_LSX_INTRINSICS
|
||||
if (!SDL_HasLSX()) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
|
|
@ -684,7 +684,7 @@ void rgb24_yuv420_sseu(uint32_t width, uint32_t height,
|
|||
|
||||
#endif //HAVE_SSE2_INTRINSICS
|
||||
|
||||
#ifdef __loongarch_sx
|
||||
#if HAVE_LSX_INTRINSICS
|
||||
|
||||
#define LSX_FUNCTION_NAME yuv420_rgb24_lsx
|
||||
#define STD_FUNCTION_NAME yuv420_rgb24_std
|
||||
|
@ -716,6 +716,6 @@ void rgb24_yuv420_sseu(uint32_t width, uint32_t height,
|
|||
#define RGB_FORMAT RGB_FORMAT_ABGR
|
||||
#include "yuv_rgb_lsx_func.h"
|
||||
|
||||
#endif //__loongarch_sx
|
||||
#endif //HAVE_LSX_INTRINSICS
|
||||
|
||||
#endif /* SDL_HAVE_YUV */
|
||||
|
|
Loading…
Reference in New Issue