artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b0d376
)
Provide optimised bn_clzw() for aarch64.
author
jsing
<jsing@openbsd.org>
Wed, 21 Jun 2023 07:56:43 +0000
(07:56 +0000)
committer
jsing
<jsing@openbsd.org>
Wed, 21 Jun 2023 07:56:43 +0000
(07:56 +0000)
lib/libcrypto/bn/arch/aarch64/bn_arch.h
patch
|
blob
|
history
diff --git
a/lib/libcrypto/bn/arch/aarch64/bn_arch.h
b/lib/libcrypto/bn/arch/aarch64/bn_arch.h
index
aa780e0
..
66de368
100644
(file)
--- a/
lib/libcrypto/bn/arch/aarch64/bn_arch.h
+++ b/
lib/libcrypto/bn/arch/aarch64/bn_arch.h
@@
-1,4
+1,4
@@
-/* $OpenBSD: bn_arch.h,v 1.1
1 2023/06/17 15:40:46
jsing Exp $ */
+/* $OpenBSD: bn_arch.h,v 1.1
2 2023/06/21 07:56:43
jsing Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
@@
-24,6
+24,20
@@
#if defined(__GNUC__)
+#define HAVE_BN_CLZW
+
+static inline int
+bn_clzw(BN_ULONG w)
+{
+ BN_ULONG n;
+
+ __asm__ ("clz %[n], %[w]"
+ : [n]"=r"(n)
+ : [w]"r"(w));
+
+ return n;
+}
+
#define HAVE_BN_ADDW
static inline void