diff options
author | Andy Polyakov <appro@openssl.org> | 2013-10-13 19:15:15 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2013-10-13 19:24:22 +0200 |
commit | 958608ca1c6c10d933b424159866f13963f8a881 (patch) | |
tree | 62314c01dda8b8ee037bb67ebb3ef730060fd2ea /crypto/md32_common.h | |
parent | 1aecb23f5b7364a999c2c061187c9176ee89e3b1 (diff) |
Initial aarch64 bits.
(cherry picked from commit 039081b80977e2a5de84e1f88f8b4d025b559956)
Diffstat (limited to 'crypto/md32_common.h')
-rw-r--r-- | crypto/md32_common.h | 18 |
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 |