SCM Repository
View of /trunk/src/compiler/mid-il/mid-il-types.sml
Parent Directory
|
Revision Log
Revision 427 -
(download)
(annotate)
Mon Oct 18 19:35:52 2010 UTC (11 years, 8 months ago) by jhr
File size: 1039 byte(s)
Mon Oct 18 19:35:52 2010 UTC (11 years, 8 months ago) by jhr
File size: 1039 byte(s)
Bug fix: realTy == VecTy 1 (not 0)
(* 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 *) | ImageTy val intTy = IVecTy 1 val realTy = VecTy 1 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 | hash ImageTy = 0w6 fun toString BoolTy = "bool" | toString StringTy = "string" | toString (IVecTy 1) = "int" | toString (IVecTy d) = "int" ^ Int.toString d | toString (VecTy 1) = "real" | toString (VecTy d) = "real" ^ Int.toString d | toString AddrTy = "addr" | toString ImageTy = "image" end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |