Exemple #1
0
func (s *MySuite) TestHasAVX(c *C) {
	if runtime.GOOS == "linux" {
		var flag = cpu.HasAVX()
		osFlag, err := hasCPUFeatureFromOS("avx")
		c.Assert(err, IsNil)
		c.Check(osFlag, Equals, flag)
	}
}
Exemple #2
0
func block(dig *digest, p []byte) {
	switch true {
	case cpu.HasAVX2() == true:
		blockAVX2(dig, p)
	case cpu.HasAVX() == true:
		blockAVX(dig, p)
	case cpu.HasSSE41() == true:
		blockSSE(dig, p)
	default:
		blockSoftware(dig, p)
	}
}