Andreas Auernhammer f671756e04 blake2b: fix AVX performance problems on amd64
On some amd64 CPUs (Xeon E5-2680v4 / E5-2620v3) using SSE and AVX instructions
leads to very low performance.
On a i7-6500U the SSE-AVX code performs following:

AVX2:
name        time/op
Write128-4    165ns ± 0%
Write1K-4    1.20µs ± 0%
Sum128-4      189ns ± 1%
Sum1K-4      1.22µs ± 0%

name        speed
Write128-4  773MB/s ± 1%
Write1K-4   855MB/s ± 0%
Sum128-4    675MB/s ± 1%
Sum1K-4     838MB/s ± 0%

while the same code achieves values < 65MB/s on a Xeon E5-2620v3.

Replacing the `MOVQ` and `PINSRQ` with the AVX instructions `VMOVQ` and `VPINSRQ`
increases the performance of the AVX/AVX2 code to some expected values:

name         old time/op    new time/op     delta
Write128-12    2.20µs ±10%     0.22µs ± 9%    -90.00%  (p=0.029 n=4+4)
Write1K-12     16.2µs ± 0%      1.1µs ± 0%    -93.07%  (p=0.029 n=4+4)
Sum128-12      2.10µs ± 0%     0.22µs ± 0%    -89.47%  (p=0.029 n=4+4)
Sum1K-12       16.3µs ± 0%      1.2µs ± 0%    -92.65%  (p=0.029 n=4+4)

name         old speed      new speed       delta
Write128-12  58.5MB/s ±10%  582.8MB/s ±10%   +897.08%  (p=0.029 n=4+4)
Write1K-12   63.1MB/s ± 0%  909.8MB/s ± 0%  +1341.40%  (p=0.029 n=4+4)
Sum128-12    60.8MB/s ± 0%  576.3MB/s ± 0%   +847.84%  (p=0.029 n=4+4)
Sum1K-12     62.8MB/s ± 0%  855.2MB/s ± 0%  +1260.78%  (p=0.029 n=4+4)

The AVX/AVX2 code now uses only AVX (no SSE) instructions.

Fixes golang/go#18563.

Change-Id: I1961dd8fa02014642587523b7f099816a263c9f5
Reviewed-on: https://go-review.googlesource.com/34993
Reviewed-by: Adam Langley <agl@golang.org>
2017-02-08 19:53:58 +00:00
2017-02-07 22:59:19 +00:00
2014-12-09 23:26:36 +00:00
2016-10-28 19:53:00 +00:00
2016-12-06 19:59:59 +00:00
2014-12-09 23:26:36 +00:00
2016-04-25 23:11:06 +00:00
2014-12-09 23:26:36 +00:00
2014-12-09 23:26:36 +00:00
2017-01-04 23:09:04 +00:00
2017-01-18 18:54:26 +00:00
2014-12-09 23:26:36 +00:00
2014-12-09 23:26:36 +00:00
2016-10-21 19:51:19 +00:00
2014-12-09 23:26:36 +00:00
2014-12-09 23:26:36 +00:00
2014-12-09 23:26:36 +00:00
2014-12-08 10:41:13 +11:00
2015-03-18 17:04:25 +00:00
2015-02-18 23:42:20 +00:00
2012-03-17 15:19:30 +11:00
2012-01-25 15:31:12 -05:00

This repository holds supplementary Go cryptography libraries.

To submit changes to this repository, see http://golang.org/doc/contribute.html.
S
Description
Mirror of ys-ll/crypto (GitHub), kept for paraterm builds
https://golang.org/x/crypto
Readme BSD-3-Clause
8.1 MiB
Languages
Go 88.6%
Assembly 11.1%
C 0.3%