Skip to content

Commit 703e1ae

Browse files
committed
new directives in arm
1 parent 3dcd846 commit 703e1ae

File tree

4 files changed

+277
-205
lines changed

4 files changed

+277
-205
lines changed

backend/amd64/emit.ml

+5-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ let to_x86_directive (dir : ND.Directive.t) : X86_ast.asm_line list =
110110
comment_lines comment @ [X86_ast.Sleb128 (to_x86_constant constant)]
111111
| Space { bytes } -> [Space bytes]
112112
| Type (n, st) ->
113-
let typ = match st with Function -> "STT_FUNC" | Object -> "STT_OBJECT" in
113+
let typ = ND.symbol_type_to_string st in
114114
[Type (n, typ)]
115115
| Uleb128 { constant; comment } ->
116116
comment_lines comment @ [X86_ast.Uleb128 (to_x86_constant constant)]
@@ -1689,7 +1689,10 @@ let emit_instr ~first ~fallthrough i =
16891689
(* +0.0 *)
16901690
I.xorpd (res i 0) (res i 0)
16911691
| _ ->
1692-
(* float32 constants still take up 8 bytes; we load the lower half. *)
1692+
(* float32 constants take up 8 bytes when we emit them with
1693+
[float_literal] (see the conversion from int32 to int64 below). Thus,
1694+
we load the lower half. Note that this is different from Cmm 32-bit
1695+
floats ([Csingle]), which are emitted as 4-byte constants. *)
16931696
let lbl = add_float_constant (Int64.of_int32 f) in
16941697
I.movss (mem64_rip REAL4 (emit_label lbl)) (res i 0))
16951698
| Lop (Const_float f) -> (

0 commit comments

Comments
 (0)