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 2162, Thu Nov 2 21:20:47 2006 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    
# Line 155  Line 156 
156    | EXTEND of int * int    | EXTEND of int * int
157    | COPY of int * int    | COPY of int * int
158    
159      | TEST_INF of int                     (* inf -> i *)
160      | TRUNC_INF of int                    (* inf -> i *)
161      | EXTEND_INF of int                   (* i -> inf *)
162      | COPY_INF of int                     (* i -> inf *)
163    
164    | ROUND of {floor: bool, fromkind: numkind, tokind: numkind}    | ROUND of {floor: bool, fromkind: numkind, tokind: numkind}
165    | REAL of {fromkind: numkind, tokind: numkind}    | REAL of {fromkind: numkind, tokind: numkind}
166    
# Line 197  Line 203 
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    | USELVAR | DEFLVAR
206    | INLDIV | INLMOD | INLREM   (* inline interger arithmetic *)    | INLMIN of numkind          (* inline min *)
207    | INLMIN |INLMAX | INLABS    (* inline interger arithmetic *)    | INLMAX of numkind          (* inline max *)
208      | INLABS of numkind          (* inline abs *)
209    | INLNOT                     (* inline bool not operator *)    | INLNOT                     (* inline bool not operator *)
210    | INLCOMPOSE                 (* inline compose "op o"  operator *)    | INLCOMPOSE                 (* inline compose "op o"  operator *)
211    | INLBEFORE                  (* inline "before" operator *)    | INLBEFORE                  (* inline "before" operator *)
212      | INLIGNORE                  (* inline "ignore" function *)
213    | INL_ARRAY                  (* inline polymorphic array allocation *)    | INL_ARRAY                  (* inline polymorphic array allocation *)
214    | INL_VECTOR                 (* inline polymorphic vector allocation *)    | INL_VECTOR                 (* inline polymorphic vector allocation *)
215    | INL_MONOARRAY of numkind   (* inline monomorphic array allocation *)    | INL_MONOARRAY of numkind   (* inline monomorphic array allocation *)
# Line 215  Line 223 
223    | GET_SEQ_DATA                (* get data pointer from arr/vec header *)    | GET_SEQ_DATA                (* get data pointer from arr/vec header *)
224    | SUBSCRIPT_REC               (* record subscript operation *)    | SUBSCRIPT_REC               (* record subscript operation *)
225    | SUBSCRIPT_RAW64             (* raw64 subscript operation *)    | SUBSCRIPT_RAW64             (* raw64 subscript operation *)
226    (* Primops to support new experimental C FFI. *)
227      | RAW_LOAD of numkind         (* load from arbitrary memory location *)
228      | RAW_STORE of numkind        (* store to arbitrary memory location *)
229        (* make a call to a C-function;
230         * The primop carries C function prototype information and specifies
231         * which of its (ML-) arguments are floating point. C prototype
232         * information is for use by the backend, ML information is for
233         * use by the CPS converter. *)
234      | RAW_CCALL of { c_proto: CTypes.c_proto,
235                       ml_args: ccall_type list,
236                       ml_res_opt: ccall_type option,
237                       reentrant : bool
238                     } option
239       (* Allocate uninitialized storage on the heap.
240        * The record is meant to hold short-lived C objects, i.e., they
241        * are not ML pointers.  The representation is
242        * the same as RECORD with tag tag_raw32 (fblock = false),
243        * or tag_fblock (fblock = true).
244        *)
245      | RAW_RECORD of { fblock: bool }
246    
247      | INLIDENTITY                         (* polymorphic identity *)
248    
249      | CVT64                               (* convert between external and
250                                             * internal representation of
251                                             * simulated 64-bit scalars *)
252    
253    and ccall_type =
254        CCI32 |                             (* passed as int32 *)
255        CCI64 |                             (* int64, currently unused *)
256        CCR64 |                             (* passed as real64 *)
257        CCML                                (* passed as Unsafe.Object.object *)
258    
259  val IADD : primop  (* default integer addition *)  val IADD : primop  (* default integer addition *)
260  val ISUB : primop  (* default integer subtraction *)  val ISUB : primop  (* default integer subtraction *)
# Line 233  Line 272 
272    
273  val prNumkind : numkind -> string  val prNumkind : numkind -> string
274  val prPrimop: primop -> string  val prPrimop: primop -> string
 val purePrimop : primop -> bool  
275  val mayRaise : primop -> bool  val mayRaise : primop -> bool
276  (* This should return more than just a boolean.  (* This should return more than just a boolean.
277   * 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.2162

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