diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-31 09:12:48 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-14 14:54:31 +0100 |
commit | c3db7e37a74680b98bcd8c582f0ef3f8778b4dde (patch) | |
tree | f903ee90fbb3f7913b1de5429ebd24e974ac2ba9 /gcc/ada/libgnat | |
parent | 53133d07901afa45bd1cb3cdcf7f5d4ed2418dd7 (diff) | |
download | gcc-c3db7e37a74680b98bcd8c582f0ef3f8778b4dde.zip gcc-c3db7e37a74680b98bcd8c582f0ef3f8778b4dde.tar.gz gcc-c3db7e37a74680b98bcd8c582f0ef3f8778b4dde.tar.bz2 |
ada: Fix outdated description in System.Arith_* units
Mainly System.Arith_Double, which has left-overs from its original version.
gcc/ada/ChangeLog:
* libgnat/s-aridou.ads (Add_With_Ovflo_Check): Adjust description.
(Subtract_With_Ovflo_Check): Likewise.
(Multiply_With_Ovflo_Check): Likewise.
(Scaled_Divide): Likewise.
(Double_Divide): Likewise.
* libgnat/s-arit64.ads (Multiply_With_Ovflo_Check64): Likewise.
* libgnat/s-arit128.ads (Multiply_With_Ovflo_Check128): Likewise.
Diffstat (limited to 'gcc/ada/libgnat')
-rw-r--r-- | gcc/ada/libgnat/s-aridou.ads | 36 | ||||
-rw-r--r-- | gcc/ada/libgnat/s-arit128.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/s-arit64.ads | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/gcc/ada/libgnat/s-aridou.ads b/gcc/ada/libgnat/s-aridou.ads index f1275ad..4618295 100644 --- a/gcc/ada/libgnat/s-aridou.ads +++ b/gcc/ada/libgnat/s-aridou.ads @@ -100,8 +100,8 @@ is with Pre => In_Double_Int_Range (Big (X) + Big (Y)), Post => Add_With_Ovflo_Check'Result = X + Y; - -- Raises Constraint_Error if sum of operands overflows 64 bits, - -- otherwise returns the 64-bit signed integer sum. + -- Raises Constraint_Error if sum of operands overflows Double_Int, + -- otherwise returns this sum of operands as Double_Int. -- -- The sum of ``X`` and ``Y`` is first computed using wrap-around -- semantics. @@ -118,8 +118,8 @@ is with Pre => In_Double_Int_Range (Big (X) - Big (Y)), Post => Subtract_With_Ovflo_Check'Result = X - Y; - -- Raises Constraint_Error if difference of operands overflows 64 - -- bits, otherwise returns the 64-bit signed integer difference. + -- Raises Constraint_Error if difference of operands overflows Double_Int, + -- otherwise returns this difference of operands as Double_Int. -- -- The logic of the implementation is reversed from *Add_With_Ovflo_Check*: -- if ``X`` and ``Y`` have the same sign, no overflow is checked, otherwise @@ -131,12 +131,12 @@ is Pre => In_Double_Int_Range (Big (X) * Big (Y)), Post => Multiply_With_Ovflo_Check'Result = X * Y; pragma Convention (C, Multiply_With_Ovflo_Check); - -- Raises Constraint_Error if product of operands overflows 64 - -- bits, otherwise returns the 64-bit signed integer product. - -- GIGI may also call this routine directly. + -- Raises Constraint_Error if product of operands overflows Double_Int, + -- otherwise returns this product of operands as Double_Int. The code + -- generator may also generate direct calls to this routine. -- - -- The multiplication is done using pencil and paper algorithm using base - -- 2**32. The multiplication is done on unsigned values, then the correct + -- The multiplication is done using pencil and paper algorithm applied to + -- Single_Uns, that is to say done on unsigned values, then the correct -- signed value is returned. Overflow check is performed by looking at -- higher digits. @@ -186,13 +186,13 @@ is -- quotient. The remainder ``R`` is not affected by the setting of the -- ``Round`` flag. -- - -- The multiplication is done using pencil and paper algorithm using base - -- 2**32. The multiplication is done on unsigned values. The result is a - -- 128 bit value. + -- The multiplication is done using pencil and paper algorithm applied to + -- Single_Uns, that is to say done on unsigned values. The result is a + -- pair of Double_Uns values. -- -- The overflow is detected on the intermediate value. -- - -- If Z is a 32 bit value, the division is done using pencil and paper + -- If Z is a Single_Uns value, the division is done using pencil and paper -- algorithm. -- -- Otherwise, the division is performed using the algorithm D from section @@ -232,14 +232,14 @@ is -- -- Division by 0 is first detected. -- - -- The intermediate value ``Y`` * ``Z`` is then computed on 128 bits. The - -- multiplication is done on unsigned values. + -- The intermediate value ``Y`` * ``Z`` is then computed as a pair of + -- Double_Uns value. that is to say done on unsigned values. -- - -- If the high 64 bits of the intermediate value is not 0, then 0 is + -- If the high Double_Uns of the intermediate value is not 0, then 0 is -- returned. The overflow case of the largest negative number divided by -- -1 is detected here. -- - -- 64-bit division is then performed, the result is rounded, its sign is - -- corrected, and then returned. + -- Double_Uns division is then performed, the result is rounded, its sign + -- is corrected, and then returned. end System.Arith_Double; diff --git a/gcc/ada/libgnat/s-arit128.ads b/gcc/ada/libgnat/s-arit128.ads index 3eb170f4..275b30f 100644 --- a/gcc/ada/libgnat/s-arit128.ads +++ b/gcc/ada/libgnat/s-arit128.ads @@ -96,7 +96,7 @@ is pragma Export (C, Multiply_With_Ovflo_Check128, "__gnat_mulv128"); -- Raises Constraint_Error if product of operands overflows 128 -- bits, otherwise returns the 128-bit signed integer product. - -- Gigi may also call this routine directly. + -- The code generator may also generate direct calls to this routine. function Same_Sign (X, Y : Big_Integer) return Boolean is (X = Big (Int128'(0)) diff --git a/gcc/ada/libgnat/s-arit64.ads b/gcc/ada/libgnat/s-arit64.ads index cbf0af5..efc1f5f 100644 --- a/gcc/ada/libgnat/s-arit64.ads +++ b/gcc/ada/libgnat/s-arit64.ads @@ -112,7 +112,7 @@ is pragma Export (C, Multiply_With_Ovflo_Check64, "__gnat_mulv64"); -- Raises Constraint_Error if product of operands overflows 64 -- bits, otherwise returns the 64-bit signed integer product. - -- GIGI may also call this routine directly. + -- The code generator may also generate direct calls to this routine. -- -- The multiplication is done using pencil and paper algorithm using base -- 2**32. The multiplication is done on unsigned values, then the correct |