Skip to content

Commit 767842c

Browse files
committed
remove fcm on arm
1 parent eca1333 commit 767842c

File tree

3 files changed

+3
-103
lines changed

3 files changed

+3
-103
lines changed

backend/arm64/emit.ml

+2-101
Original file line numberDiff line numberDiff line change
@@ -2112,108 +2112,9 @@ let data l =
21122112
emit_printf "\t.align\t3\n";
21132113
List.iter emit_item l
21142114

2115-
let emit_line str = emit_string (str ^ "\n")
2116-
21172115
let file_emitter ~file_num ~file_name =
21182116
D.file ~file_num:(Some file_num) ~file_name
21192117

2120-
let build_asm_directives () : (module Asm_targets.Asm_directives_intf.S) =
2121-
(module Asm_targets.Asm_directives.Make (struct
2122-
let emit_line = emit_line
2123-
2124-
let get_file_num file_name = Emitaux.get_file_num ~file_emitter file_name
2125-
2126-
let debugging_comments_in_asm_files = !Flambda_backend_flags.dasm_comments
2127-
2128-
module D = struct
2129-
type constant = D.Directive.Constant.t
2130-
2131-
let const_int64 num = D.Directive.Constant.Signed_int num
2132-
2133-
let const_label str = D.Directive.Constant.Named_thing str
2134-
2135-
let const_add c1 c2 = D.Directive.Constant.Add (c1, c2)
2136-
2137-
let const_sub c1 c2 = D.Directive.Constant.Sub (c1, c2)
2138-
2139-
(* CR sspies: The functions depending on [emit_directive] below break
2140-
abstractions. This is intensional at the moment, because this is only
2141-
the first step of getting rid of the first-class module entirely. *)
2142-
let emit_directive dir =
2143-
let buf = Buffer.create 80 in
2144-
D.Directive.print buf dir;
2145-
Buffer.add_string buf "\n";
2146-
Buffer.output_buffer !output_channel buf
2147-
2148-
let emit_constant const size =
2149-
emit_directive
2150-
(Const
2151-
{ constant = D.Directive.Constant_with_width.create const size;
2152-
comment = None
2153-
})
2154-
2155-
type data_type =
2156-
| NONE
2157-
| DWORD
2158-
| QWORD
2159-
| VEC128
2160-
2161-
let file = file_emitter
2162-
2163-
let loc ~file_num ~line ~col ?discriminator () =
2164-
ignore discriminator;
2165-
D.loc ~file_num ~line ~col ?discriminator ()
2166-
2167-
let comment str = D.comment str
2168-
2169-
let label ?data_type:_ str = emit_directive (New_label (str, Code))
2170-
2171-
let section ?delayed:_ name flags args =
2172-
match name, flags, args with
2173-
| [".data"], _, _ -> D.data ()
2174-
| [".text"], _, _ -> D.text ()
2175-
| name, flags, args -> D.switch_to_section_raw ~names:name ~flags ~args
2176-
2177-
let text () = D.text ()
2178-
2179-
let new_line () = D.new_line ()
2180-
2181-
let global sym = emit_directive (Global sym)
2182-
2183-
let protected sym = if not macosx then emit_directive (Protected sym)
2184-
2185-
let type_ sym typ_ =
2186-
let typ_ : D.symbol_type =
2187-
match typ_ with
2188-
| "@function" -> Function
2189-
| "@object" -> Object
2190-
| "STT_FUNC" -> Function
2191-
| "STT_OBJECT" -> Object
2192-
| _ -> Misc.fatal_errorf "Unsupported assembly type %s" typ_
2193-
in
2194-
emit_directive (Type (sym, typ_))
2195-
2196-
let byte const = emit_constant const Eight
2197-
2198-
let word const = emit_constant const Sixteen
2199-
2200-
let long const = emit_constant const Thirty_two
2201-
2202-
let qword const = emit_constant const Sixty_four
2203-
2204-
let bytes str = D.string str
2205-
2206-
let uleb128 const =
2207-
emit_directive (Uleb128 { constant = const; comment = None })
2208-
2209-
let sleb128 const =
2210-
emit_directive (Sleb128 { constant = const; comment = None })
2211-
2212-
let direct_assignment var const =
2213-
emit_directive (Direct_assignment (var, const))
2214-
end
2215-
end))
2216-
22172118
(* Beginning / end of an assembly file *)
22182119

22192120
let begin_assembly _unix =
@@ -2246,8 +2147,8 @@ let begin_assembly _unix =
22462147
DSL.ins I.NOP [||];
22472148
emit_printf "\t.align\t3\n");
22482149
let lbl_end = Cmm_helpers.make_symbol "code_end" in
2249-
Emitaux.Dwarf_helpers.begin_dwarf ~build_asm_directives ~code_begin:lbl_begin
2250-
~code_end:lbl_end ~file_emitter
2150+
Emitaux.Dwarf_helpers.begin_dwarf ~code_begin:lbl_begin ~code_end:lbl_end
2151+
~file_emitter
22512152

22522153
let end_assembly () =
22532154
let lbl_end = Cmm_helpers.make_symbol "code_end" in

backend/emitaux.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ module Dwarf_helpers = struct
557557

558558
let sourcefile_for_dwarf = ref None
559559

560-
let begin_dwarf ~build_asm_directives:_ ~code_begin ~code_end ~file_emitter =
560+
let begin_dwarf ~code_begin ~code_end ~file_emitter =
561561
match !sourcefile_for_dwarf with
562562
| None -> ()
563563
| Some sourcefile ->

backend/emitaux.mli

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ module Dwarf_helpers : sig
159159
val init : disable_dwarf:bool -> sourcefile:string option -> unit
160160

161161
val begin_dwarf :
162-
build_asm_directives:(unit -> (module Asm_targets.Asm_directives_intf.S)) ->
163162
code_begin:string ->
164163
code_end:string ->
165164
file_emitter:(file_num:int -> file_name:string -> unit) ->

0 commit comments

Comments
 (0)