GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
doc

Document GET_MODE_MASK limit using HOST_BITS_PER_WIDE_INT.

The documentation for GET_MODE_MASK is updated to reflect its actual behavior regarding mode sizes.

The GCC internals manual incorrectly stated that the GET_MODE_MASK macro, used to get a bitmask for a given machine mode, only worked for modes with sizes up to HOST_BITS_PER_INT. This commit corrects the documentation to reflect that it works for modes up to HOST_BITS_PER_WIDE_INT, aligning the documentation with the code.

In Details

The GCC manual stated that GET_MODE_MASK macro only worked for modes with sizes up to HOST_BITS_PER_INT. The code in genmodes.cc:emit_mode_mask actually supports modes up to HOST_BITS_PER_WIDE_INT due to the HOST_WIDE_INT type used for the mask array. This patch aligns the documentation with the code.

For Context

In GCC, machine modes represent the data types a target architecture supports. Each mode has a size, such as 8 bits for a char or 32 bits for an int. The GET_MODE_MASK macro returns a bitmask for a given mode, which can be useful for bitwise operations. The HOST_BITS_PER_INT and HOST_BITS_PER_WIDE_INT constants define the maximum size of integers that GCC can use. The documentation for GET_MODE_MASK incorrectly referenced the smaller HOST_BITS_PER_INT limit.

Filed Under: documentationgccmachine modes