Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix backend conflicts #174

Merged
merged 10 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions asmcomp/CSEgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,9 @@ method class_of_operation op =
| Icompf _ | Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf
| Ifloatofint | Iintoffloat -> Op_pure
| Ispecific _ -> Op_other
<<<<<<< HEAD
| Iprobe_is_enabled _ -> Op_other
| Ibeginregion | Iendregion -> Op_other
||||||| merged common ancestors
=======
| Idls_get -> Op_load Mutable
>>>>>>> ocaml/5.1

(* Operations that are so cheap that it isn't worth factoring them. *)
method is_cheap_operation op =
Expand Down
38 changes: 1 addition & 37 deletions asmcomp/amd64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -691,28 +691,8 @@ let emit_instr env fallthrough i =
cfi_restore_state ();
end
| Lop(Istackoffset n) ->
<<<<<<< HEAD
emit_stack_offset env n
| Lop(Iload(chunk, addr, _mut)) ->
||||||| merged common ancestors
if n < 0
then I.add (int (-n)) rsp
else if n > 0
then I.sub (int n) rsp;
if n <> 0
then cfi_adjust_cfa_offset n;
env.stack_offset <- env.stack_offset + n
| Lop(Iload(chunk, addr, _mut)) ->
=======
if n < 0
then I.add (int (-n)) rsp
else if n > 0
then I.sub (int n) rsp;
if n <> 0
then cfi_adjust_cfa_offset n;
env.stack_offset <- env.stack_offset + n
| Lop(Iload { memory_chunk; addressing_mode; _ }) ->
>>>>>>> ocaml/5.1
let dest = res i 0 in
begin match memory_chunk with
| Word_int | Word_val ->
Expand Down Expand Up @@ -899,7 +879,6 @@ let emit_instr env fallthrough i =
I.movsxd (arg32 i 0) (res i 0)
| Lop(Ispecific(Izextend32)) ->
I.mov (arg32 i 0) (res32 i 0)
<<<<<<< HEAD
| Lop(Ibeginregion) ->
I.mov (domain_field Domainstate.Domain_local_sp) (res i 0)
| Lop(Iendregion) ->
Expand Down Expand Up @@ -933,11 +912,8 @@ let emit_instr env fallthrough i =
I.cmp (int 0) (res16 i 0);
I.set (cond (Iunsigned Cne)) (res8 i 0);
I.movzx (res8 i 0) (res i 0)
||||||| merged common ancestors
=======
| Lop (Idls_get) ->
I.mov (domain_field Domainstate.Domain_dls_root) (res i 0)
>>>>>>> ocaml/5.1
| Lreloadretaddr ->
()
| Lreturn ->
Expand Down Expand Up @@ -1075,7 +1051,6 @@ let rec emit_all env fallthrough i =

let all_functions = ref []

<<<<<<< HEAD
let emit_function_type_and_size fun_name =
match system with
| S_gnu | S_linux ->
Expand All @@ -1085,9 +1060,6 @@ let emit_function_type_and_size fun_name =
ConstThis,
ConstLabel (emit_symbol fun_name)))
| _ -> ()
||||||| merged common ancestors
=======
>>>>>>> ocaml/5.1

(* Emission of a function declaration *)

Expand Down Expand Up @@ -1543,16 +1515,8 @@ let end_assembly() =
efa_string = (fun s -> D.bytes (s ^ "\000"))
};

<<<<<<< HEAD
if system = S_linux then begin
let frametable = emit_symbol (Cmm_helpers.make_symbol "frametable") in
||||||| merged common ancestors
if system = S_linux then begin
let frametable = emit_symbol (Compilenv.make_symbol (Some "frametable")) in
=======
if system = S_linux || system = S_freebsd || system = S_netbsd || system = S_openbsd then begin
let frametable = emit_symbol (Compilenv.make_symbol (Some "frametable")) in
>>>>>>> ocaml/5.1
let frametable = emit_symbol (Cmm_helpers.make_symbol "frametable") in
D.size frametable (ConstSub (ConstThis, ConstLabel frametable))
end;

