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

sml/trunk/src/MLRISC/hppa/hppaMC.sml revision 16, Wed Mar 11 21:00:04 1998 UTC sml/branches/SMLNJ/src/MLRISC/hppa/hppaMC.sml 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 187  Line 188 
188        (emitWord((opcode << 0w10) ++ (itow b << 0w5) ++ r);        (emitWord((opcode << 0w10) ++ (itow b << 0w5) ++ r);
189         emitWord((rv << 0w13) ++ (ext8 << 0w5) ++ t))         emitWord((rv << 0w13) ++ (ext8 << 0w5) ++ t))
190    
191      fun fcond I.LT = 0w9      fun fcond I.?    = 0w2
192        | fcond I.LE = 0w13        | fcond I.!<=> = 0w3
193        | fcond I.EQ = 0w4        | fcond I.==   = 0w4
194        | fcond I.NE = 0w26        | fcond I.?=   = 0w6
195        | fcond I.GE = 0w21        | fcond I.!<>  = 0w7
196        | fcond I.GT = 0w17        | fcond I.!?>= = 0w8
       | fcond _ = error ""  
   
     fun fcond I.==   = 0w4  
       | fcond I.!=   = 0w26  
       | fcond I.?    = 0w2  
       | fcond I.<=>  = 0w29  
       | fcond I.>    = 0w17  
       | fcond I.>=   = 0w21  
       | fcond I.?>   = 0w18  
       | fcond I.?>=  = 0w22  
197        | fcond I.<    = 0w9        | fcond I.<    = 0w9
       | fcond I.<=   = 0w13  
198        | fcond I.?<   = 0w10        | fcond I.?<   = 0w10
199          | fcond I.!>=  = 0w11
200          | fcond I.!?>  = 0w12
201          | fcond I.<=   = 0w13
202        | fcond I.?<=  = 0w14        | fcond I.?<=  = 0w14
203          | fcond I.!>   = 0w15
204          | fcond I.!?<= = 0w16
205          | fcond I.>    = 0w17
206          | fcond I.?>   = 0w18
207          | fcond I.!<=  = 0w19
208          | fcond I.!?<  = 0w20
209          | fcond I.>=   = 0w21
210          | fcond I.?>=  = 0w22
211          | fcond I.!<   = 0w23
212          | fcond I.!?=  = 0w24
213        | fcond I.<>   = 0w25        | fcond I.<>   = 0w25
214        | fcond I.?=   = 0w6        | fcond I.!=   = 0w26
215          | fcond I.!?   = 0w28
216          | fcond I.<=>  = 0w29
217    
218      fun cmpCond I.EQ  = (0w1, 0w0)      fun cmpCond I.EQ  = (0w1, 0w0)
219        | cmpCond I.LT  = (0w2, 0w0)        | cmpCond I.LT  = (0w2, 0w0)
# Line 296  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 336  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 355  Line 364 
364    
365  (*  (*
366   * $Log: hppaMC.sml,v $   * $Log: hppaMC.sml,v $
367   * Revision 1.6  1998/02/17 02:51:15  george   * Revision 1.4  1998/09/30 19:35:40  dbm
368   *   Added the nullify bit to all branch instructions -- leunga   * fixing sharing/defspec conflict
  *  
  * Revision 1.5  1998/02/15 19:39:33  jhr  
  *   Deleted unused references to System.Tags.  
369   *   *
370   * Revision 1.4  1997/09/29 20:58:35  george   * Revision 1.3  1998/05/25 15:10:57  george
371   *   Propagate region information through instruction set   *   Fixed RCS keywords
372   *   *
 # Revision 1.3  1997/07/17  12:27:48  george  
 #   The regmap is now represented as an int map rather than using arrays.  
 #  
 # Revision 1.2  1997/04/19  18:39:11  george  
 # Version 109.27  
 #  
 # Revision 1.1.1.1  1997/04/19  18:14:23  george  
 #   Version 109.27  
 #  
373   *)   *)

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

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