Add TLS support for ELF and MachO (#1174)
* Add TLS support * Add binemit and legalize tests * Spill all caller-saved registers when necessary
This commit is contained in:
@@ -1127,6 +1127,18 @@ pub(crate) fn define(
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
ig.push(
|
||||
Inst::new(
|
||||
"tls_value",
|
||||
r#"
|
||||
Compute the value of global GV, which is a TLS (thread local storage) value.
|
||||
"#,
|
||||
&formats.unary_global_value,
|
||||
)
|
||||
.operands_in(vec![GV])
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
let HeapOffset = &TypeVar::new(
|
||||
"HeapOffset",
|
||||
"An unsigned heap offset",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Shared definitions for the Cranelift intermediate language.
|
||||
|
||||
mod entities;
|
||||
pub mod entities;
|
||||
pub mod formats;
|
||||
pub mod immediates;
|
||||
pub mod instructions;
|
||||
@@ -28,6 +28,7 @@ pub(crate) struct Definitions {
|
||||
pub imm: Immediates,
|
||||
pub formats: Formats,
|
||||
pub transform_groups: TransformGroups,
|
||||
pub entities: EntityRefs,
|
||||
}
|
||||
|
||||
pub(crate) fn define() -> Definitions {
|
||||
@@ -47,6 +48,7 @@ pub(crate) fn define() -> Definitions {
|
||||
imm: immediates,
|
||||
formats,
|
||||
transform_groups,
|
||||
entities,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,14 @@ pub(crate) fn define() -> SettingGroup {
|
||||
false,
|
||||
);
|
||||
|
||||
settings.add_enum(
|
||||
"tls_model",
|
||||
r#"
|
||||
Defines the model used to perform TLS accesses.
|
||||
"#,
|
||||
vec!["none", "elf_gd", "macho", "coff"],
|
||||
);
|
||||
|
||||
// Settings specific to the `baldrdash` calling convention.
|
||||
|
||||
settings.add_enum(
|
||||
|
||||
Reference in New Issue
Block a user