Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/compiler/ElabData/prim/primop.sig
ViewVC logotype

Diff of /sml/trunk/compiler/ElabData/prim/primop.sig

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

sml/trunk/src/compiler/FLINT/kernel/primop.sig revision 251, Mon Apr 19 02:55:26 1999 UTC sml/trunk/compiler/FLINT/kernel/primop.sig revision 4418, Mon Sep 18 21:35:55 2017 UTC
# Line 129  Line 129 
129    
130  datatype arithop  datatype arithop
131    = + | - | * | / | ~           (* int or float *)    = + | - | * | / | ~           (* int or float *)
132    | ABS                         (* floating point only *)    | ABS | FSQRT | FSIN | FCOS | FTAN            (* floating point only *)
133    | LSHIFT | RSHIFT | RSHIFTL   (* int only *)    | LSHIFT | RSHIFT | RSHIFTL   (* int only *)
134    | ANDB | ORB | XORB | NOTB    (* int only *)    | ANDB | ORB | XORB | NOTB    (* int only *)
135      | REM | DIV | MOD                             (* int only *)
136    
137  datatype cmpop = > | >= | < | <= | LEU | LTU | GEU | GTU | EQL | NEQ  datatype cmpop = > | >= | < | <= | LEU | LTU | GEU | GTU | EQL | NEQ
138                                    | FSGN (* floating point only *)
139    
140  (*  (*
141   * Various primitive operations.  Those that are designated "inline" are   * Various primitive operations.  Those that are designated "inline" are
# Line 155  Line 157 
157    | EXTEND of int * int    | EXTEND of int * int
158    | COPY of int * int    | COPY of int * int
159    
160      | TEST_INF of int                     (* inf -> i *)
161      | TRUNC_INF of int                    (* inf -> i *)
162      | EXTEND_INF of int                   (* i -> inf *)
163      | COPY_INF of int                     (* i -> inf *)
164    
165    | ROUND of {floor: bool, fromkind: numkind, tokind: numkind}    | ROUND of {floor: bool, fromkind: numkind, tokind: numkind}
166    | REAL of {fromkind: numkind, tokind: numkind}    | REAL of {fromkind: numkind, tokind: numkind}
167    
# Line 174  Line 181 
181    | OBJLENGTH                  (* length of arbitrary heap object *)    | OBJLENGTH                  (* length of arbitrary heap object *)
182    | CAST    | CAST
183    | WCAST    | WCAST
   | GETRUNVEC                  (* get the pointer to the run-vector *)  
184    | MARKEXN                    (* mark an exception value with a string *)    | MARKEXN                    (* mark an exception value with a string *)
185    | GETHDLR | SETHDLR          (* get/set exn handler pointer *)    | GETHDLR | SETHDLR          (* get/set exn handler pointer *)
186    | GETVAR | SETVAR            (* get/set var register *)    | GETVAR | SETVAR            (* get/set var register *)
# Line 196  Line 202 
202    | MKSPECIAL                  (* make a special object *)    | MKSPECIAL                  (* make a special object *)
203    | SETSPECIAL                 (* set the state of a special object *)    | SETSPECIAL                 (* set the state of a special object *)
204    | GETSPECIAL                 (* get the state of a special object *)    | GETSPECIAL                 (* get the state of a special object *)
205    | USELVAR | DEFLVAR    | INLMIN of numkind          (* inline min *)
206    | INLDIV | INLMOD | INLREM   (* inline interger arithmetic *)    | INLMAX of numkind          (* inline max *)
207    | INLMIN |INLMAX | INLABS    (* inline interger arithmetic *)    | INLABS of numkind          (* inline abs *)
208    | INLNOT                     (* inline bool not operator *)    | INLNOT                     (* inline bool not operator *)
209    | INLCOMPOSE                 (* inline compose "op o"  operator *)    | INLCOMPOSE                 (* inline compose "op o"  operator *)
210    | INLBEFORE                  (* inline "before" operator *)    | INLBEFORE                  (* inline "before" operator *)
211      | INLIGNORE                  (* inline "ignore" function *)
212    | INL_ARRAY                  (* inline polymorphic array allocation *)    | INL_ARRAY                  (* inline polymorphic array allocation *)
213    | INL_VECTOR                 (* inline polymorphic vector allocation *)    | INL_VECTOR                 (* inline polymorphic vector allocation *)
214    | INL_MONOARRAY of numkind   (* inline monomorphic array allocation *)    | INL_MONOARRAY of numkind   (* inline monomorphic array allocation *)
# Line 215  Line 222 
222    | GET_SEQ_DATA                (* get data pointer from arr/vec header *)    | GET_SEQ_DATA                (* get data pointer from arr/vec header *)
223    | SUBSCRIPT_REC               (* record subscript operation *)    | SUBSCRIPT_REC               (* record subscript operation *)
224    | SUBSCRIPT_RAW64             (* raw64 subscript operation *)    | SUBSCRIPT_RAW64             (* raw64 subscript operation *)
225    (* Primops to support new experimental C FFI. *)
226      | RAW_LOAD of numkind         (* load from arbitrary memory location *)
227      | RAW_STORE of numkind        (* store to arbitrary memory location *)
228        (* make a call to a C-function;
229         * The primop carries C function prototype information and specifies
230         * which of its (ML-) arguments are floating point. C prototype
231         * information is for use by the backend, ML information is for
232         * use by the CPS converter. *)
233      | RAW_CCALL of { c_proto: CTypes.c_proto,
234                       ml_args: ccall_type list,
235                       ml_res_opt: ccall_type option,
236                       reentrant : bool
237                     } option
238       (* Allocate uninitialized storage on the heap.
239        * The record is meant to hold short-lived C objects, i.e., they
240        * are not ML pointers.  The representation is
241        * the same as RECORD with tag tag_raw32 (fblock = false),
242        * or tag_fblock (fblock = true).
243        *)
244      | RAW_RECORD of { fblock: bool }
245    
246      | INLIDENTITY                         (* polymorphic identity *)
247    
248      | CVT64                               (* convert between external and
249                                             * internal representation of
250                                             * simulated 64-bit scalars *)
251    
252    and ccall_type =
253        CCI32 |                             (* passed as int32 *)
254        CCI64 |                             (* int64, currently unused *)
255        CCR64 |                             (* passed as real64 *)
256        CCML                                (* passed as Unsafe.Object.object *)
257    
258  val IADD : primop  (* default integer addition *)  val IADD : primop  (* default integer addition *)
259  val ISUB : primop  (* default integer subtraction *)  val ISUB : primop  (* default integer subtraction *)
# Line 233  Line 271 
271    
272  val prNumkind : numkind -> string  val prNumkind : numkind -> string
273  val prPrimop: primop -> string  val prPrimop: primop -> string
 val purePrimop : primop -> bool  
274  val mayRaise : primop -> bool  val mayRaise : primop -> bool
275  (* This should return more than just a boolean.  (* This should return more than just a boolean.
276   * True means "can not be dead-code eliminated" *)   * True means "can not be dead-code eliminated" *)

Legend:
Removed from v.251  
changed lines
  Added in v.4418

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