Skip to content

Commit

Permalink
fix hash function determination (matrixorigin#13455)
Browse files Browse the repository at this point in the history
To make CPU feature detection more accurate

Approved by: @nnsgmsone, @XuPeng-SH
  • Loading branch information
aunjgr authored Dec 14, 2023
1 parent cd170fc commit 82a8825
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/container/hashtable/hash_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ func aesInt256BatchGenHashStates(data *[4]uint64, states *[3]uint64, length int)
func aesInt320BatchGenHashStates(data *[5]uint64, states *[3]uint64, length int)

func init() {
if cpu.X86.HasSSE42 {
if cpu.X86.HasAVX {
Int64BatchHash = crc32Int64BatchHash
}

if cpu.X86.HasAES {
BytesBatchGenHashStates = aesBytesBatchGenHashStates
Int192BatchGenHashStates = aesInt192BatchGenHashStates
Int256BatchGenHashStates = aesInt256BatchGenHashStates
Int320BatchGenHashStates = aesInt320BatchGenHashStates
if cpu.X86.HasAES {
BytesBatchGenHashStates = aesBytesBatchGenHashStates
Int192BatchGenHashStates = aesInt192BatchGenHashStates
Int256BatchGenHashStates = aesInt256BatchGenHashStates
Int320BatchGenHashStates = aesInt320BatchGenHashStates
}
}
}

0 comments on commit 82a8825

Please sign in to comment.