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 788, Wed Feb 28 04:09:48 2001 UTC revision 839, Thu Jun 7 20:28:44 2001 UTC
# Line 294  Line 294 
294    
295    fun selectInstructions    fun selectInstructions
296          (instrStream as          (instrStream as
297           S.STREAM{emit,beginCluster,endCluster,           S.STREAM{emit,beginCluster,endCluster,getAnnotations,
298                    defineLabel,entryLabel,pseudoOp,annotation,                    defineLabel,entryLabel,pseudoOp,annotation,
299                    exitBlock,comment,...}) =                    exitBlock,comment,...}) =
300    let    let
# Line 468  Line 468 
468                I.IMMop(toInt(n))                I.IMMop(toInt(n))
469              else let val tmpR = newReg()              else let val tmpR = newReg()
470                   in  loadImmed(n,zeroR,tmpR,[]); I.REGop tmpR end                   in  loadImmed(n,zeroR,tmpR,[]); I.REGop tmpR end
471          | opn(e as (T.CONST _ | T.LABEL _)) = I.LABop e          | opn(e as T.CONST _) = I.LABop e
472          | opn(T.LABEXP x) = I.LABop x          | opn(T.LABEXP x) = I.LABop x
473          | opn e = I.REGop(expr e)          | opn e = I.REGop(expr e)
474    
# Line 661  Line 661 
661            | SOME 0w3 => arith(I.S8ADDQ,a,zeroT,d,an)            | SOME 0w3 => arith(I.S8ADDQ,a,zeroT,d,an)
662            | _        => arith(I.SLL,a,b,d,an)            | _        => arith(I.SLL,a,b,d,an)
663    
664        and sra32(a,b,d,an) =         (* On the alpha, all 32 bit values are already sign extended.
665            let val ra = expr a          * So no sign extension is necessary.  We do the same for
666                val rb = opn b          * sra32 and sra64
               val t  = newReg()  
           in  (* On the alpha, all 32 bit values are already sign extended.  
                * So no sign extension is necessary.  
                * signExt32(ra,t);  
                * mark(I.OPERATE{oper=I.SRA,ra=t,rb=rb,rc=d},an)  
667                 *)                 *)
668                mark(I.OPERATE{oper=I.SRA,ra=ra,rb=rb,rc=d},an)        and sra(a,b,d,an) =
           end  
   
       and sra64(a,b,d,an) =  
