File tree 3 files changed +13
-8
lines changed
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>(
154
154
target_data_layout = target_data_layout. replace ( "-p10:8:8-p20:8:8" , "" ) ;
155
155
}
156
156
}
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
+ }
157
162
158
163
// Ensure the data-layout values hardcoded remain the defaults.
159
164
if sess. target . is_builtin {
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ pub fn target() -> Target {
6
6
base. endian = Endian :: Big ;
7
7
// z10 is the oldest CPU supported by LLVM
8
8
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 .
12
12
base. features = "-vector" . into ( ) ;
13
13
base. max_atomic_width = Some ( 64 ) ;
14
14
base. min_global_align = Some ( 16 ) ;
@@ -17,7 +17,7 @@ pub fn target() -> Target {
17
17
Target {
18
18
llvm_target : "s390x-unknown-linux-gnu" . into ( ) ,
19
19
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 ( ) ,
21
21
arch : "s390x" . into ( ) ,
22
22
options : base,
23
23
}
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ pub fn target() -> Target {
6
6
base. endian = Endian :: Big ;
7
7
// z10 is the oldest CPU supported by LLVM
8
8
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 .
12
12
base. features = "-vector" . into ( ) ;
13
13
base. max_atomic_width = Some ( 64 ) ;
14
14
base. min_global_align = Some ( 16 ) ;
@@ -18,7 +18,7 @@ pub fn target() -> Target {
18
18
Target {
19
19
llvm_target : "s390x-unknown-linux-musl" . into ( ) ,
20
20
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 ( ) ,
22
22
arch : "s390x" . into ( ) ,
23
23
options : base,
24
24
}
You can’t perform that action at this time.
0 commit comments