diff options
| author | Keith Randall <khr@golang.org> | 2017-03-14 13:25:12 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2017-03-16 02:44:16 +0000 |
| commit | d5dc4905191c3f7cfeb52e93331d10ebd33301f5 (patch) | |
| tree | efbe9f8a06b01b0510d8a09fa4edcc4f2c6fb133 /src/runtime/mbitmap.go | |
| parent | 16200c73331a679b43efc4699b5806c64a556f09 (diff) | |
| download | go-d5dc4905191c3f7cfeb52e93331d10ebd33301f5.tar.xz | |
cmd/compile: intrinsics for math/bits.TrailingZerosX
Implement math/bits.TrailingZerosX using intrinsics.
Generally reorganize the intrinsic spec a bit.
The instrinsics data structure is now built at init time.
This will make doing the other functions in math/bits easier.
Update sys.CtzX to return int instead of uint{64,32} so it
matches math/bits.TrailingZerosX.
Improve the intrinsics a bit for amd64. We don't need the CMOV
for <64 bit versions.
Update #18616
Change-Id: Ic1c5339c943f961d830ae56f12674d7b29d4ff39
Reviewed-on: https://go-review.googlesource.com/38155
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/runtime/mbitmap.go')
| -rw-r--r-- | src/runtime/mbitmap.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index 4e1a3e29f9..b48dbff7f6 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -248,7 +248,7 @@ func (s *mspan) nextFreeIndex() uintptr { return snelems } - s.allocCache >>= (bitIndex + 1) + s.allocCache >>= uint(bitIndex + 1) sfreeindex = result + 1 if sfreeindex%64 == 0 && sfreeindex != snelems { |
