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/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 1002, Fri Nov 30 17:11:33 2001 UTC revision 1003, Fri Dec 7 02:45:32 2001 UTC
# Line 20  Line 20 
20    
21    val branchDelayedArch = false    val branchDelayedArch = false
22    
23    fun isSdi(I.DEFFREG _)                  = true    fun isSdi(I.ANNOTATION{i,...}) = isSdi i
24      | isSdi(I.LDA{d=I.LABop _, ...})      = true      | isSdi(I.LIVE _)            = true
25      | isSdi(I.LOAD{d=I.LABop _, ...})     = true      | isSdi(I.KILL _)            = true
26      | isSdi(I.STORE{d=I.LABop _, ...})    = true      | isSdi(I.INSTR i) =
27      | isSdi(I.FSTORE{d=I.LABop _, ...})   = true        (case i
28      | isSdi(I.FLOAD{d=I.LABop _, ...})    = true          of (I.LDA{d=I.LABop _, ...})      => true
29      | isSdi(I.OPERATE{rb=I.LABop _, ...}) = true           | (I.LOAD{d=I.LABop _, ...})     => true
30      | isSdi(I.OPERATEV{rb=I.LABop _, ...})= true           | (I.STORE{d=I.LABop _, ...})    => true
31      | isSdi(I.CMOVE{rb=I.LABop _, ...}) = true           | (I.FSTORE{d=I.LABop _, ...})   => true
32      | isSdi(I.COPY _)                     = true           | (I.FLOAD{d=I.LABop _, ...})    => true
33      | isSdi(I.FCOPY _)                    = true           | (I.OPERATE{rb=I.LABop _, ...}) => true
34      | isSdi(I.ANNOTATION{i,...})          = isSdi i           | (I.OPERATEV{rb=I.LABop _, ...})=> true
35      | isSdi _                             = false           | (I.CMOVE{rb=I.LABop _, ...})   => true
36             | (I.COPY _)                  => true
37    fun minSize(I.DEFFREG _) = 0           | (I.FCOPY _)                 => true
38      | minSize(I.COPY _)    = 0           |  _ => false
39      | minSize(I.FCOPY _)   = 0        (*esac*))
40        | isSdi _ = error "isSdi"
41    
42      fun minSize(I.INSTR(I.COPY _))    = 0
43        | minSize(I.INSTR(I.FCOPY _))   = 0
44        | minSize(I.LIVE _)             = 0
45        | minSize(I.KILL _)             = 0
46      | minSize(I.ANNOTATION{i,...}) = minSize i      | minSize(I.ANNOTATION{i,...}) = minSize i
47      | minSize _            = 4      | minSize _            = 4
48    
# Line 49  Line 55 
55    
56    fun immed8 n = n >= 0 andalso n < 256    fun immed8 n = n >= 0 andalso n < 256
57    fun im8Oper le = if immed8 (Eval.valueOf le) then 4 else 12    fun im8Oper le = if immed8 (Eval.valueOf le) then 4 else 12
58      fun sdiSize(I.ANNOTATION{i,...},x,y) = sdiSize(i,x,y)
59    fun sdiSize(I.DEFFREG _, _, _) = 0      | sdiSize(I.LIVE _, _, _) = 0
60      | sdiSize(I.LDA{d=I.LABop le, ...}, _, _) = im16load(Eval.valueOf le)      | sdiSize(I.KILL _, _, _) = 0
61      | sdiSize(I.LOAD{d=I.LABop le, ...}, _, _) = im16Oper le      | sdiSize(I.INSTR instr, _, _) =
62      | sdiSize(I.STORE{d=I.LABop le, ...}, _, _) = im16Oper le        (case instr
63      | sdiSize(I.FLOAD{d=I.LABop le, ...}, _, _) = im16Oper le          of (I.LDA{d=I.LABop le, ...}) => im16load(Eval.valueOf le)
64      | sdiSize(I.FSTORE{d=I.LABop le, ...}, _, _) = im16Oper le          | (I.LOAD{d=I.LABop le, ...}) => im16Oper le
65      | sdiSize(I.OPERATE{rb=I.LABop le, ...}, _, _) = im8Oper le          | (I.STORE{d=I.LABop le, ...}) => im16Oper le
66      | sdiSize(I.OPERATEV{rb=I.LABop le, ...}, _, _) = im8Oper le          | (I.FLOAD{d=I.LABop le, ...}) => im16Oper le
67      | sdiSize(I.CMOVE{rb=I.LABop le, ...}, _, _) = im8Oper le          | (I.FSTORE{d=I.LABop le, ...}) => im16Oper le
68      | sdiSize(I.COPY{impl=ref(SOME l),...}, _, _) = 4 * length l          | (I.OPERATE{rb=I.LABop le, ...}) => im8Oper le
69      | sdiSize(I.FCOPY{impl=ref(SOME l),...}, _, _) = 4 * length l          | (I.OPERATEV{rb=I.LABop le, ...}) => im8Oper le
70      | sdiSize(I.COPY{dst, src, impl as ref NONE, tmp}, _, _) = let          | (I.CMOVE{rb=I.LABop le, ...}) => im8Oper le
71            | (I.COPY{impl=ref(SOME l),...}) => 4 * length l
72            | (I.FCOPY{impl=ref(SOME l),...}) => 4 * length l
73            | (I.COPY{dst, src, impl as ref NONE, tmp}) => let
74          val instrs = Shuffle.shuffle{tmp=tmp, dst=dst, src=src}          val instrs = Shuffle.shuffle{tmp=tmp, dst=dst, src=src}
75        in  impl := SOME instrs;  4 * length instrs        in  impl := SOME instrs;  4 * length instrs
76        end        end
77      | sdiSize(I.FCOPY{dst, src, impl as ref NONE, tmp}, _, _) = let          | (I.FCOPY{dst, src, impl as ref NONE, tmp}) => let
78          val instrs = Shuffle.shufflefp{tmp=tmp, dst=dst, src=src}          val instrs = Shuffle.shufflefp{tmp=tmp, dst=dst, src=src}
79        in impl := SOME(instrs); 4 * length instrs        in impl := SOME(instrs); 4 * length instrs
80        end        end
81      | sdiSize(I.ANNOTATION{i,...},x,y) = sdiSize(i,x,y)          |  _ => error "sdiSize"
82           (*easc*))
83      | sdiSize _ = error "sdiSize"      | sdiSize _ = error "sdiSize"
84    
85   (* NOTE: All sdis must use a dedicated physical register as a   (* NOTE: All sdis must use a dedicated physical register as a
# Line 78  Line 88 
88    *)    *)
89    val zeroR = Option.valOf(C.zeroReg CellsBasis.GP)    val zeroR = Option.valOf(C.zeroReg CellsBasis.GP)
90    
91    fun expand(instr, size, pos) = let    fun expand(I.ANNOTATION{i,...}, size, pos) = expand(i,size,pos)
92        | expand(I.LIVE _, _, _) = []
93        | expand(I.KILL _, _, _) = []
94        | 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        (case size
97         of 4 => [ldClass{ldOp=ldOp, r=r, b=b, d=I.IMMop(Eval.valueOf le), mem=mem}]         of 4 => [ldClass{ldOp=ldOp, r=r, b=b, d=I.IMMop(Eval.valueOf le), mem=mem}]
98          | 12 => let          | 12 => let
99              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)
100            in instrs @ [ldClass{ldOp=ldOp, r=r, b=r, d=I.IMMop 0, mem=mem}]            in instrs @ [ldClass{ldOp=ldOp, r=r, b=r, d=I.IMMop 0, mem=mem}]
101            end)            end)
102    
# Line 91  Line 104 
104        (case size        (case size
105         of 4 => [stClass{stOp=stOp, r=r, b=b, d=I.IMMop(Eval.valueOf le), mem=mem}]         of 4 => [stClass{stOp=stOp, r=r, b=b, d=I.IMMop(Eval.valueOf le), mem=mem}]
106          | 12 => let          | 12 => let
107              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)
108            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, d=I.IMMop 0, mem=mem}]
109            end)            end)
110    
# Line 99  Line 112 
112        (case size        (case size
113         of 4 => [opClass{oper=oper, ra=ra, rb=I.IMMop(Eval.valueOf le), rc=rc}]         of 4 => [opClass{oper=oper, ra=ra, rb=I.IMMop(Eval.valueOf le), rc=rc}]
114          | 12 => let          | 12 => let
115              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)
116            in instrs @ [opClass{oper=oper, ra=ra, rb=I.REGop C.asmTmpR, rc=rc}]            in instrs @ [opClass{oper=oper, ra=ra, rb=I.REGop C.asmTmpR, rc=rc}]
117            end)            end)
118    in    in
119    
120      case instr      case instr
121      of I.DEFFREG _ => []          of I.LDA{r=rd, b=rs, d=I.LABop le} =>
      | I.LDA{r=rd, b=rs, d=I.LABop le} =>  
