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

SCM Repository

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

View of /trunk/src/compiler/IL/il-basis.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1910 - (download) (annotate)
Tue Jun 5 12:02:36 2012 UTC (9 years, 7 months ago) by jhr
File size: 1622 byte(s)
  Added basis functions fmod, ln, log10, while removing some deprecated functions.
(* 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 fmod : name
    val log10 : name
    val ln : name
    val pow : name
    val sin : name
    val sqrt : name
    val tan : name

    val allFuns : name list

    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 functions (in alphabetical order). The names used here are from the C math.h
   * API, so they may differ from the Diderot names.
   *)
    val atan2 = Atom.atom "atan2"
    val cos = Atom.atom "cos"
    val fmod = Atom.atom "fmod"
    val log10 = Atom.atom "log10"
    val ln = Atom.atom "log"		(* Diderot name is "ln", C name is "log" *)
    val pow = Atom.atom "pow"
    val sin = Atom.atom "sin"
    val sqrt = Atom.atom "sqrt"
    val tan = Atom.atom "tan"

    val allFuns = [
	    atan2, cos, fmod, log10, ln, pow, sin, sqrt, 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