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/CodeGen/main/mlriscGen.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/CodeGen/main/mlriscGen.sml

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

revision 1179, Tue Mar 26 03:04:46 2002 UTC revision 1180, Tue Mar 26 22:24:24 2002 UTC
# Line 741  Line 741 
741              | int31xor(w, v as CPS.INT _) = int31xor (v,w)              | int31xor(w, v as CPS.INT _) = int31xor (v,w)
742              | int31xor(v, w) = addTag (M.XORB(ity, regbind v, regbind w))              | int31xor(v, w) = addTag (M.XORB(ity, regbind v, regbind w))
743    
744            fun int31mul(signed, v, w) =            fun int31mul(signed, mulOp, v, w) =
745            let fun f(CPS.INT k, CPS.INT j) = (LI(k+k), LI(j))            let fun f(CPS.INT k, CPS.INT j) = (LI(k+k), LI(j))
746                  | f(CPS.INT k, w) = (untag(signed,w), LI(k+k))                  | f(CPS.INT k, w) = (untag(signed,w), LI(k+k))
747                  | f(v, w as CPS.INT _) = f(w, v)                  | f(v, w as CPS.INT _) = f(w, v)
748                  | f(v, w) = (stripTag(regbind v), untag(signed,w))                  | f(v, w) = (stripTag(regbind v), untag(signed,w))
749                val (v, w) = f(v, w)                val (v, w) = f(v, w)
750            in  addTag(if signed then M.MULT(ity, v, w) else M.MULU(ity, v, w))            in  addTag(mulOp(ity, v, w))
751            end            end
752    
753            fun int31div(signed, v, w) =            fun int31div(signed, v, w) =
# Line 1490  Line 1490 
1490                       of P.xorb   => defI31(x, int31xor(v,w), e, hp)                       of P.xorb   => defI31(x, int31xor(v,w), e, hp)
1491                        | P.lshift => defI31(x, int31lshift(v,w), e, hp)                        | P.lshift => defI31(x, int31lshift(v,w), e, hp)
1492                        | P.rshift => defI31(x, int31rshift(M.SRA,v,w),e,hp)                        | P.rshift => defI31(x, int31rshift(M.SRA,v,w),e,hp)
1493                          | P.+ => defI31(x, int31add(M.ADD, v, w), e, hp)
1494                          | P.- => defI31(x, int31sub(M.SUB, v, w), e, hp)
1495                          | P.* => defI31(x, int31mul(true, M.MULS, v, w), e, hp)
1496                        | _ => error "gen:PURE INT 31"                        | _ => error "gen:PURE INT 31"
1497                      (*esac*))                      (*esac*))
1498                   | P.INT 32  => (case oper                   | P.INT 32  => (case oper
# Line 1501  Line 1504 
1504                   | P.UINT 31 => (case oper                   | P.UINT 31 => (case oper
1505                       of P.+    => defI31(x, int31add(M.ADD, v, w), e, hp)                       of P.+    => defI31(x, int31add(M.ADD, v, w), e, hp)
1506                        | P.-    => defI31(x, int31sub(M.SUB, v, w), e, hp)                        | P.-    => defI31(x, int31sub(M.SUB, v, w), e, hp)
1507                        | P.*    => defI31(x, int31mul(false, v, w), e, hp)                        | P.*    => defI31(x, int31mul(false, M.MULU, v, w), e, hp)
1508                        | P./    => (* This is not really a pure                        | P./    => (* This is not really a pure
1509                                       operation -- oh well *)                                       operation -- oh well *)
1510                                   (updtHeapPtr hp;                                   (updtHeapPtr hp;
# Line 1704  Line 1707 
1707                     case oper                     case oper
1708                      of P.+ => int31add(M.ADDT, v, w)                      of P.+ => int31add(M.ADDT, v, w)
1709                       | P.- => int31sub(M.SUBT, v, w)                       | P.- => int31sub(M.SUBT, v, w)
1710                       | P.* => int31mul(true, v, w)                       | P.* => int31mul(true, M.MULT, v, w)
1711                       | P./ => int31div(true, v, w)                       | P./ => int31div(true, v, w)
1712                       | _   => error "gen:ARITH INT 31"                       | _   => error "gen:ARITH INT 31"
1713                 in  defI31(x, t, e, 0) end                 in  defI31(x, t, e, 0) end

Legend:
Removed from v.1179  
changed lines
  Added in v.1180

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