diff --git a/flang/lib/Optimizer/Builder/Runtime/Numeric.cpp b/flang/lib/Optimizer/Builder/Runtime/Numeric.cpp --- a/flang/lib/Optimizer/Builder/Runtime/Numeric.cpp +++ b/flang/lib/Optimizer/Builder/Runtime/Numeric.cpp @@ -11,6 +11,7 @@ #include "flang/Optimizer/Builder/Character.h" #include "flang/Optimizer/Builder/FIRBuilder.h" #include "flang/Optimizer/Builder/Runtime/RTBuilder.h" +#include "flang/Optimizer/Builder/Todo.h" #include "flang/Runtime/numeric.h" #include "mlir/Dialect/Func/IR/FuncOps.h" @@ -212,7 +213,9 @@ mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - if (fltTy.isF32()) { + if (fltTy.isF16()) { + TODO(loc, "support for REAL with KIND = 2 in EXPONENT"); + } else if (fltTy.isF32()) { if (resultType.isInteger(32)) func = fir::runtime::getRuntimeFunc(loc, builder); else if (resultType.isInteger(64)) @@ -233,7 +236,7 @@ else if (resultType.isInteger(64)) func = fir::runtime::getRuntimeFunc(loc, builder); } else - fir::emitFatalError(loc, "unsupported real kind in Exponent lowering"); + fir::emitFatalError(loc, "unsupported REAL KIND in EXPONENT"); auto funcTy = func.getFunctionType(); llvm::SmallVector args = { @@ -247,8 +250,9 @@ mlir::Location loc, mlir::Value x) { mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - - if (fltTy.isF32()) + if (fltTy.isF16()) + TODO(loc, "support for REAL with KIND = 2 in FRACTION"); + else if (fltTy.isF32()) func = fir::runtime::getRuntimeFunc(loc, builder); else if (fltTy.isF64()) func = fir::runtime::getRuntimeFunc(loc, builder); @@ -257,7 +261,7 @@ else if (fltTy.isF128()) func = fir::runtime::getRuntimeFunc(loc, builder); else - fir::emitFatalError(loc, "unsupported real kind in Fraction lowering"); + fir::emitFatalError(loc, "unsupported real kind in FRACTION"); auto funcTy = func.getFunctionType(); llvm::SmallVector args = { @@ -273,7 +277,9 @@ mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - if (fltTy.isF32()) + if (fltTy.isF16()) + TODO(loc, "support for REAL with KIND = 2 in NEAREST"); + else if (fltTy.isF32()) func = fir::runtime::getRuntimeFunc(loc, builder); else if (fltTy.isF64()) func = fir::runtime::getRuntimeFunc(loc, builder); @@ -282,7 +288,7 @@ else if (fltTy.isF128()) func = fir::runtime::getRuntimeFunc(loc, builder); else - fir::emitFatalError(loc, "unsupported REAL kind in Nearest lowering"); + fir::emitFatalError(loc, "unsupported REAL kind in NEAREST"); auto funcTy = func.getFunctionType(); @@ -308,7 +314,9 @@ mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - if (fltTy.isF32()) + if (fltTy.isF16()) + TODO(loc, "support for REAL with KIND = 2 in RRSPACING"); + else if (fltTy.isF32()) func = fir::runtime::getRuntimeFunc(loc, builder); else if (fltTy.isF64()) func = fir::runtime::getRuntimeFunc(loc, builder); @@ -317,7 +325,7 @@ else if (fltTy.isF128()) func = fir::runtime::getRuntimeFunc(loc, builder); else - fir::emitFatalError(loc, "unsupported real kind in RRSpacing lowering"); + fir::emitFatalError(loc, "unsupported real kind in RRSPACING"); auto funcTy = func.getFunctionType(); llvm::SmallVector args = { @@ -333,7 +341,9 @@ mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - if (fltTy.isF32()) + if (fltTy.isF16()) + TODO(loc, "support for REAL with KIND = 2 in SCALE"); + else if (fltTy.isF32()) func = fir::runtime::getRuntimeFunc(loc, builder); else if (fltTy.isF64()) func = fir::runtime::getRuntimeFunc(loc, builder); @@ -342,7 +352,7 @@ else if (fltTy.isF128()) func = fir::runtime::getRuntimeFunc(loc, builder); else - fir::emitFatalError(loc, "unsupported REAL kind in Scale lowering"); + fir::emitFatalError(loc, "unsupported REAL kind in SCALE"); auto funcTy = func.getFunctionType(); auto args = fir::runtime::createArguments(builder, loc, funcTy, x, i); @@ -357,7 +367,9 @@ mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - if (fltTy.isF32()) + if (fltTy.isF16()) + TODO(loc, "support for REAL with KIND = 2 in FRACTION"); + else if (fltTy.isF32()) func = fir::runtime::getRuntimeFunc(loc, builder); else if (fltTy.isF64()) func = fir::runtime::getRuntimeFunc(loc, builder); @@ -366,7 +378,7 @@ else if (fltTy.isF128()) func = fir::runtime::getRuntimeFunc(loc, builder); else - fir::emitFatalError(loc, "unsupported real kind in Fraction lowering"); + fir::emitFatalError(loc, "unsupported real kind in FRACTION"); auto funcTy = func.getFunctionType(); auto args = fir::runtime::createArguments(builder, loc, funcTy, x, i); @@ -380,7 +392,9 @@ mlir::func::FuncOp func; mlir::Type fltTy = x.getType(); - if (fltTy.isF32()) + if (fltTy.isF16()) + TODO(loc, "support for REAL with KIND = 2 in SPACING"); + else if (fltTy.isF32()) func = fir::runtime::getRuntimeFunc(loc, builder); else if (fltTy.isF64()) func = fir::runtime::getRuntimeFunc(loc, builder); @@ -389,7 +403,7 @@ else if (fltTy.isF128()) func = fir::runtime::getRuntimeFunc(loc, builder); else - fir::emitFatalError(loc, "unsupported real kind in Spacing lowering"); + fir::emitFatalError(loc, "unsupported real kind in SPACING"); auto funcTy = func.getFunctionType(); llvm::SmallVector args = {