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

Diff of /sml/trunk/src/MLRISC/x86/emit/x86MC.sml

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

revision 582, Thu Mar 23 01:04:32 2000 UTC revision 583, Thu Mar 23 21:52:30 2000 UTC
# Line 56  Line 56 
56    
57         fun emitter regmap =         fun emitter regmap =
58         let         let
59       fun eWord8 w = let
60              val b8 = w
61           in eByteW b8
62           end
63    
64       and eWord32 w = let
65              val b8 = w
66              val w = w >> 0wx8
67              val b16 = w
68              val w = w >> 0wx8
69              val b24 = w
70              val w = w >> 0wx8
71              val b32 = w
72           in
73              ( eByteW b8;
74              eByteW b16;
75              eByteW b24;
76              eByteW b32 )
77           end
78    
79     fun emit_GP r = itow (regmap r)     fun emit_GP r = itow (regmap r)
80     and emit_FP r = itow ((regmap r) - 32)     and emit_FP r = itow ((regmap r) - 32)
81     and emit_CC r = itow ((regmap r) - 64)     and emit_CC r = itow ((regmap r) - 64)
82     and emit_MEM r = itow ((regmap r) - 64)     and emit_MEM r = itow ((regmap r) - 64)
83     and emit_CTRL r = itow ((regmap r) - 64)     and emit_CTRL r = itow ((regmap r) - 64)
84       fun modrm {mod, reg, rm} = eWord8 ((op mod << 0wx6) + ((reg << 0wx3) + rm))
85       and sib {ss, index, base} = eWord8 ((ss << 0wx6) + ((index << 0wx3) + base))
86       and immed8 {imm} = eWord8 imm
87       and immed32 {imm} = eWord32 imm
88     fun emitInstr (I.NOP) = error "NOP"     fun emitInstr (I.NOP) = error "NOP"
89       | emitInstr (I.JMP(operand, label)) = error "JMP"       | emitInstr (I.JMP(operand, label)) = error "JMP"
90       | emitInstr (I.JCC{cond, opnd}) = error "JCC"       | emitInstr (I.JCC{cond, opnd}) = error "JCC"
# Line 90  Line 114 
114       | emitInstr (I.COPY{dst, src, tmp}) = error "COPY"       | emitInstr (I.COPY{dst, src, tmp}) = error "COPY"
115       | emitInstr (I.FCOPY{dst, src, tmp}) = error "FCOPY"       | emitInstr (I.FCOPY{dst, src, tmp}) = error "FCOPY"
116       | emitInstr (I.FBINARY{binOp, src, dst}) = error "FBINARY"       | emitInstr (I.FBINARY{binOp, src, dst}) = error "FBINARY"
117         | emitInstr (I.FIBINARY{binOp, src}) = error "FIBINARY"
118       | emitInstr (I.FUNARY funOp) = error "FUNARY"       | emitInstr (I.FUNARY funOp) = error "FUNARY"
119       | emitInstr (I.FUCOMPP) = error "FUCOMPP"       | emitInstr (I.FUCOMPP) = error "FUCOMPP"
      | emitInstr (I.FCOM) = error "FCOM"  
120       | emitInstr (I.FCOMPP) = error "FCOMPP"       | emitInstr (I.FCOMPP) = error "FCOMPP"
121       | emitInstr (I.FXCH{opnd}) = error "FXCH"       | emitInstr (I.FXCH{opnd}) = error "FXCH"
122       | emitInstr (I.FSTPL operand) = error "FSTPL"       | emitInstr (I.FSTPL operand) = error "FSTPL"
123       | emitInstr (I.FSTPS operand) = error "FSTPS"       | emitInstr (I.FSTPS operand) = error "FSTPS"
124       | emitInstr (I.FSTPT operand) = error "FSTPT"       | emitInstr (I.FSTPT operand) = error "FSTPT"
125         | emitInstr (I.FSTL operand) = error "FSTL"
126         | emitInstr (I.FSTS operand) = error "FSTS"
127         | emitInstr (I.FLD1) = error "FLD1"
128         | emitInstr (I.FLDL2E) = error "FLDL2E"
129         | emitInstr (I.FLDL2T) = error "FLDL2T"
130         | emitInstr (I.FLDLG2) = error "FLDLG2"
131         | emitInstr (I.FLDLN2) = error "FLDLN2"
132         | emitInstr (I.FLDPI) = error "FLDPI"
133         | emitInstr (I.FLDZ) = error "FLDZ"
134       | emitInstr (I.FLDL operand) = error "FLDL"       | emitInstr (I.FLDL operand) = error "FLDL"
135       | emitInstr (I.FLDS operand) = error "FLDS"       | emitInstr (I.FLDS operand) = error "FLDS"
136       | emitInstr (I.FLDT operand) = error "FLDT"       | emitInstr (I.FLDT operand) = error "FLDT"
137       | emitInstr (I.FILD operand) = error "FILD"       | emitInstr (I.FILD operand) = error "FILD"
138         | emitInstr (I.FILDL operand) = error "FILDL"
139         | emitInstr (I.FILDLL operand) = error "FILDLL"
140       | emitInstr (I.FNSTSW) = error "FNSTSW"       | emitInstr (I.FNSTSW) = error "FNSTSW"
141       | emitInstr (I.FENV{fenvOp, opnd}) = error "FENV"       | emitInstr (I.FENV{fenvOp, opnd}) = error "FENV"
142       | emitInstr (I.SAHF) = error "SAHF"       | emitInstr (I.SAHF) = error "SAHF"

Legend:
Removed from v.582  
changed lines
  Added in v.583

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