]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Implement riscv_vlen_asm for riscv32 master
authorHongren Zheng <i@zenithal.me>
Fri, 26 Apr 2024 06:03:43 +0000 (06:03 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 10 May 2024 15:02:49 +0000 (17:02 +0200)
riscvcap.c: undefined reference to 'riscv_vlen_asm'

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24270)

crypto/riscv32cpuid.pl

index 20694e7de7ef64edd636b3b829c1e200542e336e..ac1c043ec91f305af7bbf12bc77018753a2a7c3c 100644 (file)
@@ -84,5 +84,22 @@ OPENSSL_cleanse:
 ___
 }
 
+{
+my ($ret) = ('a0');
+$code .= <<___;
+################################################################################
+# size_t riscv_vlen_asm(void)
+# Return VLEN (i.e. the length of a vector register in bits).
+.p2align 3
+.globl riscv_vlen_asm
+.type riscv_vlen_asm,\@function
+riscv_vlen_asm:
+    csrr $ret, vlenb
+    slli $ret, $ret, 3
+    ret
+.size riscv_vlen_asm,.-riscv_vlen_asm
+___
+}
+
 print $code;
 close STDOUT or die "error closing STDOUT: $!";