authorgravatar for auguste.rame@gmail.comAuguste Rame <auguste.rame@gmail.com> 2021-07-25 22:58:58-04:00
committergravatar for auguste.rame@gmail.comAuguste Rame <auguste.rame@gmail.com> 2021-07-25 22:58:58-04:00
logdd796154be57da69c0b8467495e9029bb52cb897
treeb2e3a63e1e4450d3670a63abd97401bd5e3c19be
parentc619b85f67386cac63463f0f801b4c316cfb6e95

Doc fixes for clz + ctz


1 files changed, 14 insertions(+), 10 deletions(-)

doc/langref.html.in+14-10
......@@ -7366,18 +7366,20 @@ pub const CallOptions = struct {
73667366 {#header_close#}
73677367
73687368 {#header_open|@clz#}
7369 <pre>{#syntax#}@clz(comptime T: type, integer: T){#endsyntax#}</pre>
7369 <pre>{#syntax#}@clz(comptime T: type, operand: T){#endsyntax#}</pre>
7370 <p>{#syntax#}T{#endsyntax#} must be an integer type.</p>
7371 <p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
73707372 <p>
7371 This function counts the number of most-significant (leading in a big-Endian sense) zeroes in {#syntax#}integer{#endsyntax#}.
7373 This function counts the number of most-significant (leading in a big-Endian sense) zeroes in an integer.
73727374 </p>
73737375 <p>
7374 If {#syntax#}integer{#endsyntax#} is known at {#link|comptime#},
7376 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
73757377 the return type is {#syntax#}comptime_int{#endsyntax#}.
7376 Otherwise, the return type is an unsigned integer with the minimum number
7378 Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
73777379 of bits that can represent the bit count of the integer type.
73787380 </p>
73797381 <p>
7380 If {#syntax#}integer{#endsyntax#} is zero, {#syntax#}@clz{#endsyntax#} returns the bit width
7382 If {#syntax#}operand{#endsyntax#} is zero, {#syntax#}@clz{#endsyntax#} returns the bit width
73817383 of integer type {#syntax#}T{#endsyntax#}.
73827384 </p>
73837385 {#see_also|@ctz|@popCount#}
......@@ -7509,18 +7511,20 @@ test "main" {
75097511 {#header_close#}
75107512
75117513 {#header_open|@ctz#}
7512 <pre>{#syntax#}@ctz(comptime T: type, integer: T){#endsyntax#}</pre>
7514 <pre>{#syntax#}@ctz(comptime T: type, operand: T){#endsyntax#}</pre>
7515 <p>{#syntax#}T{#endsyntax#} must be an integer type.</p>
7516 <p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
75137517 <p>
7514 This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in {#syntax#}integer{#endsyntax#}.
7518 This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in an integer.
75157519 </p>
75167520 <p>
7517 If {#syntax#}integer{#endsyntax#} is known at {#link|comptime#},
7521 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
75187522 the return type is {#syntax#}comptime_int{#endsyntax#}.
7519 Otherwise, the return type is an unsigned integer with the minimum number
7523 Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
75207524 of bits that can represent the bit count of the integer type.
75217525 </p>
75227526 <p>
7523 If {#syntax#}integer{#endsyntax#} is zero, {#syntax#}@ctz{#endsyntax#} returns
7527 If {#syntax#}operand{#endsyntax#} is zero, {#syntax#}@ctz{#endsyntax#} returns
75247528 the bit width of integer type {#syntax#}T{#endsyntax#}.
75257529 </p>
75267530 {#see_also|@clz|@popCount#}