vect1.ad[sb]: Add more tests.

* gnat.dg/vect1.ad[sb]: Add more tests.
	* gnat.dg/vect2.ad[sb]: Likewise.
	* gnat.dg/vect3.ad[sb]: Likewise.
	* gnat.dg/vect4.ad[sb]: Likewise.
	* gnat.dg/vect5.ad[sb]: Likewise.
	* gnat.dg/vect6.ad[sb]: Likewise.

From-SVN: r182276
This commit is contained in:
Eric Botcazou 2011-12-13 11:26:14 +00:00 committed by Eric Botcazou
parent ddf2e10953
commit ba3125d780
13 changed files with 255 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2011-12-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/vect1.ad[sb]: Add more tests.
* gnat.dg/vect2.ad[sb]: Likewise.
* gnat.dg/vect3.ad[sb]: Likewise.
* gnat.dg/vect4.ad[sb]: Likewise.
* gnat.dg/vect5.ad[sb]: Likewise.
* gnat.dg/vect6.ad[sb]: Likewise.
2011-12-12 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/51495

View File

@ -12,6 +12,13 @@ package body Vect1 is
return R;
end;
procedure Add (X, Y : Varray; R : out Varray) is
begin
for I in X'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Varray; R : not null access Varray) is
begin
for I in X'Range loop
@ -29,6 +36,13 @@ package body Vect1 is
return R;
end;
procedure Add (X, Y : Sarray; R : out Sarray) is
begin
for I in Sarray'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Sarray; R : not null access Sarray) is
begin
for I in Sarray'Range loop
@ -46,6 +60,13 @@ package body Vect1 is
return R;
end;
procedure Add (X, Y : Darray1; R : out Darray1) is
begin
for I in Darray1'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray1; R : not null access Darray1) is
begin
for I in Darray1'Range loop
@ -63,6 +84,13 @@ package body Vect1 is
return R;
end;
procedure Add (X, Y : Darray2; R : out Darray2) is
begin
for I in Darray2'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray2; R : not null access Darray2) is
begin
for I in Darray2'Range loop
@ -80,6 +108,13 @@ package body Vect1 is
return R;
end;
procedure Add (X, Y : Darray3; R : out Darray3) is
begin
for I in Darray3'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray3; R : not null access Darray3) is
begin
for I in Darray3'Range loop
@ -89,5 +124,5 @@ package body Vect1 is
end Vect1;
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } }
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 15 "vect" } }
-- { dg-final { cleanup-tree-dump "vect" } }

View File

@ -8,6 +8,7 @@ package Vect1 is
for Varray'Alignment use 16;
function "+" (X, Y : Varray) return Varray;
procedure Add (X, Y : Varray; R : out Varray);
procedure Add (X, Y : not null access Varray; R : not null access Varray);
@ -16,6 +17,7 @@ package Vect1 is
for Sarray'Alignment use 16;
function "+" (X, Y : Sarray) return Sarray;
procedure Add (X, Y : Sarray; R : out Sarray);
procedure Add (X, Y : not null access Sarray; R : not null access Sarray);
@ -23,6 +25,7 @@ package Vect1 is
for Darray1'Alignment use 16;
function "+" (X, Y : Darray1) return Darray1;
procedure Add (X, Y : Darray1; R : out Darray1);
procedure Add (X, Y : not null access Darray1; R : not null access Darray1);
@ -30,6 +33,7 @@ package Vect1 is
for Darray2'Alignment use 16;
function "+" (X, Y : Darray2) return Darray2;
procedure Add (X, Y : Darray2; R : out Darray2);
procedure Add (X, Y : not null access Darray2; R : not null access Darray2);
@ -37,6 +41,7 @@ package Vect1 is
for Darray3'Alignment use 16;
function "+" (X, Y : Darray3) return Darray3;
procedure Add (X, Y : Darray3; R : out Darray3);
procedure Add (X, Y : not null access Darray3; R : not null access Darray3);
end Vect1;

View File

