exp: use new operations from math/bits for faster generation

Code by josharian.

benchmark                        old ns/op     new ns/op     delta
BenchmarkPCGMultiply-4           3.48          2.31          -33.62%
BenchmarkSource-4                7.46          3.54          -52.55%
BenchmarkInt63Threadsafe-4       21.6          19.4          -10.19%
BenchmarkInt63Unthreadsafe-4     7.69          3.60          -53.19%
BenchmarkIntn1000-4              17.3          13.2          -23.70%
BenchmarkInt63n1000-4            17.7          13.2          -25.42%
BenchmarkInt31n1000-4            17.4          13.2          -24.14%
BenchmarkFloat32-4               13.5          8.57          -36.52%
BenchmarkFloat64-4               11.1          6.43          -42.07%
BenchmarkPerm3-4                 64.6          49.2          -23.84%
BenchmarkPerm30-4                614           430           -29.97%
BenchmarkPerm30ViaShuffle-4      556           450           -19.06%
BenchmarkShuffleOverhead-4       969           788           -18.68%
BenchmarkRead3-4                 11.7          10.1          -13.68%
BenchmarkRead64-4                127           83.0          -34.65%
BenchmarkRead1000-4              1820          1191          -34.56%

Also move the rotate out from under the 1.9 build tag, as 1.9 is old.
The new code goes under a 1.12 build tag.

Update golang/go#21835.

Change-Id: I66d5cac6578b8df2cdfc3b90ed097c5525adb6bc
Reviewed-on: https://go-review.googlesource.com/c/163258
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
3 files changed
tree: e588a18c508cf92b44232709ffc04baa84492749
  1. .gitattributes
  2. .gitignore
  3. AUTHORS
  4. CONTRIBUTING.md
  5. CONTRIBUTORS
  6. LICENSE
  7. PATENTS
  8. README.md
  9. apidiff/
  10. cmd/
  11. codereview.cfg
  12. ebnf/
  13. ebnflint/
  14. errors/
  15. fsnotify/
  16. inotify/
  17. io/
  18. mmap/
  19. old/
  20. rand/
  21. shiny/
  22. shootout/
  23. utf8string/
  24. winfsnotify/
README.md

exp

This subrepository holds experimental and deprecated (in the old directory) packages.

The idea for this subrepository originated as the pkg/exp directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get these packages.

Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.

In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)

Caveat emptor.