Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Fix sha256 implementation to fit changes in Go assembly for avx2 dete… #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions zsl-golang/zsl/sha256/sha256block_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package sha256

import (
"golang.org/x/sys/cpu"
)

var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2
4 changes: 3 additions & 1 deletion zsl-golang/zsl/sha256/sha256block_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@
ADDL y3, h // h = t1 + S0 + MAJ // --

TEXT ·block(SB), 0, $536-32
CMPB runtime·support_avx2(SB), $1
// CMPB runtime·support_avx2(SB), $1
CMPB ·useAVX2(SB), $1

JE avx2

MOVQ p_base+8(FP), SI
Expand Down