================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits