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 /MLRISC/trunk/amd64/emit/amd64Asm.sml
ViewVC logotype

Diff of /MLRISC/trunk/amd64/emit/amd64Asm.sml

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

revision 2946, Sat Feb 16 00:14:43 2008 UTC revision 2947, Sat Feb 16 00:17:56 2008 UTC
# Line 223  Line 223 
223       | asm_move (I.MOVSBL) = "movsbl"       | asm_move (I.MOVSBL) = "movsbl"
224       | asm_move (I.MOVZBL) = "movzbl"       | asm_move (I.MOVZBL) = "movzbl"
225       | asm_move (I.MOVSLQ) = "movslq"       | asm_move (I.MOVSLQ) = "movslq"
226         | asm_move (I.CVTSD2SI) = "cvtsd2si"
227         | asm_move (I.CVTSS2SI) = "cvtss2si"
228         | asm_move (I.CVTSD2SIQ) = "cvtsd2siq"
229         | asm_move (I.CVTSS2SIQ) = "cvtss2siq"
230     and emit_move x = emit (asm_move x)     and emit_move x = emit (asm_move x)
231     and asm_fbin_op (I.ADDSS) = "addss"     and asm_fbin_op (I.ADDSS) = "addss"
232       | asm_fbin_op (I.ADDSD) = "addsd"       | asm_fbin_op (I.ADDSD) = "addsd"
# Line 248  Line 252 
252       | asm_fmove_op (I.MOVSD) = "movsd"       | asm_fmove_op (I.MOVSD) = "movsd"
253       | asm_fmove_op (I.CVTSS2SD) = "cvtss2sd"       | asm_fmove_op (I.CVTSS2SD) = "cvtss2sd"
254       | asm_fmove_op (I.CVTSD2SS) = "cvtsd2ss"       | asm_fmove_op (I.CVTSD2SS) = "cvtsd2ss"
      | asm_fmove_op (I.CVTSS2SI) = "cvtss2si"  
      | asm_fmove_op (I.CVTSS2SIQ) = "cvtss2siq"  
      | asm_fmove_op (I.CVTSD2SI) = "cvtsd2si"  
      | asm_fmove_op (I.CVTSD2SIQ) = "cvtsd2siq"  
