From: tedu Date: Thu, 18 Dec 2014 20:29:08 +0000 (+0000) Subject: only unroll on i386 and amd64 (where confirmed to be much faster). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=44e3b1d3edb9001661f0ec29c69eddc872c874e3;p=openbsd only unroll on i386 and amd64 (where confirmed to be much faster). naddy found sparc64 gets a little slower when unrolled. ok deraadt --- diff --git a/lib/libc/hash/sha2.c b/lib/libc/hash/sha2.c index db6046cf689..f77dc6b54fa 100644 --- a/lib/libc/hash/sha2.c +++ b/lib/libc/hash/sha2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha2.c,v 1.19 2014/12/17 19:42:44 tedu Exp $ */ +/* $OpenBSD: sha2.c,v 1.20 2014/12/18 20:29:08 tedu Exp $ */ /* * FILE: sha2.c @@ -52,7 +52,9 @@ * #define SHA2_UNROLL_TRANSFORM * */ +#if defined(__amd64__) || defined(__i386__) #define SHA2_UNROLL_TRANSFORM +#endif /*** SHA-224/256/384/512 Machine Architecture Definitions *****************/ /* diff --git a/sys/crypto/sha2.c b/sys/crypto/sha2.c index 06912c32d70..5ccb340214d 100644 --- a/sys/crypto/sha2.c +++ b/sys/crypto/sha2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha2.c,v 1.10 2014/12/17 19:40:24 tedu Exp $ */ +/* $OpenBSD: sha2.c,v 1.11 2014/12/18 20:29:08 tedu Exp $ */ /* * FILE: sha2.c @@ -53,9 +53,10 @@ * */ #ifndef SMALL_KERNEL +#if defined(__amd64__) || defined(__i386__) #define SHA2_UNROLL_TRANSFORM #endif - +#endif /*** SHA-256/384/512 Machine Architecture Definitions *****************/ /*