669            mark(I.OPERATE{oper=I.SRA,ra=expr a,rb=opn b,rc=d},an)            mark(I.OPERATE{oper=I.SRA,ra=expr a,rb=opn b,rc=d},an)
670    
671        and srl32(a,b,d,an) =        and srl32(a,b,d,an) =
# Line 966  Line 958 
958            | T.REMS(32,a,b) => pseudo(P.reml,a,b,d)            | T.REMS(32,a,b) => pseudo(P.reml,a,b,d)
959    
960            | T.SLL(32,a,b) => sll32(a,b,d,an)            | T.SLL(32,a,b) => sll32(a,b,d,an)
961            | T.SRA(32,a,b) => sra32(a,b,d,an)            | T.SRA(32,a,b) => sra(a,b,d,an)
962            | T.SRL(32,a,b) => srl32(a,b,d,an)            | T.SRL(32,a,b) => srl32(a,b,d,an)
963    
964              (* 64 bit support *)              (* 64 bit support *)
# Line 994  Line 986 
986            | T.REMS(64,a,b) => pseudo(P.remq,a,b,d)            | T.REMS(64,a,b) => pseudo(P.remq,a,b,d)
987    
988            | T.SLL(64,a,b) => sll64(a,b,d,an)            | T.SLL(64,a,b) => sll64(a,b,d,an)
989            | T.SRA(64,a,b) => sra64(a,b,d,an)            | T.SRA(64,a,b) => sra(a,b,d,an)
990            | T.SRL(64,a,b) => srl64(a,b,d,an)            | T.SRL(64,a,b) => srl64(a,b,d,an)
991    
992              (* special bit operations with complement *)              (* special bit operations with complement *)
# Line 1416  Line 1408 
1408        and goto(lab,an) = mark(I.BRANCH{b=I.BR,r=zeroR,lab=lab},an)        and goto(lab,an) = mark(I.BRANCH{b=I.BR,r=zeroR,lab=lab},an)
1409    
1410           (* generate an call instruction *)           (* generate an call instruction *)
1411        and call(ea,flow,defs,uses,mem,an) =        and call(ea,flow,defs,uses,mem,cutTo,an,0) =
1412         let val defs=cellset defs         let val defs=cellset defs
1413             val uses=cellset uses             val uses=cellset uses
1414             val instr =             val instr =
1415                 case (ea, flow) of                 case (ea, flow) of
1416                   (T.LABEL lab, [_]) =>                   (T.LABEL lab, [_]) =>
1417                     I.BSR{lab=lab,r=C.returnAddr,defs=defs,uses=uses,mem=mem}                        I.BSR{lab=lab,r=C.returnAddr,defs=defs,uses=uses,
1418                                cutsTo=cutTo,mem=mem}
1419                 | _ => I.JSR{r=C.returnAddr,b=expr ea,                 | _ => I.JSR{r=C.returnAddr,b=expr ea,
1420                              d=0,defs=defs,uses=uses,mem=mem}                                   d=0,defs=defs,uses=uses,cutsTo=cutTo,mem=mem}
1421         in  mark(instr,an)         in  mark(instr,an)
1422         end         end
1423            | call _ = error "pops<>0 not implemented"
1424    
1425        and doCCexpr(T.CC(_,r),d,an) = move(r,d,an)        and doCCexpr(T.CC(_,r),d,an) = move(r,d,an)
1426          | doCCexpr(T.FCC(_,r),d,an) = fmove(r,d,an)          | doCCexpr(T.FCC(_,r),d,an) = fmove(r,d,an)
# Line 1454  Line 1448 
1448            | T.JMP(T.LABEL lab,_) => goto(lab,an)            | T.JMP(T.LABEL lab,_) => goto(lab,an)
1449            | T.JMP(e,labs) => mark(I.JMPL({r=zeroR,b=expr e,d=0},labs),an)            | T.JMP(e,labs) => mark(I.JMPL({r=zeroR,b=expr e,d=0},labs),an)
1450            | T.BCC(cc,lab) => branch(cc,lab,an)            | T.BCC(cc,lab) => branch(cc,lab,an)
1451            | T.CALL{funct,targets,defs,uses,region,...} =>            | T.CALL{funct,targets,defs,uses,region,pops,...} =>
1452                call(funct,targets,defs,uses,region,an)                call(funct,targets,defs,uses,region,[],an,pops)
1453              | T.FLOW_TO(T.CALL{funct,targets,defs,uses,region,pops,...},cutTo) =>
1454                  call(funct,targets,defs,uses,region,cutTo,an,pops)
1455            | T.RET _ => mark(I.RET{r=zeroR,b=C.returnAddr,d=0},an)            | T.RET _ => mark(I.RET{r=zeroR,b=C.returnAddr,d=0},an)
1456            | T.STORE(8,ea,data,mem) => store8(ea,data,mem,an)            | T.STORE(8,ea,data,mem) => store8(ea,data,mem,an)
1457            | T.STORE(16,ea,data,mem) => store16(ea,data,mem,an)            | T.STORE(16,ea,data,mem) => store16(ea,data,mem,an)
# Line 1506  Line 1502 
1502             entryLabel  = entryLabel,             entryLabel  = entryLabel,
1503             comment     = comment,             comment     = comment,
1504             annotation  = annotation,             annotation  = annotation,
1505               getAnnotations = getAnnotations,
1506             exitBlock   = fn regs => exitBlock(cellset regs)             exitBlock   = fn regs => exitBlock(cellset regs)
1507           }           }
1508     in  self()     in  self()

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

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