-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- If operands are non-aligned, or length is too short, go by bytes
- if ModA (OrA (Left, Right), 4) /= 0 or else Compare_Len < 4 then
+ if Left mod Storage_Offset (4) /= 0
+ or else Right mod Storage_Offset (4) /= 0
+ or else Compare_Len < 4
+ then
return Compare_Array_S8_Unaligned (Left, Right, Left_Len, Right_Len);
end if;
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- If operands are non-aligned, or length is too short, go by bytes
- if ModA (OrA (Left, Right), 4) /= 0 or else Compare_Len < 4 then
+ if Left mod Storage_Offset (4) /= 0
+ or else Right mod Storage_Offset (4) /= 0
+ or else Compare_Len < 4
+ then
return Compare_Array_U8_Unaligned (Left, Right, Left_Len, Right_Len);
end if;
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Case of going by aligned quadruple words
- if ModA (OrA (Left, Right), 16) = 0 then
+ if Left mod Storage_Offset (16) = 0
+ and then Right mod Storage_Offset (16) = 0
+ then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Go by words if possible
- if ModA (OrA (Left, Right), 4) = 0 then
+ if Left mod Storage_Offset (4) = 0
+ and then Right mod Storage_Offset (4) = 0
+ then
while Clen > 1
and then W (L).all = W (R).all
loop
-- Case of going by aligned half words
- if ModA (OrA (Left, Right), 2) = 0 then
+ if Left mod Storage_Offset (2) = 0
+ and then Right mod Storage_Offset (2) = 0
+ then
while Clen /= 0 loop
if H (L).all /= H (R).all then
if H (L).all > H (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Case of going by aligned words
- if ModA (OrA (Left, Right), 4) = 0 then
+ if Left mod Storage_Offset (4) = 0
+ and then Right mod Storage_Offset (4) = 0
+ then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Case of going by aligned double words
- if ModA (OrA (Left, Right), 8) = 0 then
+ if Left mod Storage_Offset (8) = 0
+ and then Right mod Storage_Offset (8) = 0
+ then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Case of going by aligned quadruple words
- if ModA (OrA (Left, Right), 16) = 0 then
+ if Left mod Storage_Offset (16) = 0
+ and then Right mod Storage_Offset (16) = 0
+ then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Go by words if possible
- if ModA (OrA (Left, Right), 4) = 0 then
+ if Left mod Storage_Offset (4) = 0
+ and then Right mod Storage_Offset (4) = 0
+ then
while Clen > 1
and then W (L).all = W (R).all
loop
-- Case of going by aligned half words
- if ModA (OrA (Left, Right), 2) = 0 then
+ if Left mod Storage_Offset (2) = 0
+ and then Right mod Storage_Offset (2) = 0
+ then
while Clen /= 0 loop
if H (L).all /= H (R).all then
if H (L).all > H (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Case of going by aligned words
- if ModA (OrA (Left, Right), 4) = 0 then
+ if Left mod Storage_Offset (4) = 0
+ and then Right mod Storage_Offset (4) = 0
+ then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
begin
-- Case of going by aligned double words
- if ModA (OrA (Left, Right), 8) = 0 then
+ if Left mod Storage_Offset (8) = 0
+ and then Right mod Storage_Offset (8) = 0
+ then
while Clen /= 0 loop
if W (L).all /= W (R).all then
if W (L).all > W (R).all then
-- --
------------------------------------------------------------------------------
-with System.Address_Operations; use System.Address_Operations;
-with System.Storage_Elements; use System.Storage_Elements;
+with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
(R, X, Y : System.Address;
Length : System.Storage_Elements.Storage_Count)
is
- RA : Address := R;
- XA : Address := X;
- YA : Address := Y;
- -- Address of next element to process in R, X and Y
-
VI : constant Integer_Address := Integer_Address (VU);
Unaligned : constant Integer_Address :=
- Boolean'Pos (OrA (OrA (RA, XA), YA) mod VU /= 0) - 1;
+ (if R mod VU /= 0 or X mod VU /= 0 or Y mod VU /= 0 then 0 else -1);
-- Zero iff one or more argument addresses is not aligned, else all 1's
type Vector_Ptr is access all Vectors.Vector;
-- Vector'Size > Storage_Unit
-- VI > 0
SA : constant Address :=
- XA + Storage_Offset
- ((Integer_Address (Length) / VI * VI) and Unaligned);
+ X + Storage_Offset
+ ((Integer_Address (Length) / VI * VI) and Unaligned);
-- First address of argument X to start serial processing
+ RA : Address := R;
+ XA : Address := X;
+ YA : Address := Y;
+ -- Address of next element to process in R, X and Y
+
begin
while XA < SA loop
VP (RA).all := Vector_Op (VP (XA).all, VP (YA).all);
(R, X : System.Address;
Length : System.Storage_Elements.Storage_Count)
is
- RA : Address := R;
- XA : Address := X;
- -- Address of next element to process in R and X
-
VI : constant Integer_Address := Integer_Address (VU);
Unaligned : constant Integer_Address :=
- Boolean'Pos (OrA (RA, XA) mod VU /= 0) - 1;
+ (if R mod VU /= 0 or X mod VU /= 0 then 0 else -1);
-- Zero iff one or more argument addresses is not aligned, else all 1's
type Vector_Ptr is access all Vectors.Vector;
-- Vector'Size > Storage_Unit
-- VI > 0
SA : constant Address :=
- XA + Storage_Offset
- ((Integer_Address (Length) / VI * VI) and Unaligned);
+ X + Storage_Offset
+ ((Integer_Address (Length) / VI * VI) and Unaligned);
-- First address of argument X to start serial processing
+ RA : Address := R;
+ XA : Address := X;
+ -- Address of next element to process in R and X
+
begin
while XA < SA loop
VP (RA).all := Vector_Op (VP (XA).all);