URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 338 |
package body Tail_Call_P is
|
package body Tail_Call_P is
|
|
|
function Start_Side (Element : T) return Index is
|
function Start_Side (Element : T) return Index is
|
begin
|
begin
|
if Element = 1 then
|
if Element = 1 then
|
raise Program_Error;
|
raise Program_Error;
|
end if;
|
end if;
|
if Element = 0 then
|
if Element = 0 then
|
return Second;
|
return Second;
|
else
|
else
|
return First;
|
return First;
|
end if;
|
end if;
|
end;
|
end;
|
|
|
function Segment (Element : T) return T is
|
function Segment (Element : T) return T is
|
begin
|
begin
|
if Element /= 0 then
|
if Element /= 0 then
|
raise Program_Error;
|
raise Program_Error;
|
end if;
|
end if;
|
return 1;
|
return 1;
|
end;
|
end;
|
|
|
procedure Really_Insert (Into : T; Element : T; Value : T) is
|
procedure Really_Insert (Into : T; Element : T; Value : T) is
|
begin
|
begin
|
if Into /= 0 then
|
if Into /= 0 then
|
raise Program_Error;
|
raise Program_Error;
|
end if;
|
end if;
|
end;
|
end;
|
|
|
procedure Insert (Into : A; Element : T; Value : T) is
|
procedure Insert (Into : A; Element : T; Value : T) is
|
begin
|
begin
|
Really_Insert (Into (Start_Side (Element)), Segment (Element), Value);
|
Really_Insert (Into (Start_Side (Element)), Segment (Element), Value);
|
end Insert;
|
end Insert;
|
|
|
end Tail_Call_P;
|
end Tail_Call_P;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.