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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/target-cpu/gen.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/target-cpu/gen.sml

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

revision 3931, Sun Jun 5 14:13:21 2016 UTC revision 3954, Sat Jun 11 17:59:55 2016 UTC
# Line 38  Line 38 
38              }              }
39    
40    (* create the target-specific substitution list *)    (* create the target-specific substitution list *)
41      fun mkSubs (spec, IR.Strand{name, ...}, IR.Create{dim, ...}) = [      fun mkSubs (spec, strand, IR.Create{dim, ...}) = let
42              val IR.Strand{name, stateInit, initM, updateM, stabilizeM, ...} = strand
43              fun mkMethodArgs (name, NONE) = (name, "")
44                | mkMethodArgs (name, SOME(IR.Method{usesGlobals, needsWorld, ...})) = let
45                    val value = if needsWorld then "this, " else ""
46                    val value = if usesGlobals then value ^ "glob, " else value
47                    in
48                      (name, value)
49                    end
50              in [
51              ("CFILE",                   OS.Path.joinBaseExt{base= #outBase spec, ext= SOME "c"}),              ("CFILE",                   OS.Path.joinBaseExt{base= #outBase spec, ext= SOME "c"}),
52              ("CXXFILE",                 OS.Path.joinBaseExt{base= #outBase spec, ext= SOME "cxx"}),              ("CXXFILE",                 OS.Path.joinBaseExt{base= #outBase spec, ext= SOME "cxx"}),
53              ("HDRFILE",                 OS.Path.joinBaseExt{base= #outBase spec, ext= SOME "h"}),              ("HDRFILE",                 OS.Path.joinBaseExt{base= #outBase spec, ext= SOME "h"}),
# Line 56  Line 65 
65              ("DIDEROT_INT_PRECISION",   TargetSpec.intPrecisionDef spec),              ("DIDEROT_INT_PRECISION",   TargetSpec.intPrecisionDef spec),
66              ("DIDEROT_TARGET",          TargetSpec.targetDef spec),              ("DIDEROT_TARGET",          TargetSpec.targetDef spec),
67              ("REALTY",                  if #double spec then "double" else "float"),              ("REALTY",                  if #double spec then "double" else "float"),
68              ("INTTY",                   if #longint spec then "int64_t" else "int32_t")              ("INTTY",                   if #longint spec then "int64_t" else "int32_t"),
69            ]              mkMethodArgs ("STATE_INIT_ARGS", SOME stateInit),
70                mkMethodArgs ("INITIALLY_ARGS", initM),
71                mkMethodArgs ("UPDATE_ARGS", SOME updateM),
72                mkMethodArgs ("STABILIZE_ARGS", stabilizeM)
73              ] end
74    
75      fun condCons (true, x, xs) = x::xs      fun condCons (true, x, xs) = x::xs
76        | condCons (false, _, xs) = xs        | condCons (false, _, xs) = xs

Legend:
Removed from v.3931  
changed lines
  Added in v.3954

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