Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/alpha/backpatch/alphaJumps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/alpha/backpatch/alphaJumps.sml

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

revision 1333, Thu May 22 17:12:13 2003 UTC revision 1334, Thu May 22 22:46:30 2003 UTC
# Line 80  Line 80 
80    *)    *)
81    val zeroR = Option.valOf(C.zeroReg CellsBasis.GP)    val zeroR = Option.valOf(C.zeroReg CellsBasis.GP)
82    
83      fun caseSize 4 { four, twelf } = four ()
84        | caseSize 12 { four, twelf } = twelf ()
85        | caseSize sz _ = error ("caseSize " ^ Int.toString sz)
86    
87    fun expand(I.ANNOTATION{i,...}, size, pos) = expand(i,size,pos)    fun expand(I.ANNOTATION{i,...}, size, pos) = expand(i,size,pos)
88      | expand(I.LIVE _, _, _) = []      | expand(I.LIVE _, _, _) = []
89      | expand(I.KILL _, _, _) = []      | expand(I.KILL _, _, _) = []
# Line 89  Line 93 
93         Shuffle.shufflefp{src=src, dst=dst, tmp=tmp}         Shuffle.shufflefp{src=src, dst=dst, tmp=tmp}
94      | expand(I.INSTR instr, size, pos) = let      | expand(I.INSTR instr, size, pos) = let
95          fun load(ldClass, ldOp, r, b, d as I.LABop le, mem) =          fun load(ldClass, ldOp, r, b, d as I.LABop le, mem) =
96            (case size              caseSize size
97             of 4 => [ldClass{ldOp=ldOp, r=r, b=b, d=I.IMMop(Eval.valueOf le), mem=mem}]                  { four = fn () =>
98              | 12 => let                       [ldClass{ldOp=ldOp, r=r, b=b,
99                                  d=I.IMMop(Eval.valueOf le), mem=mem}],
100                      twelf = fn () => let
101                  val instrs = expand(I.lda{r=r, b=b, d=d}, 8, pos)                  val instrs = expand(I.lda{r=r, b=b, d=d}, 8, pos)
102                in instrs @ [ldClass{ldOp=ldOp, r=r, b=r, d=I.IMMop 0, mem=mem}]                    in instrs @ [ldClass{ldOp=ldOp, r=r, b=r,
103                end)                                         d=I.IMMop 0, mem=mem}]
104                      end }
105              | load _ = error "store"
106    
107          fun store(stClass, stOp, r, b, d as I.LABop le, mem) =          fun store(stClass, stOp, r, b, d as I.LABop le, mem) =
108            (case size              caseSize size
109             of 4 => [stClass{stOp=stOp, r=r, b=b, d=I.IMMop(Eval.valueOf le), mem=mem}]                  { four = fn () =>
110              | 12 => let                       [stClass{stOp=stOp, r=r, b=b,
111                                  d=I.IMMop(Eval.valueOf le), mem=mem}],
112                      twelf = fn () => let
113                  val instrs = expand(I.lda{r=C.asmTmpR, b=b, d=d}, 8, pos)                  val instrs = expand(I.lda{r=C.asmTmpR, b=b, d=d}, 8, pos)
114                in instrs @ [stClass{stOp=stOp, r=r, b=C.asmTmpR, d=I.IMMop 0, mem=mem}]                    in instrs @ [stClass{stOp=stOp, r=r, b=C.asmTmpR,
115                end)                                         d=I.IMMop 0, mem=mem}]
116                      end }
117              | store _ = error "store"
118    
119          fun operate(opClass, oper, ra, rb as I.LABop le, rc) =          fun operate(opClass, oper, ra, rb as I.LABop le, rc) =
120            (case size              caseSize size
121             of 4 => [opClass{oper=oper, ra=ra, rb=I.IMMop(Eval.valueOf le), rc=rc}]                  { four = fn () =>
122              | 12 => let                       [opClass{oper=oper, ra=ra,
123                                  rb=I.IMMop(Eval.valueOf le), rc=rc}],
124                      twelf = fn () => let
125                  val instrs = expand(I.lda{r=C.asmTmpR, b=zeroR, d=rb}, 8, pos)                  val instrs = expand(I.lda{r=C.asmTmpR, b=zeroR, d=rb}, 8, pos)
126                in instrs @ [opClass{oper=oper, ra=ra, rb=I.REGop C.asmTmpR, rc=rc}]                    in instrs @ [opClass{oper=oper, ra=ra,
127                end)                                         rb=I.REGop C.asmTmpR, rc=rc}]
128                      end }
129              | operate _ = error "operate"
130        in        in
131    
132          case instr          case instr
# Line 128  Line 144 
144          | I.OPERATE{oper, ra, rb, rc} => operate(I.operate, oper, ra, rb, rc)          | I.OPERATE{oper, ra, rb, rc} => operate(I.operate, oper, ra, rb, rc)
145          | I.OPERATEV{oper, ra, rb, rc} => operate(I.operatev, oper, ra, rb, rc)          | I.OPERATEV{oper, ra, rb, rc} => operate(I.operatev, oper, ra, rb, rc)
146          | I.CMOVE{oper, ra, rb, rc} =>          | I.CMOVE{oper, ra, rb, rc} =>
147            (case size              caseSize size
148             of 4 => [I.INSTR instr]                  { four = fn () => [I.INSTR instr],
149              | 12 =>                    twelf = fn () => let
150                let val instrs = expand(I.lda{r=C.asmTmpR, b=zeroR, d=rb}, 8, pos)                        val instrs = expand(I.lda{r=C.asmTmpR, b=zeroR, d=rb},
151                in  instrs @ [I.cmove{oper=oper, ra=ra, rb=I.REGop C.asmTmpR, rc=rc}]                                            8, pos)
152                end)                    in  instrs @ [I.cmove{oper=oper, ra=ra,
153                                            rb=I.REGop C.asmTmpR, rc=rc}]
154                      end }
155          | _ => error "expand"          | _ => error "expand"
156        end        end
157      | expand _ = error "expand"      | expand _ = error "expand"

Legend:
Removed from v.1333  
changed lines
  Added in v.1334

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