From dd796154be57da69c0b8467495e9029bb52cb897 Mon Sep 17 00:00:00 2001 From: Auguste Rame Date: Sun, 25 Jul 2021 22:58:58 -0400 Subject: [PATCH] Doc fixes for clz + ctz --- doc/langref.html.in | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index ebb81884e..9e98bb011 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -7366,18 +7366,20 @@ pub const CallOptions = struct { {#header_close#} {#header_open|@clz#} -
{#syntax#}@clz(comptime T: type, integer: T){#endsyntax#}
+
{#syntax#}@clz(comptime T: type, operand: T){#endsyntax#}
+

{#syntax#}T{#endsyntax#} must be an integer type.

+

{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.

- This function counts the number of most-significant (leading in a big-Endian sense) zeroes in {#syntax#}integer{#endsyntax#}. + This function counts the number of most-significant (leading in a big-Endian sense) zeroes in an integer.

- If {#syntax#}integer{#endsyntax#} is known at {#link|comptime#}, + If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer, the return type is {#syntax#}comptime_int{#endsyntax#}. - Otherwise, the return type is an unsigned integer with the minimum number + Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number of bits that can represent the bit count of the integer type.

- If {#syntax#}integer{#endsyntax#} is zero, {#syntax#}@clz{#endsyntax#} returns the bit width + If {#syntax#}operand{#endsyntax#} is zero, {#syntax#}@clz{#endsyntax#} returns the bit width of integer type {#syntax#}T{#endsyntax#}.

{#see_also|@ctz|@popCount#} @@ -7509,18 +7511,20 @@ test "main" { {#header_close#} {#header_open|@ctz#} -
{#syntax#}@ctz(comptime T: type, integer: T){#endsyntax#}
+
{#syntax#}@ctz(comptime T: type, operand: T){#endsyntax#}
+

{#syntax#}T{#endsyntax#} must be an integer type.

+

{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.

- This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in {#syntax#}integer{#endsyntax#}. + This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in an integer.

- If {#syntax#}integer{#endsyntax#} is known at {#link|comptime#}, + If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer, the return type is {#syntax#}comptime_int{#endsyntax#}. - Otherwise, the return type is an unsigned integer with the minimum number + Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number of bits that can represent the bit count of the integer type.

- If {#syntax#}integer{#endsyntax#} is zero, {#syntax#}@ctz{#endsyntax#} returns + If {#syntax#}operand{#endsyntax#} is zero, {#syntax#}@ctz{#endsyntax#} returns the bit width of integer type {#syntax#}T{#endsyntax#}.

{#see_also|@clz|@popCount#}