cannam@95: (* cannam@95: * Copyright (c) 1997-1999 Massachusetts Institute of Technology cannam@95: * Copyright (c) 2003, 2007-11 Matteo Frigo cannam@95: * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology cannam@95: * cannam@95: * This program is free software; you can redistribute it and/or modify cannam@95: * it under the terms of the GNU General Public License as published by cannam@95: * the Free Software Foundation; either version 2 of the License, or cannam@95: * (at your option) any later version. cannam@95: * cannam@95: * This program is distributed in the hope that it will be useful, cannam@95: * but WITHOUT ANY WARRANTY; without even the implied warranty of cannam@95: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the cannam@95: * GNU General Public License for more details. cannam@95: * cannam@95: * You should have received a copy of the GNU General Public License cannam@95: * along with this program; if not, write to the Free Software cannam@95: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA cannam@95: * cannam@95: *) cannam@95: cannam@95: type stride = cannam@95: | SVar of string cannam@95: | SConst of string cannam@95: | SInteger of int cannam@95: | SNeg of stride cannam@95: val array_subscript : string -> stride -> int -> string cannam@95: val varray_subscript : string -> stride -> stride -> int -> int -> string cannam@95: cannam@95: val real_of : string -> string cannam@95: val imag_of : string -> string cannam@95: cannam@95: val realtype : string cannam@95: val realtypep : string cannam@95: val constrealtype : string cannam@95: val constrealtypep : string cannam@95: val stridetype : string cannam@95: cannam@95: type c_decl = cannam@95: | Decl of string * string cannam@95: | Tdecl of string (* arbitrary text declaration *) cannam@95: cannam@95: and c_ast = cannam@95: | Asch of Annotate.annotated_schedule cannam@95: | Simd_leavefun cannam@95: | Return of c_ast cannam@95: | For of c_ast * c_ast * c_ast * c_ast cannam@95: | If of c_ast * c_ast cannam@95: | Block of (c_decl list) * (c_ast list) cannam@95: | Binop of string * c_ast * c_ast cannam@95: | Expr_assign of c_ast * c_ast cannam@95: | Stmt_assign of c_ast * c_ast cannam@95: | Comma of c_ast * c_ast cannam@95: | Integer of int cannam@95: | CVar of string cannam@95: | CCall of string * c_ast cannam@95: | CPlus of c_ast list cannam@95: | ITimes of c_ast * c_ast cannam@95: | CUminus of c_ast cannam@95: and c_fcn = | Fcn of string * string * c_decl list * c_ast cannam@95: cannam@95: val unparse_expr : Expr.expr -> string cannam@95: val unparse_assignment : Expr.assignment -> string cannam@95: val unparse_annotated : bool -> Annotate.annotated_schedule -> string cannam@95: val unparse_decl : c_decl -> string cannam@95: val unparse_ast : c_ast -> string cannam@95: val unparse_function : c_fcn -> string cannam@95: cannam@95: val flops_of : c_fcn -> string cannam@95: val print_cost : c_fcn -> string cannam@95: cannam@95: val ast_to_expr_list : c_ast -> Expr.expr list cannam@95: val extract_constants : c_ast -> c_decl list cannam@95: val ctimes : (c_ast * c_ast) -> c_ast