OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [opt1.adb] - Blame information for rev 696

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 696 jeremybenn
-- { dg-do compile }
2
-- { dg-options "-O -gnatws" }
3
 
4
package body Opt1 is
5
 
6
   function De_Linear_Index
7
     (Index       : Natural;
8
      D           : Natural;
9
      Ind_Lengths : Dimention_Length)
10
      return        Dimension_Indexes
11
   is
12
      Len     : Natural := 1;
13
      Tmp_Ind : Natural := Index;
14
      Tmp_Res : Natural;
15
      Result  : Dimension_Indexes (1 .. D);
16
   begin
17
      for J in 1 .. D loop
18
         Len := Len * Ind_Lengths (J);
19
      end loop;
20
 
21
      for J in Result'Range loop
22
         Result (J) := Tmp_Res;
23
         Tmp_Ind := Tmp_Ind - Len * (Result (J) - 1);
24
      end loop;
25
 
26
      return Result;
27
   end;
28
 
29
end Opt1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.