@@ -389,10 +389,10 @@ static constexpr IntrinsicHandler handlers[]{
389389 &I::genIeeeSignalingCompare<mlir::arith::CmpFPredicate::UNE>},
390390 {" ieee_signbit" , &I::genIeeeSignbit},
391391 {" ieee_support_flag" ,
392- &I::genIeeeSupportFlagOrHalting ,
392+ &I::genIeeeSupportFlag ,
393393 {{{" flag" , asValue}, {" x" , asInquired, handleDynamicOptional}}},
394394 /* isElemental=*/ false },
395- {" ieee_support_halting" , &I::genIeeeSupportFlagOrHalting },
395+ {" ieee_support_halting" , &I::genIeeeSupportHalting },
396396 {" ieee_support_rounding" , &I::genIeeeSupportRounding},
397397 {" ieee_unordered" , &I::genIeeeUnordered},
398398 {" ieee_value" , &I::genIeeeValue},
@@ -5259,14 +5259,14 @@ mlir::Value IntrinsicLibrary::genIeeeSignbit(mlir::Type resultType,
52595259 return builder.createConvert (loc, resultType, sign);
52605260}
52615261
5262- // IEEE_SUPPORT_FLAG, IEEE_SUPPORT_HALTING
5263- fir::ExtendedValue IntrinsicLibrary::genIeeeSupportFlagOrHalting (
5264- mlir::Type resultType, llvm::ArrayRef<fir::ExtendedValue> args) {
5265- // Check if a floating point exception or halting mode FLAG is supported.
5266- // An IEEE_SUPPORT_FLAG flag is supported either for all type kinds or none.
5267- // An optional kind argument X is therefore ignored.
5268- // Standard flags are all supported.
5269- // The nonstandard DENORM extension is not supported. (At least for now.)
5262+ // IEEE_SUPPORT_FLAG
5263+ fir::ExtendedValue
5264+ IntrinsicLibrary::genIeeeSupportFlag ( mlir::Type resultType,
5265+ llvm::ArrayRef<fir::ExtendedValue> args) {
5266+ // Check if a floating point exception flag is supported. A flag is
5267+ // supported either for all type kinds or none. An optional kind argument X
5268+ // is therefore ignored. Standard flags are all supported. The nonstandard
5269+ // DENORM extension is not supported, at least for now.
52705270 assert (args.size () == 1 || args.size () == 2 );
52715271 auto [fieldRef, fieldTy] = getFieldRef (builder, loc, fir::getBase (args[0 ]));
52725272 mlir::Value flag = builder.create <fir::LoadOp>(loc, fieldRef);
@@ -5283,6 +5283,22 @@ fir::ExtendedValue IntrinsicLibrary::genIeeeSupportFlagOrHalting(
52835283 builder.createIntegerConstant (loc, fieldTy, 0 )));
52845284}
52855285
5286+ // IEEE_SUPPORT_HALTING
5287+ fir::ExtendedValue IntrinsicLibrary::genIeeeSupportHalting (
5288+ mlir::Type resultType, llvm::ArrayRef<fir::ExtendedValue> args) {
5289+ // Check if halting is supported for a floating point exception flag.
5290+ // Standard flags are all supported. The nonstandard DENORM extension is
5291+ // not supported, at least for now.
5292+ assert (args.size () == 1 );
5293+ mlir::Type i32Ty = builder.getIntegerType (32 );
5294+ auto [fieldRef, ignore] = getFieldRef (builder, loc, getBase (args[0 ]));
5295+ mlir::Value field = builder.create <fir::LoadOp>(loc, fieldRef);
5296+ return builder.createConvert (
5297+ loc, resultType,
5298+ fir::runtime::genSupportHalting (
5299+ builder, loc, {builder.create <fir::ConvertOp>(loc, i32Ty, field)}));
5300+ }
5301+
52865302// IEEE_SUPPORT_ROUNDING
52875303mlir::Value
52885304IntrinsicLibrary::genIeeeSupportRounding (mlir::Type resultType,
0 commit comments