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

Diff of /sml/trunk/src/MLRISC/hppa/emit/hppaMC.sml

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

revision 983, Wed Nov 21 18:44:55 2001 UTC revision 984, Wed Nov 21 19:00:08 2001 UTC
# Line 6  Line 6 
6    
7    
8  functor HppaMCEmitter(structure Instr : HPPAINSTR  functor HppaMCEmitter(structure Instr : HPPAINSTR
9                          structure MLTreeEval : MLTREE_EVAL where T = Instr.T
10                          structure Stream : INSTRUCTION_STREAM
11                        structure CodeString : CODE_STRING                        structure CodeString : CODE_STRING
12                       ) : INSTRUCTION_EMITTER =                       ) : INSTRUCTION_EMITTER =
13  struct  struct
14     structure I = Instr     structure I = Instr
15     structure C = I.C     structure C = I.C
    structure LabelExp = I.LabelExp  
16     structure Constant = I.Constant     structure Constant = I.Constant
17     structure T = I.T     structure T = I.T
18     structure S = T.Stream     structure S = Stream
19     structure P = S.P     structure P = S.P
20     structure W = Word32     structure W = Word32
21    
# Line 34  Line 35 
35         val emit_int = itow         val emit_int = itow
36         fun emit_word w = w         fun emit_word w = w
37         fun emit_label l = itow(Label.addrOf l)         fun emit_label l = itow(Label.addrOf l)
38         fun emit_labexp le = itow(LabelExp.valueOf le)         fun emit_labexp le = itow(MLTreeEval.valueOf le)
39         fun emit_const c = itow(Constant.valueOf c)         fun emit_const c = itow(Constant.valueOf c)
40         val loc = ref 0         val loc = ref 0
41    
# Line 411  Line 412 
412             fun lo11 n = (itow n) && 0wx7ff             fun lo11 n = (itow n) && 0wx7ff
413         in         in
414            (case opnd of            (case opnd of
415              I.HILabExp(lexp, _) => hi21X (LabelExp.valueOf lexp)              I.HILabExp(lexp, _) => hi21X (MLTreeEval.valueOf lexp)
416            | I.LOLabExp(lexp, _) => lo11 (LabelExp.valueOf lexp)            | I.LOLabExp(lexp, _) => lo11 (MLTreeEval.valueOf lexp)
417            | I.LabExp(lexp, _) => itow (LabelExp.valueOf lexp)            | I.LabExp(lexp, _) => itow (MLTreeEval.valueOf lexp)
418            | I.IMMED i => itow i            | I.IMMED i => itow i
419            | I.REG _ => error "REG"            | I.REG _ => error "REG"
420            )            )
# Line 589  Line 590 
590                    T.LI (IntInf.fromInt 4)))                    T.LI (IntInf.fromInt 4)))
591         in Label.setAddr (tmpLab, ( ! loc) + 4);         in Label.setAddr (tmpLab, ( ! loc) + 4);
592            branchLink (0wx3a, tmp, tmpLab, 0wx0, n);            branchLink (0wx3a, tmp, tmpLab, 0wx0, n);
593            LongImmed {Op=0wxa, r=tmp, im21=assemble_21 (itow (LabelExp.valueOf offset))};            LongImmed {Op=0wxa, r=tmp, im21=assemble_21 (itow (MLTreeEval.valueOf offset))};
594            BranchVectored {Op=0wx3a, t=tmp, x=zeroR, ext3=0wx6, n=n}            BranchVectored {Op=0wx3a, t=tmp, x=zeroR, ext3=0wx6, n=n}
595         end         end
596       | emitInstr (I.BE{b, d, sr, n, labs}) =       | emitInstr (I.BE{b, d, sr, n, labs}) =

Legend:
Removed from v.983  
changed lines
  Added in v.984

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