These lines:
|
if(os_support_lsx) printf("#define HAVE_LSX\n"); |
|
if(os_support_lasx) printf("#define HAVE_LASX\n"); |
use the function itself instead of its call result to detect LSX/LASX features:
|
/* Detect whether the OS supports the LSX instruction set */ |
|
static int os_support_lsx() { |
|
int hwcap = (int)getauxval(AT_HWCAP); |
|
|
|
if (hwcap & LA_HWCAP_LSX) |
|
return 1; |
|
else |
|
return 0; |
|
} |
This will cause the condition always returns true and enable the LSX/LASX features on unsupported loongarch64 target.
These lines:
OpenBLAS/cpuid_loongarch64.c
Lines 398 to 399 in 2347cdd
use the function itself instead of its call result to detect LSX/LASX features:
OpenBLAS/cpuid_loongarch64.c
Lines 260 to 268 in 2347cdd
This will cause the condition always returns true and enable the LSX/LASX features on unsupported loongarch64 target.