aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2024-12-10 08:56:45 -0500
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-01-06 10:14:48 +0100
commit3861ac19e8dac9915c6022dbaa64bd974ece6000 (patch)
tree3c71554e469a8b58830fa6f3c525c04c19611e0b /gcc/ada
parent7067e6f6ff9bf9c640a8f1e3193fad195d20f6c3 (diff)
downloadgcc-3861ac19e8dac9915c6022dbaa64bd974ece6000.zip
gcc-3861ac19e8dac9915c6022dbaa64bd974ece6000.tar.gz
gcc-3861ac19e8dac9915c6022dbaa64bd974ece6000.tar.bz2
ada: cleanup documentation for shift and rotate
Documentation updated. gcc/ada/ChangeLog: * sinfo.ads (Shift_Count_OK): Update comments. (Is_Power_Of_2_For_Shift): Likewise.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sinfo.ads34
1 files changed, 16 insertions, 18 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 3db084e..2b82ab3 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -1812,16 +1812,15 @@ package Sinfo is
-- A flag set on an aggregate that uses parentheses as delimiters
-- Is_Power_Of_2_For_Shift
- -- A flag present only in N_Op_Expon nodes. It is set when the
- -- exponentiation is of the form 2 ** N, where the type of N is an
- -- unsigned integral subtype whose size does not exceed the size of
- -- Standard_Integer (i.e. a type that can be safely converted to
- -- Natural), and the exponentiation appears as the right operand of an
- -- integer multiplication or an integer division where the dividend is
- -- unsigned. It is also required that overflow checking is off for both
- -- the exponentiation and the multiply/divide node. If this set of
- -- conditions holds, and the flag is set, then the division or
- -- multiplication can be (and is) converted to a shift.
+ -- Present in N_Op_Expon nodes. It is set when the exponentiation is of
+ -- the form 2 ** N, where the type of N is an integer subtype whose size
+ -- does not exceed the size of Standard.Integer (i.e. a type that can be
+ -- safely converted to Natural), and the exponentiation appears as the
+ -- right operand of an integer multiplication or an integer division
+ -- where the dividend is unsigned. It is also required that overflow
+ -- checking is off for both the exponentiation and the multiply/divide
+ -- node. If this set of conditions holds, and the flag is set, then the
+ -- division or multiplication is converted to a shift.
-- Is_Preelaborable_Call
-- Present in call marker nodes. Set when the related call is non-static
@@ -2291,7 +2290,8 @@ package Sinfo is
-- known to be in range, i.e. is in the range from zero to word length
-- minus one. If this flag is not set, then the shift count may be
-- outside this range, i.e. larger than the word length, and the code
- -- must ensure that such shift counts give the appropriate result.
+ -- generated by the back end must ensure that such shift counts give the
+ -- appropriate result.
-- Source_Type
-- Used in an N_Validate_Unchecked_Conversion node to point to the
@@ -7738,15 +7738,13 @@ package Sinfo is
-- operator names. Note that for a given shift operation, one node
-- covers all possible types, as for normal operators.
- -- Note: it is perfectly permissible for the expander to generate
- -- shift operation nodes directly, in which case they will be analyzed
- -- and parsed in the usual manner.
-
-- Sprint syntax: shift-function-name!(expr, count)
- -- Note: the Left_Opnd field holds the first argument (the value to
- -- be shifted). The Right_Opnd field holds the second argument (the
- -- shift count). The Chars field is the name of the intrinsic function.
+ -- The Left_Opnd field holds the first argument (the value to be
+ -- shifted). The Right_Opnd field holds the second argument (the shift
+ -- count). The Chars field is the name of the intrinsic function.
+ -- The back end is responsible for generating correct code in the case
+ -- of large shift counts (in which case Shift_Count_OK will be False).
-- N_Op_Rotate_Left
-- Sloc points to the function name