Expand Down
8 changes: 0 additions & 8 deletions asmcomp/arm64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,9 @@ module BR = Branch_relaxation.Make (struct
| Lop (Ispecific (Ibswap _)) -> 1
| Lop (Ispecific Imove32) -> 1
| Lop (Ispecific (Isignext _)) -> 1
<<<<<<< HEAD
| Lop (Iprobe _ |Iprobe_is_enabled _) ->
Misc.fatal_error ("Probes not supported.")
||||||| merged common ancestors
=======
| Lop (Idls_get) -> 1
>>>>>>> ocaml/5.1
| Lreloadretaddr -> 0
| Lreturn -> epilogue_size f
| Llabel _ -> 0
Expand Down Expand Up @@ -965,15 +961,11 @@ let emit_instr env i =
end
| Lop(Ispecific(Isignext size)) ->
` sbfm {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, #0, #{emit_int (size - 1)}\n`
<<<<<<< HEAD
| Lop (Iprobe _ |Iprobe_is_enabled _) ->
Misc.fatal_error ("Probes not supported.")
||||||| merged common ancestors
=======
| Lop(Idls_get) ->
let offset = Domainstate.(idx_of_field Domain_dls_root) * 8 in
` ldr {emit_reg i.res.(0)}, [{emit_reg reg_domain_state_ptr}, {emit_int offset}]\n`
>>>>>>> ocaml/5.1
| Lreloadretaddr ->
()
| Lreturn ->
Expand Down
66 changes: 8 additions & 58 deletions asmcomp/asmlink.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,41 +48,22 @@ let implementations_defined = ref ([] : (CU.t * string) list)
let cmx_required = ref ([] : CU.t list)

let check_consistency file_name unit crc =
let ui_name = CU.name unit.ui_unit in
begin try
let source = List.assoc unit.ui_unit !implementations_defined in
raise (Error(Multiple_definition(ui_name, file_name, source)))
with Not_found -> ()
end;
begin try
mshinwell marked this conversation as resolved.
Show resolved Hide resolved
<<<<<<< HEAD
Array.iter
(fun import ->
let name = Import_info.name import in
let crco = Import_info.crc_with_unit import in
||||||| merged common ancestors
List.iter
(fun (name, crco) ->
=======
let source = List.assoc unit.ui_name !implementations_defined in
raise (Error(Multiple_definition(unit.ui_name, file_name, source)))
with Not_found -> ()
end;
begin try
List.iter
(fun (name, crco) ->
>>>>>>> ocaml/5.1
interfaces := name :: !interfaces;
match crco with
None -> ()
<<<<<<< HEAD
| Some (full_name, crc) ->
if CU.Name.equal name (CU.name unit.ui_unit)
then Cmi_consistbl.set crc_interfaces name full_name crc file_name
else
Cmi_consistbl.check crc_interfaces name full_name crc file_name)
||||||| merged common ancestors
| Some crc ->
if name = unit.ui_name
then Cmi_consistbl.set crc_interfaces name crc file_name
else Cmi_consistbl.check crc_interfaces name crc file_name)
=======
| Some crc -> Cmi_consistbl.check crc_interfaces name crc file_name)
>>>>>>> ocaml/5.1
Cmi_consistbl.check crc_interfaces name full_name crc file_name)
unit.ui_imports_cmi
with Cmi_consistbl.Inconsistency {
unit_name = name;
Expand Down Expand Up @@ -111,27 +92,8 @@ let check_consistency file_name unit crc =
} ->
raise(Error(Inconsistent_implementation(name, user, auth)))
end;
<<<<<<< HEAD
let ui_name = CU.name unit.ui_unit in
begin try
let source = List.assoc unit.ui_unit !implementations_defined in
raise (Error(Multiple_definition(ui_name, file_name, source)))
with Not_found -> ()
end;
implementations := unit.ui_unit :: !implementations;
Cmx_consistbl.set crc_implementations unit.ui_unit () crc file_name;
||||||| merged common ancestors
begin try
let source = List.assoc unit.ui_name !implementations_defined in
raise (Error(Multiple_definition(unit.ui_name, file_name, source)))
with Not_found -> ()
end;
implementations := unit.ui_name :: !implementations;
Cmx_consistbl.set crc_implementations unit.ui_name crc file_name;
=======
implementations := unit.ui_name :: !implementations;
Cmx_consistbl.check crc_implementations unit.ui_name crc file_name;
>>>>>>> ocaml/5.1
Cmx_consistbl.check crc_implementations unit.ui_unit () crc file_name;
implementations_defined :=
(unit.ui_unit, file_name) :: !implementations_defined;
if CU.is_packed unit.ui_unit then
Expand Down Expand Up @@ -309,13 +271,7 @@ let make_startup_file ~ppf_dump units_list ~crc_interfaces =
compile_phrase (Cmm_helpers.entry_point name_list);
let units = List.map (fun (info,_,_) -> info) units_list in
List.iter compile_phrase
<<<<<<< HEAD
(Cmm_helpers.emit_preallocated_blocks []
||||||| merged common ancestors
List.iter compile_phrase (Cmm_helpers.generic_functions false units);
=======
(Cmm_helpers.emit_preallocated_blocks [] (* add gc_roots (for dynlink) *)
>>>>>>> ocaml/5.1
(Cmm_helpers.generic_functions false units));
Array.iteri
(fun i name -> compile_phrase (Cmm_helpers.predef_exception i name))
Expand Down Expand Up @@ -352,13 +308,7 @@ let make_shared_startup_file ~ppf_dump units =
Compilenv.reset shared_startup_comp_unit;
Emit.begin_assembly ();
List.iter compile_phrase
<<<<<<< HEAD
(Cmm_helpers.emit_preallocated_blocks []
||||||| merged common ancestors
(Cmm_helpers.generic_functions true (List.map fst units));
=======
(Cmm_helpers.emit_preallocated_blocks [] (* add gc_roots (for dynlink) *)
>>>>>>> ocaml/5.1
(Cmm_helpers.generic_functions true (List.map fst units)));
compile_phrase (Cmm_helpers.plugin_header units);
compile_phrase
Expand Down
12 changes: 0 additions & 12 deletions asmcomp/asmpackager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,9 @@ let read_member_info pack_path file = (
PM_intf
else begin
let (info, crc) = Compilenv.read_unit_info file in
<<<<<<< HEAD
if not (CU.Name.equal (CU.name info.ui_unit) name)
then raise(Error(Illegal_renaming(name, file, (CU.name info.ui_unit))));
if not (CU.is_parent pack_path ~child:info.ui_unit)
||||||| merged common ancestors
if info.ui_name <> name
then raise(Error(Illegal_renaming(name, file, info.ui_name)));
if info.ui_symbol <>
(Compilenv.current_unit_infos()).ui_symbol ^ "__" ^ info.ui_name
=======
if info.ui_name <> name
then raise(Error(Illegal_renaming(name, file, info.ui_name)));
if info.ui_symbol <>
(Compilenv.current_unit_infos()).ui_symbol ^ "." ^ info.ui_name
>>>>>>> ocaml/5.1
then raise(Error(Wrong_for_pack(file, pack_path)));
Asmlink.check_consistency file info crc;
Compilenv.cache_unit_info info;
Expand Down
4 changes: 0 additions & 4 deletions asmcomp/mach.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,10 @@ type operation =
| Iopaque
| Ispecific of Arch.specific_operation
| Ipoll of { return_label: Cmm.label option }
<<<<<<< HEAD
| Iprobe of { name: string; handler_code_sym: string; }
| Iprobe_is_enabled of { name: string }
| Ibeginregion | Iendregion
||||||| merged common ancestors
=======
| Idls_get
>>>>>>> ocaml/5.1

type instruction =
{ desc: instruction_desc;
Expand Down
7 changes: 1 addition & 6 deletions asmcomp/polling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,8 @@ let find_poll_alloc_or_calls instr =
Iconst_symbol _ | Iextcall { alloc = false } | Istackoffset _ |
Iload _ | Istore _ | Iintop _ | Iintop_imm _ | Ifloatofint |
Iintoffloat | Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf |
<<<<<<< HEAD
Iopaque | Ispecific _ |
Iopaque | Ispecific _ | Idls_get | Icompf _ |
Ibeginregion | Iendregion | Iprobe _ | Iprobe_is_enabled _) -> None
||||||| merged common ancestors
=======
Iopaque | Ispecific _ | Idls_get | Icompf _) -> None
>>>>>>> ocaml/5.1
| Iend | Ireturn | Iifthenelse _ | Iswitch _ | Icatch _ | Iexit _ |
Itrywith _ | Iraise _ -> None
in
Expand Down
8 changes: 0 additions & 8 deletions asmcomp/power/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,11 @@ module BR = Branch_relaxation.Make (struct
| Lop(Iintoffloat) -> 4
| Lop(Iopaque) -> 0
| Lop(Ispecific _) -> 1
<<<<<<< HEAD
| Lop (Iprobe _ |Iprobe_is_enabled _) ->
Misc.fatal_error ("Probes not supported.")
||||||| merged common ancestors
=======
| Lop (Idls_get) ->
(* Here to maintain build *)
assert false
>>>>>>> ocaml/5.1
| Lreloadretaddr -> 2
| Lreturn -> 2
| Llabel _ -> 0
Expand Down Expand Up @@ -937,15 +933,11 @@ let emit_instr env i =
| Lop(Ispecific sop) ->
let instr = name_for_specific sop in
` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_reg i.arg.(2)}\n`
<<<<<<< HEAD
| Lop (Iprobe _ |Iprobe_is_enabled _) ->
Misc.fatal_error ("Probes not supported.")
||||||| merged common ancestors
=======
| Lop (Idls_get) ->
(* Here to maintain build *)
assert false
>>>>>>> ocaml/5.1
| Lreloadretaddr ->
` {emit_string lg} 11, {emit_int(retaddr_offset env)}(1)\n`;
` mtlr 11\n`
Expand Down
Loading
Loading