This is a breaking API change: the following settings have been renamed: - jump_tables_enabled -> enable_jump_tables - colocated_libcalls -> use_colocated_libcalls - probestack_enabled -> enable_probestack - allones_funcaddrs -> emit_all_ones_funcaddrs
This commit is contained in:
committed by
Sean Stangl
parent
bd88155483
commit
dd497c19e1
@@ -59,16 +59,16 @@ pub(crate) fn define(shared: &SettingGroup) -> SettingGroup {
|
||||
// back in the shared SettingGroup, and use it in x86 instruction predicates.
|
||||
|
||||
let is_pic = shared.get_bool("is_pic");
|
||||
let allones_funcaddrs = shared.get_bool("allones_funcaddrs");
|
||||
let emit_all_ones_funcaddrs = shared.get_bool("emit_all_ones_funcaddrs");
|
||||
settings.add_predicate("is_pic", predicate!(is_pic));
|
||||
settings.add_predicate("not_is_pic", predicate!(!is_pic));
|
||||
settings.add_predicate(
|
||||
"all_ones_funcaddrs_and_not_is_pic",
|
||||
predicate!(allones_funcaddrs && !is_pic),
|
||||
predicate!(emit_all_ones_funcaddrs && !is_pic),
|
||||
);
|
||||
settings.add_predicate(
|
||||
"not_all_ones_funcaddrs_and_not_is_pic",
|
||||
predicate!(!allones_funcaddrs && !is_pic),
|
||||
predicate!(!emit_all_ones_funcaddrs && !is_pic),
|
||||
);
|
||||
|
||||
// Presets corresponding to x86 CPUs.
|
||||
|
||||
@@ -37,7 +37,7 @@ pub(crate) fn define() -> SettingGroup {
|
||||
);
|
||||
|
||||
settings.add_bool(
|
||||
"colocated_libcalls",
|
||||
"use_colocated_libcalls",
|
||||
r#"
|
||||
Use colocated libcalls.
|
||||
|
||||
@@ -177,7 +177,7 @@ pub(crate) fn define() -> SettingGroup {
|
||||
// BaldrMonkey requires that not-yet-relocated function addresses be encoded
|
||||
// as all-ones bitpatterns.
|
||||
settings.add_bool(
|
||||
"allones_funcaddrs",
|
||||
"emit_all_ones_funcaddrs",
|
||||
"Emit not-yet-relocated function addresses as all-ones bit patterns.",
|
||||
false,
|
||||
);
|
||||
@@ -185,7 +185,7 @@ pub(crate) fn define() -> SettingGroup {
|
||||
// Stack probing options.
|
||||
|
||||
settings.add_bool(
|
||||
"probestack_enabled",
|
||||
"enable_probestack",
|
||||
r#"
|
||||
Enable the use of stack probes, for calling conventions which support this
|
||||
functionality.
|
||||
@@ -218,7 +218,7 @@ pub(crate) fn define() -> SettingGroup {
|
||||
// Jump table options.
|
||||
|
||||
settings.add_bool(
|
||||
"jump_tables_enabled",
|
||||
"enable_jump_tables",
|
||||
"Enable the use of jump tables in generated machine code.",
|
||||
true,
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ use serde::{Deserialize, Serialize};
|
||||
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
||||
pub enum LibCall {
|
||||
/// probe for stack overflow. These are emitted for functions which need
|
||||
/// when the `probestack_enabled` setting is true.
|
||||
/// when the `enable_probestack` setting is true.
|
||||
Probestack,
|
||||
/// ceil.f32
|
||||
CeilF32,
|
||||
@@ -202,7 +202,7 @@ fn make_funcref(
|
||||
func.import_function(ExtFuncData {
|
||||
name: ExternalName::LibCall(libcall),
|
||||
signature: sigref,
|
||||
colocated: isa.flags().colocated_libcalls(),
|
||||
colocated: isa.flags().use_colocated_libcalls(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -453,7 +453,7 @@ pub fn prologue_epilogue(func: &mut ir::Function, isa: &dyn TargetIsa) -> Codege
|
||||
|
||||
fn baldrdash_prologue_epilogue(func: &mut ir::Function, isa: &dyn TargetIsa) -> CodegenResult<()> {
|
||||
debug_assert!(
|
||||
!isa.flags().probestack_enabled(),
|
||||
!isa.flags().enable_probestack(),
|
||||
"baldrdash does not expect cranelift to emit stack probes"
|
||||
);
|
||||
|
||||
@@ -754,8 +754,7 @@ fn insert_common_prologue(
|
||||
|
||||
// Allocate stack frame storage.
|
||||
if stack_size > 0 {
|
||||
if isa.flags().probestack_enabled()
|
||||
&& stack_size > (1 << isa.flags().probestack_size_log2())
|
||||
if isa.flags().enable_probestack() && stack_size > (1 << isa.flags().probestack_size_log2())
|
||||
{
|
||||
// Emit a stack probe.
|
||||
let rax = RU::rax as RegUnit;
|
||||
|
||||
@@ -191,7 +191,7 @@ pub fn legalize_function(func: &mut ir::Function, cfg: &mut ControlFlowGraph, is
|
||||
}
|
||||
|
||||
// Now that we've lowered all br_tables, we don't need the jump tables anymore.
|
||||
if !isa.flags().jump_tables_enabled() {
|
||||
if !isa.flags().enable_jump_tables() {
|
||||
pos.func.jump_tables.clear();
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ fn expand_br_table(
|
||||
cfg: &mut ControlFlowGraph,
|
||||
isa: &dyn TargetIsa,
|
||||
) {
|
||||
if isa.flags().jump_tables_enabled() {
|
||||
if isa.flags().enable_jump_tables() {
|
||||
expand_br_table_jt(inst, func, cfg, isa);
|
||||
} else {
|
||||
expand_br_table_conds(inst, func, cfg, isa);
|
||||
|
||||
@@ -384,7 +384,7 @@ mod tests {
|
||||
probestack_size_log2 = 12\n\
|
||||
enable_verifier = true\n\
|
||||
is_pic = false\n\
|
||||
colocated_libcalls = false\n\
|
||||
use_colocated_libcalls = false\n\
|
||||
avoid_div_traps = false\n\
|
||||
enable_float = true\n\
|
||||
enable_nan_canonicalization = false\n\
|
||||
@@ -393,10 +393,10 @@ mod tests {
|
||||
enable_simd = false\n\
|
||||
enable_atomics = true\n\
|
||||
enable_safepoints = false\n\
|
||||
allones_funcaddrs = false\n\
|
||||
probestack_enabled = true\n\
|
||||
emit_all_ones_funcaddrs = false\n\
|
||||
enable_probestack = true\n\
|
||||
probestack_func_adjusts_sp = false\n\
|
||||
jump_tables_enabled = true\n"
|
||||
enable_jump_tables = true\n"
|
||||
);
|
||||
assert_eq!(f.opt_level(), super::OptLevel::None);
|
||||
assert_eq!(f.enable_simd(), false);
|
||||
|
||||
Reference in New Issue
Block a user