summaryrefslogtreecommitdiff
path: root/crypto/md32_common.h
diff options
context:
space:
mode:
authorappro <appro>2007-04-30 13:26:05 +0000
committerappro <appro>2007-04-30 13:26:05 +0000
commitdb8fdd88f826ec5f7ab30fe438c47f7ae5ab0160 (patch)
treec41dba7433f3949336f342fa2481278164832967 /crypto/md32_common.h
parent55a91d016c56ac60e1246ea135698bd9a296514a (diff)
downloadopenssl-db8fdd88f826ec5f7ab30fe438c47f7ae5ab0160.tar.gz
s390x optimizations.
Diffstat (limited to 'crypto/md32_common.h')
-rw-r--r--crypto/md32_common.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/md32_common.h b/crypto/md32_common.h
index ce956df38..bbcb03a73 100644
--- a/crypto/md32_common.h
+++ b/crypto/md32_common.h
@@ -178,6 +178,13 @@
: "r"(a), "I"(n)); \
ret; \
})
+# elif defined(__s390__) || defined(__s390x__)
+# define ROTATE(a,n) ({ register unsigned int ret; \
+ asm ("rll %0,%1,%2" \
+ : "=r"(ret) \
+ : "r"(a), "I"(n):"cc"); \
+ ret; \
+ })
# endif
# endif
#endif /* PEDANTIC */
@@ -209,6 +216,10 @@
# 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))
+#endif
#ifndef HOST_c2l
#define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \
@@ -227,6 +238,18 @@
#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+#ifndef PEDANTIC
+# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+# if defined(__s390x__)
+# define HOST_c2l(c,l) ({ asm ("lrv %0,0(%1)" \
+ :"=r"(l) : "r"(c)); \
+ (c)+=4; (l); })
+# define HOST_l2c(l,c) ({ asm ("strv %0,0(%1)" \
+ : : "r"(l),"r"(c) : "memory"); \
+ (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. */