util/loongarch64: Detect LASX vector support
Reviewed-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
1c05d53baf
commit
9d779187b8
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */
|
#define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */
|
||||||
#define CPUINFO_LSX (1u << 1)
|
#define CPUINFO_LSX (1u << 1)
|
||||||
|
#define CPUINFO_LASX (1u << 2)
|
||||||
|
|
||||||
/* Initialized with a constructor. */
|
/* Initialized with a constructor. */
|
||||||
extern unsigned cpuinfo;
|
extern unsigned cpuinfo;
|
||||||
|
@ -29,6 +29,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
|
|||||||
|
|
||||||
info = CPUINFO_ALWAYS;
|
info = CPUINFO_ALWAYS;
|
||||||
info |= (hwcap & HWCAP_LOONGARCH_LSX ? CPUINFO_LSX : 0);
|
info |= (hwcap & HWCAP_LOONGARCH_LSX ? CPUINFO_LSX : 0);
|
||||||
|
info |= (hwcap & HWCAP_LOONGARCH_LASX ? CPUINFO_LASX : 0);
|
||||||
|
|
||||||
cpuinfo = info;
|
cpuinfo = info;
|
||||||
return info;
|
return info;
|
||||||
|
Loading…
Reference in New Issue
Block a user