]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Emit rev8 on __riscv_zbkb as on __riscv_zbb
authormarcfedorow <mark.fedorov@cloudbear.ru>
Tue, 19 Jul 2022 16:15:44 +0000 (19:15 +0300)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Jul 2022 06:25:06 +0000 (07:25 +0100)
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)

include/crypto/modes.h

index f98b7056559a20481a618d8580e6b679ee266446..90c9861011e108786676045dab38b0894bc97b5f 100644 (file)
@@ -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