Do not use pragma Provide_Shift_Operators in Atree package
This pragma is relatively recent and may be problematic for the bootstrap. gcc/ada/ * atree.ads (Slot): Remove pragma Provide_Shift_Operators. (Shift_Left): New intrinsic function. (Shift_Right): Likewise. * atree.adb (Get_1_Bit_Val): Use Natural instead of Integer. (Get_2_Bit_Val): Likewise. (Get_4_Bit_Val): Likewise. (Get_8_Bit_Val): Likewise. (Set_1_Bit_Val): Likewise. (Set_2_Bit_Val): Likewise. (Set_4_Bit_Val): Likewise. (Set_8_Bit_Val): Likewise.
This commit is contained in:
parent
a1b10eec36
commit
b1241d5738
2 changed files with 14 additions and 9 deletions
|
@ -564,7 +564,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
return Field_1_Bit (Shift_Right (S, V) and 1);
|
||||
end Get_1_Bit_Val;
|
||||
|
@ -577,7 +577,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
return Field_2_Bit (Shift_Right (S, V) and 3);
|
||||
end Get_2_Bit_Val;
|
||||
|
@ -590,7 +590,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
return Field_4_Bit (Shift_Right (S, V) and 15);
|
||||
end Get_4_Bit_Val;
|
||||
|
@ -603,7 +603,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
return Field_8_Bit (Shift_Right (S, V) and 255);
|
||||
end Get_8_Bit_Val;
|
||||
|
@ -626,7 +626,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
S := (S and not Shift_Left (1, V)) or Shift_Left (Slot (Val), V);
|
||||
end Set_1_Bit_Val;
|
||||
|
@ -639,7 +639,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
S := (S and not Shift_Left (3, V)) or Shift_Left (Slot (Val), V);
|
||||
end Set_2_Bit_Val;
|
||||
|
@ -652,7 +652,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
S := (S and not Shift_Left (15, V)) or Shift_Left (Slot (Val), V);
|
||||
end Set_4_Bit_Val;
|
||||
|
@ -665,7 +665,7 @@ package body Atree is
|
|||
pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L));
|
||||
|
||||
S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L);
|
||||
V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L));
|
||||
V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L));
|
||||
begin
|
||||
S := (S and not Shift_Left (255, V)) or Shift_Left (Slot (Val), V);
|
||||
end Set_8_Bit_Val;
|
||||
|
|
|
@ -653,7 +653,12 @@ package Atree is
|
|||
Slot_Size : constant := 32;
|
||||
type Slot is mod 2**Slot_Size;
|
||||
for Slot'Size use Slot_Size;
|
||||
pragma Provide_Shift_Operators (Slot);
|
||||
|
||||
function Shift_Left (S : Slot; V : Natural) return Slot;
|
||||
pragma Import (Intrinsic, Shift_Left);
|
||||
|
||||
function Shift_Right (S : Slot; V : Natural) return Slot;
|
||||
pragma Import (Intrinsic, Shift_Right);
|
||||
|
||||
type Field_1_Bit is mod 2**1;
|
||||
type Field_2_Bit is mod 2**2;
|
||||
|
|
Loading…
Add table
Reference in a new issue