github.com/metacubex/sing-tun@v0.2.7-0.20240512075008-89e7c6208eec/internal/clashtcpip/tcpip_arm64.go (about) 1 package clashtcpip 2 3 import ( 4 "unsafe" 5 6 "golang.org/x/sys/cpu" 7 ) 8 9 //go:noescape 10 func sumAsmNeon(data unsafe.Pointer, length uintptr) uintptr 11 12 func SumNeon(data []byte) uint32 { 13 if len(data) == 0 { 14 return 0 15 } 16 17 return uint32(sumAsmNeon(unsafe.Pointer(&data[0]), uintptr(len(data)))) 18 } 19 20 func init() { 21 if cpu.ARM64.HasASIMD { 22 SumFnc = SumNeon 23 } 24 }