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/src/compiler/Semant/statenv/prim.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/statenv/prim.sml

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

revision 1173, Sat Mar 23 04:18:51 2002 UTC revision 1174, Sat Mar 23 21:14:40 2002 UTC
# Line 189  Line 189 
189  val i32 = BT.int32Ty  val i32 = BT.int32Ty
190  val w32 = BT.word32Ty  val w32 = BT.word32Ty
191  val w8 = BT.word8Ty  val w8 = BT.word8Ty
192    val s  = BT.stringTy
193    
194  fun p0 t = t  fun p0 t = t
195  fun p1 t = T.POLYty {sign=[false], tyfun=T.TYFUN {arity=1, body=t}}  fun p1 t = T.POLYty {sign=[false], tyfun=T.TYFUN {arity=1, body=t}}
# Line 219  Line 220 
220  val w32i32_u = p0(ar(pa(w32,i32),u))  val w32i32_u = p0(ar(pa(w32,i32),u))
221  val w32f64_u = p0(ar(pa(w32,f64),u))  val w32f64_u = p0(ar(pa(w32,f64),u))
222    
223    val i_x      = p1(ar(i,v1))
224    val xw32_w32 = p1(ar(pa(v1,w32),w32))
225    val xw32_i32 = p1(ar(pa(v1,w32),i32))
226    val xw32_f64 = p1(ar(pa(v1,w32),f64))
227    val xw32w32_u = p1(ar(tp(v1,w32,w32),u))
228    val xw32i32_u = p1(ar(tp(v1,w32,i32),u))
229    val xw32f64_u = p1(ar(tp(v1,w32,f64),u))
230    
231  val b_b = unf bo  val b_b = unf bo
232    
233  val f64_i = p0(ar(f64,i))  val f64_i = p0(ar(f64,i))
# Line 289  Line 298 
298   * generate code according to the C calling convention.   * generate code according to the C calling convention.
299   * (In other words, 'b will be a completely ad-hoc encoding of a CTypes.c_proto   * (In other words, 'b will be a completely ad-hoc encoding of a CTypes.c_proto
300   * value in ML types.)   * value in ML types.)
301     *
302     * The reentrant version of the operator has an extra bool type parameter.
303     * Its value is ignored.
304   *)   *)
305  val rccType = p3(ar(tp(w32,v1,v2),v3))  val rccType = p3(ar(tp(w32,v1,v2),v3))
306    val rccType' = p3(ar(tp(s,v1,v2),v3))
307    val reentrantRccType = p3(ar(BT.tupleTy[w32,v1,v2,bo],v3))
308    val reentrantRccType' = p3(ar(BT.tupleTy[s,v1,v2,bo],v3))
309    
310  in  in
311    
# Line 681  Line 696 
696         ("rawi32s",      P.RAW_STORE (P.INT 32),   w32i32_u) :-:         ("rawi32s",      P.RAW_STORE (P.INT 32),   w32i32_u) :-:
697         ("rawf32s",      P.RAW_STORE (P.FLOAT 32), w32f64_u) :-:         ("rawf32s",      P.RAW_STORE (P.FLOAT 32), w32f64_u) :-:
698         ("rawf64s",      P.RAW_STORE (P.FLOAT 64), w32f64_u) :-:         ("rawf64s",      P.RAW_STORE (P.FLOAT 64), w32f64_u) :-:
699         ("rawccall",     P.RAW_CCALL NONE,         rccType)         ("rawccall",     P.RAW_CCALL NONE,         rccType) :-:
700           ("rawccall_direct", P.RAW_CCALL NONE,      rccType') :-:
701    
702              (* Support for experimental reentrant C calls *)
703           ("rawccall_reentrant",  P.RAW_CCALL NONE,  reentrantRccType) :-:
704           ("rawccall_reentrant_direct",  P.RAW_CCALL NONE,  reentrantRccType') :-:
705    
706              (* Support for direct construction of C objects on ML heap.
707               * rawrecord builds a record holding C objects on the heap.
708               * rawselectxxx index on this record.  They are of type:
709               *    'a * Word32.word -> Word32.word
710               * The 'a is to guarantee that the compiler will treat
711               * the record as a ML object, in case it passes thru a gc boundary.
712               * rawupdatexxx writes to the record.
713               *)
714           ("rawrecord",    P.RAW_RECORD{tag=true,sz=4}, i_x) :-:
715           ("rawrecord_notag",P.RAW_RECORD{tag=false,sz=4}, i_x) :-:
716           ("rawrecord64",    P.RAW_RECORD{tag=true,sz=8}, i_x) :-:
717           ("rawrecord64_notag",P.RAW_RECORD{tag=false,sz=8}, i_x) :-:
718    
719           ("rawselectw8",  P.RAW_LOAD (P.UINT 8), xw32_w32) :-:
720           ("rawselecti8",  P.RAW_LOAD (P.INT 8), xw32_i32) :-:
721           ("rawselectw16", P.RAW_LOAD (P.UINT 16), xw32_w32) :-:
722           ("rawselecti16", P.RAW_LOAD (P.INT 16), xw32_i32) :-:
723           ("rawselectw32", P.RAW_LOAD (P.UINT 32), xw32_w32) :-:
724           ("rawselecti32", P.RAW_LOAD (P.INT 32), xw32_i32) :-:
725           ("rawselectf32", P.RAW_LOAD (P.FLOAT 32), xw32_f64) :-:
726           ("rawselectf64", P.RAW_LOAD (P.FLOAT 64), xw32_f64) :-:
727    
728           ("rawupdatew8",  P.RAW_STORE (P.UINT 8), xw32w32_u) :-:
729           ("rawupdatei8",  P.RAW_STORE (P.INT 8), xw32i32_u) :-:
730           ("rawupdatew16", P.RAW_STORE (P.UINT 16), xw32w32_u) :-:
731           ("rawupdatei16", P.RAW_STORE (P.INT 16), xw32i32_u) :-:
732           ("rawupdatew32", P.RAW_STORE (P.UINT 32), xw32w32_u) :-:
733           ("rawupdatei32", P.RAW_STORE (P.INT 32), xw32i32_u) :-:
734           ("rawupdatef32", P.RAW_STORE (P.FLOAT 32), xw32f64_u) :-:
735           ("rawupdatef64", P.RAW_STORE (P.FLOAT 64), xw32f64_u)
736    
737  end (* local *)  end (* local *)
738    

Legend:
Removed from v.1173  
changed lines
  Added in v.1174

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