================ @@ -229,6 +230,36 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APInt intVal); + + cir::ConstantOp getConstInt(mlir::Location loc, mlir::Type t, uint64_t c); + + mlir::Type getFPType(llvm::fltSemantics const &sem) { + switch (llvm::APFloat::SemanticsToEnum(sem)) { + case llvm::APFloat::S_IEEEhalf: + return cir::FP16Type::get(getContext(), typeCache.FP16Ty); + case llvm::APFloat::S_BFloat: + return cir::BF16Type::get(getContext(), typeCache.BFloat16Ty); + case llvm::APFloat::S_IEEEsingle: + return cir::SingleType::get(getContext(), typeCache.FloatTy); + case llvm::APFloat::S_IEEEdouble: + return cir::DoubleType::get(getContext(), typeCache.DoubleTy); + case llvm::APFloat::S_IEEEquad: + return cir::FP128Type::get(getContext(), typeCache.FP128Ty); + case llvm::APFloat::S_x87DoubleExtended: + return cir::FP80Type::get(getContext(), typeCache.FP80Ty); + default: + llvm_unreachable("Unrecognized floating semantics"); + } + } + + cir::ConstantOp getConstFP(mlir::Location loc, llvm::APFloat fpVal) { ---------------- erichkeane wrote:
This too? https://github.com/llvm/llvm-project/pull/142981 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits