aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2007-08-24 16:16:16 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2007-08-24 16:16:16 +0000
commit28dc6b33c4b8bfbd36866e084e2263ef384c1bbc (patch)
treeb12449583134bdcb1419a30d4a072fbb3e1c10fd /libgfortran
parentc6a8035acf00eb3ef5f1a4a22469e7ebb6785af5 (diff)
downloadgcc-28dc6b33c4b8bfbd36866e084e2263ef384c1bbc.zip
gcc-28dc6b33c4b8bfbd36866e084e2263ef384c1bbc.tar.gz
gcc-28dc6b33c4b8bfbd36866e084e2263ef384c1bbc.tar.bz2
re PR libfortran/32972 (performance of pack/unpack)
2007-08-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/32972 * iresolve.c: Don't convert array masks. 2007-08-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/32972 * libgfortran.h: Remove GFOR_POINTER_L8_TO_L4 macro. Add GFOR_POINTER_TO_L1 macro. * m4/iforeach.m4(`m'name`'rtype_qual`_'atype_code): Change argument 'mask' to gfc_array_l1. Adjust prototype. Change mask pointer to GFC_LOGICAL_1. Multiply strides by kind of mask * m4/ifunction.m4: Likewise. * intrinsics/pack_generic.c(pack_internal): Likewise. * intrinsics/unpack_generic.c(unpack_internal): Likewise. * m4/matmull.m4: Switch to GFC_LOGICAL_1. Multiply strides by kind of logical arguments a and b. * generated/matmul_l16.c: Regenerated. * generated/matmul_l4.c: Regenerated. * generated/matmul_l8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. From-SVN: r127774
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog170
-rw-r--r--libgfortran/generated/matmul_l16.c55
-rw-r--r--libgfortran/generated/matmul_l4.c55
-rw-r--r--libgfortran/generated/matmul_l8.c55
-rw-r--r--libgfortran/generated/maxloc0_16_i1.c33
-rw-r--r--libgfortran/generated/maxloc0_16_i16.c33
-rw-r--r--libgfortran/generated/maxloc0_16_i2.c33
-rw-r--r--libgfortran/generated/maxloc0_16_i4.c33
-rw-r--r--libgfortran/generated/maxloc0_16_i8.c33
-rw-r--r--libgfortran/generated/maxloc0_16_r10.c33
-rw-r--r--libgfortran/generated/maxloc0_16_r16.c33
-rw-r--r--libgfortran/generated/maxloc0_16_r4.c33
-rw-r--r--libgfortran/generated/maxloc0_16_r8.c33
-rw-r--r--libgfortran/generated/maxloc0_4_i1.c33
-rw-r--r--libgfortran/generated/maxloc0_4_i16.c33
-rw-r--r--libgfortran/generated/maxloc0_4_i2.c33
-rw-r--r--libgfortran/generated/maxloc0_4_i4.c33
-rw-r--r--libgfortran/generated/maxloc0_4_i8.c33
-rw-r--r--libgfortran/generated/maxloc0_4_r10.c33
-rw-r--r--libgfortran/generated/maxloc0_4_r16.c33
-rw-r--r--libgfortran/generated/maxloc0_4_r4.c33
-rw-r--r--libgfortran/generated/maxloc0_4_r8.c33
-rw-r--r--libgfortran/generated/maxloc0_8_i1.c33
-rw-r--r--libgfortran/generated/maxloc0_8_i16.c33
-rw-r--r--libgfortran/generated/maxloc0_8_i2.c33
-rw-r--r--libgfortran/generated/maxloc0_8_i4.c33
-rw-r--r--libgfortran/generated/maxloc0_8_i8.c33
-rw-r--r--libgfortran/generated/maxloc0_8_r10.c33
-rw-r--r--libgfortran/generated/maxloc0_8_r16.c33
-rw-r--r--libgfortran/generated/maxloc0_8_r4.c33
-rw-r--r--libgfortran/generated/maxloc0_8_r8.c33
-rw-r--r--libgfortran/generated/maxloc1_16_i1.c40
-rw-r--r--libgfortran/generated/maxloc1_16_i16.c40
-rw-r--r--libgfortran/generated/maxloc1_16_i2.c40
-rw-r--r--libgfortran/generated/maxloc1_16_i4.c40
-rw-r--r--libgfortran/generated/maxloc1_16_i8.c40
-rw-r--r--libgfortran/generated/maxloc1_16_r10.c40
-rw-r--r--libgfortran/generated/maxloc1_16_r16.c40
-rw-r--r--libgfortran/generated/maxloc1_16_r4.c40
-rw-r--r--libgfortran/generated/maxloc1_16_r8.c40
-rw-r--r--libgfortran/generated/maxloc1_4_i1.c40
-rw-r--r--libgfortran/generated/maxloc1_4_i16.c40
-rw-r--r--libgfortran/generated/maxloc1_4_i2.c40
-rw-r--r--libgfortran/generated/maxloc1_4_i4.c40
-rw-r--r--libgfortran/generated/maxloc1_4_i8.c40
-rw-r--r--libgfortran/generated/maxloc1_4_r10.c40
-rw-r--r--libgfortran/generated/maxloc1_4_r16.c40
-rw-r--r--libgfortran/generated/maxloc1_4_r4.c40
-rw-r--r--libgfortran/generated/maxloc1_4_r8.c40
-rw-r--r--libgfortran/generated/maxloc1_8_i1.c40
-rw-r--r--libgfortran/generated/maxloc1_8_i16.c40
-rw-r--r--libgfortran/generated/maxloc1_8_i2.c40
-rw-r--r--libgfortran/generated/maxloc1_8_i4.c40
-rw-r--r--libgfortran/generated/maxloc1_8_i8.c40
-rw-r--r--libgfortran/generated/maxloc1_8_r10.c40
-rw-r--r--libgfortran/generated/maxloc1_8_r16.c40
-rw-r--r--libgfortran/generated/maxloc1_8_r4.c40
-rw-r--r--libgfortran/generated/maxloc1_8_r8.c40
-rw-r--r--libgfortran/generated/maxval_i1.c40
-rw-r--r--libgfortran/generated/maxval_i16.c40
-rw-r--r--libgfortran/generated/maxval_i2.c40
-rw-r--r--libgfortran/generated/maxval_i4.c40
-rw-r--r--libgfortran/generated/maxval_i8.c40
-rw-r--r--libgfortran/generated/maxval_r10.c40
-rw-r--r--libgfortran/generated/maxval_r16.c40
-rw-r--r--libgfortran/generated/maxval_r4.c40
-rw-r--r--libgfortran/generated/maxval_r8.c40
-rw-r--r--libgfortran/generated/minloc0_16_i1.c33
-rw-r--r--libgfortran/generated/minloc0_16_i16.c33
-rw-r--r--libgfortran/generated/minloc0_16_i2.c33
-rw-r--r--libgfortran/generated/minloc0_16_i4.c33
-rw-r--r--libgfortran/generated/minloc0_16_i8.c33
-rw-r--r--libgfortran/generated/minloc0_16_r10.c33
-rw-r--r--libgfortran/generated/minloc0_16_r16.c33
-rw-r--r--libgfortran/generated/minloc0_16_r4.c33
-rw-r--r--libgfortran/generated/minloc0_16_r8.c33
-rw-r--r--libgfortran/generated/minloc0_4_i1.c33
-rw-r--r--libgfortran/generated/minloc0_4_i16.c33
-rw-r--r--libgfortran/generated/minloc0_4_i2.c33
-rw-r--r--libgfortran/generated/minloc0_4_i4.c33
-rw-r--r--libgfortran/generated/minloc0_4_i8.c33
-rw-r--r--libgfortran/generated/minloc0_4_r10.c33
-rw-r--r--libgfortran/generated/minloc0_4_r16.c33
-rw-r--r--libgfortran/generated/minloc0_4_r4.c33
-rw-r--r--libgfortran/generated/minloc0_4_r8.c33
-rw-r--r--libgfortran/generated/minloc0_8_i1.c33
-rw-r--r--libgfortran/generated/minloc0_8_i16.c33
-rw-r--r--libgfortran/generated/minloc0_8_i2.c33
-rw-r--r--libgfortran/generated/minloc0_8_i4.c33
-rw-r--r--libgfortran/generated/minloc0_8_i8.c33
-rw-r--r--libgfortran/generated/minloc0_8_r10.c33
-rw-r--r--libgfortran/generated/minloc0_8_r16.c33
-rw-r--r--libgfortran/generated/minloc0_8_r4.c33
-rw-r--r--libgfortran/generated/minloc0_8_r8.c33
-rw-r--r--libgfortran/generated/minloc1_16_i1.c40
-rw-r--r--libgfortran/generated/minloc1_16_i16.c40
-rw-r--r--libgfortran/generated/minloc1_16_i2.c40
-rw-r--r--libgfortran/generated/minloc1_16_i4.c40
-rw-r--r--libgfortran/generated/minloc1_16_i8.c40
-rw-r--r--libgfortran/generated/minloc1_16_r10.c40
-rw-r--r--libgfortran/generated/minloc1_16_r16.c40
-rw-r--r--libgfortran/generated/minloc1_16_r4.c40
-rw-r--r--libgfortran/generated/minloc1_16_r8.c40
-rw-r--r--libgfortran/generated/minloc1_4_i1.c40
-rw-r--r--libgfortran/generated/minloc1_4_i16.c40
-rw-r--r--libgfortran/generated/minloc1_4_i2.c40
-rw-r--r--libgfortran/generated/minloc1_4_i4.c40
-rw-r--r--libgfortran/generated/minloc1_4_i8.c40
-rw-r--r--libgfortran/generated/minloc1_4_r10.c40
-rw-r--r--libgfortran/generated/minloc1_4_r16.c40
-rw-r--r--libgfortran/generated/minloc1_4_r4.c40
-rw-r--r--libgfortran/generated/minloc1_4_r8.c40
-rw-r--r--libgfortran/generated/minloc1_8_i1.c40
-rw-r--r--libgfortran/generated/minloc1_8_i16.c40
-rw-r--r--libgfortran/generated/minloc1_8_i2.c40
-rw-r--r--libgfortran/generated/minloc1_8_i4.c40
-rw-r--r--libgfortran/generated/minloc1_8_i8.c40
-rw-r--r--libgfortran/generated/minloc1_8_r10.c40
-rw-r--r--libgfortran/generated/minloc1_8_r16.c40
-rw-r--r--libgfortran/generated/minloc1_8_r4.c40
-rw-r--r--libgfortran/generated/minloc1_8_r8.c40
-rw-r--r--libgfortran/generated/minval_i1.c40
-rw-r--r--libgfortran/generated/minval_i16.c40
-rw-r--r--libgfortran/generated/minval_i2.c40
-rw-r--r--libgfortran/generated/minval_i4.c40
-rw-r--r--libgfortran/generated/minval_i8.c40
-rw-r--r--libgfortran/generated/minval_r10.c40
-rw-r--r--libgfortran/generated/minval_r16.c40
-rw-r--r--libgfortran/generated/minval_r4.c40
-rw-r--r--libgfortran/generated/minval_r8.c40
-rw-r--r--libgfortran/generated/product_c10.c40
-rw-r--r--libgfortran/generated/product_c16.c40
-rw-r--r--libgfortran/generated/product_c4.c40
-rw-r--r--libgfortran/generated/product_c8.c40
-rw-r--r--libgfortran/generated/product_i1.c40
-rw-r--r--libgfortran/generated/product_i16.c40
-rw-r--r--libgfortran/generated/product_i2.c40
-rw-r--r--libgfortran/generated/product_i4.c40
-rw-r--r--libgfortran/generated/product_i8.c40
-rw-r--r--libgfortran/generated/product_r10.c40
-rw-r--r--libgfortran/generated/product_r16.c40
-rw-r--r--libgfortran/generated/product_r4.c40
-rw-r--r--libgfortran/generated/product_r8.c40
-rw-r--r--libgfortran/generated/sum_c10.c40
-rw-r--r--libgfortran/generated/sum_c16.c40
-rw-r--r--libgfortran/generated/sum_c4.c40
-rw-r--r--libgfortran/generated/sum_c8.c40
-rw-r--r--libgfortran/generated/sum_i1.c40
-rw-r--r--libgfortran/generated/sum_i16.c40
-rw-r--r--libgfortran/generated/sum_i2.c40
-rw-r--r--libgfortran/generated/sum_i4.c40
-rw-r--r--libgfortran/generated/sum_i8.c40
-rw-r--r--libgfortran/generated/sum_r10.c40
-rw-r--r--libgfortran/generated/sum_r16.c40
-rw-r--r--libgfortran/generated/sum_r4.c40
-rw-r--r--libgfortran/generated/sum_r8.c40
-rw-r--r--libgfortran/intrinsics/pack_generic.c46
-rw-r--r--libgfortran/intrinsics/unpack_generic.c42
-rw-r--r--libgfortran/libgfortran.h6
-rw-r--r--libgfortran/m4/iforeach.m433
-rw-r--r--libgfortran/m4/ifunction.m440
-rw-r--r--libgfortran/m4/matmull.m456
162 files changed, 3536 insertions, 2724 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e9832a0..10e6009 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,173 @@
+2007-08-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/32972
+ * libgfortran.h: Remove GFOR_POINTER_L8_TO_L4 macro.
+ Add GFOR_POINTER_TO_L1 macro.
+ * m4/iforeach.m4(`m'name`'rtype_qual`_'atype_code):
+ Change argument 'mask' to gfc_array_l1. Adjust prototype.
+ Change mask pointer to GFC_LOGICAL_1. Multiply strides
+ by kind of mask
+ * m4/ifunction.m4: Likewise.
+ * intrinsics/pack_generic.c(pack_internal): Likewise.
+ * intrinsics/unpack_generic.c(unpack_internal): Likewise.
+ * m4/matmull.m4: Switch to GFC_LOGICAL_1. Multiply strides by
+ kind of logical arguments a and b.
+ * generated/matmul_l16.c: Regenerated.
+ * generated/matmul_l4.c: Regenerated.
+ * generated/matmul_l8.c: Regenerated.
+ * generated/maxloc0_16_i1.c: Regenerated.
+ * generated/maxloc0_16_i16.c: Regenerated.
+ * generated/maxloc0_16_i2.c: Regenerated.
+ * generated/maxloc0_16_i4.c: Regenerated.
+ * generated/maxloc0_16_i8.c: Regenerated.
+ * generated/maxloc0_16_r10.c: Regenerated.
+ * generated/maxloc0_16_r16.c: Regenerated.
+ * generated/maxloc0_16_r4.c: Regenerated.
+ * generated/maxloc0_16_r8.c: Regenerated.
+ * generated/maxloc0_4_i1.c: Regenerated.
+ * generated/maxloc0_4_i16.c: Regenerated.
+ * generated/maxloc0_4_i2.c: Regenerated.
+ * generated/maxloc0_4_i4.c: Regenerated.
+ * generated/maxloc0_4_i8.c: Regenerated.
+ * generated/maxloc0_4_r10.c: Regenerated.
+ * generated/maxloc0_4_r16.c: Regenerated.
+ * generated/maxloc0_4_r4.c: Regenerated.
+ * generated/maxloc0_4_r8.c: Regenerated.
+ * generated/maxloc0_8_i1.c: Regenerated.
+ * generated/maxloc0_8_i16.c: Regenerated.
+ * generated/maxloc0_8_i2.c: Regenerated.
+ * generated/maxloc0_8_i4.c: Regenerated.
+ * generated/maxloc0_8_i8.c: Regenerated.
+ * generated/maxloc0_8_r10.c: Regenerated.
+ * generated/maxloc0_8_r16.c: Regenerated.
+ * generated/maxloc0_8_r4.c: Regenerated.
+ * generated/maxloc0_8_r8.c: Regenerated.
+ * generated/maxloc1_16_i1.c: Regenerated.
+ * generated/maxloc1_16_i16.c: Regenerated.
+ * generated/maxloc1_16_i2.c: Regenerated.
+ * generated/maxloc1_16_i4.c: Regenerated.
+ * generated/maxloc1_16_i8.c: Regenerated.
+ * generated/maxloc1_16_r10.c: Regenerated.
+ * generated/maxloc1_16_r16.c: Regenerated.
+ * generated/maxloc1_16_r4.c: Regenerated.
+ * generated/maxloc1_16_r8.c: Regenerated.
+ * generated/maxloc1_4_i1.c: Regenerated.
+ * generated/maxloc1_4_i16.c: Regenerated.
+ * generated/maxloc1_4_i2.c: Regenerated.
+ * generated/maxloc1_4_i4.c: Regenerated.
+ * generated/maxloc1_4_i8.c: Regenerated.
+ * generated/maxloc1_4_r10.c: Regenerated.
+ * generated/maxloc1_4_r16.c: Regenerated.
+ * generated/maxloc1_4_r4.c: Regenerated.
+ * generated/maxloc1_4_r8.c: Regenerated.
+ * generated/maxloc1_8_i1.c: Regenerated.
+ * generated/maxloc1_8_i16.c: Regenerated.
+ * generated/maxloc1_8_i2.c: Regenerated.
+ * generated/maxloc1_8_i4.c: Regenerated.
+ * generated/maxloc1_8_i8.c: Regenerated.
+ * generated/maxloc1_8_r10.c: Regenerated.
+ * generated/maxloc1_8_r16.c: Regenerated.
+ * generated/maxloc1_8_r4.c: Regenerated.
+ * generated/maxloc1_8_r8.c: Regenerated.
+ * generated/maxval_i1.c: Regenerated.
+ * generated/maxval_i16.c: Regenerated.
+ * generated/maxval_i2.c: Regenerated.
+ * generated/maxval_i4.c: Regenerated.
+ * generated/maxval_i8.c: Regenerated.
+ * generated/maxval_r10.c: Regenerated.
+ * generated/maxval_r16.c: Regenerated.
+ * generated/maxval_r4.c: Regenerated.
+ * generated/maxval_r8.c: Regenerated.
+ * generated/minloc0_16_i1.c: Regenerated.
+ * generated/minloc0_16_i16.c: Regenerated.
+ * generated/minloc0_16_i2.c: Regenerated.
+ * generated/minloc0_16_i4.c: Regenerated.
+ * generated/minloc0_16_i8.c: Regenerated.
+ * generated/minloc0_16_r10.c: Regenerated.
+ * generated/minloc0_16_r16.c: Regenerated.
+ * generated/minloc0_16_r4.c: Regenerated.
+ * generated/minloc0_16_r8.c: Regenerated.
+ * generated/minloc0_4_i1.c: Regenerated.
+ * generated/minloc0_4_i16.c: Regenerated.
+ * generated/minloc0_4_i2.c: Regenerated.
+ * generated/minloc0_4_i4.c: Regenerated.
+ * generated/minloc0_4_i8.c: Regenerated.
+ * generated/minloc0_4_r10.c: Regenerated.
+ * generated/minloc0_4_r16.c: Regenerated.
+ * generated/minloc0_4_r4.c: Regenerated.
+ * generated/minloc0_4_r8.c: Regenerated.
+ * generated/minloc0_8_i1.c: Regenerated.
+ * generated/minloc0_8_i16.c: Regenerated.
+ * generated/minloc0_8_i2.c: Regenerated.
+ * generated/minloc0_8_i4.c: Regenerated.
+ * generated/minloc0_8_i8.c: Regenerated.
+ * generated/minloc0_8_r10.c: Regenerated.
+ * generated/minloc0_8_r16.c: Regenerated.
+ * generated/minloc0_8_r4.c: Regenerated.
+ * generated/minloc0_8_r8.c: Regenerated.
+ * generated/minloc1_16_i1.c: Regenerated.
+ * generated/minloc1_16_i16.c: Regenerated.
+ * generated/minloc1_16_i2.c: Regenerated.
+ * generated/minloc1_16_i4.c: Regenerated.
+ * generated/minloc1_16_i8.c: Regenerated.
+ * generated/minloc1_16_r10.c: Regenerated.
+ * generated/minloc1_16_r16.c: Regenerated.
+ * generated/minloc1_16_r4.c: Regenerated.
+ * generated/minloc1_16_r8.c: Regenerated.
+ * generated/minloc1_4_i1.c: Regenerated.
+ * generated/minloc1_4_i16.c: Regenerated.
+ * generated/minloc1_4_i2.c: Regenerated.
+ * generated/minloc1_4_i4.c: Regenerated.
+ * generated/minloc1_4_i8.c: Regenerated.
+ * generated/minloc1_4_r10.c: Regenerated.
+ * generated/minloc1_4_r16.c: Regenerated.
+ * generated/minloc1_4_r4.c: Regenerated.
+ * generated/minloc1_4_r8.c: Regenerated.
+ * generated/minloc1_8_i1.c: Regenerated.
+ * generated/minloc1_8_i16.c: Regenerated.
+ * generated/minloc1_8_i2.c: Regenerated.
+ * generated/minloc1_8_i4.c: Regenerated.
+ * generated/minloc1_8_i8.c: Regenerated.
+ * generated/minloc1_8_r10.c: Regenerated.
+ * generated/minloc1_8_r16.c: Regenerated.
+ * generated/minloc1_8_r4.c: Regenerated.
+ * generated/minloc1_8_r8.c: Regenerated.
+ * generated/minval_i1.c: Regenerated.
+ * generated/minval_i16.c: Regenerated.
+ * generated/minval_i2.c: Regenerated.
+ * generated/minval_i4.c: Regenerated.
+ * generated/minval_i8.c: Regenerated.
+ * generated/minval_r10.c: Regenerated.
+ * generated/minval_r16.c: Regenerated.
+ * generated/minval_r4.c: Regenerated.
+ * generated/minval_r8.c: Regenerated.
+ * generated/product_c10.c: Regenerated.
+ * generated/product_c16.c: Regenerated.
+ * generated/product_c4.c: Regenerated.
+ * generated/product_c8.c: Regenerated.
+ * generated/product_i1.c: Regenerated.
+ * generated/product_i16.c: Regenerated.
+ * generated/product_i2.c: Regenerated.
+ * generated/product_i4.c: Regenerated.
+ * generated/product_i8.c: Regenerated.
+ * generated/product_r10.c: Regenerated.
+ * generated/product_r16.c: Regenerated.
+ * generated/product_r4.c: Regenerated.
+ * generated/product_r8.c: Regenerated.
+ * generated/sum_c10.c: Regenerated.
+ * generated/sum_c16.c: Regenerated.
+ * generated/sum_c4.c: Regenerated.
+ * generated/sum_c8.c: Regenerated.
+ * generated/sum_i1.c: Regenerated.
+ * generated/sum_i16.c: Regenerated.
+ * generated/sum_i2.c: Regenerated.
+ * generated/sum_i4.c: Regenerated.
+ * generated/sum_i8.c: Regenerated.
+ * generated/sum_r10.c: Regenerated.
+ * generated/sum_r16.c: Regenerated.
+ * generated/sum_r4.c: Regenerated.
+ * generated/sum_r8.c: Regenerated.
+
2007-08-23 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/23138
diff --git a/libgfortran/generated/matmul_l16.c b/libgfortran/generated/matmul_l16.c
index 7e7f2f9..f4fb0b3 100644
--- a/libgfortran/generated/matmul_l16.c
+++ b/libgfortran/generated/matmul_l16.c
@@ -39,15 +39,15 @@ Boston, MA 02110-1301, USA. */
Either a or b can be rank 1. In this case x or y is 1. */
extern void matmul_l16 (gfc_array_l16 * const restrict,
- gfc_array_l4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
export_proto(matmul_l16);
void
matmul_l16 (gfc_array_l16 * const restrict retarray,
- gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b)
+ gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
{
- const GFC_INTEGER_4 * restrict abase;
- const GFC_INTEGER_4 * restrict bbase;
+ const GFC_LOGICAL_1 * restrict abase;
+ const GFC_LOGICAL_1 * restrict bbase;
GFC_LOGICAL_16 * restrict dest;
index_type rxstride;
index_type rystride;
@@ -57,9 +57,11 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
index_type ystride;
index_type x;
index_type y;
+ int a_kind;
+ int b_kind;
- const GFC_INTEGER_4 * restrict pa;
- const GFC_INTEGER_4 * restrict pb;
+ const GFC_LOGICAL_1 * restrict pa;
+ const GFC_LOGICAL_1 * restrict pb;
index_type astride;
index_type bstride;
index_type count;
@@ -99,17 +101,29 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
abase = a->data;
- if (GFC_DESCRIPTOR_SIZE (a) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (a) == 8);
- abase = GFOR_POINTER_L8_TO_L4 (abase);
- }
+ a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+ if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || a_kind == 16
+#endif
+ )
+ abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
bbase = b->data;
- if (GFC_DESCRIPTOR_SIZE (b) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (b) == 8);
- bbase = GFOR_POINTER_L8_TO_L4 (bbase);
- }
+ b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+ if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || b_kind == 16
+#endif
+ )
+ bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
dest = retarray->data;
@@ -128,7 +142,7 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
one. */
if (GFC_DESCRIPTOR_RANK (a) == 1)
{
- astride = a->dim[0].stride;
+ astride = a->dim[0].stride * a_kind;
count = a->dim[0].ubound + 1 - a->dim[0].lbound;
xstride = 0;
rxstride = 0;
@@ -136,14 +150,14 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
else
{
- astride = a->dim[1].stride;
+ astride = a->dim[1].stride * a_kind;
count = a->dim[1].ubound + 1 - a->dim[1].lbound;
xstride = a->dim[0].stride;
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
if (GFC_DESCRIPTOR_RANK (b) == 1)
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = 0;
rystride = 0;
@@ -151,7 +165,7 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
else
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = b->dim[1].stride;
ycount = b->dim[1].ubound + 1 - b->dim[1].lbound;
@@ -189,3 +203,4 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
#endif
+
diff --git a/libgfortran/generated/matmul_l4.c b/libgfortran/generated/matmul_l4.c
index 8428ff9..0b822f6 100644
--- a/libgfortran/generated/matmul_l4.c
+++ b/libgfortran/generated/matmul_l4.c
@@ -39,15 +39,15 @@ Boston, MA 02110-1301, USA. */
Either a or b can be rank 1. In this case x or y is 1. */
extern void matmul_l4 (gfc_array_l4 * const restrict,
- gfc_array_l4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
export_proto(matmul_l4);
void
matmul_l4 (gfc_array_l4 * const restrict retarray,
- gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b)
+ gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
{
- const GFC_INTEGER_4 * restrict abase;
- const GFC_INTEGER_4 * restrict bbase;
+ const GFC_LOGICAL_1 * restrict abase;
+ const GFC_LOGICAL_1 * restrict bbase;
GFC_LOGICAL_4 * restrict dest;
index_type rxstride;
index_type rystride;
@@ -57,9 +57,11 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
index_type ystride;
index_type x;
index_type y;
+ int a_kind;
+ int b_kind;
- const GFC_INTEGER_4 * restrict pa;
- const GFC_INTEGER_4 * restrict pb;
+ const GFC_LOGICAL_1 * restrict pa;
+ const GFC_LOGICAL_1 * restrict pb;
index_type astride;
index_type bstride;
index_type count;
@@ -99,17 +101,29 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
}
abase = a->data;
- if (GFC_DESCRIPTOR_SIZE (a) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (a) == 8);
- abase = GFOR_POINTER_L8_TO_L4 (abase);
- }
+ a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+ if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || a_kind == 16
+#endif
+ )
+ abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
bbase = b->data;
- if (GFC_DESCRIPTOR_SIZE (b) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (b) == 8);
- bbase = GFOR_POINTER_L8_TO_L4 (bbase);
- }
+ b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+ if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || b_kind == 16
+#endif
+ )
+ bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
dest = retarray->data;
@@ -128,7 +142,7 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
one. */
if (GFC_DESCRIPTOR_RANK (a) == 1)
{
- astride = a->dim[0].stride;
+ astride = a->dim[0].stride * a_kind;
count = a->dim[0].ubound + 1 - a->dim[0].lbound;
xstride = 0;
rxstride = 0;
@@ -136,14 +150,14 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
}
else
{
- astride = a->dim[1].stride;
+ astride = a->dim[1].stride * a_kind;
count = a->dim[1].ubound + 1 - a->dim[1].lbound;
xstride = a->dim[0].stride;
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
if (GFC_DESCRIPTOR_RANK (b) == 1)
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = 0;
rystride = 0;
@@ -151,7 +165,7 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
}
else
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = b->dim[1].stride;
ycount = b->dim[1].ubound + 1 - b->dim[1].lbound;
@@ -189,3 +203,4 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
}
#endif
+
diff --git a/libgfortran/generated/matmul_l8.c b/libgfortran/generated/matmul_l8.c
index 76dee0a..2fe0983 100644
--- a/libgfortran/generated/matmul_l8.c
+++ b/libgfortran/generated/matmul_l8.c
@@ -39,15 +39,15 @@ Boston, MA 02110-1301, USA. */
Either a or b can be rank 1. In this case x or y is 1. */
extern void matmul_l8 (gfc_array_l8 * const restrict,
- gfc_array_l4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
export_proto(matmul_l8);
void
matmul_l8 (gfc_array_l8 * const restrict retarray,
- gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b)
+ gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
{
- const GFC_INTEGER_4 * restrict abase;
- const GFC_INTEGER_4 * restrict bbase;
+ const GFC_LOGICAL_1 * restrict abase;
+ const GFC_LOGICAL_1 * restrict bbase;
GFC_LOGICAL_8 * restrict dest;
index_type rxstride;
index_type rystride;
@@ -57,9 +57,11 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
index_type ystride;
index_type x;
index_type y;
+ int a_kind;
+ int b_kind;
- const GFC_INTEGER_4 * restrict pa;
- const GFC_INTEGER_4 * restrict pb;
+ const GFC_LOGICAL_1 * restrict pa;
+ const GFC_LOGICAL_1 * restrict pb;
index_type astride;
index_type bstride;
index_type count;
@@ -99,17 +101,29 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
}
abase = a->data;
- if (GFC_DESCRIPTOR_SIZE (a) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (a) == 8);
- abase = GFOR_POINTER_L8_TO_L4 (abase);
- }
+ a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+ if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || a_kind == 16
+#endif
+ )
+ abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
bbase = b->data;
- if (GFC_DESCRIPTOR_SIZE (b) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (b) == 8);
- bbase = GFOR_POINTER_L8_TO_L4 (bbase);
- }
+ b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+ if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || b_kind == 16
+#endif
+ )
+ bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
dest = retarray->data;
@@ -128,7 +142,7 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
one. */
if (GFC_DESCRIPTOR_RANK (a) == 1)
{
- astride = a->dim[0].stride;
+ astride = a->dim[0].stride * a_kind;
count = a->dim[0].ubound + 1 - a->dim[0].lbound;
xstride = 0;
rxstride = 0;
@@ -136,14 +150,14 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
}
else
{
- astride = a->dim[1].stride;
+ astride = a->dim[1].stride * a_kind;
count = a->dim[1].ubound + 1 - a->dim[1].lbound;
xstride = a->dim[0].stride;
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
if (GFC_DESCRIPTOR_RANK (b) == 1)
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = 0;
rystride = 0;
@@ -151,7 +165,7 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
}
else
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = b->dim[1].stride;
ycount = b->dim[1].ubound + 1 - b->dim[1].lbound;
@@ -189,3 +203,4 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
}
#endif
+
diff --git a/libgfortran/generated/maxloc0_16_i1.c b/libgfortran/generated/maxloc0_16_i1.c
index 37b0bb0..aa52dec 100644
--- a/libgfortran/generated/maxloc0_16_i1.c
+++ b/libgfortran/generated/maxloc0_16_i1.c
@@ -148,13 +148,13 @@ maxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_i1 (gfc_array_i16 * const restrict,
- gfc_array_i1 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_i1);
void
mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
gfc_array_i1 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_1 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_i16.c b/libgfortran/generated/maxloc0_16_i16.c
index efd421b..30c91f5 100644
--- a/libgfortran/generated/maxloc0_16_i16.c
+++ b/libgfortran/generated/maxloc0_16_i16.c
@@ -148,13 +148,13 @@ maxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_i16 (gfc_array_i16 * const restrict,
- gfc_array_i16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_i16);
void
mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_i2.c b/libgfortran/generated/maxloc0_16_i2.c
index df2466b..bf55fbd 100644
--- a/libgfortran/generated/maxloc0_16_i2.c
+++ b/libgfortran/generated/maxloc0_16_i2.c
@@ -148,13 +148,13 @@ maxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_i2 (gfc_array_i16 * const restrict,
- gfc_array_i2 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_i2);
void
mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
gfc_array_i2 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_2 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_i4.c b/libgfortran/generated/maxloc0_16_i4.c
index 0154bf3..ffe10a8 100644
--- a/libgfortran/generated/maxloc0_16_i4.c
+++ b/libgfortran/generated/maxloc0_16_i4.c
@@ -148,13 +148,13 @@ maxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_i4 (gfc_array_i16 * const restrict,
- gfc_array_i4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_i4);
void
mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
gfc_array_i4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_i8.c b/libgfortran/generated/maxloc0_16_i8.c
index 8f7804b..9f61917 100644
--- a/libgfortran/generated/maxloc0_16_i8.c
+++ b/libgfortran/generated/maxloc0_16_i8.c
@@ -148,13 +148,13 @@ maxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_i8 (gfc_array_i16 * const restrict,
- gfc_array_i8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_i8);
void
mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
gfc_array_i8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_r10.c b/libgfortran/generated/maxloc0_16_r10.c
index 48910a9..4da00f2 100644
--- a/libgfortran/generated/maxloc0_16_r10.c
+++ b/libgfortran/generated/maxloc0_16_r10.c
@@ -148,13 +148,13 @@ maxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_r10 (gfc_array_i16 * const restrict,
- gfc_array_r10 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_r10);
void
mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
gfc_array_r10 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_10 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_r16.c b/libgfortran/generated/maxloc0_16_r16.c
index 8492293..3f33f63 100644
--- a/libgfortran/generated/maxloc0_16_r16.c
+++ b/libgfortran/generated/maxloc0_16_r16.c
@@ -148,13 +148,13 @@ maxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_r16 (gfc_array_i16 * const restrict,
- gfc_array_r16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_r16);
void
mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
gfc_array_r16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_r4.c b/libgfortran/generated/maxloc0_16_r4.c
index 602f334..0868d1f 100644
--- a/libgfortran/generated/maxloc0_16_r4.c
+++ b/libgfortran/generated/maxloc0_16_r4.c
@@ -148,13 +148,13 @@ maxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_r4 (gfc_array_i16 * const restrict,
- gfc_array_r4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_r4);
void
mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
gfc_array_r4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_16_r8.c b/libgfortran/generated/maxloc0_16_r8.c
index 1dbdda0..5fe6412 100644
--- a/libgfortran/generated/maxloc0_16_r8.c
+++ b/libgfortran/generated/maxloc0_16_r8.c
@@ -148,13 +148,13 @@ maxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc0_16_r8 (gfc_array_i16 * const restrict,
- gfc_array_r8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_16_r8);
void
mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
gfc_array_r8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_i1.c b/libgfortran/generated/maxloc0_4_i1.c
index de62212..10ed2d0 100644
--- a/libgfortran/generated/maxloc0_4_i1.c
+++ b/libgfortran/generated/maxloc0_4_i1.c
@@ -148,13 +148,13 @@ maxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_i1 (gfc_array_i4 * const restrict,
- gfc_array_i1 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_i1);
void
mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
gfc_array_i1 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_1 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_i16.c b/libgfortran/generated/maxloc0_4_i16.c
index 98245df..4e80d67 100644
--- a/libgfortran/generated/maxloc0_4_i16.c
+++ b/libgfortran/generated/maxloc0_4_i16.c
@@ -148,13 +148,13 @@ maxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_i16 (gfc_array_i4 * const restrict,
- gfc_array_i16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_i16);
void
mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
gfc_array_i16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_i2.c b/libgfortran/generated/maxloc0_4_i2.c
index 0a0a04e..15d975c 100644
--- a/libgfortran/generated/maxloc0_4_i2.c
+++ b/libgfortran/generated/maxloc0_4_i2.c
@@ -148,13 +148,13 @@ maxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_i2 (gfc_array_i4 * const restrict,
- gfc_array_i2 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_i2);
void
mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
gfc_array_i2 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_2 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c
index e8fe598..813c8bd 100644
--- a/libgfortran/generated/maxloc0_4_i4.c
+++ b/libgfortran/generated/maxloc0_4_i4.c
@@ -148,13 +148,13 @@ maxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_i4 (gfc_array_i4 * const restrict,
- gfc_array_i4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_i4);
void
mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c
index 80ef842..8c3fb95 100644
--- a/libgfortran/generated/maxloc0_4_i8.c
+++ b/libgfortran/generated/maxloc0_4_i8.c
@@ -148,13 +148,13 @@ maxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_i8 (gfc_array_i4 * const restrict,
- gfc_array_i8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_i8);
void
mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
gfc_array_i8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_r10.c b/libgfortran/generated/maxloc0_4_r10.c
index 0059d3b..74be989 100644
--- a/libgfortran/generated/maxloc0_4_r10.c
+++ b/libgfortran/generated/maxloc0_4_r10.c
@@ -148,13 +148,13 @@ maxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_r10 (gfc_array_i4 * const restrict,
- gfc_array_r10 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_r10);
void
mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
gfc_array_r10 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_10 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_r16.c b/libgfortran/generated/maxloc0_4_r16.c
index 9cb04bf..a6cf8bc 100644
--- a/libgfortran/generated/maxloc0_4_r16.c
+++ b/libgfortran/generated/maxloc0_4_r16.c
@@ -148,13 +148,13 @@ maxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_r16 (gfc_array_i4 * const restrict,
- gfc_array_r16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_r16);
void
mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
gfc_array_r16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c
index e568a44..50915d4 100644
--- a/libgfortran/generated/maxloc0_4_r4.c
+++ b/libgfortran/generated/maxloc0_4_r4.c
@@ -148,13 +148,13 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_r4 (gfc_array_i4 * const restrict,
- gfc_array_r4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_r4);
void
mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
gfc_array_r4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c
index e84235e..ec613e7 100644
--- a/libgfortran/generated/maxloc0_4_r8.c
+++ b/libgfortran/generated/maxloc0_4_r8.c
@@ -148,13 +148,13 @@ maxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc0_4_r8 (gfc_array_i4 * const restrict,
- gfc_array_r8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_4_r8);
void
mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
gfc_array_r8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i1.c b/libgfortran/generated/maxloc0_8_i1.c
index da132d4..916e4dc 100644
--- a/libgfortran/generated/maxloc0_8_i1.c
+++ b/libgfortran/generated/maxloc0_8_i1.c
@@ -148,13 +148,13 @@ maxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_i1 (gfc_array_i8 * const restrict,
- gfc_array_i1 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_i1);
void
mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
gfc_array_i1 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_1 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i16.c b/libgfortran/generated/maxloc0_8_i16.c
index 3b94ade..e554f46 100644
--- a/libgfortran/generated/maxloc0_8_i16.c
+++ b/libgfortran/generated/maxloc0_8_i16.c
@@ -148,13 +148,13 @@ maxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_i16 (gfc_array_i8 * const restrict,
- gfc_array_i16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_i16);
void
mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
gfc_array_i16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i2.c b/libgfortran/generated/maxloc0_8_i2.c
index 41f6457..40ebe0f 100644
--- a/libgfortran/generated/maxloc0_8_i2.c
+++ b/libgfortran/generated/maxloc0_8_i2.c
@@ -148,13 +148,13 @@ maxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_i2 (gfc_array_i8 * const restrict,
- gfc_array_i2 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_i2);
void
mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
gfc_array_i2 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_2 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c
index 93fa358..df9a43e 100644
--- a/libgfortran/generated/maxloc0_8_i4.c
+++ b/libgfortran/generated/maxloc0_8_i4.c
@@ -148,13 +148,13 @@ maxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_i4 (gfc_array_i8 * const restrict,
- gfc_array_i4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_i4);
void
mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
gfc_array_i4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c
index 49a8d52..eedd6e6 100644
--- a/libgfortran/generated/maxloc0_8_i8.c
+++ b/libgfortran/generated/maxloc0_8_i8.c
@@ -148,13 +148,13 @@ maxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_i8 (gfc_array_i8 * const restrict,
- gfc_array_i8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_i8);
void
mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_r10.c b/libgfortran/generated/maxloc0_8_r10.c
index ebe3f04..215b539 100644
--- a/libgfortran/generated/maxloc0_8_r10.c
+++ b/libgfortran/generated/maxloc0_8_r10.c
@@ -148,13 +148,13 @@ maxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_r10 (gfc_array_i8 * const restrict,
- gfc_array_r10 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_r10);
void
mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
gfc_array_r10 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_10 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_r16.c b/libgfortran/generated/maxloc0_8_r16.c
index 800f5c6..32f4b85 100644
--- a/libgfortran/generated/maxloc0_8_r16.c
+++ b/libgfortran/generated/maxloc0_8_r16.c
@@ -148,13 +148,13 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_r16 (gfc_array_i8 * const restrict,
- gfc_array_r16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_r16);
void
mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
gfc_array_r16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c
index f68a5ea..140f6cb 100644
--- a/libgfortran/generated/maxloc0_8_r4.c
+++ b/libgfortran/generated/maxloc0_8_r4.c
@@ -148,13 +148,13 @@ maxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_r4 (gfc_array_i8 * const restrict,
- gfc_array_r4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_r4);
void
mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
gfc_array_r4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c
index 5ec6afe..907dbc7 100644
--- a/libgfortran/generated/maxloc0_8_r8.c
+++ b/libgfortran/generated/maxloc0_8_r8.c
@@ -148,13 +148,13 @@ maxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc0_8_r8 (gfc_array_i8 * const restrict,
- gfc_array_r8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mmaxloc0_8_r8);
void
mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
gfc_array_r8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index 009ea6d..dc42f60 100644
--- a/libgfortran/generated/maxloc1_16_i1.c
+++ b/libgfortran/generated/maxloc1_16_i1.c
@@ -191,14 +191,14 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_i1 (gfc_array_i16 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_i1);
void
mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_i1 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index 94bab61..5b69dea 100644
--- a/libgfortran/generated/maxloc1_16_i16.c
+++ b/libgfortran/generated/maxloc1_16_i16.c
@@ -191,14 +191,14 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_i16 (gfc_array_i16 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_i16);
void
mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index 9cdd418..25360bc 100644
--- a/libgfortran/generated/maxloc1_16_i2.c
+++ b/libgfortran/generated/maxloc1_16_i2.c
@@ -191,14 +191,14 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_i2 (gfc_array_i16 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_i2);
void
mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_i2 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index 564b378..d089126 100644
--- a/libgfortran/generated/maxloc1_16_i4.c
+++ b/libgfortran/generated/maxloc1_16_i4.c
@@ -191,14 +191,14 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_i4 (gfc_array_i16 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_i4);
void
mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_i4 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index 91b68bf..502c951 100644
--- a/libgfortran/generated/maxloc1_16_i8.c
+++ b/libgfortran/generated/maxloc1_16_i8.c
@@ -191,14 +191,14 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_i8 (gfc_array_i16 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_i8);
void
mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_i8 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index f60e044..721b390 100644
--- a/libgfortran/generated/maxloc1_16_r10.c
+++ b/libgfortran/generated/maxloc1_16_r10.c
@@ -191,14 +191,14 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_r10 (gfc_array_i16 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_r10);
void
mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_r10 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index 22bdb6d..1a8e113 100644
--- a/libgfortran/generated/maxloc1_16_r16.c
+++ b/libgfortran/generated/maxloc1_16_r16.c
@@ -191,14 +191,14 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_r16 (gfc_array_i16 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_r16);
void
mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_r16 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index 4af1841..fda1bfa 100644
--- a/libgfortran/generated/maxloc1_16_r4.c
+++ b/libgfortran/generated/maxloc1_16_r4.c
@@ -191,14 +191,14 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_r4 (gfc_array_i16 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_r4);
void
mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_r4 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index 34d5ada..4d2208a 100644
--- a/libgfortran/generated/maxloc1_16_r8.c
+++ b/libgfortran/generated/maxloc1_16_r8.c
@@ -191,14 +191,14 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
extern void mmaxloc1_16_r8 (gfc_array_i16 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_16_r8);
void
mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_16_r8 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index e2f4141..0ae1a5b 100644
--- a/libgfortran/generated/maxloc1_4_i1.c
+++ b/libgfortran/generated/maxloc1_4_i1.c
@@ -191,14 +191,14 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_i1 (gfc_array_i4 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_i1);
void
mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index 30d782c..39a57c6 100644
--- a/libgfortran/generated/maxloc1_4_i16.c
+++ b/libgfortran/generated/maxloc1_4_i16.c
@@ -191,14 +191,14 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_i16 (gfc_array_i4 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_i16);
void
mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index 1e02f75..bbf43ec 100644
--- a/libgfortran/generated/maxloc1_4_i2.c
+++ b/libgfortran/generated/maxloc1_4_i2.c
@@ -191,14 +191,14 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_i2 (gfc_array_i4 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_i2);
void
mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 249efd7..5b00fb1 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -191,14 +191,14 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_i4 (gfc_array_i4 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_i4);
void
mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index b12a40b..f513114 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -191,14 +191,14 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_i8 (gfc_array_i4 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_i8);
void
mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index c498bff..17e9cbb 100644
--- a/libgfortran/generated/maxloc1_4_r10.c
+++ b/libgfortran/generated/maxloc1_4_r10.c
@@ -191,14 +191,14 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_r10 (gfc_array_i4 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_r10);
void
mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index 71c9723..7b1c558 100644
--- a/libgfortran/generated/maxloc1_4_r16.c
+++ b/libgfortran/generated/maxloc1_4_r16.c
@@ -191,14 +191,14 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_r16 (gfc_array_i4 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_r16);
void
mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 69f3ca9..4534e6f 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -191,14 +191,14 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_r4 (gfc_array_i4 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_r4);
void
mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index cab8eeb..7917aae 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -191,14 +191,14 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
extern void mmaxloc1_4_r8 (gfc_array_i4 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_4_r8);
void
mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index a6a7966..33966a2 100644
--- a/libgfortran/generated/maxloc1_8_i1.c
+++ b/libgfortran/generated/maxloc1_8_i1.c
@@ -191,14 +191,14 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_i1 (gfc_array_i8 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_i1);
void
mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index b366e68..612003e 100644
--- a/libgfortran/generated/maxloc1_8_i16.c
+++ b/libgfortran/generated/maxloc1_8_i16.c
@@ -191,14 +191,14 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_i16 (gfc_array_i8 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_i16);
void
mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index 0cfe019..04018e3 100644
--- a/libgfortran/generated/maxloc1_8_i2.c
+++ b/libgfortran/generated/maxloc1_8_i2.c
@@ -191,14 +191,14 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_i2 (gfc_array_i8 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_i2);
void
mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index e43ba95..833e4be 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -191,14 +191,14 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_i4 (gfc_array_i8 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_i4);
void
mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index 733462b..880ad7c 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -191,14 +191,14 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_i8 (gfc_array_i8 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_i8);
void
mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index deef31c..6de90ea 100644
--- a/libgfortran/generated/maxloc1_8_r10.c
+++ b/libgfortran/generated/maxloc1_8_r10.c
@@ -191,14 +191,14 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_r10 (gfc_array_i8 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_r10);
void
mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 24d55c3..06e00dc 100644
--- a/libgfortran/generated/maxloc1_8_r16.c
+++ b/libgfortran/generated/maxloc1_8_r16.c
@@ -191,14 +191,14 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_r16 (gfc_array_i8 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_r16);
void
mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index 3dd01b3..3d9d5c6 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -191,14 +191,14 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_r4 (gfc_array_i8 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_r4);
void
mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index 1adc4c8..ea2769e 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -191,14 +191,14 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
extern void mmaxloc1_8_r8 (gfc_array_i8 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxloc1_8_r8);
void
mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index 3c63c22..08334d5 100644
--- a/libgfortran/generated/maxval_i1.c
+++ b/libgfortran/generated/maxval_i1.c
@@ -185,14 +185,14 @@ maxval_i1 (gfc_array_i1 * const restrict retarray,
extern void mmaxval_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_i1);
void
mmaxval_i1 (gfc_array_i1 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_1 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index 9a217ac..56d7854 100644
--- a/libgfortran/generated/maxval_i16.c
+++ b/libgfortran/generated/maxval_i16.c
@@ -185,14 +185,14 @@ maxval_i16 (gfc_array_i16 * const restrict retarray,
extern void mmaxval_i16 (gfc_array_i16 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_i16);
void
mmaxval_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -286,22 +301,11 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index c8fd718..111f5b9 100644
--- a/libgfortran/generated/maxval_i2.c
+++ b/libgfortran/generated/maxval_i2.c
@@ -185,14 +185,14 @@ maxval_i2 (gfc_array_i2 * const restrict retarray,
extern void mmaxval_i2 (gfc_array_i2 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_i2);
void
mmaxval_i2 (gfc_array_i2 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_2 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index c800f1a..4413477 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -185,14 +185,14 @@ maxval_i4 (gfc_array_i4 * const restrict retarray,
extern void mmaxval_i4 (gfc_array_i4 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_i4);
void
mmaxval_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index 898ef3c..7e3cb16 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -185,14 +185,14 @@ maxval_i8 (gfc_array_i8 * const restrict retarray,
extern void mmaxval_i8 (gfc_array_i8 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_i8);
void
mmaxval_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index 3123d06..1433864 100644
--- a/libgfortran/generated/maxval_r10.c
+++ b/libgfortran/generated/maxval_r10.c
@@ -185,14 +185,14 @@ maxval_r10 (gfc_array_r10 * const restrict retarray,
extern void mmaxval_r10 (gfc_array_r10 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_r10);
void
mmaxval_r10 (gfc_array_r10 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_10 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_10 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index bdef616..6b4c409 100644
--- a/libgfortran/generated/maxval_r16.c
+++ b/libgfortran/generated/maxval_r16.c
@@ -185,14 +185,14 @@ maxval_r16 (gfc_array_r16 * const restrict retarray,
extern void mmaxval_r16 (gfc_array_r16 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_r16);
void
mmaxval_r16 (gfc_array_r16 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_16 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index ebdb968..9e797d3 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -185,14 +185,14 @@ maxval_r4 (gfc_array_r4 * const restrict retarray,
extern void mmaxval_r4 (gfc_array_r4 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_r4);
void
mmaxval_r4 (gfc_array_r4 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_4 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index 6a05df7..ff4ed07 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -185,14 +185,14 @@ maxval_r8 (gfc_array_r8 * const restrict retarray,
extern void mmaxval_r8 (gfc_array_r8 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mmaxval_r8);
void
mmaxval_r8 (gfc_array_r8 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_8 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc0_16_i1.c b/libgfortran/generated/minloc0_16_i1.c
index e8f9856..5afd387 100644
--- a/libgfortran/generated/minloc0_16_i1.c
+++ b/libgfortran/generated/minloc0_16_i1.c
@@ -148,13 +148,13 @@ minloc0_16_i1 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_i1 (gfc_array_i16 * const restrict,
- gfc_array_i1 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_i1);
void
mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
gfc_array_i1 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_1 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_i16.c b/libgfortran/generated/minloc0_16_i16.c
index 31ade24..5f49874 100644
--- a/libgfortran/generated/minloc0_16_i16.c
+++ b/libgfortran/generated/minloc0_16_i16.c
@@ -148,13 +148,13 @@ minloc0_16_i16 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_i16 (gfc_array_i16 * const restrict,
- gfc_array_i16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_i16);
void
mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_i2.c b/libgfortran/generated/minloc0_16_i2.c
index 772519d..fed8015 100644
--- a/libgfortran/generated/minloc0_16_i2.c
+++ b/libgfortran/generated/minloc0_16_i2.c
@@ -148,13 +148,13 @@ minloc0_16_i2 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_i2 (gfc_array_i16 * const restrict,
- gfc_array_i2 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_i2);
void
mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
gfc_array_i2 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_2 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_i4.c b/libgfortran/generated/minloc0_16_i4.c
index 3096ec0..bfb4541 100644
--- a/libgfortran/generated/minloc0_16_i4.c
+++ b/libgfortran/generated/minloc0_16_i4.c
@@ -148,13 +148,13 @@ minloc0_16_i4 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_i4 (gfc_array_i16 * const restrict,
- gfc_array_i4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_i4);
void
mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
gfc_array_i4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_i8.c b/libgfortran/generated/minloc0_16_i8.c
index 99b53be..d07297e 100644
--- a/libgfortran/generated/minloc0_16_i8.c
+++ b/libgfortran/generated/minloc0_16_i8.c
@@ -148,13 +148,13 @@ minloc0_16_i8 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_i8 (gfc_array_i16 * const restrict,
- gfc_array_i8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_i8);
void
mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
gfc_array_i8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_INTEGER_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_r10.c b/libgfortran/generated/minloc0_16_r10.c
index 5c043f8..34b1d56 100644
--- a/libgfortran/generated/minloc0_16_r10.c
+++ b/libgfortran/generated/minloc0_16_r10.c
@@ -148,13 +148,13 @@ minloc0_16_r10 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_r10 (gfc_array_i16 * const restrict,
- gfc_array_r10 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_r10);
void
mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
gfc_array_r10 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_10 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_r16.c b/libgfortran/generated/minloc0_16_r16.c
index 9a87bb6..6e60e19 100644
--- a/libgfortran/generated/minloc0_16_r16.c
+++ b/libgfortran/generated/minloc0_16_r16.c
@@ -148,13 +148,13 @@ minloc0_16_r16 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_r16 (gfc_array_i16 * const restrict,
- gfc_array_r16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_r16);
void
mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
gfc_array_r16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_r4.c b/libgfortran/generated/minloc0_16_r4.c
index dbe167e..7e98c18 100644
--- a/libgfortran/generated/minloc0_16_r4.c
+++ b/libgfortran/generated/minloc0_16_r4.c
@@ -148,13 +148,13 @@ minloc0_16_r4 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_r4 (gfc_array_i16 * const restrict,
- gfc_array_r4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_r4);
void
mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
gfc_array_r4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_16_r8.c b/libgfortran/generated/minloc0_16_r8.c
index 8c43bb5..4c2044b 100644
--- a/libgfortran/generated/minloc0_16_r8.c
+++ b/libgfortran/generated/minloc0_16_r8.c
@@ -148,13 +148,13 @@ minloc0_16_r8 (gfc_array_i16 * const restrict retarray,
extern void mminloc0_16_r8 (gfc_array_i16 * const restrict,
- gfc_array_r8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_16_r8);
void
mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
gfc_array_r8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
index_type dstride;
GFC_INTEGER_16 *dest;
const GFC_REAL_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_i1.c b/libgfortran/generated/minloc0_4_i1.c
index 42d64a8..645af76 100644
--- a/libgfortran/generated/minloc0_4_i1.c
+++ b/libgfortran/generated/minloc0_4_i1.c
@@ -148,13 +148,13 @@ minloc0_4_i1 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_i1 (gfc_array_i4 * const restrict,
- gfc_array_i1 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_i1);
void
mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
gfc_array_i1 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_1 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_i16.c b/libgfortran/generated/minloc0_4_i16.c
index 19b960e..5160d2e 100644
--- a/libgfortran/generated/minloc0_4_i16.c
+++ b/libgfortran/generated/minloc0_4_i16.c
@@ -148,13 +148,13 @@ minloc0_4_i16 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_i16 (gfc_array_i4 * const restrict,
- gfc_array_i16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_i16);
void
mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
gfc_array_i16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_i2.c b/libgfortran/generated/minloc0_4_i2.c
index c57d5e7..28d0a7f 100644
--- a/libgfortran/generated/minloc0_4_i2.c
+++ b/libgfortran/generated/minloc0_4_i2.c
@@ -148,13 +148,13 @@ minloc0_4_i2 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_i2 (gfc_array_i4 * const restrict,
- gfc_array_i2 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_i2);
void
mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
gfc_array_i2 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_2 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c
index a8c5a5e..a820231 100644
--- a/libgfortran/generated/minloc0_4_i4.c
+++ b/libgfortran/generated/minloc0_4_i4.c
@@ -148,13 +148,13 @@ minloc0_4_i4 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_i4 (gfc_array_i4 * const restrict,
- gfc_array_i4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_i4);
void
mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c
index 61eab8c..4d63109 100644
--- a/libgfortran/generated/minloc0_4_i8.c
+++ b/libgfortran/generated/minloc0_4_i8.c
@@ -148,13 +148,13 @@ minloc0_4_i8 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_i8 (gfc_array_i4 * const restrict,
- gfc_array_i8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_i8);
void
mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
gfc_array_i8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_INTEGER_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_r10.c b/libgfortran/generated/minloc0_4_r10.c
index 20a2252..c2d8d82 100644
--- a/libgfortran/generated/minloc0_4_r10.c
+++ b/libgfortran/generated/minloc0_4_r10.c
@@ -148,13 +148,13 @@ minloc0_4_r10 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_r10 (gfc_array_i4 * const restrict,
- gfc_array_r10 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_r10);
void
mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
gfc_array_r10 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_10 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_r16.c b/libgfortran/generated/minloc0_4_r16.c
index 83f293c..9a42aab 100644
--- a/libgfortran/generated/minloc0_4_r16.c
+++ b/libgfortran/generated/minloc0_4_r16.c
@@ -148,13 +148,13 @@ minloc0_4_r16 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_r16 (gfc_array_i4 * const restrict,
- gfc_array_r16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_r16);
void
mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
gfc_array_r16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c
index 669a8c1..a2c6725 100644
--- a/libgfortran/generated/minloc0_4_r4.c
+++ b/libgfortran/generated/minloc0_4_r4.c
@@ -148,13 +148,13 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_r4 (gfc_array_i4 * const restrict,
- gfc_array_r4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_r4);
void
mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
gfc_array_r4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c
index fbe9abd..ceefacf 100644
--- a/libgfortran/generated/minloc0_4_r8.c
+++ b/libgfortran/generated/minloc0_4_r8.c
@@ -148,13 +148,13 @@ minloc0_4_r8 (gfc_array_i4 * const restrict retarray,
extern void mminloc0_4_r8 (gfc_array_i4 * const restrict,
- gfc_array_r8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_4_r8);
void
mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
gfc_array_r8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
index_type dstride;
GFC_INTEGER_4 *dest;
const GFC_REAL_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i1.c b/libgfortran/generated/minloc0_8_i1.c
index e1b95ce..2629591 100644
--- a/libgfortran/generated/minloc0_8_i1.c
+++ b/libgfortran/generated/minloc0_8_i1.c
@@ -148,13 +148,13 @@ minloc0_8_i1 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_i1 (gfc_array_i8 * const restrict,
- gfc_array_i1 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_i1);
void
mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
gfc_array_i1 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_1 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i16.c b/libgfortran/generated/minloc0_8_i16.c
index 390b74a..30d8551 100644
--- a/libgfortran/generated/minloc0_8_i16.c
+++ b/libgfortran/generated/minloc0_8_i16.c
@@ -148,13 +148,13 @@ minloc0_8_i16 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_i16 (gfc_array_i8 * const restrict,
- gfc_array_i16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_i16);
void
mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
gfc_array_i16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i2.c b/libgfortran/generated/minloc0_8_i2.c
index c070429..34c2363 100644
--- a/libgfortran/generated/minloc0_8_i2.c
+++ b/libgfortran/generated/minloc0_8_i2.c
@@ -148,13 +148,13 @@ minloc0_8_i2 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_i2 (gfc_array_i8 * const restrict,
- gfc_array_i2 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_i2);
void
mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
gfc_array_i2 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_2 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c
index 524af74..e1053e0 100644
--- a/libgfortran/generated/minloc0_8_i4.c
+++ b/libgfortran/generated/minloc0_8_i4.c
@@ -148,13 +148,13 @@ minloc0_8_i4 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_i4 (gfc_array_i8 * const restrict,
- gfc_array_i4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_i4);
void
mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
gfc_array_i4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c
index 510973c..851645e 100644
--- a/libgfortran/generated/minloc0_8_i8.c
+++ b/libgfortran/generated/minloc0_8_i8.c
@@ -148,13 +148,13 @@ minloc0_8_i8 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_i8 (gfc_array_i8 * const restrict,
- gfc_array_i8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_i8);
void
mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_INTEGER_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_r10.c b/libgfortran/generated/minloc0_8_r10.c
index 7e4dcb0..569efa0 100644
--- a/libgfortran/generated/minloc0_8_r10.c
+++ b/libgfortran/generated/minloc0_8_r10.c
@@ -148,13 +148,13 @@ minloc0_8_r10 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_r10 (gfc_array_i8 * const restrict,
- gfc_array_r10 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_r10);
void
mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
gfc_array_r10 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_10 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_r16.c b/libgfortran/generated/minloc0_8_r16.c
index dfb6bd6..4e19efa 100644
--- a/libgfortran/generated/minloc0_8_r16.c
+++ b/libgfortran/generated/minloc0_8_r16.c
@@ -148,13 +148,13 @@ minloc0_8_r16 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_r16 (gfc_array_i8 * const restrict,
- gfc_array_r16 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_r16);
void
mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
gfc_array_r16 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_16 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c
index d10f942..0bcf5c6 100644
--- a/libgfortran/generated/minloc0_8_r4.c
+++ b/libgfortran/generated/minloc0_8_r4.c
@@ -148,13 +148,13 @@ minloc0_8_r4 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_r4 (gfc_array_i8 * const restrict,
- gfc_array_r4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_r4);
void
mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
gfc_array_r4 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_4 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c
index 781f0ca..7789633 100644
--- a/libgfortran/generated/minloc0_8_r8.c
+++ b/libgfortran/generated/minloc0_8_r8.c
@@ -148,13 +148,13 @@ minloc0_8_r8 (gfc_array_i8 * const restrict retarray,
extern void mminloc0_8_r8 (gfc_array_i8 * const restrict,
- gfc_array_r8 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
export_proto(mminloc0_8_r8);
void
mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
gfc_array_r8 * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -163,9 +163,10 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
index_type dstride;
GFC_INTEGER_8 *dest;
const GFC_REAL_8 *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -189,12 +190,25 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -207,17 +221,6 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index fa25b3d..1e7b09b 100644
--- a/libgfortran/generated/minloc1_16_i1.c
+++ b/libgfortran/generated/minloc1_16_i1.c
@@ -191,14 +191,14 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_i1 (gfc_array_i16 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_i1);
void
mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_i1 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index 4ea816f..0570e16 100644
--- a/libgfortran/generated/minloc1_16_i16.c
+++ b/libgfortran/generated/minloc1_16_i16.c
@@ -191,14 +191,14 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_i16 (gfc_array_i16 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_i16);
void
mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index 6251f19..3ec829e 100644
--- a/libgfortran/generated/minloc1_16_i2.c
+++ b/libgfortran/generated/minloc1_16_i2.c
@@ -191,14 +191,14 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_i2 (gfc_array_i16 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_i2);
void
mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_i2 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index c70b028..1d2a229 100644
--- a/libgfortran/generated/minloc1_16_i4.c
+++ b/libgfortran/generated/minloc1_16_i4.c
@@ -191,14 +191,14 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_i4 (gfc_array_i16 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_i4);
void
mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_i4 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index 9135327..009bfc8 100644
--- a/libgfortran/generated/minloc1_16_i8.c
+++ b/libgfortran/generated/minloc1_16_i8.c
@@ -191,14 +191,14 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_i8 (gfc_array_i16 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_i8);
void
mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_i8 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index 77cc644..18e7d90 100644
--- a/libgfortran/generated/minloc1_16_r10.c
+++ b/libgfortran/generated/minloc1_16_r10.c
@@ -191,14 +191,14 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_r10 (gfc_array_i16 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_r10);
void
mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_r10 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index 146a66f..11d6670 100644
--- a/libgfortran/generated/minloc1_16_r16.c
+++ b/libgfortran/generated/minloc1_16_r16.c
@@ -191,14 +191,14 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_r16 (gfc_array_i16 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_r16);
void
mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_r16 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index 93bf9e9..36ab933 100644
--- a/libgfortran/generated/minloc1_16_r4.c
+++ b/libgfortran/generated/minloc1_16_r4.c
@@ -191,14 +191,14 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_r4 (gfc_array_i16 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_r4);
void
mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_r4 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index 8313589..4bc2f7e 100644
--- a/libgfortran/generated/minloc1_16_r8.c
+++ b/libgfortran/generated/minloc1_16_r8.c
@@ -191,14 +191,14 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
extern void mminloc1_16_r8 (gfc_array_i16 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_16_r8);
void
mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_16_r8 (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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -292,22 +307,11 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index 637a7ec..b94775d 100644
--- a/libgfortran/generated/minloc1_4_i1.c
+++ b/libgfortran/generated/minloc1_4_i1.c
@@ -191,14 +191,14 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_i1 (gfc_array_i4 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_i1);
void
mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index abc9d79..720d35c 100644
--- a/libgfortran/generated/minloc1_4_i16.c
+++ b/libgfortran/generated/minloc1_4_i16.c
@@ -191,14 +191,14 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_i16 (gfc_array_i4 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_i16);
void
mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index 0183035..10a3537 100644
--- a/libgfortran/generated/minloc1_4_i2.c
+++ b/libgfortran/generated/minloc1_4_i2.c
@@ -191,14 +191,14 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_i2 (gfc_array_i4 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_i2);
void
mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index 8e746c8..941ac82 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -191,14 +191,14 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_i4 (gfc_array_i4 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_i4);
void
mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index a05e972..3676806 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -191,14 +191,14 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_i8 (gfc_array_i4 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_i8);
void
mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index 2c36814..84631c0 100644
--- a/libgfortran/generated/minloc1_4_r10.c
+++ b/libgfortran/generated/minloc1_4_r10.c
@@ -191,14 +191,14 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_r10 (gfc_array_i4 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_r10);
void
mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index 7258dda..d3e9b5f 100644
--- a/libgfortran/generated/minloc1_4_r16.c
+++ b/libgfortran/generated/minloc1_4_r16.c
@@ -191,14 +191,14 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_r16 (gfc_array_i4 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_r16);
void
mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index b36cee2..e2ccd58 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -191,14 +191,14 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_r4 (gfc_array_i4 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_r4);
void
mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index a4ad138..6e96a65 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -191,14 +191,14 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
extern void mminloc1_4_r8 (gfc_array_i4 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_4_r8);
void
mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index 36f4982..caa48af 100644
--- a/libgfortran/generated/minloc1_8_i1.c
+++ b/libgfortran/generated/minloc1_8_i1.c
@@ -191,14 +191,14 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_i1 (gfc_array_i8 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_i1);
void
mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index 907454d..1928c40 100644
--- a/libgfortran/generated/minloc1_8_i16.c
+++ b/libgfortran/generated/minloc1_8_i16.c
@@ -191,14 +191,14 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_i16 (gfc_array_i8 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_i16);
void
mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index 1d6526e..6c40de8 100644
--- a/libgfortran/generated/minloc1_8_i2.c
+++ b/libgfortran/generated/minloc1_8_i2.c
@@ -191,14 +191,14 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_i2 (gfc_array_i8 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_i2);
void
mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index cebf452..9f563d5 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -191,14 +191,14 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_i4 (gfc_array_i8 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_i4);
void
mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index 1b822e2..6cdeec7 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -191,14 +191,14 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_i8 (gfc_array_i8 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_i8);
void
mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index f7fb3bf..1dc5be6 100644
--- a/libgfortran/generated/minloc1_8_r10.c
+++ b/libgfortran/generated/minloc1_8_r10.c
@@ -191,14 +191,14 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_r10 (gfc_array_i8 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_r10);
void
mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index cbba161..5bec299 100644
--- a/libgfortran/generated/minloc1_8_r16.c
+++ b/libgfortran/generated/minloc1_8_r16.c
@@ -191,14 +191,14 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_r16 (gfc_array_i8 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_r16);
void
mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index 7508178..9952148 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -191,14 +191,14 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_r4 (gfc_array_i8 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_r4);
void
mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index 372ff21..44e3eec 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -191,14 +191,14 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
extern void mminloc1_8_r8 (gfc_array_i8 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminloc1_8_r8);
void
mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -207,13 +207,14 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -221,13 +222,27 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -237,7 +252,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -292,22 +307,11 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c
index 6ac105b..5c72eb9 100644
--- a/libgfortran/generated/minval_i1.c
+++ b/libgfortran/generated/minval_i1.c
@@ -185,14 +185,14 @@ minval_i1 (gfc_array_i1 * const restrict retarray,
extern void mminval_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_i1);
void
mminval_i1 (gfc_array_i1 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_1 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index 3dd1678..eedadad 100644
--- a/libgfortran/generated/minval_i16.c
+++ b/libgfortran/generated/minval_i16.c
@@ -185,14 +185,14 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
extern void mminval_i16 (gfc_array_i16 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_i16);
void
mminval_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ 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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -286,22 +301,11 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c
index 6d0d3eb..2ca3506 100644
--- a/libgfortran/generated/minval_i2.c
+++ b/libgfortran/generated/minval_i2.c
@@ -185,14 +185,14 @@ minval_i2 (gfc_array_i2 * const restrict retarray,
extern void mminval_i2 (gfc_array_i2 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_i2);
void
mminval_i2 (gfc_array_i2 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_2 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index 2d6c1de..2f5796e 100644
--- a/libgfortran/generated/minval_i4.c
+++ b/libgfortran/generated/minval_i4.c
@@ -185,14 +185,14 @@ minval_i4 (gfc_array_i4 * const restrict retarray,
extern void mminval_i4 (gfc_array_i4 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_i4);
void
mminval_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index 78158ca..0bdbb81 100644
--- a/libgfortran/generated/minval_i8.c
+++ b/libgfortran/generated/minval_i8.c
@@ -185,14 +185,14 @@ minval_i8 (gfc_array_i8 * const restrict retarray,
extern void mminval_i8 (gfc_array_i8 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_i8);
void
mminval_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c
index fe87af4..aa5c576 100644
--- a/libgfortran/generated/minval_r10.c
+++ b/libgfortran/generated/minval_r10.c
@@ -185,14 +185,14 @@ minval_r10 (gfc_array_r10 * const restrict retarray,
extern void mminval_r10 (gfc_array_r10 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_r10);
void
mminval_r10 (gfc_array_r10 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_10 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_10 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c
index 58596b5..ada6f8c 100644
--- a/libgfortran/generated/minval_r16.c
+++ b/libgfortran/generated/minval_r16.c
@@ -185,14 +185,14 @@ minval_r16 (gfc_array_r16 * const restrict retarray,
extern void mminval_r16 (gfc_array_r16 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_r16);
void
mminval_r16 (gfc_array_r16 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_16 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c
index a11549e..7143b2b 100644
--- a/libgfortran/generated/minval_r4.c
+++ b/libgfortran/generated/minval_r4.c
@@ -185,14 +185,14 @@ minval_r4 (gfc_array_r4 * const restrict retarray,
extern void mminval_r4 (gfc_array_r4 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_r4);
void
mminval_r4 (gfc_array_r4 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_4 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c
index 14ca055..c21dc23 100644
--- a/libgfortran/generated/minval_r8.c
+++ b/libgfortran/generated/minval_r8.c
@@ -185,14 +185,14 @@ minval_r8 (gfc_array_r8 * const restrict retarray,
extern void mminval_r8 (gfc_array_r8 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mminval_r8);
void
mminval_r8 (gfc_array_r8 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -201,13 +201,14 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_8 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -215,13 +216,27 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -231,7 +246,7 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -286,22 +301,11 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c
index 0d73a9b..b63cb6a 100644
--- a/libgfortran/generated/product_c10.c
+++ b/libgfortran/generated/product_c10.c
@@ -184,14 +184,14 @@ product_c10 (gfc_array_c10 * const restrict retarray,
extern void mproduct_c10 (gfc_array_c10 * const restrict,
gfc_array_c10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_c10);
void
mproduct_c10 (gfc_array_c10 * const restrict retarray,
gfc_array_c10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_10 * restrict dest;
const GFC_COMPLEX_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_10 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c
index a5c8bd0..3b6265a 100644
--- a/libgfortran/generated/product_c16.c
+++ b/libgfortran/generated/product_c16.c
@@ -184,14 +184,14 @@ product_c16 (gfc_array_c16 * const restrict retarray,
extern void mproduct_c16 (gfc_array_c16 * const restrict,
gfc_array_c16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_c16);
void
mproduct_c16 (gfc_array_c16 * const restrict retarray,
gfc_array_c16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_16 * restrict dest;
const GFC_COMPLEX_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index 45a62c9..07e0df0 100644
--- a/libgfortran/generated/product_c4.c
+++ b/libgfortran/generated/product_c4.c
@@ -184,14 +184,14 @@ product_c4 (gfc_array_c4 * const restrict retarray,
extern void mproduct_c4 (gfc_array_c4 * const restrict,
gfc_array_c4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_c4);
void
mproduct_c4 (gfc_array_c4 * const restrict retarray,
gfc_array_c4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_4 * restrict dest;
const GFC_COMPLEX_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index 69bcb87..a81241e 100644
--- a/libgfortran/generated/product_c8.c
+++ b/libgfortran/generated/product_c8.c
@@ -184,14 +184,14 @@ product_c8 (gfc_array_c8 * const restrict retarray,
extern void mproduct_c8 (gfc_array_c8 * const restrict,
gfc_array_c8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_c8);
void
mproduct_c8 (gfc_array_c8 * const restrict retarray,
gfc_array_c8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_8 * restrict dest;
const GFC_COMPLEX_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c
index 76427e4..4c68414 100644
--- a/libgfortran/generated/product_i1.c
+++ b/libgfortran/generated/product_i1.c
@@ -184,14 +184,14 @@ product_i1 (gfc_array_i1 * const restrict retarray,
extern void mproduct_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_i1);
void
mproduct_i1 (gfc_array_i1 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_1 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c
index 7b73578..9e81e59 100644
--- a/libgfortran/generated/product_i16.c
+++ b/libgfortran/generated/product_i16.c
@@ -184,14 +184,14 @@ product_i16 (gfc_array_i16 * const restrict retarray,
extern void mproduct_i16 (gfc_array_i16 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_i16);
void
mproduct_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -285,22 +300,11 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c
index bdb51a6..dde442a 100644
--- a/libgfortran/generated/product_i2.c
+++ b/libgfortran/generated/product_i2.c
@@ -184,14 +184,14 @@ product_i2 (gfc_array_i2 * const restrict retarray,
extern void mproduct_i2 (gfc_array_i2 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_i2);
void
mproduct_i2 (gfc_array_i2 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_2 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index 72d0e1a..50875da 100644
--- a/libgfortran/generated/product_i4.c
+++ b/libgfortran/generated/product_i4.c
@@ -184,14 +184,14 @@ product_i4 (gfc_array_i4 * const restrict retarray,
extern void mproduct_i4 (gfc_array_i4 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_i4);
void
mproduct_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index d1ae82e..0b9d268 100644
--- a/libgfortran/generated/product_i8.c
+++ b/libgfortran/generated/product_i8.c
@@ -184,14 +184,14 @@ product_i8 (gfc_array_i8 * const restrict retarray,
extern void mproduct_i8 (gfc_array_i8 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_i8);
void
mproduct_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c
index f19b67b..2873250 100644
--- a/libgfortran/generated/product_r10.c
+++ b/libgfortran/generated/product_r10.c
@@ -184,14 +184,14 @@ product_r10 (gfc_array_r10 * const restrict retarray,
extern void mproduct_r10 (gfc_array_r10 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_r10);
void
mproduct_r10 (gfc_array_r10 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_10 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_10 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c
index 3d0a76a..6114951 100644
--- a/libgfortran/generated/product_r16.c
+++ b/libgfortran/generated/product_r16.c
@@ -184,14 +184,14 @@ product_r16 (gfc_array_r16 * const restrict retarray,
extern void mproduct_r16 (gfc_array_r16 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_r16);
void
mproduct_r16 (gfc_array_r16 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_16 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c
index 069b0d0..b3c9a0b 100644
--- a/libgfortran/generated/product_r4.c
+++ b/libgfortran/generated/product_r4.c
@@ -184,14 +184,14 @@ product_r4 (gfc_array_r4 * const restrict retarray,
extern void mproduct_r4 (gfc_array_r4 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_r4);
void
mproduct_r4 (gfc_array_r4 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_4 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c
index e9cfae3..8d49b27 100644
--- a/libgfortran/generated/product_r8.c
+++ b/libgfortran/generated/product_r8.c
@@ -184,14 +184,14 @@ product_r8 (gfc_array_r8 * const restrict retarray,
extern void mproduct_r8 (gfc_array_r8 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(mproduct_r8);
void
mproduct_r8 (gfc_array_r8 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_8 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c
index 96b878b..2fa7594 100644
--- a/libgfortran/generated/sum_c10.c
+++ b/libgfortran/generated/sum_c10.c
@@ -184,14 +184,14 @@ sum_c10 (gfc_array_c10 * const restrict retarray,
extern void msum_c10 (gfc_array_c10 * const restrict,
gfc_array_c10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_c10);
void
msum_c10 (gfc_array_c10 * const restrict retarray,
gfc_array_c10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_10 * restrict dest;
const GFC_COMPLEX_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_10 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c
index a99d4f6..b74aa43 100644
--- a/libgfortran/generated/sum_c16.c
+++ b/libgfortran/generated/sum_c16.c
@@ -184,14 +184,14 @@ sum_c16 (gfc_array_c16 * const restrict retarray,
extern void msum_c16 (gfc_array_c16 * const restrict,
gfc_array_c16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_c16);
void
msum_c16 (gfc_array_c16 * const restrict retarray,
gfc_array_c16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_16 * restrict dest;
const GFC_COMPLEX_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index 83979fb..bf41330 100644
--- a/libgfortran/generated/sum_c4.c
+++ b/libgfortran/generated/sum_c4.c
@@ -184,14 +184,14 @@ sum_c4 (gfc_array_c4 * const restrict retarray,
extern void msum_c4 (gfc_array_c4 * const restrict,
gfc_array_c4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_c4);
void
msum_c4 (gfc_array_c4 * const restrict retarray,
gfc_array_c4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_4 * restrict dest;
const GFC_COMPLEX_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index d82092a..d7c3c9d 100644
--- a/libgfortran/generated/sum_c8.c
+++ b/libgfortran/generated/sum_c8.c
@@ -184,14 +184,14 @@ sum_c8 (gfc_array_c8 * const restrict retarray,
extern void msum_c8 (gfc_array_c8 * const restrict,
gfc_array_c8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_c8);
void
msum_c8 (gfc_array_c8 * const restrict retarray,
gfc_array_c8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_COMPLEX_8 * restrict dest;
const GFC_COMPLEX_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_COMPLEX_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_COMPLEX_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c
index 87205b8..0b0d3c8 100644
--- a/libgfortran/generated/sum_i1.c
+++ b/libgfortran/generated/sum_i1.c
@@ -184,14 +184,14 @@ sum_i1 (gfc_array_i1 * const restrict retarray,
extern void msum_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_i1);
void
msum_i1 (gfc_array_i1 * const restrict retarray,
gfc_array_i1 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_1 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_1 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c
index 8385773..0f0bc55 100644
--- a/libgfortran/generated/sum_i16.c
+++ b/libgfortran/generated/sum_i16.c
@@ -184,14 +184,14 @@ sum_i16 (gfc_array_i16 * const restrict retarray,
extern void msum_i16 (gfc_array_i16 * const restrict,
gfc_array_i16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_i16);
void
msum_i16 (gfc_array_i16 * const restrict retarray,
gfc_array_i16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_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;
+ mstride[n] = mask->dim[n + 1].stride * mask_kind;
extent[n] =
array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound;
@@ -285,22 +300,11 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c
index c4452c3..c951d67 100644
--- a/libgfortran/generated/sum_i2.c
+++ b/libgfortran/generated/sum_i2.c
@@ -184,14 +184,14 @@ sum_i2 (gfc_array_i2 * const restrict retarray,
extern void msum_i2 (gfc_array_i2 * const restrict,
gfc_array_i2 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_i2);
void
msum_i2 (gfc_array_i2 * const restrict retarray,
gfc_array_i2 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_2 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_2 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index e97d15c..973b8f1 100644
--- a/libgfortran/generated/sum_i4.c
+++ b/libgfortran/generated/sum_i4.c
@@ -184,14 +184,14 @@ sum_i4 (gfc_array_i4 * const restrict retarray,
extern void msum_i4 (gfc_array_i4 * const restrict,
gfc_array_i4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_i4);
void
msum_i4 (gfc_array_i4 * const restrict retarray,
gfc_array_i4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index da91344..87e7ec6 100644
--- a/libgfortran/generated/sum_i8.c
+++ b/libgfortran/generated/sum_i8.c
@@ -184,14 +184,14 @@ sum_i8 (gfc_array_i8 * const restrict retarray,
extern void msum_i8 (gfc_array_i8 * const restrict,
gfc_array_i8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_i8);
void
msum_i8 (gfc_array_i8 * const restrict retarray,
gfc_array_i8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_INTEGER_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c
index 0433c90..f552026 100644
--- a/libgfortran/generated/sum_r10.c
+++ b/libgfortran/generated/sum_r10.c
@@ -184,14 +184,14 @@ sum_r10 (gfc_array_r10 * const restrict retarray,
extern void msum_r10 (gfc_array_r10 * const restrict,
gfc_array_r10 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_r10);
void
msum_r10 (gfc_array_r10 * const restrict retarray,
gfc_array_r10 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_10 * restrict dest;
const GFC_REAL_10 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_10 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_10 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c
index 2c9fdf5..5861054 100644
--- a/libgfortran/generated/sum_r16.c
+++ b/libgfortran/generated/sum_r16.c
@@ -184,14 +184,14 @@ sum_r16 (gfc_array_r16 * const restrict retarray,
extern void msum_r16 (gfc_array_r16 * const restrict,
gfc_array_r16 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_r16);
void
msum_r16 (gfc_array_r16 * const restrict retarray,
gfc_array_r16 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_16 * restrict dest;
const GFC_REAL_16 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_16 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_16 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c
index e3c33fb..4b07477 100644
--- a/libgfortran/generated/sum_r4.c
+++ b/libgfortran/generated/sum_r4.c
@@ -184,14 +184,14 @@ sum_r4 (gfc_array_r4 * const restrict retarray,
extern void msum_r4 (gfc_array_r4 * const restrict,
gfc_array_r4 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_r4);
void
msum_r4 (gfc_array_r4 * const restrict retarray,
gfc_array_r4 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_4 * restrict dest;
const GFC_REAL_4 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_4 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_4 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c
index 4d331e2..43df4a6 100644
--- a/libgfortran/generated/sum_r8.c
+++ b/libgfortran/generated/sum_r8.c
@@ -184,14 +184,14 @@ sum_r8 (gfc_array_r8 * const restrict retarray,
extern void msum_r8 (gfc_array_r8 * const restrict,
gfc_array_r8 * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(msum_r8);
void
msum_r8 (gfc_array_r8 * const restrict retarray,
gfc_array_r8 * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -200,13 +200,14 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
index_type mstride[GFC_MAX_DIMENSIONS];
GFC_REAL_8 * restrict dest;
const GFC_REAL_8 * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -214,13 +215,27 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -230,7 +245,7 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -285,22 +300,11 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const GFC_REAL_8 * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
GFC_REAL_8 result;
src = base;
msrc = mbase;
diff --git a/libgfortran/intrinsics/pack_generic.c b/libgfortran/intrinsics/pack_generic.c
index a1998ad58..30255f0 100644
--- a/libgfortran/intrinsics/pack_generic.c
+++ b/libgfortran/intrinsics/pack_generic.c
@@ -76,7 +76,7 @@ array valued, and the other one where MASK is scalar. */
static void
pack_internal (gfc_array_char *ret, const gfc_array_char *array,
- const gfc_array_l4 *mask, const gfc_array_char *vector,
+ const gfc_array_l1 *mask, const gfc_array_char *vector,
index_type size)
{
/* r.* indicates the return array. */
@@ -89,7 +89,7 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array,
/* m.* indicates the mask array. */
index_type mstride[GFC_MAX_DIMENSIONS];
index_type mstride0;
- const GFC_LOGICAL_4 *mptr;
+ const GFC_LOGICAL_1 *mptr;
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -98,8 +98,31 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array,
index_type dim;
index_type nelem;
index_type total;
+ int mask_kind;
dim = GFC_DESCRIPTOR_RANK (array);
+
+ sptr = array->data;
+ mptr = mask->data;
+
+ /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+ and using shifting to address size and endian issues. */
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ {
+ /* Don't convert a NULL pointer as we use test for NULL below. */
+ if (mptr)
+ mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+ }
+ else
+ runtime_error ("Funny sized logical array");
+
zero_sized = 0;
for (n = 0; n < dim; n++)
{
@@ -108,25 +131,12 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array,
if (extent[n] <= 0)
zero_sized = 1;
sstride[n] = array->dim[n].stride * size;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
}
if (sstride[0] == 0)
sstride[0] = size;
if (mstride[0] == 0)
- mstride[0] = 1;
-
- sptr = array->data;
- mptr = mask->data;
-
- /* Use the same loop for both logical types. */
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- if (GFC_DESCRIPTOR_SIZE (mask) != 8)
- runtime_error ("Funny sized logical array");
- for (n = 0; n < dim; n++)
- mstride[n] <<= 1;
- mptr = GFOR_POINTER_L8_TO_L4 (mptr);
- }
+ mstride[0] = mask_kind;
if (ret->data == NULL || compile_options.bounds_check)
{
@@ -156,7 +166,7 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array,
cache behavior in the case where our cache is not big
enough to hold all elements that have to be copied. */
- const GFC_LOGICAL_4 *m = mptr;
+ const GFC_LOGICAL_1 *m = mptr;
total = 0;
if (zero_sized)
diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c
index b349f0d..86c70fb 100644
--- a/libgfortran/intrinsics/unpack_generic.c
+++ b/libgfortran/intrinsics/unpack_generic.c
@@ -36,7 +36,7 @@ Boston, MA 02110-1301, USA. */
static void
unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
- const gfc_array_l4 *mask, const gfc_array_char *field,
+ const gfc_array_l1 *mask, const gfc_array_char *field,
index_type size, index_type fsize)
{
/* r.* indicates the return array. */
@@ -54,7 +54,7 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
/* m.* indicates the mask array. */
index_type mstride[GFC_MAX_DIMENSIONS];
index_type mstride0;
- const GFC_LOGICAL_4 *mptr;
+ const GFC_LOGICAL_1 *mptr;
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -62,8 +62,30 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
index_type dim;
int empty;
+ int mask_kind;
empty = 0;
+
+ mptr = mask->data;
+
+ /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+ and using shifting to address size and endian issues. */
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ {
+ /* Don't convert a NULL pointer as we use test for NULL below. */
+ if (mptr)
+ mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+ }
+ else
+ runtime_error ("Funny sized logical array");
+
if (ret->data == NULL)
{
/* The front end has signalled that we need to populate the
@@ -80,7 +102,7 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
empty = empty || extent[n] <= 0;
rstride[n] = ret->dim[n].stride * size;
fstride[n] = field->dim[n].stride * fsize;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
rs *= extent[n];
}
ret->offset = 0;
@@ -96,7 +118,7 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
empty = empty || extent[n] <= 0;
rstride[n] = ret->dim[n].stride * size;
fstride[n] = field->dim[n].stride * fsize;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
}
if (rstride[0] == 0)
rstride[0] = size;
@@ -118,20 +140,8 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
mstride0 = mstride[0];
rptr = ret->data;
fptr = field->data;
- mptr = mask->data;
vptr = vector->data;
- /* Use the same loop for both logical types. */
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- if (GFC_DESCRIPTOR_SIZE (mask) != 8)
- runtime_error ("Funny sized logical array");
- for (n = 0; n < dim; n++)
- mstride[n] <<= 1;
- mstride0 <<= 1;
- mptr = GFOR_POINTER_L8_TO_L4 (mptr);
- }
-
while (rptr)
{
if (*mptr)
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 6c687f7..555c6bf 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -233,8 +233,8 @@ typedef GFC_INTEGER_4 gfc_charlen_type;
extern int l8_to_l4_offset;
internal_proto(l8_to_l4_offset);
-#define GFOR_POINTER_L8_TO_L4(p8) \
- (l8_to_l4_offset + (GFC_LOGICAL_4 *)(p8))
+#define GFOR_POINTER_TO_L1(p, kind) \
+ (l8_to_l4_offset * (kind - 1) + (GFC_LOGICAL_1 *)(p))
#define GFC_INTEGER_1_HUGE \
(GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1)
@@ -322,6 +322,8 @@ typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_10) gfc_array_c10;
#ifdef HAVE_GFC_COMPLEX_16
typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_16) gfc_array_c16;
#endif
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_1) gfc_array_l1;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_2) gfc_array_l2;
typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_4) gfc_array_l4;
typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_8) gfc_array_l8;
#ifdef HAVE_GFC_LOGICAL_16
diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4
index af53cef..720a4c0 100644
--- a/libgfortran/m4/iforeach.m4
+++ b/libgfortran/m4/iforeach.m4
@@ -106,13 +106,13 @@ define(FINISH_FOREACH_FUNCTION,
define(START_MASKED_FOREACH_FUNCTION,
`
extern void `m'name`'rtype_qual`_'atype_code (rtype * const restrict,
- atype * const restrict, gfc_array_l4 * const restrict);
+ atype * const restrict, gfc_array_l1 * const restrict);
export_proto(`m'name`'rtype_qual`_'atype_code);
void
`m'name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
atype * const restrict array,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -121,9 +121,10 @@ void
index_type dstride;
rtype_name *dest;
const atype_name *base;
- GFC_LOGICAL_4 *mbase;
+ GFC_LOGICAL_1 *mbase;
int rank;
index_type n;
+ int mask_kind;
rank = GFC_DESCRIPTOR_RANK (array);
if (rank <= 0)
@@ -147,12 +148,25 @@ void
runtime_error ("dimension of return array incorrect");
}
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ mbase = mask->data;
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
count[n] = 0;
if (extent[n] <= 0)
@@ -165,17 +179,6 @@ void
}
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
-
/* Initialize the return value. */
for (n = 0; n < rank; n++)
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index 225b89a..d8a661c 100644
--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -166,14 +166,14 @@ define(START_MASKED_ARRAY_FUNCTION,
`
extern void `m'name`'rtype_qual`_'atype_code (rtype * const restrict,
atype * const restrict, const index_type * const restrict,
- gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict);
export_proto(`m'name`'rtype_qual`_'atype_code);
void
`m'name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
atype * const restrict array,
const index_type * const restrict pdim,
- gfc_array_l4 * const restrict mask)
+ gfc_array_l1 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
@@ -182,13 +182,14 @@ void
index_type mstride[GFC_MAX_DIMENSIONS];
rtype_name * restrict dest;
const atype_name * restrict base;
- const GFC_LOGICAL_4 * restrict mbase;
+ const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
+ int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
@@ -196,13 +197,27 @@ void
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
+
+ mbase = mask->data;
+
+ mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+ if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || mask_kind == 16
+#endif
+ )
+ mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+ else
+ runtime_error ("Funny sized logical array");
+
delta = array->dim[dim].stride;
- mdelta = mask->dim[dim].stride;
+ mdelta = mask->dim[dim].stride * mask_kind;
for (n = 0; n < dim; n++)
{
sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride;
+ mstride[n] = mask->dim[n].stride * mask_kind;
extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
if (extent[n] < 0)
@@ -212,7 +227,7 @@ void
for (n = dim; n < rank; n++)
{
sstride[n] = array->dim[n + 1].stride;
- mstride[n] = mask->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;
@@ -267,22 +282,11 @@ void
dest = retarray->data;
base = array->data;
- mbase = mask->data;
-
- if (GFC_DESCRIPTOR_SIZE (mask) != 4)
- {
- /* This allows the same loop to be used for all logical types. */
- assert (GFC_DESCRIPTOR_SIZE (mask) == 8);
- for (n = 0; n < rank; n++)
- mstride[n] <<= 1;
- mdelta <<= 1;
- mbase = (GFOR_POINTER_L8_TO_L4 (mbase));
- }
while (base)
{
const atype_name * restrict src;
- const GFC_LOGICAL_4 * restrict msrc;
+ const GFC_LOGICAL_1 * restrict msrc;
rtype_name result;
src = base;
msrc = mbase;
diff --git a/libgfortran/m4/matmull.m4 b/libgfortran/m4/matmull.m4
index d4b0008..4e999fc 100644
--- a/libgfortran/m4/matmull.m4
+++ b/libgfortran/m4/matmull.m4
@@ -40,15 +40,15 @@ include(iparm.m4)dnl
Either a or b can be rank 1. In this case x or y is 1. */
extern void matmul_'rtype_code` ('rtype` * const restrict,
- gfc_array_l4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
export_proto(matmul_'rtype_code`);
void
matmul_'rtype_code` ('rtype` * const restrict retarray,
- gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b)
+ gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
{
- const GFC_INTEGER_4 * restrict abase;
- const GFC_INTEGER_4 * restrict bbase;
+ const GFC_LOGICAL_1 * restrict abase;
+ const GFC_LOGICAL_1 * restrict bbase;
'rtype_name` * restrict dest;
index_type rxstride;
index_type rystride;
@@ -58,9 +58,11 @@ matmul_'rtype_code` ('rtype` * const restrict retarray,
index_type ystride;
index_type x;
index_type y;
+ int a_kind;
+ int b_kind;
- const GFC_INTEGER_4 * restrict pa;
- const GFC_INTEGER_4 * restrict pb;
+ const GFC_LOGICAL_1 * restrict pa;
+ const GFC_LOGICAL_1 * restrict pb;
index_type astride;
index_type bstride;
index_type count;
@@ -100,17 +102,29 @@ matmul_'rtype_code` ('rtype` * const restrict retarray,
}
abase = a->data;
- if (GFC_DESCRIPTOR_SIZE (a) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (a) == 8);
- abase = GFOR_POINTER_L8_TO_L4 (abase);
- }
+ a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+ if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || a_kind == 16
+#endif
+ )
+ abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
bbase = b->data;
- if (GFC_DESCRIPTOR_SIZE (b) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (b) == 8);
- bbase = GFOR_POINTER_L8_TO_L4 (bbase);
- }
+ b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+ if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || b_kind == 16
+#endif
+ )
+ bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
dest = retarray->data;
'
sinclude(`matmul_asm_'rtype_code`.m4')dnl
@@ -130,7 +144,7 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
one. */
if (GFC_DESCRIPTOR_RANK (a) == 1)
{
- astride = a->dim[0].stride;
+ astride = a->dim[0].stride * a_kind;
count = a->dim[0].ubound + 1 - a->dim[0].lbound;
xstride = 0;
rxstride = 0;
@@ -138,14 +152,14 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
}
else
{
- astride = a->dim[1].stride;
+ astride = a->dim[1].stride * a_kind;
count = a->dim[1].ubound + 1 - a->dim[1].lbound;
xstride = a->dim[0].stride;
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
if (GFC_DESCRIPTOR_RANK (b) == 1)
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = 0;
rystride = 0;
@@ -153,7 +167,7 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
}
else
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = b->dim[1].stride;
ycount = b->dim[1].ubound + 1 - b->dim[1].lbound;
@@ -191,4 +205,4 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
}
#endif
-' \ No newline at end of file
+'