public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type
@ 2023-12-01 10:26 Jakub Jelinek
  2023-12-01 15:07 ` Jeff Law
  2023-12-01 17:04 ` Sandra Loosemore
  0 siblings, 2 replies; 7+ messages in thread
From: Jakub Jelinek @ 2023-12-01 10:26 UTC (permalink / raw)
  To: Gerald Pfeifer, Joseph Myers, Sandra Loosemore; +Cc: gcc-patches

Hi!

In https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fstdc_005fbit_005ffloor
I've noticed that while e.g. __builtin_stdc_bit_floor builtin is properly
rendered in bold and bigger size, for the __builtin_stdc_bit_width builtin
it is not the builtin name which is marked like that, but the keyword int
before it.  Also, seems such builtins are missing from the index.

I've read the texinfo docs and they seem to suggest in
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Line-Macros.html
that return types of functions with spaces in the return type should be
wrapped with {}s and we already use that e.g. in
@defbuiltin{{void *} __builtin_thread_pointer (void)}

The following patch adjusts builtins I found which contained one or two
spaces in the return type name (plus two spots which used 2 spaces after
single keyword return type instead of 1 which triggered my search regex as
well).

Tested on x86_64-linux, ok for trunk?

2023-12-01  Jakub Jelinek  <jakub@redhat.com>

	* doc/extend.texi (__builtin_addc, __builtin_addcl, __builtin_addcll,
	__builtin_subc, __builtin_subcl, __builtin_subcll,
	__builtin_stdc_bit_width, __builtin_stdc_count_ones,
	__builtin_stdc_count_zeros, __builtin_stdc_first_leading_one,
	__builtin_stdc_first_leading_zero, __builtin_stdc_first_trailing_one,
	__builtin_stdc_first_trailing_zero, __builtin_stdc_has_single_bit,
	__builtin_stdc_leading_ones, __builtin_stdc_leading_zeros,
	__builtin_stdc_trailing_ones, __builtin_stdc_trailing_zeros,
	__builtin_nvptx_brev, __builtin_nvptx_brevll, __builtin_darn,
	__builtin_darn_raw, __builtin_ia32_vec_ext_v2di,
	__builtin_ia32_crc32qi, __builtin_ia32_crc32hi,
	__builtin_ia32_crc32si, __builtin_ia32_crc32di): Put {}s around
	return type with spaces in it.
	(__builtin_rx_mvfachi, __builtin_rx_mvfacmi): Remove superfluous
	whitespace.

--- gcc/doc/extend.texi.jj	2023-12-01 08:10:42.887322032 +0100
+++ gcc/doc/extend.texi	2023-12-01 11:08:30.968219118 +0100
@@ -13238,9 +13238,9 @@ after addition, conditional jump on carr
  
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_addc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out)}
-@defbuiltinx{unsigned long int __builtin_addcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out)}
-@defbuiltinx{unsigned long long int __builtin_addcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out)}
+@defbuiltin{{unsigned int} __builtin_addc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out)}
+@defbuiltinx{{unsigned long int} __builtin_addcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out)}
+@defbuiltinx{{unsigned long long int} __builtin_addcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out)}
 
 These built-in functions are equivalent to:
 @smallexample
@@ -13260,9 +13260,9 @@ emitted if one of them (preferrably the
 
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_subc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out)}
-@defbuiltinx{unsigned long int __builtin_subcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out)}
-@defbuiltinx{unsigned long long int __builtin_subcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out)}
+@defbuiltin{{unsigned int} __builtin_subc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out)}
+@defbuiltinx{{unsigned long int} __builtin_subcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out)}
+@defbuiltinx{{unsigned long long int} __builtin_subcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out)}
 
 These built-in functions are equivalent to:
 @smallexample
@@ -15167,7 +15167,7 @@ where @var{prec} is bit width of @var{ty
 in @var{arg} are evaluated just once.
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_bit_width (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_bit_width (@var{type} @var{arg})}
 The @code{__builtin_stdc_bit_width} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15176,7 +15176,7 @@ performed on the argument.  It is equiva
 where @var{prec} is bit width of @var{type}.
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_count_ones (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_count_ones (@var{type} @var{arg})}
 The @code{__builtin_stdc_count_ones} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15184,7 +15184,7 @@ performed on the argument.  It is equiva
 @code{(unsigned int) __builtin_popcountg (@var{arg})}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_count_zeros (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_count_zeros (@var{type} @var{arg})}
 The @code{__builtin_stdc_count_zeros} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15192,7 +15192,7 @@ performed on the argument.  It is equiva
 @code{(unsigned int) __builtin_popcountg ((@var{type}) ~@var{arg})}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_first_leading_one (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_first_leading_one (@var{type} @var{arg})}
 The @code{__builtin_stdc_first_leading_one} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15200,7 +15200,7 @@ performed on the argument.  It is equiva
 @code{__builtin_clzg (@var{arg}, -1) + 1U}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_first_leading_zero (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_first_leading_zero (@var{type} @var{arg})}
 The @code{__builtin_stdc_first_leading_zero} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15208,7 +15208,7 @@ performed on the argument.  It is equiva
 @code{__builtin_clzg ((@var{type}) ~@var{arg}, -1) + 1U}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_first_trailing_one (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_first_trailing_one (@var{type} @var{arg})}
 The @code{__builtin_stdc_first_trailing_one} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15216,7 +15216,7 @@ performed on the argument.  It is equiva
 @code{__builtin_ctzg (@var{arg}, -1) + 1U}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_first_trailing_zero (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_first_trailing_zero (@var{type} @var{arg})}
 The @code{__builtin_stdc_first_trailing_zero} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15224,7 +15224,7 @@ performed on the argument.  It is equiva
 @code{__builtin_ctzg ((@var{type}) ~@var{arg}, -1) + 1U}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_has_single_bit (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_has_single_bit (@var{type} @var{arg})}
 The @code{__builtin_stdc_has_single_bit} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15232,7 +15232,7 @@ performed on the argument.  It is equiva
 @code{(_Bool) (__builtin_popcountg (@var{arg}) == 1)}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_leading_ones (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_leading_ones (@var{type} @var{arg})}
 The @code{__builtin_stdc_leading_ones} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15240,7 +15240,7 @@ performed on the argument.  It is equiva
 @code{(unsigned int) __builtin_clzg ((@var{type}) ~@var{arg}, @var{prec})}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_leading_zeros (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_leading_zeros (@var{type} @var{arg})}
 The @code{__builtin_stdc_leading_zeros} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15248,7 +15248,7 @@ performed on the argument.  It is equiva
 @code{(unsigned int) __builtin_clzg (@var{arg}, @var{prec})}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_trailing_ones (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_trailing_ones (@var{type} @var{arg})}
 The @code{__builtin_stdc_trailing_ones} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -15256,7 +15256,7 @@ performed on the argument.  It is equiva
 @code{(unsigned int) __builtin_ctzg ((@var{type}) ~@var{arg}, @var{prec})}
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_stdc_trailing_zeros (@var{type} @var{arg})}
+@defbuiltin{{unsigned int} __builtin_stdc_trailing_zeros (@var{type} @var{arg})}
 The @code{__builtin_stdc_trailing_zeros} function is available only
 in C.  It is type-generic, the argument can be any unsigned integer
 (standard, extended or bit-precise).  No integral argument promotions are
@@ -18731,11 +18731,11 @@ Disable global interrupt.
 
 These built-in functions are available for the Nvidia PTX target:
 
-@defbuiltin{unsigned int __builtin_nvptx_brev (unsigned int @var{x})}
+@defbuiltin{{unsigned int} __builtin_nvptx_brev (unsigned int @var{x})}
 Reverse the bit order of a 32-bit unsigned integer.
 @enddefbuiltin
 
-@defbuiltin{unsigned long long __builtin_nvptx_brevll (unsigned long long @var{x})}
+@defbuiltin{{unsigned long long} __builtin_nvptx_brevll (unsigned long long @var{x})}
 Reverse the bit order of a 64-bit unsigned integer.
 @enddefbuiltin
 
@@ -19232,8 +19232,8 @@ round to odd as the rounding mode.
 The following additional built-in functions are also available for the
 PowerPC family of processors, starting with ISA 3.0 or later:
 
-@defbuiltin{long long __builtin_darn (void)}
-@defbuiltinx{long long __builtin_darn_raw (void)}
+@defbuiltin{{long long} __builtin_darn (void)}
+@defbuiltinx{{long long} __builtin_darn_raw (void)}
 @defbuiltinx{int __builtin_darn_32 (void)}
 The @code{__builtin_darn} and @code{__builtin_darn_raw}
 functions require a
