Use pointer sized array indices.

Using pointer sized variables (e.g. size_t / ptrdiff_t) when the
variables are used as array indices allows accessing larger arrays,
and can be a slight performance improvement due to no need for sign or
zero extending, or masking.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* generated/cshift1_16.c (cshift1): Regenerated.
	* generated/cshift1_4.c (cshift1): Regenerated.
	* generated/cshift1_8.c (cshift1): Regenerated.
	* generated/eoshift1_16.c (eoshift1): Regenerated.
	* generated/eoshift1_4.c (eoshift1): Regenerated.
	* generated/eoshift1_8.c (eoshift1): Regenerated.
	* generated/eoshift3_16.c (eoshift3): Regenerated.
	* generated/eoshift3_4.c (eoshift3): Regenerated.
	* generated/eoshift3_8.c (eoshift3): Regenerated.
	* generated/in_pack_c10.c (internal_pack_c10): Regenerated.
	* generated/in_pack_c16.c (internal_pack_c16): Regenerated.
	* generated/in_pack_c4.c (internal_pack_c4): Regenerated.
	* generated/in_pack_c8.c (internal_pack_c8): Regenerated.
	* generated/in_pack_i1.c (internal_pack_1): Regenerated.
	* generated/in_pack_i16.c (internal_pack_16): Regenerated.
	* generated/in_pack_i2.c (internal_pack_2): Regenerated.
	* generated/in_pack_i4.c (internal_pack_4): Regenerated.
	* generated/in_pack_i8.c (internal_pack_8): Regenerated.
	* generated/in_pack_r10.c (internal_pack_r10): Regenerated.
	* generated/in_pack_r16.c (internal_pack_r16): Regenerated.
	* generated/in_pack_r4.c (internal_pack_r4): Regenerated.
	* generated/in_pack_r8.c (internal_pack_r8): Regenerated.
	* generated/in_unpack_c10.c (internal_unpack_c10): Regenerated.
	* generated/in_unpack_c16.c (internal_unpack_c16): Regenerated.
	* generated/in_unpack_c4.c (internal_unpack_c4): Regenerated.
	* generated/in_unpack_c8.c (internal_unpack_c8): Regenerated.
	* generated/in_unpack_i1.c (internal_unpack_1): Regenerated.
	* generated/in_unpack_i16.c (internal_unpack_16): Regenerated.
	* generated/in_unpack_i2.c (internal_unpack_2): Regenerated.
	* generated/in_unpack_i4.c (internal_unpack_4): Regenerated.
	* generated/in_unpack_i8.c (internal_unpack_8): Regenerated.
	* generated/in_unpack_r10.c (internal_unpack_r10): Regenerated.
	* generated/in_unpack_r16.c (internal_unpack_r16): Regenerated.
	* generated/in_unpack_r4.c (internal_unpack_r4): Regenerated.
	* generated/in_unpack_r8.c (internal_unpack_r8): Regenerated.
	* generated/reshape_c10.c (reshape_c10): Regenerated.
	* generated/reshape_c16.c (reshape_c16): Regenerated.
	* generated/reshape_c4.c (reshape_c4): Regenerated.
	* generated/reshape_c8.c (reshape_c8): Regenerated.
	* generated/reshape_i16.c (reshape_16): Regenerated.
	* generated/reshape_i4.c (reshape_4): Regenerated.
	* generated/reshape_i8.c (reshape_8): Regenerated.
	* generated/reshape_r10.c (reshape_r10): Regenerated.
	* generated/reshape_r16.c (reshape_r16): Regenerated.
	* generated/reshape_r4.c (reshape_r4): Regenerated.
	* generated/reshape_r8.c (reshape_r8): Regenerated.
	* generated/shape_i1.c (shape_1): Regenerated.
	* generated/shape_i16.c (shape_16): Regenerated.
	* generated/shape_i2.c (shape_2): Regenerated.
	* generated/shape_i4.c (shape_4): Regenerated.
	* generated/shape_i8.c (shape_8): Regenerated.
	* generated/spread_c10.c (spread_scalar_c10): Regenerated.
	* generated/spread_c16.c (spread_scalar_c16): Regenerated.
	* generated/spread_c4.c (spread_scalar_c4): Regenerated.
	* generated/spread_c8.c (spread_scalar_c8): Regenerated.
	* generated/spread_i1.c (spread_scalar_i1): Regenerated.
	* generated/spread_i16.c (spread_scalar_i16): Regenerated.
	* generated/spread_i2.c (spread_scalar_i2): Regenerated.
	* generated/spread_i4.c (spread_scalar_i4): Regenerated.
	* generated/spread_i8.c (spread_scalar_i8): Regenerated.
	* generated/spread_r10.c (spread_scalar_r10): Regenerated.
	* generated/spread_r16.c (spread_scalar_r16): Regenerated.
	* generated/spread_r4.c (spread_scalar_r4): Regenerated.
	* generated/spread_r8.c (spread_scalar_r8): Regenerated.
	* intrinsics/random.c (jump): Use size_t for array index in loop.
	(getosrandom): Likewise.
	(arandom_r4): Make n an index_type.
	(arandom_r8): Likewise.
	(arandom_r10): Likewise.
	(arandom_r16): Likewise.
	(scramble_seed): Use size_t for array index in loop.
	* m4/cshift1.m4: Make i an index_type.
	* m4/eoshift1.m4: Likewise.
	* m4/eoshift3.m4: Likewise.
	* m4/in_pack.m4: Make n an index_type.
	* m4/in_unpack.m4: Likewise.
	* m4/reshape.m4: Make n and dim index_type's.
	* m4/shape.m4: Make n an index_type.
	* m4/spread.m4: Likewise, use index_type argument rather than
	copying to int.
	* runtime/bounds.c (bounds_ifunction_return): Make n an
	index_type.
	* runtime/in_pack_generic.c (internal_pack): Likewise.
	* runtime/in_unpack_generic.c (internal_unpack): Make n and size
	index_type's.

