Source File
crc32_amd64.go
Belonging Package
hash/crc32
package crc32
import (
)
func ( uint32, []byte) uint32
const castagnoliK1 = 168
const castagnoliK2 = 1344
type sse42Table [4]Table
var castagnoliSSE42TableK1 *sse42Table
var castagnoliSSE42TableK2 *sse42Table
func () bool {
return cpu.X86.HasSSE42
}
func () {
if !cpu.X86.HasSSE42 {
panic("arch-specific Castagnoli not available")
}
castagnoliSSE42TableK1 = new(sse42Table)
var [castagnoliK2]byte
for := 0; < 4; ++ {
for := 0; < 256; ++ {
:= uint32() << uint32(*8)
castagnoliSSE42TableK1[][] = castagnoliSSE42(, [:castagnoliK1])
castagnoliSSE42TableK2[][] = castagnoliSSE42(, [:])
}
}
}
= ^
if len() >= castagnoliK1*3 {
:= int(uintptr(unsafe.Pointer(&[0])) & 7)
if != 0 {
= 8 -
= castagnoliSSE42(, [:])
= [:]
}
}
, , := castagnoliSSE42Triple(
, 0, 0,
, [castagnoliK2:], [castagnoliK2*2:],
castagnoliK2/24)
= castagnoliShift(castagnoliSSE42TableK2, ) ^
= [castagnoliK2*3:]
}
, , := castagnoliSSE42Triple(
, 0, 0,
, [castagnoliK1:], [castagnoliK1*2:],
castagnoliK1/24)
= castagnoliShift(castagnoliSSE42TableK1, ) ^
= [castagnoliK1*3:]
}
= castagnoliSSE42(, )
return ^
}
func () bool {
return cpu.X86.HasPCLMULQDQ && cpu.X86.HasSSE41
}
var archIeeeTable8 *slicing8Table
func () {
if !cpu.X86.HasPCLMULQDQ || !cpu.X86.HasSSE41 {
panic("not available")
archIeeeTable8 = slicingMakeTable(IEEE)
}
func ( uint32, []byte) uint32 {
if !cpu.X86.HasPCLMULQDQ || !cpu.X86.HasSSE41 {
panic("not available")
}
if len() >= 64 {
:= len() & 15
:= len() -
= ^ieeeCLMUL(^, [:])
= [:]
}
if len() == 0 {
return
}
return slicingUpdate(, archIeeeTable8, )
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |