This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] md.texi: Add reference to macros for clz, ctz
- From: Jesper Nilsson <jesper dot nilsson at axis dot com>
- To: Jesper Nilsson <jesper dot nilsson at axis dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Sep 2007 16:57:38 +0200
- Subject: Re: [PATCH] md.texi: Add reference to macros for clz, ctz
- References: <20070829120101.GD1433@axis.com> <20070829150415.GG1433@axis.com>
Hi,
I'm resubmitting this patch for the documentation of CLZ and CTZ in
md.texi. Previously there was no mention here that CLZ_DEFINED_VALUE_AT_ZERO
in fact determined the result at value zero (likewise for
CTZ_DEFINED_VALUE_AT_ZERO).
There was also a mention of CLZ_DEFINED_VALUE_AT_ZERO and
CTZ_DEFINED_VALUE_AT_ZERO without references in rtl.texi, so I added them.
Tested with make info && make dvi on i686-pc-linux-gnu,
no overfull hboxes, inspected with both info and xdvi.
Best regards,
/^Jesper Nilsson
:ADDPATCH doc clz/ctz:
gcc/ChangeLog:
2007-09-11 Jesper Nilsson <jesper.nilsson@axis.com>
* doc/md.texi (clz, ctz): Add reference.
* doc/rtl.texi (clz, ctz): Likewise.
Index: doc/md.texi
===================================================================
--- doc/md.texi (revision 128178)
+++ doc/md.texi (working copy)
@@ -4043,16 +4043,20 @@
@cindex @code{clz@var{m}2} instruction pattern
@item @samp{clz@var{m}2}
Store into operand 0 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. @var{m} is the mode of operand 0; operand 1's mode is
+at the most significant bit position. If @var{x} is 0, the
+@code{CLZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}) macro defines if
+the result is undefined or has a useful value.
+@var{m} is the mode of operand 0; operand 1's mode is
specified by the instruction pattern, and the compiler will convert the
operand to that mode before generating the instruction.
@cindex @code{ctz@var{m}2} instruction pattern
@item @samp{ctz@var{m}2}
Store into operand 0 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. @var{m} is the mode of operand 0; operand 1's mode is
+at the least significant bit position. If @var{x} is 0, the
+@code{CTZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}) macro defines if
+the result is undefined or has a useful value.
+@var{m} is the mode of operand 0; operand 1's mode is
specified by the instruction pattern, and the compiler will convert the
operand to that mode before generating the instruction.
Index: doc/rtl.texi
===================================================================
--- doc/rtl.texi (revision 128178)
+++ doc/rtl.texi (working copy)
@@ -2224,7 +2224,7 @@
Represents the number of leading 0-bits in @var{x}, represented as an
integer of mode @var{m}, starting at the most significant bit position.
If @var{x} is zero, the value is determined by
-@code{CLZ_DEFINED_VALUE_AT_ZERO}. Note that this is one of
+@code{CLZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}). Note that this is one of
the few expressions that is not invariant under widening. The mode of
@var{x} will usually be an integer mode.
@@ -2233,7 +2233,7 @@
Represents the number of trailing 0-bits in @var{x}, represented as an
integer of mode @var{m}, starting at the least significant bit position.
If @var{x} is zero, the value is determined by
-@code{CTZ_DEFINED_VALUE_AT_ZERO}. Except for this case,
+@code{CTZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}). Except for this case,
@code{ctz(x)} is equivalent to @code{ffs(@var{x}) - 1}. The mode of
@var{x} will usually be an integer mode.
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com