authorgravatar for rpkak@noreply.codeberg.orgrpkak <rpkak@noreply.codeberg.org> 2024-07-28 13:00:20+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-26 20:30:06+01:00
log9c45fb4b0933970912966786a036cbf787e69ae6
tree452c2c56b0770ddf7f8dd627e98285667fdd5f41
parentd714cf33405486d9aa707e9aee8f103a011d06e9

langref: correct return type of comptime known bitcount ops


1 files changed, 3 insertions(+), 9 deletions(-)

doc/langref.html.in+3-9
......@@ -4522,9 +4522,7 @@ comptime {
45224522 Counts the number of most-significant (leading in a big-endian sense) zeroes in an integer - "count leading zeroes".
45234523 </p>
45244524 <p>
4525 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
4526 the return type is {#syntax#}comptime_int{#endsyntax#}.
4527 Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
4525 The return type is an unsigned integer or vector of unsigned integers with the minimum number
45284526 of bits that can represent the bit count of the integer type.
45294527 </p>
45304528 <p>
......@@ -4635,9 +4633,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
46354633 Counts the number of least-significant (trailing in a big-endian sense) zeroes in an integer - "count trailing zeroes".
46364634 </p>
46374635 <p>
4638 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
4639 the return type is {#syntax#}comptime_int{#endsyntax#}.
4640 Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
4636 The return type is an unsigned integer or vector of unsigned integers with the minimum number
46414637 of bits that can represent the bit count of the integer type.
46424638 </p>
46434639 <p>
......@@ -5176,9 +5172,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
51765172 Counts the number of bits set in an integer - "population count".
51775173 </p>
51785174 <p>
5179 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
5180 the return type is {#syntax#}comptime_int{#endsyntax#}.
5181 Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
5175 The return type is an unsigned integer or vector of unsigned integers with the minimum number
51825176 of bits that can represent the bit count of the integer type.
51835177 </p>
51845178 {#see_also|@ctz|@clz#}