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 !purego
6
7package sha512
8
9import "internal/cpu"
10
11//go:noescape
12func blockAVX2(dig *digest, p []byte)
13
14//go:noescape
15func blockAMD64(dig *digest, p []byte)
16
17var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI1 && cpu.X86.HasBMI2
18
19func block(dig *digest, p []byte) {
20	if useAVX2 {
21		blockAVX2(dig, p)
22	} else {
23		blockAMD64(dig, p)
24	}
25}
26