Beispiel #1
0
func (s *MySuite) TestHasAVX2(c *C) {
	if runtime.GOOS == "linux" {
		var flag = cpu.HasAVX2()
		osFlag, err := hasCPUFeatureFromOS("avx2")
		c.Assert(err, IsNil)
		c.Check(osFlag, Equals, flag)
	}
}
Beispiel #2
0
func block(dig *digest, p []byte) {
	switch true {
	case cpu.HasAVX2() == true:
		blockAVX2(dig, p)
	case cpu.HasSSE41() == true:
		blockSSE3(dig, p)
	default:
		blockGeneric(dig, p)
	}
}