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/MLRISC/mltree/mltree-gen.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/mltree/mltree-gen.sml

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

revision 788, Wed Feb 28 04:09:48 2001 UTC revision 796, Tue Mar 6 00:04:33 2001 UTC
# Line 66  Line 66 
66         in  rightShift(W,f(W,T.SLL(W,a,shift),T.SLL(W,b,shift)),shift)         in  rightShift(W,f(W,T.SLL(W,a,shift),T.SLL(W,b,shift)),shift)
67         end         end
68    
69     fun promoteTy(e,ty) =     fun promoteTy(ty) =
70     let fun loop([]) =     let fun loop([]) =
71             raise Unsupported("can't promote integer width "^Int.toString ty)             raise Unsupported("can't promote integer width "^Int.toString ty)
72           | loop(t::ts) = if t > ty then t else loop ts           | loop(t::ts) = if t > ty then t else loop ts
# Line 75  Line 75 
75     fun promotable rightShift (e, f, ty, a, b) =     fun promotable rightShift (e, f, ty, a, b) =
76         case naturalWidths of         case naturalWidths of
77           [] => arith(rightShift,f,ty,a,b)           [] => arith(rightShift,f,ty,a,b)
78         | _  => f(promoteTy(e, ty), a, b)         | _  => f(promoteTy(ty), a, b)
79    
80     (*     (*
81      * Translate integer expressions of unknown types into the appropriate      * Translate integer expressions of unknown types into the appropriate
# Line 165  Line 165 
165          * one of the naturally supported widths on the machine.          * one of the naturally supported widths on the machine.
166          *)          *)
167         | T.CVTF2I(ty,round,fty,e) =>         | T.CVTF2I(ty,round,fty,e) =>
168           let val ty' = promoteTy(exp,ty)           let val ty' = promoteTy(ty)
169           in  T.SX(ty,ty',T.CVTF2I(ty',round,fty,e))           in  T.SX(ty,ty',T.CVTF2I(ty',round,fty,e))
170           end           end
171    
172             (* Promote to higher width and zero high bits *)
173           | T.SLL(ty, data, shift) =>
174             let val ty' = promoteTy(ty)
175             in  T.ZX(ty, ty', T.SLL(ty', data, shift)) end
176    
177         | exp => raise Unsupported("unknown expression")         | exp => raise Unsupported("unknown expression")
178    
179     fun compileFexp fexp = raise Unsupported("unknown expression")     fun compileFexp fexp = raise Unsupported("unknown expression")

Legend:
Removed from v.788  
changed lines
  Added in v.796

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