re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
/* Implementation of the IALL intrinsic
|
2024-01-03 11:19:35 +00:00
|
|
|
Copyright (C) 2010-2024 Free Software Foundation, Inc.
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
Contributed by Tobias Burnus <burnus@net-b.de>
|
|
|
|
|
|
|
|
This file is part of the GNU Fortran runtime library (libgfortran).
|
|
|
|
|
|
|
|
Libgfortran is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 3 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
Libgfortran is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#include "libgfortran.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
|
|
|
|
|
|
|
|
|
|
|
|
extern void iall_i1 (gfc_array_i1 * const restrict,
|
|
|
|
gfc_array_i1 * const restrict, const index_type * const restrict);
|
|
|
|
export_proto(iall_i1);
|
|
|
|
|
|
|
|
void
|
|
|
|
iall_i1 (gfc_array_i1 * const restrict retarray,
|
|
|
|
gfc_array_i1 * const restrict array,
|
|
|
|
const index_type * const restrict pdim)
|
|
|
|
{
|
|
|
|
index_type count[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type extent[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type sstride[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type dstride[GFC_MAX_DIMENSIONS];
|
|
|
|
const GFC_INTEGER_1 * restrict base;
|
|
|
|
GFC_INTEGER_1 * restrict dest;
|
|
|
|
index_type rank;
|
|
|
|
index_type n;
|
|
|
|
index_type len;
|
|
|
|
index_type delta;
|
|
|
|
index_type dim;
|
|
|
|
int continue_loop;
|
|
|
|
|
|
|
|
/* Make dim zero based to avoid confusion. */
|
|
|
|
rank = GFC_DESCRIPTOR_RANK (array) - 1;
|
2017-07-31 09:34:36 +00:00
|
|
|
dim = (*pdim) - 1;
|
|
|
|
|
|
|
|
if (unlikely (dim < 0 || dim > rank))
|
|
|
|
{
|
|
|
|
runtime_error ("Dim argument incorrect in IALL intrinsic: "
|
|
|
|
"is %ld, should be between 1 and %ld",
|
|
|
|
(long int) dim + 1, (long int) rank + 1);
|
|
|
|
}
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
len = GFC_DESCRIPTOR_EXTENT(array,dim);
|
|
|
|
if (len < 0)
|
|
|
|
len = 0;
|
|
|
|
delta = GFC_DESCRIPTOR_STRIDE(array,dim);
|
|
|
|
|
|
|
|
for (n = 0; n < dim; n++)
|
|
|
|
{
|
|
|
|
sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
|
|
|
|
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
|
|
|
|
|
|
|
|
if (extent[n] < 0)
|
|
|
|
extent[n] = 0;
|
|
|
|
}
|
|
|
|
for (n = dim; n < rank; n++)
|
|
|
|
{
|
|
|
|
sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
|
|
|
|
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
|
|
|
|
|
|
|
|
if (extent[n] < 0)
|
|
|
|
extent[n] = 0;
|
|
|
|
}
|
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
if (retarray->base_addr == NULL)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
|
|
|
size_t alloc_size, str;
|
|
|
|
|
|
|
|
for (n = 0; n < rank; n++)
|
|
|
|
{
|
|
|
|
if (n == 0)
|
|
|
|
str = 1;
|
|
|
|
else
|
|
|
|
str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
|
|
|
|
|
|
|
|
GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
retarray->offset = 0;
|
2018-06-01 20:20:35 +00:00
|
|
|
retarray->dtype.rank = rank;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
2014-06-17 03:50:34 +00:00
|
|
|
alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
2014-06-17 03:50:34 +00:00
|
|
|
retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
if (alloc_size == 0)
|
libgfortran: Remove empty array descriptor first dimension overwrite [PR112371]
Remove the forced overwrite of the first dimension of the result array
descriptor to set it to zero extent, in the function templates for
transformational functions doing an array reduction along a dimension. This
overwrite, which happened before early returning in case the result array
was empty, was wrong because an array may have a non-zero extent in the
first dimension and still be empty if it has a zero extent in a higher
dimension. Overwriting the dimension was resulting in wrong array result
upper bound for the first dimension in that case.
The offending piece of code was present in several places, and this removes
them all. More precisely, there is only one case to fix for logical
reduction functions, and there are three cases for other reduction
functions, corresponding to non-masked reduction, reduction with array mask,
and reduction with scalar mask. The impacted m4 files are
ifunction_logical.m4 for logical reduction functions, ifunction.m4 for
regular functions and types, ifunction-s.m4 for character minloc and maxloc,
ifunction-s2.m4 for character minval and maxval, and ifindloc1.m4 for
findloc.
PR fortran/112371
libgfortran/ChangeLog:
* m4/ifunction.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Remove overwrite of the first dimension of the
array descriptor.
* m4/ifunction-s.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction-s2.m4 (START_ARRAY_FUNCTION,
START_MASKED_ARRAY_FUNCTION, SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction_logical.m4 (START_ARRAY_FUNCTION): Ditto.
* m4/ifindloc1.m4: Ditto.
* generated/all_l1.c: Regenerate.
* generated/all_l16.c: Regenerate.
* generated/all_l2.c: Regenerate.
* generated/all_l4.c: Regenerate.
* generated/all_l8.c: Regenerate.
* generated/any_l1.c: Regenerate.
* generated/any_l16.c: Regenerate.
* generated/any_l2.c: Regenerate.
* generated/any_l4.c: Regenerate.
* generated/any_l8.c: Regenerate.
* generated/count_16_l.c: Regenerate.
* generated/count_1_l.c: Regenerate.
* generated/count_2_l.c: Regenerate.
* generated/count_4_l.c: Regenerate.
* generated/count_8_l.c: Regenerate.
* generated/findloc1_c10.c: Regenerate.
* generated/findloc1_c16.c: Regenerate.
* generated/findloc1_c17.c: Regenerate.
* generated/findloc1_c4.c: Regenerate.
* generated/findloc1_c8.c: Regenerate.
* generated/findloc1_i1.c: Regenerate.
* generated/findloc1_i16.c: Regenerate.
* generated/findloc1_i2.c: Regenerate.
* generated/findloc1_i4.c: Regenerate.
* generated/findloc1_i8.c: Regenerate.
* generated/findloc1_r10.c: Regenerate.
* generated/findloc1_r16.c: Regenerate.
* generated/findloc1_r17.c: Regenerate.
* generated/findloc1_r4.c: Regenerate.
* generated/findloc1_r8.c: Regenerate.
* generated/findloc1_s1.c: Regenerate.
* generated/findloc1_s4.c: Regenerate.
* generated/iall_i1.c: Regenerate.
* generated/iall_i16.c: Regenerate.
* generated/iall_i2.c: Regenerate.
* generated/iall_i4.c: Regenerate.
* generated/iall_i8.c: Regenerate.
* generated/iany_i1.c: Regenerate.
* generated/iany_i16.c: Regenerate.
* generated/iany_i2.c: Regenerate.
* generated/iany_i4.c: Regenerate.
* generated/iany_i8.c: Regenerate.
* generated/iparity_i1.c: Regenerate.
* generated/iparity_i16.c: Regenerate.
* generated/iparity_i2.c: Regenerate.
* generated/iparity_i4.c: Regenerate.
* generated/iparity_i8.c: Regenerate.
* generated/maxloc1_16_i1.c: Regenerate.
* generated/maxloc1_16_i16.c: Regenerate.
* generated/maxloc1_16_i2.c: Regenerate.
* generated/maxloc1_16_i4.c: Regenerate.
* generated/maxloc1_16_i8.c: Regenerate.
* generated/maxloc1_16_r10.c: Regenerate.
* generated/maxloc1_16_r16.c: Regenerate.
* generated/maxloc1_16_r17.c: Regenerate.
* generated/maxloc1_16_r4.c: Regenerate.
* generated/maxloc1_16_r8.c: Regenerate.
* generated/maxloc1_16_s1.c: Regenerate.
* generated/maxloc1_16_s4.c: Regenerate.
* generated/maxloc1_4_i1.c: Regenerate.
* generated/maxloc1_4_i16.c: Regenerate.
* generated/maxloc1_4_i2.c: Regenerate.
* generated/maxloc1_4_i4.c: Regenerate.
* generated/maxloc1_4_i8.c: Regenerate.
* generated/maxloc1_4_r10.c: Regenerate.
* generated/maxloc1_4_r16.c: Regenerate.
* generated/maxloc1_4_r17.c: Regenerate.
* generated/maxloc1_4_r4.c: Regenerate.
* generated/maxloc1_4_r8.c: Regenerate.
* generated/maxloc1_4_s1.c: Regenerate.
* generated/maxloc1_4_s4.c: Regenerate.
* generated/maxloc1_8_i1.c: Regenerate.
* generated/maxloc1_8_i16.c: Regenerate.
* generated/maxloc1_8_i2.c: Regenerate.
* generated/maxloc1_8_i4.c: Regenerate.
* generated/maxloc1_8_i8.c: Regenerate.
* generated/maxloc1_8_r10.c: Regenerate.
* generated/maxloc1_8_r16.c: Regenerate.
* generated/maxloc1_8_r17.c: Regenerate.
* generated/maxloc1_8_r4.c: Regenerate.
* generated/maxloc1_8_r8.c: Regenerate.
* generated/maxloc1_8_s1.c: Regenerate.
* generated/maxloc1_8_s4.c: Regenerate.
* generated/maxval1_s1.c: Regenerate.
* generated/maxval1_s4.c: Regenerate.
* generated/maxval_i1.c: Regenerate.
* generated/maxval_i16.c: Regenerate.
* generated/maxval_i2.c: Regenerate.
* generated/maxval_i4.c: Regenerate.
* generated/maxval_i8.c: Regenerate.
* generated/maxval_r10.c: Regenerate.
* generated/maxval_r16.c: Regenerate.
* generated/maxval_r17.c: Regenerate.
* generated/maxval_r4.c: Regenerate.
* generated/maxval_r8.c: Regenerate.
* generated/minloc1_16_i1.c: Regenerate.
* generated/minloc1_16_i16.c: Regenerate.
* generated/minloc1_16_i2.c: Regenerate.
* generated/minloc1_16_i4.c: Regenerate.
* generated/minloc1_16_i8.c: Regenerate.
* generated/minloc1_16_r10.c: Regenerate.
* generated/minloc1_16_r16.c: Regenerate.
* generated/minloc1_16_r17.c: Regenerate.
* generated/minloc1_16_r4.c: Regenerate.
* generated/minloc1_16_r8.c: Regenerate.
* generated/minloc1_16_s1.c: Regenerate.
* generated/minloc1_16_s4.c: Regenerate.
* generated/minloc1_4_i1.c: Regenerate.
* generated/minloc1_4_i16.c: Regenerate.
* generated/minloc1_4_i2.c: Regenerate.
* generated/minloc1_4_i4.c: Regenerate.
* generated/minloc1_4_i8.c: Regenerate.
* generated/minloc1_4_r10.c: Regenerate.
* generated/minloc1_4_r16.c: Regenerate.
* generated/minloc1_4_r17.c: Regenerate.
* generated/minloc1_4_r4.c: Regenerate.
* generated/minloc1_4_r8.c: Regenerate.
* generated/minloc1_4_s1.c: Regenerate.
* generated/minloc1_4_s4.c: Regenerate.
* generated/minloc1_8_i1.c: Regenerate.
* generated/minloc1_8_i16.c: Regenerate.
* generated/minloc1_8_i2.c: Regenerate.
* generated/minloc1_8_i4.c: Regenerate.
* generated/minloc1_8_i8.c: Regenerate.
* generated/minloc1_8_r10.c: Regenerate.
* generated/minloc1_8_r16.c: Regenerate.
* generated/minloc1_8_r17.c: Regenerate.
* generated/minloc1_8_r4.c: Regenerate.
* generated/minloc1_8_r8.c: Regenerate.
* generated/minloc1_8_s1.c: Regenerate.
* generated/minloc1_8_s4.c: Regenerate.
* generated/minval1_s1.c: Regenerate.
* generated/minval1_s4.c: Regenerate.
* generated/minval_i1.c: Regenerate.
* generated/minval_i16.c: Regenerate.
* generated/minval_i2.c: Regenerate.
* generated/minval_i4.c: Regenerate.
* generated/minval_i8.c: Regenerate.
* generated/minval_r10.c: Regenerate.
* generated/minval_r16.c: Regenerate.
* generated/minval_r17.c: Regenerate.
* generated/minval_r4.c: Regenerate.
* generated/minval_r8.c: Regenerate.
* generated/norm2_r10.c: Regenerate.
* generated/norm2_r16.c: Regenerate.
* generated/norm2_r17.c: Regenerate.
* generated/norm2_r4.c: Regenerate.
* generated/norm2_r8.c: Regenerate.
* generated/parity_l1.c: Regenerate.
* generated/parity_l16.c: Regenerate.
* generated/parity_l2.c: Regenerate.
* generated/parity_l4.c: Regenerate.
* generated/parity_l8.c: Regenerate.
* generated/product_c10.c: Regenerate.
* generated/product_c16.c: Regenerate.
* generated/product_c17.c: Regenerate.
* generated/product_c4.c: Regenerate.
* generated/product_c8.c: Regenerate.
* generated/product_i1.c: Regenerate.
* generated/product_i16.c: Regenerate.
* generated/product_i2.c: Regenerate.
* generated/product_i4.c: Regenerate.
* generated/product_i8.c: Regenerate.
* generated/product_r10.c: Regenerate.
* generated/product_r16.c: Regenerate.
* generated/product_r17.c: Regenerate.
* generated/product_r4.c: Regenerate.
* generated/product_r8.c: Regenerate.
* generated/sum_c10.c: Regenerate.
* generated/sum_c16.c: Regenerate.
* generated/sum_c17.c: Regenerate.
* generated/sum_c4.c: Regenerate.
* generated/sum_c8.c: Regenerate.
* generated/sum_i1.c: Regenerate.
* generated/sum_i16.c: Regenerate.
* generated/sum_i2.c: Regenerate.
* generated/sum_i4.c: Regenerate.
* generated/sum_i8.c: Regenerate.
* generated/sum_r10.c: Regenerate.
* generated/sum_r16.c: Regenerate.
* generated/sum_r17.c: Regenerate.
* generated/sum_r4.c: Regenerate.
* generated/sum_r8.c: Regenerate.
gcc/testsuite/ChangeLog:
* gfortran.dg/bound_11.f90: New test.
2023-11-07 10:24:04 +00:00
|
|
|
return;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (rank != GFC_DESCRIPTOR_RANK (retarray))
|
|
|
|
runtime_error ("rank of return array incorrect in"
|
|
|
|
" IALL intrinsic: is %ld, should be %ld",
|
|
|
|
(long int) (GFC_DESCRIPTOR_RANK (retarray)),
|
|
|
|
(long int) rank);
|
|
|
|
|
|
|
|
if (unlikely (compile_options.bounds_check))
|
|
|
|
bounds_ifunction_return ((array_t *) retarray, extent,
|
|
|
|
"return value", "IALL");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (n = 0; n < rank; n++)
|
|
|
|
{
|
|
|
|
count[n] = 0;
|
|
|
|
dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
|
|
|
|
if (extent[n] <= 0)
|
2011-08-28 10:08:50 +00:00
|
|
|
return;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
}
|
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
base = array->base_addr;
|
|
|
|
dest = retarray->base_addr;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
continue_loop = 1;
|
|
|
|
while (continue_loop)
|
|
|
|
{
|
|
|
|
const GFC_INTEGER_1 * restrict src;
|
|
|
|
GFC_INTEGER_1 result;
|
|
|
|
src = base;
|
|
|
|
{
|
|
|
|
|
|
|
|
result = (GFC_INTEGER_1) -1;
|
|
|
|
if (len <= 0)
|
|
|
|
*dest = 0;
|
|
|
|
else
|
|
|
|
{
|
2018-05-08 07:47:19 +00:00
|
|
|
#if ! defined HAVE_BACK_ARG
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
for (n = 0; n < len; n++, src += delta)
|
|
|
|
{
|
2018-05-08 07:47:19 +00:00
|
|
|
#endif
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
result &= *src;
|
|
|
|
}
|
|
|
|
|
|
|
|
*dest = result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Advance to the next element. */
|
|
|
|
count[0]++;
|
|
|
|
base += sstride[0];
|
|
|
|
dest += dstride[0];
|
|
|
|
n = 0;
|
|
|
|
while (count[n] == extent[n])
|
|
|
|
{
|
|
|
|
/* When we get to the end of a dimension, reset it and increment
|
|
|
|
the next dimension. */
|
|
|
|
count[n] = 0;
|
|
|
|
/* We could precalculate these products, but this is a less
|
|
|
|
frequently used path so probably not worth it. */
|
|
|
|
base -= sstride[n] * extent[n];
|
|
|
|
dest -= dstride[n] * extent[n];
|
|
|
|
n++;
|
2017-03-10 19:42:46 +00:00
|
|
|
if (n >= rank)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
2017-03-10 19:42:46 +00:00
|
|
|
/* Break out of the loop. */
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
continue_loop = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
count[n]++;
|
|
|
|
base += sstride[n];
|
|
|
|
dest += dstride[n];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern void miall_i1 (gfc_array_i1 * const restrict,
|
|
|
|
gfc_array_i1 * const restrict, const index_type * const restrict,
|
|
|
|
gfc_array_l1 * const restrict);
|
|
|
|
export_proto(miall_i1);
|
|
|
|
|
|
|
|
void
|
|
|
|
miall_i1 (gfc_array_i1 * const restrict retarray,
|
|
|
|
gfc_array_i1 * const restrict array,
|
|
|
|
const index_type * const restrict pdim,
|
|
|
|
gfc_array_l1 * const restrict mask)
|
|
|
|
{
|
|
|
|
index_type count[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type extent[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type sstride[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type dstride[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type mstride[GFC_MAX_DIMENSIONS];
|
|
|
|
GFC_INTEGER_1 * restrict dest;
|
|
|
|
const GFC_INTEGER_1 * restrict base;
|
|
|
|
const GFC_LOGICAL_1 * restrict mbase;
|
2017-07-31 09:34:36 +00:00
|
|
|
index_type rank;
|
|
|
|
index_type dim;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
index_type n;
|
|
|
|
index_type len;
|
|
|
|
index_type delta;
|
|
|
|
index_type mdelta;
|
|
|
|
int mask_kind;
|
|
|
|
|
2018-12-31 14:59:46 +00:00
|
|
|
if (mask == NULL)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_BACK_ARG
|
|
|
|
iall_i1 (retarray, array, pdim, back);
|
|
|
|
#else
|
|
|
|
iall_i1 (retarray, array, pdim);
|
|
|
|
#endif
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
dim = (*pdim) - 1;
|
|
|
|
rank = GFC_DESCRIPTOR_RANK (array) - 1;
|
|
|
|
|
2017-07-31 09:34:36 +00:00
|
|
|
|
|
|
|
if (unlikely (dim < 0 || dim > rank))
|
|
|
|
{
|
|
|
|
runtime_error ("Dim argument incorrect in IALL intrinsic: "
|
|
|
|
"is %ld, should be between 1 and %ld",
|
|
|
|
(long int) dim + 1, (long int) rank + 1);
|
|
|
|
}
|
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
len = GFC_DESCRIPTOR_EXTENT(array,dim);
|
2023-11-07 10:24:03 +00:00
|
|
|
if (len < 0)
|
|
|
|
len = 0;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
mbase = mask->base_addr;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
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 = GFC_DESCRIPTOR_STRIDE(array,dim);
|
|
|
|
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
|
|
|
|
|
|
|
|
for (n = 0; n < dim; n++)
|
|
|
|
{
|
|
|
|
sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
|
|
|
|
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
|
|
|
|
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
|
|
|
|
|
|
|
|
if (extent[n] < 0)
|
|
|
|
extent[n] = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
for (n = dim; n < rank; n++)
|
|
|
|
{
|
|
|
|
sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
|
|
|
|
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
|
|
|
|
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
|
|
|
|
|
|
|
|
if (extent[n] < 0)
|
|
|
|
extent[n] = 0;
|
|
|
|
}
|
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
if (retarray->base_addr == NULL)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
|
|
|
size_t alloc_size, str;
|
|
|
|
|
|
|
|
for (n = 0; n < rank; n++)
|
|
|
|
{
|
|
|
|
if (n == 0)
|
|
|
|
str = 1;
|
|
|
|
else
|
|
|
|
str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
|
|
|
|
|
|
|
|
GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-06-17 03:50:34 +00:00
|
|
|
alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
retarray->offset = 0;
|
2018-06-01 20:20:35 +00:00
|
|
|
retarray->dtype.rank = rank;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
libgfortran: Don't skip allocation if size is zero [PR112412]
In the function template of transformational functions doing a reduction
of an array along one dimension, if the passed in result array was
unallocated and the calculated allocation size was zero (this is the case
of empty result arrays), an early return used to skip the allocation. This
change moves the allocation before the early return, so that empty result
arrays are not seen as unallocated. This is possible because zero size is
explicitly supported by the allocation function.
The offending code is present in several places, and this updates them all.
More precisely, there is one place in the template for logical reductions,
and there are two places in the templates corresponding to masked reductions
with respectively array mask and scalar mask. Templates for unmasked
reductions, which already allocate before returning, are not affected, but
unmasked reductions are checked nevertheless in the testcase. The affected
m4 files are ifunction.m4 for regular functions and types, ifunction-s.m4
for character minloc and maxloc, ifunction-s2.m4 for character minval and
maxval, and ifunction_logical for logical reductions.
PR fortran/112412
libgfortran/ChangeLog:
* m4/ifunction.m4 (START_MASKED_ARRAY_FUNCTION, SCALAR_ARRAY_FUNCTION):
Don't skip allocation if the allocation size is zero.
* m4/ifunction-s.m4 (START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction-s2.m4 (START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction_logical.m4 (START_ARRAY_FUNCTION): Ditto.
* generated/all_l1.c: Regenerate.
* generated/all_l16.c: Regenerate.
* generated/all_l2.c: Regenerate.
* generated/all_l4.c: Regenerate.
* generated/all_l8.c: Regenerate.
* generated/any_l1.c: Regenerate.
* generated/any_l16.c: Regenerate.
* generated/any_l2.c: Regenerate.
* generated/any_l4.c: Regenerate.
* generated/any_l8.c: Regenerate.
* generated/count_16_l.c: Regenerate.
* generated/count_1_l.c: Regenerate.
* generated/count_2_l.c: Regenerate.
* generated/count_4_l.c: Regenerate.
* generated/count_8_l.c: Regenerate.
* generated/iall_i1.c: Regenerate.
* generated/iall_i16.c: Regenerate.
* generated/iall_i2.c: Regenerate.
* generated/iall_i4.c: Regenerate.
* generated/iall_i8.c: Regenerate.
* generated/iany_i1.c: Regenerate.
* generated/iany_i16.c: Regenerate.
* generated/iany_i2.c: Regenerate.
* generated/iany_i4.c: Regenerate.
* generated/iany_i8.c: Regenerate.
* generated/iparity_i1.c: Regenerate.
* generated/iparity_i16.c: Regenerate.
* generated/iparity_i2.c: Regenerate.
* generated/iparity_i4.c: Regenerate.
* generated/iparity_i8.c: Regenerate.
* generated/maxloc1_16_i1.c: Regenerate.
* generated/maxloc1_16_i16.c: Regenerate.
* generated/maxloc1_16_i2.c: Regenerate.
* generated/maxloc1_16_i4.c: Regenerate.
* generated/maxloc1_16_i8.c: Regenerate.
* generated/maxloc1_16_r10.c: Regenerate.
* generated/maxloc1_16_r16.c: Regenerate.
* generated/maxloc1_16_r17.c: Regenerate.
* generated/maxloc1_16_r4.c: Regenerate.
* generated/maxloc1_16_r8.c: Regenerate.
* generated/maxloc1_16_s1.c: Regenerate.
* generated/maxloc1_16_s4.c: Regenerate.
* generated/maxloc1_4_i1.c: Regenerate.
* generated/maxloc1_4_i16.c: Regenerate.
* generated/maxloc1_4_i2.c: Regenerate.
* generated/maxloc1_4_i4.c: Regenerate.
* generated/maxloc1_4_i8.c: Regenerate.
* generated/maxloc1_4_r10.c: Regenerate.
* generated/maxloc1_4_r16.c: Regenerate.
* generated/maxloc1_4_r17.c: Regenerate.
* generated/maxloc1_4_r4.c: Regenerate.
* generated/maxloc1_4_r8.c: Regenerate.
* generated/maxloc1_4_s1.c: Regenerate.
* generated/maxloc1_4_s4.c: Regenerate.
* generated/maxloc1_8_i1.c: Regenerate.
* generated/maxloc1_8_i16.c: Regenerate.
* generated/maxloc1_8_i2.c: Regenerate.
* generated/maxloc1_8_i4.c: Regenerate.
* generated/maxloc1_8_i8.c: Regenerate.
* generated/maxloc1_8_r10.c: Regenerate.
* generated/maxloc1_8_r16.c: Regenerate.
* generated/maxloc1_8_r17.c: Regenerate.
* generated/maxloc1_8_r4.c: Regenerate.
* generated/maxloc1_8_r8.c: Regenerate.
* generated/maxloc1_8_s1.c: Regenerate.
* generated/maxloc1_8_s4.c: Regenerate.
* generated/maxval1_s1.c: Regenerate.
* generated/maxval1_s4.c: Regenerate.
* generated/maxval_i1.c: Regenerate.
* generated/maxval_i16.c: Regenerate.
* generated/maxval_i2.c: Regenerate.
* generated/maxval_i4.c: Regenerate.
* generated/maxval_i8.c: Regenerate.
* generated/maxval_r10.c: Regenerate.
* generated/maxval_r16.c: Regenerate.
* generated/maxval_r17.c: Regenerate.
* generated/maxval_r4.c: Regenerate.
* generated/maxval_r8.c: Regenerate.
* generated/minloc1_16_i1.c: Regenerate.
* generated/minloc1_16_i16.c: Regenerate.
* generated/minloc1_16_i2.c: Regenerate.
* generated/minloc1_16_i4.c: Regenerate.
* generated/minloc1_16_i8.c: Regenerate.
* generated/minloc1_16_r10.c: Regenerate.
* generated/minloc1_16_r16.c: Regenerate.
* generated/minloc1_16_r17.c: Regenerate.
* generated/minloc1_16_r4.c: Regenerate.
* generated/minloc1_16_r8.c: Regenerate.
* generated/minloc1_16_s1.c: Regenerate.
* generated/minloc1_16_s4.c: Regenerate.
* generated/minloc1_4_i1.c: Regenerate.
* generated/minloc1_4_i16.c: Regenerate.
* generated/minloc1_4_i2.c: Regenerate.
* generated/minloc1_4_i4.c: Regenerate.
* generated/minloc1_4_i8.c: Regenerate.
* generated/minloc1_4_r10.c: Regenerate.
* generated/minloc1_4_r16.c: Regenerate.
* generated/minloc1_4_r17.c: Regenerate.
* generated/minloc1_4_r4.c: Regenerate.
* generated/minloc1_4_r8.c: Regenerate.
* generated/minloc1_4_s1.c: Regenerate.
* generated/minloc1_4_s4.c: Regenerate.
* generated/minloc1_8_i1.c: Regenerate.
* generated/minloc1_8_i16.c: Regenerate.
* generated/minloc1_8_i2.c: Regenerate.
* generated/minloc1_8_i4.c: Regenerate.
* generated/minloc1_8_i8.c: Regenerate.
* generated/minloc1_8_r10.c: Regenerate.
* generated/minloc1_8_r16.c: Regenerate.
* generated/minloc1_8_r17.c: Regenerate.
* generated/minloc1_8_r4.c: Regenerate.
* generated/minloc1_8_r8.c: Regenerate.
* generated/minloc1_8_s1.c: Regenerate.
* generated/minloc1_8_s4.c: Regenerate.
* generated/minval1_s1.c: Regenerate.
* generated/minval1_s4.c: Regenerate.
* generated/minval_i1.c: Regenerate.
* generated/minval_i16.c: Regenerate.
* generated/minval_i2.c: Regenerate.
* generated/minval_i4.c: Regenerate.
* generated/minval_i8.c: Regenerate.
* generated/minval_r10.c: Regenerate.
* generated/minval_r16.c: Regenerate.
* generated/minval_r17.c: Regenerate.
* generated/minval_r4.c: Regenerate.
* generated/minval_r8.c: Regenerate.
* generated/product_c10.c: Regenerate.
* generated/product_c16.c: Regenerate.
* generated/product_c17.c: Regenerate.
* generated/product_c4.c: Regenerate.
* generated/product_c8.c: Regenerate.
* generated/product_i1.c: Regenerate.
* generated/product_i16.c: Regenerate.
* generated/product_i2.c: Regenerate.
* generated/product_i4.c: Regenerate.
* generated/product_i8.c: Regenerate.
* generated/product_r10.c: Regenerate.
* generated/product_r16.c: Regenerate.
* generated/product_r17.c: Regenerate.
* generated/product_r4.c: Regenerate.
* generated/product_r8.c: Regenerate.
* generated/sum_c10.c: Regenerate.
* generated/sum_c16.c: Regenerate.
* generated/sum_c17.c: Regenerate.
* generated/sum_c4.c: Regenerate.
* generated/sum_c8.c: Regenerate.
* generated/sum_i1.c: Regenerate.
* generated/sum_i16.c: Regenerate.
* generated/sum_i2.c: Regenerate.
* generated/sum_i4.c: Regenerate.
* generated/sum_i8.c: Regenerate.
* generated/sum_r10.c: Regenerate.
* generated/sum_r16.c: Regenerate.
* generated/sum_r17.c: Regenerate.
* generated/sum_r4.c: Regenerate.
* generated/sum_r8.c: Regenerate.
gcc/testsuite/ChangeLog:
* gfortran.dg/allocated_4.f90: New test.
2023-11-07 10:24:02 +00:00
|
|
|
retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
if (alloc_size == 0)
|
libgfortran: Remove empty array descriptor first dimension overwrite [PR112371]
Remove the forced overwrite of the first dimension of the result array
descriptor to set it to zero extent, in the function templates for
transformational functions doing an array reduction along a dimension. This
overwrite, which happened before early returning in case the result array
was empty, was wrong because an array may have a non-zero extent in the
first dimension and still be empty if it has a zero extent in a higher
dimension. Overwriting the dimension was resulting in wrong array result
upper bound for the first dimension in that case.
The offending piece of code was present in several places, and this removes
them all. More precisely, there is only one case to fix for logical
reduction functions, and there are three cases for other reduction
functions, corresponding to non-masked reduction, reduction with array mask,
and reduction with scalar mask. The impacted m4 files are
ifunction_logical.m4 for logical reduction functions, ifunction.m4 for
regular functions and types, ifunction-s.m4 for character minloc and maxloc,
ifunction-s2.m4 for character minval and maxval, and ifindloc1.m4 for
findloc.
PR fortran/112371
libgfortran/ChangeLog:
* m4/ifunction.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Remove overwrite of the first dimension of the
array descriptor.
* m4/ifunction-s.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction-s2.m4 (START_ARRAY_FUNCTION,
START_MASKED_ARRAY_FUNCTION, SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction_logical.m4 (START_ARRAY_FUNCTION): Ditto.
* m4/ifindloc1.m4: Ditto.
* generated/all_l1.c: Regenerate.
* generated/all_l16.c: Regenerate.
* generated/all_l2.c: Regenerate.
* generated/all_l4.c: Regenerate.
* generated/all_l8.c: Regenerate.
* generated/any_l1.c: Regenerate.
* generated/any_l16.c: Regenerate.
* generated/any_l2.c: Regenerate.
* generated/any_l4.c: Regenerate.
* generated/any_l8.c: Regenerate.
* generated/count_16_l.c: Regenerate.
* generated/count_1_l.c: Regenerate.
* generated/count_2_l.c: Regenerate.
* generated/count_4_l.c: Regenerate.
* generated/count_8_l.c: Regenerate.
* generated/findloc1_c10.c: Regenerate.
* generated/findloc1_c16.c: Regenerate.
* generated/findloc1_c17.c: Regenerate.
* generated/findloc1_c4.c: Regenerate.
* generated/findloc1_c8.c: Regenerate.
* generated/findloc1_i1.c: Regenerate.
* generated/findloc1_i16.c: Regenerate.
* generated/findloc1_i2.c: Regenerate.
* generated/findloc1_i4.c: Regenerate.
* generated/findloc1_i8.c: Regenerate.
* generated/findloc1_r10.c: Regenerate.
* generated/findloc1_r16.c: Regenerate.
* generated/findloc1_r17.c: Regenerate.
* generated/findloc1_r4.c: Regenerate.
* generated/findloc1_r8.c: Regenerate.
* generated/findloc1_s1.c: Regenerate.
* generated/findloc1_s4.c: Regenerate.
* generated/iall_i1.c: Regenerate.
* generated/iall_i16.c: Regenerate.
* generated/iall_i2.c: Regenerate.
* generated/iall_i4.c: Regenerate.
* generated/iall_i8.c: Regenerate.
* generated/iany_i1.c: Regenerate.
* generated/iany_i16.c: Regenerate.
* generated/iany_i2.c: Regenerate.
* generated/iany_i4.c: Regenerate.
* generated/iany_i8.c: Regenerate.
* generated/iparity_i1.c: Regenerate.
* generated/iparity_i16.c: Regenerate.
* generated/iparity_i2.c: Regenerate.
* generated/iparity_i4.c: Regenerate.
* generated/iparity_i8.c: Regenerate.
* generated/maxloc1_16_i1.c: Regenerate.
* generated/maxloc1_16_i16.c: Regenerate.
* generated/maxloc1_16_i2.c: Regenerate.
* generated/maxloc1_16_i4.c: Regenerate.
* generated/maxloc1_16_i8.c: Regenerate.
* generated/maxloc1_16_r10.c: Regenerate.
* generated/maxloc1_16_r16.c: Regenerate.
* generated/maxloc1_16_r17.c: Regenerate.
* generated/maxloc1_16_r4.c: Regenerate.
* generated/maxloc1_16_r8.c: Regenerate.
* generated/maxloc1_16_s1.c: Regenerate.
* generated/maxloc1_16_s4.c: Regenerate.
* generated/maxloc1_4_i1.c: Regenerate.
* generated/maxloc1_4_i16.c: Regenerate.
* generated/maxloc1_4_i2.c: Regenerate.
* generated/maxloc1_4_i4.c: Regenerate.
* generated/maxloc1_4_i8.c: Regenerate.
* generated/maxloc1_4_r10.c: Regenerate.
* generated/maxloc1_4_r16.c: Regenerate.
* generated/maxloc1_4_r17.c: Regenerate.
* generated/maxloc1_4_r4.c: Regenerate.
* generated/maxloc1_4_r8.c: Regenerate.
* generated/maxloc1_4_s1.c: Regenerate.
* generated/maxloc1_4_s4.c: Regenerate.
* generated/maxloc1_8_i1.c: Regenerate.
* generated/maxloc1_8_i16.c: Regenerate.
* generated/maxloc1_8_i2.c: Regenerate.
* generated/maxloc1_8_i4.c: Regenerate.
* generated/maxloc1_8_i8.c: Regenerate.
* generated/maxloc1_8_r10.c: Regenerate.
* generated/maxloc1_8_r16.c: Regenerate.
* generated/maxloc1_8_r17.c: Regenerate.
* generated/maxloc1_8_r4.c: Regenerate.
* generated/maxloc1_8_r8.c: Regenerate.
* generated/maxloc1_8_s1.c: Regenerate.
* generated/maxloc1_8_s4.c: Regenerate.
* generated/maxval1_s1.c: Regenerate.
* generated/maxval1_s4.c: Regenerate.
* generated/maxval_i1.c: Regenerate.
* generated/maxval_i16.c: Regenerate.
* generated/maxval_i2.c: Regenerate.
* generated/maxval_i4.c: Regenerate.
* generated/maxval_i8.c: Regenerate.
* generated/maxval_r10.c: Regenerate.
* generated/maxval_r16.c: Regenerate.
* generated/maxval_r17.c: Regenerate.
* generated/maxval_r4.c: Regenerate.
* generated/maxval_r8.c: Regenerate.
* generated/minloc1_16_i1.c: Regenerate.
* generated/minloc1_16_i16.c: Regenerate.
* generated/minloc1_16_i2.c: Regenerate.
* generated/minloc1_16_i4.c: Regenerate.
* generated/minloc1_16_i8.c: Regenerate.
* generated/minloc1_16_r10.c: Regenerate.
* generated/minloc1_16_r16.c: Regenerate.
* generated/minloc1_16_r17.c: Regenerate.
* generated/minloc1_16_r4.c: Regenerate.
* generated/minloc1_16_r8.c: Regenerate.
* generated/minloc1_16_s1.c: Regenerate.
* generated/minloc1_16_s4.c: Regenerate.
* generated/minloc1_4_i1.c: Regenerate.
* generated/minloc1_4_i16.c: Regenerate.
* generated/minloc1_4_i2.c: Regenerate.
* generated/minloc1_4_i4.c: Regenerate.
* generated/minloc1_4_i8.c: Regenerate.
* generated/minloc1_4_r10.c: Regenerate.
* generated/minloc1_4_r16.c: Regenerate.
* generated/minloc1_4_r17.c: Regenerate.
* generated/minloc1_4_r4.c: Regenerate.
* generated/minloc1_4_r8.c: Regenerate.
* generated/minloc1_4_s1.c: Regenerate.
* generated/minloc1_4_s4.c: Regenerate.
* generated/minloc1_8_i1.c: Regenerate.
* generated/minloc1_8_i16.c: Regenerate.
* generated/minloc1_8_i2.c: Regenerate.
* generated/minloc1_8_i4.c: Regenerate.
* generated/minloc1_8_i8.c: Regenerate.
* generated/minloc1_8_r10.c: Regenerate.
* generated/minloc1_8_r16.c: Regenerate.
* generated/minloc1_8_r17.c: Regenerate.
* generated/minloc1_8_r4.c: Regenerate.
* generated/minloc1_8_r8.c: Regenerate.
* generated/minloc1_8_s1.c: Regenerate.
* generated/minloc1_8_s4.c: Regenerate.
* generated/minval1_s1.c: Regenerate.
* generated/minval1_s4.c: Regenerate.
* generated/minval_i1.c: Regenerate.
* generated/minval_i16.c: Regenerate.
* generated/minval_i2.c: Regenerate.
* generated/minval_i4.c: Regenerate.
* generated/minval_i8.c: Regenerate.
* generated/minval_r10.c: Regenerate.
* generated/minval_r16.c: Regenerate.
* generated/minval_r17.c: Regenerate.
* generated/minval_r4.c: Regenerate.
* generated/minval_r8.c: Regenerate.
* generated/norm2_r10.c: Regenerate.
* generated/norm2_r16.c: Regenerate.
* generated/norm2_r17.c: Regenerate.
* generated/norm2_r4.c: Regenerate.
* generated/norm2_r8.c: Regenerate.
* generated/parity_l1.c: Regenerate.
* generated/parity_l16.c: Regenerate.
* generated/parity_l2.c: Regenerate.
* generated/parity_l4.c: Regenerate.
* generated/parity_l8.c: Regenerate.
* generated/product_c10.c: Regenerate.
* generated/product_c16.c: Regenerate.
* generated/product_c17.c: Regenerate.
* generated/product_c4.c: Regenerate.
* generated/product_c8.c: Regenerate.
* generated/product_i1.c: Regenerate.
* generated/product_i16.c: Regenerate.
* generated/product_i2.c: Regenerate.
* generated/product_i4.c: Regenerate.
* generated/product_i8.c: Regenerate.
* generated/product_r10.c: Regenerate.
* generated/product_r16.c: Regenerate.
* generated/product_r17.c: Regenerate.
* generated/product_r4.c: Regenerate.
* generated/product_r8.c: Regenerate.
* generated/sum_c10.c: Regenerate.
* generated/sum_c16.c: Regenerate.
* generated/sum_c17.c: Regenerate.
* generated/sum_c4.c: Regenerate.
* generated/sum_c8.c: Regenerate.
* generated/sum_i1.c: Regenerate.
* generated/sum_i16.c: Regenerate.
* generated/sum_i2.c: Regenerate.
* generated/sum_i4.c: Regenerate.
* generated/sum_i8.c: Regenerate.
* generated/sum_r10.c: Regenerate.
* generated/sum_r16.c: Regenerate.
* generated/sum_r17.c: Regenerate.
* generated/sum_r4.c: Regenerate.
* generated/sum_r8.c: Regenerate.
gcc/testsuite/ChangeLog:
* gfortran.dg/bound_11.f90: New test.
2023-11-07 10:24:04 +00:00
|
|
|
return;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (rank != GFC_DESCRIPTOR_RANK (retarray))
|
|
|
|
runtime_error ("rank of return array incorrect in IALL intrinsic");
|
|
|
|
|
|
|
|
if (unlikely (compile_options.bounds_check))
|
|
|
|
{
|
|
|
|
bounds_ifunction_return ((array_t *) retarray, extent,
|
|
|
|
"return value", "IALL");
|
|
|
|
bounds_equal_extents ((array_t *) mask, (array_t *) array,
|
|
|
|
"MASK argument", "IALL");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (n = 0; n < rank; n++)
|
|
|
|
{
|
|
|
|
count[n] = 0;
|
|
|
|
dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
|
|
|
|
if (extent[n] <= 0)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
dest = retarray->base_addr;
|
|
|
|
base = array->base_addr;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
while (base)
|
|
|
|
{
|
|
|
|
const GFC_INTEGER_1 * restrict src;
|
|
|
|
const GFC_LOGICAL_1 * restrict msrc;
|
|
|
|
GFC_INTEGER_1 result;
|
|
|
|
src = base;
|
|
|
|
msrc = mbase;
|
|
|
|
{
|
|
|
|
|
2020-09-03 18:33:14 +00:00
|
|
|
result = (GFC_INTEGER_1) -1;
|
2012-10-28 16:54:44 +00:00
|
|
|
for (n = 0; n < len; n++, src += delta, msrc += mdelta)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
if (*msrc)
|
|
|
|
result &= *src;
|
|
|
|
}
|
2012-10-28 16:54:44 +00:00
|
|
|
*dest = result;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
}
|
|
|
|
/* Advance to the next element. */
|
|
|
|
count[0]++;
|
|
|
|
base += sstride[0];
|
|
|
|
mbase += mstride[0];
|
|
|
|
dest += dstride[0];
|
|
|
|
n = 0;
|
|
|
|
while (count[n] == extent[n])
|
|
|
|
{
|
|
|
|
/* When we get to the end of a dimension, reset it and increment
|
|
|
|
the next dimension. */
|
|
|
|
count[n] = 0;
|
|
|
|
/* We could precalculate these products, but this is a less
|
|
|
|
frequently used path so probably not worth it. */
|
|
|
|
base -= sstride[n] * extent[n];
|
|
|
|
mbase -= mstride[n] * extent[n];
|
|
|
|
dest -= dstride[n] * extent[n];
|
|
|
|
n++;
|
2017-03-10 19:42:46 +00:00
|
|
|
if (n >= rank)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
2017-03-10 19:42:46 +00:00
|
|
|
/* Break out of the loop. */
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
base = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
count[n]++;
|
|
|
|
base += sstride[n];
|
|
|
|
mbase += mstride[n];
|
|
|
|
dest += dstride[n];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern void siall_i1 (gfc_array_i1 * const restrict,
|
|
|
|
gfc_array_i1 * const restrict, const index_type * const restrict,
|
|
|
|
GFC_LOGICAL_4 *);
|
|
|
|
export_proto(siall_i1);
|
|
|
|
|
|
|
|
void
|
|
|
|
siall_i1 (gfc_array_i1 * const restrict retarray,
|
|
|
|
gfc_array_i1 * const restrict array,
|
|
|
|
const index_type * const restrict pdim,
|
|
|
|
GFC_LOGICAL_4 * mask)
|
|
|
|
{
|
|
|
|
index_type count[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type extent[GFC_MAX_DIMENSIONS];
|
|
|
|
index_type dstride[GFC_MAX_DIMENSIONS];
|
|
|
|
GFC_INTEGER_1 * restrict dest;
|
|
|
|
index_type rank;
|
|
|
|
index_type n;
|
|
|
|
index_type dim;
|
|
|
|
|
|
|
|
|
2018-12-31 14:59:46 +00:00
|
|
|
if (mask == NULL || *mask)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
2018-01-15 18:35:13 +00:00
|
|
|
#ifdef HAVE_BACK_ARG
|
|
|
|
iall_i1 (retarray, array, pdim, back);
|
|
|
|
#else
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
iall_i1 (retarray, array, pdim);
|
2018-01-15 18:35:13 +00:00
|
|
|
#endif
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
/* Make dim zero based to avoid confusion. */
|
|
|
|
dim = (*pdim) - 1;
|
|
|
|
rank = GFC_DESCRIPTOR_RANK (array) - 1;
|
|
|
|
|
2017-07-31 09:34:36 +00:00
|
|
|
if (unlikely (dim < 0 || dim > rank))
|
|
|
|
{
|
|
|
|
runtime_error ("Dim argument incorrect in IALL intrinsic: "
|
|
|
|
"is %ld, should be between 1 and %ld",
|
|
|
|
(long int) dim + 1, (long int) rank + 1);
|
|
|
|
}
|
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
for (n = 0; n < dim; n++)
|
|
|
|
{
|
|
|
|
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
|
|
|
|
|
|
|
|
if (extent[n] <= 0)
|
|
|
|
extent[n] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (n = dim; n < rank; n++)
|
|
|
|
{
|
|
|
|
extent[n] =
|
|
|
|
GFC_DESCRIPTOR_EXTENT(array,n + 1);
|
|
|
|
|
|
|
|
if (extent[n] <= 0)
|
|
|
|
extent[n] = 0;
|
|
|
|
}
|
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
if (retarray->base_addr == NULL)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
{
|
|
|
|
size_t alloc_size, str;
|
|
|
|
|
|
|
|
for (n = 0; n < rank; n++)
|
|
|
|
{
|
|
|
|
if (n == 0)
|
|
|
|
str = 1;
|
|
|
|
else
|
|
|
|
str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
|
|
|
|
|
|
|
|
GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
retarray->offset = 0;
|
2018-06-01 20:20:35 +00:00
|
|
|
retarray->dtype.rank = rank;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
2014-06-17 03:50:34 +00:00
|
|
|
alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
libgfortran: Don't skip allocation if size is zero [PR112412]
In the function template of transformational functions doing a reduction
of an array along one dimension, if the passed in result array was
unallocated and the calculated allocation size was zero (this is the case
of empty result arrays), an early return used to skip the allocation. This
change moves the allocation before the early return, so that empty result
arrays are not seen as unallocated. This is possible because zero size is
explicitly supported by the allocation function.
The offending code is present in several places, and this updates them all.
More precisely, there is one place in the template for logical reductions,
and there are two places in the templates corresponding to masked reductions
with respectively array mask and scalar mask. Templates for unmasked
reductions, which already allocate before returning, are not affected, but
unmasked reductions are checked nevertheless in the testcase. The affected
m4 files are ifunction.m4 for regular functions and types, ifunction-s.m4
for character minloc and maxloc, ifunction-s2.m4 for character minval and
maxval, and ifunction_logical for logical reductions.
PR fortran/112412
libgfortran/ChangeLog:
* m4/ifunction.m4 (START_MASKED_ARRAY_FUNCTION, SCALAR_ARRAY_FUNCTION):
Don't skip allocation if the allocation size is zero.
* m4/ifunction-s.m4 (START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction-s2.m4 (START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction_logical.m4 (START_ARRAY_FUNCTION): Ditto.
* generated/all_l1.c: Regenerate.
* generated/all_l16.c: Regenerate.
* generated/all_l2.c: Regenerate.
* generated/all_l4.c: Regenerate.
* generated/all_l8.c: Regenerate.
* generated/any_l1.c: Regenerate.
* generated/any_l16.c: Regenerate.
* generated/any_l2.c: Regenerate.
* generated/any_l4.c: Regenerate.
* generated/any_l8.c: Regenerate.
* generated/count_16_l.c: Regenerate.
* generated/count_1_l.c: Regenerate.
* generated/count_2_l.c: Regenerate.
* generated/count_4_l.c: Regenerate.
* generated/count_8_l.c: Regenerate.
* generated/iall_i1.c: Regenerate.
* generated/iall_i16.c: Regenerate.
* generated/iall_i2.c: Regenerate.
* generated/iall_i4.c: Regenerate.
* generated/iall_i8.c: Regenerate.
* generated/iany_i1.c: Regenerate.
* generated/iany_i16.c: Regenerate.
* generated/iany_i2.c: Regenerate.
* generated/iany_i4.c: Regenerate.
* generated/iany_i8.c: Regenerate.
* generated/iparity_i1.c: Regenerate.
* generated/iparity_i16.c: Regenerate.
* generated/iparity_i2.c: Regenerate.
* generated/iparity_i4.c: Regenerate.
* generated/iparity_i8.c: Regenerate.
* generated/maxloc1_16_i1.c: Regenerate.
* generated/maxloc1_16_i16.c: Regenerate.
* generated/maxloc1_16_i2.c: Regenerate.
* generated/maxloc1_16_i4.c: Regenerate.
* generated/maxloc1_16_i8.c: Regenerate.
* generated/maxloc1_16_r10.c: Regenerate.
* generated/maxloc1_16_r16.c: Regenerate.
* generated/maxloc1_16_r17.c: Regenerate.
* generated/maxloc1_16_r4.c: Regenerate.
* generated/maxloc1_16_r8.c: Regenerate.
* generated/maxloc1_16_s1.c: Regenerate.
* generated/maxloc1_16_s4.c: Regenerate.
* generated/maxloc1_4_i1.c: Regenerate.
* generated/maxloc1_4_i16.c: Regenerate.
* generated/maxloc1_4_i2.c: Regenerate.
* generated/maxloc1_4_i4.c: Regenerate.
* generated/maxloc1_4_i8.c: Regenerate.
* generated/maxloc1_4_r10.c: Regenerate.
* generated/maxloc1_4_r16.c: Regenerate.
* generated/maxloc1_4_r17.c: Regenerate.
* generated/maxloc1_4_r4.c: Regenerate.
* generated/maxloc1_4_r8.c: Regenerate.
* generated/maxloc1_4_s1.c: Regenerate.
* generated/maxloc1_4_s4.c: Regenerate.
* generated/maxloc1_8_i1.c: Regenerate.
* generated/maxloc1_8_i16.c: Regenerate.
* generated/maxloc1_8_i2.c: Regenerate.
* generated/maxloc1_8_i4.c: Regenerate.
* generated/maxloc1_8_i8.c: Regenerate.
* generated/maxloc1_8_r10.c: Regenerate.
* generated/maxloc1_8_r16.c: Regenerate.
* generated/maxloc1_8_r17.c: Regenerate.
* generated/maxloc1_8_r4.c: Regenerate.
* generated/maxloc1_8_r8.c: Regenerate.
* generated/maxloc1_8_s1.c: Regenerate.
* generated/maxloc1_8_s4.c: Regenerate.
* generated/maxval1_s1.c: Regenerate.
* generated/maxval1_s4.c: Regenerate.
* generated/maxval_i1.c: Regenerate.
* generated/maxval_i16.c: Regenerate.
* generated/maxval_i2.c: Regenerate.
* generated/maxval_i4.c: Regenerate.
* generated/maxval_i8.c: Regenerate.
* generated/maxval_r10.c: Regenerate.
* generated/maxval_r16.c: Regenerate.
* generated/maxval_r17.c: Regenerate.
* generated/maxval_r4.c: Regenerate.
* generated/maxval_r8.c: Regenerate.
* generated/minloc1_16_i1.c: Regenerate.
* generated/minloc1_16_i16.c: Regenerate.
* generated/minloc1_16_i2.c: Regenerate.
* generated/minloc1_16_i4.c: Regenerate.
* generated/minloc1_16_i8.c: Regenerate.
* generated/minloc1_16_r10.c: Regenerate.
* generated/minloc1_16_r16.c: Regenerate.
* generated/minloc1_16_r17.c: Regenerate.
* generated/minloc1_16_r4.c: Regenerate.
* generated/minloc1_16_r8.c: Regenerate.
* generated/minloc1_16_s1.c: Regenerate.
* generated/minloc1_16_s4.c: Regenerate.
* generated/minloc1_4_i1.c: Regenerate.
* generated/minloc1_4_i16.c: Regenerate.
* generated/minloc1_4_i2.c: Regenerate.
* generated/minloc1_4_i4.c: Regenerate.
* generated/minloc1_4_i8.c: Regenerate.
* generated/minloc1_4_r10.c: Regenerate.
* generated/minloc1_4_r16.c: Regenerate.
* generated/minloc1_4_r17.c: Regenerate.
* generated/minloc1_4_r4.c: Regenerate.
* generated/minloc1_4_r8.c: Regenerate.
* generated/minloc1_4_s1.c: Regenerate.
* generated/minloc1_4_s4.c: Regenerate.
* generated/minloc1_8_i1.c: Regenerate.
* generated/minloc1_8_i16.c: Regenerate.
* generated/minloc1_8_i2.c: Regenerate.
* generated/minloc1_8_i4.c: Regenerate.
* generated/minloc1_8_i8.c: Regenerate.
* generated/minloc1_8_r10.c: Regenerate.
* generated/minloc1_8_r16.c: Regenerate.
* generated/minloc1_8_r17.c: Regenerate.
* generated/minloc1_8_r4.c: Regenerate.
* generated/minloc1_8_r8.c: Regenerate.
* generated/minloc1_8_s1.c: Regenerate.
* generated/minloc1_8_s4.c: Regenerate.
* generated/minval1_s1.c: Regenerate.
* generated/minval1_s4.c: Regenerate.
* generated/minval_i1.c: Regenerate.
* generated/minval_i16.c: Regenerate.
* generated/minval_i2.c: Regenerate.
* generated/minval_i4.c: Regenerate.
* generated/minval_i8.c: Regenerate.
* generated/minval_r10.c: Regenerate.
* generated/minval_r16.c: Regenerate.
* generated/minval_r17.c: Regenerate.
* generated/minval_r4.c: Regenerate.
* generated/minval_r8.c: Regenerate.
* generated/product_c10.c: Regenerate.
* generated/product_c16.c: Regenerate.
* generated/product_c17.c: Regenerate.
* generated/product_c4.c: Regenerate.
* generated/product_c8.c: Regenerate.
* generated/product_i1.c: Regenerate.
* generated/product_i16.c: Regenerate.
* generated/product_i2.c: Regenerate.
* generated/product_i4.c: Regenerate.
* generated/product_i8.c: Regenerate.
* generated/product_r10.c: Regenerate.
* generated/product_r16.c: Regenerate.
* generated/product_r17.c: Regenerate.
* generated/product_r4.c: Regenerate.
* generated/product_r8.c: Regenerate.
* generated/sum_c10.c: Regenerate.
* generated/sum_c16.c: Regenerate.
* generated/sum_c17.c: Regenerate.
* generated/sum_c4.c: Regenerate.
* generated/sum_c8.c: Regenerate.
* generated/sum_i1.c: Regenerate.
* generated/sum_i16.c: Regenerate.
* generated/sum_i2.c: Regenerate.
* generated/sum_i4.c: Regenerate.
* generated/sum_i8.c: Regenerate.
* generated/sum_r10.c: Regenerate.
* generated/sum_r16.c: Regenerate.
* generated/sum_r17.c: Regenerate.
* generated/sum_r4.c: Regenerate.
* generated/sum_r8.c: Regenerate.
gcc/testsuite/ChangeLog:
* gfortran.dg/allocated_4.f90: New test.
2023-11-07 10:24:02 +00:00
|
|
|
retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
if (alloc_size == 0)
|
libgfortran: Remove empty array descriptor first dimension overwrite [PR112371]
Remove the forced overwrite of the first dimension of the result array
descriptor to set it to zero extent, in the function templates for
transformational functions doing an array reduction along a dimension. This
overwrite, which happened before early returning in case the result array
was empty, was wrong because an array may have a non-zero extent in the
first dimension and still be empty if it has a zero extent in a higher
dimension. Overwriting the dimension was resulting in wrong array result
upper bound for the first dimension in that case.
The offending piece of code was present in several places, and this removes
them all. More precisely, there is only one case to fix for logical
reduction functions, and there are three cases for other reduction
functions, corresponding to non-masked reduction, reduction with array mask,
and reduction with scalar mask. The impacted m4 files are
ifunction_logical.m4 for logical reduction functions, ifunction.m4 for
regular functions and types, ifunction-s.m4 for character minloc and maxloc,
ifunction-s2.m4 for character minval and maxval, and ifindloc1.m4 for
findloc.
PR fortran/112371
libgfortran/ChangeLog:
* m4/ifunction.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Remove overwrite of the first dimension of the
array descriptor.
* m4/ifunction-s.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction-s2.m4 (START_ARRAY_FUNCTION,
START_MASKED_ARRAY_FUNCTION, SCALAR_ARRAY_FUNCTION): Ditto.
* m4/ifunction_logical.m4 (START_ARRAY_FUNCTION): Ditto.
* m4/ifindloc1.m4: Ditto.
* generated/all_l1.c: Regenerate.
* generated/all_l16.c: Regenerate.
* generated/all_l2.c: Regenerate.
* generated/all_l4.c: Regenerate.
* generated/all_l8.c: Regenerate.
* generated/any_l1.c: Regenerate.
* generated/any_l16.c: Regenerate.
* generated/any_l2.c: Regenerate.
* generated/any_l4.c: Regenerate.
* generated/any_l8.c: Regenerate.
* generated/count_16_l.c: Regenerate.
* generated/count_1_l.c: Regenerate.
* generated/count_2_l.c: Regenerate.
* generated/count_4_l.c: Regenerate.
* generated/count_8_l.c: Regenerate.
* generated/findloc1_c10.c: Regenerate.
* generated/findloc1_c16.c: Regenerate.
* generated/findloc1_c17.c: Regenerate.
* generated/findloc1_c4.c: Regenerate.
* generated/findloc1_c8.c: Regenerate.
* generated/findloc1_i1.c: Regenerate.
* generated/findloc1_i16.c: Regenerate.
* generated/findloc1_i2.c: Regenerate.
* generated/findloc1_i4.c: Regenerate.
* generated/findloc1_i8.c: Regenerate.
* generated/findloc1_r10.c: Regenerate.
* generated/findloc1_r16.c: Regenerate.
* generated/findloc1_r17.c: Regenerate.
* generated/findloc1_r4.c: Regenerate.
* generated/findloc1_r8.c: Regenerate.
* generated/findloc1_s1.c: Regenerate.
* generated/findloc1_s4.c: Regenerate.
* generated/iall_i1.c: Regenerate.
* generated/iall_i16.c: Regenerate.
* generated/iall_i2.c: Regenerate.
* generated/iall_i4.c: Regenerate.
* generated/iall_i8.c: Regenerate.
* generated/iany_i1.c: Regenerate.
* generated/iany_i16.c: Regenerate.
* generated/iany_i2.c: Regenerate.
* generated/iany_i4.c: Regenerate.
* generated/iany_i8.c: Regenerate.
* generated/iparity_i1.c: Regenerate.
* generated/iparity_i16.c: Regenerate.
* generated/iparity_i2.c: Regenerate.
* generated/iparity_i4.c: Regenerate.
* generated/iparity_i8.c: Regenerate.
* generated/maxloc1_16_i1.c: Regenerate.
* generated/maxloc1_16_i16.c: Regenerate.
* generated/maxloc1_16_i2.c: Regenerate.
* generated/maxloc1_16_i4.c: Regenerate.
* generated/maxloc1_16_i8.c: Regenerate.
* generated/maxloc1_16_r10.c: Regenerate.
* generated/maxloc1_16_r16.c: Regenerate.
* generated/maxloc1_16_r17.c: Regenerate.
* generated/maxloc1_16_r4.c: Regenerate.
* generated/maxloc1_16_r8.c: Regenerate.
* generated/maxloc1_16_s1.c: Regenerate.
* generated/maxloc1_16_s4.c: Regenerate.
* generated/maxloc1_4_i1.c: Regenerate.
* generated/maxloc1_4_i16.c: Regenerate.
* generated/maxloc1_4_i2.c: Regenerate.
* generated/maxloc1_4_i4.c: Regenerate.
* generated/maxloc1_4_i8.c: Regenerate.
* generated/maxloc1_4_r10.c: Regenerate.
* generated/maxloc1_4_r16.c: Regenerate.
* generated/maxloc1_4_r17.c: Regenerate.
* generated/maxloc1_4_r4.c: Regenerate.
* generated/maxloc1_4_r8.c: Regenerate.
* generated/maxloc1_4_s1.c: Regenerate.
* generated/maxloc1_4_s4.c: Regenerate.
* generated/maxloc1_8_i1.c: Regenerate.
* generated/maxloc1_8_i16.c: Regenerate.
* generated/maxloc1_8_i2.c: Regenerate.
* generated/maxloc1_8_i4.c: Regenerate.
* generated/maxloc1_8_i8.c: Regenerate.
* generated/maxloc1_8_r10.c: Regenerate.
* generated/maxloc1_8_r16.c: Regenerate.
* generated/maxloc1_8_r17.c: Regenerate.
* generated/maxloc1_8_r4.c: Regenerate.
* generated/maxloc1_8_r8.c: Regenerate.
* generated/maxloc1_8_s1.c: Regenerate.
* generated/maxloc1_8_s4.c: Regenerate.
* generated/maxval1_s1.c: Regenerate.
* generated/maxval1_s4.c: Regenerate.
* generated/maxval_i1.c: Regenerate.
* generated/maxval_i16.c: Regenerate.
* generated/maxval_i2.c: Regenerate.
* generated/maxval_i4.c: Regenerate.
* generated/maxval_i8.c: Regenerate.
* generated/maxval_r10.c: Regenerate.
* generated/maxval_r16.c: Regenerate.
* generated/maxval_r17.c: Regenerate.
* generated/maxval_r4.c: Regenerate.
* generated/maxval_r8.c: Regenerate.
* generated/minloc1_16_i1.c: Regenerate.
* generated/minloc1_16_i16.c: Regenerate.
* generated/minloc1_16_i2.c: Regenerate.
* generated/minloc1_16_i4.c: Regenerate.
* generated/minloc1_16_i8.c: Regenerate.
* generated/minloc1_16_r10.c: Regenerate.
* generated/minloc1_16_r16.c: Regenerate.
* generated/minloc1_16_r17.c: Regenerate.
* generated/minloc1_16_r4.c: Regenerate.
* generated/minloc1_16_r8.c: Regenerate.
* generated/minloc1_16_s1.c: Regenerate.
* generated/minloc1_16_s4.c: Regenerate.
* generated/minloc1_4_i1.c: Regenerate.
* generated/minloc1_4_i16.c: Regenerate.
* generated/minloc1_4_i2.c: Regenerate.
* generated/minloc1_4_i4.c: Regenerate.
* generated/minloc1_4_i8.c: Regenerate.
* generated/minloc1_4_r10.c: Regenerate.
* generated/minloc1_4_r16.c: Regenerate.
* generated/minloc1_4_r17.c: Regenerate.
* generated/minloc1_4_r4.c: Regenerate.
* generated/minloc1_4_r8.c: Regenerate.
* generated/minloc1_4_s1.c: Regenerate.
* generated/minloc1_4_s4.c: Regenerate.
* generated/minloc1_8_i1.c: Regenerate.
* generated/minloc1_8_i16.c: Regenerate.
* generated/minloc1_8_i2.c: Regenerate.
* generated/minloc1_8_i4.c: Regenerate.
* generated/minloc1_8_i8.c: Regenerate.
* generated/minloc1_8_r10.c: Regenerate.
* generated/minloc1_8_r16.c: Regenerate.
* generated/minloc1_8_r17.c: Regenerate.
* generated/minloc1_8_r4.c: Regenerate.
* generated/minloc1_8_r8.c: Regenerate.
* generated/minloc1_8_s1.c: Regenerate.
* generated/minloc1_8_s4.c: Regenerate.
* generated/minval1_s1.c: Regenerate.
* generated/minval1_s4.c: Regenerate.
* generated/minval_i1.c: Regenerate.
* generated/minval_i16.c: Regenerate.
* generated/minval_i2.c: Regenerate.
* generated/minval_i4.c: Regenerate.
* generated/minval_i8.c: Regenerate.
* generated/minval_r10.c: Regenerate.
* generated/minval_r16.c: Regenerate.
* generated/minval_r17.c: Regenerate.
* generated/minval_r4.c: Regenerate.
* generated/minval_r8.c: Regenerate.
* generated/norm2_r10.c: Regenerate.
* generated/norm2_r16.c: Regenerate.
* generated/norm2_r17.c: Regenerate.
* generated/norm2_r4.c: Regenerate.
* generated/norm2_r8.c: Regenerate.
* generated/parity_l1.c: Regenerate.
* generated/parity_l16.c: Regenerate.
* generated/parity_l2.c: Regenerate.
* generated/parity_l4.c: Regenerate.
* generated/parity_l8.c: Regenerate.
* generated/product_c10.c: Regenerate.
* generated/product_c16.c: Regenerate.
* generated/product_c17.c: Regenerate.
* generated/product_c4.c: Regenerate.
* generated/product_c8.c: Regenerate.
* generated/product_i1.c: Regenerate.
* generated/product_i16.c: Regenerate.
* generated/product_i2.c: Regenerate.
* generated/product_i4.c: Regenerate.
* generated/product_i8.c: Regenerate.
* generated/product_r10.c: Regenerate.
* generated/product_r16.c: Regenerate.
* generated/product_r17.c: Regenerate.
* generated/product_r4.c: Regenerate.
* generated/product_r8.c: Regenerate.
* generated/sum_c10.c: Regenerate.
* generated/sum_c16.c: Regenerate.
* generated/sum_c17.c: Regenerate.
* generated/sum_c4.c: Regenerate.
* generated/sum_c8.c: Regenerate.
* generated/sum_i1.c: Regenerate.
* generated/sum_i16.c: Regenerate.
* generated/sum_i2.c: Regenerate.
* generated/sum_i4.c: Regenerate.
* generated/sum_i8.c: Regenerate.
* generated/sum_r10.c: Regenerate.
* generated/sum_r16.c: Regenerate.
* generated/sum_r17.c: Regenerate.
* generated/sum_r4.c: Regenerate.
* generated/sum_r8.c: Regenerate.
gcc/testsuite/ChangeLog:
* gfortran.dg/bound_11.f90: New test.
2023-11-07 10:24:04 +00:00
|
|
|
return;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (rank != GFC_DESCRIPTOR_RANK (retarray))
|
|
|
|
runtime_error ("rank of return array incorrect in"
|
|
|
|
" IALL intrinsic: is %ld, should be %ld",
|
|
|
|
(long int) (GFC_DESCRIPTOR_RANK (retarray)),
|
|
|
|
(long int) rank);
|
|
|
|
|
|
|
|
if (unlikely (compile_options.bounds_check))
|
|
|
|
{
|
|
|
|
for (n=0; n < rank; n++)
|
|
|
|
{
|
|
|
|
index_type ret_extent;
|
|
|
|
|
|
|
|
ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
|
|
|
|
if (extent[n] != ret_extent)
|
|
|
|
runtime_error ("Incorrect extent in return value of"
|
|
|
|
" IALL intrinsic in dimension %ld:"
|
|
|
|
" is %ld, should be %ld", (long int) n + 1,
|
|
|
|
(long int) ret_extent, (long int) extent[n]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (n = 0; n < rank; n++)
|
|
|
|
{
|
|
|
|
count[n] = 0;
|
|
|
|
dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
|
|
|
|
}
|
|
|
|
|
libgfortran.h (descriptor_dimension, [...]): Rename _lbound to lower_bound and data to base_addr.
2012-03-10 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (descriptor_dimension, GFC_DIMENSION_LBOUND,
GFC_DIMENSION_EXTENT, GFC_DIMENSION_SET, GFC_DESCRIPTOR_DATA,
GFC_ARRAY_DESCRIPTOR): Rename _lbound to lower_bound and
data to base_addr.
* intrinsics/cshift0.c (size0, cshift0): Handle data to
base_addr rename.
* intrinsics/date_and_time.c (date_and_time, secnds, itime_i4,
itime_i8, gmtime_i4, gmtime_i8, ltime_i4, ltime_i8): Ditto.
* intrinsics/dtime.c (dtime_sub): Ditto.
* intrinsics/eoshift0.c (eoshift0): Ditto.
* intrinsics/eoshift2.c (eoshift2): Ditto.
* intrinsics/etime.c (etime_sub): Ditto.
* intrinsics/iso_c_binding.c (c_f_pointer_u0): Ditto.
* intrinsics/move_alloc.c (move_alloc): Ditto.
* intrinsics/pack_generic.c (pack_internal, pack,
pack_s_internal): Ditto.
* intrinsics/random.c (arandom_r4, arandom_r8, arandom_r10,
arandom_r16, random_seed_i4, random_seed_i8): Ditto.
* intrinsics/reshape_generic.c (reshape_internal): Ditto.
* intrinsics/spread_generic.c (spread_internal,
spread_internal_scalar, spread, spread_scalar): Ditto.
* intrinsics/stat.c (stat_i4_sub_0, stat_i8_sub_0, fstat_i4_sub,
fstat_i8_sub): Ditto.
* intrinsics/transpose_generic.c (transpose_internal): Ditto.
* intrinsics/unpack_generic.c (unpack_bounds, unpack_internal,
unpack1, unpack0, unpack0_char4): Ditto.
* m4/bessel.m4 (bessel_jn_r'rtype_kind`,
* bessel_yn_r'rtype_kind`):
Ditto.
* m4/cshift0.m4 (cshift0_'rtype_code`): Ditto.
* m4/cshift1.m4 (cshift1): Ditto.
* m4/eoshift1.m4 (eoshift1): Ditto.
* m4/eoshift3.m4 (eoshift3): Ditto.
* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
* Ditto.
* m4/in_pack.m4 (internal_pack_'rtype_ccode`): Ditto.
* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`): Ditto.
* m4/matmul.m4 (matmul_'rtype_code`): Ditto.
* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
* m4/pack.m4 (pack_'rtype_code`): Ditto.
* m4/reshape.m4 (reshape_'rtype_ccode`): Ditto.
* m4/shape.m4 (shape_'rtype_kind`): Ditto.
* m4/spread.m4 (spread_'rtype_code`): Ditto.
* m4/transpose.m4 (transpose_'rtype_code`): Ditto.
* m4/unpack.m4 (unpack0_'rtype_code`, unpack1_'rtype_code`):
* Ditto.
* runtime/bounds.c (count_0): Ditto.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* generated/cshift0_r4.c: Regenerated.
* generated/unpack_r8.c: Regenerated.
* generated/cshift0_c10.c: Regenerated.
* generated/in_unpack_i1.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/unpack_r16.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/unpack_i4.c: Regenerated.
* generated/in_pack_i1.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/unpack_i2.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/in_unpack_c8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/in_pack_c16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/in_pack_i2.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/matmul_l8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/matmul_c10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/unpack_c16.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/in_unpack_r8.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/in_unpack_r4.c: Regenerated.
* generated/unpack_i1.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/unpack_c8.c: Regenerated.
* generated/transpose_c8.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/unpack_i8.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/in_pack_r10.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/reshape_c10.c: Regenerated.
* generated/matmul_l4.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/in_unpack_c4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/unpack_i16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/in_pack_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/unpack_c10.c: Regenerated.
* generated/bessel_r4.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/in_pack_c8.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/unpack_r10.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/in_pack_r8.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/matmul_c16.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/matmul_i1.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/matmul_c4.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/in_unpack_i2.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/matmul_l16.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/shape_i16.c: Regenerated.
* generated/in_pack_c4.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/in_pack_r16.c: Regenerated.
* generated/iall_i16.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/in_pack_i16.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/shape_i4.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/unpack_c4.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/in_pack_c10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/in_pack_i4.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/unpack_r4.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
From-SVN: r185177
2012-03-10 17:22:31 +00:00
|
|
|
dest = retarray->base_addr;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
*dest = 0;
|
|
|
|
count[0]++;
|
|
|
|
dest += dstride[0];
|
|
|
|
n = 0;
|
|
|
|
while (count[n] == extent[n])
|
|
|
|
{
|
|
|
|
/* When we get to the end of a dimension, reset it and increment
|
|
|
|
the next dimension. */
|
|
|
|
count[n] = 0;
|
|
|
|
/* We could precalculate these products, but this is a less
|
|
|
|
frequently used path so probably not worth it. */
|
|
|
|
dest -= dstride[n] * extent[n];
|
|
|
|
n++;
|
2017-03-10 19:42:46 +00:00
|
|
|
if (n >= rank)
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 05:55:10 +00:00
|
|
|
return;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
count[n]++;
|
|
|
|
dest += dstride[n];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|