From-SVN: r257234
This commit is contained in:
Janne Blomqvist 2018-01-31 16:16:22 +02:00
parent 9f3dcd1414
commit 7a15726687
77 changed files with 370 additions and 394 deletions

View File

@ -1,3 +1,91 @@
2018-01-31 Janne Blomqvist <jb@gcc.gnu.org>
* generated/cshift1_16.c (cshift1): Regenerated.
* generated/cshift1_4.c (cshift1): Regenerated.
* generated/cshift1_8.c (cshift1): Regenerated.
* generated/eoshift1_16.c (eoshift1): Regenerated.
* generated/eoshift1_4.c (eoshift1): Regenerated.
* generated/eoshift1_8.c (eoshift1): Regenerated.
* generated/eoshift3_16.c (eoshift3): Regenerated.
* generated/eoshift3_4.c (eoshift3): Regenerated.
* generated/eoshift3_8.c (eoshift3): Regenerated.
* generated/in_pack_c10.c (internal_pack_c10): Regenerated.
* generated/in_pack_c16.c (internal_pack_c16): Regenerated.
* generated/in_pack_c4.c (internal_pack_c4): Regenerated.
* generated/in_pack_c8.c (internal_pack_c8): Regenerated.
* generated/in_pack_i1.c (internal_pack_1): Regenerated.
* generated/in_pack_i16.c (internal_pack_16): Regenerated.
* generated/in_pack_i2.c (internal_pack_2): Regenerated.
* generated/in_pack_i4.c (internal_pack_4): Regenerated.
* generated/in_pack_i8.c (internal_pack_8): Regenerated.
* generated/in_pack_r10.c (internal_pack_r10): Regenerated.
* generated/in_pack_r16.c (internal_pack_r16): Regenerated.
* generated/in_pack_r4.c (internal_pack_r4): Regenerated.
* generated/in_pack_r8.c (internal_pack_r8): Regenerated.
* generated/in_unpack_c10.c (internal_unpack_c10): Regenerated.
* generated/in_unpack_c16.c (internal_unpack_c16): Regenerated.
* generated/in_unpack_c4.c (internal_unpack_c4): Regenerated.
* generated/in_unpack_c8.c (internal_unpack_c8): Regenerated.
* generated/in_unpack_i1.c (internal_unpack_1): Regenerated.
* generated/in_unpack_i16.c (internal_unpack_16): Regenerated.
* generated/in_unpack_i2.c (internal_unpack_2): Regenerated.
* generated/in_unpack_i4.c (internal_unpack_4): Regenerated.
* generated/in_unpack_i8.c (internal_unpack_8): Regenerated.
* generated/in_unpack_r10.c (internal_unpack_r10): Regenerated.
* generated/in_unpack_r16.c (internal_unpack_r16): Regenerated.
* generated/in_unpack_r4.c (internal_unpack_r4): Regenerated.
* generated/in_unpack_r8.c (internal_unpack_r8): Regenerated.
* generated/reshape_c10.c (reshape_c10): Regenerated.
* generated/reshape_c16.c (reshape_c16): Regenerated.
* generated/reshape_c4.c (reshape_c4): Regenerated.
* generated/reshape_c8.c (reshape_c8): Regenerated.
* generated/reshape_i16.c (reshape_16): Regenerated.
* generated/reshape_i4.c (reshape_4): Regenerated.
* generated/reshape_i8.c (reshape_8): Regenerated.
* generated/reshape_r10.c (reshape_r10): Regenerated.
* generated/reshape_r16.c (reshape_r16): Regenerated.
* generated/reshape_r4.c (reshape_r4): Regenerated.
* generated/reshape_r8.c (reshape_r8): Regenerated.
* generated/shape_i1.c (shape_1): Regenerated.
* generated/shape_i16.c (shape_16): Regenerated.
* generated/shape_i2.c (shape_2): Regenerated.
* generated/shape_i4.c (shape_4): Regenerated.
* generated/shape_i8.c (shape_8): Regenerated.
* generated/spread_c10.c (spread_scalar_c10): Regenerated.
* generated/spread_c16.c (spread_scalar_c16): Regenerated.
* generated/spread_c4.c (spread_scalar_c4): Regenerated.
* generated/spread_c8.c (spread_scalar_c8): Regenerated.
* generated/spread_i1.c (spread_scalar_i1): Regenerated.
* generated/spread_i16.c (spread_scalar_i16): Regenerated.
* generated/spread_i2.c (spread_scalar_i2): Regenerated.
* generated/spread_i4.c (spread_scalar_i4): Regenerated.
* generated/spread_i8.c (spread_scalar_i8): Regenerated.
* generated/spread_r10.c (spread_scalar_r10): Regenerated.
* generated/spread_r16.c (spread_scalar_r16): Regenerated.
* generated/spread_r4.c (spread_scalar_r4): Regenerated.
* generated/spread_r8.c (spread_scalar_r8): Regenerated.
* intrinsics/random.c (jump): Use size_t for array index in loop.
(getosrandom): Likewise.
(arandom_r4): Make n an index_type.
(arandom_r8): Likewise.
(arandom_r10): Likewise.
(arandom_r16): Likewise.
(scramble_seed): Use size_t for array index in loop.
* m4/cshift1.m4: Make i an index_type.
* m4/eoshift1.m4: Likewise.
* m4/eoshift3.m4: Likewise.
* m4/in_pack.m4: Make n an index_type.
* m4/in_unpack.m4: Likewise.
* m4/reshape.m4: Make n and dim index_type's.
* m4/shape.m4: Make n an index_type.
* m4/spread.m4: Likewise, use index_type argument rather than
copying to int.
* runtime/bounds.c (bounds_ifunction_return): Make n an
index_type.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Make n and size
index_type's.
2018-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/37577

