* [libgfortran, patch] Remove runtime TRANSPOSE support functions
@ 2016-12-19 14:32 FX
2016-12-19 15:42 ` Janne Blomqvist
0 siblings, 1 reply; 3+ messages in thread
From: FX @ 2016-12-19 14:32 UTC (permalink / raw)
To: GCC-Fortran-ML; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
Since 2010, gfortran does not rely on library support functions to handle TRANSPOSE, but instead emits code directly in the front-end (https://gcc.gnu.org/ml/fortran/2010-09/msg00109.html). We have since kept the various _gfortran_transpose_* functions in libgfortran for ABI compatbility, but we can now remove them.
Attached patch bootstrapped and regtested on x86_64-apple-darwin16.3.0.
OK to commit?
FX
[-- Attachment #2: transpose.ChangeLog --]
[-- Type: application/octet-stream, Size: 721 bytes --]
2016-12-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* Makefile.am: Remove intrinsics/transpose_generic.c,
generated/transpose_*.c and m4/transpose.m4.
* Makefile.in: Regenerate.
* gfortran.map: Remove _gfortran_transpose*.
* intrinsics/transpose_generic.c: Remove.
* m4/transpose.m4: Remove.
* generated/transpose_c10.c: Remove.
* generated/transpose_c16.c: Remove.
* generated/transpose_c4.c: Remove.
* generated/transpose_c8.c: Remove.
* generated/transpose_i16.c: Remove.
* generated/transpose_i4.c: Remove.
* generated/transpose_i8.c: Remove.
* generated/transpose_r10.c: Remove.
* generated/transpose_r16.c: Remove.
* generated/transpose_r4.c: Remove.
* generated/transpose_r8.c: Remove.
[-- Attachment #3: transpose.diff --]
[-- Type: application/octet-stream, Size: 56954 bytes --]
Index: Makefile.am
===================================================================
--- Makefile.am (revision 243794)
+++ Makefile.am (working copy)
@@ -139,7 +137,6 @@ intrinsics/reshape_generic.c \
intrinsics/reshape_packed.c \
intrinsics/selected_int_kind.f90 \
intrinsics/selected_real_kind.f90 \
-intrinsics/transpose_generic.c \
intrinsics/unpack_generic.c \
runtime/in_pack_generic.c \
runtime/in_unpack_generic.c
@@ -470,19 +467,6 @@ $(srcdir)/generated/matmul_l4.c \
$(srcdir)/generated/matmul_l8.c \
$(srcdir)/generated/matmul_l16.c
-i_transpose_c= \
-$(srcdir)/generated/transpose_i4.c \
-$(srcdir)/generated/transpose_i8.c \
-$(srcdir)/generated/transpose_i16.c \
-$(srcdir)/generated/transpose_r4.c \
-$(srcdir)/generated/transpose_r8.c \
-$(srcdir)/generated/transpose_r10.c \
-$(srcdir)/generated/transpose_r16.c \
-$(srcdir)/generated/transpose_c4.c \
-$(srcdir)/generated/transpose_c8.c \
-$(srcdir)/generated/transpose_c10.c \
-$(srcdir)/generated/transpose_c16.c
-
i_shape_c= \
$(srcdir)/generated/shape_i1.c \
$(srcdir)/generated/shape_i2.c \
@@ -683,7 +667,7 @@ m4_files= m4/iparm.m4 m4/ifunction.m4 m4
m4/matmul.m4 m4/matmull.m4 m4/ifunction_logical.m4 \
m4/ctrig.m4 m4/cexp.m4 m4/chyp.m4 m4/mtype.m4 \
m4/specific.m4 m4/specific2.m4 m4/head.m4 m4/shape.m4 m4/reshape.m4 \
- m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
+ m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \
m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \
m4/unpack.m4 m4/spread.m4 m4/bessel.m4 m4/norm2.m4 m4/parity.m4 \
@@ -693,7 +677,7 @@ gfor_built_src= $(i_all_c) $(i_any_c) $(
$(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \
$(i_product_c) $(i_sum_c) $(i_bessel_c) $(i_iall_c) $(i_iany_c) \
$(i_iparity_c) $(i_norm2_c) $(i_parity_c) \
- $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \
+ $(i_matmul_c) $(i_matmull_c) $(i_shape_c) $(i_eoshift1_c) \
$(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \
$(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
$(i_pow_c) $(i_rrspacing_c) $(i_spacing_c) $(i_pack_c) $(i_unpack_c) \
@@ -1000,9 +984,6 @@ $(i_norm2_c): m4/norm2.m4 $(I_M4_DEPS1)
$(i_parity_c): m4/parity.m4 $(I_M4_DEPS1)
$(M4) -Dfile=$@ -I$(srcdir)/m4 parity.m4 > $@
-$(i_transpose_c): m4/transpose.m4 $(I_M4_DEPS)
- $(M4) -Dfile=$@ -I$(srcdir)/m4 transpose.m4 > $@
-
$(i_shape_c): m4/shape.m4 $(I_M4_DEPS)
$(M4) -Dfile=$@ -I$(srcdir)/m4 shape.m4 > $@
Index: gfortran.map
===================================================================
--- gfortran.map (revision 243794)
+++ gfortran.map (working copy)
@@ -980,19 +980,6 @@ GFORTRAN_1.0 {
_gfortran_transfer_integer;
_gfortran_transfer_logical;
_gfortran_transfer_real;
- _gfortran_transpose;
- _gfortran_transpose_c10;
- _gfortran_transpose_c16;
- _gfortran_transpose_c4;
- _gfortran_transpose_c8;
- _gfortran_transpose_char;
- _gfortran_transpose_i16;
- _gfortran_transpose_i4;
- _gfortran_transpose_i8;
- _gfortran_transpose_r10;
- _gfortran_transpose_r16;
- _gfortran_transpose_r4;
- _gfortran_transpose_r8;
_gfortran_ttynam;
_gfortran_ttynam_sub;
_gfortran_umask_i4;
@@ -1088,7 +1054,6 @@ GFORTRAN_1.1 {
_gfortran_string_verify_char4;
_gfortran_st_wait;
_gfortran_transfer_character_wide;
- _gfortran_transpose_char4;
_gfortran_unpack0_char4;
_gfortran_unpack1_char4;
} GFORTRAN_1.0;
Index: intrinsics/transpose_generic.c
===================================================================
--- intrinsics/transpose_generic.c (revision 243794)
+++ intrinsics/transpose_generic.c (nonexistent)
@@ -1,151 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-extern void transpose (gfc_array_char *, gfc_array_char *);
-export_proto(transpose);
-
-static void
-transpose_internal (gfc_array_char *ret, gfc_array_char *source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- char *rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const char *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
- index_type size;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2
- && GFC_DESCRIPTOR_RANK (ret) == 2);
-
- size = GFC_DESCRIPTOR_SIZE(ret);
-
- if (ret->base_addr == NULL)
- {
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
- ret->offset = 0;
- }
- else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE_BYTES(source,0);
- systride = GFC_DESCRIPTOR_STRIDE_BYTES(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE_BYTES(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE_BYTES(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y = 0; y < ycount; y++)
- {
- for (x = 0; x < xcount; x++)
- {
- memcpy (rptr, sptr, size);
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-
-extern void transpose (gfc_array_char *, gfc_array_char *);
-export_proto(transpose);
-
-void
-transpose (gfc_array_char *ret, gfc_array_char *source)
-{
- transpose_internal (ret, source);
-}
-
-
-extern void transpose_char (gfc_array_char *, GFC_INTEGER_4,
- gfc_array_char *, GFC_INTEGER_4);
-export_proto(transpose_char);
-
-void
-transpose_char (gfc_array_char *ret,
- GFC_INTEGER_4 ret_length __attribute__((unused)),
- gfc_array_char *source,
- GFC_INTEGER_4 source_length __attribute__((unused)))
-{
- transpose_internal (ret, source);
-}
-
-
-extern void transpose_char4 (gfc_array_char *, GFC_INTEGER_4,
- gfc_array_char *, GFC_INTEGER_4);
-export_proto(transpose_char4);
-
-void
-transpose_char4 (gfc_array_char *ret,
- GFC_INTEGER_4 ret_length __attribute__((unused)),
- gfc_array_char *source,
- GFC_INTEGER_4 source_length __attribute__((unused)))
-{
- transpose_internal (ret, source);
-}
Index: m4/transpose.m4
===================================================================
--- m4/transpose.m4 (revision 243794)
+++ m4/transpose.m4 (nonexistent)
@@ -1,116 +0,0 @@
-`/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>'
-
-include(iparm.m4)dnl
-
-`#if defined (HAVE_'rtype_name`)
-
-extern void transpose_'rtype_code` ('rtype` * const restrict ret,
- 'rtype` * const restrict source);
-export_proto(transpose_'rtype_code`);
-
-void
-transpose_'rtype_code` ('rtype` * const restrict ret,
- 'rtype` * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- 'rtype_name` * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const 'rtype_name` *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof ('rtype_name`));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif'
Index: generated/transpose_c10.c
===================================================================
--- generated/transpose_c10.c (revision 243794)
+++ generated/transpose_c10.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_COMPLEX_10)
-
-extern void transpose_c10 (gfc_array_c10 * const restrict ret,
- gfc_array_c10 * const restrict source);
-export_proto(transpose_c10);
-
-void
-transpose_c10 (gfc_array_c10 * const restrict ret,
- gfc_array_c10 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_COMPLEX_10 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_COMPLEX_10 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_COMPLEX_10));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_c16.c
===================================================================
--- generated/transpose_c16.c (revision 243794)
+++ generated/transpose_c16.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_COMPLEX_16)
-
-extern void transpose_c16 (gfc_array_c16 * const restrict ret,
- gfc_array_c16 * const restrict source);
-export_proto(transpose_c16);
-
-void
-transpose_c16 (gfc_array_c16 * const restrict ret,
- gfc_array_c16 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_COMPLEX_16 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_COMPLEX_16 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_COMPLEX_16));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_c4.c
===================================================================
--- generated/transpose_c4.c (revision 243794)
+++ generated/transpose_c4.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_COMPLEX_4)
-
-extern void transpose_c4 (gfc_array_c4 * const restrict ret,
- gfc_array_c4 * const restrict source);
-export_proto(transpose_c4);
-
-void
-transpose_c4 (gfc_array_c4 * const restrict ret,
- gfc_array_c4 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_COMPLEX_4 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_COMPLEX_4 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_COMPLEX_4));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_c8.c
===================================================================
--- generated/transpose_c8.c (revision 243794)
+++ generated/transpose_c8.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_COMPLEX_8)
-
-extern void transpose_c8 (gfc_array_c8 * const restrict ret,
- gfc_array_c8 * const restrict source);
-export_proto(transpose_c8);
-
-void
-transpose_c8 (gfc_array_c8 * const restrict ret,
- gfc_array_c8 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_COMPLEX_8 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_COMPLEX_8 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_COMPLEX_8));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_i16.c
===================================================================
--- generated/transpose_i16.c (revision 243794)
+++ generated/transpose_i16.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_INTEGER_16)
-
-extern void transpose_i16 (gfc_array_i16 * const restrict ret,
- gfc_array_i16 * const restrict source);
-export_proto(transpose_i16);
-
-void
-transpose_i16 (gfc_array_i16 * const restrict ret,
- gfc_array_i16 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_INTEGER_16 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_INTEGER_16 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_INTEGER_16));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_i4.c
===================================================================
--- generated/transpose_i4.c (revision 243794)
+++ generated/transpose_i4.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_INTEGER_4)
-
-extern void transpose_i4 (gfc_array_i4 * const restrict ret,
- gfc_array_i4 * const restrict source);
-export_proto(transpose_i4);
-
-void
-transpose_i4 (gfc_array_i4 * const restrict ret,
- gfc_array_i4 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_INTEGER_4 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_INTEGER_4 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_INTEGER_4));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_i8.c
===================================================================
--- generated/transpose_i8.c (revision 243794)
+++ generated/transpose_i8.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_INTEGER_8)
-
-extern void transpose_i8 (gfc_array_i8 * const restrict ret,
- gfc_array_i8 * const restrict source);
-export_proto(transpose_i8);
-
-void
-transpose_i8 (gfc_array_i8 * const restrict ret,
- gfc_array_i8 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_INTEGER_8 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_INTEGER_8 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_INTEGER_8));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_r10.c
===================================================================
--- generated/transpose_r10.c (revision 243794)
+++ generated/transpose_r10.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_REAL_10)
-
-extern void transpose_r10 (gfc_array_r10 * const restrict ret,
- gfc_array_r10 * const restrict source);
-export_proto(transpose_r10);
-
-void
-transpose_r10 (gfc_array_r10 * const restrict ret,
- gfc_array_r10 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_REAL_10 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_REAL_10 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_REAL_10));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_r16.c
===================================================================
--- generated/transpose_r16.c (revision 243794)
+++ generated/transpose_r16.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_REAL_16)
-
-extern void transpose_r16 (gfc_array_r16 * const restrict ret,
- gfc_array_r16 * const restrict source);
-export_proto(transpose_r16);
-
-void
-transpose_r16 (gfc_array_r16 * const restrict ret,
- gfc_array_r16 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_REAL_16 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_REAL_16 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_REAL_16));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_r4.c
===================================================================
--- generated/transpose_r4.c (revision 243794)
+++ generated/transpose_r4.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_REAL_4)
-
-extern void transpose_r4 (gfc_array_r4 * const restrict ret,
- gfc_array_r4 * const restrict source);
-export_proto(transpose_r4);
-
-void
-transpose_r4 (gfc_array_r4 * const restrict ret,
- gfc_array_r4 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_REAL_4 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_REAL_4 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_REAL_4));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
Index: generated/transpose_r8.c
===================================================================
--- generated/transpose_r8.c (revision 243794)
+++ generated/transpose_r8.c (nonexistent)
@@ -1,115 +0,0 @@
-/* Implementation of the TRANSPOSE intrinsic
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- Contributed by Tobias Schlüter
-
-This file is part of the GNU Fortran runtime library (libgfortran).
-
-Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-Libgfortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#include "libgfortran.h"
-#include <assert.h>
-
-
-#if defined (HAVE_GFC_REAL_8)
-
-extern void transpose_r8 (gfc_array_r8 * const restrict ret,
- gfc_array_r8 * const restrict source);
-export_proto(transpose_r8);
-
-void
-transpose_r8 (gfc_array_r8 * const restrict ret,
- gfc_array_r8 * const restrict source)
-{
- /* r.* indicates the return array. */
- index_type rxstride, rystride;
- GFC_REAL_8 * restrict rptr;
- /* s.* indicates the source array. */
- index_type sxstride, systride;
- const GFC_REAL_8 *sptr;
-
- index_type xcount, ycount;
- index_type x, y;
-
- assert (GFC_DESCRIPTOR_RANK (source) == 2);
-
- if (ret->base_addr == NULL)
- {
- assert (GFC_DESCRIPTOR_RANK (ret) == 2);
- assert (ret->dtype == source->dtype);
-
- GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
- 1);
-
- GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
- GFC_DESCRIPTOR_EXTENT(source, 1));
-
- ret->base_addr = xmallocarray (size0 ((array_t *) ret),
- sizeof (GFC_REAL_8));
- ret->offset = 0;
- } else if (unlikely (compile_options.bounds_check))
- {
- index_type ret_extent, src_extent;
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 1: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
- src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
-
- if (src_extent != ret_extent)
- runtime_error ("Incorrect extent in return value of TRANSPOSE"
- " intrinsic in dimension 2: is %ld,"
- " should be %ld", (long int) src_extent,
- (long int) ret_extent);
-
- }
-
- sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
- systride = GFC_DESCRIPTOR_STRIDE(source,1);
- xcount = GFC_DESCRIPTOR_EXTENT(source,0);
- ycount = GFC_DESCRIPTOR_EXTENT(source,1);
-
- rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
- rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
-
- rptr = ret->base_addr;
- sptr = source->base_addr;
-
- for (y=0; y < ycount; y++)
- {
- for (x=0; x < xcount; x++)
- {
- *rptr = *sptr;
-
- sptr += sxstride;
- rptr += rystride;
- }
- sptr += systride - (sxstride * xcount);
- rptr += rxstride - (rystride * xcount);
- }
-}
-
-#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [libgfortran, patch] Remove runtime TRANSPOSE support functions
2016-12-19 14:32 [libgfortran, patch] Remove runtime TRANSPOSE support functions FX
@ 2016-12-19 15:42 ` Janne Blomqvist
2016-12-19 16:05 ` FX
0 siblings, 1 reply; 3+ messages in thread
From: Janne Blomqvist @ 2016-12-19 15:42 UTC (permalink / raw)
To: FX; +Cc: GCC-Fortran-ML, gcc-patches
On Mon, Dec 19, 2016 at 4:31 PM, FX <fxcoudert@gmail.com> wrote:
> Since 2010, gfortran does not rely on library support functions to handle TRANSPOSE, but instead emits code directly in the front-end (https://gcc.gnu.org/ml/fortran/2010-09/msg00109.html). We have since kept the various _gfortran_transpose_* functions in libgfortran for ABI compatbility, but we can now remove them.
>
> Attached patch bootstrapped and regtested on x86_64-apple-darwin16.3.0.
> OK to commit?
No, this was actually part of r243799 which I just committed (after
you Ok'd it. :) )
--
Janne Blomqvist
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-19 15:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 14:32 [libgfortran, patch] Remove runtime TRANSPOSE support functions FX
2016-12-19 15:42 ` Janne Blomqvist
2016-12-19 16:05 ` FX
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).