mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add LoongArch64 architecture LSX support.(build/test )
This commit is contained in:
committed by
Charles Schlosser
parent
c486af5ad3
commit
e986838464
@@ -100,8 +100,8 @@
|
||||
// certain common platform (compiler+architecture combinations) to avoid these problems.
|
||||
// Only static alignment is really problematic (relies on nonstandard compiler extensions),
|
||||
// try to keep heap alignment even when we have to disable static alignment.
|
||||
#if EIGEN_COMP_GNUC && \
|
||||
!(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_PPC || EIGEN_ARCH_IA64 || EIGEN_ARCH_MIPS)
|
||||
#if EIGEN_COMP_GNUC && !(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_PPC || EIGEN_ARCH_IA64 || \
|
||||
EIGEN_ARCH_MIPS || EIGEN_ARCH_LOONGARCH64)
|
||||
#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1
|
||||
#else
|
||||
#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 0
|
||||
@@ -430,6 +430,12 @@ extern "C" {
|
||||
#include <msa.h>
|
||||
#endif
|
||||
|
||||
#elif (defined __loongarch64 && defined __loongarch_sx)
|
||||
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_LSX
|
||||
#include <lsxintrin.h>
|
||||
|
||||
#elif defined __HVX__ && (__HVX_LENGTH__ == 128)
|
||||
|
||||
#define EIGEN_VECTORIZE
|
||||
@@ -520,6 +526,8 @@ inline static const char *SimdInstructionSetsInUse(void) {
|
||||
return "S390X ZVECTOR";
|
||||
#elif defined(EIGEN_VECTORIZE_MSA)
|
||||
return "MIPS MSA";
|
||||
#elif defined(EIGEN_VECTORIZE_LSX)
|
||||
return "LOONGARCH64 LSX";
|
||||
#else
|
||||
return "None";
|
||||
#endif
|
||||
|
||||
@@ -474,6 +474,7 @@ enum Type {
|
||||
MSA = 0x5,
|
||||
SVE = 0x6,
|
||||
HVX = 0x7,
|
||||
LSX = 0x8,
|
||||
#if defined EIGEN_VECTORIZE_SSE
|
||||
Target = SSE
|
||||
#elif defined EIGEN_VECTORIZE_ALTIVEC
|
||||
@@ -488,6 +489,8 @@ enum Type {
|
||||
Target = MSA
|
||||
#elif defined EIGEN_VECTORIZE_HVX
|
||||
Target = HVX
|
||||
#elif defined EIGEN_VECTORIZE_LSX
|
||||
Target = LSX
|
||||
#else
|
||||
Target = Generic
|
||||
#endif
|
||||
|
||||
@@ -376,6 +376,13 @@
|
||||
#define EIGEN_ARCH_MIPS 0
|
||||
#endif
|
||||
|
||||
/// \internal EIGEN_ARCH_LOONGARCH64 set to 1 if the architecture is LOONGARCH64
|
||||
#if defined(__loongarch64)
|
||||
#define EIGEN_ARCH_LOONGARCH64 1
|
||||
#else
|
||||
#define EIGEN_ARCH_LOONGARCH64 0
|
||||
#endif
|
||||
|
||||
/// \internal EIGEN_ARCH_SPARC set to 1 if the architecture is SPARC
|
||||
#if defined(__sparc__) || defined(__sparc)
|
||||
#define EIGEN_ARCH_SPARC 1
|
||||
|
||||
Reference in New Issue
Block a user