Commit 452390e 1 parent 0cba565 commit 452390e Copy full SHA for 452390e
File tree 2 files changed +11
-9
lines changed
2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ let slot_offset loc cl =
53
53
else !stack_offset + (num_stack_slots.(0) + n) * 8
54
54
| Outgoing n -> n
55
55
56
- (* Output a 32 bit integer in hex *)
56
+ (* Output a 32 or 64 bit integer in hex *)
57
57
58
58
let emit_int32 n = emit_printf "0%lxh" n
59
+ let emit_int64 n = emit_printf "0%Lxh" n
59
60
60
61
(* Symbols *)
61
62
@@ -334,8 +335,7 @@ let add_float_constant cst =
334
335
lbl
335
336
336
337
let emit_float_constant (cst, lbl) =
337
- `{emit_label lbl}:`;
338
- emit_float64_directive "QWORD" cst
338
+ `{emit_label lbl}: QWORD {emit_int64 cst}\n`
339
339
340
340
let emit_movabs reg n =
341
341
(* force ml64 to use mov reg, imm64 instruction *)
@@ -706,9 +706,9 @@ let emit_item = function
706
706
| Cint n ->
707
707
` QWORD {emit_nativeint n}\n`
708
708
| Csingle f ->
709
- emit_float32_directive " DWORD" (Int32.bits_of_float f)
709
+ ` DWORD {emit_int32 (Int32.bits_of_float f)}\n`
710
710
| Cdouble f ->
711
- emit_float64_directive " QWORD" (Int64.bits_of_float f)
711
+ ` QWORD {emit_int64 (Int64.bits_of_float f)}\n`
712
712
| Csymbol_address s ->
713
713
add_used_symbol s;
714
714
` QWORD {emit_symbol s}\n`
Original file line number Diff line number Diff line change @@ -62,7 +62,10 @@ let add_used_symbol s =
62
62
let emit_symbol s =
63
63
emit_string "_"; Emitaux.emit_symbol '$' s
64
64
65
+ (* Output a 32 or 64 bit integer in hex *)
66
+
65
67
let emit_int32 n = emit_printf "0%lxh" n
68
+ let emit_int64 n = emit_printf "0%Lxh" n
66
69
67
70
(* Output a label *)
68
71
@@ -374,8 +377,7 @@ let add_float_constant cst =
374
377
lbl
375
378
376
379
let emit_float_constant (cst, lbl) =
377
- `{emit_label lbl}:`;
378
- emit_float64_directive "QWORD" cst
380
+ `{emit_label lbl}: QWORD {emit_int64 cst}\n`
379
381
380
382
(* Output the assembly code for an instruction *)
381
383
@@ -801,9 +803,9 @@ let emit_item = function
801
803
| Cint32 n ->
802
804
` DWORD {emit_nativeint n}\n`
803
805
| Csingle f ->
804
- emit_float32_directive " DWORD" (Int32.bits_of_float f)
806
+ ` DWORD {emit_int32 (Int32.bits_of_float f)}\n`
805
807
| Cdouble f ->
806
- emit_float64_directive " QWORD" (Int64.bits_of_float f)
808
+ ` QWORD {emit_int64 (Int64.bits_of_float f)}\n`
807
809
| Csymbol_address s ->
808
810
add_used_symbol s ;
809
811
` DWORD {emit_symbol s}\n`
You can’t perform that action at this time.
0 commit comments