aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcfedorow <mark.fedorov@cloudbear.ru>2022-07-19 19:15:44 +0300
committerTomas Mraz <tomas@openssl.org>2022-11-23 18:21:42 +0100
commit6df209b410bb6949ab96d2946d867d8c3188de87 (patch)
tree802099e920984a55e4ba9dadbeddfe55f8bb7834
parentfe6060192741824a0688d4e7468af41d889999a7 (diff)
downloadopenssl-6df209b410bb6949ab96d2946d867d8c3188de87.zip
openssl-6df209b410bb6949ab96d2946d867d8c3188de87.tar.gz
openssl-6df209b410bb6949ab96d2946d867d8c3188de87.tar.bz2
Emit rev8 on __riscv_zbkb as on __riscv_zbb
Also add early clobber for two-insn bswap. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18827) (cherry picked from commit 48b6776678d794406c625dcb5767102b73081962)
-rw-r--r--include/crypto/modes.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/crypto/modes.h b/include/crypto/modes.h
index 99a4b3c..77954db 100644
--- a/include/crypto/modes.h
+++ b/include/crypto/modes.h
@@ -74,13 +74,13 @@ typedef unsigned char u8;
asm ("rev %0,%1" \
: "=r"(ret_) : "r"((u32)(x))); \
ret_; })
-# elif defined(__riscv_zbb) && __riscv_xlen == 64
+# elif (defined(__riscv_zbb) || defined(__riscv_zbkb)) && __riscv_xlen == 64
# define BSWAP8(x) ({ u64 ret_=(x); \
asm ("rev8 %0,%0" \
: "+r"(ret_)); ret_; })
# define BSWAP4(x) ({ u32 ret_=(x); \
asm ("rev8 %0,%0; srli %0,%0,32"\
- : "+r"(ret_)); ret_; })
+ : "+&r"(ret_)); ret_; })
# endif
# elif defined(_MSC_VER)
# if _MSC_VER>=1300