@@ -22317,12 +22317,12 @@ multiplying the bottom 16 bits of the tw
 accumulator.
 @enddefbuiltin
 
-@defbuiltin{int  __builtin_rx_mvfachi (void)}
+@defbuiltin{int __builtin_rx_mvfachi (void)}
 Generates the @code{mvfachi} machine instruction to read the top
 32 bits of the accumulator.
 @enddefbuiltin
 
-@defbuiltin{int  __builtin_rx_mvfacmi (void)}
+@defbuiltin{int __builtin_rx_mvfacmi (void)}
 Generates the @code{mvfacmi} machine instruction to read the middle
 32 bits of the accumulator.
 @enddefbuiltin
@@ -23691,7 +23691,7 @@ Generates the @code{extractps} machine i
 Generates the @code{pextrd} machine instruction.
 @enddefbuiltin
 
-@defbuiltin{long long __builtin_ia32_vec_ext_v2di (v2di, const int)}
+@defbuiltin{{long long} __builtin_ia32_vec_ext_v2di (v2di, const int)}
 Generates the @code{pextrq} machine instruction in 64bit mode.
 @enddefbuiltin
 
@@ -23720,19 +23720,19 @@ v2di __builtin_ia32_pcmpgtq (v2di, v2di)
 The following built-in functions are available when @option{-msse4.2} is
 used.
 
-@defbuiltin{unsigned int __builtin_ia32_crc32qi (unsigned int, unsigned char)}
+@defbuiltin{{unsigned int} __builtin_ia32_crc32qi (unsigned int, unsigned char)}
 Generates the @code{crc32b} machine instruction.
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_ia32_crc32hi (unsigned int, unsigned short)}
+@defbuiltin{{unsigned int} __builtin_ia32_crc32hi (unsigned int, unsigned short)}
 Generates the @code{crc32w} machine instruction.
 @enddefbuiltin
 
-@defbuiltin{unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int)}
+@defbuiltin{{unsigned int} __builtin_ia32_crc32si (unsigned int, unsigned int)}
 Generates the @code{crc32l} machine instruction.
 @enddefbuiltin
 
