Add f16 and f128 support

This commit is contained in:
beetrees 2024-07-10 09:38:47 +01:00
parent da27b89ca5
commit d5db933f9d
No known key found for this signature in database
GPG key ID: 8791BD754191EBD6
28 changed files with 384 additions and 73 deletions

View file

@ -2622,6 +2622,13 @@ impl BuiltinType {
matches!(self.inner, hir_def::builtin_type::BuiltinType::Float(_))
}
pub fn is_f16(&self) -> bool {
matches!(
self.inner,
hir_def::builtin_type::BuiltinType::Float(hir_def::builtin_type::BuiltinFloat::F16)
)
}
pub fn is_f32(&self) -> bool {
matches!(
self.inner,
@ -2636,6 +2643,13 @@ impl BuiltinType {
)
}
pub fn is_f128(&self) -> bool {
matches!(
self.inner,
hir_def::builtin_type::BuiltinType::Float(hir_def::builtin_type::BuiltinFloat::F128)
)
}
pub fn is_char(&self) -> bool {
matches!(self.inner, hir_def::builtin_type::BuiltinType::Char)
}