summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-19 15:42:55 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-19 15:42:55 +0000
commit983801291792e8c072469a24dd713002f2308d00 (patch)
tree370b9d6b0738999469c560cab3acf85bde3ceb2d /libgfortran/runtime
parentbb51041ccbf9da99fd8a86e85c77ac801be071bf (diff)
downloadgcc-983801291792e8c072469a24dd713002f2308d00.tar.gz
2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32972 * Makefile.am (in_pack_c): Add in_pack_i1.c, in_pack_i2.c, in_pack_r4.c, in_pack_r8.c, in_pack_r10.c and in_pack_r16.c. (in_unpack_c): Add in_unpack_i1.c, in_unpack_i2.c, in_unpack_r4.c, in_unpack_r8.c, in_unpack_r10.c and in_unpack_r16.c. * Makefile.in: Regenerate. * libgfortran.h: Add prototypes for internal_pack_1, internal_pack_2, internal_pack_16, internal_pack_r4, internal_pack_r8, internal_pack_r10, internal_pack_r16, internal_pack_c10 and internal_pack_c16. Add prototypes for internal_unpack_1, internal_unpack_2, internal_unpack_16, internal_unpack_r4, internal_unpack_r8, internal_unpack_r10, internal_unpack_r16, internal_unpack_c10 and internal_unpack_c16. * runtime/in_pack_generic.c (internal_pack): Use sizeof instead of hardwired sizes. Add calls to internal_pack_1, internal_pack_2, internal_pack_16, internal_pack_r4, internal_pack_r8, internal_pack_r10, internal_pack_r16, internal_pack_c10 and internal_pack_c16. * runtime/in_unpack_generic.c (internal_unpack): Use sizeof instead of hardwired sizes. Add calls to internal_unpack_1, internal_unpack_2, internal_unpack_16, internal_unpack_r4, internal_unpack_r8, internal_unpack_r10, internal_unpack_r16, internal_unpack_c10 and internal_unpack_c16. * generated/in_pack_r4.c: New file. * generated/in_pack_i2.c: New file. * generated/in_unpack_i1.c: New file. * generated/in_pack_r10.c: New file. * generated/in_unpack_r4.c: New file. * generated/in_unpack_i2.c: New file. * generated/in_unpack_r16.c: New file. * generated/in_pack_r8.c: New file. * generated/in_unpack_r10.c: New file. * generated/in_unpack_r8.c: New file. * generated/in_pack_r16.c: New file. * generated/in_pack_i1.c: New file. 2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 * gfortran.dg/internal_pack_1.f90: New test case. * gfortran.dg/internal_pack_2.f90: New test case. * gfortran.dg/internal_pack_3.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/in_pack_generic.c58
-rw-r--r--libgfortran/runtime/in_unpack_generic.c65
2 files changed, 107 insertions, 16 deletions
diff --git a/libgfortran/runtime/in_pack_generic.c b/libgfortran/runtime/in_pack_generic.c
index 59205ead999..ff02ec1d372 100644
--- a/libgfortran/runtime/in_pack_generic.c
+++ b/libgfortran/runtime/in_pack_generic.c
@@ -65,25 +65,65 @@ internal_pack (gfc_array_char * source)
{
case GFC_DTYPE_INTEGER:
case GFC_DTYPE_LOGICAL:
- case GFC_DTYPE_REAL:
switch (size)
{
- case 4:
- return internal_pack_4 ((gfc_array_i4 *)source);
+ case sizeof (GFC_INTEGER_1):
+ return internal_pack_1 ((gfc_array_i1 *) source);
+
+ case sizeof (GFC_INTEGER_2):
+ return internal_pack_2 ((gfc_array_i2 *) source);
+
+ case sizeof (GFC_INTEGER_4):
+ return internal_pack_4 ((gfc_array_i4 *) source);
- case 8:
- return internal_pack_8 ((gfc_array_i8 *)source);
+ case sizeof (GFC_INTEGER_8):
+ return internal_pack_8 ((gfc_array_i8 *) source);
+
+#if defined(HAVE_GFC_INTEGER_16)
+ case sizeof (GFC_INTEGER_16):
+ return internal_pack_16 (gfc_array_i16 *) source);
+#endif
}
break;
+ case GFC_DTYPE_REAL:
+ switch (size)
+ {
+ case sizeof (GFC_REAL_4):
+ return internal_pack_r4 ((gfc_array_r4 *) source);
+
+ case sizeof (GFC_REAL_8):
+ return internal_pack_r8 ((gfc_array_r8 *) source);
+
+#if defined (HAVE_GFC_REAL_10)
+ case sizeof (GFC_REAL_10):
+ return internal_pack_r10 ((gfc_array_r10 *) source);
+#endif
+
+#if defined (HAVE_GFC_REAL_16)
+ case sizeof (GFC_REAL_16):
+ return internal_pack_r16 ((gfc_array_r16 *) source);
+#endif
+ }
case GFC_DTYPE_COMPLEX:
switch (size)
{
- case 8:
- return internal_pack_c4 ((gfc_array_c4 *)source);
+ case sizeof (GFC_COMPLEX_4):
+ return internal_pack_c4 ((gfc_array_c4 *) source);
- case 16:
- return internal_pack_c8 ((gfc_array_c8 *)source);
+ case sizeof (GFC_COMPLEX_8):
+ return internal_pack_c8 ((gfc_array_c8 *) source);
+
+#if defined (HAVE_GFC_COMPLEX_10)
+ case sizeof (GFC_COMPLEX_10):
+ return internal_pack_c10 ((gfc_array_c10 *) source);
+#endif
+
+#if defined (HAVE_GFC_COMPLEX_16)
+ case sizeof (GFC_COMPLEX_16):
+ return internal_pack_c16 ((gfc_array_c16 *) source);
+#endif
+
}
break;
diff --git a/libgfortran/runtime/in_unpack_generic.c b/libgfortran/runtime/in_unpack_generic.c
index 25ab64f9c01..8b51fe92e72 100644
--- a/libgfortran/runtime/in_unpack_generic.c
+++ b/libgfortran/runtime/in_unpack_generic.c
@@ -62,29 +62,80 @@ internal_unpack (gfc_array_char * d, const void * s)
{
case GFC_DTYPE_INTEGER:
case GFC_DTYPE_LOGICAL:
- case GFC_DTYPE_REAL:
switch (size)
{
- case 4:
- internal_unpack_4 ((gfc_array_i4 *)d, (const GFC_INTEGER_4 *)s);
+ case sizeof (GFC_INTEGER_1):
+ internal_unpack_1 ((gfc_array_i1 *) d, (const GFC_INTEGER_1 *) s);
+ return;
+
+ case sizeof (GFC_INTEGER_2):
+ internal_unpack_2 ((gfc_array_i2 *) d, (const GFC_INTEGER_2 *) s);
+ return;
+
+ case sizeof (GFC_INTEGER_4):
+ internal_unpack_4 ((gfc_array_i4 *) d, (const GFC_INTEGER_4 *) s);
+ return;
+
+ case sizeof (GFC_INTEGER_8):
+ internal_unpack_8 ((gfc_array_i8 *) d, (const GFC_INTEGER_8 *) s);
return;
- case 8:
- internal_unpack_8 ((gfc_array_i8 *)d, (const GFC_INTEGER_8 *)s);
+#if defined (HAVE_GFC_INTEGER_16)
+ case sizeof (GFC_INTEGER_16):
+ internal_unpack_16 ((gfc_array_i16 *) d, (const GFC_INTEGER_16 *) s);
return;
+#endif
}
break;
+ case GFC_DTYPE_REAL:
+ switch (size)
+ {
+ case sizeof (GFC_REAL_4):
+ internal_unpack_r4 ((gfc_array_r4 *) d, (const GFC_REAL_4 *) s);
+ return;
+
+ case sizeof (GFC_REAL_8):
+ internal_unpack_r8 ((gfc_array_r8 *) d, (const GFC_REAL_8 *) s);
+ return;
+
+#if defined(HAVE_GFC_REAL_10)
+ case sizeof (GFC_REAL_10):
+ internal_unpack_r10 ((gfc_array_r10 *) d, (const GFC_REAL_10 *) s);
+ return;
+#endif
+
+#if defined(HAVE_GFC_REAL_16)
+ case sizeof (GFC_REAL_16):
+ internal_unpack_r16 ((gfc_array_r16 *) d, (const GFC_REAL_16 *) s);
+ return;
+#endif
+
+ }
+
case GFC_DTYPE_COMPLEX:
switch (size)
{
- case 8:
+ case sizeof (GFC_COMPLEX_4):
internal_unpack_c4 ((gfc_array_c4 *)d, (const GFC_COMPLEX_4 *)s);
return;
- case 16:
+ case sizeof (GFC_COMPLEX_8):
internal_unpack_c8 ((gfc_array_c8 *)d, (const GFC_COMPLEX_8 *)s);
return;
+
+#if defined(HAVE_GFC_COMPLEX_10)
+ case sizeof (GFC_COMPLEX_10):
+ internal_unpack_c10 ((gfc_array_c10 *) d, (const GFC_COMPLEX_10 *) s);
+ return;
+#endif
+
+#if defined(HAVE_GFC_COMPLEX_16)
+ case sizeof (GFC_COMPLEX_16):
+ internal_unpack_c16 ((gfc_array_c16 *) d, (const GFC_COMPLEX_16 *) s);
+ return;
+#endif
+
}
default:
break;