[flang-commits] [flang] [flang][runtime] Support NORM2 for REAL(16) with FortranFloat128Math lib. (PR #83219)

via flang-commits flang-commits at lists.llvm.org
Wed Feb 28 07:08:40 PST 2024


================
@@ -149,6 +149,22 @@ struct ForcedNorm2Real16 {
   }
 };
 
+/// Placeholder for real*16 version of Norm2Dim Intrinsic
+struct ForcedNorm2DimReal16 {
+  static constexpr const char *name = ExpandAndQuoteKey(RTNAME(Norm2DimReal16));
+  static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
+    return [](mlir::MLIRContext *ctx) {
+      auto boxTy =
+          fir::runtime::getModel<const Fortran::runtime::Descriptor &>()(ctx);
+      auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
+      auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
----------------
jeanPerier wrote:

I would advise using `fir::runtime::getModel<const char*>` and `fir::runtime::getModel<int>` for `strTy` and `intTy` too to make any future work enabling cross compilation easier/centralize the work.

If this is the way it is done for other Forced... helper, you can keep it that way and we should update all usages in one go.

https://github.com/llvm/llvm-project/pull/83219


More information about the flang-commits mailing list