summaryrefslogtreecommitdiff
path: root/libgfortran/generated/minval_i16.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/minval_i16.c')
-rw-r--r--libgfortran/generated/minval_i16.c108
1 files changed, 52 insertions, 56 deletions
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index e0bd7332316..f0bd16fe003 100644
--- a/libgfortran/generated/minval_i16.c
+++ b/libgfortran/generated/minval_i16.c
@@ -57,24 +57,23 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
- len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = array->dim[dim].stride;
+ delta = GFC_DESCRIPTOR_STRIDE(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = array->dim[n].stride;
- extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
extent[n] = 0;
}
for (n = dim; n < rank; n++)
{
- sstride[n] = array->dim[n + 1].stride;
- extent[n] =
- array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
extent[n] = 0;
@@ -82,30 +81,31 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
if (retarray->data == NULL)
{
- size_t alloc_size;
+ size_t alloc_size, str;
for (n = 0; n < rank; n++)
{
- retarray->dim[n].lbound = 0;
- retarray->dim[n].ubound = extent[n]-1;
if (n == 0)
- retarray->dim[n].stride = 1;
+ str = 1;
else
- retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1];
+ str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+ GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
}
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * retarray->dim[rank-1].stride
+ alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
* extent[rank-1];
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
- retarray->dim[0].lbound = 0;
- retarray->dim[0].ubound = -1;
+ GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
return;
+
}
else
retarray->data = internal_malloc_size (alloc_size);
@@ -124,8 +124,7 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
{
index_type ret_extent;
- ret_extent = retarray->dim[n].ubound + 1
- - retarray->dim[n].lbound;
+ ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
if (extent[n] != ret_extent)
runtime_error ("Incorrect extent in return value of"
" MINVAL intrinsic in dimension %ld:"
@@ -138,7 +137,7 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = retarray->dim[n].stride;
+ dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
if (extent[n] <= 0)
len = 0;
}
@@ -230,7 +229,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
- len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@@ -247,14 +246,14 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
else
runtime_error ("Funny sized logical array");
- delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride * mask_kind;
+ delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride * mask_kind;
- extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+ extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
extent[n] = 0;
@@ -262,10 +261,9 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->dim[n + 1].stride * mask_kind;
- extent[n] =
- array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+ mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+ extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
extent[n] = 0;
@@ -273,19 +271,20 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
if (retarray->data == NULL)
{
- size_t alloc_size;
+ size_t alloc_size, str;
for (n = 0; n < rank; n++)
{
- retarray->dim[n].lbound = 0;
- retarray->dim[n].ubound = extent[n]-1;
if (n == 0)
- retarray->dim[n].stride = 1;
+ str = 1;
else
- retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1];
+ str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+ GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
}
- alloc_size = sizeof (GFC_INTEGER_16) * retarray->dim[rank-1].stride
+ alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
* extent[rank-1];
retarray->offset = 0;
@@ -294,8 +293,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
- retarray->dim[0].lbound = 0;
- retarray->dim[0].ubound = -1;
+ GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
return;
}
else
@@ -313,8 +311,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
{
index_type ret_extent;
- ret_extent = retarray->dim[n].ubound + 1
- - retarray->dim[n].lbound;
+ ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
if (extent[n] != ret_extent)
runtime_error ("Incorrect extent in return value of"
" MINVAL intrinsic in dimension %ld:"
@@ -325,8 +322,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
{
index_type mask_extent, array_extent;
- array_extent = array->dim[n].ubound + 1 - array->dim[n].lbound;
- mask_extent = mask->dim[n].ubound + 1 - mask->dim[n].lbound;
+ array_extent = GFC_DESCRIPTOR_EXTENT(array,n);
+ mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n);
if (array_extent != mask_extent)
runtime_error ("Incorrect extent in MASK argument of"
" MINVAL intrinsic in dimension %ld:"
@@ -339,7 +336,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = retarray->dim[n].stride;
+ dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -437,8 +434,8 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = array->dim[n].stride;
- extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] <= 0)
extent[n] = 0;
@@ -446,9 +443,9 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
- sstride[n] = array->dim[n + 1].stride;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
extent[n] =
- array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
+ GFC_DESCRIPTOR_EXTENT(array,n + 1);
if (extent[n] <= 0)
extent[n] = 0;
@@ -456,29 +453,29 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
if (retarray->data == NULL)
{
- size_t alloc_size;
+ size_t alloc_size, str;
for (n = 0; n < rank; n++)
{
- retarray->dim[n].lbound = 0;
- retarray->dim[n].ubound = extent[n]-1;
if (n == 0)
- retarray->dim[n].stride = 1;
+ str = 1;
else
- retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1];
+ str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+ GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
}
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * retarray->dim[rank-1].stride
+ alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
* extent[rank-1];
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
- retarray->dim[0].lbound = 0;
- retarray->dim[0].ubound = -1;
+ GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
return;
}
else
@@ -498,8 +495,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
{
index_type ret_extent;
- ret_extent = retarray->dim[n].ubound + 1
- - retarray->dim[n].lbound;
+ ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
if (extent[n] != ret_extent)
runtime_error ("Incorrect extent in return value of"
" MINVAL intrinsic in dimension %ld:"
@@ -512,7 +508,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = retarray->dim[n].stride;
+ dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
}
dest = retarray->data;