Skip to content

Delete x86 architecture check #2381

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

Merged
merged 2 commits into from
Apr 2, 2024
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
6 changes: 1 addition & 5 deletions backend/amd64/arch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ let command_line_options =
"-ftrap-notes", Arg.Set trap_notes,
" Emit .note.ocaml_eh section with trap handling information (default)";
"-fno-trap-notes", Arg.Clear trap_notes,
" Do not emit .note.ocaml_eh section with trap handling information";
"-farch-check", Arg.Set arch_check_symbols,
" Emit ISA extension symbols for CPUID check (default)";
"-fno-arch-check", Arg.Clear arch_check_symbols,
" Do not emit ISA extension symbols for CPUID check";
" Do not emit .note.ocaml_eh section with trap handling information"
] @ Extension.args

let assert_simd_enabled () =
Expand Down
24 changes: 0 additions & 24 deletions backend/amd64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -922,29 +922,6 @@ let emit_push_trap_label handler =
traps.push_traps <- lbl::traps.push_traps;
traps.enter_traps <- Int.Set.add handler traps.enter_traps

(* ISA Extension Checking *)

module Extension = struct
module E = Arch.Extension

(* Keep in sync with [isa.c] in the runtime. *)
let symbol : E.t -> string =
fun t -> "caml_arch_" ^ String.lowercase_ascii (E.name t)

let is_nasm_or_masm () =
match system with
| S_macosx | S_win32 | S_win64 -> true
| _ -> false

let emit_symbols () =
if !arch_check_symbols && not (is_nasm_or_masm ()) then
List.iter (fun ext ->
let name = symbol ext in
D.label name;
D.weak name
) (E.available ())
end

(* Emit Code *)

let emit_atomic instr op (size : Cmm.atomic_bitwidth) addr =
Expand Down Expand Up @@ -2011,7 +1988,6 @@ let begin_assembly unix =

D.data ();
emit_global_label "data_begin";
Extension.emit_symbols ();

emit_named_text_section code_begin;
emit_global_label_for_symbol code_begin;
Expand Down
8 changes: 2 additions & 6 deletions ocaml/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ runtime4_COMMON_C_SOURCES = \
interp \
ints \
io \
isa \
lexing \
main \
major_gc \
Expand Down Expand Up @@ -674,8 +673,7 @@ runtime4_NATIVE_ONLY_C_SOURCES = \
fail_nat \
roots_nat \
startup_nat \
signals_nat \
isa
signals_nat

# Runtime system source files (v5)

Expand Down Expand Up @@ -704,7 +702,6 @@ runtime_COMMON_C_SOURCES = \
intern \
ints \
io \
isa \
lexing \
lf_skiplist \
main \
Expand Down Expand Up @@ -747,8 +744,7 @@ runtime_NATIVE_ONLY_C_SOURCES = \
fail_nat \
frame_descriptors \
startup_nat \
signals_nat \
isa
signals_nat

# The runtime system

Expand Down
1 change: 0 additions & 1 deletion ocaml/runtime/caml/dune
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
(interp.h as caml/interp.h)
(intext.h as caml/intext.h)
(io.h as caml/io.h)
(isa.h as caml/isa.h)
(lf_skiplist.h as caml/lf_skiplist.h)
(m.h as caml/m.h)
(major_gc.h as caml/major_gc.h)
Expand Down
111 changes: 0 additions & 111 deletions ocaml/runtime/caml/isa.h

This file was deleted.

1 change: 0 additions & 1 deletion ocaml/runtime/caml/mlvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "config.h"
#include "misc.h"
#include "isa.h"

#ifdef __cplusplus
extern "C" {
Expand Down
165 changes: 0 additions & 165 deletions ocaml/runtime/isa.c

This file was deleted.

2 changes: 0 additions & 2 deletions ocaml/runtime/startup_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
and native code. */

#include <stdio.h>
#include "caml/isa.h"
#include "caml/backtrace.h"
#include "caml/memory.h"
#include "caml/callback.h"
Expand Down Expand Up @@ -115,7 +114,6 @@ void caml_parse_ocamlrunparam(void)
case 'v': scanmult (opt, (uintnat *)&caml_verb_gc); break;
case 'V': scanmult (opt, &params.verify_heap); break;
case 'W': scanmult (opt, &caml_runtime_warnings); break;
case 'X': scanmult (opt, &caml_skip_arch_extension_check); break;
case ',': continue;
}
while (*opt != '\0'){
Expand Down
Loading
Loading