From 9e7c5030d064395e24a25dd1a81722f5583defcf Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 19 Oct 2022 17:26:33 +0100 Subject: [PATCH] math/bits: note that functions here may be compiler intrinsics It was noted in the go1.9 release notes that functions in math/bits may be implemented by compiler intrinsics, but this never made it to the documentation. This change adapts the wording of the release notes and puts it in the documentation for math/bits. Change-Id: Ibeea88eaf7df10952cbe670885e910ac30b49d55 Reviewed-on: https://go-review.googlesource.com/c/go/+/444035 Reviewed-by: Keith Randall Reviewed-by: Robert Griesemer Reviewed-by: Filippo Valsorda Reviewed-by: Ian Lance Taylor --- src/math/bits/bits.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/math/bits/bits.go b/src/math/bits/bits.go index 65452feda2..6ca4bfe9a6 100644 --- a/src/math/bits/bits.go +++ b/src/math/bits/bits.go @@ -6,6 +6,12 @@ // Package bits implements bit counting and manipulation // functions for the predeclared unsigned integer types. +// +// Functions in this package may be implemented directly by +// the compiler, for better performance. For those functions +// the code in this package will not be used. Which +// functions are implemented by the compiler depends on the +// architecture and the Go release. package bits const uintSize = 32 << (^uint(0) >> 63) // 32 or 64 -- 2.50.0