122         (case size of         (case size of
123            4  => [I.LDA{r=rd, b=rs, d=I.LOLABop le}]                4  => [I.lda{r=rd, b=rs, d=I.LOLABop le}]
124          | 8  => [I.LDA{r=rd, b=rs, d=I.LOLABop le},              | 8  => [I.lda{r=rd, b=rs, d=I.LOLABop le},
125                   I.LDAH{r=rd, b=rd, d=I.HILABop le}]                       I.ldah{r=rd, b=rd, d=I.HILABop le}]
126          | _  => error "expand:LDA"          | _  => error "expand:LDA"
127         )         )
128      | I.COPY{impl=ref(SOME instrs),...} => instrs      | I.COPY{impl=ref(SOME instrs),...} => instrs
129      | I.FCOPY{impl=ref(SOME instrs),...} => instrs      | I.FCOPY{impl=ref(SOME instrs),...} => instrs
130      | I.LOAD{ldOp, r, b, d, mem} => load(I.LOAD, ldOp, r, b, d, mem)          | I.LOAD{ldOp, r, b, d, mem} => load(I.load, ldOp, r, b, d, mem)
131      | I.FLOAD{ldOp, r, b, d, mem} => load(I.FLOAD, ldOp, r, b, d, mem)          | I.FLOAD{ldOp, r, b, d, mem} => load(I.fload, ldOp, r, b, d, mem)
132      | I.STORE{stOp, r, b, d, mem} => store(I.STORE, stOp, r, b, d, mem)          | I.STORE{stOp, r, b, d, mem} => store(I.store, stOp, r, b, d, mem)
133      | I.FSTORE{stOp, r, b, d, mem} => store(I.FSTORE, stOp, r, b, d, mem)          | I.FSTORE{stOp, r, b, d, mem} => store(I.fstore, stOp, r, b, d, mem)
134      | 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)
135      | 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)
136      | I.CMOVE{oper, ra, rb, rc} =>      | I.CMOVE{oper, ra, rb, rc} =>
137        (case size        (case size
138         of 4 => [instr]             of 4 => [I.INSTR instr]
139          | 12 =>          | 12 =>
140            let val instrs = expand(I.LDA{r=C.asmTmpR, b=zeroR, d=rb}, 8, pos)                let val instrs = expand(I.lda{r=C.asmTmpR, b=zeroR, d=rb}, 8, pos)
141            in  instrs @ [I.CMOVE{oper=oper, ra=ra, rb=I.REGop C.asmTmpR, rc=rc}]                in  instrs @ [I.cmove{oper=oper, ra=ra, rb=I.REGop C.asmTmpR, rc=rc}]
142            end)            end)
     | I.ANNOTATION{i,...} => expand(i,size,pos)  
143      | _ => error "expand"      | _ => error "expand"
144    end    end
145        | expand _ = error "expand"
146  end  end
147    
148    

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