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/hppa/backpatch/hppaDelaySlotProps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/hppa/backpatch/hppaDelaySlotProps.sml

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

revision 1002, Fri Nov 30 17:11:33 2001 UTC revision 1003, Fri Dec 7 02:45:32 2001 UTC
# Line 36  Line 36 
36    
37     fun delaySlot{instr, backward} =     fun delaySlot{instr, backward} =
38         case instr of         case instr of
39           I.BCOND{nop,n,...} =>           I.INSTR(I.BCOND{nop,n,...}) =>
40               {nop=nop, n=n, nOn=if backward then D_TAKEN else D_FALLTHRU,               {nop=nop, n=n, nOn=if backward then D_TAKEN else D_FALLTHRU,
41                nOff=D_ALWAYS}                nOff=D_ALWAYS}
42         | I.BCONDI{nop,n,...} =>         | I.INSTR(I.BCONDI{nop,n,...}) =>
43               {nop=nop, n=n, nOn=if backward then D_TAKEN else D_FALLTHRU,               {nop=nop, n=n, nOn=if backward then D_TAKEN else D_FALLTHRU,
44                nOff=D_ALWAYS}                nOff=D_ALWAYS}
45         | I.BB{nop,n,...} =>         | I.INSTR(I.BB{nop,n,...}) =>
46               {nop=nop, n=n, nOn=if backward then D_TAKEN else D_FALLTHRU,               {nop=nop, n=n, nOn=if backward then D_TAKEN else D_FALLTHRU,
47                nOff=D_ALWAYS}                nOff=D_ALWAYS}
48         | I.B{n,...} => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}         | I.INSTR(I.B{n,...}) => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}
49         | I.LONGJUMP{n,...} => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}         | I.INSTR(I.LONGJUMP{n,...}) => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}
50         | I.BV{n,...} => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}         | I.INSTR(I.BV{n,...}) => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}
51         | I.BE{n,...} => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}         | I.INSTR(I.BE{n,...}) => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}
52         | I.BLR{n,...} => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}         | I.INSTR(I.BLR{n,...}) => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}
53         | I.BL{n,...} => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}         | I.INSTR(I.BL{n,...}) => {nop=false, n=n, nOn=D_NONE, nOff=D_ALWAYS}
54         | I.ANNOTATION{i,...} => delaySlot{instr=i,backward=backward}         | I.ANNOTATION{i,...} => delaySlot{instr=i,backward=backward}
55         | _ => {n=false,nOn=D_ERROR,nOff=D_NONE,nop=false}         | _ => {n=false,nOn=D_ERROR,nOff=D_NONE,nop=false}
56    
57     fun enableDelaySlot{instr, n, nop} =     fun enableDelaySlot{instr, n, nop} =
58         case (instr,nop) of         case (instr,nop) of
59           (I.BCOND{cmp,bc,r1,r2,t,f,...},_) =>           (I.INSTR(I.BCOND{cmp,bc,r1,r2,t,f,...}),_) =>
60               I.BCOND{cmp=cmp,bc=bc,nop=nop,n=n,r1=r1,r2=r2,t=t,f=f}               I.bcond{cmp=cmp,bc=bc,nop=nop,n=n,r1=r1,r2=r2,t=t,f=f}
61         | (I.BCONDI{cmpi,bc,i,r2,t,f,...},_) =>         | (I.INSTR(I.BCONDI{cmpi,bc,i,r2,t,f,...}),_) =>
62               I.BCONDI{cmpi=cmpi,bc=bc,nop=nop,n=n,i=i,r2=r2,t=t,f=f}               I.bcondi{cmpi=cmpi,bc=bc,nop=nop,n=n,i=i,r2=r2,t=t,f=f}
63         | (I.BB{bc,p,r,t,f,...},_) =>         | (I.INSTR(I.BB{bc,p,r,t,f,...}),_) =>
64               I.BB{bc=bc,p=p,nop=nop,n=n,r=r,t=t,f=f}               I.bb{bc=bc,p=p,nop=nop,n=n,r=r,t=t,f=f}
65         | (I.B{lab,...},false) => I.B{lab=lab,n=n}         | (I.INSTR(I.B{lab,...}),false) => I.b{lab=lab,n=n}
66         | (I.BV{labs,b,x,...},false) => I.BV{labs=labs,b=b,x=x,n=n}         | (I.INSTR(I.BV{labs,b,x,...}),false) => I.bv{labs=labs,b=b,x=x,n=n}
67         | (I.BE{labs,b,d,sr,...},false) => I.BE{labs=labs,b=b,d=d,sr=sr,n=n}         | (I.INSTR(I.BE{labs,b,d,sr,...}),false) => I.be{labs=labs,b=b,d=d,sr=sr,n=n}
68         | (I.BLR{x,t,labs,...},false) => I.BLR{x=x,t=t,labs=labs,n=n}         | (I.INSTR(I.BLR{x,t,labs,...}),false) => I.blr{x=x,t=t,labs=labs,n=n}
69         | (I.BL{lab,t,defs,uses,cutsTo,mem,...},false) =>         | (I.INSTR(I.BL{lab,t,defs,uses,cutsTo,mem,...}),false) =>
70              I.BL{lab=lab,t=t,defs=defs,uses=uses,cutsTo=cutsTo,mem=mem,n=n}              I.bl{lab=lab,t=t,defs=defs,uses=uses,cutsTo=cutsTo,mem=mem,n=n}
71         | (I.LONGJUMP{lab,tmp,tmpLab,...},false) =>         | (I.INSTR(I.LONGJUMP{lab,tmp,tmpLab,...}),false) =>
72              I.LONGJUMP{lab=lab,tmp=tmp,tmpLab=tmpLab,n=n}              I.longjump{lab=lab,tmp=tmp,tmpLab=tmpLab,n=n}
73         | (I.ANNOTATION{i,a},_) =>         | (I.ANNOTATION{i,a},_) =>
74             I.ANNOTATION{i=enableDelaySlot{instr=i,n=n,nop=nop},a=a}             I.ANNOTATION{i=enableDelaySlot{instr=i,n=n,nop=nop},a=a}
75         | _ => error "enableDelaySlot"         | _ => error "enableDelaySlot"
# Line 101  Line 101 
101          end          end
102    
103      fun delaySlotCandidate{jmp,delaySlot=      fun delaySlotCandidate{jmp,delaySlot=
104               (I.BCOND _ | I.BCONDI _ | I.BB _ | I.FBRANCH _ | I.BV _ | I.BE _ |               (  I.INSTR(I.BCOND _) | I.INSTR(I.BCONDI _) | I.INSTR(I.BB _) | I.INSTR(I.FBRANCH _)
105                I.COMCLR_LDO _ | I.COMICLR_LDO _ | I.B _ | I.LONGJUMP _ |                | I.INSTR(I.BV _) | I.INSTR(I.BE _) | I.INSTR(I.COMCLR_LDO _) | I.INSTR(I.COMICLR_LDO _)
106                I.BLR _ | I.BL _ | I.BLE _)} = false                | I.INSTR(I.B _) | I.INSTR(I.LONGJUMP _) | I.INSTR(I.BLR _) | I.INSTR(I.BL _)
107                  | I.INSTR(I.BLE _))} = false
108        | delaySlotCandidate{jmp=I.ANNOTATION{i,...},delaySlot} =        | delaySlotCandidate{jmp=I.ANNOTATION{i,...},delaySlot} =
109             delaySlotCandidate{jmp=i,delaySlot=delaySlot}             delaySlotCandidate{jmp=i,delaySlot=delaySlot}
110        | delaySlotCandidate{jmp,delaySlot=I.ANNOTATION{i,...}} =        | delaySlotCandidate{jmp,delaySlot=I.ANNOTATION{i,...}} =
111             delaySlotCandidate{jmp=jmp,delaySlot=i}             delaySlotCandidate{jmp=jmp,delaySlot=i}
112        | delaySlotCandidate _ = true        | delaySlotCandidate _ = true
113    
114     fun setTarget(I.BCOND{n,nop,r1,r2,cmp,bc,t,f,...},lab) =     fun setTarget(I.INSTR(I.BCOND{n,nop,r1,r2,cmp,bc,t,f,...}), lab) =
115           I.BCOND{cmp=cmp,bc=bc,nop=nop,n=n,r1=r1,r2=r2,t=lab,f=f}           I.bcond{cmp=cmp,bc=bc,nop=nop,n=n,r1=r1,r2=r2,t=lab,f=f}
116       | setTarget(I.BCONDI{n,nop,i,r2,cmpi,bc,t,f,...},lab) =       | setTarget(I.INSTR(I.BCONDI{n,nop,i,r2,cmpi,bc,t,f,...}), lab) =
117           I.BCONDI{cmpi=cmpi,bc=bc,nop=nop,n=n,i=i,r2=r2,t=lab,f=f}           I.bcondi{cmpi=cmpi,bc=bc,nop=nop,n=n,i=i,r2=r2,t=lab,f=f}
118       | setTarget(I.BB{bc,r,p,n,nop,t,f,...},lab) =       | setTarget(I.INSTR(I.BB{bc,r,p,n,nop,t,f,...}), lab) =
119           I.BB{bc=bc,p=p,nop=nop,n=n,r=r,t=lab,f=f}           I.bb{bc=bc,p=p,nop=nop,n=n,r=r,t=lab,f=f}
120       | setTarget(I.B{n,...},lab) = I.B{n=n,lab=lab}       | setTarget(I.INSTR(I.B{n,...}), lab) = I.b{n=n,lab=lab}
121       | setTarget(I.LONGJUMP{n, tmp, tmpLab, ...},lab) =       | setTarget(I.INSTR(I.LONGJUMP{n, tmp, tmpLab, ...}), lab) =
122           I.LONGJUMP{n=n, tmp=tmp, tmpLab=tmpLab, lab=lab}           I.longjump{n=n, tmp=tmp, tmpLab=tmpLab, lab=lab}
123       | setTarget(I.ANNOTATION{i,a},lab) = I.ANNOTATION{i=setTarget(i,lab),a=a}       | setTarget(I.ANNOTATION{i,a},lab) = I.ANNOTATION{i=setTarget(i,lab),a=a}
124       | setTarget _ = error "setTarget"       | setTarget _ = error "setTarget"
125    

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

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