1
Fork 0

Auto merge of #121728 - tgross35:f16-f128-step1-ty-updates, r=compiler-errors

Add stubs in IR and ABI for `f16` and `f128`

This is the very first step toward the changes in https://github.com/rust-lang/rust/pull/114607 and the [`f16` and `f128` RFC](https://rust-lang.github.io/rfcs/3453-f16-and-f128.html). It adds the types to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`, and just propagates those out as `unimplemented!` stubs where necessary.

These types do not parse yet so there is no feature gate, and it should be okay to use `unimplemented!`.

The next steps will probably be AST support with parsing and the feature gate.

r? `@compiler-errors`
cc `@Nilstrieb` suggested breaking the PR up in https://github.com/rust-lang/rust/pull/120645#issuecomment-1925900572
This commit is contained in:
bors 2024-03-01 03:36:11 +00:00
commit 6cbf0926d5
37 changed files with 233 additions and 14 deletions

View file

@ -59,7 +59,7 @@ where
_ => return Err(CannotUseFpConv),
}
}
abi::F32 | abi::F64 => {
abi::F16 | abi::F32 | abi::F64 | abi::F128 => {
if arg_layout.size.bits() > flen {
return Err(CannotUseFpConv);
}

View file

@ -412,7 +412,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
Abi::Scalar(scalar) => {
let kind = match scalar.primitive() {
abi::Int(..) | abi::Pointer(_) => RegKind::Integer,
abi::F32 | abi::F64 => RegKind::Float,
abi::F16 | abi::F32 | abi::F64 | abi::F128 => RegKind::Float,
};
Ok(HomogeneousAggregate::Homogeneous(Reg { kind, size: self.size }))
}

View file

@ -65,7 +65,7 @@ where
_ => return Err(CannotUseFpConv),
}
}
abi::F32 | abi::F64 => {
abi::F16 | abi::F32 | abi::F64 | abi::F128 => {
if arg_layout.size.bits() > flen {
return Err(CannotUseFpConv);
}

View file

@ -51,7 +51,7 @@ where
Abi::Scalar(scalar) => match scalar.primitive() {
abi::Int(..) | abi::Pointer(_) => Class::Int,
abi::F32 | abi::F64 => Class::Sse,
abi::F16 | abi::F32 | abi::F64 | abi::F128 => Class::Sse,
},
Abi::Vector { .. } => Class::Sse,