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/instructions/hppaProps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/hppa/instructions/hppaProps.sml

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

revision 1008, Fri Dec 14 21:01:29 2001 UTC revision 1009, Wed Jan 9 19:44:22 2002 UTC
# Line 30  Line 30 
30      *========================================================================*)      *========================================================================*)
31    (* Note: BLE and BL used to implement calls are not view as branches *)    (* Note: BLE and BL used to implement calls are not view as branches *)
32    fun instrKind(I.ANNOTATION{i, ...}) = instrKind i    fun instrKind(I.ANNOTATION{i, ...}) = instrKind i
33        | instrKind(I.COPY _) = IK_COPY
34      | instrKind(I.INSTR instr) =      | instrKind(I.INSTR instr) =
35        (case instr        (case instr
36          of (I.BCOND _) => IK_JUMP          of (I.BCOND _) => IK_JUMP
# Line 41  Line 42 
42           | (I.BV _)     => IK_JUMP           | (I.BV _)     => IK_JUMP
43           | (I.BLR _)    => IK_JUMP           | (I.BLR _)    => IK_JUMP
44           | (I.NOP)      => IK_NOP           | (I.NOP)      => IK_NOP
          | (I.COPY _)   => IK_COPY  
          | (I.FCOPY _)  => IK_COPY  
45           | (I.BL{cutsTo=_::_,...}) => IK_CALL_WITH_CUTS           | (I.BL{cutsTo=_::_,...}) => IK_CALL_WITH_CUTS
46           | (I.BL  _)    => IK_CALL           | (I.BL  _)    => IK_CALL
47           | (I.BLE{cutsTo=_::_,...}) => IK_CALL_WITH_CUTS           | (I.BLE{cutsTo=_::_,...}) => IK_CALL_WITH_CUTS
# Line 53  Line 52 
52           |  _          => IK_INSTR)           |  _          => IK_INSTR)
53      | instrKind _ = error "instrKind"      | instrKind _ = error "instrKind"
54    
55    fun moveInstr(I.INSTR(I.COPY _))   = true    fun moveInstr(I.COPY _)            = true
     | moveInstr(I.INSTR(I.FCOPY _))  = true  
     | moveInstr(I.LIVE _)            = false  
     | moveInstr(I.KILL _)            = false  
56      | moveInstr(I.ANNOTATION{i,...}) = moveInstr i      | moveInstr(I.ANNOTATION{i,...}) = moveInstr i
57      | moveInstr _ = false      | moveInstr _ = false
58    
# Line 65  Line 61 
61     (*========================================================================     (*========================================================================
62      *  Parallel Move      *  Parallel Move
63      *========================================================================*)      *========================================================================*)
64    fun moveTmpR(I.INSTR(I.COPY{tmp=SOME(I.Direct r), ...})) = SOME r    fun moveTmpR(I.COPY{tmp, ...}) =
65      | moveTmpR(I.INSTR(I.FCOPY{tmp=SOME(I.FDirect f), ...})) = SOME f        (case tmp
66            of SOME(I.Direct r) => SOME r
67             | SOME(I.FDirect f) => SOME f
68             | _ => NONE
69          (*esac*))
70      | moveTmpR(I.ANNOTATION{i,...}) = moveTmpR i      | moveTmpR(I.ANNOTATION{i,...}) = moveTmpR i
71      | moveTmpR _ = NONE      | moveTmpR _ = NONE
72    
73    fun moveDstSrc(I.INSTR(I.COPY{dst, src, ...})) = (dst, src)    fun moveDstSrc(I.COPY{dst, src, ...}) = (dst, src)
     | moveDstSrc(I.INSTR(I.FCOPY{dst, src, ...})) = (dst, src)  
74      | moveDstSrc(I.ANNOTATION{i,...}) = moveDstSrc i      | moveDstSrc(I.ANNOTATION{i,...}) = moveDstSrc i
75      | moveDstSrc _ = error "moveDstSrc"      | moveDstSrc _ = error "moveDstSrc"
76    
# Line 227  Line 226 
226                (r31 :: t :: C.getReg defs, b :: C.getReg uses)                (r31 :: t :: C.getReg defs, b :: C.getReg uses)
227          | I.LDIL{i, t}              => ([t], [])          | I.LDIL{i, t}              => ([t], [])
228          | I.LDO{b, t, ...}          => ([t], [b])          | I.LDO{b, t, ...}          => ([t], [b])
         | I.COPY{dst, src, tmp=SOME(I.Direct r), ...} => (r::dst, src)  
         | I.COPY{dst, src, ...}       => (dst, src)  
