summaryrefslogtreecommitdiffstats
path: root/crypto/md32_common.h
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2013-10-13 19:15:15 +0200
committerAndy Polyakov <appro@openssl.org>2013-10-13 19:15:15 +0200
commit039081b80977e2a5de84e1f88f8b4d025b559956 (patch)
treeafbd005de48985f2218b8e40faeb011cf8eb3b80 /crypto/md32_common.h
parent0c2adb0a9be76da8de9bbfd5377215f71711a52e (diff)
Initial aarch64 bits.
Diffstat (limited to 'crypto/md32_common.h')
-rw-r--r--crypto/md32_common.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/md32_common.h b/crypto/md32_common.h
index d7f7a26e70..147a7a00c3 100644
--- a/crypto/md32_common.h
+++ b/crypto/md32_common.h
@@ -215,6 +215,24 @@
asm ("bswapl %0":"=r"(r):"0"(r)); \
*((unsigned int *)(c))=r; (c)+=4; r; })
# endif
+# elif defined(__aarch64__)
+# if defined(__BYTE_ORDER__)
+# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
+# define HOST_c2l(c,l) ({ unsigned int r; \
+ asm ("rev %w0,%w1" \
+ :"=r"(r) \
+ :"r"(*((const unsigned int *)(c))));\
+ (c)+=4; (l)=r; })
+# define HOST_l2c(l,c) ({ unsigned int r; \
+ asm ("rev %w0,%w1" \
+ :"=r"(r) \
+ :"r"((unsigned int)(l)));\
+ *((unsigned int *)(c))=r; (c)+=4; r; })
+# elif defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
+# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l))
+# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l))
+# endif
+# endif
# endif
# endif
#endif