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

SCM Repository

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

View of /branches/vis15/src/compiler/target-cpu/target-cpu.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4516 - (download) (annotate)
Mon Sep 5 16:19:47 2016 UTC (3 years, 5 months ago) by jhr
File size: 1402 byte(s)
  Working on merge: strand arrays and spatial queries
(* target-cpu.sml
 *
 * Code generation for the sequential and parallel targets.
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 *)

structure TargetCPU : sig

    val target : TargetOptions.t -> {
            info : TreeIR.target_info,
            generate : TreeIR.program -> unit
          }

  end = struct

    structure Spec = TargetSpec

    fun generate (tgt : TargetOptions.t) prog = let
          val spec = TargetSpec.mk (tgt, prog)
          in
            if (#exec spec)
              then Gen.exec (spec, prog)
              else Gen.library (spec, prog)
          end

    fun info (tgt : TargetOptions.t) = {
            layout = if (#scalar tgt)
                then VectorLayout.scalar
                else VectorLayout.layout (VectorLayout.gccVectorSizes (#double tgt)),
            isInline =
               fn LowOps.RealToInt d => (d = 1) (* because it produces an array when d > 1 *)
                | LowOps.EigenVecs2x2 => false
                | LowOps.EigenVecs3x3 => false
                | LowOps.EigenVals2x2 => false
                | LowOps.EigenVals3x3 => false
                | LowOps.Zero _ => false
                | _ => true
          }

    fun target tgt = {
            info = info tgt,
            generate = generate tgt
          }

  end

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