229          | I.MTCTL{r, t}             => ([],  [r])          | I.MTCTL{r, t}             => ([],  [r])
230          | I.FSTORE {b, ...}         => ([],  [b])          | I.FSTORE {b, ...}         => ([],  [b])
231          | I.FSTOREX {b, x, ...}             => ([],  [b,x])          | I.FSTOREX {b, x, ...}             => ([],  [b,x])
# Line 242  Line 239 
239          | I.LIVE{regs, ...} => ([], C.getReg regs)          | I.LIVE{regs, ...} => ([], C.getReg regs)
240          | I.KILL{regs, ...} => (C.getReg regs, [])          | I.KILL{regs, ...} => (C.getReg regs, [])
241          | I.INSTR(i) => hppaDU(i)          | I.INSTR(i) => hppaDU(i)
242          | _ => error "defUseR"          | I.COPY{k, dst, src, tmp, ...} => let
243                val (d,u) = case k of CB.GP => (dst, src) | _ => ([], [])
244              in
245                  case tmp
246                  of SOME(I.Direct r) => (r::d, u)
247                   | SOME(I.Displace{base, ...}) => (* (d, base::u) *) (d, u)
248                   | _ => (d,u)
249              end
250    end    end
251    
252    fun defUseF instr = let    fun defUseF instr = let
# Line 258  Line 262 
262           | I.FBRANCH{f1, f2,...}           => ([],  [f1, f2])           | I.FBRANCH{f1, f2,...}           => ([],  [f1, f2])
263           | I.BL{defs, uses, ...}     => (C.getFreg defs, C.getFreg uses)           | I.BL{defs, uses, ...}     => (C.getFreg defs, C.getFreg uses)
264           | I.BLE{defs, uses, ...}    => (C.getFreg defs, C.getFreg uses)           | I.BLE{defs, uses, ...}    => (C.getFreg defs, C.getFreg uses)
          | I.FCOPY{dst, src, tmp=SOME(I.FDirect f), ...} => (f::dst, src)  
          | I.FCOPY{dst, src, ...}    => (dst, src)  
265           | _ => ([],[])           | _ => ([],[])
266    in    in
267        case instr        case instr
# Line 267  Line 269 
269          | I.INSTR(i) => hppaDU(i)          | I.INSTR(i) => hppaDU(i)
270          | I.LIVE{regs, ...} => ([], C.getFreg regs)          | I.LIVE{regs, ...} => ([], C.getFreg regs)
271          | I.KILL{regs, ...} => (C.getFreg regs, [])          | I.KILL{regs, ...} => (C.getFreg regs, [])
272          | _ => error "defUseR"          | I.COPY{k, dst, src, tmp, ...} => let
273                val (d, u) = case k of CB.FP => (dst, src) | _ => ([],[])
274              in
275                 case tmp
276                  of SOME(I.FDirect f) => (f::d, u)
277                   | _ => (d, u)
278              end
279    end    end
280    
281    fun defUse CB.GP = defUseR    fun defUse CB.GP = defUseR
# Line 286  Line 294 
294     *  Replicate an instruction     *  Replicate an instruction
295     *========================================================================*)     *========================================================================*)
296    fun replicate(I.ANNOTATION{i,a}) = I.ANNOTATION{i=replicate i,a=a}    fun replicate(I.ANNOTATION{i,a}) = I.ANNOTATION{i=replicate i,a=a}
297      | replicate(I.INSTR(I.COPY{tmp=SOME _, dst, src, impl})) =      | replicate(I.COPY{k, sz, tmp=SOME _, dst, src}) =  let
298          I.copy{tmp=SOME(I.Direct(C.newReg())), dst=dst, src=src, impl=ref NONE}            val tmp = case k of CB.GP => C.newReg() | CB.FP => C.newFreg()
299      | replicate(I.INSTR(I.FCOPY{tmp=SOME _, dst, src, impl})) =        in
300          I.fcopy{tmp=SOME(I.FDirect(C.newFreg())),          I.COPY{k=k, sz=sz, tmp=SOME(I.Direct(tmp)), dst=dst, src=src}
301                  dst=dst, src=src, impl=ref NONE}        end
302      | replicate i = i      | replicate i = i
303  end  end
304    

Legend:
Removed from v.1008  
changed lines
  Added in v.1009

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