From: Alex Coplan <[email protected]>

This updates the description of GET_MODE_MASK in the GCC internals
manual.  Currently it says that the macro can only be used for modes
whose bitsize is less than or equal to HOST_BITS_PER_INT.  That may have
once been correct, but these days it seems to work for modes up to
HOST_BITS_PER_WIDE_INT in size.  The code in genmodes.cc:emit_mode_mask
seems to support this.  It has:

  print_maybe_const_decl ("%sunsigned HOST_WIDE_INT", "mode_mask_array",
                          "NUM_MACHINE_MODES", adj_nunits);
  puts ("\
  ((m) >= HOST_BITS_PER_WIDE_INT)             \\\n\
   ? HOST_WIDE_INT_M1U                        \\\n\
   : (HOST_WIDE_INT_1U << (m)) - 1\n");

I did wonder whether the second sentence should be rephrased.  The macro
_can_ be used for modes whose bitsize is greater than
HOST_BITS_PER_WIDE_INT, it's just that it doesn't tell you very much
(just that the mode is at least as big as a HOST_WIDE_INT).  I've left
it as is for now, but would be happy to change it if reviewers think
it's worth doing.

Tested with make html and eyeballing the built docs.

OK for trunk?

Thanks,
Alex

gcc/ChangeLog:

        * doc/rtl.texi (Machine Modes): Update description of
        GET_MODE_MASK to use HOST_BITS_PER_WIDE_INT instead of
        HOST_BITS_PER_INT as the upper limit of the input mode's bitsize.
---
 gcc/doc/rtl.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 4fa4d27506cf..7fd656b70dc3 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -1577,9 +1577,9 @@ Returns the number of fractional bits of a datum of 
fixed-point mode @var{m}.
 
 @findex GET_MODE_MASK
 @item GET_MODE_MASK (@var{m})
-Returns a bitmask containing 1 for all bits in a word that fit within
-mode @var{m}.  This macro can only be used for modes whose bitsize is
-less than or equal to @code{HOST_BITS_PER_INT}.
+Returns a bitmask containing 1 for all bits in a @code{HOST_WIDE_INT}
+that fit within mode @var{m}.  This macro can only be used for modes
+whose bitsize is less than or equal to @code{HOST_BITS_PER_WIDE_INT}.
 
 @findex GET_MODE_ALIGNMENT
 @item GET_MODE_ALIGNMENT (@var{m})
-- 
2.54.0

Reply via email to