diff options
author | Jiajie Chen <c@jia.je> | 2023-10-01 16:53:05 +0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-10-18 15:32:16 -0700 |
commit | a9f6004f677923f620e0927a626d1bdaa1eb2166 (patch) | |
tree | 6dd6c7145237096a3cebd8f164fd7f079d336ca9 | |
parent | 3b894b699c9a9c064466e128c18be80a3f2113bc (diff) |
linux-user/elfload: Enable LSX/LASX in HWCAP for LoongArch
Since support for LSX and LASX is landed in QEMU recently, we can update
HWCAPS accordingly.
Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231001085315.1692667-1-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | linux-user/elfload.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 213fd3e584..2e3809f03c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1237,6 +1237,14 @@ static uint32_t get_elf_hwcap(void) hwcaps |= HWCAP_LOONGARCH_LAM; } + if (FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LSX)) { + hwcaps |= HWCAP_LOONGARCH_LSX; + } + + if (FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LASX)) { + hwcaps |= HWCAP_LOONGARCH_LASX; + } + return hwcaps; } |