File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,11 @@ pub unsafe fn create_module<'ll>(
154154 target_data_layout = target_data_layout. replace ( "-p10:8:8-p20:8:8" , "" ) ;
155155 }
156156 }
157+ if llvm_version < ( 16 , 0 , 0 ) {
158+ if sess. target . arch == "s390x" {
159+ target_data_layout = target_data_layout. replace ( "-v128:64" , "" ) ;
160+ }
161+ }
157162
158163 // Ensure the data-layout values hardcoded remain the defaults.
159164 if sess. target . is_builtin {
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ pub fn target() -> Target {
66 base. endian = Endian :: Big ;
77 // z10 is the oldest CPU supported by LLVM
88 base. cpu = "z10" . into ( ) ;
9- // FIXME: The data_layout string below and the ABI implementation in
10- // cabi_s390x.rs are for now hard-coded to assume the no-vector ABI.
11- // Pass the -vector feature string to LLVM to respect this assumption .
9+ // FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
10+ // ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
11+ // also strip v128 from the data_layout below to match the older LLVM's expectation .
1212 base. features = "-vector" . into ( ) ;
1313 base. max_atomic_width = Some ( 64 ) ;
1414 base. min_global_align = Some ( 16 ) ;
@@ -17,7 +17,7 @@ pub fn target() -> Target {
1717 Target {
1818 llvm_target : "s390x-unknown-linux-gnu" . into ( ) ,
1919 pointer_width : 64 ,
20- data_layout : "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64" . into ( ) ,
20+ data_layout : "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64- a:8:16-n32:64" . into ( ) ,
2121 arch : "s390x" . into ( ) ,
2222 options : base,
2323 }
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ pub fn target() -> Target {
66 base. endian = Endian :: Big ;
77 // z10 is the oldest CPU supported by LLVM
88 base. cpu = "z10" . into ( ) ;
9- // FIXME: The data_layout string below and the ABI implementation in
10- // cabi_s390x.rs are for now hard-coded to assume the no-vector ABI.
11- // Pass the -vector feature string to LLVM to respect this assumption .
9+ // FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
10+ // ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
11+ // also strip v128 from the data_layout below to match the older LLVM's expectation .
1212 base. features = "-vector" . into ( ) ;
1313 base. max_atomic_width = Some ( 64 ) ;
1414 base. min_global_align = Some ( 16 ) ;
@@ -18,7 +18,7 @@ pub fn target() -> Target {
1818 Target {
1919 llvm_target : "s390x-unknown-linux-musl" . into ( ) ,
2020 pointer_width : 64 ,
21- data_layout : "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64" . into ( ) ,
21+ data_layout : "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64- a:8:16-n32:64" . into ( ) ,
2222 arch : "s390x" . into ( ) ,
2323 options : base,
2424 }
You can’t perform that action at this time.
0 commit comments