diff options
author | Andy Polyakov <appro@openssl.org> | 2002-12-14 20:42:05 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2002-12-14 20:42:05 +0000 |
commit | 2f98abbcb6cfd6ffcf45d5587286f1f849184594 (patch) | |
tree | 890a6915ae4da1afd9ef397b6ead8ac5e8ab37e7 /crypto/des/des_locl.h | |
parent | 270fa8aedae8595f9c95a03f019b69cffc31baee (diff) | |
download | openssl-2f98abbcb6cfd6ffcf45d5587286f1f849184594.tar.gz |
x86_64 performance patch.
Diffstat (limited to 'crypto/des/des_locl.h')
-rw-r--r-- | crypto/des/des_locl.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/des/des_locl.h b/crypto/des/des_locl.h index 9e033f7c2e..5eb7cff0ca 100644 --- a/crypto/des/des_locl.h +++ b/crypto/des/des_locl.h @@ -159,6 +159,16 @@ #if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER) #define ROTATE(a,n) (_lrotr(a,n)) +#elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM) && !defined(NO_INLINE_ASM) +# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) +# define ROTATE(a,n) ({ register unsigned int ret; \ + asm ("rorl %1,%0" \ + : "=r"(ret) \ + : "I"(n),"0"(a) \ + : "cc"); \ + ret; \ + }) +# endif #else #define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n)))) #endif |