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

Diff of /sml/trunk/src/MLRISC/sparc/mltree/sparc.sml

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

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 657, Fri Jun 9 05:20:54 2000 UTC
# Line 105  Line 105 
105      (val signed = true)      (val signed = true)
106    
107    (* unsigned, non-trapping version of multiply and divide *)    (* unsigned, non-trapping version of multiply and divide *)
108    structure Mulu32 = Multiply32    functor Mul32 = Multiply32
109      (val trapping = false      (val trapping = false
110       val multCost = muluCost       val multCost = muluCost
111       fun addv{r1,r2,d} = [I.ARITH{a=I.ADD,r=r1,i=I.REG r2,d=d}]       fun addv{r1,r2,d} = [I.ARITH{a=I.ADD,r=r1,i=I.REG r2,d=d}]
# Line 114  Line 114 
114       val sh2addv = NONE       val sh2addv = NONE
115       val sh3addv = NONE       val sh3addv = NONE
116      )      )
117      (val signed = false)    structure Mulu32 = Mul32(val signed = false)
118    
119      structure Muls32 = Mul32(val signed = true)
120    
121    (* signed, trapping version of multiply and divide *)    (* signed, trapping version of multiply and divide *)
122    structure Mult64 = Multiply64    structure Mult64 = Multiply64
# Line 131  Line 133 
133      (val signed = true)      (val signed = true)
134    
135    (* unsigned, non-trapping version of multiply and divide *)    (* unsigned, non-trapping version of multiply and divide *)
136    structure Mulu64 = Multiply64    functor Mul64 = Multiply64
137      (val trapping = false      (val trapping = false
138       val multCost = muluCost       val multCost = muluCost
139       fun addv{r1,r2,d} = [I.ARITH{a=I.ADD,r=r1,i=I.REG r2,d=d}]       fun addv{r1,r2,d} = [I.ARITH{a=I.ADD,r=r1,i=I.REG r2,d=d}]
# Line 140  Line 142 
142       val sh2addv = NONE       val sh2addv = NONE
143       val sh3addv = NONE       val sh3addv = NONE
144      )      )
145      (val signed = false)    structure Mulu64 = Mul64(val signed = false)
146    
147      structure Muls64 = Mul64(val signed = true)
148    
149    datatype commutative = COMMUTE | NOCOMMUTE    datatype commutative = COMMUTE | NOCOMMUTE
150    datatype cc = REG    (* write to register *)    datatype cc = REG    (* write to register *)
# Line 352  Line 356 
356    
357            (* divisions *)            (* divisions *)
358        and divu32 x = Mulu32.divide{mode=T.TO_ZERO,stm=doStmt} x        and divu32 x = Mulu32.divide{mode=T.TO_ZERO,stm=doStmt} x
359          and divs32 x = Muls32.divide{mode=T.TO_ZERO,stm=doStmt} x
360        and divt32 x = Mult32.divide{mode=T.TO_ZERO,stm=doStmt} x        and divt32 x = Mult32.divide{mode=T.TO_ZERO,stm=doStmt} x
361        and divu64 x = Mulu64.divide{mode=T.TO_ZERO,stm=doStmt} x        and divu64 x = Mulu64.divide{mode=T.TO_ZERO,stm=doStmt} x
362          and divs64 x = Muls64.divide{mode=T.TO_ZERO,stm=doStmt} x
363        and divt64 x = Mult64.divide{mode=T.TO_ZERO,stm=doStmt} x        and divt64 x = Mult64.divide{mode=T.TO_ZERO,stm=doStmt} x
364    
365        (*        (*
# Line 569  Line 575 
575                 arith(I.ADDCC,I.ADDCC,a,b,d,CC_REG,COMMUTE,trap32,an)                 arith(I.ADDCC,I.ADDCC,a,b,d,CC_REG,COMMUTE,trap32,an)
576            | T.SUBT(32,a,b)=>            | T.SUBT(32,a,b)=>
577                 arith(I.SUBCC,I.SUBCC,a,b,d,CC_REG,NOCOMMUTE,trap32,an)                 arith(I.SUBCC,I.SUBCC,a,b,d,CC_REG,NOCOMMUTE,trap32,an)
578            | T.MULU(32,a,b) => extarith(P.umul,Mulu32.multiply,a,b,d,cc,COMMUTE)            | T.MULU(32,a,b) => extarith(P.umul32,
579            | T.MULT(32,a,b) => extarith(P.smul,Mult32.multiply,a,b,d,cc,COMMUTE)                                         Mulu32.multiply,a,b,d,cc,COMMUTE)
580            | T.DIVU(32,a,b) => extarith(P.udiv,divu32,a,b,d,cc,NOCOMMUTE)            | T.MULS(32,a,b) => extarith(P.smul32,
581            | T.DIVT(32,a,b) => extarith(P.sdiv,divt32,a,b,d,cc,NOCOMMUTE)                                         Muls32.multiply,a,b,d,cc,COMMUTE)
582              | T.MULT(32,a,b) => extarith(P.smul32trap,
583                                           Mult32.multiply,a,b,d,cc,COMMUTE)
584              | T.DIVU(32,a,b) => extarith(P.udiv32,divu32,a,b,d,cc,NOCOMMUTE)
585              | T.DIVS(32,a,b) => extarith(P.sdiv32,divs32,a,b,d,cc,NOCOMMUTE)
586              | T.DIVT(32,a,b) => extarith(P.sdiv32trap,divt32,a,b,d,cc,NOCOMMUTE)
587    
588                 (* 64 bit support *)                 (* 64 bit support *)
589            | T.SRA(64,a,b) => shift(I.SRAX,a,b,d,cc,an)            | T.SRA(64,a,b) => shift(I.SRAX,a,b,d,cc,an)
# Line 584  Line 595 
595                 arith(I.SUBCC,I.SUBCC,a,b,d,CC_REG,NOCOMMUTE,trap64,an)                 arith(I.SUBCC,I.SUBCC,a,b,d,CC_REG,NOCOMMUTE,trap64,an)
596            | T.MULU(64,a,b) =>            | T.MULU(64,a,b) =>
597                muldiv64(I.MULX,Mulu64.multiply,a,b,d,cc,COMMUTE,an)                muldiv64(I.MULX,Mulu64.multiply,a,b,d,cc,COMMUTE,an)
598              | T.MULS(64,a,b) =>
599                  muldiv64(I.MULX,Muls64.multiply,a,b,d,cc,COMMUTE,an)
600            | T.MULT(64,a,b) =>            | T.MULT(64,a,b) =>
601                (muldiv64(I.MULX,Mult64.multiply,a,b,d,CC_REG,COMMUTE,an);                (muldiv64(I.MULX,Mult64.multiply,a,b,d,CC_REG,COMMUTE,an);
602                 app emit trap64)                 app emit trap64)
603            | T.DIVU(64,a,b) => muldiv64(I.UDIVX,divu64,a,b,d,cc,NOCOMMUTE,an)            | T.DIVU(64,a,b) => muldiv64(I.UDIVX,divu64,a,b,d,cc,NOCOMMUTE,an)
604              | T.DIVS(64,a,b) => muldiv64(I.SDIVX,divs64,a,b,d,cc,NOCOMMUTE,an)
605            | T.DIVT(64,a,b) => muldiv64(I.SDIVX,divt64,a,b,d,cc,NOCOMMUTE,an)            | T.DIVT(64,a,b) => muldiv64(I.SDIVX,divt64,a,b,d,cc,NOCOMMUTE,an)
606    
607                (* loads *)                (* loads *)

Legend:
Removed from v.651  
changed lines
  Added in v.657

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