1
0
mirror of https://github.com/golang/go synced 2024-10-01 11:28:34 -06:00
Commit Graph

16 Commits

Author SHA1 Message Date
Ian Lance Taylor
d94e6fe0fd container/intsets: use fast popcount with gccgo
Use the compiler intrinsic __builtin_popcount.

Change-Id: I58286fbcf66d1068390ea9caff2f98b8fe244c2d
Reviewed-on: https://go-review.googlesource.com/16831
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-11 02:17:02 +00:00
David Symonds
3dedf801dd container/intsets: update build tags to exclude assembly from gccgo.
Change-Id: I6f3b351d42f5534dd5a5ff161f1e5680b4dbfd58
Reviewed-on: https://go-review.googlesource.com/16793
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-11-11 01:35:11 +00:00
Andrew Gerrand
3d33c30540 container/intsets: build correctly on App Engine
App Engine is amd64 but it doesn't support uploading assembly files.
Use the explicit build tag so that it selects the generic implementation
on App Engine.
This is required to deploy golang.org.

Change-Id: I7374c91961c53d59f6fdcc9ac98b8a9cec755b2c
Reviewed-on: https://go-review.googlesource.com/15246
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-10-06 04:34:19 +00:00
Alan Donovan
b7f0150d16 container/intsets: popcount: use POPCNT on amd64, Hacker's Delight algorithm on 386
This function accounts for 2% of "godoc -analysis=pointer"
and this change makes it twice as fast---and simpler.

Added test and benchmark.

Change-Id: I8578fa42dce34df057d81f6c522a7b4e0506d09d
Reviewed-on: https://go-review.googlesource.com/15211
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-10-01 19:57:28 +00:00
Andrew M Bursavich
ac8637e9fa container/intsets: Intersects, SubsetOf, SymmetricDifference(With)
Just reading through intsets and decided to knock out a few TODOs.

Change-Id: I677dbcc5ff934fbe0f0af09a4741e708a893f8db
Reviewed-on: https://go-review.googlesource.com/2733
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-14 20:51:28 +00:00
Emil Hessman
ca3901c3d8 all: address vet reports
Fixes various problems reported by go vet.

Change-Id: I12a6fdba8f911b21805d8e42903f8f6a5033790a
Reviewed-on: https://go-review.googlesource.com/2163
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-29 06:08:34 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
Alan Donovan
b8d26f5b94 tools: minor comment fixes.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/173170043
2014-11-13 12:34:25 -05:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00
Alan Donovan
5fe8afcb15 container/intsets: add benchmark of AppendTo method.
Also:
- increase sparsity of sets in benchmarks.
- removed TODO in forEach.  Subword masks had no benefit.
- minor cleanup.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/103470049
2014-06-19 14:35:37 -04:00
Alan Donovan
fd72015344 go.tools/container/intsets: increase block size to 256 bits.
This consistently yields better performance with go/pointer.

Also: return int not word from ntz().

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/97570044
2014-05-30 13:21:36 -04:00
Alan Donovan
65906ce503 go.tools/container/intsets: support negative elements in BitString().
(I forgot about this when we added support for negative elements generally.)

We use floating point for negative numbers.  The order of the
output is reversed from the previous (little-endian) behaviour
since it makes for more readable floating point.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/95570043
2014-05-20 14:52:50 -04:00
Rob Pike
6f17d00f0d go.tools: fix various minor issues found by go vet
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/96360048
2014-05-19 08:47:28 -07:00
Alan Donovan
174d6e8ca3 go.tools/container/intsets: use " " not ", " as (*Sparse).String() separator.
This is both easier to read and 25% shorter (helpful when
using String() as a map key for interning sets).

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/96370045
2014-05-16 13:06:08 -04:00
Alan Donovan
e1b97610f0 go.tools/container/intsets: fix compile error on 32-bit platforms.
Also, fix typo.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/99310043
2014-05-15 14:03:05 -04:00
Alan Donovan
61c5c64029 go.tools/container/intsets: Sparse: a space-efficient representation for ordered sets of int values.
intsets.Sparse is a sparse bit vector.  It uses space proportional
to the number of elements, not the maximum element (as is the case		for a dense bit vector).

A forthcoming CL will make use of it in go/pointer, where it reduces
solve time by 78%.  A similar representation is used for Andersen's
analysis in gcc and LLVM.

+ Tests.

LGTM=sameer, crawshaw, gri
R=gri
CC=crawshaw, golang-codereviews, sameer
https://golang.org/cl/10837043
2014-05-14 17:54:14 -04:00