github.com/mattn/go@v0.0.0-20171011075504-07f7db3ea99f/src/crypto/sha512/sha512block_amd64.go (about) 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 // +build 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 }