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

SCM Repository

[diderot] View of /branches/pure-cfg/src/compiler/IL/il-basis.sml
ViewVC logotype

View of /branches/pure-cfg/src/compiler/IL/il-basis.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 695 - (download) (annotate)
Fri Mar 25 17:52:54 2011 UTC (9 years ago) by jhr
File size: 1190 byte(s)
  Added mechanism for supporting "black box" functions (e.g., sin and sqrt).
  Also added atan2, sqrt, and tan functions to Basis
(* il-basis.sml
 *
 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * These are functions that the various IL optimization passes treat as
 * "black boxes", so we do not need to have a separate operator constructor
 * for each.
 *)

structure ILBasis :> sig

    type name

    val toString : name -> string
    val same : name * name -> bool
    val hash : name -> word

  (* Basis function *)
    val atan2 : name
    val cos : name
    val pow : name
    val sin : name
    val sqrt : name
    val tan : name

    structure Set : ORD_SET where type Key.ord_key = name
    structure Map : ORD_MAP where type Key.ord_key = name
    structure Tbl : MONO_HASH_TABLE where type Key.hash_key = name

  end = struct

    type name = Atom.atom

    val toString = Atom.toString
    val same = Atom.same
    val hash = Atom.hash

  (* Basis function *)
    val atan2 = Atom.atom "atan2"
    val cos = Atom.atom "cos"
    val pow = Atom.atom "pow"
    val sin = Atom.atom "sin"
    val sqrt = Atom.atom "sqrt"
    val tan = Atom.atom "tan"

    structure Set = AtomSet
    structure Map = AtomMap
    structure Tbl = AtomTable

  end

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