.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / container / intsets / popcnt_amd64.go
1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build amd64 && !appengine && !gccgo
6 // +build amd64,!appengine,!gccgo
7
8 package intsets
9
10 func popcnt(x word) int
11 func havePOPCNT() bool
12
13 var hasPOPCNT = havePOPCNT()
14
15 // popcount returns the population count (number of set bits) of x.
16 func popcount(x word) int {
17         if hasPOPCNT {
18                 return popcnt(x)
19         }
20         return popcountTable(x) // faster than Hacker's Delight
21 }