@@ -1178,6 +1178,7 @@ impl Target {
11781178 // LLVM handles the rest.
11791179 FeatureConstraints { required : & [ "soft-float" ] , incompatible : & [ ] }
11801180 }
1181+ _ => unreachable ! ( ) ,
11811182 }
11821183 }
11831184 Arch :: X86_64 => {
@@ -1198,7 +1199,7 @@ impl Target {
11981199 // LLVM handles the rest.
11991200 FeatureConstraints { required : & [ "soft-float" ] , incompatible : & [ ] }
12001201 }
1201- Some ( r ) => panic ! ( "invalid Rust ABI for x86_64: {r:?}" ) ,
1202+ _ => unreachable ! ( ) ,
12021203 }
12031204 }
12041205 Arch :: Arm => {
@@ -1235,7 +1236,7 @@ impl Target {
12351236 // `FeatureConstraints` uses Rust feature names, hence only "neon" shows up.
12361237 FeatureConstraints { required : & [ "neon" ] , incompatible : & [ ] }
12371238 }
1238- Some ( r ) => panic ! ( "invalid Rust ABI for aarch64: {r:?}" ) ,
1239+ _ => unreachable ! ( ) ,
12391240 }
12401241 }
12411242 Arch :: RiscV32 | Arch :: RiscV64 => {
@@ -1312,17 +1313,32 @@ impl Target {
13121313 // llvm will switch to soft-float ABI just based on this feature.
13131314 FeatureConstraints { required : & [ "soft-float" ] , incompatible : & [ "vector" ] }
13141315 }
1315- Some ( r) => {
1316- panic ! ( "invalid Rust ABI for s390x: {r:?}" ) ;
1316+ _ => unreachable ! ( ) ,
1317+ }
1318+ }
1319+ Arch :: PowerPC => {
1320+ // The main ABI-relevant target features are "hard-float" and "spe". We use our own
1321+ // ABI indicator here.
1322+ match self . rustc_abi {
1323+ None => {
1324+ // Default hardfloat ABI.
1325+ FeatureConstraints { required : & [ "hard-float" ] , incompatible : & [ "spe" ] }
1326+ }
1327+ Some ( RustcAbi :: PowerPcSpe ) => {
1328+ // We reject "efpu2" since that seems to *disable* the f64 registers in
1329+ // LLVM, which seems likely to affect the ABI.
1330+ FeatureConstraints {
1331+ required : & [ "hard-float" , "spe" ] ,
1332+ incompatible : & [ "efpu2" ] ,
1333+ }
13171334 }
1335+ _ => unreachable ! ( ) ,
13181336 }
13191337 }
1320- Arch :: PowerPC | Arch :: PowerPC64 => {
1321- // The main ABI-relevant target features are "hard-float" and "spe". There is also
1322- // "efpu2" but that seems only relevant when "spe" is enabled. If we ever add a
1323- // soft-float variant, it looks like we have to mark "altivec" as incompatible --
1324- // unlike other targets, it looks like enabling "altivec" will have LLVM use
1325- // different registers for float types even if "hard-float" is off.
1338+ Arch :: PowerPC64 => {
1339+ // There's no SPE for PowerPC64, and we currently don't support any soft-float
1340+ // targets. (If we ever add one, we need to match on `RustcAbi::Softfloat` similar
1341+ // to other targets above.)
13261342 FeatureConstraints { required : & [ "hard-float" ] , incompatible : & [ "spe" ] }
13271343 }
13281344 Arch :: Avr => {
0 commit comments