[flang-commits] [PATCH] D95387: [flang] Fix errors in ISO_FORTRAN_ENV module for REAL128

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jan 25 12:28:04 PST 2021


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Some parameters of 128-bit IEEE floating-point numbers were
incorrect, leading to a failure to define REAL128 to 16.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95387

Files:
  flang/module/iso_fortran_env.f90


Index: flang/module/iso_fortran_env.f90
===================================================================
--- flang/module/iso_fortran_env.f90
+++ flang/module/iso_fortran_env.f90
@@ -86,7 +86,7 @@
     selectedReal64 = selected_real_kind(15, 307), &   ! IEEE double
     selectedReal80 = selected_real_kind(18, 4931), &  ! 80x87 extended
     selectedReal64x2 = selected_real_kind(31, 307), & ! "double-double"
-    selectedReal128 = selected_real_kind(33, 9863), & ! IEEE quad
+    selectedReal128 = selected_real_kind(33, 4931), & ! IEEE quad
     safeReal16 = merge(selectedReal16, selected_real_kind(0,0), &
                        selectedReal16 >= 0), &
     safeBfloat16 = merge(selectedBfloat16, selected_real_kind(0,0), &
@@ -115,7 +115,7 @@
     real64x2 = merge(selectedReal64x2, merge(-2, -1, selectedReal64x2 >= 0), &
                      digits(real(0,kind=safeReal64x2)) == 106), &
     real128 = merge(selectedReal128, merge(-2, -1, selectedReal128 >= 0), &
-                    digits(real(0,kind=safeReal128)) == 112)
+                    digits(real(0,kind=safeReal128)) == 113)
 
   integer, parameter :: real_kinds(*) = [ &
     [(real16, integer :: j=1, count([real16 >= 0]))], &


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95387.319089.patch
Type: text/x-patch
Size: 1206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210125/ceee7f57/attachment.bin>


More information about the flang-commits mailing list