[multiple changes]

2009-11-30  Robert Dewar  <dewar@adacore.com>

	* g-alleve.adb: Minor code reorganization (use conditional expressions)

2009-11-30  Thomas Quinot  <quinot@adacore.com>

	* a-tasatt.adb, s-taprop-dummy.adb (Ada.Task_Attributes.Reference):
	Remove unreachable code.
	(System.Task_Primitives.Operations.Initialize, dummy version):
	Use plain Program_Error rather than call to
	System.Error_Reporting.Shutdown.

From-SVN: r154766
This commit is contained in:
Arnaud Charlet 2009-11-30 10:48:04 +01:00
parent 979bbe902b
commit 864e0cbdc8
3 changed files with 63 additions and 153 deletions

View File

@ -221,7 +221,6 @@
-- general use 'Unchecked_Access instead of 'Access as the package can be
-- instantiated from within a local context.
with System.Error_Reporting;
with System.Storage_Elements;
with System.Task_Primitives.Operations;
with System.Tasking;
@ -237,8 +236,7 @@ pragma Elaborate_All (System.Tasking.Task_Attributes);
package body Ada.Task_Attributes is
use System.Error_Reporting,
System.Tasking.Initialization,
use System.Tasking.Initialization,
System.Tasking,
System.Tasking.Task_Attributes,
Ada.Exceptions;
@ -424,9 +422,6 @@ package body Ada.Task_Attributes is
end;
end if;
pragma Assert (Shutdown ("Should never get here in Reference"));
return null;
exception
when Tasking_Error | Program_Error =>
raise;

View File

