* [PATCH] fortran: Extend -fconvert= option for ppc64le r16_ieee and r16_ibm
@ 2022-01-22 0:51 Jakub Jelinek
2022-01-22 8:02 ` Thomas Koenig
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2022-01-22 0:51 UTC (permalink / raw)
To: Joseph S. Myers, Thomas Koenig; +Cc: gcc-patches, fortran
Hi!
This patch on top of the previously posted option handling changes patch
allows specifying -fconvert=swap,r16_ieee etc. (but will error on it
when not on powerpc64le because in the library such swapping is only
implemented for HAVE_REAL_17).
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2022-01-21 Jakub Jelinek <jakub@redhat.com>
* lang.opt (fconvert=): Add EnumSet property and mention also
r16_ieee and r16_ibm arguments.
(big-endian, little-endian, native, swap): Add Set(1) property.
(r16_ieee, r16_ibm): New EnumValue entries with Set(2) property.
* trans-types.cc (gfc_init_kinds): Emit gfc_fatal_error for
-fconvert=r16_ieee or -fconvert=r16_ibm when R16_IEEE <=> R16_IBM
conversions aren't supported.
--- gcc/fortran/lang.opt.jj 2022-01-11 23:49:52.167824673 +0100
+++ gcc/fortran/lang.opt 2022-01-21 15:15:15.494099716 +0100
@@ -421,23 +421,29 @@ Fortran
Produce a warning at runtime if a array temporary has been created for a procedure argument.
fconvert=
-Fortran RejectNegative Joined Enum(gfc_convert) Var(flag_convert) Init(GFC_FLAG_CONVERT_NATIVE)
--fconvert=<big-endian|little-endian|native|swap> The endianness used for unformatted files.
+Fortran RejectNegative Joined Enum(gfc_convert) EnumSet Var(flag_convert) Init(GFC_FLAG_CONVERT_NATIVE)
+-fconvert=<big-endian|little-endian|native|swap|r16_ieee|r16_ibm> The endianness used for unformatted files.
Enum
Name(gfc_convert) Type(enum gfc_convert) UnknownError(Unrecognized option to endianness value: %qs)
EnumValue
-Enum(gfc_convert) String(big-endian) Value(GFC_FLAG_CONVERT_BIG)
+Enum(gfc_convert) String(big-endian) Value(GFC_FLAG_CONVERT_BIG) Set(1)
EnumValue
-Enum(gfc_convert) String(little-endian) Value(GFC_FLAG_CONVERT_LITTLE)
+Enum(gfc_convert) String(little-endian) Value(GFC_FLAG_CONVERT_LITTLE) Set(1)
EnumValue
-Enum(gfc_convert) String(native) Value(GFC_FLAG_CONVERT_NATIVE)
+Enum(gfc_convert) String(native) Value(GFC_FLAG_CONVERT_NATIVE) Set(1)
EnumValue
-Enum(gfc_convert) String(swap) Value(GFC_FLAG_CONVERT_SWAP)
+Enum(gfc_convert) String(swap) Value(GFC_FLAG_CONVERT_SWAP) Set(1)
+
+EnumValue
+Enum(gfc_convert) String(r16_ieee) Value(GFC_FLAG_CONVERT_R16_IEEE) Set(2)
+
+EnumValue
+Enum(gfc_convert) String(r16_ibm) Value(GFC_FLAG_CONVERT_R16_IBM) Set(2)
fcray-pointer
Fortran Var(flag_cray_pointer)
--- gcc/fortran/trans-types.cc.jj 2022-01-18 11:58:59.579982099 +0100
+++ gcc/fortran/trans-types.cc 2022-01-21 20:26:29.438558960 +0100
@@ -527,6 +527,9 @@ gfc_init_kinds (void)
}
}
}
+ else if ((flag_convert & (GFC_CONVERT_R16_IEEE | GFC_CONVERT_R16_IBM)) != 0)
+ gfc_fatal_error ("%<-fconvert=r16_ieee%> or %<-fconvert=r16_ibm%> not "
+ "supported on this architecture");
/* Choose the default integer kind. We choose 4 unless the user directs us
otherwise. Even if the user specified that the default integer kind is 8,
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fortran: Extend -fconvert= option for ppc64le r16_ieee and r16_ibm
2022-01-22 0:51 [PATCH] fortran: Extend -fconvert= option for ppc64le r16_ieee and r16_ibm Jakub Jelinek
@ 2022-01-22 8:02 ` Thomas Koenig
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Koenig @ 2022-01-22 8:02 UTC (permalink / raw)
To: Jakub Jelinek, Joseph S. Myers; +Cc: gcc-patches, fortran
Hi Jakub,
> This patch on top of the previously posted option handling changes patch
> allows specifying -fconvert=swap,r16_ieee etc. (but will error on it
> when not on powerpc64le because in the library such swapping is only
> implemented for HAVE_REAL_17).
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK!
This is a much cleaner solution than what I had in mind, but didn't
start work on, which was to make the option into a string and parse
by hand.
Best regards
Thomas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-22 8:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 0:51 [PATCH] fortran: Extend -fconvert= option for ppc64le r16_ieee and r16_ibm Jakub Jelinek
2022-01-22 8:02 ` Thomas Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).