mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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
2 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */
|
||||
#define CPUINFO_LSX (1u << 1)
|
||||
#define CPUINFO_LASX (1u << 2)
|
||||
|
||||
/* Initialized with a constructor. */
|
||||
extern unsigned cpuinfo;
|
||||
|
|
|
@ -29,6 +29,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
|
|||
|
||||
info = CPUINFO_ALWAYS;
|
||||
info |= (hwcap & HWCAP_LOONGARCH_LSX ? CPUINFO_LSX : 0);
|
||||
info |= (hwcap & HWCAP_LOONGARCH_LASX ? CPUINFO_LASX : 0);
|
||||
|
||||
cpuinfo = info;
|
||||
return info;
|
||||
|
|
Loading…
Reference in a new issue