[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[risu PATCH v2 4/6] loongarch: Add clean_lsx_result()
From: |
Song Gao |
Subject: |
[risu PATCH v2 4/6] loongarch: Add clean_lsx_result() |
Date: |
Wed, 13 Dec 2023 16:18:37 +0800 |
The result of the LSX instruction is in the low 128 bits
of the vreg register. We use clean_lsx_result() to clean up
the high 128 bits of the vreg register.
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
risugen_loongarch64.pm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/risugen_loongarch64.pm b/risugen_loongarch64.pm
index f8b1612..98fbd48 100644
--- a/risugen_loongarch64.pm
+++ b/risugen_loongarch64.pm
@@ -81,6 +81,18 @@ sub nanbox_s($)
return $fpreg;
}
+sub clean_lsx_result($)
+{
+ my ($vreg) = @_;
+
+ # xvinsgr2vr.d vd, r0, 2;
+ insn32(0x76ebe000 | 2 << 10 | $vreg);
+ # xvinsgr2vr.d vd, r0, 3;
+ insn32(0x76ebe000 | 3 << 10 | $vreg);
+
+ return $vreg;
+}
+
sub align($)
{
my ($a) = @_;
--
2.25.1
- [risu PATCH v2 0/6] Add LoongArch LSX/LASX instructions, Song Gao, 2023/12/13
- [risu PATCH v2 1/6] loongarch: Rename block type 'safefloat' to 'post', Song Gao, 2023/12/13
- [risu PATCH v2 4/6] loongarch: Add clean_lsx_result(),
Song Gao <=
- [risu PATCH v2 3/6] loongarch: init LASX registers, Song Gao, 2023/12/13
- [risu PATCH v2 6/6] loongarch: Add LASX instructions, Song Gao, 2023/12/13
- [risu PATCH v2 2/6] loongarch: reginfo suport LSX/LASX, Song Gao, 2023/12/13
- [risu PATCH v2 5/6] loongarch: Add LSX instructions, Song Gao, 2023/12/13
- Re: [risu PATCH v2 0/6] Add LoongArch LSX/LASX instructions, Peter Maydell, 2023/12/14