| 1 | // Copyright 2013 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | //go:build ignore && amd64 |
| 6 | |
| 7 | package sha512 |
| 8 | |
| 9 | import "internal/cpu" |
| 10 | |
| 11 | //go:noescape |
| 12 | func blockAVX2(dig *digest, p []byte) |
| 13 | |
| 14 | //go:noescape |
| 15 | func blockAMD64(dig *digest, p []byte) |
| 16 | |
| 17 | var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI1 && cpu.X86.HasBMI2 |
| 18 | |
| 19 | func block(dig *digest, p []byte) { |
| 20 | if useAVX2 { |
| 21 | blockAVX2(dig, p) |
| 22 | } else { |
| 23 | blockAMD64(dig, p) |
| 24 | } |
| 25 | } |