[clang] [CIR] floating-point, pointer, and function types (PR #120484)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 19 09:49:22 PST 2024
================
@@ -63,13 +153,71 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
cir::IntType::get(&getMLIRContext(), astContext.getTypeSize(ty),
/*isSigned=*/false);
break;
+
+ // Floating-point types
+ case BuiltinType::Float16:
+ resultType = cgm.FP16Ty;
+ break;
+ case BuiltinType::Half:
+ if (astContext.getLangOpts().NativeHalfType ||
+ !astContext.getTargetInfo().useFP16ConversionIntrinsics()) {
+ resultType = cgm.FP16Ty;
+ } else {
+ cgm.errorNYI(SourceLocation(), "processing of built-in type", type);
+ resultType = cgm.SInt32Ty;
+ }
+ break;
+ case BuiltinType::BFloat16:
+ resultType = cgm.BFloat16Ty;
+ break;
+ case BuiltinType::Float:
+ assert(&astContext.getFloatTypeSemantics(type) ==
+ &llvm::APFloat::IEEEsingle() &&
+ "ClangIR only supports float as IEEE 32-bit");
+ resultType = cgm.FloatTy;
+ break;
+ case BuiltinType::Double:
+ assert(&astContext.getFloatTypeSemantics(type) ==
----------------
bcardosolopes wrote:
If we know there are possible 32 bit doubles (given previous comment), this looks more like NYI?
https://github.com/llvm/llvm-project/pull/120484
More information about the cfe-commits
mailing list