@ -376,11 +376,8 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for K in Varray_Type'Range loop
if A (K) /= Component_Type'First then
D (K) := abs (A (K));
else
D (K) := Component_Type'First;
end if;
D (K) := (if A (K) /= Component_Type'First
then abs (A (K)) else Component_Type'First);
end loop;
return D;
@ -443,11 +440,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_Type'Range loop
if A (J) > B (J) then
D (J) := Bool_True;
else
D (J) := Bool_False;
end if;
D (J) := (if A (J) > B (J) then Bool_True else Bool_False);
end loop;
return D;
@ -489,11 +482,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_Type'Range loop
if A (J) > B (J) then
D (J) := A (J);
else
D (J) := B (J);
end if;
D (J) := (if A (J) > B (J) then A (J) else B (J));
end loop;
return D;
@ -545,11 +534,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_Type'Range loop
if A (J) < B (J) then
D (J) := A (J);
else
D (J) := B (J);
end if;
D (J) := (if A (J) < B (J) then A (J) else B (J));
end loop;
return D;
@ -971,11 +956,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_Type'Range loop
if A (J) = B (J) then
D (J) := Bool_True;
else
D (J) := Bool_False;
end if;
D (J) := (if A (J) = B (J) then Bool_True else Bool_False);
end loop;
return D;
@ -992,11 +973,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
D : Varray_Type;
begin
for J in Varray_Type'Range loop
if A (J) > B (J) then
D (J) := Bool_True;
else
D (J) := Bool_False;
end if;
D (J) := (if A (J) > B (J) then Bool_True else Bool_False);
end loop;
return D;
@ -1011,11 +988,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_Type'Range loop
if A (J) > B (J) then
D (J) := A (J);
else
D (J) := B (J);
end if;
D (J) := (if A (J) > B (J) then A (J) else B (J));
end loop;
return D;
@ -1030,11 +1003,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_Type'Range loop
if A (J) < B (J) then
D (J) := A (J);
else
D (J) := B (J);
end if;
D (J) := (if A (J) < B (J) then A (J) else B (J));
end loop;
return D;
@ -1248,17 +1217,15 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in 0 .. N - 1 loop
if Use_Even_Components then
Offset := Index_Type (2 * J + Integer (Index_Type'First));
else
Offset := Index_Type (2 * J + 1 + Integer (Index_Type'First));
end if;
Offset :=
Index_Type ((if Use_Even_Components then 2 * J else 2 * J + 1) +
Integer (Index_Type'First));
Double_Offset :=
Double_Index_Type (J + Integer (Double_Index_Type'First));
D (Double_Offset) :=
Double_Component_Type (A (Offset))
* Double_Component_Type (B (Offset));
Double_Component_Type (A (Offset)) *
Double_Component_Type (B (Offset));
end loop;
return D;
@ -1418,17 +1385,15 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in 0 .. N - 1 loop
if Use_Even_Components then
Offset := Index_Type (2 * J + Integer (Index_Type'First));
else
Offset := Index_Type (2 * J + 1 + Integer (Index_Type'First));
end if;
Offset :=
Index_Type ((if Use_Even_Components then 2 * J else 2 * J + 1) +
Integer (Index_Type'First));
Double_Offset :=
Double_Index_Type (J + Integer (Double_Index_Type'First));
D (Double_Offset) :=
Double_Component_Type (A (Offset))
* Double_Component_Type (B (Offset));
Double_Component_Type (A (Offset)) *
Double_Component_Type (B (Offset));
end loop;
return D;
@ -1620,11 +1585,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
if (Bits (VSCR, NJ_POS, NJ_POS) = 1)
and then abs (X) < 2.0 ** (-126)
then
if X < 0.0 then
D := -0.0;
else
D := 0.0;
end if;
D := (if X < 0.0 then -0.0 else +0.0);
else
D := X;
end if;
@ -1648,17 +1609,18 @@ package body GNAT.Altivec.Low_Level_Vectors is
function Rnd_To_FPI_Near (X : F64) return F64 is
Result : F64;
Ceiling : F64;
begin
Result := F64 (SI64 (X));
if (F64'Ceiling (X) - X) = (X + 1.0 - F64'Ceiling (X)) then
-- Round to even
Ceiling := F64'Ceiling (X);
if Rnd_To_FPI_Trunc (Ceiling / 2.0) * 2.0 = Ceiling then
Result := Ceiling;
else
Result := Ceiling - 1.0;
end if;
Result :=
(if Rnd_To_FPI_Trunc (Ceiling / 2.0) * 2.0 = Ceiling
then Ceiling else Ceiling - 1.0);
end if;
return Result;
@ -2111,14 +2073,9 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_unsigned_int'Range loop
Addition_Result :=
UI64 (VA.Values (J)) + UI64 (VB.Values (J));
if Addition_Result > UI64 (unsigned_int'Last) then
D.Values (J) := 1;
else
D.Values (J) := 0;
end if;
Addition_Result := UI64 (VA.Values (J)) + UI64 (VB.Values (J));
D.Values (J) :=
(if Addition_Result > UI64 (unsigned_int'Last) then 1 else 0);
end loop;
return To_LL_VSI (To_Vector (D));
@ -2374,19 +2331,15 @@ package body GNAT.Altivec.Low_Level_Vectors is
D.Values (K) := Write_Bit (D.Values (K), 1, 1);
else
if NJ_Truncate (VA.Values (J))
<= NJ_Truncate (VB.Values (J)) then
D.Values (K) := Write_Bit (D.Values (K), 0, 0);
else
D.Values (K) := Write_Bit (D.Values (K), 0, 1);
end if;
D.Values (K) :=
(if NJ_Truncate (VA.Values (J)) <= NJ_Truncate (VB.Values (J))
then Write_Bit (D.Values (K), 0, 0)
else Write_Bit (D.Values (K), 0, 1));
if NJ_Truncate (VA.Values (J))
>= -NJ_Truncate (VB.Values (J)) then
D.Values (K) := Write_Bit (D.Values (K), 1, 0);
else
D.Values (K) := Write_Bit (D.Values (K), 1, 1);
end if;
D.Values (K) :=
(if NJ_Truncate (VA.Values (J)) >= -NJ_Truncate (VB.Values (J))
then Write_Bit (D.Values (K), 1, 0)
else Write_Bit (D.Values (K), 1, 1));
end if;
end loop;
@ -2441,17 +2394,11 @@ package body GNAT.Altivec.Low_Level_Vectors is
VA : constant VF_View := To_View (A);
VB : constant VF_View := To_View (B);
D : VUI_View;
K : Vint_Range;
begin
for J in Varray_float'Range loop
K := Vint_Range (J);
if VA.Values (J) = VB.Values (J) then
D.Values (K) := unsigned_int'Last;
else
D.Values (K) := 0;
end if;
D.Values (Vint_Range (J)) :=
(if VA.Values (J) = VB.Values (J) then unsigned_int'Last else 0);
end loop;
return To_LL_VSI (To_Vector (D));
@ -2465,17 +2412,12 @@ package body GNAT.Altivec.Low_Level_Vectors is
VA : constant VF_View := To_View (A);
VB : constant VF_View := To_View (B);
D : VSI_View;
K : Vint_Range;
begin
for J in Varray_float'Range loop
K := Vint_Range (J);
if VA.Values (J) >= VB.Values (J) then
D.Values (K) := Signed_Bool_True;
else
D.Values (K) := Signed_Bool_False;
end if;
D.Values (Vint_Range (J)) :=
(if VA.Values (J) >= VB.Values (J) then Signed_Bool_True
else Signed_Bool_False);
end loop;
return To_Vector (D);
@ -2567,18 +2509,12 @@ package body GNAT.Altivec.Low_Level_Vectors is
VA : constant VF_View := To_View (A);
VB : constant VF_View := To_View (B);
D : VSI_View;
K : Vint_Range;
begin
for J in Varray_float'Range loop
K := Vint_Range (J);
if NJ_Truncate (VA.Values (J))
> NJ_Truncate (VB.Values (J)) then
D.Values (K) := Signed_Bool_True;
else
D.Values (K) := Signed_Bool_False;
end if;
D.Values (Vint_Range (J)) :=
(if NJ_Truncate (VA.Values (J)) > NJ_Truncate (VB.Values (J))
then Signed_Bool_True else Signed_Bool_False);
end loop;
return To_Vector (D);
@ -3069,11 +3005,8 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_float'Range loop
if VA.Values (J) > VB.Values (J) then
D.Values (J) := VA.Values (J);
else
D.Values (J) := VB.Values (J);
end if;
D.Values (J) := (if VA.Values (J) > VB.Values (J) then VA.Values (J)
else VB.Values (J));
end loop;
return To_Vector (D);
@ -3186,11 +3119,8 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Varray_float'Range loop
if VA.Values (J) < VB.Values (J) then
D.Values (J) := VA.Values (J);
else
D.Values (J) := VB.Values (J);
end if;
D.Values (J) := (if VA.Values (J) < VB.Values (J) then VA.Values (J)
else VB.Values (J));
end loop;
return To_Vector (D);
@ -3924,12 +3854,9 @@ package body GNAT.Altivec.Low_Level_Vectors is
for N in Vchar_Range'Range loop
J := Vchar_Range (Integer (Bits (VC.Values (N), 4, 7))
+ Integer (Vchar_Range'First));
if Bits (VC.Values (N), 3, 3) = 0 then
D.Values (N) := VA.Values (J);
else
D.Values (N) := VB.Values (J);
end if;
D.Values (N) :=
(if Bits (VC.Values (N), 3, 3) = 0 then VA.Values (J)
else VB.Values (J));
end loop;
return To_LL_VSI (To_Vector (D));
@ -4184,12 +4111,9 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for N in Vchar_Range'Range loop
J := Natural (N) + M;
if J <= Natural (Vchar_Range'Last) then
D.Values (N) := VA.Values (Vchar_Range (J));
else
D.Values (N) := 0;
end if;
D.Values (N) :=
(if J <= Natural (Vchar_Range'Last) then VA.Values (Vchar_Range (J))
else 0);
end loop;
return To_LL_VSI (To_Vector (D));
@ -4530,12 +4454,8 @@ package body GNAT.Altivec.Low_Level_Vectors is
begin
for J in Vint_Range'Range loop
Subst_Result := SI64 (VA.Values (J)) - SI64 (VB.Values (J));
if Subst_Result < SI64 (unsigned_int'First) then
D.Values (J) := 0;
else
D.Values (J) := 1;
end if;
D.Values (J) :=
(if Subst_Result < SI64 (unsigned_int'First) then 0 else 1);
end loop;
return To_LL_VSI (To_Vector (D));
@ -5023,12 +4943,11 @@ package body GNAT.Altivec.Low_Level_Vectors is
D := To_View (vcmpbfp (B, C));
for J in Vint_Range'Range loop
-- vcmpbfp is not returning the usual bool vector; do the conversion
if D.Values (J) = 0 then
D.Values (J) := Signed_Bool_False;
else
D.Values (J) := Signed_Bool_True;
end if;
D.Values (J) :=
(if D.Values (J) = 0 then Signed_Bool_False else Signed_Bool_True);
end loop;
return LL_VSI_Operations.Check_CR6 (A, D.Values);

View File

@ -38,8 +38,6 @@ pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during tasking
-- operations. It causes infinite loops and other problems.
with System.Error_Reporting;
package body System.Task_Primitives.Operations is
use System.Tasking;
@ -192,9 +190,7 @@ package body System.Task_Primitives.Operations is
procedure Initialize (Environment_Task : Task_Id) is
No_Tasking : Boolean;
begin
No_Tasking :=
System.Error_Reporting.Shutdown
("Tasking not implemented on this configuration");
raise Program_Error with "Tasking not implemented on this configuration";
end Initialize;
procedure Initialize (S : in out Suspension_Object) is