| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: patch-vendor_golang.org_x_crypto_blake2b_blake2bAVX2__amd64.go,v 1.1 2019/03/15 15:03:02 he Exp $ | | 1 | $NetBSD: patch-vendor_golang.org_x_crypto_blake2b_blake2bAVX2__amd64.go,v 1.2 2021/09/04 14:10:33 bsiegert Exp $ |
2 | | | 2 | |
3 | We get link errors about runtime.support_avx and runtime.support_avx2, so | | 3 | We get link errors about runtime.support_avx and runtime.support_avx2, so |
4 | revert the offending commit from | | 4 | revert the offending commit from |
5 | https://github.com/golang/crypto/commit/b0697eccbea9adec5b7ba8008f4c33d98d733388 | | 5 | https://github.com/golang/crypto/commit/b0697eccbea9adec5b7ba8008f4c33d98d733388 |
6 | I've not been able to track which version of golang.org/x/crypto is | | 6 | I've not been able to track which version of golang.org/x/crypto is |
7 | embedded in the beats package, and frankly am befuddled that this sort | | 7 | embedded in the beats package, and frankly am befuddled that this sort |
8 | of thing makes it into released code, in this day and age with widespread | | 8 | of thing makes it into released code, in this day and age with widespread |
9 | use of CI etc. This coupled with the apparent widespread practice of | | 9 | use of CI etc. This coupled with the apparent widespread practice of |
10 | "vendoring" code (copy a vendor's code and ship it as part of your source | | 10 | "vendoring" code (copy a vendor's code and ship it as part of your source |
11 | package) makes it difficult to stamp out this sort of bugs. Sigh! | | 11 | package) makes it difficult to stamp out this sort of bugs. Sigh! |
12 | | | 12 | |
13 | --- vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go.orig 2019-03-06 10:13:10.000000000 +0000 | | 13 | --- vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go.orig 2019-03-06 10:13:10.000000000 +0000 |
14 | +++ vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go | | 14 | +++ vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go |
| @@ -25,24 +25,24 @@ package) makes it difficult to stamp out | | | @@ -25,24 +25,24 @@ package) makes it difficult to stamp out |
25 | | | 25 | |
26 | -//go:noescape | | 26 | -//go:noescape |
27 | -func supportsSSE4() bool | | 27 | -func supportsSSE4() bool |
28 | +//go:linkname x86_HasAVX internal/cpu.X86.HasAVX | | 28 | +//go:linkname x86_HasAVX internal/cpu.X86.HasAVX |
29 | +var x86_HasAVX bool | | 29 | +var x86_HasAVX bool |
30 | | | 30 | |
31 | -//go:noescape | | 31 | -//go:noescape |
32 | -func supportsAVX() bool | | 32 | -func supportsAVX() bool |
33 | +//go:linkname x86_HasAVX2 internal/cpu.X86.HasAVX2 | | 33 | +//go:linkname x86_HasAVX2 internal/cpu.X86.HasAVX2 |
34 | +var x86_HasAVX2 bool | | 34 | +var x86_HasAVX2 bool |
35 | | | 35 | |
36 | -//go:noescape | | 36 | -//go:noescape |
37 | -func supportsAVX2() bool | | 37 | -func supportsAVX2() bool |
38 | +//go:linkname x86_HasAVX internal/cpu.X86.HasSSE4 | | 38 | +//go:linkname x86_HasSSE4 internal/cpu.X86.HasSSE4 |
39 | +var x86_HasSSE4 bool | | 39 | +var x86_HasSSE4 bool |
40 | + | | 40 | + |
41 | +func init() { | | 41 | +func init() { |
42 | + useAVX2 = x86_HasAVX2 | | 42 | + useAVX2 = x86_HasAVX2 |
43 | + useAVX = x86_HasAVX | | 43 | + useAVX = x86_HasAVX |
44 | + useSSE4 = x86_HasSSE4 | | 44 | + useSSE4 = x86_HasSSE4 |
45 | +} | | 45 | +} |
46 | | | 46 | |
47 | //go:noescape | | 47 | //go:noescape |
48 | func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) | | 48 | func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) |