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/branches/SMLNJ/src/MLRISC/hppa/hppaMC.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/MLRISC/hppa/hppaMC.sml

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

revision 166, Sat Nov 7 20:11:41 1998 UTC revision 167, Sat Nov 7 20:11:41 1998 UTC
# Line 7  Line 7 
7    
8  functor HppaMCEmitter  functor HppaMCEmitter
9    (structure Instr : HPPAINSTR    (structure Instr : HPPAINSTR
10     structure Assembler:EMITTER_NEW     structure Assembler : EMITTER_NEW where I = Instr
11     structure FlowGraph : FLOWGRAPH  (* sharing/definiton conflict at Instr.Cells.regmap ----
12         sharing Assembler.F = FlowGraph         sharing Assembler.F = FlowGraph
13         sharing FlowGraph.I = Assembler.I = Instr) : EMITTER_NEW =         sharing FlowGraph.I = Assembler.I = Instr *)
14      ) : EMITTER_NEW =
15  struct  struct
16    structure I = Instr    structure I = Instr
17    structure F = FlowGraph    structure P = Assembler.P
18    
19    val << = Word.<<    val << = Word.<<
20    val >> = Word.>>    val >> = Word.>>
# Line 42  Line 43 
43    fun emitWord w = (emitByte((w >> 0w8) & 0w255); emitByte(w & 0w255))    fun emitWord w = (emitByte((w >> 0w8) & 0w255); emitByte(w & 0w255))
44    
45    fun defineLabel  lab = ()    fun defineLabel  lab = ()
46    fun pseudoOp pOp = F.P.emitValue{pOp=pOp, loc= !loc, emit=emitbyte}    fun pseudoOp pOp = P.emitValue{pOp=pOp, loc= !loc, emit=emitbyte}
47    fun comment msg = ()    fun comment msg = ()
48    fun init n = (CodeString.init n; loc:=0)    fun init n = (CodeString.init n; loc:=0)
49    
# Line 300  Line 301 
301             emitWord((0w3 << 0w13) ++ 0w2))             emitWord((0w3 << 0w13) ++ 0w2))
302        | I.BLE _           => error "BLE: not implemented"        | I.BLE _           => error "BLE: not implemented"
303        | I.B{lab, n, ...}  => branchLink(0wx3a, 0, lab, 0w0, nullify n)        | I.B{lab, n, ...}  => branchLink(0wx3a, 0, lab, 0w0, nullify n)
       | I.FBCC _          => error "FBCC"  
304        | I.BV{b, x, n,...} => branchVectored(0wx3a, b, x, 0w6, nullify n)        | I.BV{b, x, n,...} => branchVectored(0wx3a, b, x, 0w6, nullify n)
305          | I.BLR{x, t, n,...} => branchVectored(0wx3a, t, x, 0w2, nullify n)
306        | I.MTCTL{r, t}     => control(0w0, t, rNum r, 0w0, 0wxc2, 0w0)        | I.MTCTL{r, t}     => control(0w0, t, rNum r, 0w0, 0wxc2, 0w0)
307        | I.FSTORE{fst, b, d, r, ...} =>        | I.FSTORE{fst, b, d, r, ...} =>
308           (case fst           (case fst
# Line 340  Line 341 
341              | I.FABS   => floatOpMaj0C(fNum f, 0w0, 0w3, 0w1, 0w0, 0w0, fNum t)              | I.FABS   => floatOpMaj0C(fNum f, 0w0, 0w3, 0w1, 0w0, 0w0, fNum t)
342              | I.FCNVXF => floatOpMaj0E(fNum f, 0w0, 0w5, 0w0, 0w1, 0w4, fNum t)              | I.FCNVXF => floatOpMaj0E(fNum f, 0w0, 0w5, 0w0, 0w1, 0w4, fNum t)
343           (*esac*))           (*esac*))
344        | I.FCMP(cc, f1, f2) =>        | I.FBRANCH{cc,f1,f2,n,t,f,long} =>
345              floatOpMaj0C(fNum f1, fNum f2, 0w0, 0w1, 0w2, 0w0, fcond cc)          ( (* FCMP *)
346        | I.FTEST =>           floatOpMaj0C(fNum f1, fNum f2, 0w0, 0w1, 0w2, 0w0, fcond cc);
347           (emitWord(0wxc << 0w10);             (* FTEST *)
348            emitWord((0w1 << 0w13) ++ (0w2 << 0w9) ++ (0w1 << 0w5)))           emitWord(0wxc << 0w10);
349             emitWord((0w1 << 0w13) ++ (0w2 << 0w9) ++ (0w1 << 0w5));
350               (* B,n t *)
351             branchLink(0wx3a, 0, t, 0w0, nullify n)
352            )
353        | I.BREAK(i, j) =>        | I.BREAK(i, j) =>
354           (emitWord((itow i & 0wx1fff) >> 0w3);           (emitWord((itow i & 0wx1fff) >> 0w3);
355            emitWord(((itow i & 0wx7) << 0w13) & (itow j & 0wx1f)))            emitWord(((itow i & 0wx7) << 0w13) & (itow j & 0wx1f)))
# Line 358  Line 363 
363   *)   *)
364    
365  (*  (*
366   * $Log$   * $Log: hppaMC.sml,v $
367     * Revision 1.4  1998/09/30 19:35:40  dbm
368     * fixing sharing/defspec conflict
369     *
370     * Revision 1.3  1998/05/25 15:10:57  george
371     *   Fixed RCS keywords
372     *
373   *)   *)

Legend:
Removed from v.166  
changed lines
  Added in v.167

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