@@ -2367,7 +2367,7 @@ mlir::Value IntrinsicLibrary::genAcosd(mlir::Type resultType,
2367
2367
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
2368
2368
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi );
2369
2369
mlir::Value dfactor = builder.createRealConstant (
2370
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
2370
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
2371
2371
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
2372
2372
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
2373
2373
return getRuntimeCallGenerator (" acos" , ftype)(builder, loc, {arg});
@@ -2518,7 +2518,7 @@ mlir::Value IntrinsicLibrary::genAsind(mlir::Type resultType,
2518
2518
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
2519
2519
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi );
2520
2520
mlir::Value dfactor = builder.createRealConstant (
2521
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
2521
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
2522
2522
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
2523
2523
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
2524
2524
return getRuntimeCallGenerator (" asin" , ftype)(builder, loc, {arg});
@@ -2544,7 +2544,7 @@ mlir::Value IntrinsicLibrary::genAtand(mlir::Type resultType,
2544
2544
}
2545
2545
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi );
2546
2546
mlir::Value dfactor = builder.createRealConstant (
2547
- loc, mlir::FloatType::getF64 (context), llvm::APFloat (180.0 ) / pi );
2547
+ loc, mlir::Float64Type::get (context), llvm::APFloat (180.0 ) / pi );
2548
2548
mlir::Value factor = builder.createConvert (loc, resultType, dfactor);
2549
2549
return builder.create <mlir::arith::MulFOp>(loc, atan , factor);
2550
2550
}
@@ -2569,7 +2569,7 @@ mlir::Value IntrinsicLibrary::genAtanpi(mlir::Type resultType,
2569
2569
}
2570
2570
llvm::APFloat inv_pi = llvm::APFloat (llvm::numbers::inv_pi);
2571
2571
mlir::Value dfactor =
2572
- builder.createRealConstant (loc, mlir::FloatType::getF64 (context), inv_pi);
2572
+ builder.createRealConstant (loc, mlir::Float64Type::get (context), inv_pi);
2573
2573
mlir::Value factor = builder.createConvert (loc, resultType, dfactor);
2574
2574
return builder.create <mlir::arith::MulFOp>(loc, atan , factor);
2575
2575
}
@@ -3124,7 +3124,7 @@ mlir::Value IntrinsicLibrary::genCosd(mlir::Type resultType,
3124
3124
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
3125
3125
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi );
3126
3126
mlir::Value dfactor = builder.createRealConstant (
3127
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
3127
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
3128
3128
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
3129
3129
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
3130
3130
return getRuntimeCallGenerator (" cos" , ftype)(builder, loc, {arg});
@@ -4418,12 +4418,12 @@ IntrinsicLibrary::genIeeeCopySign(mlir::Type resultType,
4418
4418
mlir::FloatType yRealType =
4419
4419
mlir::dyn_cast<mlir::FloatType>(yRealVal.getType ());
4420
4420
4421
- if (yRealType == mlir::FloatType::getBF16 (builder.getContext ())) {
4421
+ if (yRealType == mlir::BFloat16Type::get (builder.getContext ())) {
4422
4422
// Workaround: CopySignOp and BitcastOp don't work for kind 3 arg Y.
4423
4423
// This conversion should always preserve the sign bit.
4424
4424
yRealVal = builder.createConvert (
4425
- loc, mlir::FloatType::getF32 (builder.getContext ()), yRealVal);
4426
- yRealType = mlir::FloatType::getF32 (builder.getContext ());
4425
+ loc, mlir::Float32Type::get (builder.getContext ()), yRealVal);
4426
+ yRealType = mlir::Float32Type::get (builder.getContext ());
4427
4427
}
4428
4428
4429
4429
// Args have the same type.
@@ -4979,7 +4979,7 @@ mlir::Value IntrinsicLibrary::genIeeeReal(mlir::Type resultType,
4979
4979
4980
4980
assert (args.size () == 2 );
4981
4981
mlir::Type i1Ty = builder.getI1Type ();
4982
- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
4982
+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
4983
4983
mlir::Value a = args[0 ];
4984
4984
mlir::Type aType = a.getType ();
4985
4985
@@ -5179,7 +5179,7 @@ mlir::Value IntrinsicLibrary::genIeeeRem(mlir::Type resultType,
5179
5179
mlir::Value x = args[0 ];
5180
5180
mlir::Value y = args[1 ];
5181
5181
if (mlir::dyn_cast<mlir::FloatType>(resultType).getWidth () < 32 ) {
5182
- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
5182
+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
5183
5183
x = builder.create <fir::ConvertOp>(loc, f32Ty, x);
5184
5184
y = builder.create <fir::ConvertOp>(loc, f32Ty, y);
5185
5185
} else {
@@ -5213,7 +5213,7 @@ mlir::Value IntrinsicLibrary::genIeeeRint(mlir::Type resultType,
5213
5213
}
5214
5214
if (mlir::cast<mlir::FloatType>(resultType).getWidth () == 16 )
5215
5215
a = builder.create <fir::ConvertOp>(
5216
- loc, mlir::FloatType::getF32 (builder.getContext ()), a);
5216
+ loc, mlir::Float32Type::get (builder.getContext ()), a);
5217
5217
mlir::Value result = builder.create <fir::ConvertOp>(
5218
5218
loc, resultType, genRuntimeCall (" nearbyint" , a.getType (), a));
5219
5219
if (isStaticallyPresent (args[1 ])) {
@@ -5298,10 +5298,10 @@ mlir::Value IntrinsicLibrary::genIeeeSignbit(mlir::Type resultType,
5298
5298
mlir::Value realVal = args[0 ];
5299
5299
mlir::FloatType realType = mlir::dyn_cast<mlir::FloatType>(realVal.getType ());
5300
5300
int bitWidth = realType.getWidth ();
5301
- if (realType == mlir::FloatType::getBF16 (builder.getContext ())) {
5301
+ if (realType == mlir::BFloat16Type::get (builder.getContext ())) {
5302
5302
// Workaround: can't bitcast or convert real(3) to integer(2) or real(2).
5303
5303
realVal = builder.createConvert (
5304
- loc, mlir::FloatType::getF32 (builder.getContext ()), realVal);
5304
+ loc, mlir::Float32Type::get (builder.getContext ()), realVal);
5305
5305
bitWidth = 32 ;
5306
5306
}
5307
5307
mlir::Type intType = builder.getIntegerType (bitWidth);
@@ -6065,7 +6065,7 @@ mlir::Value IntrinsicLibrary::genModulo(mlir::Type resultType,
6065
6065
auto fastMathFlags = builder.getFastMathFlags ();
6066
6066
// F128 arith::RemFOp may be lowered to a runtime call that may be unsupported
6067
6067
// on the target, so generate a call to Fortran Runtime's ModuloReal16.
6068
- if (resultType == mlir::FloatType::getF128 (builder.getContext ()) ||
6068
+ if (resultType == mlir::Float128Type::get (builder.getContext ()) ||
6069
6069
(fastMathFlags & mlir::arith::FastMathFlags::ninf) ==
6070
6070
mlir::arith::FastMathFlags::none)
6071
6071
return builder.createConvert (
@@ -6254,7 +6254,7 @@ mlir::Value IntrinsicLibrary::genNearest(mlir::Type resultType,
6254
6254
mlir::FloatType yType = mlir::dyn_cast<mlir::FloatType>(args[1 ].getType ());
6255
6255
const unsigned yBitWidth = yType.getWidth ();
6256
6256
if (xType != yType) {
6257
- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
6257
+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
6258
6258
if (xBitWidth < 32 )
6259
6259
x1 = builder.createConvert (loc, f32Ty, x1);
6260
6260
if (yBitWidth > 32 && yBitWidth > xBitWidth)
@@ -7205,7 +7205,7 @@ mlir::Value IntrinsicLibrary::genSind(mlir::Type resultType,
7205
7205
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
7206
7206
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi );
7207
7207
mlir::Value dfactor = builder.createRealConstant (
7208
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
7208
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
7209
7209
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
7210
7210
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
7211
7211
return getRuntimeCallGenerator (" sin" , ftype)(builder, loc, {arg});
@@ -7286,7 +7286,7 @@ mlir::Value IntrinsicLibrary::genTand(mlir::Type resultType,
7286
7286
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
7287
7287
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi );
7288
7288
mlir::Value dfactor = builder.createRealConstant (
7289
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
7289
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
7290
7290
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
7291
7291
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
7292
7292
return getRuntimeCallGenerator (" tan" , ftype)(builder, loc, {arg});
0 commit comments