SCM Repository
View of /trunk/src/compiler/mid-il/mid-il-types.sml
Parent Directory
|
Revision Log
Revision 394 -
(download)
(annotate)
Thu Oct 14 16:30:29 2010 UTC (11 years, 8 months ago) by jhr
File size: 961 byte(s)
Thu Oct 14 16:30:29 2010 UTC (11 years, 8 months ago) by jhr
File size: 961 byte(s)
Added types to IL variables
(* mid-il-types.sml * * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu) * All rights reserved. * * Types for the MidIL. *) structure MidILTypes = struct datatype ty = BoolTy | StringTy | IVecTy of int (* integers; both scalars and vectors *) | VecTy of int (* reals; both scalars and vectors *) | AddrTy (* voxel address *) val intTy = IVecTy 0 val realTy = VecTy 0 fun same (ty1 : ty, ty2) = (ty1 = ty2) fun hash BoolTy = 0w1 | hash StringTy = 0w2 | hash (IVecTy d) = 0w7 * Word.fromInt d + 0w3 | hash (VecTy d) = 0w11 * Word.fromInt d + 0w4 | hash AddrTy = 0w5 fun toString BoolTy = "bool" | toString StringTy = "string" | toString (IVecTy 0) = "int" | toString (IVecTy d) = "int" ^ Int.toString d | toString (VecTy 0) = "real" | toString (VecTy d) = "real" ^ Int.toString d | toString AddrTy = "addr" end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |