summaryrefslogtreecommitdiffstats
path: root/crypto/md32_common.h
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2015-10-23 19:46:02 +0000
committerjkim <jkim@FreeBSD.org>2015-10-23 19:46:02 +0000
commit64cb0c902e312216cdc4c826fc0be9ba9e1bf4da (patch)
treeae816a5a768ec78af3610e509ca39507b33aa9f7 /crypto/md32_common.h
parente5911a7a89e76432a8d4607068e9171b30272e08 (diff)
downloadFreeBSD-src-64cb0c902e312216cdc4c826fc0be9ba9e1bf4da.zip
FreeBSD-src-64cb0c902e312216cdc4c826fc0be9ba9e1bf4da.tar.gz
Import OpenSSL 1.0.2d.
Diffstat (limited to 'crypto/md32_common.h')
-rw-r--r--crypto/md32_common.h38
1 files changed, 28 insertions, 10 deletions
diff --git a/crypto/md32_common.h b/crypto/md32_common.h
index 1823833..96828d2 100644
--- a/crypto/md32_common.h
+++ b/crypto/md32_common.h
@@ -215,12 +215,30 @@
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
-# if defined(__s390__) || defined(__s390x__)
-# 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))
+# if defined(__s390__) || defined(__s390x__)
+# 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
# ifndef HOST_c2l
@@ -250,12 +268,12 @@
(c)+=4; (l); })
# endif
# endif
-# endif
-# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
-# ifndef B_ENDIAN
- /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
-# 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)
+# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
+# ifndef B_ENDIAN
+ /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
+# 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
OpenPOWER on IntegriCloud