Source file src/simd/archsimd/cpu_exp.go
1 // Code generated by 'simdgen -o godefs -goroot $GOROOT -arch amd64 -xedPath $XED_PATH go_amd64.yaml types.yaml categories.yaml'; DO NOT EDIT. 2 3 //go:build goexperiment.simd 4 5 package archsimd 6 7 import "internal/cpu" 8 9 // AVX2AES returns whether the CPU supports AES operations on 256-bit vectors. 10 // 11 // This corresponds to the AVX2, VAES, and AES CPUID features. 12 // 13 // If it returns true, then the CPU also supports AVX, AVX2, and AVXAES. 14 // 15 // AVX2AES is defined on all GOARCHes, but will only return true on 16 // GOARCH amd64. 17 func (X86Features) AVX2AES() bool { 18 return cpu.X86.HasAVX2 && cpu.X86.HasVAES && cpu.X86.HasAES 19 } 20 21 // AVX512AES returns whether the CPU supports AES operations on 512-bit vectors. 22 // 23 // This corresponds to the AVX512F, AVX512CD, AVX512BW, AVX512DQ, AVX512VL, VAES, and AES CPUID features. 24 // 25 // If it returns true, then the CPU also supports AVX, AVX2, AVX512, AVXAES, and AVX2AES. 26 // 27 // AVX512AES is defined on all GOARCHes, but will only return true on 28 // GOARCH amd64. 29 func (X86Features) AVX512AES() bool { 30 return cpu.X86.HasAVX512 && cpu.X86.HasVAES && cpu.X86.HasAES 31 } 32 33 // AVX512GFNI returns whether the CPU supports the AVX512GFNI feature. 34 // 35 // If it returns true, then the CPU also supports AVX, AVX2, and AVX512. 36 // 37 // AVX512GFNI is defined on all GOARCHes, but will only return true on 38 // GOARCH amd64. 39 func (X86Features) AVX512GFNI() bool { 40 return cpu.X86.HasAVX512GFNI 41 } 42 43 // AVX512VNNI returns whether the CPU supports the AVX512VNNI feature. 44 // 45 // If it returns true, then the CPU also supports AVX, AVX2, and AVX512. 46 // 47 // AVX512VNNI is defined on all GOARCHes, but will only return true on 48 // GOARCH amd64. 49 func (X86Features) AVX512VNNI() bool { 50 return cpu.X86.HasAVX512VNNI 51 } 52 53 // AVXAES returns whether the CPU supports AES operations on 128-bit vectors. 54 // 55 // This corresponds to the AVX and AES CPUID features. 56 // 57 // If it returns true, then the CPU also supports AVX. 58 // 59 // AVXAES is defined on all GOARCHes, but will only return true on 60 // GOARCH amd64. 61 func (X86Features) AVXAES() bool { 62 return cpu.X86.HasAVX && cpu.X86.HasAES 63 } 64 65 // AVXVNNI returns whether the CPU supports the AVXVNNI feature. 66 // 67 // If it returns true, then the CPU also supports AVX and AVX2. 68 // 69 // AVXVNNI is defined on all GOARCHes, but will only return true on 70 // GOARCH amd64. 71 func (X86Features) AVXVNNI() bool { 72 return cpu.X86.HasAVXVNNI 73 } 74 75 // SHA returns whether the CPU supports the SHA feature. 76 // 77 // SHA is defined on all GOARCHes, but will only return true on 78 // GOARCH amd64. 79 func (X86Features) SHA() bool { 80 return cpu.X86.HasSHA 81 } 82