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

Diff of /sml/trunk/src/MLRISC/hppa/hppaAsm.sml

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

sml/branches/SMLNJ/src/MLRISC/hppa/hppaAsm.sml revision 127, Mon Sep 7 19:06:29 1998 UTC sml/trunk/src/MLRISC/hppa/hppaAsm.sml revision 168, Sat Nov 7 20:11:41 1998 UTC
# Line 6  Line 6 
6    
7  functor HppaAsmEmitter  functor HppaAsmEmitter
8    (structure Instr : HPPAINSTR    (structure Instr : HPPAINSTR
9     structure FlowGraph : FLOWGRAPH     structure PseudoOps : PSEUDO_OPS
10     structure Shuffle : HPPASHUFFLE     structure Shuffle : HPPASHUFFLE where I = Instr) : EMITTER_NEW =
        sharing FlowGraph.I = Shuffle.I = Instr) : EMITTER_NEW =  
11  struct  struct
12    structure I = Instr    structure I = Instr
13    structure C = I.C    structure C = I.C
14    structure F = FlowGraph    structure P = PseudoOps
15    structure LE = LabelExp    structure LE = LabelExp
16    structure Constant = I.Constant    structure Constant = I.Constant
17    structure Region = I.Region    structure Region = I.Region
# Line 27  Line 26 
26    
27    fun comment msg = emit ("\t/* " ^ msg ^ " */")    fun comment msg = emit ("\t/* " ^ msg ^ " */")
28    fun region r = comment(Region.toString r)    fun region r = comment(Region.toString r)
29    fun pseudoOp pOp = emit(F.P.toString pOp)    fun pseudoOp pOp = emit(P.toString pOp)
30    fun init size = (comment ("Code Size = " ^ ms size); emit"\n")    fun init size = (comment ("Code Size = " ^ ms size); emit"\n")
31    
32    fun emitInstr(instr,regmap) = let    fun emitInstr(instr,regmap) = let
# Line 208  Line 207 
207        | I.B{lab,n}                      => (emit "\tB"; nullify n;        | I.B{lab,n}                      => (emit "\tB"; nullify n;
208                                              emit "\t"; eLabel lab;                                              emit "\t"; eLabel lab;
209                                              emit "\n\tNOP" )                                              emit "\n\tNOP" )
210        | I.FBCC{t,n, ...}                => (emit "\tFBCC"; nullify n;        | I.FBRANCH{cc,f1,f2,t,n,...} =>
211                                              emit "\t"; eLabel t;            (emit ("\tFCMP," ^ fcond cc ^"\t"); eFreg f1; comma(); eFreg f2;
212                                              emit "\n\tNOP")             emit "\n\tFTEST\n";
213               emit "\tB"; nullify n; emit "\t"; eLabel t; emit "\n\tNOP")
214        | I.BLE{d, sr, b, t, ...} =>        | I.BLE{d, sr, b, t, ...} =>
215            (emit "\tBLE\t"; eOperand d;            (emit "\tBLE\t"; eOperand d;
216             paren(fn () => (emit(ms sr); comma(); eReg b));             paren(fn () => (emit(ms sr); comma(); eReg b));
# Line 224  Line 223 
223        | I.BV{x, b, n, ...} =>        | I.BV{x, b, n, ...} =>
224            (emit "\tBV"; nullify n; emit "\t"; eReg x; paren(fn () => eReg b);            (emit "\tBV"; nullify n; emit "\t"; eReg x; paren(fn () => eReg b);
225             emit "\n\tNOP" )             emit "\n\tNOP" )
226          | I.BLR{x, t, n, labs, ...} =>
227              (emit "\tBLR"; nullify n; emit "\t"; eReg x; comma(); eReg t;
228               emit "\n\tNOP\n";
229               app (fn l => (emit "\tB,n\t"; eLabel l; emit "\n\tNOP\n")) labs
230              )
231        | I.LDIL{i, t} => (emit "\tLDIL\t"; eOperand i; comma(); eReg t)        | I.LDIL{i, t} => (emit "\tLDIL\t"; eOperand i; comma(); eReg t)
232        | I.LDO{i,b,t} =>        | I.LDO{i,b,t} =>
233            (emit "\tLDO\t";  eOperand i; paren(fn () => eReg b);            (emit "\tLDO\t";  eOperand i; paren(fn () => eReg b);
# Line 247  Line 251 
251        | I.FUNARY{fu=I.FCPY, f, t} => funary("\tFCPY\t", f, t)        | I.FUNARY{fu=I.FCPY, f, t} => funary("\tFCPY\t", f, t)
252        | I.FUNARY{fu=I.FABS, f, t} => funary("\tFABS\t", f, t)        | I.FUNARY{fu=I.FABS, f, t} => funary("\tFABS\t", f, t)
253        | I.FUNARY{fu=I.FCNVXF, f, t} => funary("\tFCNVXF\t", f, t)        | I.FUNARY{fu=I.FCNVXF, f, t} => funary("\tFCNVXF\t", f, t)
       | I.FCMP(cc,f1,f2) =>  
           (emit ("\tFCMP," ^ fcond cc ^"\t"); eFreg f1; comma(); eFreg f2)  
       | I.FTEST => emit "\tFTEST"  
254        | I.BREAK(i, j) => emit ("\tBREAK(" ^ ms i ^ ", " ^ ms j ^ ")")        | I.BREAK(i, j) => emit ("\tBREAK(" ^ ms i ^ ", " ^ ms j ^ ")")
255        | I.NOP => emit "\tNOP"        | I.NOP => emit "\tNOP"
256        | I.COPY{dst, src, tmp, ...} =>        | I.COPY{dst, src, tmp, ...} =>
# Line 264  Line 265 
265  end  end
266    
267    
268    (*
269     * $Log: hppaAsm.sml,v $
270     * Revision 1.5  1998/09/30 19:35:22  dbm
271     * fixing sharing/defspec conflict
272     *
273     * Revision 1.4  1998/07/25 03:08:15  george
274     *   added to support block names in MLRISC
275     *
276     * Revision 1.3  1998/05/25 15:10:53  george
277     *   Fixed RCS keywords
278     *
279     *)

Legend:
Removed from v.127  
changed lines
  Added in v.168

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