Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/c-target/runtime-names.sml
ViewVC logotype

Diff of /trunk/src/compiler/c-target/runtime-names.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1231, Mon May 16 13:49:17 2011 UTC revision 1232, Mon May 16 23:37:52 2011 UTC
# Line 15  Line 15 
15    (* globals that specify the target characteristics.  These should be initialized    (* globals that specify the target characteristics.  These should be initialized
16     * when the program object is created.     * when the program object is created.
17     *)     *)
18        val doublePrecision = ref false
19      val gVectorWid = ref 4      val gVectorWid = ref 4
20      val gIntTy = ref CLang.int32      val gIntTy = ref CLang.int32
21      val gRealTy = ref CLang.float      val gRealTy = ref CLang.float
# Line 23  Line 24 
24      val gIntFormat = ref "?"      val gIntFormat = ref "?"
25    
26    (* initialize globals based on target precision *)    (* initialize globals based on target precision *)
27      fun initTargetSpec () = if !Controls.doublePrecision      fun initTargetSpec double = (
28              doublePrecision := double;
29              if double
30            then (            then (
31              gVectorWid := 2;              gVectorWid := 2;
32              gIntTy := CLang.int64;              gIntTy := CLang.int64;
# Line 37  Line 40 
40              gRealTy := CLang.float;              gRealTy := CLang.float;
41              gRealSuffix := "f";              gRealSuffix := "f";
42              gIntSuffix := "i";              gIntSuffix := "i";
43              gIntFormat := "%d")                gIntFormat := "%d"))
44    
45      fun addRealSuffix stem = stem ^ !gRealSuffix      fun addRealSuffix stem = stem ^ !gRealSuffix
46      fun addVecSuffix stem n = concat[stem, Int.toString n, !gRealSuffix]      fun addVecSuffix stem n = concat[stem, Int.toString n, !gRealSuffix]
# Line 53  Line 56 
56    
57    (* names of generated tyes, functions, and globals *)    (* names of generated tyes, functions, and globals *)
58      val initGlobals = "Diderot_InitGlobals"     (* function for initializing program globals *)      val initGlobals = "Diderot_InitGlobals"     (* function for initializing program globals *)
59        val shutdown = "Diderot_Shutdown"           (* function that gets called at the end *)
60      val initially = "Diderot_Initially"         (* function for creating initial strands *)      val initially = "Diderot_Initially"         (* function for creating initial strands *)
61      fun strandInit strand = strand ^ "_InitState"      fun strandInit strand = strand ^ "_InitState"
62      fun strandTy strand = concat["Strand_", strand, "_t"]      fun strandTy strand = concat["Strand_", strand, "_t"]
# Line 120  Line 124 
124    
125      fun input ty = (case ty      fun input ty = (case ty
126             of Ty.StringTy => "Diderot_InputString"             of Ty.StringTy => "Diderot_InputString"
127              | Ty.TensorTy[] => "Diderot_Input" ^ !gRealSuffix              | Ty.TensorTy[] => "Diderot_InputReal"
128              | Ty.TensorTy[3] => "Diderot_InputVec3" ^ !gRealSuffix              | Ty.TensorTy[2] => "Diderot_InputVec2"
129                | Ty.TensorTy[3] => "Diderot_InputVec3"
130              | ty => raise Fail("unsupported input type " ^ Ty.toString ty)              | ty => raise Fail("unsupported input type " ^ Ty.toString ty)
131            (* end case *))            (* end case *))
132    

Legend:
Removed from v.1231  
changed lines
  Added in v.1232

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0