@ -12,6 +12,13 @@ package body Vect2 is
return R;
end;
procedure Add (X, Y : Varray; R : out Varray) is
begin
for I in X'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Varray; R : not null access Varray) is
begin
for I in X'Range loop
@ -29,6 +36,13 @@ package body Vect2 is
return R;
end;
procedure Add (X, Y : Sarray; R : out Sarray) is
begin
for I in Sarray'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Sarray; R : not null access Sarray) is
begin
for I in Sarray'Range loop
@ -46,6 +60,13 @@ package body Vect2 is
return R;
end;
procedure Add (X, Y : Darray1; R : out Darray1) is
begin
for I in Darray1'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray1; R : not null access Darray1) is
begin
for I in Darray1'Range loop
@ -63,6 +84,13 @@ package body Vect2 is
return R;
end;
procedure Add (X, Y : Darray2; R : out Darray2) is
begin
for I in Darray2'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray2; R : not null access Darray2) is
begin
for I in Darray2'Range loop
@ -80,6 +108,13 @@ package body Vect2 is
return R;
end;
procedure Add (X, Y : Darray3; R : out Darray3) is
begin
for I in Darray3'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray3; R : not null access Darray3) is
begin
for I in Darray3'Range loop
@ -89,5 +124,5 @@ package body Vect2 is
end Vect2;
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } }
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 15 "vect" } }
-- { dg-final { cleanup-tree-dump "vect" } }

View File

@ -8,6 +8,7 @@ package Vect2 is
for Varray'Alignment use 16;
function "+" (X, Y : Varray) return Varray;
procedure Add (X, Y : Varray; R : out Varray);
procedure Add (X, Y : not null access Varray; R : not null access Varray);
@ -16,6 +17,7 @@ package Vect2 is
for Sarray'Alignment use 16;
function "+" (X, Y : Sarray) return Sarray;
procedure Add (X, Y : Sarray; R : out Sarray);
procedure Add (X, Y : not null access Sarray; R : not null access Sarray);
@ -23,6 +25,7 @@ package Vect2 is
for Darray1'Alignment use 16;
function "+" (X, Y : Darray1) return Darray1;
procedure Add (X, Y : Darray1; R : out Darray1);
procedure Add (X, Y : not null access Darray1; R : not null access Darray1);
@ -30,6 +33,7 @@ package Vect2 is
for Darray2'Alignment use 16;
function "+" (X, Y : Darray2) return Darray2;
procedure Add (X, Y : Darray2; R : out Darray2);
procedure Add (X, Y : not null access Darray2; R : not null access Darray2);
@ -37,6 +41,7 @@ package Vect2 is
for Darray3'Alignment use 16;
function "+" (X, Y : Darray3) return Darray3;
procedure Add (X, Y : Darray3; R : out Darray3);
procedure Add (X, Y : not null access Darray3; R : not null access Darray3);
end Vect2;

View File

@ -12,6 +12,13 @@ package body Vect3 is
return R;
end;
procedure Add (X, Y : Varray; R : out Varray) is
begin
for I in X'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Varray; R : not null access Varray) is
begin
for I in X'Range loop
@ -29,6 +36,13 @@ package body Vect3 is
return R;
end;
procedure Add (X, Y : Sarray; R : out Sarray) is
begin
for I in Sarray'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Sarray; R : not null access Sarray) is
begin
for I in Sarray'Range loop
@ -46,6 +60,13 @@ package body Vect3 is
return R;
end;
procedure Add (X, Y : Darray1; R : out Darray1) is
begin
for I in Darray1'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray1; R : not null access Darray1) is
begin
for I in Darray1'Range loop
@ -63,6 +84,13 @@ package body Vect3 is
return R;
end;
procedure Add (X, Y : Darray2; R : out Darray2) is
begin
for I in Darray2'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray2; R : not null access Darray2) is
begin
for I in Darray2'Range loop
@ -80,6 +108,13 @@ package body Vect3 is
return R;
end;
procedure Add (X, Y : Darray3; R : out Darray3) is
begin
for I in Darray3'Range loop
R(I) := X(I) + Y(I);
end loop;
end;
procedure Add (X, Y : not null access Darray3; R : not null access Darray3) is
begin
for I in Darray3'Range loop
@ -89,5 +124,5 @@ package body Vect3 is
end Vect3;
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } }
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 15 "vect" } }
-- { dg-final { cleanup-tree-dump "vect" } }

View File

@ -8,6 +8,7 @@ package Vect3 is
for Varray'Alignment use 16;
function "+" (X, Y : Varray) return Varray;
procedure Add (X, Y : Varray; R : out Varray);
procedure Add (X, Y : not null access Varray; R : not null access Varray);
@ -17,6 +18,7 @@ package Vect3 is
for Sarray'Alignment use 16;
function "+" (X, Y : Sarray) return Sarray;
procedure Add (X, Y : Sarray; R : out Sarray);
procedure Add (X, Y : not null access Sarray; R : not null access Sarray);
@ -24,6 +26,7 @@ package Vect3 is
for Darray1'Alignment use 16;
function "+" (X, Y : Darray1) return Darray1;
procedure Add (X, Y : Darray1; R : out Darray1);
procedure Add (X, Y : not null access Darray1; R : not null access Darray1);
@ -31,6 +34,7 @@ package Vect3 is
for Darray2'Alignment use 16;
function "+" (X, Y : Darray2) return Darray2;
procedure Add (X, Y : Darray2; R : out Darray2);
procedure Add (X, Y : not null access Darray2; R : not null access Darray2);
@ -38,6 +42,7 @@ package Vect3 is
for Darray3'Alignment use 16;
function "+" (X, Y : Darray3) return Darray3;
procedure Add (X, Y : Darray3; R : out Darray3);
procedure Add (X, Y : not null access Darray3; R : not null access Darray3);
end Vect3;

View File

@ -12,6 +12,13 @@ package body Vect4 is
return R;
end;
procedure Add (X : Varray; Y : Long_Float; R : out Varray) is
begin
for I in X'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Varray; Y : Long_Float; R : not null access Varray) is
begin
for I in X'Range loop
@ -29,6 +36,13 @@ package body Vect4 is
return R;
end;
procedure Add (X : Sarray; Y : Long_Float; R : out Sarray) is
begin
for I in Sarray'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Sarray; Y : Long_Float; R : not null access Sarray) is
begin
for I in Sarray'Range loop
@ -46,6 +60,13 @@ package body Vect4 is
return R;
end;
procedure Add (X : Darray1; Y : Long_Float; R : out Darray1) is
begin
for I in Darray1'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray1; Y : Long_Float; R : not null access Darray1) is
begin
for I in Darray1'Range loop
@ -63,6 +84,13 @@ package body Vect4 is
return R;
end;
procedure Add (X : Darray2; Y : Long_Float; R : out Darray2) is
begin
for I in Darray2'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray2; Y : Long_Float; R : not null access Darray2) is
begin
for I in Darray2'Range loop
@ -80,6 +108,13 @@ package body Vect4 is
return R;
end;
procedure Add (X : Darray3; Y : Long_Float; R : out Darray3) is
begin
for I in Darray3'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray3; Y : Long_Float; R : not null access Darray3) is
begin
for I in Darray3'Range loop
@ -89,5 +124,5 @@ package body Vect4 is
end Vect4;
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } }
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 15 "vect" } }
-- { dg-final { cleanup-tree-dump "vect" } }

View File

@ -8,6 +8,7 @@ package Vect4 is
for Varray'Alignment use 16;
function "+" (X : Varray; Y : Long_Float) return Varray;
procedure Add (X : Varray; Y : Long_Float; R : out Varray);
procedure Add (X : not null access Varray; Y : Long_Float; R : not null access Varray);
@ -16,6 +17,7 @@ package Vect4 is
for Sarray'Alignment use 16;
function "+" (X : Sarray; Y : Long_Float) return Sarray;
procedure Add (X : Sarray; Y : Long_Float; R : out Sarray);
procedure Add (X : not null access Sarray; Y : Long_Float; R : not null access Sarray);
@ -23,6 +25,7 @@ package Vect4 is
for Darray1'Alignment use 16;
function "+" (X : Darray1; Y : Long_Float) return Darray1;
procedure Add (X : Darray1; Y : Long_Float; R : out Darray1);
procedure Add (X : not null access Darray1; Y : Long_Float; R : not null access Darray1);
@ -30,6 +33,7 @@ package Vect4 is
for Darray2'Alignment use 16;
function "+" (X : Darray2; Y : Long_Float) return Darray2;
procedure Add (X : Darray2; Y : Long_Float; R : out Darray2);
procedure Add (X : not null access Darray2; Y : Long_Float; R : not null access Darray2);
@ -37,6 +41,7 @@ package Vect4 is
for Darray3'Alignment use 16;
function "+" (X : Darray3; Y : Long_Float) return Darray3;
procedure Add (X : Darray3; Y : Long_Float; R : out Darray3);
procedure Add (X : not null access Darray3; Y : Long_Float; R : not null access Darray3);
end Vect4;

View File

@ -12,6 +12,13 @@ package body Vect5 is
return R;
end;
procedure Add (X : Varray; Y : Long_Float; R : out Varray) is
begin
for I in X'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Varray; Y : Long_Float; R : not null access Varray) is
begin
for I in X'Range loop
@ -29,6 +36,13 @@ package body Vect5 is
return R;
end;
procedure Add (X : Sarray; Y : Long_Float; R : out Sarray) is
begin
for I in Sarray'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Sarray; Y : Long_Float; R : not null access Sarray) is
begin
for I in Sarray'Range loop
@ -46,6 +60,13 @@ package body Vect5 is
return R;
end;
procedure Add (X : Darray1; Y : Long_Float; R : out Darray1) is
begin
for I in Darray1'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray1; Y : Long_Float; R : not null access Darray1) is
begin
for I in Darray1'Range loop
@ -63,6 +84,13 @@ package body Vect5 is
return R;
end;
procedure Add (X : Darray2; Y : Long_Float; R : out Darray2) is
begin
for I in Darray2'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray2; Y : Long_Float; R : not null access Darray2) is
begin
for I in Darray2'Range loop
@ -80,6 +108,13 @@ package body Vect5 is
return R;
end;
procedure Add (X : Darray3; Y : Long_Float; R : out Darray3) is
begin
for I in Darray3'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray3; Y : Long_Float; R : not null access Darray3) is
begin
for I in Darray3'Range loop
@ -89,5 +124,5 @@ package body Vect5 is
end Vect5;
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } }
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 15 "vect" } }
-- { dg-final { cleanup-tree-dump "vect" } }

View File

@ -8,6 +8,7 @@ package Vect5 is
for Varray'Alignment use 16;
function "+" (X : Varray; Y : Long_Float) return Varray;
procedure Add (X : Varray; Y : Long_Float; R : out Varray);
procedure Add (X : not null access Varray; Y : Long_Float; R : not null access Varray);
@ -16,6 +17,7 @@ package Vect5 is
for Sarray'Alignment use 16;
function "+" (X : Sarray; Y : Long_Float) return Sarray;
procedure Add (X : Sarray; Y : Long_Float; R : out Sarray);
procedure Add (X : not null access Sarray; Y : Long_Float; R : not null access Sarray);
@ -23,6 +25,7 @@ package Vect5 is
for Darray1'Alignment use 16;
function "+" (X : Darray1; Y : Long_Float) return Darray1;
procedure Add (X : Darray1; Y : Long_Float; R : out Darray1);
procedure Add (X : not null access Darray1; Y : Long_Float; R : not null access Darray1);
@ -30,6 +33,7 @@ package Vect5 is
for Darray2'Alignment use 16;
function "+" (X : Darray2; Y : Long_Float) return Darray2;
procedure Add (X : Darray2; Y : Long_Float; R : out Darray2);
procedure Add (X : not null access Darray2; Y : Long_Float; R : not null access Darray2);
@ -37,6 +41,7 @@ package Vect5 is
for Darray3'Alignment use 16;
function "+" (X : Darray3; Y : Long_Float) return Darray3;
procedure Add (X : Darray3; Y : Long_Float; R : out Darray3);
procedure Add (X : not null access Darray3; Y : Long_Float; R : not null access Darray3);
end Vect5;

View File

@ -12,6 +12,13 @@ package body Vect6 is
return R;
end;
procedure Add (X : Varray; Y : Long_Float; R : out Varray) is
begin
for I in X'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Varray; Y : Long_Float; R : not null access Varray) is
begin
for I in X'Range loop
@ -29,6 +36,13 @@ package body Vect6 is
return R;
end;
procedure Add (X : Sarray; Y : Long_Float; R : out Sarray) is
begin
for I in Sarray'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Sarray; Y : Long_Float; R : not null access Sarray) is
begin
for I in Sarray'Range loop
@ -46,6 +60,13 @@ package body Vect6 is
return R;
end;
procedure Add (X : Darray1; Y : Long_Float; R : out Darray1) is
begin
for I in Darray1'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray1; Y : Long_Float; R : not null access Darray1) is
begin
for I in Darray1'Range loop
@ -63,6 +84,13 @@ package body Vect6 is
return R;
end;
procedure Add (X : Darray2; Y : Long_Float; R : out Darray2) is
begin
for I in Darray2'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray2; Y : Long_Float; R : not null access Darray2) is
begin
for I in Darray2'Range loop
@ -80,6 +108,13 @@ package body Vect6 is
return R;
end;
procedure Add (X : Darray3; Y : Long_Float; R : out Darray3) is
begin
for I in Darray3'Range loop
R(I) := X(I) + Y;
end loop;
end;
procedure Add (X : not null access Darray3; Y : Long_Float; R : not null access Darray3) is
begin
for I in Darray3'Range loop
@ -89,5 +124,5 @@ package body Vect6 is
end Vect6;
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } }
-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 15 "vect" } }
-- { dg-final { cleanup-tree-dump "vect" } }

View File

@ -8,6 +8,7 @@ package Vect6 is
for Varray'Alignment use 16;
function "+" (X : Varray; Y : Long_Float) return Varray;
procedure Add (X : Varray; Y : Long_Float; R : out Varray);
procedure Add (X : not null access Varray; Y : Long_Float; R : not null access Varray);
@ -17,6 +18,7 @@ package Vect6 is
for Sarray'Alignment use 16;
function "+" (X : Sarray; Y : Long_Float) return Sarray;
procedure Add (X : Sarray; Y : Long_Float; R : out Sarray);
procedure Add (X : not null access Sarray; Y : Long_Float; R : not null access Sarray);
@ -24,6 +26,7 @@ package Vect6 is
for Darray1'Alignment use 16;
function "+" (X : Darray1; Y : Long_Float) return Darray1;
procedure Add (X : Darray1; Y : Long_Float; R : out Darray1);
procedure Add (X : not null access Darray1; Y : Long_Float; R : not null access Darray1);
@ -31,6 +34,7 @@ package Vect6 is
for Darray2'Alignment use 16;
function "+" (X : Darray2; Y : Long_Float) return Darray2;
procedure Add (X : Darray2; Y : Long_Float; R : out Darray2);
procedure Add (X : not null access Darray2; Y : Long_Float; R : not null access Darray2);
@ -38,6 +42,7 @@ package Vect6 is
for Darray3'Alignment use 16;
function "+" (X : Darray3; Y : Long_Float) return Darray3;
procedure Add (X : Darray3; Y : Long_Float; R : out Darray3);
procedure Add (X : not null access Darray3; Y : Long_Float; R : not null access Darray3);
end Vect6;