Skip to content
Closed
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
8 changes: 4 additions & 4 deletions src/hash/crc32/crc32_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ TEXT ·ieeeCLMUL(SB),NOSPLIT,$0
CMPQ CX, $1024
JL useSSE42

// Use AVX512
VPXORQ Z0, Z0, Z0
VMOVQ AX, X0
// Use AVX512. Zero upper and Z10 and load initial CRC into lower part of Z10.
VPXORQ Z10, Z10, Z10
VMOVAPS X0, X10
VMOVDQU64 (SI), Z1
VPXORQ Z0, Z1, Z1 // Merge initial CRC value into Z1
VPXORQ Z10, Z1, Z1 // Merge initial CRC value into Z1
ADDQ $64, SI // buf+=64
SUBQ $64, CX // len-=64

Expand Down
3 changes: 3 additions & 0 deletions src/hash/crc32/crc32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"internal/testhash"
"io"
"math/rand"
"strings"
"testing"
)

Expand Down Expand Up @@ -67,6 +68,8 @@ var golden = []test{
{0x8c79fd79, 0x297a88ed, "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley", "crc\x01ʇ\x91Ml+\xb8\xa7", "crc\x01wB\x84\x81\xbf\xd6S\xdd"},
{0xa20b7167, 0x66ed1d8b, "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule", "crc\x01ʇ\x91M<lR[", "crc\x01wB\x84\x81{\xaco\xb1"},
{0x8e0bb443, 0xdcded527, "How can you write a big system without C++? -Paul Glick", "crc\x01ʇ\x91M\x0e\x88\x89\xed", "crc\x01wB\x84\x813\xd7C\u007f"},
{0x1010dab0, 0x8a11661f, strings.Repeat("01234567", 1024), "crc\x01ʇ\x91M\x92\xe5\xba\xf3", "crc\x01wB\x84\x81\x1a\x02\x88Y"},
{0x772d04d7, 0x5a6f5c45, strings.Repeat("a", 1024+65), "crc\x01ʇ\x91M\xe7Љ\xd1", "crc\x01wB\x84\x81\x95B\xa9("},
}

// testGoldenIEEE verifies that the given function returns
Expand Down