Gerald Pfeifer <[email protected]> writes:
> Hi Karl,
>
> I noticed this patch was not applied (and did apparently not see any
> response).
>
> Technically I could approve as doc maintainer, alas this is beyond my
> scope of technical knowledge. Maybe repost the patch or, if you are
> really confident, push it.
>
> Gerald
>
>
> On Thu, 29 May 2025, Karl Meakin wrote:
>> In some places the documentation refers to "fixed-point" types or values
>> when talking about plain integer types. Although this is meant to mean
>> "the opposite of floating-point", it is misleading and can be confused
>> with the fractional types that are also known as "fixed-point". For the
>> avoidance of doubt, refer to plain integer types as "integer"
>> throughout.
"integral mode" and "integral value" might be better than "integer mode"
and "integer value". That would correspond with:
/* Nonzero if MODE is an integral mode. */
#define INTEGRAL_MODE_P(MODE) \
(GET_MODE_CLASS (MODE) == MODE_INT \
|| GET_MODE_CLASS (MODE) == MODE_PARTIAL_INT \
|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_BOOL \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_INT)
since (for example) the logic ops are also valid for partial integers
and for vectors of integers. It would also match the tree-level
distinction between INTEGER_TYPE and (ANY_)INTEGRAL_TYPE_P.
>> Testing done:
>> `make info` and `make dvi`
>>
>> gcc/ChangeLog:
>> * doc/rtl.texi: Replace "fixed-point" with "integer" where
>> appropriate.
>> ---
>> gcc/doc/rtl.texi | 44 ++++++++++++++++++++++----------------------
>> 1 file changed, 22 insertions(+), 22 deletions(-)
>>
>> diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
>> index 089bb1c4ede..ddba52a4014 100644
>> --- a/gcc/doc/rtl.texi
>> +++ b/gcc/doc/rtl.texi
>> @@ -2619,40 +2619,40 @@ integers.
>> @cindex bitwise complement
>> @item (not:@var{m} @var{x})
>> Represents the bitwise complement of the value represented by @var{x},
>> -carried out in mode @var{m}, which must be a fixed-point machine mode.
>> +carried out in mode @var{m}, which must be an integer machine mode.
>>
>> @findex and
>> @cindex logical-and, bitwise
>> @cindex bitwise logical-and
>> @item (and:@var{m} @var{x} @var{y})
>> Represents the bitwise logical-and of the values represented by
>> @var{x} and @var{y}, carried out in machine mode @var{m}, which must be
>> -a fixed-point machine mode.
>> +an integer machine mode.
>>
>> @findex ior
>> @cindex inclusive-or, bitwise
>> @cindex bitwise inclusive-or
>> @item (ior:@var{m} @var{x} @var{y})
>> Represents the bitwise inclusive-or of the values represented by @var{x}
>> -and @var{y}, carried out in machine mode @var{m}, which must be a
>> -fixed-point mode.
>> +and @var{y}, carried out in machine mode @var{m}, which must be an
>> +integer mode.
>>
>> @findex xor
>> @cindex exclusive-or, bitwise
>> @cindex bitwise exclusive-or
>> @item (xor:@var{m} @var{x} @var{y})
>> Represents the bitwise exclusive-or of the values represented by @var{x}
>> -and @var{y}, carried out in machine mode @var{m}, which must be a
>> -fixed-point mode.
>> +and @var{y}, carried out in machine mode @var{m}, which must be an
>> +integer mode.
>>
>> @findex ashift
>> @findex ss_ashift
>> @findex us_ashift
>> @cindex left shift
>> @cindex shift
>> @cindex arithmetic shift
>> @cindex arithmetic shift with signed saturation
>> @cindex arithmetic shift with unsigned saturation
>> @item (ashift:@var{m} @var{x} @var{c})
>> @itemx (ss_ashift:@var{m} @var{x} @var{c})
>> @itemx (us_ashift:@var{m} @var{x} @var{c})
>> @@ -2663,8 +2663,8 @@ in case of a change in the sign bit; @code{ss_ashift}
>> and @code{us_ashift}
>> saturates to the minimum or maximum representable value if any of the bits
>> shifted out differs from the final sign bit.
>>
>> -@var{x} have mode @var{m}, a fixed-point machine mode. @var{c}
>> -be a fixed-point mode or be a constant with mode @code{VOIDmode}; which
>> +@var{x} have mode @var{m}, an integer machine mode. @var{c}
>> +be an integer mode or be a constant with mode @code{VOIDmode}; which
Could you fix the pre-existing grammar issues while you're there?
@var{x} has mode @var{m}, an integral machine mode. @var{c} must have
an integral mode or be a constant with mode @code{VOIDmode}; which
OK with those changes from my POV.
Thanks,
Richard
>> mode is determined by the mode called for in the machine description
>> entry for the left-shift instruction. For example, on the VAX, the mode
>> of @var{c} is @code{QImode} regardless of @var{m}.
>> @@ -2750,13 +2750,13 @@ integer of mode @var{m}. The mode of @var{x} must
>> be @var{m} or
>> @findex bswap
>> @item (bswap:@var{m} @var{x})
>> Represents the value @var{x} with the order of bytes reversed, carried out
>> -in mode @var{m}, which must be a fixed-point machine mode.
>> +in mode @var{m}, which must be an integer machine mode.
>> The mode of @var{x} must be @var{m} or @code{VOIDmode}.
>>
>> @findex bitreverse
>> @item (bitreverse:@var{m} @var{x})
>> Represents the value @var{x} with the order of bits reversed, carried out
>> -in mode @var{m}, which must be a fixed-point machine mode.
>> +in mode @var{m}, which must be an integer machine mode.
>> The mode of @var{x} must be @var{m} or @code{VOIDmode}.
>>
>> @findex copysign
>> @@ -2824,18 +2824,18 @@ are not equal, otherwise 0.
>> @findex gt
>> @cindex greater than
>> @item (gt:@var{m} @var{x} @var{y})
>> @code{STORE_FLAG_VALUE} if the @var{x} is greater than @var{y}. If they
>> -are fixed-point, the comparison is done in a signed sense.
>> +are integers, the comparison is done in a signed sense.
>>
>> @findex gtu
>> @cindex greater than
>> @cindex unsigned greater than
>> @item (gtu:@var{m} @var{x} @var{y})
>> -Like @code{gt} but does unsigned comparison, on fixed-point numbers only.
>> +Like @code{gt} but does unsigned comparison, on integers only.
>>
>> @findex lt
>> @cindex less than
>> @findex ltu
>> @cindex unsigned less than
>> @item (lt:@var{m} @var{x} @var{y})
>> @itemx (ltu:@var{m} @var{x} @var{y})
>> @@ -3002,14 +3002,14 @@ must be placed into a register.
>> @findex sign_extend
>> @item (sign_extend:@var{m} @var{x})
>> Represents the result of sign-extending the value @var{x}
>> -to machine mode @var{m}. @var{m} must be a fixed-point mode
>> -and @var{x} a fixed-point value of a mode narrower than @var{m}.
>> +to machine mode @var{m}. @var{m} must be an integer mode
>> +and @var{x} an integer value of a mode narrower than @var{m}.
>>
>> @findex zero_extend
>> @item (zero_extend:@var{m} @var{x})
>> Represents the result of zero-extending the value @var{x}
>> -to machine mode @var{m}. @var{m} must be a fixed-point mode
>> -and @var{x} a fixed-point value of a mode narrower than @var{m}.
>> +to machine mode @var{m}. @var{m} must be an integer mode
>> +and @var{x} an integer value of a mode narrower than @var{m}.
>>
>> @findex float_extend
>> @item (float_extend:@var{m} @var{x})
>> @@ -3020,21 +3020,21 @@ and @var{x} a floating point value of a mode
>> narrower than @var{m}.
>> @findex truncate
>> @item (truncate:@var{m} @var{x})
>> Represents the result of truncating the value @var{x}
>> -to machine mode @var{m}. @var{m} must be a fixed-point mode
>> -and @var{x} a fixed-point value of a mode wider than @var{m}.
>> +to machine mode @var{m}. @var{m} must be an integer mode
>> +and @var{x} an integer value of a mode wider than @var{m}.
>>
>> @findex ss_truncate
>> @item (ss_truncate:@var{m} @var{x})
>> Represents the result of truncating the value @var{x}
>> to machine mode @var{m}, using signed saturation in the case of
>> -overflow. Both @var{m} and the mode of @var{x} must be fixed-point
>> +overflow. Both @var{m} and the mode of @var{x} must be integer
>> modes.
>>
>> @findex us_truncate
>> @item (us_truncate:@var{m} @var{x})
>> Represents the result of truncating the value @var{x}
>> to machine mode @var{m}, using unsigned saturation in the case of
>> -overflow. Both @var{m} and the mode of @var{x} must be fixed-point
>> +overflow. Both @var{m} and the mode of @var{x} must be integer
>> modes.
>>
>> @findex float_truncate
>> @@ -3045,12 +3045,12 @@ and @var{x} a floating point value of a mode wider
>> than @var{m}.
>>
>> @findex float
>> @item (float:@var{m} @var{x})
>> -Represents the result of converting fixed point value @var{x},
>> +Represents the result of converting integer value @var{x},
>> regarded as signed, to floating point mode @var{m}.
>>
>> @findex unsigned_float
>> @item (unsigned_float:@var{m} @var{x})
>> -Represents the result of converting fixed point value @var{x},
>> +Represents the result of converting integer value @var{x},
>> regarded as unsigned, to floating point mode @var{m}.
>>
>> @findex fix
>>