diff mbox series

linux-user/elfload: Enable LSX/LASX in HWCAP for LoongArch

Message ID 20231001085315.1692667-1-c@jia.je
State New
Headers show
Series linux-user/elfload: Enable LSX/LASX in HWCAP for LoongArch | expand

Commit Message

Jiajie Chen Oct. 1, 2023, 8:53 a.m. UTC
Since support for LSX and LASX is landed in QEMU recently, we can update
HWCAPS accordingly.

Signed-off-by: Jiajie Chen <c@jia.je>
---
 linux-user/elfload.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Richard Henderson Oct. 1, 2023, 2:09 p.m. UTC | #1
On 10/1/23 01:53, Jiajie Chen wrote:
> Since support for LSX and LASX is landed in QEMU recently, we can update
> HWCAPS accordingly.
> 
> Signed-off-by: Jiajie Chen<c@jia.je>
> ---
>   linux-user/elfload.c | 8 ++++++++
>   1 file changed, 8 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Richard Henderson Oct. 3, 2023, 8:34 p.m. UTC | #2
On 10/1/23 01:53, Jiajie Chen wrote:
> Since support for LSX and LASX is landed in QEMU recently, we can update
> HWCAPS accordingly.
> 
> Signed-off-by: Jiajie Chen <c@jia.je>
> ---
>   linux-user/elfload.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index db75cd4b33..f11f25309e 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;
>   }
>   

Queued to linux-user-next.


r~
diff mbox series

Patch

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index db75cd4b33..f11f25309e 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;
 }