URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 384 |
-- { dg-do compile }
|
-- { dg-do compile }
|
-- { dg-options "-O2" }
|
-- { dg-options "-O2" }
|
|
|
function slice1 (Offset : Integer) return String is
|
function slice1 (Offset : Integer) return String is
|
|
|
Convert : constant String := "0123456789abcdef";
|
Convert : constant String := "0123456789abcdef";
|
Buffer : String (1 .. 32);
|
Buffer : String (1 .. 32);
|
Pos : Natural := Buffer'Last;
|
Pos : Natural := Buffer'Last;
|
Value : Long_Long_Integer := Long_Long_Integer (Offset);
|
Value : Long_Long_Integer := Long_Long_Integer (Offset);
|
|
|
begin
|
begin
|
while Value > 0 loop
|
while Value > 0 loop
|
Buffer (Pos) := Convert (Integer (Value mod 16));
|
Buffer (Pos) := Convert (Integer (Value mod 16));
|
Pos := Pos - 1;
|
Pos := Pos - 1;
|
Value := Value / 16;
|
Value := Value / 16;
|
end loop;
|
end loop;
|
|
|
return Buffer (Pos + 1 .. Buffer'Last);
|
return Buffer (Pos + 1 .. Buffer'Last);
|
end;
|
end;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.