aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2022-01-09 16:35:21 +0100
committerJakub Jelinek <jakub@redhat.com>2022-01-11 23:49:52 +0100
commit9840285d877c5820d75d1347fc2a4f176ab31b11 (patch)
treed26cdaba1d95d45635a068634a0b4285e3c1c813 /gcc
parente79f6e61d5849408c3137dbfa5d49e7066f9df7b (diff)
downloadgcc-9840285d877c5820d75d1347fc2a4f176ab31b11.zip
gcc-9840285d877c5820d75d1347fc2a4f176ab31b11.tar.gz
gcc-9840285d877c5820d75d1347fc2a4f176ab31b11.tar.bz2
Implement CONVERT specifier for OPEN.
This patch, based on Jakub's work, implements the CONVERT specifier for the power-ieee128 brach. It allows specifying the conversion as r16_ieee,big_endian and the other way around, based on a table. Setting the conversion via environment variable and via program option does not yet work. gcc/ChangeLog: * flag-types.h (enum gfc_convert): Add flags for conversion. gcc/fortran/ChangeLog: * libgfortran.h (unit_convert): Add flags. libgfortran/ChangeLog: * Makefile.in: Regenerate. * io/file_pos.c (unformatted_backspace): Mask off R16 parts for convert. * io/inquire.c (inquire_via_unit): Add cases for R16 parts. * io/open.c (st_open): Add cases for R16 conversion. * io/transfer.c (unformatted_read): Adjust for R16 conversions. (unformatted_write): Likewise. (us_read): Mask of R16 bits. (data_transfer_init): Likewiese. (write_us_marker): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/flag-types.h10
-rw-r--r--gcc/fortran/libgfortran.h12
2 files changed, 19 insertions, 3 deletions
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index 649021f..d92c167 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -424,7 +424,15 @@ enum gfc_convert
GFC_FLAG_CONVERT_NATIVE = 0,
GFC_FLAG_CONVERT_SWAP,
GFC_FLAG_CONVERT_BIG,
- GFC_FLAG_CONVERT_LITTLE
+ GFC_FLAG_CONVERT_LITTLE,
+ GFC_FLAG_CONVERT_R16_IEEE = 4,
+ GFC_FLAG_CONVERT_R16_IEEE_SWAP,
+ GFC_FLAG_CONVERT_R16_IEEE_BIG,
+ GFC_FLAG_CONVERT_R16_IEEE_LITTLE,
+ GFC_FLAG_CONVERT_R16_IBM = 8,
+ GFC_FLAG_CONVERT_R16_IBM_SWAP,
+ GFC_FLAG_CONVERT_R16_IBM_BIG,
+ GFC_FLAG_CONVERT_R16_IBM_LITTLE,
};
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index 9055730..ddba41c 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -86,14 +86,22 @@ along with GCC; see the file COPYING3. If not see
#define GFC_INVALID_UNIT -3
/* Possible values for the CONVERT I/O specifier. */
-/* Keep in sync with GFC_FLAG_CONVERT_* in gcc/flags.h. */
+/* Keep in sync with GFC_FLAG_CONVERT_* in gcc/flag-types.h. */
typedef enum
{
GFC_CONVERT_NONE = -1,
GFC_CONVERT_NATIVE = 0,
GFC_CONVERT_SWAP,
GFC_CONVERT_BIG,
- GFC_CONVERT_LITTLE
+ GFC_CONVERT_LITTLE,
+ GFC_CONVERT_R16_IEEE = 4,
+ GFC_CONVERT_R16_IEEE_SWAP,
+ GFC_CONVERT_R16_IEEE_BIG,
+ GFC_CONVERT_R16_IEEE_LITTLE,
+ GFC_CONVERT_R16_IBM = 8,
+ GFC_CONVERT_R16_IBM_SWAP,
+ GFC_CONVERT_R16_IBM_BIG,
+ GFC_CONVERT_R16_IBM_LITTLE,
}
unit_convert;