summaryrefslogtreecommitdiff
path: root/gcc/ada/s-casi64.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-casi64.adb')
-rw-r--r--gcc/ada/s-casi64.adb25
1 files changed, 10 insertions, 15 deletions
diff --git a/gcc/ada/s-casi64.adb b/gcc/ada/s-casi64.adb
index 9d141358d4c..9caf3ab80cd 100644
--- a/gcc/ada/s-casi64.adb
+++ b/gcc/ada/s-casi64.adb
@@ -31,16 +31,12 @@
-- --
------------------------------------------------------------------------------
+with System.Address_Operations; use System.Address_Operations;
+
with Unchecked_Conversion;
package body System.Compare_Array_Signed_64 is
- function "+" (Left, Right : Address) return Address;
- pragma Import (Intrinsic, "+");
- -- Provide addition operation on type Address (this may not be directly
- -- available if type System.Address is non-private and the operations on
- -- the type are made abstract to hide them from public users of System.
-
type Word is range -2**63 .. 2**63 - 1;
for Word'Size use 64;
-- Used to process operands by words
@@ -66,8 +62,7 @@ package body System.Compare_Array_Signed_64 is
(Left : System.Address;
Right : System.Address;
Left_Len : Natural;
- Right_Len : Natural)
- return Integer
+ Right_Len : Natural) return Integer
is
Clen : Natural := Natural'Min (Left_Len, Right_Len);
-- Number of elements left to compare
@@ -77,9 +72,9 @@ package body System.Compare_Array_Signed_64 is
-- Pointers to next elements to compare
begin
- -- Case of going by aligned words
+ -- Case of going by aligned double words
- if ((Left or Right) and (8 - 1)) = 0 then
+ if ModA (OrA (Left, Right), 8) = 0 then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
@@ -90,11 +85,11 @@ package body System.Compare_Array_Signed_64 is
end if;
Clen := Clen - 1;
- L := L + 8;
- R := R + 8;
+ L := AddA (L, 8);
+ R := AddA (R, 8);
end loop;
- -- Case of going by unaligned words
+ -- Case of going by unaligned double words
else
while Clen /= 0 loop
@@ -107,8 +102,8 @@ package body System.Compare_Array_Signed_64 is
end if;
Clen := Clen - 1;
- L := L + 8;
- R := R + 8;
+ L := AddA (L, 8);
+ R := AddA (R, 8);
end loop;
end if;