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

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

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

revision 2780, Wed Sep 19 04:14:56 2007 UTC revision 2781, Sat Sep 22 19:04:15 2007 UTC
# Line 721  Line 721 
721                  | multiply_notrap (ty, e1 as T.LI _, e2) = multiply_notrap (ty, e2, e1)                  | multiply_notrap (ty, e1 as T.LI _, e2) = multiply_notrap (ty, e2, e1)
722                  | multiply_notrap (ty, e1, e2) = multiply (ty, e1, e2)                  | multiply_notrap (ty, e1, e2) = multiply (ty, e1, e2)
723    
724                  fun cmovcc (tyCond, tyCmp, cc, t1, t2, y, n) = let
725                      fun gen (dstR, _) = let
726                          val _ = expr' (tyCond, n, dstR, [])  (* false branch *)
727                          val src = regOrMem (tyCond, operand tyCond y)  (* yes branch (note the ordering )*)
728                          val cc = cmp (true, tyCmp, cc, t1, t2, []) (* compare *)
729                          in
730                            mark (I.CMOV {cond=cond cc, src=src, dst=dstR}, an)
731                          end
732                      in
733                        dstMustBeReg gen
734                      end
735    
736              in              in
737                (case e                (case e
# Line 797  Line 808 
808                   (* zero-extended loads *)                   (* zero-extended loads *)
809                   | T.ZX(fTy, tTy, T.LOAD (_, ea, mem)) =>                   | T.ZX(fTy, tTy, T.LOAD (_, ea, mem)) =>
810                     genLoad (O.loadZXOp (fTy, tTy), ea, mem)                     genLoad (O.loadZXOp (fTy, tTy), ea, mem)
811                     | T.COND (tyCond, T.CMP (tyCmp, cc, t1, t2), y, n) =>
812                       cmovcc (tyCond, tyCmp, cc, t1, t2, y, n)
813                   | T.LET (s, e) => (stmt s; expr (e, dst, an))                   | T.LET (s, e) => (stmt s; expr (e, dst, an))
814                   | _ => raise Fail("todo: " ^ MLTreeUtils.rexpToString e)                   | _ => raise Fail("todo: " ^ MLTreeUtils.rexpToString e)
815                (* end case *))                (* end case *))

Legend:
Removed from v.2780  
changed lines
  Added in v.2781

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