255       | asm_fmove_op (I.CVTSI2SS) = "cvtsi2ss"       | asm_fmove_op (I.CVTSI2SS) = "cvtsi2ss"
256       | asm_fmove_op (I.CVTSI2SSQ) = "cvtsi2ssq"       | asm_fmove_op (I.CVTSI2SSQ) = "cvtsi2ssq"
257       | asm_fmove_op (I.CVTSI2SD) = "cvtsi2sd"       | asm_fmove_op (I.CVTSI2SD) = "cvtsi2sd"
# Line 266  Line 266 
266       | asm_isize (I.I64) = "64"       | asm_isize (I.I64) = "64"
267     and emit_isize x = emit (asm_isize x)     and emit_isize x = emit (asm_isize x)
268    
269  (*#line 476.7 "amd64/amd64.mdl"*)  (*#line 479.7 "amd64/amd64.mdl"*)
270     fun emitInt32 i =     fun emitInt32 i =
271         let         let
272  (*#line 477.11 "amd64/amd64.mdl"*)  (*#line 480.11 "amd64/amd64.mdl"*)
273             val s = Int32.toString i             val s = Int32.toString i
274    
275  (*#line 478.11 "amd64/amd64.mdl"*)  (*#line 481.11 "amd64/amd64.mdl"*)
276             val s = (if (i >= 0)             val s = (if (i >= 0)
277                    then s                    then s
278                    else ("-" ^ (String.substring (s, 1, (size s) - 1))))                    else ("-" ^ (String.substring (s, 1, (size s) - 1))))
279         in emit s         in emit s
280         end         end
281    
282  (*#line 482.7 "amd64/amd64.mdl"*)  (*#line 485.7 "amd64/amd64.mdl"*)
283     fun emitInt64 i =     fun emitInt64 i =
284         let         let
285  (*#line 483.11 "amd64/amd64.mdl"*)  (*#line 486.11 "amd64/amd64.mdl"*)
286             val s = Int64.toString i             val s = Int64.toString i
287    
288  (*#line 484.11 "amd64/amd64.mdl"*)  (*#line 487.11 "amd64/amd64.mdl"*)
289             val s = (if (i >= 0)             val s = (if (i >= 0)
290                    then s                    then s
291                    else ("-" ^ (String.substring (s, 1, (size s) - 1))))                    else ("-" ^ (String.substring (s, 1, (size s) - 1))))
292         in emit s         in emit s
293         end         end
294    
295  (*#line 489.7 "amd64/amd64.mdl"*)  (*#line 492.7 "amd64/amd64.mdl"*)
296     val {low=SToffset, ...} = C.cellRange CellsBasis.FP     val {low=SToffset, ...} = C.cellRange CellsBasis.FP
297    
298  (*#line 491.7 "amd64/amd64.mdl"*)  (*#line 494.7 "amd64/amd64.mdl"*)
299     fun emitScale 0 = emit "1"     fun emitScale 0 = emit "1"
300       | emitScale 1 = emit "2"       | emitScale 1 = emit "2"
301       | emitScale 2 = emit "4"       | emitScale 2 = emit "4"
# Line 352  Line 352 
352       | emit_disp (I.ImmedLabel lexp) = emit_labexp lexp       | emit_disp (I.ImmedLabel lexp) = emit_labexp lexp
353       | emit_disp _ = error "emit_disp"       | emit_disp _ = error "emit_disp"
354    
355  (*#line 539.7 "amd64/amd64.mdl"*)  (*#line 542.7 "amd64/amd64.mdl"*)
356     fun stupidGas (I.ImmedLabel lexp) = emit_labexp lexp     fun stupidGas (I.ImmedLabel lexp) = emit_labexp lexp
357       | stupidGas opnd =       | stupidGas opnd =
358         ( emit "*";         ( emit "*";
359           emit_operand opnd )           emit_operand opnd )
360    
361  (*#line 543.7 "amd64/amd64.mdl"*)  (*#line 546.7 "amd64/amd64.mdl"*)
362     fun isMemOpnd (I.FDirect f) = true     fun isMemOpnd (I.FDirect f) = true
363       | isMemOpnd (I.LabelEA _) = true       | isMemOpnd (I.LabelEA _) = true
364       | isMemOpnd (I.Displace _) = true       | isMemOpnd (I.Displace _) = true
365       | isMemOpnd (I.Indexed _) = true       | isMemOpnd (I.Indexed _) = true
366       | isMemOpnd _ = false       | isMemOpnd _ = false
367    
368  (*#line 548.7 "amd64/amd64.mdl"*)  (*#line 551.7 "amd64/amd64.mdl"*)
369     fun chop fbinOp =     fun chop fbinOp =
370         let         let
371  (*#line 549.15 "amd64/amd64.mdl"*)  (*#line 552.15 "amd64/amd64.mdl"*)
372             val n = size fbinOp             val n = size fbinOp
373         in         in
374            (case Char.toLower (String.sub (fbinOp, n - 1)) of            (case Char.toLower (String.sub (fbinOp, n - 1)) of
# Line 377  Line 377 
377            )            )
378         end         end
379    
380  (*#line 555.7 "amd64/amd64.mdl"*)  (*#line 558.7 "amd64/amd64.mdl"*)
381     val emit_dst = emit_operand     val emit_dst = emit_operand
382    
383  (*#line 556.7 "amd64/amd64.mdl"*)  (*#line 559.7 "amd64/amd64.mdl"*)
384     val emit_src = emit_operand     val emit_src = emit_operand
385    
386  (*#line 557.7 "amd64/amd64.mdl"*)  (*#line 560.7 "amd64/amd64.mdl"*)
387     val emit_opnd = emit_operand     val emit_opnd = emit_operand
388    
389  (*#line 558.7 "amd64/amd64.mdl"*)  (*#line 561.7 "amd64/amd64.mdl"*)
390     val emit_opnd8 = emit_operand8     val emit_opnd8 = emit_operand8
391    
392  (*#line 559.7 "amd64/amd64.mdl"*)  (*#line 562.7 "amd64/amd64.mdl"*)
393     val emit_rsrc = emit_operand     val emit_rsrc = emit_operand
394    
395  (*#line 560.7 "amd64/amd64.mdl"*)  (*#line 563.7 "amd64/amd64.mdl"*)
396     val emit_lsrc = emit_operand     val emit_lsrc = emit_operand
397    
398  (*#line 561.7 "amd64/amd64.mdl"*)  (*#line 564.7 "amd64/amd64.mdl"*)
399     val emit_addr = emit_operand     val emit_addr = emit_operand
400    
401  (*#line 562.7 "amd64/amd64.mdl"*)  (*#line 565.7 "amd64/amd64.mdl"*)
402     val emit_src1 = emit_operand     val emit_src1 = emit_operand
403    
404  (*#line 563.7 "amd64/amd64.mdl"*)  (*#line 566.7 "amd64/amd64.mdl"*)
405     val emit_ea = emit_operand     val emit_ea = emit_operand
406    
407  (*#line 564.7 "amd64/amd64.mdl"*)  (*#line 567.7 "amd64/amd64.mdl"*)
408     val emit_count = emit_operand     val emit_count = emit_operand
409     fun emitInstr' instr =     fun emitInstr' instr =
410         (case instr of         (case instr of

Legend:
Removed from v.2946  
changed lines
  Added in v.2947

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