Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / 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 // +build amd64,!appengine,!gccgo
6
7 package intsets
8
9 func popcnt(x word) int
10 func havePOPCNT() bool
11
12 var hasPOPCNT = havePOPCNT()
13
14 // popcount returns the population count (number of set bits) of x.
15 func popcount(x word) int {
16         if hasPOPCNT {
17                 return popcnt(x)
18         }
19         return popcountTable(x) // faster than Hacker's Delight
20 }