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

Diff of /sml/trunk/src/MLRISC/ppc/emit/ppcMC.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 PPCMCEmitter(structure Instr : PPCINSTR  functor PPCMCEmitter(structure Instr : PPCINSTR
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 80  Line 81 
81     and emit_CELLSET r = itow (CellsBasis.physicalRegisterNum r)     and emit_CELLSET r = itow (CellsBasis.physicalRegisterNum r)
82     fun emit_operand (I.RegOp GP) = emit_GP GP     fun emit_operand (I.RegOp GP) = emit_GP GP
83       | emit_operand (I.ImmedOp int) = itow int       | emit_operand (I.ImmedOp int) = itow int
84       | emit_operand (I.LabelOp labexp) = itow (LabelExp.valueOf labexp)       | emit_operand (I.LabelOp labexp) = itow (MLTreeEval.valueOf labexp)
85     and emit_fcmp (I.FCMPO) = (0wx20 : Word32.word)     and emit_fcmp (I.FCMPO) = (0wx20 : Word32.word)
86       | emit_fcmp (I.FCMPU) = (0wx0 : Word32.word)       | emit_fcmp (I.FCMPU) = (0wx0 : Word32.word)
87     and emit_unary (I.NEG) = (0wx68 : Word32.word)     and emit_unary (I.NEG) = (0wx68 : Word32.word)
# Line 680  Line 681 
681         end         end
682    
683  (*#line 540.7 "ppc/ppc.mdl"*)  (*#line 540.7 "ppc/ppc.mdl"*)
684     fun relative (I.LabelOp lexp) = (itow ((LabelExp.valueOf lexp) - ( ! loc))) ~>> 0wx2     fun relative (I.LabelOp lexp) = (itow ((MLTreeEval.valueOf lexp) - ( ! loc))) ~>> 0wx2
685       | relative _ = error "relative"       | relative _ = error "relative"
686         fun emitter instr =         fun emitter instr =
687         let         let

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