-@defbuiltin{unsigned long long __builtin_ia32_crc32di (unsigned long long, unsigned long long)}
+@defbuiltin{{unsigned long long} __builtin_ia32_crc32di (unsigned long long, unsigned long long)}
 Generates the @code{crc32q} machine instruction.
 @enddefbuiltin
 


	Jakub


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type
  2023-12-01 10:26 [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type Jakub Jelinek
@ 2023-12-01 15:07 ` Jeff Law
  2023-12-01 17:04 ` Sandra Loosemore
  1 sibling, 0 replies; 7+ messages in thread
From: Jeff Law @ 2023-12-01 15:07 UTC (permalink / raw)
  To: Jakub Jelinek, Gerald Pfeifer, Joseph Myers, Sandra Loosemore; +Cc: gcc-patches



On 12/1/23 03:26, Jakub Jelinek wrote:
> Hi!
> 
> In https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fstdc_005fbit_005ffloor
> I've noticed that while e.g. __builtin_stdc_bit_floor builtin is properly
> rendered in bold and bigger size, for the __builtin_stdc_bit_width builtin
> it is not the builtin name which is marked like that, but the keyword int
> before it.  Also, seems such builtins are missing from the index.
> 
> I've read the texinfo docs and they seem to suggest in
> https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Line-Macros.html
> that return types of functions with spaces in the return type should be
> wrapped with {}s and we already use that e.g. in
> @defbuiltin{{void *} __builtin_thread_pointer (void)}
> 
> The following patch adjusts builtins I found which contained one or two
> spaces in the return type name (plus two spots which used 2 spaces after
> single keyword return type instead of 1 which triggered my search regex as
> well).
> 
> Tested on x86_64-linux, ok for trunk?
> 
> 2023-12-01  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* doc/extend.texi (__builtin_addc, __builtin_addcl, __builtin_addcll,
> 	__builtin_subc, __builtin_subcl, __builtin_subcll,
> 	__builtin_stdc_bit_width, __builtin_stdc_count_ones,
> 	__builtin_stdc_count_zeros, __builtin_stdc_first_leading_one,
> 	__builtin_stdc_first_leading_zero, __builtin_stdc_first_trailing_one,
> 	__builtin_stdc_first_trailing_zero, __builtin_stdc_has_single_bit,
> 	__builtin_stdc_leading_ones, __builtin_stdc_leading_zeros,
> 	__builtin_stdc_trailing_ones, __builtin_stdc_trailing_zeros,
> 	__builtin_nvptx_brev, __builtin_nvptx_brevll, __builtin_darn,
> 	__builtin_darn_raw, __builtin_ia32_vec_ext_v2di,
> 	__builtin_ia32_crc32qi, __builtin_ia32_crc32hi,
> 	__builtin_ia32_crc32si, __builtin_ia32_crc32di): Put {}s around
> 	return type with spaces in it.
> 	(__builtin_rx_mvfachi, __builtin_rx_mvfacmi): Remove superfluous
> 	whitespace.
OK
jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type
  2023-12-01 10:26 [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type Jakub Jelinek
  2023-12-01 15:07 ` Jeff Law
@ 2023-12-01 17:04 ` Sandra Loosemore
  2023-12-01 17:33   ` Jakub Jelinek
  1 sibling, 1 reply; 7+ messages in thread
From: Sandra Loosemore @ 2023-12-01 17:04 UTC (permalink / raw)
  To: Jakub Jelinek, Gerald Pfeifer, Joseph Myers, Sandra Loosemore; +Cc: gcc-patches

On 12/1/23 03:26, Jakub Jelinek wrote:
> Hi!
> 
> In https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fstdc_005fbit_005ffloor>> I've noticed that while e.g. __builtin_stdc_bit_floor builtin is properly
> rendered in bold and bigger size, for the __builtin_stdc_bit_width builtin
> it is not the builtin name which is marked like that, but the keyword int
> before it.  Also, seems such builtins are missing from the index.
> 
> I've read the texinfo docs and they seem to suggest in
> https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Line-Macros.html>> that return types of functions with spaces in the return type should be
> wrapped with {}s and we already use that e.g. in
> @defbuiltin{{void *} __builtin_thread_pointer (void)}
> 
> The following patch adjusts builtins I found which contained one or two
> spaces in the return type name (plus two spots which used 2 spaces after
> single keyword return type instead of 1 which triggered my search regex as
> well).
> 
> Tested on x86_64-linux, ok for trunk?

Thanks, this looks good to me.  I think I also noticed this weird formatting in 
passing recently when I was looking for something else and did not have time to 
track it down myself.

-Sandra



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type
  2023-12-01 17:04 ` Sandra Loosemore
@ 2023-12-01 17:33   ` Jakub Jelinek
  2023-12-01 17:43     ` Sandra Loosemore
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2023-12-01 17:33 UTC (permalink / raw)
  To: Sandra Loosemore
  Cc: Gerald Pfeifer, Joseph Myers, Sandra Loosemore, gcc-patches

On Fri, Dec 01, 2023 at 10:04:38AM -0700, Sandra Loosemore wrote:
> Thanks, this looks good to me.  I think I also noticed this weird formatting
> in passing recently when I was looking for something else and did not have
> time to track it down myself.

There is another question.  In many cases we just specify types for the
builtin arguments, in other cases types and names with @var{name} syntax,
and in other case with just name.

@defbuiltin{int __builtin_fpclassify (int, int, int, int, int, ...)}
vs.
@defbuiltin{size_t __builtin_object_size (const void * @var{ptr}, int @var{type})}
vs.
@defbuiltinx{bool __builtin_umull_overflow (unsigned long int a, unsigned long int b, unsigned long int *res)}
and in some cases even just name the arguments and don't specify type:
@defbuiltin{void __builtin_clear_padding (@var{ptr})}
@defbuiltin{@var{type} __builtin_choose_expr (@var{const_exp}, @var{exp1}, @var{exp2})}

Shall we tweak that somehow?  If the argument names are unimportant, perhaps
it is fine to leave that out, but shouldn't we always use @var{...} around
the parameter names when specified?
And avoid leaving out the types, use something like
__builtin_clear_padding (@var{type} *@var{ptr})
or
__builtin_choose_expr (@var{type1} @var{const_exp}, @var{type2} @var{exp1}, @var{type3} @var{exp2})
?

	Jakub


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type
  2023-12-01 17:33   ` Jakub Jelinek
@ 2023-12-01 17:43     ` Sandra Loosemore
  2023-12-04  7:36       ` [PATCH] extend.texi: Mark builtin arguments with @var{...} Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Sandra Loosemore @ 2023-12-01 17:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Gerald Pfeifer, Joseph Myers, Sandra Loosemore, gcc-patches

On 12/1/23 10:33, Jakub Jelinek wrote:
> On Fri, Dec 01, 2023 at 10:04:38AM -0700, Sandra Loosemore wrote:
>> Thanks, this looks good to me.  I think I also noticed this weird formatting
>> in passing recently when I was looking for something else and did not have
>> time to track it down myself.
> 
> There is another question.  In many cases we just specify types for the
> builtin arguments, in other cases types and names with @var{name} syntax,
> and in other case with just name.
> 
> @defbuiltin{int __builtin_fpclassify (int, int, int, int, int, ...)}
> vs.
> @defbuiltin{size_t __builtin_object_size (const void * @var{ptr}, int @var{type})}
> vs.
> @defbuiltinx{bool __builtin_umull_overflow (unsigned long int a, unsigned long int b, unsigned long int *res)}
> and in some cases even just name the arguments and don't specify type:
> @defbuiltin{void __builtin_clear_padding (@var{ptr})}
> @defbuiltin{@var{type} __builtin_choose_expr (@var{const_exp}, @var{exp1}, @var{exp2})}
> 
> Shall we tweak that somehow?  If the argument names are unimportant, perhaps
> it is fine to leave that out, but shouldn't we always use @var{...} around
> the parameter names when specified?

Yup.  The Texinfo manual says:  "When using @deftypefn command and variations, 
you should mark parameter names with @var to distinguish these from data type 
names, keywords, and other parts of the literal syntax of the programming 
language."

> And avoid leaving out the types, use something like
> __builtin_clear_padding (@var{type} *@var{ptr})
> or
> __builtin_choose_expr (@var{type1} @var{const_exp}, @var{type2} @var{exp1}, @var{type3} @var{exp2})
> ?

That would probably be good too.

-Sandra




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] extend.texi: Mark builtin arguments with @var{...}
  2023-12-01 17:43     ` Sandra Loosemore
@ 2023-12-04  7:36       ` Jakub Jelinek
  2023-12-11  1:48         ` Sandra Loosemore
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2023-12-04  7:36 UTC (permalink / raw)
  To: Sandra Loosemore; +Cc: Gerald Pfeifer, Joseph Myers, gcc-patches

On Fri, Dec 01, 2023 at 10:43:57AM -0700, Sandra Loosemore wrote:
> On 12/1/23 10:33, Jakub Jelinek wrote:
> > Shall we tweak that somehow?  If the argument names are unimportant, perhaps
> > it is fine to leave that out, but shouldn't we always use @var{...} around
> > the parameter names when specified?
> 
> Yup.  The Texinfo manual says:  "When using @deftypefn command and
> variations, you should mark parameter names with @var to distinguish these
> from data type names, keywords, and other parts of the literal syntax of the
> programming language."

Here is a patch which does that (but not adding types to where they were
missing, that will be harder to search for).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2023-12-04  Jakub Jelinek  <jakub@redhat.com>

	* doc/extend.texi (__sync_fetch_and_add, __sync_fetch_and_sub,
	__sync_fetch_and_or, __sync_fetch_and_and, __sync_fetch_and_xor,
	__sync_fetch_and_nand, __sync_add_and_fetch, __sync_sub_and_fetch,
	__sync_or_and_fetch, __sync_and_and_fetch, __sync_xor_and_fetch,
	__sync_nand_and_fetch, __sync_bool_compare_and_swap,
	__sync_val_compare_and_swap, __sync_lock_test_and_set,
	__sync_lock_release, __atomic_load_n, __atomic_load, __atomic_store_n,
	__atomic_store, __atomic_exchange_n, __atomic_exchange,
	__atomic_compare_exchange_n, __atomic_compare_exchange,
	__atomic_add_fetch, __atomic_sub_fetch, __atomic_and_fetch,
	__atomic_xor_fetch, __atomic_or_fetch, __atomic_nand_fetch,
	__atomic_fetch_add, __atomic_fetch_sub, __atomic_fetch_and,
	__atomic_fetch_xor, __atomic_fetch_or, __atomic_fetch_nand,
	__atomic_test_and_set, __atomic_clear, __atomic_thread_fence,
	__atomic_signal_fence, __atomic_always_lock_free,
	__atomic_is_lock_free, __builtin_add_overflow,
	__builtin_sadd_overflow, __builtin_saddl_overflow,
	__builtin_saddll_overflow, __builtin_uadd_overflow,
	__builtin_uaddl_overflow, __builtin_uaddll_overflow,
	__builtin_sub_overflow, __builtin_ssub_overflow,
	__builtin_ssubl_overflow, __builtin_ssubll_overflow,
	__builtin_usub_overflow, __builtin_usubl_overflow,
	__builtin_usubll_overflow, __builtin_mul_overflow,
	__builtin_smul_overflow, __builtin_smull_overflow,
	__builtin_smulll_overflow, __builtin_umul_overflow,
	__builtin_umull_overflow, __builtin_umulll_overflow,
	__builtin_add_overflow_p, __builtin_sub_overflow_p,
	__builtin_mul_overflow_p, __builtin_addc, __builtin_addcl,
	__builtin_addcll, __builtin_subc, __builtin_subcl, __builtin_subcll,
	__builtin_alloca, __builtin_alloca_with_align,
	__builtin_alloca_with_align_and_max, __builtin_speculation_safe_value,
	__builtin_nan, __builtin_nand32, __builtin_nand64, __builtin_nand128,
	__builtin_nanf, __builtin_nanl, __builtin_nanf@var{n},
	__builtin_nanf@var{n}x, __builtin_nans, __builtin_nansd32,
	__builtin_nansd64, __builtin_nansd128, __builtin_nansf,
	__builtin_nansl, __builtin_nansf@var{n}, __builtin_nansf@var{n}x,
	__builtin_ffs, __builtin_clz, __builtin_ctz, __builtin_clrsb,
	__builtin_popcount, __builtin_parity, __builtin_bswap16,
	__builtin_bswap32, __builtin_bswap64, __builtin_bswap128,
	__builtin_extend_pointer, __builtin_goacc_parlevel_id,
	__builtin_goacc_parlevel_size, vec_clrl, vec_clrr, vec_mulh, vec_mul,
	vec_div, vec_dive, vec_mod, __builtin_rx_mvtc): Use @var{...} around
	parameter names.
	(vec_rl, vec_sl, vec_sr, vec_sra): Likewise.  Use @var{...} also
	around A, B and R in description.

--- gcc/doc/extend.texi.jj	2023-12-01 16:57:27.577890670 +0100
+++ gcc/doc/extend.texi	2023-12-02 10:35:16.509472645 +0100
@@ -12733,12 +12733,12 @@ variables to be protected.  The list is
 empty.  GCC interprets an empty list as meaning that all globally
 accessible variables should be protected.
 
-@defbuiltin{@var{type} __sync_fetch_and_add (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_fetch_and_sub (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_fetch_and_or (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_fetch_and_and (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_fetch_and_xor (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_fetch_and_nand (@var{type} *ptr, @var{type} value, ...)}
+@defbuiltin{@var{type} __sync_fetch_and_add (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_fetch_and_sub (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_fetch_and_or (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_fetch_and_and (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_fetch_and_xor (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_fetch_and_nand (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
 These built-in functions perform the operation suggested by the name, and
 returns the value that had previously been in memory.  That is, operations
 on integer operands have the following semantics.  Operations on pointer
@@ -12758,13 +12758,13 @@ type.  It must not be a boolean type.
 as @code{*ptr = ~(tmp & value)} instead of @code{*ptr = ~tmp & value}.
 @enddefbuiltin
 
-@defbuiltin{@var{type} __sync_add_and_fetch (@var{type} *ptr, @
-                                             @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_sub_and_fetch (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_or_and_fetch (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_and_and_fetch (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_xor_and_fetch (@var{type} *ptr, @var{type} value, ...)}
-@defbuiltinx{@var{type} __sync_nand_and_fetch (@var{type} *ptr, @var{type} value, ...)}
+@defbuiltin{@var{type} __sync_add_and_fetch (@var{type} *@var{ptr}, @
+                                             @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_sub_and_fetch (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_or_and_fetch (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_and_and_fetch (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_xor_and_fetch (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
+@defbuiltinx{@var{type} __sync_nand_and_fetch (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
 These built-in functions perform the operation suggested by the name, and
 return the new value.  That is, operations on integer operands have
 the following semantics.  Operations on pointer operands are performed as
@@ -12783,8 +12783,8 @@ as @code{*ptr = ~(*ptr & value)} instead
 @code{*ptr = ~*ptr & value}.
 @enddefbuiltin
 
-@defbuiltin{bool __sync_bool_compare_and_swap (@var{type} *ptr, @var{type} oldval, @var{type} newval, ...)}
-@defbuiltinx{@var{type} __sync_val_compare_and_swap (@var{type} *ptr, @var{type} oldval, @var{type} newval, ...)}
+@defbuiltin{bool __sync_bool_compare_and_swap (@var{type} *@var{ptr}, @var{type} @var{oldval}, @var{type} @var{newval}, ...)}
+@defbuiltinx{@var{type} __sync_val_compare_and_swap (@var{type} *@var{ptr}, @var{type} @var{oldval}, @var{type} @var{newval}, ...)}
 These built-in functions perform an atomic compare and swap.
 That is, if the current
 value of @code{*@var{ptr}} is @var{oldval}, then write @var{newval} into
@@ -12799,7 +12799,7 @@ of @code{*@var{ptr}} before the operatio
 This built-in function issues a full memory barrier.
 @enddefbuiltin
 
-@defbuiltin{@var{type} __sync_lock_test_and_set (@var{type} *ptr, @var{type} value, ...)}
+@defbuiltin{@var{type} __sync_lock_test_and_set (@var{type} *@var{ptr}, @var{type} @var{value}, ...)}
 This built-in function, as described by Intel, is not a traditional test-and-set
 operation, but rather an atomic exchange operation.  It writes @var{value}
 into @code{*@var{ptr}}, and returns the previous contents of
@@ -12819,7 +12819,7 @@ be globally visible yet, and previous me
 satisfied.
 @enddefbuiltin
 
-@defbuiltin{void __sync_lock_release (@var{type} *ptr, ...)}
+@defbuiltin{void __sync_lock_release (@var{type} *@var{ptr}, ...)}
 This built-in function releases the lock acquired by
 @code{__sync_lock_test_and_set}.
 Normally this means writing the constant 0 to @code{*@var{ptr}}.
@@ -12936,7 +12936,7 @@ reserved for the memory order.  The rema
 for target use and should be 0.  Use of the predefined atomic values
 ensures proper usage.
 
-@defbuiltin{@var{type} __atomic_load_n (@var{type} *ptr, int memorder)}
+@defbuiltin{@var{type} __atomic_load_n (@var{type} *@var{ptr}, int @var{memorder})}
 This built-in function implements an atomic load operation.  It returns the
 contents of @code{*@var{ptr}}.
 
@@ -12946,13 +12946,13 @@ and @code{__ATOMIC_CONSUME}.
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_load (@var{type} *ptr, @var{type} *ret, int memorder)}
+@defbuiltin{void __atomic_load (@var{type} *@var{ptr}, @var{type} *ret, int @var{memorder})}
 This is the generic version of an atomic load.  It returns the
 contents of @code{*@var{ptr}} in @code{*@var{ret}}.
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_store_n (@var{type} *ptr, @var{type} val, int memorder)}
+@defbuiltin{void __atomic_store_n (@var{type} *@var{ptr}, @var{type} val, int @var{memorder})}
 This built-in function implements an atomic store operation.  It writes 
 @code{@var{val}} into @code{*@var{ptr}}.  
 
@@ -12961,13 +12961,13 @@ The valid memory order variants are
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_store (@var{type} *ptr, @var{type} *val, int memorder)}
+@defbuiltin{void __atomic_store (@var{type} *@var{ptr}, @var{type} *val, int @var{memorder})}
 This is the generic version of an atomic store.  It stores the value
 of @code{*@var{val}} into @code{*@var{ptr}}.
 
 @enddefbuiltin
 
-@defbuiltin{@var{type} __atomic_exchange_n (@var{type} *ptr, @var{type} val, int memorder)}
+@defbuiltin{@var{type} __atomic_exchange_n (@var{type} *@var{ptr}, @var{type} val, int @var{memorder})}
 This built-in function implements an atomic exchange operation.  It writes
 @var{val} into @code{*@var{ptr}}, and returns the previous contents of
 @code{*@var{ptr}}.
@@ -12976,14 +12976,14 @@ All memory order variants are valid.
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_exchange (@var{type} *ptr, @var{type} *val, @var{type} *ret, int memorder)}
+@defbuiltin{void __atomic_exchange (@var{type} *@var{ptr}, @var{type} *val, @var{type} *ret, int @var{memorder})}
 This is the generic version of an atomic exchange.  It stores the
 contents of @code{*@var{val}} into @code{*@var{ptr}}. The original value
 of @code{*@var{ptr}} is copied into @code{*@var{ret}}.
 
 @enddefbuiltin
 
-@defbuiltin{bool __atomic_compare_exchange_n (@var{type} *ptr, @var{type} *expected, @var{type} desired, bool weak, int success_memorder, int failure_memorder)}
+@defbuiltin{bool __atomic_compare_exchange_n (@var{type} *@var{ptr}, @var{type} *@var{expected}, @var{type} @var{desired}, bool @var{weak}, int @var{success_memorder}, int @var{failure_memorder})}
 This built-in function implements an atomic compare and exchange operation.
 This compares the contents of @code{*@var{ptr}} with the contents of
 @code{*@var{expected}}. If equal, the operation is a @emph{read-modify-write}
@@ -13007,7 +13007,7 @@ stronger order than that specified by @v
 
 @enddefbuiltin
 
-@defbuiltin{bool __atomic_compare_exchange (@var{type} *ptr, @var{type} *expected, @var{type} *desired, bool weak, int success_memorder, int failure_memorder)}
+@defbuiltin{bool __atomic_compare_exchange (@var{type} *@var{ptr}, @var{type} *@var{expected}, @var{type} *@var{desired}, bool @var{weak}, int @var{success_memorder}, int @var{failure_memorder})}
 This built-in function implements the generic version of
 @code{__atomic_compare_exchange}.  The function is virtually identical to
 @code{__atomic_compare_exchange_n}, except the desired value is also a
@@ -13015,12 +13015,12 @@ pointer.
 
 @enddefbuiltin
 
-@defbuiltin{@var{type} __atomic_add_fetch (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_sub_fetch (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_and_fetch (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_xor_fetch (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_or_fetch (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_nand_fetch (@var{type} *ptr, @var{type} val, int memorder)}
+@defbuiltin{@var{type} __atomic_add_fetch (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_sub_fetch (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_and_fetch (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_xor_fetch (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_or_fetch (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_nand_fetch (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
 These built-in functions perform the operation suggested by the name, and
 return the result of the operation.  Operations on pointer arguments are
 performed as if the operands were of the @code{uintptr_t} type.  That is,
@@ -13036,12 +13036,12 @@ type.  It must not be a boolean type.  A
 
 @enddefbuiltin
 
-@defbuiltin{@var{type} __atomic_fetch_add (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_fetch_sub (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_fetch_and (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_fetch_xor (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_fetch_or (@var{type} *ptr, @var{type} val, int memorder)}
-@defbuiltinx{@var{type} __atomic_fetch_nand (@var{type} *ptr, @var{type} val, int memorder)}
+@defbuiltin{@var{type} __atomic_fetch_add (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_fetch_sub (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_fetch_and (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_fetch_xor (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_fetch_or (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
+@defbuiltinx{@var{type} __atomic_fetch_nand (@var{type} *@var{ptr}, @var{type} @var{val}, int @var{memorder})}
 These built-in functions perform the operation suggested by the name, and
 return the value that had previously been in @code{*@var{ptr}}.  Operations
 on pointer arguments are performed as if the operands were of
@@ -13058,7 +13058,7 @@ The same constraints on arguments apply
 
 @enddefbuiltin
 
-@defbuiltin{bool __atomic_test_and_set (void *ptr, int memorder)}
+@defbuiltin{bool __atomic_test_and_set (void *@var{ptr}, int @var{memorder})}
 
 This built-in function performs an atomic test-and-set operation on
 the byte at @code{*@var{ptr}}.  The byte is set to some implementation
@@ -13071,7 +13071,7 @@ All memory orders are valid.
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_clear (bool *ptr, int memorder)}
+@defbuiltin{void __atomic_clear (bool *@var{ptr}, int @var{memorder})}
 
 This built-in function performs an atomic clear operation on
 @code{*@var{ptr}}.  After the operation, @code{*@var{ptr}} contains 0.
@@ -13086,7 +13086,7 @@ The valid memory order variants are
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_thread_fence (int memorder)}
+@defbuiltin{void __atomic_thread_fence (int @var{memorder})}
 
 This built-in function acts as a synchronization fence between threads
 based on the specified memory order.
@@ -13095,7 +13095,7 @@ All memory orders are valid.
 
 @enddefbuiltin
 
-@defbuiltin{void __atomic_signal_fence (int memorder)}
+@defbuiltin{void __atomic_signal_fence (int @var{memorder})}
 
 This built-in function acts as a synchronization fence between a thread
 and signal handlers based in the same thread.
@@ -13104,7 +13104,7 @@ All memory orders are valid.
 
 @enddefbuiltin
 
-@defbuiltin{bool __atomic_always_lock_free (size_t size,  void *ptr)}
+@defbuiltin{bool __atomic_always_lock_free (size_t @var{size},  void *@var{ptr})}
 
 This built-in function returns @code{true} if objects of @var{size} bytes always
 generate lock-free atomic instructions for the target architecture.
@@ -13121,7 +13121,7 @@ if (__atomic_always_lock_free (sizeof (l
 
 @enddefbuiltin
 
-@defbuiltin{bool __atomic_is_lock_free (size_t size, void *ptr)}
+@defbuiltin{bool __atomic_is_lock_free (size_t @var{size}, void *@var{ptr})}
 
 This built-in function returns @code{true} if objects of @var{size} bytes always
 generate lock-free atomic instructions for the target architecture.  If
@@ -13139,13 +13139,13 @@ compiler may also ignore this parameter.
 The following built-in functions allow performing simple arithmetic operations
 together with checking whether the operations overflowed.
 
-@defbuiltin{bool __builtin_add_overflow (@var{type1} a, @var{type2} b, @var{type3} *res)}
-@defbuiltinx{bool __builtin_sadd_overflow (int a, int b, int *res)}
-@defbuiltinx{bool __builtin_saddl_overflow (long int a, long int b, long int *res)}
-@defbuiltinx{bool __builtin_saddll_overflow (long long int a, long long int b, long long int *res)}
-@defbuiltinx{bool __builtin_uadd_overflow (unsigned int a, unsigned int b, unsigned int *res)}
-@defbuiltinx{bool __builtin_uaddl_overflow (unsigned long int a, unsigned long int b, unsigned long int *res)}
-@defbuiltinx{bool __builtin_uaddll_overflow (unsigned long long int a, unsigned long long int b, unsigned long long int *res)}
+@defbuiltin{bool __builtin_add_overflow (@var{type1} @var{a}, @var{type2} @var{b}, @var{type3} *@var{res})}
+@defbuiltinx{bool __builtin_sadd_overflow (int @var{a}, int @var{b}, int *@var{res})}
+@defbuiltinx{bool __builtin_saddl_overflow (long int @var{a}, long int @var{b}, long int *@var{res})}
+@defbuiltinx{bool __builtin_saddll_overflow (long long int @var{a}, long long int @var{b}, long long int *@var{res})}
+@defbuiltinx{bool __builtin_uadd_overflow (unsigned int @var{a}, unsigned int @var{b}, unsigned int *@var{res})}
+@defbuiltinx{bool __builtin_uaddl_overflow (unsigned long int @var{a}, unsigned long int @var{b}, unsigned long int *@var{res})}
+@defbuiltinx{bool __builtin_uaddll_overflow (unsigned long long int @var{a}, unsigned long long int @var{b}, unsigned long long int *@var{res})}
 
 These built-in functions promote the first two operands into infinite precision signed
 type and perform addition on those promoted operands.  The result is then
@@ -13165,13 +13165,13 @@ after addition, conditional jump on carr
 
 @enddefbuiltin
 
-@defbuiltin{bool __builtin_sub_overflow (@var{type1} a, @var{type2} b, @var{type3} *res)}
-@defbuiltinx{bool __builtin_ssub_overflow (int a, int b, int *res)}
-@defbuiltinx{bool __builtin_ssubl_overflow (long int a, long int b, long int *res)}
-@defbuiltinx{bool __builtin_ssubll_overflow (long long int a, long long int b, long long int *res)}
-@defbuiltinx{bool __builtin_usub_overflow (unsigned int a, unsigned int b, unsigned int *res)}
-@defbuiltinx{bool __builtin_usubl_overflow (unsigned long int a, unsigned long int b, unsigned long int *res)}
-@defbuiltinx{bool __builtin_usubll_overflow (unsigned long long int a, unsigned long long int b, unsigned long long int *res)}
+@defbuiltin{bool __builtin_sub_overflow (@var{type1} @var{a}, @var{type2} @var{b}, @var{type3} *@var{res})}
+@defbuiltinx{bool __builtin_ssub_overflow (int @var{a}, int @var{b}, int *@var{res})}
+@defbuiltinx{bool __builtin_ssubl_overflow (long int @var{a}, long int @var{b}, long int *@var{res})}
+@defbuiltinx{bool __builtin_ssubll_overflow (long long int @var{a}, long long int @var{b}, long long int *@var{res})}
+@defbuiltinx{bool __builtin_usub_overflow (unsigned int @var{a}, unsigned int @var{b}, unsigned int *@var{res})}
+@defbuiltinx{bool __builtin_usubl_overflow (unsigned long int @var{a}, unsigned long int @var{b}, unsigned long int *@var{res})}
+@defbuiltinx{bool __builtin_usubll_overflow (unsigned long long int @var{a}, unsigned long long int @var{b}, unsigned long long int *@var{res})}
 
 These built-in functions are similar to the add overflow checking built-in
 functions above, except they perform subtraction, subtract the second argument
@@ -13179,13 +13179,13 @@ from the first one, instead of addition.
 
 @enddefbuiltin
 
-@defbuiltin{bool __builtin_mul_overflow (@var{type1} a, @var{type2} b, @var{type3} *res)}
-@defbuiltinx{bool __builtin_smul_overflow (int a, int b, int *res)}
-@defbuiltinx{bool __builtin_smull_overflow (long int a, long int b, long int *res)}
-@defbuiltinx{bool __builtin_smulll_overflow (long long int a, long long int b, long long int *res)}
-@defbuiltinx{bool __builtin_umul_overflow (unsigned int a, unsigned int b, unsigned int *res)}
-@defbuiltinx{bool __builtin_umull_overflow (unsigned long int a, unsigned long int b, unsigned long int *res)}
-@defbuiltinx{bool __builtin_umulll_overflow (unsigned long long int a, unsigned long long int b, unsigned long long int *res)}
+@defbuiltin{bool __builtin_mul_overflow (@var{type1} @var{a}, @var{type2} @var{b}, @var{type3} *@var{res})}
+@defbuiltinx{bool __builtin_smul_overflow (int @var{a}, int @var{b}, int *@var{res})}
+@defbuiltinx{bool __builtin_smull_overflow (long int @var{a}, long int @var{b}, long int *@var{res})}
+@defbuiltinx{bool __builtin_smulll_overflow (long long int @var{a}, long long int @var{b}, long long int *@var{res})}
+@defbuiltinx{bool __builtin_umul_overflow (unsigned int @var{a}, unsigned int @var{b}, unsigned int *@var{res})}
+@defbuiltinx{bool __builtin_umull_overflow (unsigned long int @var{a}, unsigned long int @var{b}, unsigned long int *@var{res})}
+@defbuiltinx{bool __builtin_umulll_overflow (unsigned long long int @var{a}, unsigned long long int @var{b}, unsigned long long int *@var{res})}
 
 These built-in functions are similar to the add overflow checking built-in
 functions above, except they perform multiplication, instead of addition.
@@ -13195,9 +13195,9 @@ functions above, except they perform mul
 The following built-in functions allow checking if simple arithmetic operation
 would overflow.
 
-@defbuiltin{bool __builtin_add_overflow_p (@var{type1} a, @var{type2} b, @var{type3} c)}
-@defbuiltinx{bool __builtin_sub_overflow_p (@var{type1} a, @var{type2} b, @var{type3} c)}
-@defbuiltinx{bool __builtin_mul_overflow_p (@var{type1} a, @var{type2} b, @var{type3} c)}
+@defbuiltin{bool __builtin_add_overflow_p (@var{type1} @var{a}, @var{type2} @var{b}, @var{type3} @var{c})}
+@defbuiltinx{bool __builtin_sub_overflow_p (@var{type1} @var{a}, @var{type2} @var{b}, @var{type3} @var{c})}
+@defbuiltinx{bool __builtin_mul_overflow_p (@var{type1} @var{a}, @var{type2} @var{b}, @var{type3} @var{c})}
 
 These built-in functions are similar to @code{__builtin_add_overflow},
 @code{__builtin_sub_overflow}, or @code{__builtin_mul_overflow}, except that
@@ -13237,9 +13237,9 @@ after addition, conditional jump on carr
  
 @enddefbuiltin
 
-@defbuiltin{{unsigned int} __builtin_addc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out)}
-@defbuiltinx{{unsigned long int} __builtin_addcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out)}
-@defbuiltinx{{unsigned long long int} __builtin_addcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out)}
+@defbuiltin{{unsigned int} __builtin_addc (unsigned int @var{a}, unsigned int @var{b}, unsigned int @var{carry_in}, unsigned int *@var{carry_out})}
+@defbuiltinx{{unsigned long int} __builtin_addcl (unsigned long int @var{a}, unsigned long int @var{b}, unsigned int @var{carry_in}, unsigned long int *@var{carry_out})}
+@defbuiltinx{{unsigned long long int} __builtin_addcll (unsigned long long int @var{a}, unsigned long long int @var{b}, unsigned long long int @var{carry_in}, unsigned long long int *@var{carry_out})}
 
 These built-in functions are equivalent to:
 @smallexample
@@ -13259,9 +13259,9 @@ emitted if one of them (preferrably the
 
 @enddefbuiltin
 
-@defbuiltin{{unsigned int} __builtin_subc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out)}
-@defbuiltinx{{unsigned long int} __builtin_subcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out)}
-@defbuiltinx{{unsigned long long int} __builtin_subcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out)}
+@defbuiltin{{unsigned int} __builtin_subc (unsigned int @var{a}, unsigned int @var{b}, unsigned int @var{carry_in}, unsigned int *@var{carry_out})}
+@defbuiltinx{{unsigned long int} __builtin_subcl (unsigned long int @var{a}, unsigned long int @var{b}, unsigned int @var{carry_in}, unsigned long int *@var{carry_out})}
+@defbuiltinx{{unsigned long long int} __builtin_subcll (unsigned long long int @var{a}, unsigned long long int @var{b}, unsigned long long int @var{carry_in}, unsigned long long int *@var{carry_out})}
 
 These built-in functions are equivalent to:
 @smallexample
@@ -14043,7 +14043,7 @@ for all target libcs, but in all cases t
 calls.  These built-in functions appear both with and without the
 @code{__builtin_} prefix.
 
-@defbuiltin{{void *} __builtin_alloca (size_t size)}
+@defbuiltin{{void *} __builtin_alloca (size_t @var{size})}
 The @code{__builtin_alloca} function must be called at block scope.
 The function allocates an object @var{size} bytes large on the stack
 of the calling function.  The object is aligned on the default stack
@@ -14083,7 +14083,7 @@ where GCC provides them as an extension.
 
 @enddefbuiltin
 
-@defbuiltin{{void *} __builtin_alloca_with_align (size_t size, size_t alignment)}
+@defbuiltin{{void *} __builtin_alloca_with_align (size_t @var{size}, size_t @var{alignment})}
 The @code{__builtin_alloca_with_align} function must be called at block
 scope.  The function allocates an object @var{size} bytes large on
 the stack of the calling function.  The allocated object is aligned on
@@ -14130,7 +14130,7 @@ an extension.  @xref{Variable Length}, f
 
 @enddefbuiltin
 
-@defbuiltin{{void *} __builtin_alloca_with_align_and_max (size_t size, size_t alignment, size_t max_size)}
+@defbuiltin{{void *} __builtin_alloca_with_align_and_max (size_t @var{size}, size_t @var{alignment}, size_t @var{max_size})}
 Similar to @code{__builtin_alloca_with_align} but takes an extra argument
 specifying an upper bound for @var{size} in case its value cannot be computed
 at compile time, for use by @option{-fstack-usage}, @option{-Wstack-usage}
@@ -14183,7 +14183,7 @@ recognized in such contexts.
 
 @enddefbuiltin
 
-@defbuiltin{@var{type} __builtin_speculation_safe_value (@var{type} val, @var{type} failval)}
+@defbuiltin{@var{type} __builtin_speculation_safe_value (@var{type} @var{val}, @var{type} @var{failval})}
 
 This built-in function can be used to help mitigate against unsafe
 speculative execution.  @var{type} may be any integral type or any
@@ -14915,7 +14915,7 @@ argument.  GCC treats this parameter as
 does not do default promotion from float to double.
 @enddefbuiltin
 
-@defbuiltin{double __builtin_nan (const char *str)}
+@defbuiltin{double __builtin_nan (const char *@var{str})}
 This is an implementation of the ISO C99 function @code{nan}.
 
 Since ISO C99 defines this function in terms of @code{strtod}, which we
@@ -14932,68 +14932,68 @@ consumed by @code{strtol}, is evaluated
 compile-time constant.
 @enddefbuiltin
 
-@defbuiltin{_Decimal32 __builtin_nand32 (const char *str)}
+@defbuiltin{_Decimal32 __builtin_nand32 (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is @code{_Decimal32}.
 @enddefbuiltin
 
-@defbuiltin{_Decimal64 __builtin_nand64 (const char *str)}
+@defbuiltin{_Decimal64 __builtin_nand64 (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is @code{_Decimal64}.
 @enddefbuiltin
 
-@defbuiltin{_Decimal128 __builtin_nand128 (const char *str)}
+@defbuiltin{_Decimal128 __builtin_nand128 (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is @code{_Decimal128}.
 @enddefbuiltin
 
-@defbuiltin{float __builtin_nanf (const char *str)}
+@defbuiltin{float __builtin_nanf (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is @code{float}.
 @enddefbuiltin
 
-@defbuiltin{{long double} __builtin_nanl (const char *str)}
+@defbuiltin{{long double} __builtin_nanl (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is @code{long double}.
 @enddefbuiltin
 
-@defbuiltin{_Float@var{n} __builtin_nanf@var{n} (const char *str)}
+@defbuiltin{_Float@var{n} __builtin_nanf@var{n} (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is
 @code{_Float@var{n}}.
 @enddefbuiltin
 
-@defbuiltin{_Float@var{n}x __builtin_nanf@var{n}x (const char *str)}
+@defbuiltin{_Float@var{n}x __builtin_nanf@var{n}x (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the return type is
 @code{_Float@var{n}x}.
 @enddefbuiltin
 
-@defbuiltin{double __builtin_nans (const char *str)}
+@defbuiltin{double __builtin_nans (const char *@var{str})}
 Similar to @code{__builtin_nan}, except the significand is forced
 to be a signaling NaN@.  The @code{nans} function is proposed by
 @uref{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n965.htm,,WG14 N965}.
 @enddefbuiltin
 
-@defbuiltin{_Decimal32 __builtin_nansd32 (const char *str)}
+@defbuiltin{_Decimal32 __builtin_nansd32 (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is @code{_Decimal32}.
 @enddefbuiltin
 
-@defbuiltin{_Decimal64 __builtin_nansd64 (const char *str)}
+@defbuiltin{_Decimal64 __builtin_nansd64 (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is @code{_Decimal64}.
 @enddefbuiltin
 
-@defbuiltin{_Decimal128 __builtin_nansd128 (const char *str)}
+@defbuiltin{_Decimal128 __builtin_nansd128 (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is @code{_Decimal128}.
 @enddefbuiltin
 
-@defbuiltin{float __builtin_nansf (const char *str)}
+@defbuiltin{float __builtin_nansf (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is @code{float}.
 @enddefbuiltin
 
-@defbuiltin{{long double} __builtin_nansl (const char *str)}
+@defbuiltin{{long double} __builtin_nansl (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is @code{long double}.
 @enddefbuiltin
 
-@defbuiltin{_Float@var{n} __builtin_nansf@var{n} (const char *str)}
+@defbuiltin{_Float@var{n} __builtin_nansf@var{n} (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is
 @code{_Float@var{n}}.
 @enddefbuiltin
 
-@defbuiltin{_Float@var{n}x __builtin_nansf@var{n}x (const char *str)}
+@defbuiltin{_Float@var{n}x __builtin_nansf@var{n}x (const char *@var{str})}
 Similar to @code{__builtin_nans}, except the return type is
 @code{_Float@var{n}x}.
 @enddefbuiltin
@@ -15012,32 +15012,32 @@ With @code{-ffinite-math-only} option th
 return 0.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_ffs (int x)}
+@defbuiltin{int __builtin_ffs (int @var{x})}
 Returns one plus the index of the least significant 1-bit of @var{x}, or
 if @var{x} is zero, returns zero.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_clz (unsigned int x)}
+@defbuiltin{int __builtin_clz (unsigned int @var{x})}
 Returns the number of leading 0-bits in @var{x}, starting at the most
 significant bit position.  If @var{x} is 0, the result is undefined.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_ctz (unsigned int x)}
+@defbuiltin{int __builtin_ctz (unsigned int @var{x})}
 Returns the number of trailing 0-bits in @var{x}, starting at the least
 significant bit position.  If @var{x} is 0, the result is undefined.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_clrsb (int x)}
+@defbuiltin{int __builtin_clrsb (int @var{x})}
 Returns the number of leading redundant sign bits in @var{x}, i.e.@: the
 number of bits following the most significant bit that are identical
 to it.  There are no special cases for 0 or other values. 
 @enddefbuiltin
 
-@defbuiltin{int __builtin_popcount (unsigned int x)}
+@defbuiltin{int __builtin_popcount (unsigned int @var{x})}
 Returns the number of 1-bits in @var{x}.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_parity (unsigned int x)}
+@defbuiltin{int __builtin_parity (unsigned int @var{x})}
 Returns the parity of @var{x}, i.e.@: the number of 1-bits in @var{x}
 modulo 2.
 @enddefbuiltin
@@ -15270,29 +15270,29 @@ Returns the first argument raised to the
 @code{pow} function no guarantees about precision and rounding are made.
 @enddefbuiltin
 
-@defbuiltin{uint16_t __builtin_bswap16 (uint16_t x)}
+@defbuiltin{uint16_t __builtin_bswap16 (uint16_t @var{x})}
 Returns @var{x} with the order of the bytes reversed; for example,
 @code{0xaabb} becomes @code{0xbbaa}.  Byte here always means
 exactly 8 bits.
 @enddefbuiltin
 
-@defbuiltin{uint32_t __builtin_bswap32 (uint32_t x)}
+@defbuiltin{uint32_t __builtin_bswap32 (uint32_t @var{x})}
 Similar to @code{__builtin_bswap16}, except the argument and return types
 are 32-bit.
 @enddefbuiltin
 
-@defbuiltin{uint64_t __builtin_bswap64 (uint64_t x)}
+@defbuiltin{uint64_t __builtin_bswap64 (uint64_t @var{x})}
 Similar to @code{__builtin_bswap32}, except the argument and return types
 are 64-bit.
 @enddefbuiltin
 
-@defbuiltin{uint128_t __builtin_bswap128 (uint128_t x)}
+@defbuiltin{uint128_t __builtin_bswap128 (uint128_t @var{x})}
 Similar to @code{__builtin_bswap64}, except the argument and return types
 are 128-bit.  Only supported on targets when 128-bit types are supported.
 @enddefbuiltin
 
 
-@defbuiltin{Pmode __builtin_extend_pointer (void * x)}
+@defbuiltin{Pmode __builtin_extend_pointer (void * @var{x})}
 On targets where the user visible pointer size is smaller than the size
 of an actual hardware address this function returns the extended user
 pointer.  Targets where this is true included ILP32 mode on x86_64 or
@@ -15300,12 +15300,12 @@ Aarch64.  This function is mainly useful
 code.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_goacc_parlevel_id (int x)}
+@defbuiltin{int __builtin_goacc_parlevel_id (int @var{x})}
 Returns the openacc gang, worker or vector id depending on whether @var{x} is
 0, 1 or 2.
 @enddefbuiltin
 
-@defbuiltin{int __builtin_goacc_parlevel_size (int x)}
+@defbuiltin{int __builtin_goacc_parlevel_size (int @var{x})}
 Returns the openacc gang, worker or vector size depending on whether @var{x} is
 0, 1 or 2.
 @enddefbuiltin
@@ -20911,9 +20911,9 @@ implemented by the @code{vctzdm} instruc
 
 @smallexample
 @exdent vector signed char
-@exdent vec_clrl (vector signed char a, unsigned int n);
+@exdent vec_clrl (vector signed char @var{a}, unsigned int @var{n});
 @exdent vector unsigned char
-@exdent vec_clrl (vector unsigned char a, unsigned int n);
+@exdent vec_clrl (vector unsigned char @var{a}, unsigned int @var{n});
 @end smallexample
 Clear the left-most @code{(16 - n)} bytes of vector argument @code{a}, as if
 implemented by the @code{vclrlb} instruction on a big-endian target
@@ -20923,9 +20923,9 @@ value of @code{n} that is greater than 1
 
 @smallexample
 @exdent vector signed char
-@exdent vec_clrr (vector signed char a, unsigned int n);
+@exdent vec_clrr (vector signed char @var{a}, unsigned int @var{n});
 @exdent vector unsigned char
-@exdent vec_clrr (vector unsigned char a, unsigned int n);
+@exdent vec_clrr (vector unsigned char @var{a}, unsigned int @var{n});
 @end smallexample
 Clear the right-most @code{(16 - n)} bytes of vector argument @code{a}, as if
 implemented by the @code{vclrrb} instruction on a big-endian target
@@ -21379,9 +21379,9 @@ Vector Integer Multiply/Divide/Modulo
 
 @smallexample
 @exdent vector signed int
-@exdent vec_mulh (vector signed int a, vector signed int b);
+@exdent vec_mulh (vector signed int @var{a}, vector signed int @var{b});
 @exdent vector unsigned int
-@exdent vec_mulh (vector unsigned int a, vector unsigned int b);
+@exdent vec_mulh (vector unsigned int @var{a}, vector unsigned int @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 3, do the following. The integer
@@ -21391,9 +21391,9 @@ into word element @code{i} of the vector
 
 @smallexample
 @exdent vector signed long long
-@exdent vec_mulh (vector signed long long a, vector signed long long b);
+@exdent vec_mulh (vector signed long long @var{a}, vector signed long long @var{b});
 @exdent vector unsigned long long
-@exdent vec_mulh (vector unsigned long long a, vector unsigned long long b);
+@exdent vec_mulh (vector unsigned long long @var{a}, vector unsigned long long @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 1, do the following. The integer
@@ -21403,9 +21403,9 @@ are placed into doubleword element @code
 
 @smallexample
 @exdent vector unsigned long long
-@exdent vec_mul (vector unsigned long long a, vector unsigned long long b);
+@exdent vec_mul (vector unsigned long long @var{a}, vector unsigned long long @var{b});
 @exdent vector signed long long
-@exdent vec_mul (vector signed long long a, vector signed long long b);
+@exdent vec_mul (vector signed long long @var{a}, vector signed long long @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 1, do the following. The integer
@@ -21415,9 +21415,9 @@ are placed into doubleword element @code
 
 @smallexample
 @exdent vector signed int
-@exdent vec_div (vector signed int a, vector signed int b);
+@exdent vec_div (vector signed int @var{a}, vector signed int @var{b});
 @exdent vector unsigned int
-@exdent vec_div (vector unsigned int a, vector unsigned int b);
+@exdent vec_div (vector unsigned int @var{a}, vector unsigned int @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 3, do the following. The integer in
@@ -21428,9 +21428,9 @@ the vector returned. If an attempt is ma
 
 @smallexample
 @exdent vector signed long long
-@exdent vec_div (vector signed long long a, vector signed long long b);
+@exdent vec_div (vector signed long long @var{a}, vector signed long long @var{b});
 @exdent vector unsigned long long
-@exdent vec_div (vector unsigned long long a, vector unsigned long long b);
+@exdent vec_div (vector unsigned long long @var{a}, vector unsigned long long @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 1, do the following. The integer in
@@ -21442,9 +21442,9 @@ the quotient is undefined.
 
 @smallexample
 @exdent vector signed int
-@exdent vec_dive (vector signed int a, vector signed int b);
+@exdent vec_dive (vector signed int @var{a}, vector signed int @var{b});
 @exdent vector unsigned int
-@exdent vec_dive (vector unsigned int a, vector unsigned int b);
+@exdent vec_dive (vector unsigned int @var{a}, vector unsigned int @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 3, do the following. The integer in
@@ -21456,9 +21456,9 @@ divisions <anything> ÷ 0 then the quoti
 
 @smallexample
 @exdent vector signed long long
-@exdent vec_dive (vector signed long long a, vector signed long long b);
+@exdent vec_dive (vector signed long long @var{a}, vector signed long long @var{b});
 @exdent vector unsigned long long
-@exdent vec_dive (vector unsigned long long a, vector unsigned long long b);
+@exdent vec_dive (vector unsigned long long @var{a}, vector unsigned long long @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 1, do the following. The integer in
@@ -21470,9 +21470,9 @@ quotient cannot be represented in 64 bit
 
 @smallexample
 @exdent vector signed int
-@exdent vec_mod (vector signed int a, vector signed int b);
+@exdent vec_mod (vector signed int @var{a}, vector signed int @var{b});
 @exdent vector unsigned int
-@exdent vec_mod (vector unsigned int a, vector unsigned int b);
+@exdent vec_mod (vector unsigned int @var{a}, vector unsigned int @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 3, do the following. The integer in
@@ -21483,9 +21483,9 @@ the vector returned.  If an attempt is m
 
 @smallexample
 @exdent vector signed long long
-@exdent vec_mod (vector signed long long a, vector signed long long b);
+@exdent vec_mod (vector signed long long @var{a}, vector signed long long @var{b});
 @exdent vector unsigned long long
-@exdent vec_mod (vector unsigned long long a, vector unsigned long long b);
+@exdent vec_mod (vector unsigned long long @var{a}, vector unsigned long long @var{b});
 @end smallexample
 
 For each integer value @code{i} from 0 to 1, do the following. The integer in
@@ -21500,14 +21500,14 @@ immediate value is either 0, 1, 2 or 3.
 @findex vec_genpcvm
 
 @smallexample
-@exdent vector unsigned __int128 vec_rl (vector unsigned __int128 A,
-                                         vector unsigned __int128 B);
-@exdent vector signed __int128 vec_rl (vector signed __int128 A,
-                                       vector unsigned __int128 B);
+@exdent vector unsigned __int128 vec_rl (vector unsigned __int128 @var{A},
+                                         vector unsigned __int128 @var{B});
+@exdent vector signed __int128 vec_rl (vector signed __int128 @var{A},
+                                       vector unsigned __int128 @var{B});
 @end smallexample
 
-Result value: Each element of R is obtained by rotating the corresponding element
-of A left by the number of bits specified by the corresponding element of B.
+Result value: Each element of @var{R} is obtained by rotating the corresponding element
+of @var{A} left by the number of bits specified by the corresponding element of @var{B}.
 
 
 @smallexample
@@ -21541,28 +21541,28 @@ input.  The shift is obtained from the t
 [125:131] where all bits counted from zero at the left.
 
 @smallexample
-@exdent vector unsigned __int128 vec_sl(vector unsigned __int128 A, vector unsigned __int128 B);
-@exdent vector signed __int128 vec_sl(vector signed __int128 A, vector unsigned __int128 B);
+@exdent vector unsigned __int128 vec_sl(vector unsigned __int128 @var{A}, vector unsigned __int128 @var{B});
+@exdent vector signed __int128 vec_sl(vector signed __int128 @var{A}, vector unsigned __int128 @var{B});
 @end smallexample
 
-Result value: Each element of R is obtained by shifting the corresponding element of
-A left by the number of bits specified by the corresponding element of B.
+Result value: Each element of @var{R} is obtained by shifting the corresponding element of
+@var{A} left by the number of bits specified by the corresponding element of @var{B}.
 
 @smallexample
-@exdent vector unsigned __int128 vec_sr(vector unsigned __int128 A, vector unsigned __int128 B);
-@exdent vector signed __int128 vec_sr(vector signed __int128 A, vector unsigned __int128 B);
+@exdent vector unsigned __int128 vec_sr(vector unsigned __int128 @var{A}, vector unsigned __int128 @var{B});
+@exdent vector signed __int128 vec_sr(vector signed __int128 @var{A}, vector unsigned __int128 @var{B});
 @end smallexample
 
-Result value: Each element of R is obtained by shifting the corresponding element of
-A right by the number of bits specified by the corresponding element of B.
+Result value: Each element of @var{R} is obtained by shifting the corresponding element of
+@var{A} right by the number of bits specified by the corresponding element of @var{B}.
 
 @smallexample
-@exdent vector unsigned __int128 vec_sra(vector unsigned __int128 A, vector unsigned __int128 B);
-@exdent vector signed __int128 vec_sra(vector signed __int128 A, vector unsigned __int128 B);
+@exdent vector unsigned __int128 vec_sra(vector unsigned __int128 @var{A}, vector unsigned __int128 @var{B});
+@exdent vector signed __int128 vec_sra(vector signed __int128 @var{A}, vector unsigned __int128 @var{B});
 @end smallexample
 
-Result value: Each element of R is obtained by arithmetic shifting the corresponding
-element of A right by the number of bits specified by the corresponding element of B.
+Result value: Each element of @var{R} is obtained by arithmetic shifting the corresponding
+element of @var{A} right by the number of bits specified by the corresponding element of @var{B}.
 
 @smallexample
 @exdent vector unsigned __int128 vec_mule (vector unsigned long long,
@@ -22341,7 +22341,7 @@ Generates the @code{mvtaclo} machine ins
 32 bits of the accumulator.
 @enddefbuiltin
 
-@defbuiltin{void __builtin_rx_mvtc (int reg, int val)}
+@defbuiltin{void __builtin_rx_mvtc (int @var{reg}, int @var{val})}
 Generates the @code{mvtc} machine instruction which sets control
 register number @code{reg} to @code{val}.
 @enddefbuiltin

	Jakub


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] extend.texi: Mark builtin arguments with @var{...}
  2023-12-04  7:36       ` [PATCH] extend.texi: Mark builtin arguments with @var{...} Jakub Jelinek
@ 2023-12-11  1:48         ` Sandra Loosemore
  0 siblings, 0 replies; 7+ messages in thread
From: Sandra Loosemore @ 2023-12-11  1:48 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Gerald Pfeifer, Joseph Myers, gcc-patches

On 12/4/23 00:36, Jakub Jelinek wrote:
> On Fri, Dec 01, 2023 at 10:43:57AM -0700, Sandra Loosemore wrote:
>> On 12/1/23 10:33, Jakub Jelinek wrote:
>>> Shall we tweak that somehow?  If the argument names are unimportant, perhaps
>>> it is fine to leave that out, but shouldn't we always use @var{...} around
>>> the parameter names when specified?
>>
>> Yup.  The Texinfo manual says:  "When using @deftypefn command and
>> variations, you should mark parameter names with @var to distinguish these
>> from data type names, keywords, and other parts of the literal syntax of the
>> programming language."
> 
> Here is a patch which does that (but not adding types to where they were
> missing, that will be harder to search for).
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

This is mostly OK, but I noticed some things you missed:

> @@ -12946,13 +12946,13 @@ and @code{__ATOMIC_CONSUME}.
>   
>   @enddefbuiltin
>   
> -@defbuiltin{void __atomic_load (@var{type} *ptr, @var{type} *ret, int memorder)}
> +@defbuiltin{void __atomic_load (@var{type} *@var{ptr}, @var{type} *ret, int @var{memorder})}

@var markup on "ret" here.

> -@defbuiltin{void __atomic_store_n (@var{type} *ptr, @var{type} val, int memorder)}
> +@defbuiltin{void __atomic_store_n (@var{type} *@var{ptr}, @var{type} val, int @var{memorder})}

And on "val" here...

> -@defbuiltin{void __atomic_store (@var{type} *ptr, @var{type} *val, int memorder)}
> +@defbuiltin{void __atomic_store (@var{type} *@var{ptr}, @var{type} *val, int @var{memorder})}

...and here...

> -@defbuiltin{@var{type} __atomic_exchange_n (@var{type} *ptr, @var{type} val, int memorder)}
> +@defbuiltin{@var{type} __atomic_exchange_n (@var{type} *@var{ptr}, @var{type} val, int @var{memorder})}

...and here.

> -@defbuiltin{void __atomic_exchange (@var{type} *ptr, @var{type} *val, @var{type} *ret, int memorder)}
> +@defbuiltin{void __atomic_exchange (@var{type} *@var{ptr}, @var{type} *val, @var{type} *ret, int @var{memorder})}

And both "val" and "ret" here.

OK with those things fixed.

-Sandra



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-11  1:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01 10:26 [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type Jakub Jelinek
2023-12-01 15:07 ` Jeff Law
2023-12-01 17:04 ` Sandra Loosemore
2023-12-01 17:33   ` Jakub Jelinek
2023-12-01 17:43     ` Sandra Loosemore
2023-12-04  7:36       ` [PATCH] extend.texi: Mark builtin arguments with @var{...} Jakub Jelinek
2023-12-11  1:48         ` Sandra Loosemore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).