Message ID | 20231213081839.4176614-4-gaosong@loongson.cn |
---|---|
State | New |
Headers | show |
Series | Add LoongArch LSX/LASX instructions | expand |
diff --git a/risugen_loongarch64.pm b/risugen_loongarch64.pm index 01df1da..f8b1612 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();
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(+)