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

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

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

revision 1003, Fri Dec 7 02:45:32 2001 UTC revision 1009, Wed Jan 9 19:44:22 2002 UTC
# Line 5  Line 5 
5   *   *
6   * -- Allen   * -- Allen
7   *   *
8   * Notes: places with optimizations are marked ***OPT***   * Notes: places with optimizations are marked ***OPT**n*
9   *)   *)
10    
11    
12  functor Alpha  functor Alpha
13     (structure AlphaInstr : ALPHAINSTR     (structure AlphaInstr : ALPHAINSTR
14      structure PseudoInstrs : ALPHA_PSEUDO_INSTR      structure PseudoInstrs : ALPHA_PSEUDO_INSTR
# Line 225  Line 226 
226       type arg  = {r1:CB.cell,r2:CB.cell,d:CB.cell}       type arg  = {r1:CB.cell,r2:CB.cell,d:CB.cell}
227       type argi = {r:CB.cell,i:int,d:CB.cell}       type argi = {r:CB.cell,i:int,d:CB.cell}
228    
229       fun mov{r,d}    = I.copy{dst=[d],src=[r],tmp=NONE,impl=ref NONE}       fun mov{r,d}    = I.COPY{k=CB.GP, sz=intTy, dst=[d],src=[r],tmp=NONE}
230       fun add{r1,r2,d} = I.operate{oper=I.ADDL,ra=r1,rb=I.REGop r2,rc=d}       fun add{r1,r2,d} = I.operate{oper=I.ADDL,ra=r1,rb=I.REGop r2,rc=d}
231       (*       (*
232        * How to left shift by a constant (32bits)        * How to left shift by a constant (32bits)
# Line 268  Line 269 
269       type arg  = {r1:CB.cell, r2:CB.cell, d:CB.cell}       type arg  = {r1:CB.cell, r2:CB.cell, d:CB.cell}
270       type argi = {r:CB.cell, i:int, d:CB.cell}       type argi = {r:CB.cell, i:int, d:CB.cell}
271    
272       fun mov{r,d}    = I.copy{dst=[d],src=[r],tmp=NONE,impl=ref NONE}       fun mov{r,d}    = I.COPY{k=CB.GP, sz=intTy, dst=[d],src=[r],tmp=NONE}
273       fun add{r1,r2,d}= I.operate{oper=I.ADDQ,ra=r1,rb=I.REGop r2,rc=d}       fun add{r1,r2,d}= I.operate{oper=I.ADDQ,ra=r1,rb=I.REGop r2,rc=d}
274       fun slli{r,i,d} = [I.operate{oper=I.SLL,ra=r,rb=I.IMMop i,rc=d}]       fun slli{r,i,d} = [I.operate{oper=I.SLL,ra=r,rb=I.IMMop i,rc=d}]
275       fun srli{r,i,d} = [I.operate{oper=I.SRL,ra=r,rb=I.IMMop i,rc=d}]       fun srli{r,i,d} = [I.operate{oper=I.SRL,ra=r,rb=I.IMMop i,rc=d}]
# Line 456  Line 457 
457    
458        (* emit a copy *)        (* emit a copy *)
459        and copy(dst,src,an) =        and copy(dst,src,an) =
460            mark(I.COPY{dst=dst,src=src,impl=ref NONE,            mark'(I.COPY{k=CB.GP, sz=32, dst=dst,src=src,
461                        tmp=case dst of                        tmp=case dst of
462                             [_] => NONE | _ => SOME(I.Direct(newReg()))},an)                             [_] => NONE | _ => SOME(I.Direct(newReg()))},an)
463    
464        (* emit a floating point copy *)        (* emit a floating point copy *)
465        and fcopy(dst,src,an) =        and fcopy(dst,src,an) =
466            mark(I.FCOPY{dst=dst,src=src,impl=ref NONE,            mark'(I.COPY{k=CB.FP, sz=64, dst=dst,src=src,
467                        tmp=case dst of                        tmp=case dst of
468                             [_] => NONE | _ => SOME(I.FDirect(newFreg()))},an)                             [_] => NONE | _ => SOME(I.FDirect(newFreg()))},an)
469    
470        and move(s,d,an) =        and move(s,d,an) =
471            if CB.sameCell(s,d) orelse CB.sameCell(d,zeroR) then () else            if CB.sameCell(s,d) orelse CB.sameCell(d,zeroR) then () else
472            mark(I.COPY{dst=[d],src=[s],impl=ref NONE,tmp=NONE},an)            mark'(I.COPY{k=CB.GP, sz=32, dst=[d],src=[s],tmp=NONE},an)
473    
474        and fmove(s,d,an) =        and fmove(s,d,an) =
475            if CB.sameCell(s,d) orelse CB.sameCell(d,zeroFR) then () else            if CB.sameCell(s,d) orelse CB.sameCell(d,zeroFR) then () else
476            mark(I.FCOPY{dst=[d],src=[s],impl=ref NONE,tmp=NONE},an)            mark'(I.COPY{k=CB.FP, sz=64, dst=[d],src=[s],tmp=NONE},an)
477    
478         (* emit an sign extension op *)         (* emit an sign extension op *)
479        and signExt32(r,d) =        and signExt32(r,d) =

Legend:
Removed from v.1003  
changed lines
  Added in v.1009

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