// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && gc && !purego
// +build amd64,gc,!purego

package argon2

import 

func () {
	useSSE4 = cpu.X86.HasSSE41
}

//go:noescape
func (, , ,  *block)

//go:noescape
func (, , ,  *block)

//go:noescape
func ( *block)

func (, ,  *block,  bool) {
	var  block
	mixBlocksSSE2(&, , , &)
	if useSSE4 {
		blamkaSSE4(&)
	} else {
		for  := 0;  < blockLength;  += 16 {
			blamkaGeneric(
				&[+0], &[+1], &[+2], &[+3],
				&[+4], &[+5], &[+6], &[+7],
				&[+8], &[+9], &[+10], &[+11],
				&[+12], &[+13], &[+14], &[+15],
			)
		}
		for  := 0;  < blockLength/8;  += 2 {
			blamkaGeneric(
				&[], &[+1], &[16+], &[16++1],
				&[32+], &[32++1], &[48+], &[48++1],
				&[64+], &[64++1], &[80+], &[80++1],
				&[96+], &[96++1], &[112+], &[112++1],
			)
		}
	}
	if  {
		xorBlocksSSE2(, , , &)
	} else {
		mixBlocksSSE2(, , , &)
	}
}

func (, ,  *block) {
	processBlockSSE(, , , false)
}

func (, ,  *block) {
	processBlockSSE(, , , true)
}