cannam@95
|
1 (*
|
cannam@95
|
2 * Copyright (c) 1997-1999 Massachusetts Institute of Technology
|
cannam@95
|
3 * Copyright (c) 2003, 2007-11 Matteo Frigo
|
cannam@95
|
4 * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
|
cannam@95
|
5 *
|
cannam@95
|
6 * This program is free software; you can redistribute it and/or modify
|
cannam@95
|
7 * it under the terms of the GNU General Public License as published by
|
cannam@95
|
8 * the Free Software Foundation; either version 2 of the License, or
|
cannam@95
|
9 * (at your option) any later version.
|
cannam@95
|
10 *
|
cannam@95
|
11 * This program is distributed in the hope that it will be useful,
|
cannam@95
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
cannam@95
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
cannam@95
|
14 * GNU General Public License for more details.
|
cannam@95
|
15 *
|
cannam@95
|
16 * You should have received a copy of the GNU General Public License
|
cannam@95
|
17 * along with this program; if not, write to the Free Software
|
cannam@95
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
cannam@95
|
19 *
|
cannam@95
|
20 *)
|
cannam@95
|
21
|
cannam@95
|
22 type stride =
|
cannam@95
|
23 | SVar of string
|
cannam@95
|
24 | SConst of string
|
cannam@95
|
25 | SInteger of int
|
cannam@95
|
26 | SNeg of stride
|
cannam@95
|
27 val array_subscript : string -> stride -> int -> string
|
cannam@95
|
28 val varray_subscript : string -> stride -> stride -> int -> int -> string
|
cannam@95
|
29
|
cannam@95
|
30 val real_of : string -> string
|
cannam@95
|
31 val imag_of : string -> string
|
cannam@95
|
32
|
cannam@95
|
33 val realtype : string
|
cannam@95
|
34 val realtypep : string
|
cannam@95
|
35 val constrealtype : string
|
cannam@95
|
36 val constrealtypep : string
|
cannam@95
|
37 val stridetype : string
|
cannam@95
|
38
|
cannam@95
|
39 type c_decl =
|
cannam@95
|
40 | Decl of string * string
|
cannam@95
|
41 | Tdecl of string (* arbitrary text declaration *)
|
cannam@95
|
42
|
cannam@95
|
43 and c_ast =
|
cannam@95
|
44 | Asch of Annotate.annotated_schedule
|
cannam@95
|
45 | Simd_leavefun
|
cannam@95
|
46 | Return of c_ast
|
cannam@95
|
47 | For of c_ast * c_ast * c_ast * c_ast
|
cannam@95
|
48 | If of c_ast * c_ast
|
cannam@95
|
49 | Block of (c_decl list) * (c_ast list)
|
cannam@95
|
50 | Binop of string * c_ast * c_ast
|
cannam@95
|
51 | Expr_assign of c_ast * c_ast
|
cannam@95
|
52 | Stmt_assign of c_ast * c_ast
|
cannam@95
|
53 | Comma of c_ast * c_ast
|
cannam@95
|
54 | Integer of int
|
cannam@95
|
55 | CVar of string
|
cannam@95
|
56 | CCall of string * c_ast
|
cannam@95
|
57 | CPlus of c_ast list
|
cannam@95
|
58 | ITimes of c_ast * c_ast
|
cannam@95
|
59 | CUminus of c_ast
|
cannam@95
|
60 and c_fcn = | Fcn of string * string * c_decl list * c_ast
|
cannam@95
|
61
|
cannam@95
|
62 val unparse_expr : Expr.expr -> string
|
cannam@95
|
63 val unparse_assignment : Expr.assignment -> string
|
cannam@95
|
64 val unparse_annotated : bool -> Annotate.annotated_schedule -> string
|
cannam@95
|
65 val unparse_decl : c_decl -> string
|
cannam@95
|
66 val unparse_ast : c_ast -> string
|
cannam@95
|
67 val unparse_function : c_fcn -> string
|
cannam@95
|
68
|
cannam@95
|
69 val flops_of : c_fcn -> string
|
cannam@95
|
70 val print_cost : c_fcn -> string
|
cannam@95
|
71
|
cannam@95
|
72 val ast_to_expr_list : c_ast -> Expr.expr list
|
cannam@95
|
73 val extract_constants : c_ast -> c_decl list
|
cannam@95
|
74 val ctimes : (c_ast * c_ast) -> c_ast
|