mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 13:37:56 +00:00
Add loongarch support
LSX and LASX are enabled by default if compiler supports them.
This commit is contained in:
@@ -229,6 +229,8 @@
|
||||
#undef HAVE_LIBUDEV_H
|
||||
#undef HAVE_LIBSAMPLERATE_H
|
||||
#undef HAVE_LIBDECOR_H
|
||||
#undef HAVE_LSXINTRIN_H
|
||||
#undef HAVE_LASXINTRIN_H
|
||||
|
||||
#undef HAVE_DDRAW_H
|
||||
#undef HAVE_DINPUT_H
|
||||
|
||||
@@ -98,6 +98,14 @@ _m_prefetch(void *__P)
|
||||
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
||||
#include <mm3dnow.h>
|
||||
#endif
|
||||
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
|
||||
#include <lsxintrin.h>
|
||||
#define __LSX__
|
||||
#endif
|
||||
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
|
||||
#include <lasxintrin.h>
|
||||
#define __LASX__
|
||||
#endif
|
||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
||||
#include <immintrin.h>
|
||||
#else
|
||||
@@ -433,6 +441,28 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using LOONGARCH instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.23.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using LOONGARCH instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.23.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
||||
|
||||
/**
|
||||
* Get the amount of RAM configured in the system.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user