diff mbox series

[risu,4/5] loongarch: init LASX registers

Message ID 20231025092915.902814-5-gaosong@loongson.cn (mailing list archive)
State New, archived
Headers show
Series Add LoongArch LSX/LASX instructions | expand

Commit Message

Song Gao Oct. 25, 2023, 9:29 a.m. UTC
Most of LoongArch cpus have LSX and LASX, so we can init LASX registers
for risu test. We use $f0-$f31 value to init LASX $vreg0- $vreg31 registers.

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 risugen_loongarch64.pm | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/risugen_loongarch64.pm b/risugen_loongarch64.pm
index 5394fdc..b3f901d 100644
--- a/risugen_loongarch64.pm
+++ b/risugen_loongarch64.pm
@@ -374,6 +374,16 @@  sub write_random_register_data($)
     if ($fp_enabled) {
         # Load floating point registers
         write_random_loongarch64_fpdata();
+
+        # Write random LASX data.
+        for (my $i = 0; $i < 32; $i++) {
+            my $tmp_reg = 6;
+            # $fi is lasx register initial value.
+            # movfr2gr.d r6 fi
+            insn32(0x114b800 | $i << 5 | $tmp_reg);
+            # xvreplgr2vr_d  $i r6
+            insn32(0x769f0c00 | 6 << 5 | $i);
+        }
     }
 
     write_random_regdata();