Update powerpc64 data layout

This commit is contained in:
Nikita Popov 2021-07-28 22:48:45 +02:00
parent 6eaf227ce1
commit b5cc03b71a
6 changed files with 9 additions and 10 deletions

View File

@ -115,10 +115,6 @@ fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
}
}
fn strip_powerpc64_vectors(data_layout: String) -> String {
data_layout.replace("-v256:256:256-v512:512:512", "")
}
pub unsafe fn create_module(
tcx: TyCtxt<'_>,
llcx: &'ll llvm::Context,
@ -130,9 +126,12 @@ pub unsafe fn create_module(
let mut target_data_layout = sess.target.data_layout.clone();
if llvm_util::get_version() < (12, 0, 0) && sess.target.arch == "powerpc64" {
target_data_layout = strip_powerpc64_vectors(target_data_layout);
target_data_layout = target_data_layout.replace("-v256:256:256-v512:512:512", "");
}
if llvm_util::get_version() < (13, 0, 0) {
if sess.target.arch == "powerpc64" {
target_data_layout = target_data_layout.replace("-S128", "");
}
if sess.target.arch == "wasm32" {
target_data_layout = "e-m:e-p:32:32-i64:64-n32:64-S128".to_string();
}

View File

@ -14,7 +14,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-musl".to_string(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: Endian::Big, ..base },
}

View File

@ -9,7 +9,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-linux-gnu".to_string(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
}

View File

@ -9,7 +9,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-linux-musl".to_string(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
}