]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
RISC-V: Add Zbb rori opcode in riscv.pm
authorJulian Zhu <julian.oerv@isrc.iscas.ac.cn>
Thu, 27 Feb 2025 09:08:39 +0000 (17:08 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 28 Mar 2025 10:16:18 +0000 (11:16 +0100)
Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27161)

crypto/perlasm/riscv.pm

index 2402c052ca4bd55e64cd99d39442690cce373313..5281aa576ca506553ef52412b115effb768c6683 100644 (file)
@@ -384,6 +384,16 @@ sub rev8 {
     return ".word ".($template | ($rs << 15) | ($rd << 7));
 }
 
+sub rori {
+    # Encoding for rori rd, rs1, shamt instruction on RV64
+    #               XXXXXXX_ shamt _ rs1 _XXX_ rd  _XXXXXXX
+    my $template = 0b0110000_00000_00000_101_00000_0010011;
+    my $rd = read_reg shift;
+    my $rs1 = read_reg shift;
+    my $shamt = shift;
+    return ".word ".($template | ($shamt << 20) | ($rs1 << 15) | ($rd << 7));
+}
+
 sub roriw {
     # Encoding for roriw rd, rs1, shamt instruction on RV64
     #               XXXXXXX_ shamt _ rs1 _XXX_ rd  _XXXXXXX