Skip to content

Commit ae0ac31

Browse files
committed
new directives on arm
1 parent 0ef22fb commit ae0ac31

File tree

4 files changed

+326
-216
lines changed

4 files changed

+326
-216
lines changed

backend/amd64/emit.ml

+8-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ let to_x86_directive (dir : ND.Directive.t) : X86_ast.asm_line list =
113113
comment_lines comment @ [X86_ast.Sleb128 (to_x86_constant constant)]
114114
| Space { bytes } -> [Space bytes]
115115
| Type (n, st) ->
116-
let typ = match st with Function -> "STT_FUNC" | Object -> "STT_OBJECT" in
116+
let typ = ND.symbol_type_to_string st in
117117
[Type (n, typ)]
118118
| Uleb128 { constant; comment } ->
119119
comment_lines comment @ [X86_ast.Uleb128 (to_x86_constant constant)]
@@ -122,6 +122,9 @@ let to_x86_directive (dir : ND.Directive.t) : X86_ast.asm_line list =
122122
| Cfi_endproc -> [X86_ast.Cfi_endproc]
123123
| Cfi_offset { reg; offset } -> [X86_ast.Cfi_offset (reg, offset)]
124124
| Cfi_startproc -> [X86_ast.Cfi_startproc]
125+
| Cfi_remember_state -> [X86_ast.Cfi_remember_state]
126+
| Cfi_restore_state -> [X86_ast.Cfi_restore_state]
127+
| Cfi_def_cfa_register r -> [X86_ast.Cfi_def_cfa_register r]
125128
| Protected s -> [X86_ast.Protected s]
126129

127130
let _label s = D.label ~typ:QWORD s
@@ -1495,7 +1498,10 @@ let emit_instr ~first ~fallthrough i =
14951498
(* +0.0 *)
14961499
I.xorpd (res i 0) (res i 0)
14971500
| _ ->
1498-
(* float32 constants still take up 8 bytes; we load the lower half. *)
1501+
(* float32 constants take up 8 bytes when we emit them with
1502+
[float_literal] (see the conversion from int32 to int64 below). Thus,
1503+
we load the lower half. Note that this is different from Cmm 32-bit
1504+
floats ([Csingle]), which are emitted as 4-byte constants. *)
14991505
let lbl = add_float_constant (Int64.of_int32 f) in
15001506
I.movss (mem64_rip REAL4 (emit_label lbl)) (res i 0))
15011507
| Lop (Const_float f) -> (

0 commit comments

Comments
 (0)