aboutsummaryrefslogtreecommitdiff
path: root/sys/modules
diff options
context:
space:
mode:
authorAllan Jude <allanjude@FreeBSD.org>2017-07-01 21:18:06 +0000
committerAllan Jude <allanjude@FreeBSD.org>2017-07-01 21:18:06 +0000
commit929b476ae6c8ebcda6021593f52d87eadbf706f9 (patch)
treeac180f5bd3a013811941b2017d6595c7829966f4 /sys/modules
parente11bad9d2b3254197d6ebe56c51a54910a5274cc (diff)
downloadsrc-929b476ae6c8ebcda6021593f52d87eadbf706f9.tar.gz
src-929b476ae6c8ebcda6021593f52d87eadbf706f9.zip
Increase loop unrolling for skein hashes
This patch was inspired by an opposite change made to shrink the code for the boot loader. On my i7-4770, it increases the skein1024 speed from 470 to 550 MB/s Reviewed by: sbruno MFC after: 1 month Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7824
Notes
Notes: svn path=/head/; revision=320554
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/crypto/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/modules/crypto/Makefile b/sys/modules/crypto/Makefile
index a06d7dacfbe1..930c72792dbb 100644
--- a/sys/modules/crypto/Makefile
+++ b/sys/modules/crypto/Makefile
@@ -19,11 +19,15 @@ SRCS += camellia.c camellia-api.c
SRCS += des_ecb.c des_enc.c des_setkey.c
SRCS += sha1.c sha256c.c sha512c.c
SRCS += skein.c skein_block.c
+# unroll the 256 and 512 loops, half unroll the 1024
+CFLAGS+= -DSKEIN_LOOP=995
.if exists(${MACHINE_ARCH}/skein_block_asm.s)
.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
SRCS += skein_block_asm.s
CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
ACFLAGS += -DELF -Wa,--noexecstack
+# Fully unroll all loops in the assembly optimized version
+AFLAGS+= --defsym SKEIN_LOOP=0
.endif
SRCS += siphash.c
SRCS += gmac.c gfmult.c