This is a summary of discussions relative to the merge request created by Alex 
Coplan (acoplan) <[email protected]> titled
doc: Fix description of GET_MODE_MASK
since its creation.

Description: 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.

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.

The full and up to date discussion can be found at 
https://forge.sourceware.org/gcc/gcc-TEST/pulls/157

The merge request has been closed without being merged directly on the forge 
repository.

On 2026-05-13 09:22:27+00:00, Richard Earnshaw (rearnsha) <[email protected]> 
approved the changes:
This is OK.



On 2026-05-14 13:06:25+00:00, Alex Coplan (acoplan) wrote:

Pushed upstream as 
https://gcc.gnu.org/cgit/gcc/commit/?id=568e1b4823b076235497e8fc790ded7629e472a4

Reply via email to