View File

@ -77,12 +77,10 @@ cshift1 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -77,12 +77,10 @@ cshift1 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -77,12 +77,10 @@ cshift1 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -84,11 +84,9 @@ eoshift1 (gfc_array_char * const restrict ret,
arraysize = size0 ((array_t *) array);
if (ret->base_addr == NULL)
{
int i;
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -84,11 +84,9 @@ eoshift1 (gfc_array_char * const restrict ret,
arraysize = size0 ((array_t *) array);
if (ret->base_addr == NULL)
{
int i;
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -84,11 +84,9 @@ eoshift1 (gfc_array_char * const restrict ret,
arraysize = size0 ((array_t *) array);
if (ret->base_addr == NULL)
{
int i;
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -85,12 +85,10 @@ eoshift3 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -85,12 +85,10 @@ eoshift3 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -85,12 +85,10 @@ eoshift3 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -43,7 +43,6 @@ internal_pack_c10 (gfc_array_c10 * source)
const GFC_COMPLEX_10 *src;
GFC_COMPLEX_10 * restrict dest;
GFC_COMPLEX_10 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_c10 (gfc_array_c10 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_c10 (gfc_array_c10 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_c16 (gfc_array_c16 * source)
const GFC_COMPLEX_16 *src;
GFC_COMPLEX_16 * restrict dest;
GFC_COMPLEX_16 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_c16 (gfc_array_c16 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_c16 (gfc_array_c16 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_c4 (gfc_array_c4 * source)
const GFC_COMPLEX_4 *src;
GFC_COMPLEX_4 * restrict dest;
GFC_COMPLEX_4 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_c4 (gfc_array_c4 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_c4 (gfc_array_c4 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_c8 (gfc_array_c8 * source)
const GFC_COMPLEX_8 *src;
GFC_COMPLEX_8 * restrict dest;
GFC_COMPLEX_8 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_c8 (gfc_array_c8 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_c8 (gfc_array_c8 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_1 (gfc_array_i1 * source)
const GFC_INTEGER_1 *src;
GFC_INTEGER_1 * restrict dest;
GFC_INTEGER_1 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_1 (gfc_array_i1 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_1 (gfc_array_i1 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_16 (gfc_array_i16 * source)
const GFC_INTEGER_16 *src;
GFC_INTEGER_16 * restrict dest;
GFC_INTEGER_16 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_16 (gfc_array_i16 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_16 (gfc_array_i16 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_2 (gfc_array_i2 * source)
const GFC_INTEGER_2 *src;
GFC_INTEGER_2 * restrict dest;
GFC_INTEGER_2 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_2 (gfc_array_i2 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_2 (gfc_array_i2 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_4 (gfc_array_i4 * source)
const GFC_INTEGER_4 *src;
GFC_INTEGER_4 * restrict dest;
GFC_INTEGER_4 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_4 (gfc_array_i4 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_4 (gfc_array_i4 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_8 (gfc_array_i8 * source)
const GFC_INTEGER_8 *src;
GFC_INTEGER_8 * restrict dest;
GFC_INTEGER_8 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_8 (gfc_array_i8 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_8 (gfc_array_i8 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_r10 (gfc_array_r10 * source)
const GFC_REAL_10 *src;
GFC_REAL_10 * restrict dest;
GFC_REAL_10 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_r10 (gfc_array_r10 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_r10 (gfc_array_r10 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_r16 (gfc_array_r16 * source)
const GFC_REAL_16 *src;
GFC_REAL_16 * restrict dest;
GFC_REAL_16 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_r16 (gfc_array_r16 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_r16 (gfc_array_r16 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_r4 (gfc_array_r4 * source)
const GFC_REAL_4 *src;
GFC_REAL_4 * restrict dest;
GFC_REAL_4 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_r4 (gfc_array_r4 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_r4 (gfc_array_r4 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -43,7 +43,6 @@ internal_pack_r8 (gfc_array_r8 * source)
const GFC_REAL_8 *src;
GFC_REAL_8 * restrict dest;
GFC_REAL_8 *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -52,7 +51,7 @@ internal_pack_r8 (gfc_array_r8 * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -88,7 +87,7 @@ internal_pack_r8 (gfc_array_r8 * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src)
index_type dim;
index_type dsize;
GFC_COMPLEX_10 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src)
index_type dim;
index_type dsize;
GFC_COMPLEX_16 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src)
index_type dim;
index_type dsize;
GFC_COMPLEX_4 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src)
index_type dim;
index_type dsize;
GFC_COMPLEX_8 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src)
index_type dim;
index_type dsize;
GFC_INTEGER_1 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src)
index_type dim;
index_type dsize;
GFC_INTEGER_16 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src)
index_type dim;
index_type dsize;
GFC_INTEGER_2 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src)
index_type dim;
index_type dsize;
GFC_INTEGER_4 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src)
index_type dim;
index_type dsize;
GFC_INTEGER_8 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src)
index_type dim;
index_type dsize;
GFC_REAL_10 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src)
index_type dim;
index_type dsize;
GFC_REAL_16 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src)
index_type dim;
index_type dsize;
GFC_REAL_4 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -39,7 +39,6 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src)
index_type dim;
index_type dsize;
GFC_REAL_8 * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -47,7 +46,7 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -77,7 +76,7 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -72,8 +72,6 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
const GFC_COMPLEX_10 *pptr;
const GFC_COMPLEX_10 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
const GFC_COMPLEX_16 *pptr;
const GFC_COMPLEX_16 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
const GFC_COMPLEX_4 *pptr;
const GFC_COMPLEX_4 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
const GFC_COMPLEX_8 *pptr;
const GFC_COMPLEX_8 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_16 (gfc_array_i16 * const restrict ret,
const GFC_INTEGER_16 *pptr;
const GFC_INTEGER_16 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_16 (gfc_array_i16 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_16 (gfc_array_i16 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_16 (gfc_array_i16 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_4 (gfc_array_i4 * const restrict ret,
const GFC_INTEGER_4 *pptr;
const GFC_INTEGER_4 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_4 (gfc_array_i4 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_4 (gfc_array_i4 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_4 (gfc_array_i4 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_8 (gfc_array_i8 * const restrict ret,
const GFC_INTEGER_8 *pptr;
const GFC_INTEGER_8 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_8 (gfc_array_i8 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_8 (gfc_array_i8 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_8 (gfc_array_i8 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
const GFC_REAL_10 *pptr;
const GFC_REAL_10 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
const GFC_REAL_16 *pptr;
const GFC_REAL_16 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
const GFC_REAL_4 *pptr;
const GFC_REAL_4 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -72,8 +72,6 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
const GFC_REAL_8 *pptr;
const GFC_REAL_8 *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -87,7 +85,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -102,7 +100,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -129,7 +127,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -160,7 +158,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -173,7 +171,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -190,10 +188,10 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -211,8 +209,9 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -243,7 +242,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -283,7 +282,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -303,7 +302,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -343,7 +342,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -36,12 +36,10 @@ void
shape_1 (gfc_array_i1 * const restrict ret,
const array_t * const restrict array)
{
int n;
index_type stride;
index_type extent;
int rank;
rank = GFC_DESCRIPTOR_RANK (array);
int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
@ -55,7 +53,7 @@ shape_1 (gfc_array_i1 * const restrict ret,
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;

View File

@ -36,12 +36,10 @@ void
shape_16 (gfc_array_i16 * const restrict ret,
const array_t * const restrict array)
{
int n;
index_type stride;
index_type extent;
int rank;
rank = GFC_DESCRIPTOR_RANK (array);
int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
@ -55,7 +53,7 @@ shape_16 (gfc_array_i16 * const restrict ret,
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;

View File

@ -36,12 +36,10 @@ void
shape_2 (gfc_array_i2 * const restrict ret,
const array_t * const restrict array)
{
int n;
index_type stride;
index_type extent;
int rank;
rank = GFC_DESCRIPTOR_RANK (array);
int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
@ -55,7 +53,7 @@ shape_2 (gfc_array_i2 * const restrict ret,
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;

View File

@ -36,12 +36,10 @@ void
shape_4 (gfc_array_i4 * const restrict ret,
const array_t * const restrict array)
{
int n;
index_type stride;
index_type extent;
int rank;
rank = GFC_DESCRIPTOR_RANK (array);
int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
@ -55,7 +53,7 @@ shape_4 (gfc_array_i4 * const restrict ret,
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;

View File

@ -36,12 +36,10 @@ void
shape_8 (gfc_array_i8 * const restrict ret,
const array_t * const restrict array)
{
int n;
index_type stride;
index_type extent;
int rank;
rank = GFC_DESCRIPTOR_RANK (array);
int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
@ -55,7 +53,7 @@ shape_8 (gfc_array_i8 * const restrict ret,
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;

View File

@ -227,10 +227,8 @@ spread_c10 (gfc_array_c10 *ret, const gfc_array_c10 *source,
void
spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_COMPLEX_10 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_c16 (gfc_array_c16 *ret, const gfc_array_c16 *source,
void
spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_COMPLEX_16 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_c4 (gfc_array_c4 *ret, const gfc_array_c4 *source,
void
spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_COMPLEX_4 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_c8 (gfc_array_c8 *ret, const gfc_array_c8 *source,
void
spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_COMPLEX_8 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_i1 (gfc_array_i1 *ret, const gfc_array_i1 *source,
void
spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_INTEGER_1 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
void
spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_INTEGER_16 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_i2 (gfc_array_i2 *ret, const gfc_array_i2 *source,
void
spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_INTEGER_2 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_i4 (gfc_array_i4 *ret, const gfc_array_i4 *source,
void
spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_INTEGER_4 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_i8 (gfc_array_i8 *ret, const gfc_array_i8 *source,
void
spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_INTEGER_8 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_r10 (gfc_array_r10 *ret, const gfc_array_r10 *source,
void
spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_REAL_10 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_r16 (gfc_array_r16 *ret, const gfc_array_r16 *source,
void
spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_REAL_16 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_r4 (gfc_array_r4 *ret, const gfc_array_r4 *source,
void
spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_REAL_4 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -227,10 +227,8 @@ spread_r8 (gfc_array_r8 *ret, const gfc_array_r8 *source,
void
spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
GFC_REAL_8 * restrict dest;
index_type stride;
@ -256,7 +254,7 @@ spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -259,7 +259,7 @@ jump (xorshift1024star_state* rs)
};
uint64_t t[16] = { 0 };
for(unsigned int i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
for(size_t i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
for(int b = 0; b < 64; b++)
{
if (JUMP[i] & 1ULL << b)
@ -306,7 +306,7 @@ getosrandom (void *buf, size_t buflen)
/* rand_s is available in MinGW-w64 but not plain MinGW. */
#if defined(__MINGW64_VERSION_MAJOR)
unsigned int* b = buf;
for (unsigned i = 0; i < buflen / sizeof (unsigned int); i++)
for (size_t i = 0; i < buflen / sizeof (unsigned int); i++)
rand_s (&b[i]);
return buflen;
#else
@ -462,14 +462,12 @@ arandom_r4 (gfc_array_r4 *x)
index_type dim;
GFC_REAL_4 *dest;
xorshift1024star_state* rs = get_rand_state();
int n;
dest = x->base_addr;
dim = GFC_DESCRIPTOR_RANK (x);
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
@ -494,7 +492,7 @@ arandom_r4 (gfc_array_r4 *x)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -531,13 +529,12 @@ arandom_r8 (gfc_array_r8 *x)
index_type dim;
GFC_REAL_8 *dest;
xorshift1024star_state* rs = get_rand_state();
int n;
dest = x->base_addr;
dim = GFC_DESCRIPTOR_RANK (x);
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
@ -561,7 +558,7 @@ arandom_r8 (gfc_array_r8 *x)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -600,13 +597,12 @@ arandom_r10 (gfc_array_r10 *x)
index_type dim;
GFC_REAL_10 *dest;
xorshift1024star_state* rs = get_rand_state();
int n;
dest = x->base_addr;
dim = GFC_DESCRIPTOR_RANK (x);
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
@ -630,7 +626,7 @@ arandom_r10 (gfc_array_r10 *x)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -671,13 +667,12 @@ arandom_r16 (gfc_array_r16 *x)
index_type dim;
GFC_REAL_16 *dest;
xorshift1024star_state* rs = get_rand_state();
int n;
dest = x->base_addr;
dim = GFC_DESCRIPTOR_RANK (x);
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
@ -702,7 +697,7 @@ arandom_r16 (gfc_array_r16 *x)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -751,7 +746,7 @@ static const uint64_t xor_keys[] = {
static void
scramble_seed (uint64_t *dest, const uint64_t *src)
{
for (int i = 0; i < (int) SZU64; i++)
for (size_t i = 0; i < SZU64; i++)
dest[i] = src[i] ^ xor_keys[i];
}

View File

@ -78,12 +78,10 @@ cshift1 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -85,11 +85,9 @@ eoshift1 (gfc_array_char * const restrict ret,
arraysize = size0 ((array_t *) array);
if (ret->base_addr == NULL)
{
int i;
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -86,12 +86,10 @@ eoshift3 (gfc_array_char * const restrict ret,
if (ret->base_addr == NULL)
{
int i;
ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
GFC_DTYPE_COPY(ret,array);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;

View File

@ -46,7 +46,6 @@ internal_pack_'rtype_ccode` ('rtype` * source)
const 'rtype_name` *src;
'rtype_name` * restrict dest;
'rtype_name` *destptr;
int n;
int packed;
/* TODO: Investigate how we can figure out if this is a temporary
@ -55,7 +54,7 @@ internal_pack_'rtype_ccode` ('rtype` * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -91,7 +90,7 @@ internal_pack_'rtype_ccode` ('rtype` * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -42,7 +42,6 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
index_type dim;
index_type dsize;
'rtype_name` * restrict dest;
int n;
dest = d->base_addr;
if (src == dest || !src)
@ -50,7 +49,7 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -80,7 +79,7 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -76,8 +76,6 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
const 'rtype_name` *pptr;
const 'rtype_name` *src;
int n;
int dim;
int sempty, pempty, shape_empty;
index_type shape_data[GFC_MAX_DIMENSIONS];
@ -91,7 +89,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
shape_empty = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
if (shape_data[n] <= 0)
@ -106,7 +104,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
index_type alloc_size;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rex = shape_data[n];
@ -133,7 +131,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
pdim = GFC_DESCRIPTOR_RANK (pad);
psize = 1;
pempty = 0;
for (n = 0; n < pdim; n++)
for (index_type n = 0; n < pdim; n++)
{
pcount[n] = 0;
pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
@ -164,7 +162,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
index_type ret_extent, source_extent;
rs = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
rs *= shape_data[n];
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
@ -177,7 +175,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
source_extent = 1;
sdim = GFC_DESCRIPTOR_RANK (source);
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
index_type se;
se = GFC_DESCRIPTOR_EXTENT(source,n);
@ -194,10 +192,10 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
int seen[GFC_MAX_DIMENSIONS];
index_type v;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
seen[n] = 0;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
@ -215,8 +213,9 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
}
rsize = 1;
for (n = 0; n < rdim; n++)
for (index_type n = 0; n < rdim; n++)
{
index_type dim;
if (order)
dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
else
@ -247,7 +246,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
ssize = 1;
sempty = 0;
for (n = 0; n < sdim; n++)
for (index_type n = 0; n < sdim; n++)
{
scount[n] = 0;
sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -287,7 +286,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
src = pptr;
sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
@ -307,7 +306,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
scount[0]++;
/* Advance to the next destination element. */
n = 0;
index_type n = 0;
while (rcount[n] == rextent[n])
{
/* When we get to the end of a dimension, reset it and increment
@ -347,7 +346,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
/* Switch to the pad array. */
sptr = NULL;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
for (index_type dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];

View File

@ -37,12 +37,10 @@ void
shape_'rtype_kind` ('rtype` * const restrict ret,
const array_t * const restrict array)
{
int n;
index_type stride;
index_type extent;
int rank;
rank = GFC_DESCRIPTOR_RANK (array);
int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
@ -56,7 +54,7 @@ shape_'rtype_kind` ('rtype` * const restrict ret,
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;

View File

@ -228,10 +228,8 @@ spread_'rtype_code` ('rtype` *ret, const 'rtype` *source,
void
spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source,
const index_type along, const index_type pncopies)
const index_type along, const index_type ncopies)
{
int n;
int ncopies = pncopies;
'rtype_name` * restrict dest;
index_type stride;
@ -257,7 +255,7 @@ spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source,
dest = ret->base_addr;
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
for (n = 0; n < ncopies; n++)
for (index_type n = 0; n < ncopies; n++)
{
*dest = *source;
dest += stride;

View File

@ -62,7 +62,6 @@ bounds_ifunction_return (array_t * a, const index_type * extent,
const char * a_name, const char * intrinsic)
{
int empty;
int n;
int rank;
index_type a_size;
@ -70,7 +69,7 @@ bounds_ifunction_return (array_t * a, const index_type * extent,
a_size = size0 (a);
empty = 0;
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
if (extent[n] == 0)
empty = 1;
@ -89,7 +88,7 @@ bounds_ifunction_return (array_t * a, const index_type * extent,
" intrinsic: should not be zero-sized",
a_name, intrinsic);
for (n = 0; n < rank; n++)
for (index_type n = 0; n < rank; n++)
{
index_type a_extent;
a_extent = GFC_DESCRIPTOR_EXTENT(a, n);

View File

@ -41,7 +41,6 @@ internal_pack (gfc_array_char * source)
const char *src;
char *dest;
void *destptr;
int n;
int packed;
index_type size;
index_type type_size;
@ -163,7 +162,7 @@ internal_pack (gfc_array_char * source)
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
@ -199,7 +198,7 @@ internal_pack (gfc_array_char * source)
src += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment

View File

@ -40,8 +40,7 @@ internal_unpack (gfc_array_char * d, const void * s)
index_type dsize;
char *dest;
const char *src;
int n;
int size;
index_type size;
int type_size;
dest = d->base_addr;
@ -190,7 +189,7 @@ internal_unpack (gfc_array_char * d, const void * s)
dim = GFC_DESCRIPTOR_RANK (d);
dsize = 1;
for (n = 0; n < dim; n++)
for (index_type n = 0; n < dim; n++)
{
count[n] = 0;
stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
@ -223,7 +222,7 @@ internal_unpack (gfc_array_char * d, const void * s)
dest += stride0;
count[0]++;
/* Advance to the next source element. */
n = 0;
index_type n = 0;
while (count[n] == extent[n])
{
/* When we get to the end of a dimension, reset it and increment