github.com/matrixorigin/matrixone@v0.7.0/pkg/container/hashtable/hash_arm64.go (about) 1 // Copyright 2021 Matrix Origin 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package hashtable 16 17 import ( 18 "unsafe" 19 20 "golang.org/x/sys/cpu" 21 ) 22 23 func crc32Int64BatchHash(data unsafe.Pointer, hashes *uint64, length int) 24 func crc32Int64CellBatchHash(data unsafe.Pointer, hashes *uint64, length int) 25 26 func aesBytesBatchGenHashStates(data *[]byte, states *[3]uint64, length int) 27 func aesInt192BatchGenHashStates(data *[3]uint64, states *[3]uint64, length int) 28 func aesInt256BatchGenHashStates(data *[4]uint64, states *[3]uint64, length int) 29 func aesInt320BatchGenHashStates(data *[5]uint64, states *[3]uint64, length int) 30 31 func init() { 32 if cpu.ARM64.HasCRC32 { 33 Int64BatchHash = crc32Int64BatchHash 34 Int64CellBatchHash = crc32Int64CellBatchHash 35 } 36 37 if cpu.ARM64.HasAES { 38 BytesBatchGenHashStates = aesBytesBatchGenHashStates 39 Int192BatchGenHashStates = aesInt192BatchGenHashStates 40 Int256BatchGenHashStates = aesInt256BatchGenHashStates 41 Int320BatchGenHashStates = aesInt320BatchGenHashStates 42 } 43 }