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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/c-target/c-target.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/c-target/c-target.sml

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

revision 564, Wed Feb 23 22:34:31 2011 UTC revision 565, Thu Feb 24 18:34:48 2011 UTC
# Line 277  Line 277 
277          fun ceil (e, ty) = (CL.mkApply(RN.addTySuffix("ceil", ty), [e]), ty)          fun ceil (e, ty) = (CL.mkApply(RN.addTySuffix("ceil", ty), [e]), ty)
278    
279        (* conversions *)        (* conversions *)
280            fun toInt (e, T_Real) = (CL.mkCast(!RN.gIntTy, e), T_Int)
281              | toInt (e, T_Vec n) = (CL.mkCast(CL.T_Named(RN.ivecTy n), e), ivecTy n)
282              | toInt e = invalid ("toInt", [e])
283          fun toReal (e, T_Int) = (CL.mkCast(!RN.gRealTy, e), T_Real)          fun toReal (e, T_Int) = (CL.mkCast(!RN.gRealTy, e), T_Real)
284            | toReal e = invalid ("toReal", [e])            | toReal e = invalid ("toReal", [e])
285    
         fun truncToInt (e as (_, T_Real)) = (CL.mkCast(!RN.gIntTy, #1(trunc e)), T_Int)  
           | truncToInt (e, T_Vec n) = (CL.mkApply(RN.truncToInt n, [e]), T_IVec n)  
           | truncToInt e = invalid ("truncToInt", [e])  
         fun roundToInt (e as (_, T_Real)) = (CL.mkCast(!RN.gIntTy, #1(round e)), T_Int)  
           | roundToInt e = invalid ("roundToInt", [e])  
         fun ceilToInt (e as (_, T_Real)) = (CL.mkCast(!RN.gIntTy, #1(floor e)), T_Int)  
           | ceilToInt e = invalid ("ceilToInt", [e])  
         fun floorToInt (e as (_, T_Real)) = (CL.mkCast(!RN.gIntTy, #1(ceil e)), T_Int)  
           | floorToInt e = invalid ("floorToInt", [e])  
   
286        (* runtime system hooks *)        (* runtime system hooks *)
287          fun imageAddr (e, T_Image(_, rTy)) = let          fun imageAddr (e, T_Image(_, rTy)) = let
288                val cTy = CL.T_Ptr(CL.T_Num rTy)                val cTy = CL.T_Ptr(CL.T_Num rTy)

Legend:
Removed from v.564  
changed lines
  Added in v.565

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