[PATCH 10/18] tcg/loongarch64: Support LASX in tcg_out_dupi_vec

Richard Henderson posted 18 patches 1 year, 5 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, WANG Xuerui <git@xen0n.name>
[PATCH 10/18] tcg/loongarch64: Support LASX in tcg_out_dupi_vec
Posted by Richard Henderson 1 year, 5 months ago
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/loongarch64/tcg-target.c.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index 9a8f67cf3e..c7d0c7839b 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -1743,7 +1743,12 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
     int64_t value = sextract64(v64, 0, 8 << vece);
     if (-0x200 <= value && value <= 0x1FF) {
         uint32_t imm = (vece << 10) | ((uint32_t)v64 & 0x3FF);
-        tcg_out_opc_vldi(s, rd, imm);
+
+        if (type == TCG_TYPE_V256) {
+            tcg_out_opc_xvldi(s, rd, imm);
+        } else {
+            tcg_out_opc_vldi(s, rd, imm);
+        }
         return;
     }
 
-- 
2.34.1
Re: [PATCH 10/18] tcg/loongarch64: Support LASX in tcg_out_dupi_vec
Posted by gaosong 1 year, 5 months ago
在 2024/5/28 上午5:19, Richard Henderson 写道:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/loongarch64/tcg-target.c.inc | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
Reviewed-by: Song Gao <gaosong@loongson.cn>

Thanks.
Song Gao
> diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
> index 9a8f67cf3e..c7d0c7839b 100644
> --- a/tcg/loongarch64/tcg-target.c.inc
> +++ b/tcg/loongarch64/tcg-target.c.inc
> @@ -1743,7 +1743,12 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
>       int64_t value = sextract64(v64, 0, 8 << vece);
>       if (-0x200 <= value && value <= 0x1FF) {
>           uint32_t imm = (vece << 10) | ((uint32_t)v64 & 0x3FF);
> -        tcg_out_opc_vldi(s, rd, imm);
> +
> +        if (type == TCG_TYPE_V256) {
> +            tcg_out_opc_xvldi(s, rd, imm);
> +        } else {
> +            tcg_out_opc_vldi(s, rd, imm);
> +        }
>           return;
>       }
>