[mlir][IR] Remove factory methods from FloatType
(#123026)
This commit removes convenience methods from `FloatType` to make it independent of concrete interface implementations. See discussion here: https://discourse.llvm.org/t/rethink-on-approach-to-low-precision-fp-types/82361 Note for LLVM integration: Replace `FloatType::getF32(` with `Float32Type::get(` etc.
This commit is contained in:
parent
f711aa9e5d
commit
f023da12d1
@ -320,7 +320,7 @@ constexpr TypeBuilderFunc getModel<unsigned long long>() {
|
||||
template <>
|
||||
constexpr TypeBuilderFunc getModel<double>() {
|
||||
return [](mlir::MLIRContext *context) -> mlir::Type {
|
||||
return mlir::FloatType::getF64(context);
|
||||
return mlir::Float64Type::get(context);
|
||||
};
|
||||
}
|
||||
template <>
|
||||
@ -347,11 +347,11 @@ constexpr TypeBuilderFunc getModel<long double>() {
|
||||
static_assert(size == 16 || size == 10 || size == 8,
|
||||
"unsupported long double size");
|
||||
if constexpr (size == 16)
|
||||
return mlir::FloatType::getF128(context);
|
||||
return mlir::Float128Type::get(context);
|
||||
if constexpr (size == 10)
|
||||
return mlir::FloatType::getF80(context);
|
||||
return mlir::Float80Type::get(context);
|
||||
if constexpr (size == 8)
|
||||
return mlir::FloatType::getF64(context);
|
||||
return mlir::Float64Type::get(context);
|
||||
llvm_unreachable("failed static assert");
|
||||
};
|
||||
}
|
||||
@ -369,7 +369,7 @@ constexpr TypeBuilderFunc getModel<const long double *>() {
|
||||
template <>
|
||||
constexpr TypeBuilderFunc getModel<float>() {
|
||||
return [](mlir::MLIRContext *context) -> mlir::Type {
|
||||
return mlir::FloatType::getF32(context);
|
||||
return mlir::Float32Type::get(context);
|
||||
};
|
||||
}
|
||||
template <>
|
||||
|
@ -36,17 +36,17 @@ static mlir::Type genRealType(mlir::MLIRContext *context, int kind) {
|
||||
Fortran::common::TypeCategory::Real, kind)) {
|
||||
switch (kind) {
|
||||
case 2:
|
||||
return mlir::FloatType::getF16(context);
|
||||
return mlir::Float16Type::get(context);
|
||||
case 3:
|
||||
return mlir::FloatType::getBF16(context);
|
||||
return mlir::BFloat16Type::get(context);
|
||||
case 4:
|
||||
return mlir::FloatType::getF32(context);
|
||||
return mlir::Float32Type::get(context);
|
||||
case 8:
|
||||
return mlir::FloatType::getF64(context);
|
||||
return mlir::Float64Type::get(context);
|
||||
case 10:
|
||||
return mlir::FloatType::getF80(context);
|
||||
return mlir::Float80Type::get(context);
|
||||
case 16:
|
||||
return mlir::FloatType::getF128(context);
|
||||
return mlir::Float128Type::get(context);
|
||||
}
|
||||
}
|
||||
llvm_unreachable("REAL type translation not implemented");
|
||||
|
@ -105,17 +105,17 @@ mlir::Type fir::FirOpBuilder::getVarLenSeqTy(mlir::Type eleTy, unsigned rank) {
|
||||
mlir::Type fir::FirOpBuilder::getRealType(int kind) {
|
||||
switch (kindMap.getRealTypeID(kind)) {
|
||||
case llvm::Type::TypeID::HalfTyID:
|
||||
return mlir::FloatType::getF16(getContext());
|
||||
return mlir::Float16Type::get(getContext());
|
||||
case llvm::Type::TypeID::BFloatTyID:
|
||||
return mlir::FloatType::getBF16(getContext());
|
||||
return mlir::BFloat16Type::get(getContext());
|
||||
case llvm::Type::TypeID::FloatTyID:
|
||||
return mlir::FloatType::getF32(getContext());
|
||||
return mlir::Float32Type::get(getContext());
|
||||
case llvm::Type::TypeID::DoubleTyID:
|
||||
return mlir::FloatType::getF64(getContext());
|
||||
return mlir::Float64Type::get(getContext());
|
||||
case llvm::Type::TypeID::X86_FP80TyID:
|
||||
return mlir::FloatType::getF80(getContext());
|
||||
return mlir::Float80Type::get(getContext());
|
||||
case llvm::Type::TypeID::FP128TyID:
|
||||
return mlir::FloatType::getF128(getContext());
|
||||
return mlir::Float128Type::get(getContext());
|
||||
default:
|
||||
fir::emitFatalError(mlir::UnknownLoc::get(getContext()),
|
||||
"unsupported type !fir.real<kind>");
|
||||
|
@ -2367,7 +2367,7 @@ mlir::Value IntrinsicLibrary::genAcosd(mlir::Type resultType,
|
||||
mlir::FunctionType::get(context, {resultType}, {args[0].getType()});
|
||||
llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
|
||||
mlir::Value dfactor = builder.createRealConstant(
|
||||
loc, mlir::FloatType::getF64(context), pi / llvm::APFloat(180.0));
|
||||
loc, mlir::Float64Type::get(context), pi / llvm::APFloat(180.0));
|
||||
mlir::Value factor = builder.createConvert(loc, args[0].getType(), dfactor);
|
||||
mlir::Value arg = builder.create<mlir::arith::MulFOp>(loc, args[0], factor);
|
||||
return getRuntimeCallGenerator("acos", ftype)(builder, loc, {arg});
|
||||
@ -2518,7 +2518,7 @@ mlir::Value IntrinsicLibrary::genAsind(mlir::Type resultType,
|
||||
mlir::FunctionType::get(context, {resultType}, {args[0].getType()});
|
||||
llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
|
||||
mlir::Value dfactor = builder.createRealConstant(
|
||||
loc, mlir::FloatType::getF64(context), pi / llvm::APFloat(180.0));
|
||||
loc, mlir::Float64Type::get(context), pi / llvm::APFloat(180.0));
|
||||
mlir::Value factor = builder.createConvert(loc, args[0].getType(), dfactor);
|
||||
mlir::Value arg = builder.create<mlir::arith::MulFOp>(loc, args[0], factor);
|
||||
return getRuntimeCallGenerator("asin", ftype)(builder, loc, {arg});
|
||||
@ -2544,7 +2544,7 @@ mlir::Value IntrinsicLibrary::genAtand(mlir::Type resultType,
|
||||
}
|
||||
llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
|
||||
mlir::Value dfactor = builder.createRealConstant(
|
||||
loc, mlir::FloatType::getF64(context), llvm::APFloat(180.0) / pi);
|
||||
loc, mlir::Float64Type::get(context), llvm::APFloat(180.0) / pi);
|
||||
mlir::Value factor = builder.createConvert(loc, resultType, dfactor);
|
||||
return builder.create<mlir::arith::MulFOp>(loc, atan, factor);
|
||||
}
|
||||
@ -2569,7 +2569,7 @@ mlir::Value IntrinsicLibrary::genAtanpi(mlir::Type resultType,
|
||||
}
|
||||
llvm::APFloat inv_pi = llvm::APFloat(llvm::numbers::inv_pi);
|
||||
mlir::Value dfactor =
|
||||
builder.createRealConstant(loc, mlir::FloatType::getF64(context), inv_pi);
|
||||
builder.createRealConstant(loc, mlir::Float64Type::get(context), inv_pi);
|
||||
mlir::Value factor = builder.createConvert(loc, resultType, dfactor);
|
||||
return builder.create<mlir::arith::MulFOp>(loc, atan, factor);
|
||||
}
|
||||
@ -3124,7 +3124,7 @@ mlir::Value IntrinsicLibrary::genCosd(mlir::Type resultType,
|
||||
mlir::FunctionType::get(context, {resultType}, {args[0].getType()});
|
||||
llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
|
||||
mlir::Value dfactor = builder.createRealConstant(
|
||||
loc, mlir::FloatType::getF64(context), pi / llvm::APFloat(180.0));
|
||||
loc, mlir::Float64Type::get(context), pi / llvm::APFloat(180.0));
|
||||
mlir::Value factor = builder.createConvert(loc, args[0].getType(), dfactor);
|
||||
mlir::Value arg = builder.create<mlir::arith::MulFOp>(loc, args[0], factor);
|
||||
return getRuntimeCallGenerator("cos", ftype)(builder, loc, {arg});
|
||||
@ -4418,12 +4418,12 @@ IntrinsicLibrary::genIeeeCopySign(mlir::Type resultType,
|
||||
mlir::FloatType yRealType =
|
||||
mlir::dyn_cast<mlir::FloatType>(yRealVal.getType());
|
||||
|
||||
if (yRealType == mlir::FloatType::getBF16(builder.getContext())) {
|
||||
if (yRealType == mlir::BFloat16Type::get(builder.getContext())) {
|
||||
// Workaround: CopySignOp and BitcastOp don't work for kind 3 arg Y.
|
||||
// This conversion should always preserve the sign bit.
|
||||
yRealVal = builder.createConvert(
|
||||
loc, mlir::FloatType::getF32(builder.getContext()), yRealVal);
|
||||
yRealType = mlir::FloatType::getF32(builder.getContext());
|
||||
loc, mlir::Float32Type::get(builder.getContext()), yRealVal);
|
||||
yRealType = mlir::Float32Type::get(builder.getContext());
|
||||
}
|
||||
|
||||
// Args have the same type.
|
||||
@ -4979,7 +4979,7 @@ mlir::Value IntrinsicLibrary::genIeeeReal(mlir::Type resultType,
|
||||
|
||||
assert(args.size() == 2);
|
||||
mlir::Type i1Ty = builder.getI1Type();
|
||||
mlir::Type f32Ty = mlir::FloatType::getF32(builder.getContext());
|
||||
mlir::Type f32Ty = mlir::Float32Type::get(builder.getContext());
|
||||
mlir::Value a = args[0];
|
||||
mlir::Type aType = a.getType();
|
||||
|
||||
@ -5179,7 +5179,7 @@ mlir::Value IntrinsicLibrary::genIeeeRem(mlir::Type resultType,
|
||||
mlir::Value x = args[0];
|
||||
mlir::Value y = args[1];
|
||||
if (mlir::dyn_cast<mlir::FloatType>(resultType).getWidth() < 32) {
|
||||
mlir::Type f32Ty = mlir::FloatType::getF32(builder.getContext());
|
||||
mlir::Type f32Ty = mlir::Float32Type::get(builder.getContext());
|
||||
x = builder.create<fir::ConvertOp>(loc, f32Ty, x);
|
||||
y = builder.create<fir::ConvertOp>(loc, f32Ty, y);
|
||||
} else {
|
||||
@ -5213,7 +5213,7 @@ mlir::Value IntrinsicLibrary::genIeeeRint(mlir::Type resultType,
|
||||
}
|
||||
if (mlir::cast<mlir::FloatType>(resultType).getWidth() == 16)
|
||||
a = builder.create<fir::ConvertOp>(
|
||||
loc, mlir::FloatType::getF32(builder.getContext()), a);
|
||||
loc, mlir::Float32Type::get(builder.getContext()), a);
|
||||
mlir::Value result = builder.create<fir::ConvertOp>(
|
||||
loc, resultType, genRuntimeCall("nearbyint", a.getType(), a));
|
||||
if (isStaticallyPresent(args[1])) {
|
||||
@ -5298,10 +5298,10 @@ mlir::Value IntrinsicLibrary::genIeeeSignbit(mlir::Type resultType,
|
||||
mlir::Value realVal = args[0];
|
||||
mlir::FloatType realType = mlir::dyn_cast<mlir::FloatType>(realVal.getType());
|
||||
int bitWidth = realType.getWidth();
|
||||
if (realType == mlir::FloatType::getBF16(builder.getContext())) {
|
||||
if (realType == mlir::BFloat16Type::get(builder.getContext())) {
|
||||
// Workaround: can't bitcast or convert real(3) to integer(2) or real(2).
|
||||
realVal = builder.createConvert(
|
||||
loc, mlir::FloatType::getF32(builder.getContext()), realVal);
|
||||
loc, mlir::Float32Type::get(builder.getContext()), realVal);
|
||||
bitWidth = 32;
|
||||
}
|
||||
mlir::Type intType = builder.getIntegerType(bitWidth);
|
||||
@ -6065,7 +6065,7 @@ mlir::Value IntrinsicLibrary::genModulo(mlir::Type resultType,
|
||||
auto fastMathFlags = builder.getFastMathFlags();
|
||||
// F128 arith::RemFOp may be lowered to a runtime call that may be unsupported
|
||||
// on the target, so generate a call to Fortran Runtime's ModuloReal16.
|
||||
if (resultType == mlir::FloatType::getF128(builder.getContext()) ||
|
||||
if (resultType == mlir::Float128Type::get(builder.getContext()) ||
|
||||
(fastMathFlags & mlir::arith::FastMathFlags::ninf) ==
|
||||
mlir::arith::FastMathFlags::none)
|
||||
return builder.createConvert(
|
||||
@ -6254,7 +6254,7 @@ mlir::Value IntrinsicLibrary::genNearest(mlir::Type resultType,
|
||||
mlir::FloatType yType = mlir::dyn_cast<mlir::FloatType>(args[1].getType());
|
||||
const unsigned yBitWidth = yType.getWidth();
|
||||
if (xType != yType) {
|
||||
mlir::Type f32Ty = mlir::FloatType::getF32(builder.getContext());
|
||||
mlir::Type f32Ty = mlir::Float32Type::get(builder.getContext());
|
||||
if (xBitWidth < 32)
|
||||
x1 = builder.createConvert(loc, f32Ty, x1);
|
||||
if (yBitWidth > 32 && yBitWidth > xBitWidth)
|
||||
@ -7205,7 +7205,7 @@ mlir::Value IntrinsicLibrary::genSind(mlir::Type resultType,
|
||||
mlir::FunctionType::get(context, {resultType}, {args[0].getType()});
|
||||
llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
|
||||
mlir::Value dfactor = builder.createRealConstant(
|
||||
loc, mlir::FloatType::getF64(context), pi / llvm::APFloat(180.0));
|
||||
loc, mlir::Float64Type::get(context), pi / llvm::APFloat(180.0));
|
||||
mlir::Value factor = builder.createConvert(loc, args[0].getType(), dfactor);
|
||||
mlir::Value arg = builder.create<mlir::arith::MulFOp>(loc, args[0], factor);
|
||||
return getRuntimeCallGenerator("sin", ftype)(builder, loc, {arg});
|
||||
@ -7286,7 +7286,7 @@ mlir::Value IntrinsicLibrary::genTand(mlir::Type resultType,
|
||||
mlir::FunctionType::get(context, {resultType}, {args[0].getType()});
|
||||
llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
|
||||
mlir::Value dfactor = builder.createRealConstant(
|
||||
loc, mlir::FloatType::getF64(context), pi / llvm::APFloat(180.0));
|
||||
loc, mlir::Float64Type::get(context), pi / llvm::APFloat(180.0));
|
||||
mlir::Value factor = builder.createConvert(loc, args[0].getType(), dfactor);
|
||||
mlir::Value arg = builder.create<mlir::arith::MulFOp>(loc, args[0], factor);
|
||||
return getRuntimeCallGenerator("tan", ftype)(builder, loc, {arg});
|
||||
|
@ -1579,7 +1579,7 @@ PPCIntrinsicLibrary::genVecConvert(mlir::Type resultType,
|
||||
|
||||
return callOp.getResult(0);
|
||||
} else if (width == 64) {
|
||||
auto fTy{mlir::FloatType::getF64(context)};
|
||||
auto fTy{mlir::Float64Type::get(context)};
|
||||
auto ty{mlir::VectorType::get(2, fTy)};
|
||||
|
||||
// vec_vtf(arg1, arg2) = fmul(1.0 / (1 << arg2), llvm.sitofp(arg1))
|
||||
@ -1639,7 +1639,7 @@ PPCIntrinsicLibrary::genVecConvert(mlir::Type resultType,
|
||||
newArgs[0] =
|
||||
builder.create<fir::CallOp>(loc, funcOp, newArgs).getResult(0);
|
||||
auto fvf32Ty{newArgs[0].getType()};
|
||||
auto f32type{mlir::FloatType::getF32(context)};
|
||||
auto f32type{mlir::Float32Type::get(context)};
|
||||
auto mvf32Ty{mlir::VectorType::get(4, f32type)};
|
||||
newArgs[0] = builder.createConvert(loc, mvf32Ty, newArgs[0]);
|
||||
|
||||
@ -1949,7 +1949,7 @@ PPCIntrinsicLibrary::genVecLdCallGrp(mlir::Type resultType,
|
||||
fname = isBEVecElemOrderOnLE() ? "llvm.ppc.vsx.lxvd2x.be"
|
||||
: "llvm.ppc.vsx.lxvd2x";
|
||||
// llvm.ppc.altivec.lxvd2x* returns <2 x double>
|
||||
intrinResTy = mlir::VectorType::get(2, mlir::FloatType::getF64(context));
|
||||
intrinResTy = mlir::VectorType::get(2, mlir::Float64Type::get(context));
|
||||
} break;
|
||||
case VecOp::Xlw4:
|
||||
fname = isBEVecElemOrderOnLE() ? "llvm.ppc.vsx.lxvw4x.be"
|
||||
@ -2092,7 +2092,7 @@ PPCIntrinsicLibrary::genVecPerm(mlir::Type resultType,
|
||||
auto mlirTy{vecTyInfo.toMlirVectorType(context)};
|
||||
|
||||
auto vi32Ty{mlir::VectorType::get(4, mlir::IntegerType::get(context, 32))};
|
||||
auto vf64Ty{mlir::VectorType::get(2, mlir::FloatType::getF64(context))};
|
||||
auto vf64Ty{mlir::VectorType::get(2, mlir::Float64Type::get(context))};
|
||||
|
||||
auto mArg0{builder.createConvert(loc, mlirTy, argBases[0])};
|
||||
auto mArg1{builder.createConvert(loc, mlirTy, argBases[1])};
|
||||
|
@ -27,7 +27,7 @@ struct ForcedErfcScaled10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ErfcScaled10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -38,7 +38,7 @@ struct ForcedErfcScaled16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ErfcScaled16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -49,7 +49,7 @@ struct ForcedExponent10_4 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Exponent10_4));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 32);
|
||||
return mlir::FunctionType::get(ctx, fltTy, intTy);
|
||||
};
|
||||
@ -60,7 +60,7 @@ struct ForcedExponent10_8 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Exponent10_8));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 64);
|
||||
return mlir::FunctionType::get(ctx, fltTy, intTy);
|
||||
};
|
||||
@ -72,7 +72,7 @@ struct ForcedExponent16_4 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Exponent16_4));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 32);
|
||||
return mlir::FunctionType::get(ctx, fltTy, intTy);
|
||||
};
|
||||
@ -83,7 +83,7 @@ struct ForcedExponent16_8 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Exponent16_8));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 64);
|
||||
return mlir::FunctionType::get(ctx, fltTy, intTy);
|
||||
};
|
||||
@ -95,7 +95,7 @@ struct ForcedFraction10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Fraction10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -106,7 +106,7 @@ struct ForcedFraction16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Fraction16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -117,7 +117,7 @@ struct ForcedMod10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ModReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
|
||||
return mlir::FunctionType::get(ctx, {fltTy, fltTy, strTy, intTy},
|
||||
@ -131,7 +131,7 @@ struct ForcedMod16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ModReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
|
||||
return mlir::FunctionType::get(ctx, {fltTy, fltTy, strTy, intTy},
|
||||
@ -145,7 +145,7 @@ struct ForcedModulo10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ModuloReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
|
||||
return mlir::FunctionType::get(ctx, {fltTy, fltTy, strTy, intTy},
|
||||
@ -159,7 +159,7 @@ struct ForcedModulo16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ModuloReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
|
||||
return mlir::FunctionType::get(ctx, {fltTy, fltTy, strTy, intTy},
|
||||
@ -173,7 +173,7 @@ struct ForcedNearest10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Nearest10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto boolTy = mlir::IntegerType::get(ctx, 1);
|
||||
return mlir::FunctionType::get(ctx, {fltTy, boolTy}, {fltTy});
|
||||
};
|
||||
@ -185,7 +185,7 @@ struct ForcedNearest16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Nearest16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto boolTy = mlir::IntegerType::get(ctx, 1);
|
||||
return mlir::FunctionType::get(ctx, {fltTy, boolTy}, {fltTy});
|
||||
};
|
||||
@ -197,7 +197,7 @@ struct ForcedRRSpacing10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(RRSpacing10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -208,7 +208,7 @@ struct ForcedRRSpacing16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(RRSpacing16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -219,7 +219,7 @@ struct ForcedScale10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Scale10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 64);
|
||||
return mlir::FunctionType::get(ctx, {fltTy, intTy}, {fltTy});
|
||||
};
|
||||
@ -231,7 +231,7 @@ struct ForcedScale16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Scale16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 64);
|
||||
return mlir::FunctionType::get(ctx, {fltTy, intTy}, {fltTy});
|
||||
};
|
||||
@ -243,7 +243,7 @@ struct ForcedSetExponent10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(SetExponent10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF80(ctx);
|
||||
auto fltTy = mlir::Float80Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 64);
|
||||
return mlir::FunctionType::get(ctx, {fltTy, intTy}, {fltTy});
|
||||
};
|
||||
@ -255,7 +255,7 @@ struct ForcedSetExponent16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(SetExponent16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto fltTy = mlir::FloatType::getF128(ctx);
|
||||
auto fltTy = mlir::Float128Type::get(ctx);
|
||||
auto intTy = mlir::IntegerType::get(ctx, 64);
|
||||
return mlir::FunctionType::get(ctx, {fltTy, intTy}, {fltTy});
|
||||
};
|
||||
@ -267,7 +267,7 @@ struct ForcedSpacing10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Spacing10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
@ -278,7 +278,7 @@ struct ForcedSpacing16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Spacing16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
return mlir::FunctionType::get(ctx, {ty}, {ty});
|
||||
};
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ struct ForcedMaxvalReal10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(MaxvalReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -43,7 +43,7 @@ struct ForcedMaxvalReal16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(MaxvalReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -94,7 +94,7 @@ struct ForcedMinvalReal10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(MinvalReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -110,7 +110,7 @@ struct ForcedMinvalReal16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(MinvalReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -173,7 +173,7 @@ struct ForcedNorm2Real10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Norm2_10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -188,7 +188,7 @@ struct ForcedNorm2Real16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Norm2_16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -219,7 +219,7 @@ struct ForcedProductReal10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ProductReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -235,7 +235,7 @@ struct ForcedProductReal16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(ProductReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -287,7 +287,7 @@ struct ForcedProductComplex10 {
|
||||
ExpandAndQuoteKey(RTNAME(CppProductComplex10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -305,7 +305,7 @@ struct ForcedProductComplex16 {
|
||||
ExpandAndQuoteKey(RTNAME(CppProductComplex16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -323,7 +323,7 @@ struct ForcedDotProductReal10 {
|
||||
ExpandAndQuoteKey(RTNAME(DotProductReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -339,7 +339,7 @@ struct ForcedDotProductReal16 {
|
||||
ExpandAndQuoteKey(RTNAME(DotProductReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -355,7 +355,7 @@ struct ForcedDotProductComplex10 {
|
||||
ExpandAndQuoteKey(RTNAME(CppDotProductComplex10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -373,7 +373,7 @@ struct ForcedDotProductComplex16 {
|
||||
ExpandAndQuoteKey(RTNAME(CppDotProductComplex16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -423,7 +423,7 @@ struct ForcedSumReal10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(SumReal10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -439,7 +439,7 @@ struct ForcedSumReal16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(SumReal16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -489,7 +489,7 @@ struct ForcedSumComplex10 {
|
||||
ExpandAndQuoteKey(RTNAME(CppSumComplex10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -507,7 +507,7 @@ struct ForcedSumComplex16 {
|
||||
ExpandAndQuoteKey(RTNAME(CppSumComplex16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -573,7 +573,7 @@ struct ForcedReduceReal10Ref {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal10Ref));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -593,7 +593,7 @@ struct ForcedReduceReal10Value {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal10Value));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -613,7 +613,7 @@ struct ForcedReduceReal16Ref {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal16Ref));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -633,7 +633,7 @@ struct ForcedReduceReal16Value {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal16Value));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -653,7 +653,7 @@ struct ForcedReduceReal10DimRef {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal10DimRef));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -675,7 +675,7 @@ struct ForcedReduceReal10DimValue {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal10DimValue));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -697,7 +697,7 @@ struct ForcedReduceReal16DimRef {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal16DimRef));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -719,7 +719,7 @@ struct ForcedReduceReal16DimValue {
|
||||
ExpandAndQuoteKey(RTNAME(ReduceReal16DimValue));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -911,7 +911,7 @@ struct ForcedReduceComplex10Ref {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex10Ref));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -932,7 +932,7 @@ struct ForcedReduceComplex10Value {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex10Value));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -953,7 +953,7 @@ struct ForcedReduceComplex10DimRef {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex10DimRef));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -975,7 +975,7 @@ struct ForcedReduceComplex10DimValue {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex10DimValue));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float80Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -997,7 +997,7 @@ struct ForcedReduceComplex16Ref {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex16Ref));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -1018,7 +1018,7 @@ struct ForcedReduceComplex16Value {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex16Value));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -1039,7 +1039,7 @@ struct ForcedReduceComplex16DimRef {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex16DimRef));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
@ -1061,7 +1061,7 @@ struct ForcedReduceComplex16DimValue {
|
||||
ExpandAndQuoteKey(RTNAME(CppReduceComplex16DimValue));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
|
||||
auto ty = mlir::ComplexType::get(mlir::Float128Type::get(ctx));
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto refTy = fir::ReferenceType::get(ty);
|
||||
|
@ -25,7 +25,7 @@ struct ForcedBesselJn_10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(BesselJn_10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -42,7 +42,7 @@ struct ForcedBesselJn_16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(BesselJn_16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -91,7 +91,7 @@ struct ForcedBesselYn_10 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(BesselYn_10));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF80(ctx);
|
||||
auto ty = mlir::Float80Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
@ -108,7 +108,7 @@ struct ForcedBesselYn_16 {
|
||||
static constexpr const char *name = ExpandAndQuoteKey(RTNAME(BesselYn_16));
|
||||
static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
|
||||
return [](mlir::MLIRContext *ctx) {
|
||||
auto ty = mlir::FloatType::getF128(ctx);
|
||||
auto ty = mlir::Float128Type::get(ctx);
|
||||
auto boxTy =
|
||||
fir::runtime::getModel<Fortran::runtime::Descriptor &>()(ctx);
|
||||
auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
|
||||
|
@ -572,12 +572,12 @@ struct TargetX86_64 : public GenericTarget<TargetX86_64> {
|
||||
// select an fp type of the right size, and it makes things simpler
|
||||
// here.
|
||||
if (partByteSize > 8)
|
||||
return mlir::FloatType::getF128(context);
|
||||
return mlir::Float128Type::get(context);
|
||||
if (partByteSize > 4)
|
||||
return mlir::FloatType::getF64(context);
|
||||
return mlir::Float64Type::get(context);
|
||||
if (partByteSize > 2)
|
||||
return mlir::FloatType::getF32(context);
|
||||
return mlir::FloatType::getF16(context);
|
||||
return mlir::Float32Type::get(context);
|
||||
return mlir::Float16Type::get(context);
|
||||
}
|
||||
assert(partByteSize <= 8 &&
|
||||
"expect integer part of aggregate argument to fit into eight bytes");
|
||||
|
@ -1249,17 +1249,17 @@ mlir::Type fir::fromRealTypeID(mlir::MLIRContext *context,
|
||||
llvm::Type::TypeID typeID, fir::KindTy kind) {
|
||||
switch (typeID) {
|
||||
case llvm::Type::TypeID::HalfTyID:
|
||||
return mlir::FloatType::getF16(context);
|
||||
return mlir::Float16Type::get(context);
|
||||
case llvm::Type::TypeID::BFloatTyID:
|
||||
return mlir::FloatType::getBF16(context);
|
||||
return mlir::BFloat16Type::get(context);
|
||||
case llvm::Type::TypeID::FloatTyID:
|
||||
return mlir::FloatType::getF32(context);
|
||||
return mlir::Float32Type::get(context);
|
||||
case llvm::Type::TypeID::DoubleTyID:
|
||||
return mlir::FloatType::getF64(context);
|
||||
return mlir::Float64Type::get(context);
|
||||
case llvm::Type::TypeID::X86_FP80TyID:
|
||||
return mlir::FloatType::getF80(context);
|
||||
return mlir::Float80Type::get(context);
|
||||
case llvm::Type::TypeID::FP128TyID:
|
||||
return mlir::FloatType::getF128(context);
|
||||
return mlir::Float128Type::get(context);
|
||||
default:
|
||||
mlir::emitError(mlir::UnknownLoc::get(context))
|
||||
<< "unsupported type: !fir.real<" << kind << ">";
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
helper = std::make_unique<fir::factory::Complex>(*firBuilder, loc);
|
||||
|
||||
// Init commonly used types
|
||||
realTy1 = mlir::FloatType::getF32(&context);
|
||||
realTy1 = mlir::Float32Type::get(&context);
|
||||
complexTy1 = mlir::ComplexType::get(realTy1);
|
||||
integerTy1 = mlir::IntegerType::get(&context, 32);
|
||||
|
||||
|
@ -146,7 +146,7 @@ TEST_F(FIRBuilderTest, createRealZeroConstant) {
|
||||
auto builder = getBuilder();
|
||||
auto ctx = builder.getContext();
|
||||
auto loc = builder.getUnknownLoc();
|
||||
auto realTy = mlir::FloatType::getF64(ctx);
|
||||
auto realTy = mlir::Float64Type::get(ctx);
|
||||
auto cst = builder.createRealZeroConstant(loc, realTy);
|
||||
EXPECT_TRUE(mlir::isa<arith::ConstantOp>(cst.getDefiningOp()));
|
||||
auto cstOp = dyn_cast<arith::ConstantOp>(cst.getDefiningOp());
|
||||
@ -434,7 +434,7 @@ TEST_F(FIRBuilderTest, createZeroValue) {
|
||||
auto intAttr = mlir::dyn_cast<mlir::IntegerAttr>(cst.getValue());
|
||||
EXPECT_TRUE(intAttr && intAttr.getInt() == 0);
|
||||
|
||||
mlir::Type f32Ty = mlir::FloatType::getF32(builder.getContext());
|
||||
mlir::Type f32Ty = mlir::Float32Type::get(builder.getContext());
|
||||
mlir::Value zeroFloat = fir::factory::createZeroValue(builder, loc, f32Ty);
|
||||
EXPECT_TRUE(zeroFloat.getType() == f32Ty);
|
||||
auto cst2 = mlir::dyn_cast_or_null<mlir::arith::ConstantOp>(
|
||||
@ -494,7 +494,7 @@ TEST_F(FIRBuilderTest, getBaseTypeOf) {
|
||||
return {scalars, arrays};
|
||||
};
|
||||
|
||||
auto f32Ty = mlir::FloatType::getF32(builder.getContext());
|
||||
auto f32Ty = mlir::Float32Type::get(builder.getContext());
|
||||
mlir::Type f32SeqTy = builder.getVarLenSeqTy(f32Ty);
|
||||
auto [f32Scalars, f32Arrays] = makeExv(f32Ty, f32SeqTy);
|
||||
for (const auto &scalar : f32Scalars) {
|
||||
@ -537,7 +537,7 @@ TEST_F(FIRBuilderTest, genArithFastMath) {
|
||||
auto ctx = builder.getContext();
|
||||
auto loc = builder.getUnknownLoc();
|
||||
|
||||
auto realTy = mlir::FloatType::getF32(ctx);
|
||||
auto realTy = mlir::Float32Type::get(ctx);
|
||||
auto arg = builder.create<fir::UndefOp>(loc, realTy);
|
||||
|
||||
// Test that FastMathFlags is 'none' by default.
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
TEST_F(HLFIRToolsTest, testScalarRoundTrip) {
|
||||
auto &builder = getBuilder();
|
||||
mlir::Location loc = getLoc();
|
||||
mlir::Type f32Type = mlir::FloatType::getF32(&context);
|
||||
mlir::Type f32Type = mlir::Float32Type::get(&context);
|
||||
mlir::Type scalarf32Type = builder.getRefType(f32Type);
|
||||
mlir::Value scalarf32Addr = builder.create<fir::UndefOp>(loc, scalarf32Type);
|
||||
fir::ExtendedValue scalarf32{scalarf32Addr};
|
||||
@ -82,7 +82,7 @@ TEST_F(HLFIRToolsTest, testArrayRoundTrip) {
|
||||
llvm::SmallVector<mlir::Value> lbounds{
|
||||
createConstant(-1), createConstant(-2)};
|
||||
|
||||
mlir::Type f32Type = mlir::FloatType::getF32(&context);
|
||||
mlir::Type f32Type = mlir::Float32Type::get(&context);
|
||||
mlir::Type seqf32Type = builder.getVarLenSeqTy(f32Type, 2);
|
||||
mlir::Type arrayf32Type = builder.getRefType(seqf32Type);
|
||||
mlir::Value arrayf32Addr = builder.create<fir::UndefOp>(loc, arrayf32Type);
|
||||
|
@ -227,7 +227,7 @@ TEST_F(FIRTypesTest, updateTypeForUnlimitedPolymorphic) {
|
||||
mlir::Type ptrArrNone = fir::PointerType::get(arrNone);
|
||||
|
||||
mlir::Type i32Ty = mlir::IntegerType::get(&context, 32);
|
||||
mlir::Type f32Ty = mlir::FloatType::getF32(&context);
|
||||
mlir::Type f32Ty = mlir::Float32Type::get(&context);
|
||||
mlir::Type l1Ty = fir::LogicalType::get(&context, 1);
|
||||
mlir::Type cplx32Ty = mlir::ComplexType::get(f32Ty);
|
||||
mlir::Type char1Ty = fir::CharacterType::get(&context, 1, 10);
|
||||
@ -268,12 +268,12 @@ TEST_F(FIRTypesTest, getTypeAsString) {
|
||||
fir::ReferenceType::get(mlir::IntegerType::get(&context, 32)),
|
||||
*kindMap));
|
||||
EXPECT_EQ(
|
||||
"f64", fir::getTypeAsString(mlir::FloatType::getF64(&context), *kindMap));
|
||||
"f64", fir::getTypeAsString(mlir::Float64Type::get(&context), *kindMap));
|
||||
EXPECT_EQ(
|
||||
"l8", fir::getTypeAsString(fir::LogicalType::get(&context, 1), *kindMap));
|
||||
EXPECT_EQ("z32",
|
||||
fir::getTypeAsString(
|
||||
mlir::ComplexType::get(mlir::FloatType::getF32(&context)), *kindMap));
|
||||
mlir::ComplexType::get(mlir::Float32Type::get(&context)), *kindMap));
|
||||
EXPECT_EQ("c8",
|
||||
fir::getTypeAsString(fir::CharacterType::get(&context, 1, 1), *kindMap));
|
||||
EXPECT_EQ("c8x10",
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
TEST_F(FortranVariableTest, SimpleScalar) {
|
||||
mlir::Location loc = getLoc();
|
||||
mlir::Type eleType = mlir::FloatType::getF32(&context);
|
||||
mlir::Type eleType = mlir::Float32Type::get(&context);
|
||||
mlir::Value addr = builder->create<fir::AllocaOp>(loc, eleType);
|
||||
auto name = mlir::StringAttr::get(&context, "x");
|
||||
auto declare = builder->create<fir::DeclareOp>(loc, addr.getType(), addr,
|
||||
@ -96,7 +96,7 @@ TEST_F(FortranVariableTest, CharacterScalar) {
|
||||
|
||||
TEST_F(FortranVariableTest, SimpleArray) {
|
||||
mlir::Location loc = getLoc();
|
||||
mlir::Type eleType = mlir::FloatType::getF32(&context);
|
||||
mlir::Type eleType = mlir::Float32Type::get(&context);
|
||||
llvm::SmallVector<mlir::Value> extents{
|
||||
createConstant(10), createConstant(20), createConstant(30)};
|
||||
fir::SequenceType::Shape typeShape(
|
||||
|
@ -31,7 +31,7 @@ TEST(RTBuilderTest, ComplexRuntimeInterface) {
|
||||
auto c99_cacosf_funcTy = mlir::cast<mlir::FunctionType>(c99_cacosf_signature);
|
||||
EXPECT_EQ(c99_cacosf_funcTy.getNumInputs(), 1u);
|
||||
EXPECT_EQ(c99_cacosf_funcTy.getNumResults(), 1u);
|
||||
auto cplx_ty = mlir::ComplexType::get(mlir::FloatType::getF32(&ctx));
|
||||
auto cplx_ty = mlir::ComplexType::get(mlir::Float32Type::get(&ctx));
|
||||
EXPECT_EQ(c99_cacosf_funcTy.getInput(0), cplx_ty);
|
||||
EXPECT_EQ(c99_cacosf_funcTy.getResult(0), cplx_ty);
|
||||
}
|
||||
|
@ -46,26 +46,6 @@ def FloatTypeInterface : TypeInterface<"FloatType"> {
|
||||
];
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
// Convenience factories.
|
||||
static FloatType getBF16(MLIRContext *ctx);
|
||||
static FloatType getF16(MLIRContext *ctx);
|
||||
static FloatType getF32(MLIRContext *ctx);
|
||||
static FloatType getTF32(MLIRContext *ctx);
|
||||
static FloatType getF64(MLIRContext *ctx);
|
||||
static FloatType getF80(MLIRContext *ctx);
|
||||
static FloatType getF128(MLIRContext *ctx);
|
||||
static FloatType getFloat8E5M2(MLIRContext *ctx);
|
||||
static FloatType getFloat8E4M3(MLIRContext *ctx);
|
||||
static FloatType getFloat8E4M3FN(MLIRContext *ctx);
|
||||
static FloatType getFloat8E5M2FNUZ(MLIRContext *ctx);
|
||||
static FloatType getFloat8E4M3FNUZ(MLIRContext *ctx);
|
||||
static FloatType getFloat8E4M3B11FNUZ(MLIRContext *ctx);
|
||||
static FloatType getFloat8E3M4(MLIRContext *ctx);
|
||||
static FloatType getFloat4E2M1FN(MLIRContext *ctx);
|
||||
static FloatType getFloat6E2M3FN(MLIRContext *ctx);
|
||||
static FloatType getFloat6E3M2FN(MLIRContext *ctx);
|
||||
static FloatType getFloat8E8M0FNU(MLIRContext *ctx);
|
||||
|
||||
/// Return the bitwidth of this float type.
|
||||
unsigned getWidth();
|
||||
|
||||
|
@ -401,78 +401,6 @@ inline bool BaseMemRefType::isValidElementType(Type type) {
|
||||
llvm::isa<MemRefElementTypeInterface>(type);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat4E2M1FN(MLIRContext *ctx) {
|
||||
return Float4E2M1FNType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat6E2M3FN(MLIRContext *ctx) {
|
||||
return Float6E2M3FNType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat6E3M2FN(MLIRContext *ctx) {
|
||||
return Float6E3M2FNType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E5M2(MLIRContext *ctx) {
|
||||
return Float8E5M2Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E4M3(MLIRContext *ctx) {
|
||||
return Float8E4M3Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E4M3FN(MLIRContext *ctx) {
|
||||
return Float8E4M3FNType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E5M2FNUZ(MLIRContext *ctx) {
|
||||
return Float8E5M2FNUZType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E4M3FNUZ(MLIRContext *ctx) {
|
||||
return Float8E4M3FNUZType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E4M3B11FNUZ(MLIRContext *ctx) {
|
||||
return Float8E4M3B11FNUZType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E3M4(MLIRContext *ctx) {
|
||||
return Float8E3M4Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getFloat8E8M0FNU(MLIRContext *ctx) {
|
||||
return Float8E8M0FNUType::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getBF16(MLIRContext *ctx) {
|
||||
return BFloat16Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getF16(MLIRContext *ctx) {
|
||||
return Float16Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getTF32(MLIRContext *ctx) {
|
||||
return FloatTF32Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getF32(MLIRContext *ctx) {
|
||||
return Float32Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getF64(MLIRContext *ctx) {
|
||||
return Float64Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getF80(MLIRContext *ctx) {
|
||||
return Float80Type::get(ctx);
|
||||
}
|
||||
|
||||
inline FloatType FloatType::getF128(MLIRContext *ctx) {
|
||||
return Float128Type::get(ctx);
|
||||
}
|
||||
|
||||
inline bool TensorType::classof(Type type) {
|
||||
return llvm::isa<RankedTensorType, UnrankedTensorType>(type);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ bool mlirTypeIsAFloat4E2M1FN(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat4E2M1FNTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat4E2M1FN(unwrap(ctx)));
|
||||
return wrap(Float4E2M1FNType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat6E2M3FNTypeGetTypeID() {
|
||||
@ -106,7 +106,7 @@ bool mlirTypeIsAFloat6E2M3FN(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat6E2M3FNTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat6E2M3FN(unwrap(ctx)));
|
||||
return wrap(Float6E2M3FNType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat6E3M2FNTypeGetTypeID() {
|
||||
@ -118,7 +118,7 @@ bool mlirTypeIsAFloat6E3M2FN(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat6E3M2FNTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat6E3M2FN(unwrap(ctx)));
|
||||
return wrap(Float6E3M2FNType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E5M2TypeGetTypeID() {
|
||||
@ -130,7 +130,7 @@ bool mlirTypeIsAFloat8E5M2(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E5M2TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E5M2(unwrap(ctx)));
|
||||
return wrap(Float8E5M2Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E4M3TypeGetTypeID() {
|
||||
@ -142,7 +142,7 @@ bool mlirTypeIsAFloat8E4M3(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E4M3TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E4M3(unwrap(ctx)));
|
||||
return wrap(Float8E4M3Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E4M3FNTypeGetTypeID() {
|
||||
@ -154,7 +154,7 @@ bool mlirTypeIsAFloat8E4M3FN(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E4M3FNTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E4M3FN(unwrap(ctx)));
|
||||
return wrap(Float8E4M3FNType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E5M2FNUZTypeGetTypeID() {
|
||||
@ -166,7 +166,7 @@ bool mlirTypeIsAFloat8E5M2FNUZ(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E5M2FNUZTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E5M2FNUZ(unwrap(ctx)));
|
||||
return wrap(Float8E5M2FNUZType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E4M3FNUZTypeGetTypeID() {
|
||||
@ -178,7 +178,7 @@ bool mlirTypeIsAFloat8E4M3FNUZ(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E4M3FNUZTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E4M3FNUZ(unwrap(ctx)));
|
||||
return wrap(Float8E4M3FNUZType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E4M3B11FNUZTypeGetTypeID() {
|
||||
@ -190,7 +190,7 @@ bool mlirTypeIsAFloat8E4M3B11FNUZ(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E4M3B11FNUZTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E4M3B11FNUZ(unwrap(ctx)));
|
||||
return wrap(Float8E4M3B11FNUZType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E3M4TypeGetTypeID() {
|
||||
@ -202,7 +202,7 @@ bool mlirTypeIsAFloat8E3M4(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E3M4TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E3M4(unwrap(ctx)));
|
||||
return wrap(Float8E3M4Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat8E8M0FNUTypeGetTypeID() {
|
||||
@ -214,7 +214,7 @@ bool mlirTypeIsAFloat8E8M0FNU(MlirType type) {
|
||||
}
|
||||
|
||||
MlirType mlirFloat8E8M0FNUTypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getFloat8E8M0FNU(unwrap(ctx)));
|
||||
return wrap(Float8E8M0FNUType::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirBFloat16TypeGetTypeID() {
|
||||
@ -224,7 +224,7 @@ MlirTypeID mlirBFloat16TypeGetTypeID() {
|
||||
bool mlirTypeIsABF16(MlirType type) { return unwrap(type).isBF16(); }
|
||||
|
||||
MlirType mlirBF16TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getBF16(unwrap(ctx)));
|
||||
return wrap(BFloat16Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat16TypeGetTypeID() { return wrap(Float16Type::getTypeID()); }
|
||||
@ -232,7 +232,7 @@ MlirTypeID mlirFloat16TypeGetTypeID() { return wrap(Float16Type::getTypeID()); }
|
||||
bool mlirTypeIsAF16(MlirType type) { return unwrap(type).isF16(); }
|
||||
|
||||
MlirType mlirF16TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getF16(unwrap(ctx)));
|
||||
return wrap(Float16Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloatTF32TypeGetTypeID() {
|
||||
@ -242,7 +242,7 @@ MlirTypeID mlirFloatTF32TypeGetTypeID() {
|
||||
bool mlirTypeIsATF32(MlirType type) { return unwrap(type).isTF32(); }
|
||||
|
||||
MlirType mlirTF32TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getTF32(unwrap(ctx)));
|
||||
return wrap(FloatTF32Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat32TypeGetTypeID() { return wrap(Float32Type::getTypeID()); }
|
||||
@ -250,7 +250,7 @@ MlirTypeID mlirFloat32TypeGetTypeID() { return wrap(Float32Type::getTypeID()); }
|
||||
bool mlirTypeIsAF32(MlirType type) { return unwrap(type).isF32(); }
|
||||
|
||||
MlirType mlirF32TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getF32(unwrap(ctx)));
|
||||
return wrap(Float32Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
MlirTypeID mlirFloat64TypeGetTypeID() { return wrap(Float64Type::getTypeID()); }
|
||||
@ -258,7 +258,7 @@ MlirTypeID mlirFloat64TypeGetTypeID() { return wrap(Float64Type::getTypeID()); }
|
||||
bool mlirTypeIsAF64(MlirType type) { return unwrap(type).isF64(); }
|
||||
|
||||
MlirType mlirF64TypeGet(MlirContext ctx) {
|
||||
return wrap(FloatType::getF64(unwrap(ctx)));
|
||||
return wrap(Float64Type::get(unwrap(ctx)));
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -35,62 +35,56 @@ Location Builder::getFusedLoc(ArrayRef<Location> locs, Attribute metadata) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
FloatType Builder::getFloat4E2M1FNType() {
|
||||
return FloatType::getFloat4E2M1FN(context);
|
||||
return Float4E2M1FNType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat6E2M3FNType() {
|
||||
return FloatType::getFloat6E2M3FN(context);
|
||||
return Float6E2M3FNType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat6E3M2FNType() {
|
||||
return FloatType::getFloat6E3M2FN(context);
|
||||
return Float6E3M2FNType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat8E5M2Type() {
|
||||
return FloatType::getFloat8E5M2(context);
|
||||
}
|
||||
FloatType Builder::getFloat8E5M2Type() { return Float8E5M2Type::get(context); }
|
||||
|
||||
FloatType Builder::getFloat8E4M3Type() {
|
||||
return FloatType::getFloat8E4M3(context);
|
||||
}
|
||||
FloatType Builder::getFloat8E4M3Type() { return Float8E4M3Type::get(context); }
|
||||
|
||||
FloatType Builder::getFloat8E4M3FNType() {
|
||||
return FloatType::getFloat8E4M3FN(context);
|
||||
return Float8E4M3FNType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat8E5M2FNUZType() {
|
||||
return FloatType::getFloat8E5M2FNUZ(context);
|
||||
return Float8E5M2FNUZType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat8E4M3FNUZType() {
|
||||
return FloatType::getFloat8E4M3FNUZ(context);
|
||||
return Float8E4M3FNUZType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat8E4M3B11FNUZType() {
|
||||
return FloatType::getFloat8E4M3B11FNUZ(context);
|
||||
return Float8E4M3B11FNUZType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getFloat8E3M4Type() {
|
||||
return FloatType::getFloat8E3M4(context);
|
||||
}
|
||||
FloatType Builder::getFloat8E3M4Type() { return Float8E3M4Type::get(context); }
|
||||
|
||||
FloatType Builder::getFloat8E8M0FNUType() {
|
||||
return FloatType::getFloat8E8M0FNU(context);
|
||||
return Float8E8M0FNUType::get(context);
|
||||
}
|
||||
|
||||
FloatType Builder::getBF16Type() { return FloatType::getBF16(context); }
|
||||
FloatType Builder::getBF16Type() { return BFloat16Type::get(context); }
|
||||
|
||||
FloatType Builder::getF16Type() { return FloatType::getF16(context); }
|
||||
FloatType Builder::getF16Type() { return Float16Type::get(context); }
|
||||
|
||||
FloatType Builder::getTF32Type() { return FloatType::getTF32(context); }
|
||||
FloatType Builder::getTF32Type() { return FloatTF32Type::get(context); }
|
||||
|
||||
FloatType Builder::getF32Type() { return FloatType::getF32(context); }
|
||||
FloatType Builder::getF32Type() { return Float32Type::get(context); }
|
||||
|
||||
FloatType Builder::getF64Type() { return FloatType::getF64(context); }
|
||||
FloatType Builder::getF64Type() { return Float64Type::get(context); }
|
||||
|
||||
FloatType Builder::getF80Type() { return FloatType::getF80(context); }
|
||||
FloatType Builder::getF80Type() { return Float80Type::get(context); }
|
||||
|
||||
FloatType Builder::getF128Type() { return FloatType::getF128(context); }
|
||||
FloatType Builder::getF128Type() { return Float128Type::get(context); }
|
||||
|
||||
IndexType Builder::getIndexType() { return IndexType::get(context); }
|
||||
|
||||
|
@ -117,23 +117,23 @@ FLOAT_TYPE_SEMANTICS(Float128Type, IEEEquad)
|
||||
|
||||
FloatType Float16Type::scaleElementBitwidth(unsigned scale) const {
|
||||
if (scale == 2)
|
||||
return FloatType::getF32(getContext());
|
||||
return Float32Type::get(getContext());
|
||||
if (scale == 4)
|
||||
return FloatType::getF64(getContext());
|
||||
return Float64Type::get(getContext());
|
||||
return FloatType();
|
||||
}
|
||||
|
||||
FloatType BFloat16Type::scaleElementBitwidth(unsigned scale) const {
|
||||
if (scale == 2)
|
||||
return FloatType::getF32(getContext());
|
||||
return Float32Type::get(getContext());
|
||||
if (scale == 4)
|
||||
return FloatType::getF64(getContext());
|
||||
return Float64Type::get(getContext());
|
||||
return FloatType();
|
||||
}
|
||||
|
||||
FloatType Float32Type::scaleElementBitwidth(unsigned scale) const {
|
||||
if (scale == 2)
|
||||
return FloatType::getF64(getContext());
|
||||
return Float64Type::get(getContext());
|
||||
return FloatType();
|
||||
}
|
||||
|
||||
|
@ -29,15 +29,15 @@ FloatType mlir::LLVM::detail::getFloatType(MLIRContext *context,
|
||||
unsigned width) {
|
||||
switch (width) {
|
||||
case 16:
|
||||
return FloatType::getF16(context);
|
||||
return Float16Type::get(context);
|
||||
case 32:
|
||||
return FloatType::getF32(context);
|
||||
return Float32Type::get(context);
|
||||
case 64:
|
||||
return FloatType::getF64(context);
|
||||
return Float64Type::get(context);
|
||||
case 80:
|
||||
return FloatType::getF80(context);
|
||||
return Float80Type::get(context);
|
||||
case 128:
|
||||
return FloatType::getF128(context);
|
||||
return Float128Type::get(context);
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
|
@ -816,7 +816,7 @@ static TypedAttr getScalarConstantAsAttr(OpBuilder &builder,
|
||||
llvm::Type *type = constFloat->getType();
|
||||
FloatType floatType =
|
||||
type->isBFloatTy()
|
||||
? FloatType::getBF16(context)
|
||||
? BFloat16Type::get(context)
|
||||
: LLVM::detail::getFloatType(context, type->getScalarSizeInBits());
|
||||
if (!floatType) {
|
||||
emitError(UnknownLoc::get(builder.getContext()))
|
||||
|
@ -101,8 +101,7 @@ void VectorizerTestPass::testVectorShapeRatio(llvm::raw_ostream &outs) {
|
||||
using affine::matcher::Op;
|
||||
SmallVector<int64_t, 8> shape(clTestVectorShapeRatio.begin(),
|
||||
clTestVectorShapeRatio.end());
|
||||
auto subVectorType =
|
||||
VectorType::get(shape, FloatType::getF32(f.getContext()));
|
||||
auto subVectorType = VectorType::get(shape, Float32Type::get(f.getContext()));
|
||||
// Only filter operations that operate on a strict super-vector and have one
|
||||
// return. This makes testing easier.
|
||||
auto filter = [&](Operation &op) {
|
||||
|
@ -1286,7 +1286,7 @@ struct TestTypeConverter : public TypeConverter {
|
||||
|
||||
// Convert I64 to F64.
|
||||
if (t.isSignlessInteger(64)) {
|
||||
results.push_back(FloatType::getF64(t.getContext()));
|
||||
results.push_back(Float64Type::get(t.getContext()));
|
||||
return success();
|
||||
}
|
||||
|
||||
@ -1298,7 +1298,7 @@ struct TestTypeConverter : public TypeConverter {
|
||||
|
||||
// Split F32 into F16,F16.
|
||||
if (t.isF32()) {
|
||||
results.assign(2, FloatType::getF16(t.getContext()));
|
||||
results.assign(2, Float16Type::get(t.getContext()));
|
||||
return success();
|
||||
}
|
||||
|
||||
@ -1826,7 +1826,7 @@ struct TestTypeConversionDriver
|
||||
return type;
|
||||
// Allow converting BF16/F16/F32 to F64.
|
||||
if (type.isBF16() || type.isF16() || type.isF32())
|
||||
return FloatType::getF64(type.getContext());
|
||||
return Float64Type::get(type.getContext());
|
||||
// Otherwise, the type is illegal.
|
||||
return nullptr;
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ struct PDLLTypeConverter : public TypeConverter {
|
||||
static LogicalResult convertType(Type t, SmallVectorImpl<Type> &results) {
|
||||
// Convert I64 to F64.
|
||||
if (t.isSignlessInteger(64)) {
|
||||
results.push_back(FloatType::getF64(t.getContext()));
|
||||
results.push_back(Float64Type::get(t.getContext()));
|
||||
return success();
|
||||
}
|
||||
|
||||
|
@ -107,15 +107,15 @@ std::optional<Type> recordToType(MLIRContext *ctx, const Record &predRec) {
|
||||
auto width = predRec.getValueAsInt("bitwidth");
|
||||
switch (width) {
|
||||
case 16:
|
||||
return FloatType::getF16(ctx);
|
||||
return Float16Type::get(ctx);
|
||||
case 32:
|
||||
return FloatType::getF32(ctx);
|
||||
return Float32Type::get(ctx);
|
||||
case 64:
|
||||
return FloatType::getF64(ctx);
|
||||
return Float64Type::get(ctx);
|
||||
case 80:
|
||||
return FloatType::getF80(ctx);
|
||||
return Float80Type::get(ctx);
|
||||
case 128:
|
||||
return FloatType::getF128(ctx);
|
||||
return Float128Type::get(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,39 +124,39 @@ std::optional<Type> recordToType(MLIRContext *ctx, const Record &predRec) {
|
||||
}
|
||||
|
||||
if (predRec.getName() == "BF16") {
|
||||
return FloatType::getBF16(ctx);
|
||||
return BFloat16Type::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "TF32") {
|
||||
return FloatType::getTF32(ctx);
|
||||
return FloatTF32Type::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E4M3FN") {
|
||||
return FloatType::getFloat8E4M3FN(ctx);
|
||||
return Float8E4M3FNType::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E5M2") {
|
||||
return FloatType::getFloat8E5M2(ctx);
|
||||
return Float8E5M2Type::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E4M3") {
|
||||
return FloatType::getFloat8E4M3(ctx);
|
||||
return Float8E4M3Type::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E4M3FNUZ") {
|
||||
return FloatType::getFloat8E4M3FNUZ(ctx);
|
||||
return Float8E4M3FNUZType::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E4M3B11FNUZ") {
|
||||
return FloatType::getFloat8E4M3B11FNUZ(ctx);
|
||||
return Float8E4M3B11FNUZType::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E5M2FNUZ") {
|
||||
return FloatType::getFloat8E5M2FNUZ(ctx);
|
||||
return Float8E5M2FNUZType::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.getName() == "F8E3M4") {
|
||||
return FloatType::getFloat8E3M4(ctx);
|
||||
return Float8E3M4Type::get(ctx);
|
||||
}
|
||||
|
||||
if (predRec.isSubClassOf("Complex")) {
|
||||
|
@ -154,7 +154,7 @@ TEST(DenseSplatTest, IntAttrSplat) {
|
||||
|
||||
TEST(DenseSplatTest, F32Splat) {
|
||||
MLIRContext context;
|
||||
FloatType floatTy = FloatType::getF32(&context);
|
||||
FloatType floatTy = Float32Type::get(&context);
|
||||
float value = 10.0;
|
||||
|
||||
testSplat(floatTy, value);
|
||||
@ -162,7 +162,7 @@ TEST(DenseSplatTest, F32Splat) {
|
||||
|
||||
TEST(DenseSplatTest, F64Splat) {
|
||||
MLIRContext context;
|
||||
FloatType floatTy = FloatType::getF64(&context);
|
||||
FloatType floatTy = Float64Type::get(&context);
|
||||
double value = 10.0;
|
||||
|
||||
testSplat(floatTy, APFloat(value));
|
||||
@ -170,7 +170,7 @@ TEST(DenseSplatTest, F64Splat) {
|
||||
|
||||
TEST(DenseSplatTest, FloatAttrSplat) {
|
||||
MLIRContext context;
|
||||
FloatType floatTy = FloatType::getF32(&context);
|
||||
FloatType floatTy = Float32Type::get(&context);
|
||||
Attribute value = FloatAttr::get(floatTy, 10.0);
|
||||
|
||||
testSplat(floatTy, value);
|
||||
@ -178,7 +178,7 @@ TEST(DenseSplatTest, FloatAttrSplat) {
|
||||
|
||||
TEST(DenseSplatTest, BF16Splat) {
|
||||
MLIRContext context;
|
||||
FloatType floatTy = FloatType::getBF16(&context);
|
||||
FloatType floatTy = BFloat16Type::get(&context);
|
||||
Attribute value = FloatAttr::get(floatTy, 10.0);
|
||||
|
||||
testSplat(floatTy, value);
|
||||
@ -204,7 +204,7 @@ TEST(DenseSplatTest, StringAttrSplat) {
|
||||
|
||||
TEST(DenseComplexTest, ComplexFloatSplat) {
|
||||
MLIRContext context;
|
||||
ComplexType complexType = ComplexType::get(FloatType::getF32(&context));
|
||||
ComplexType complexType = ComplexType::get(Float32Type::get(&context));
|
||||
std::complex<float> value(10.0, 15.0);
|
||||
testSplat(complexType, value);
|
||||
}
|
||||
@ -218,7 +218,7 @@ TEST(DenseComplexTest, ComplexIntSplat) {
|
||||
|
||||
TEST(DenseComplexTest, ComplexAPFloatSplat) {
|
||||
MLIRContext context;
|
||||
ComplexType complexType = ComplexType::get(FloatType::getF32(&context));
|
||||
ComplexType complexType = ComplexType::get(Float32Type::get(&context));
|
||||
std::complex<APFloat> value(APFloat(10.0f), APFloat(15.0f));
|
||||
testSplat(complexType, value);
|
||||
}
|
||||
@ -409,7 +409,7 @@ TEST(SparseElementsAttrTest, GetZero) {
|
||||
context.allowUnregisteredDialects();
|
||||
|
||||
IntegerType intTy = IntegerType::get(&context, 32);
|
||||
FloatType floatTy = FloatType::getF32(&context);
|
||||
FloatType floatTy = Float32Type::get(&context);
|
||||
Type stringTy = OpaqueType::get(StringAttr::get(&context, "test"), "string");
|
||||
|
||||
ShapedType tensorI32 = RankedTensorType::get({2, 2}, intTy);
|
||||
|
@ -24,7 +24,7 @@ TEST(ShapedTypeTest, CloneMemref) {
|
||||
MLIRContext context;
|
||||
|
||||
Type i32 = IntegerType::get(&context, 32);
|
||||
Type f32 = FloatType::getF32(&context);
|
||||
Type f32 = Float32Type::get(&context);
|
||||
Attribute memSpace = IntegerAttr::get(IntegerType::get(&context, 64), 7);
|
||||
Type memrefOriginalType = i32;
|
||||
llvm::SmallVector<int64_t> memrefOriginalShape({10, 20});
|
||||
@ -71,7 +71,7 @@ TEST(ShapedTypeTest, CloneTensor) {
|
||||
MLIRContext context;
|
||||
|
||||
Type i32 = IntegerType::get(&context, 32);
|
||||
Type f32 = FloatType::getF32(&context);
|
||||
Type f32 = Float32Type::get(&context);
|
||||
|
||||
Type tensorOriginalType = i32;
|
||||
llvm::SmallVector<int64_t> tensorOriginalShape({10, 20});
|
||||
@ -111,7 +111,7 @@ TEST(ShapedTypeTest, CloneVector) {
|
||||
MLIRContext context;
|
||||
|
||||
Type i32 = IntegerType::get(&context, 32);
|
||||
Type f32 = FloatType::getF32(&context);
|
||||
Type f32 = Float32Type::get(&context);
|
||||
|
||||
Type vectorOriginalType = i32;
|
||||
llvm::SmallVector<int64_t> vectorOriginalShape({10, 20});
|
||||
@ -134,7 +134,7 @@ TEST(ShapedTypeTest, CloneVector) {
|
||||
|
||||
TEST(ShapedTypeTest, VectorTypeBuilder) {
|
||||
MLIRContext context;
|
||||
Type f32 = FloatType::getF32(&context);
|
||||
Type f32 = Float32Type::get(&context);
|
||||
|
||||
SmallVector<int64_t> shape{2, 4, 8, 9, 1};
|
||||
SmallVector<bool> scalableDims{true, false, true, false, false};
|
||||
@ -192,7 +192,7 @@ TEST(ShapedTypeTest, VectorTypeBuilder) {
|
||||
|
||||
TEST(ShapedTypeTest, RankedTensorTypeBuilder) {
|
||||
MLIRContext context;
|
||||
Type f32 = FloatType::getF32(&context);
|
||||
Type f32 = Float32Type::get(&context);
|
||||
|
||||
SmallVector<int64_t> shape{2, 4, 8, 16, 32};
|
||||
RankedTensorType tensorType = RankedTensorType::get(shape, f32);
|
||||
@ -254,7 +254,7 @@ public:
|
||||
|
||||
TEST(ShapedTypeTest, RankedTensorTypeView) {
|
||||
MLIRContext context;
|
||||
Type f32 = FloatType::getF32(&context);
|
||||
Type f32 = Float32Type::get(&context);
|
||||
|
||||
Type noEncodingRankedTensorType = RankedTensorType::get({10, 20}, f32);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user