examples: cpu feature checks (#171)
Add necessary feature checks to the dot and geohash examples to prevent illegal instruction errors. Fixes #170 #153
This commit is contained in:
committed by
GitHub
parent
599bdd1269
commit
8f3c4ea0bf
@@ -1,10 +1,17 @@
|
||||
package geohash
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/cpu"
|
||||
)
|
||||
|
||||
//go:generate go run asm.go -out geohash.s -stubs stub.go
|
||||
|
||||
func TestEncodeIntMountEverest(t *testing.T) {
|
||||
if !(cpu.X86.HasSSE2 && cpu.X86.HasBMI2) {
|
||||
t.Skip("requires SSE2 and BMI2 instruction sets")
|
||||
}
|
||||
if EncodeInt(27.988056, 86.925278) != 0xceb7f254240fd612 {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user