[PULL v2 1/6] target/loongarch: Fix vldi inst

Bibo Mao posted 6 patches 4 months, 2 weeks ago
There is a newer version of this series
[PULL v2 1/6] target/loongarch: Fix vldi inst
Posted by Bibo Mao 4 months, 2 weeks ago
From: Guo Hongyu <guohongyu24@mails.ucas.ac.cn>

Refer to the link below for a description of the vldi instructions:
https://jia.je/unofficial-loongarch-intrinsics-guide/lsx/misc/#synopsis_88
Fixed errors in vldi instruction implementation.

Signed-off-by: Guo Hongyu <guohongyu24@mails.ucas.ac.cn>
Tested-by: Xianglai Li <lixianglai@loongson.cn>
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 target/loongarch/tcg/insn_trans/trans_vec.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
index 92b1d22e28..d317dfcc1c 100644
--- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
@@ -3480,7 +3480,7 @@ static uint64_t vldi_get_value(DisasContext *ctx, uint32_t imm)
         break;
     case 1:
         /* data: {2{16'0, imm[7:0], 8'0}} */
-        data = (t << 24) | (t << 8);
+        data = (t << 40) | (t << 8);
         break;
     case 2:
         /* data: {2{8'0, imm[7:0], 16'0}} */
-- 
2.43.5
Re: [PULL v2 1/6] target/loongarch: Fix vldi inst
Posted by gaosong 1 month, 4 weeks ago
Cc: qemu-stable@nongnu.org

Fix : https://gitlab.com/qemu-project/qemu/-/issues/2865

在 2024/12/27 下午2:22, Bibo Mao 写道:
> From: Guo Hongyu <guohongyu24@mails.ucas.ac.cn>
>
> Refer to the link below for a description of the vldi instructions:
> https://jia.je/unofficial-loongarch-intrinsics-guide/lsx/misc/#synopsis_88
> Fixed errors in vldi instruction implementation.
>
> Signed-off-by: Guo Hongyu <guohongyu24@mails.ucas.ac.cn>
> Tested-by: Xianglai Li <lixianglai@loongson.cn>
> Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
> Reviewed-by: Bibo Mao <maobibo@loongson.cn>
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   target/loongarch/tcg/insn_trans/trans_vec.c.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
> index 92b1d22e28..d317dfcc1c 100644
> --- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
> +++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
> @@ -3480,7 +3480,7 @@ static uint64_t vldi_get_value(DisasContext *ctx, uint32_t imm)
>           break;
>       case 1:
>           /* data: {2{16'0, imm[7:0], 8'0}} */
> -        data = (t << 24) | (t << 8);
> +        data = (t << 40) | (t << 8);
>           break;
>       case 2:
>           /* data: {2{8'0, imm[7:0], 16'0}} */