aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/minio/sha256-simd/cpuid_other.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
committerLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
commit8db41da676ac8368ef7c2549d56239a5ff5eedde (patch)
tree09c427fd66de2ec1ebffc8342f5fdbb84b0701b5 /vendor/github.com/minio/sha256-simd/cpuid_other.go
parentd4f75fb6db22e57577867445a022227e70958931 (diff)
downloadgitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.tar.gz
gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.zip
Delete vendor directory
Diffstat (limited to 'vendor/github.com/minio/sha256-simd/cpuid_other.go')
-rw-r--r--vendor/github.com/minio/sha256-simd/cpuid_other.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_other.go b/vendor/github.com/minio/sha256-simd/cpuid_other.go
deleted file mode 100644
index 97af6a1..0000000
--- a/vendor/github.com/minio/sha256-simd/cpuid_other.go
+++ /dev/null
@@ -1,50 +0,0 @@
1// Minio Cloud Storage, (C) 2021 Minio, Inc.
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
16package sha256
17
18import (
19 "bytes"
20 "io/ioutil"
21 "runtime"
22
23 "github.com/klauspost/cpuid/v2"
24)
25
26var (
27 hasIntelSha = runtime.GOARCH == "amd64" && cpuid.CPU.Supports(cpuid.SHA, cpuid.SSSE3, cpuid.SSE4)
28 hasAvx512 = cpuid.CPU.Supports(cpuid.AVX512F, cpuid.AVX512DQ, cpuid.AVX512BW, cpuid.AVX512VL)
29)
30
31func hasArmSha2() bool {
32 if cpuid.CPU.Has(cpuid.SHA2) {
33 return true
34 }
35 if runtime.GOARCH != "arm64" || runtime.GOOS != "linux" {
36 return false
37 }
38
39 // Fall back to hacky cpuinfo parsing...
40 const procCPUInfo = "/proc/cpuinfo"
41
42 // Feature to check for.
43 const sha256Feature = "sha2"
44
45 cpuInfo, err := ioutil.ReadFile(procCPUInfo)
46 if err != nil {
47 return false
48 }
49 return bytes.Contains(cpuInfo, []byte(sha256Feature))
50}