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

Diff of /sml/trunk/src/MLRISC/sparc/backpatch/sparcDelaySlotProps.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 16  Line 16 
16    
17     fun delaySlot{instr, backward} =     fun delaySlot{instr, backward} =
18       case instr of       case instr of
19         I.CALL{nop,...} => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}         I.INSTR(I.CALL{nop,...}) => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}
20       | I.JMP{nop,...}  => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.JMP{nop,...}) => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}
21       | I.JMPL{nop,...} => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.JMPL{nop,...}) => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}
22       | I.RET{nop,...}  => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.RET{nop,...})  => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}
23       | I.Bicc{b=I.BA,a,nop,...} => {n=false,nOn=D_NONE,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.Bicc{b=I.BA,a,nop,...}) => {n=false,nOn=D_NONE,nOff=D_ALWAYS,nop=nop}
24       | I.Bicc{a,nop,...} => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.Bicc{a,nop,...}) => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}
25       | I.FBfcc{a,nop,...} => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.FBfcc{a,nop,...}) => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}
26       | I.BR{a,nop,...} => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.BR{a,nop,...}) => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}
27       | I.BP{a,nop,...} => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.BP{a,nop,...}) => {n=a,nOn=D_TAKEN,nOff=D_ALWAYS,nop=nop}
28       | I.FCMP{nop,...} => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}       | I.INSTR(I.FCMP{nop,...}) => {n=false,nOn=D_ERROR,nOff=D_ALWAYS,nop=nop}
29       | I.ANNOTATION{i,...} => delaySlot{instr=i,backward=backward}       | I.ANNOTATION{i,...} => delaySlot{instr=i,backward=backward}
30       | _ => {n=false,nOn=D_ERROR,nOff=D_NONE,nop=false}       | _ => {n=false,nOn=D_ERROR,nOff=D_NONE,nop=false}
31    
32     fun enableDelaySlot{instr, n, nop} =     fun enableDelaySlot{instr, n, nop} =
33         case (instr,n) of         case (instr,n) of
34           (I.CALL{defs,uses,label,cutsTo,mem,...},false) =>           (I.INSTR(I.CALL{defs,uses,label,cutsTo,mem,...}),false) =>
35              I.CALL{defs=defs,uses=uses,label=label,cutsTo=cutsTo,              I.call{defs=defs,uses=uses,label=label,cutsTo=cutsTo,
36                     nop=nop,mem=mem}                     nop=nop,mem=mem}
37         | (I.JMPL{r,i,d,defs,uses,mem,cutsTo,...},false) =>         | (I.INSTR(I.JMPL{r,i,d,defs,uses,mem,cutsTo,...}),false) =>
38              I.JMPL{r=r,i=i,d=d,defs=defs,uses=uses,cutsTo=cutsTo,              I.jmpl{r=r,i=i,d=d,defs=defs,uses=uses,cutsTo=cutsTo,
39                     nop=nop,mem=mem}                     nop=nop,mem=mem}
40         | (I.JMP{r,i,labs,...},false) =>         | (I.INSTR(I.JMP{r,i,labs,...}),false) =>
41              I.JMP{r=r,i=i,labs=labs,nop=nop}              I.jmp{r=r,i=i,labs=labs,nop=nop}
42         | (I.RET{leaf,...},false) => I.RET{leaf=leaf,nop=nop}         | (I.INSTR(I.RET{leaf,...}),false) => I.ret{leaf=leaf,nop=nop}
43         | (I.Bicc{b,a,label,...},_) => I.Bicc{b=b,a=n,nop=nop,label=label}         | (I.INSTR(I.Bicc{b,a,label,...}),_) => I.bicc{b=b,a=n,nop=nop,label=label}
44         | (I.FBfcc{b,a,label,...},_) => I.FBfcc{b=b,a=n,nop=nop,label=label}         | (I.INSTR(I.FBfcc{b,a,label,...}),_) => I.fbfcc{b=b,a=n,nop=nop,label=label}
45         | (I.BR{nop,label,p,r,rcond,...},_) =>         | (I.INSTR(I.BR{nop,label,p,r,rcond,...}),_) =>
46              I.BR{rcond=rcond,r=r,a=n,nop=nop,label=label,p=p}              I.br{rcond=rcond,r=r,a=n,nop=nop,label=label,p=p}
47         | (I.BP{nop,label,p,cc,b,...},_) =>         | (I.INSTR(I.BP{nop,label,p,cc,b,...}),_) =>
48              I.BP{b=b,cc=cc,a=n,nop=nop,label=label,p=p}              I.bp{b=b,cc=cc,a=n,nop=nop,label=label,p=p}
49         | (I.FCMP{cmp,r1,r2,...},false) => I.FCMP{cmp=cmp,r1=r1,r2=r2,nop=nop}         | (I.INSTR(I.FCMP{cmp,r1,r2,...}),false) => I.fcmp{cmp=cmp,r1=r1,r2=r2,nop=nop}
50         | (I.ANNOTATION{i,a},n) =>         | (I.ANNOTATION{i,a},n) =>
51             I.ANNOTATION{i=enableDelaySlot{instr=i,n=n,nop=nop},a=a}             I.ANNOTATION{i=enableDelaySlot{instr=i,n=n,nop=nop},a=a}
52         | _ => error "enableDelaySlot"         | _ => error "enableDelaySlot"
# Line 76  Line 76 
76                | cc I.UDIVCC = true                | cc I.UDIVCC = true
77                | cc I.SDIVCC = true                | cc I.SDIVCC = true
78                | cc _ = false                | cc _ = false
79              fun defUseOther(I.Ticc _) = ([],psr)              fun defUseOther(I.INSTR(I.Ticc _)) = ([],psr)
80                | defUseOther(I.ARITH{a,...}) =                | defUseOther(I.INSTR(I.ARITH{a,...})) =
81                    if cc a then (psr,[]) else ([],[])                    if cc a then (psr,[]) else ([],[])
82                | defUseOther(I.WRY _) = (y,[])                | defUseOther(I.INSTR(I.WRY _)) = (y,[])
83                | defUseOther(I.RDY _) = ([],y)                | defUseOther(I.INSTR(I.RDY _)) = ([],y)
84                | defUseOther(I.FCMP _) = (fsr,[])                | defUseOther(I.INSTR(I.FCMP _)) = (fsr,[])
85                | defUseOther(I.Bicc{b=I.BA,...}) = ([],[])                | defUseOther(I.INSTR(I.Bicc{b=I.BA,...})) = ([],[])
86                | defUseOther(I.Bicc _) = ([],psr)                | defUseOther(I.INSTR(I.Bicc _)) = ([],psr)
87                | defUseOther(I.FBfcc _) = ([],fsr)                | defUseOther(I.INSTR(I.FBfcc _)) = ([],fsr)
88                | defUseOther(I.MOVicc _) = ([],psr)                | defUseOther(I.INSTR(I.MOVicc _)) = ([],psr)
89                | defUseOther(I.MOVfcc _) = ([],fsr)                | defUseOther(I.INSTR(I.MOVfcc _)) = ([],fsr)
90                | defUseOther(I.FMOVicc _) = ([],psr)                | defUseOther(I.INSTR(I.FMOVicc _)) = ([],psr)
91                | defUseOther(I.FMOVfcc _) = ([],fsr)                | defUseOther(I.INSTR(I.FMOVfcc _)) = ([],fsr)
92                | defUseOther(I.CALL _) = (everything,[])                | defUseOther(I.INSTR(I.CALL _)) = (everything,[])
93                | defUseOther(I.JMPL _) = (everything,[])                | defUseOther(I.INSTR(I.JMPL _)) = (everything,[])
94                | defUseOther(I.ANNOTATION{i,...}) = defUseOther i                | defUseOther(I.ANNOTATION{i,...}) = defUseOther i
95                | defUseOther _ = ([],[])                | defUseOther _ = ([],[])
96              fun clash(defUse) =              fun clash(defUse) =
# Line 114  Line 114 
114          end          end
115    
116      fun delaySlotCandidate{jmp,delaySlot=      fun delaySlotCandidate{jmp,delaySlot=
117                           (I.CALL _ | I.Bicc _ | I.FBfcc _ | I.Ticc _ | I.BR _                (  I.INSTR(I.CALL _) | I.INSTR(I.Bicc _) | I.INSTR(I.FBfcc _)
118                           | I.JMP _ | I.JMPL _ | I.RET _ | I.BP _ )} = false                 | I.INSTR(I.Ticc _) | I.INSTR(I.BR _) | I.INSTR(I.JMP _) | I.INSTR(I.JMPL _)
119        | delaySlotCandidate{jmp=I.FCMP _,delaySlot=I.FCMP _} = false                 | I.INSTR(I.RET _) | I.INSTR(I.BP _) )} = false
120          | delaySlotCandidate{jmp=I.INSTR(I.FCMP _),delaySlot=I.INSTR(I.FCMP _)} = false
121        | delaySlotCandidate{jmp=I.ANNOTATION{i,...},delaySlot} =        | delaySlotCandidate{jmp=I.ANNOTATION{i,...},delaySlot} =
122             delaySlotCandidate{jmp=i,delaySlot=delaySlot}             delaySlotCandidate{jmp=i,delaySlot=delaySlot}
123        | delaySlotCandidate{jmp,delaySlot=I.ANNOTATION{i,...}} =        | delaySlotCandidate{jmp,delaySlot=I.ANNOTATION{i,...}} =
124             delaySlotCandidate{jmp=jmp,delaySlot=i}             delaySlotCandidate{jmp=jmp,delaySlot=i}
125        | delaySlotCandidate _ = true        | delaySlotCandidate _ = true
126    
127     fun setTarget(I.Bicc{b,a,nop,...},lab) = I.Bicc{b=b,a=a,nop=nop,label=lab}     fun setTarget(I.INSTR(I.Bicc{b,a,nop,...}),lab) = I.bicc{b=b,a=a,nop=nop,label=lab}
128       | setTarget(I.FBfcc{b,a,nop,...},lab) = I.FBfcc{b=b,a=a,nop=nop,label=lab}       | setTarget(I.INSTR(I.FBfcc{b,a,nop,...}),lab) = I.fbfcc{b=b,a=a,nop=nop,label=lab}
129       | setTarget(I.BR{rcond,p,r,a,nop,...},lab) =       | setTarget(I.INSTR(I.BR{rcond,p,r,a,nop,...}),lab) =
130            I.BR{rcond=rcond,p=p,r=r,a=a,nop=nop,label=lab}            I.br{rcond=rcond,p=p,r=r,a=a,nop=nop,label=lab}
131       | setTarget(I.BP{b,p,cc,a,nop,...},lab) =       | setTarget(I.INSTR(I.BP{b,p,cc,a,nop,...}),lab) =
132            I.BP{b=b,p=p,cc=cc,a=a,nop=nop,label=lab}            I.bp{b=b,p=p,cc=cc,a=a,nop=nop,label=lab}
133       | 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}
134       | setTarget _ = error "setTarget"       | setTarget _ = error "setTarget"
135    

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