@@ -377,27 +377,27 @@ fn main() {
377
377
if !version. probe ( 83 , 2024 , 9 , 27 ) || needs_target_feature_fallback ( & version, None ) {
378
378
let target_endian =
379
379
env:: var ( "CARGO_CFG_TARGET_ENDIAN" ) . expect ( "CARGO_CFG_TARGET_ENDIAN not set" ) ;
380
- // powerpc64le is pwr8+ by default https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L702
380
+ // powerpc64le is pwr8 by default https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L702
381
381
// See also https://github.com/rust-lang/rust/issues/59932
382
- let mut has_pwr8_features = target_endian == "little" ;
383
- // https://github.com/llvm/llvm-project/commit/549e118e93c666914a1045fde38a2cac33e1e445
382
+ let mut pwr8_features = target_endian == "little" ;
384
383
if let Some ( cpu) = & target_cpu ( ) {
385
384
if let Some ( mut cpu_version) = strip_prefix ( cpu, "pwr" ) {
386
385
cpu_version = strip_suffix ( cpu_version, "x" ) . unwrap_or ( cpu_version) ; // for pwr5x and pwr6x
387
386
if let Ok ( cpu_version) = cpu_version. parse :: < u32 > ( ) {
388
- has_pwr8_features = cpu_version >= 8 ;
387
+ pwr8_features = cpu_version >= 8 ;
389
388
}
390
389
} else {
391
390
// https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L702
392
391
// https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L483
393
392
// On the minimum external LLVM version of the oldest rustc version which we can use asm_experimental_arch
394
393
// on this target (see CI config for more), "future" is based on pwr10 features.
395
394
// https://github.com/llvm/llvm-project/blob/llvmorg-12.0.0/llvm/lib/Target/PowerPC/PPC.td#L370
396
- has_pwr8_features = cpu == "ppc64le " || cpu == "future " ;
395
+ pwr8_features = cpu == "future " || cpu == "ppc64le " ;
397
396
}
398
397
}
398
+ // power8 features: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L409
399
399
// lqarx and stqcx.
400
- target_feature_fallback ( "quadword-atomics" , has_pwr8_features ) ;
400
+ target_feature_fallback ( "quadword-atomics" , pwr8_features ) ;
401
401
}
402
402
}
403
403
"s390x" => {
@@ -421,12 +421,14 @@ fn main() {
421
421
}
422
422
// As of rustc 1.80, target_feature "fast-serialization"/"load-store-on-cond"/"distinct-ops"/"miscellaneous-extensions-3" is not available on rustc side:
423
423
// https://github.com/rust-lang/rust/blob/1.80.0/compiler/rustc_target/src/target_features.rs
424
+ // arch9 features: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZFeatures.td#L103
424
425
// bcr 14,0
425
426
target_feature_fallback ( "fast-serialization" , arch9_features) ;
426
427
// {l,st}oc{,g}{,r}
427
428
target_feature_fallback ( "load-store-on-cond" , arch9_features) ;
428
429
// {al,sl,n,o,x}{,g}rk
429
430
target_feature_fallback ( "distinct-ops" , arch9_features) ;
431
+ // arch13 features: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZFeatures.td#L301
430
432
// nand (nnr{,g}k), select (sel{,g}r), etc.
431
433
target_feature_fallback ( "miscellaneous-extensions-3" , arch13_features) ;
432
434
}
0 commit comments