From e2d3b02eaeded7c3c9ec60e99213d04145c72f95 Mon Sep 17 00:00:00 2001 From: Will Fitzgerald Date: Mon, 28 Aug 2017 12:40:12 -0400 Subject: [PATCH] support for 1.9 bit counts --- popcnt_amd64.s | 1 + popcnt_cmp_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/popcnt_amd64.s b/popcnt_amd64.s index 18f5878..666c0dc 100644 --- a/popcnt_amd64.s +++ b/popcnt_amd64.s @@ -1,3 +1,4 @@ +// +build !go1.9 // +build amd64,!appengine TEXT ·hasAsm(SB),4,$0-1 diff --git a/popcnt_cmp_test.go b/popcnt_cmp_test.go index 190e83a..8a06dc9 100644 --- a/popcnt_cmp_test.go +++ b/popcnt_cmp_test.go @@ -9,7 +9,7 @@ import ( "testing" ) -func TestPopcntSlice(t *testing.T) { +func TestComparePopcntSlice(t *testing.T) { s := []uint64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29} resGo := popcntSliceGo(s) resAsm := popcntSliceAsm(s) @@ -18,7 +18,7 @@ func TestPopcntSlice(t *testing.T) { } } -func TestPopcntMaskSlice(t *testing.T) { +func TestComparePopcntMaskSlice(t *testing.T) { s := []uint64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29} m := []uint64{31, 37, 41, 43, 47, 53, 59, 61, 67, 71} resGo := popcntMaskSliceGo(s, m) @@ -28,7 +28,7 @@ func TestPopcntMaskSlice(t *testing.T) { } } -func TestPopcntAndSlice(t *testing.T) { +func TestComparePopcntAndSlice(t *testing.T) { s := []uint64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29} m := []uint64{31, 37, 41, 43, 47, 53, 59, 61, 67, 71} resGo := popcntAndSliceGo(s, m) @@ -38,7 +38,7 @@ func TestPopcntAndSlice(t *testing.T) { } } -func TestPopcntOrSlice(t *testing.T) { +func TestComparePopcntOrSlice(t *testing.T) { s := []uint64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29} m := []uint64{31, 37, 41, 43, 47, 53, 59, 61, 67, 71} resGo := popcntOrSliceGo(s, m) @@ -48,7 +48,7 @@ func TestPopcntOrSlice(t *testing.T) { } } -func TestPopcntXorSlice(t *testing.T) { +func TestComparePopcntXorSlice(t *testing.T) { s := []uint64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29} m := []uint64{31, 37, 41, 43, 47, 53, 59, 61, 67, 71} resGo := popcntXorSliceGo(s, m)