gcc/libgfortran/generated/iany_i1.c

501 lines
12 KiB
C
Raw Normal View History

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 07:55:10 +02:00
/* Implementation of the IANY intrinsic
Copyright (C) 2010-2016 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 07:55:10 +02: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"
#include <stdlib.h>
#include <assert.h>
#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
extern void iany_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict);
export_proto(iany_i1);
void
iany_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. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
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 18:22:31 +01: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 07:55:10 +02: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;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
Introduce xmallocarray, an overflow checking variant of xmalloc. 2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-17 05:50:34 +02: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 07:55:10 +02:00
Introduce xmallocarray, an overflow checking variant of xmalloc. 2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-17 05:50:34 +02: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 07:55:10 +02:00
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
return;
}
}
else
{
if (rank != GFC_DESCRIPTOR_RANK (retarray))
runtime_error ("rank of return array incorrect in"
" IANY 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", "IANY");
}
for (n = 0; n < rank; n++)
{
count[n] = 0;
dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
if (extent[n] <= 0)
re PR fortran/48066 (Segfault with SUM of zero-sized array) 2011-08-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/40866 * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/misc_specifics.F90: Regenerated (comment change). * generated/_abs_c10.F90: Regenerated (comment change). * generated/_abs_c16.F90: Regenerated (comment change). * generated/_abs_c4.F90: Regenerated (comment change). * generated/_abs_c8.F90: Regenerated (comment change). * generated/_abs_i16.F90: Regenerated (comment change). * generated/_abs_i4.F90: Regenerated (comment change). * generated/_abs_i8.F90: Regenerated (comment change). * generated/_abs_r10.F90: Regenerated (comment change). * generated/_abs_r16.F90: Regenerated (comment change). * generated/_abs_r4.F90: Regenerated (comment change). * generated/_abs_r8.F90: Regenerated (comment change). * generated/_acosh_r10.F90: Regenerated (comment change). * generated/_acosh_r16.F90: Regenerated (comment change). * generated/_acosh_r4.F90: Regenerated (comment change). * generated/_acosh_r8.F90: Regenerated (comment change). * generated/_acos_r10.F90: Regenerated (comment change). * generated/_acos_r16.F90: Regenerated (comment change). * generated/_acos_r4.F90: Regenerated (comment change). * generated/_acos_r8.F90: Regenerated (comment change). * generated/_aimag_c10.F90: Regenerated (comment change). * generated/_aimag_c16.F90: Regenerated (comment change). * generated/_aimag_c4.F90: Regenerated (comment change). * generated/_aimag_c8.F90: Regenerated (comment change). * generated/_aint_r10.F90: Regenerated (comment change). * generated/_aint_r16.F90: Regenerated (comment change). * generated/_aint_r4.F90: Regenerated (comment change). * generated/_aint_r8.F90: Regenerated (comment change). * generated/_anint_r10.F90: Regenerated (comment change). * generated/_anint_r16.F90: Regenerated (comment change). * generated/_anint_r4.F90: Regenerated (comment change). * generated/_anint_r8.F90: Regenerated (comment change). * generated/_asinh_r10.F90: Regenerated (comment change). * generated/_asinh_r16.F90: Regenerated (comment change). * generated/_asinh_r4.F90: Regenerated (comment change). * generated/_asinh_r8.F90: Regenerated (comment change). * generated/_asin_r10.F90: Regenerated (comment change). * generated/_asin_r16.F90: Regenerated (comment change). * generated/_asin_r4.F90: Regenerated (comment change). * generated/_asin_r8.F90: Regenerated (comment change). * generated/_atan2_r10.F90: Regenerated (comment change). * generated/_atan2_r16.F90: Regenerated (comment change). * generated/_atan2_r4.F90: Regenerated (comment change). * generated/_atan2_r8.F90: Regenerated (comment change). * generated/_atanh_r10.F90: Regenerated (comment change). * generated/_atanh_r16.F90: Regenerated (comment change). * generated/_atanh_r4.F90: Regenerated (comment change). * generated/_atanh_r8.F90: Regenerated (comment change). * generated/_atan_r10.F90: Regenerated (comment change). * generated/_atan_r16.F90: Regenerated (comment change). * generated/_atan_r4.F90: Regenerated (comment change). * generated/_atan_r8.F90: Regenerated (comment change). * generated/_conjg_c10.F90: Regenerated (comment change). * generated/_conjg_c16.F90: Regenerated (comment change). * generated/_conjg_c4.F90: Regenerated (comment change). * generated/_conjg_c8.F90: Regenerated (comment change). * generated/_cosh_r10.F90: Regenerated (comment change). * generated/_cosh_r16.F90: Regenerated (comment change). * generated/_cosh_r4.F90: Regenerated (comment change). * generated/_cosh_r8.F90: Regenerated (comment change). * generated/_cos_c10.F90: Regenerated (comment change). * generated/_cos_c16.F90: Regenerated (comment change). * generated/_cos_c4.F90: Regenerated (comment change). * generated/_cos_c8.F90: Regenerated (comment change). * generated/_cos_r10.F90: Regenerated (comment change). * generated/_cos_r16.F90: Regenerated (comment change). * generated/_cos_r4.F90: Regenerated (comment change). * generated/_cos_r8.F90: Regenerated (comment change). * generated/_dim_i16.F90: Regenerated (comment change). * generated/_dim_i4.F90: Regenerated (comment change). * generated/_dim_i8.F90: Regenerated (comment change). * generated/_dim_r10.F90: Regenerated (comment change). * generated/_dim_r16.F90: Regenerated (comment change). * generated/_dim_r4.F90: Regenerated (comment change). * generated/_dim_r8.F90: Regenerated (comment change). * generated/_exp_c10.F90: Regenerated (comment change). * generated/_exp_c16.F90: Regenerated (comment change). * generated/_exp_c4.F90: Regenerated (comment change). * generated/_exp_c8.F90: Regenerated (comment change). * generated/_exp_r10.F90: Regenerated (comment change). * generated/_exp_r16.F90: Regenerated (comment change). * generated/_exp_r4.F90: Regenerated (comment change). * generated/_exp_r8.F90: Regenerated (comment change). * generated/_log10_r10.F90: Regenerated (comment change). * generated/_log10_r16.F90: Regenerated (comment change). * generated/_log10_r4.F90: Regenerated (comment change). * generated/_log10_r8.F90: Regenerated (comment change). * generated/_log_c10.F90: Regenerated (comment change). * generated/_log_c16.F90: Regenerated (comment change). * generated/_log_c4.F90: Regenerated (comment change). * generated/_log_c8.F90: Regenerated (comment change). * generated/_log_r10.F90: Regenerated (comment change). * generated/_log_r16.F90: Regenerated (comment change). * generated/_log_r4.F90: Regenerated (comment change). * generated/_log_r8.F90: Regenerated (comment change). * generated/_mod_i16.F90: Regenerated (comment change). * generated/_mod_i4.F90: Regenerated (comment change). * generated/_mod_i8.F90: Regenerated (comment change). * generated/_mod_r10.F90: Regenerated (comment change). * generated/_mod_r16.F90: Regenerated (comment change). * generated/_mod_r4.F90: Regenerated (comment change). * generated/_mod_r8.F90: Regenerated (comment change). * generated/_sign_i16.F90: Regenerated (comment change). * generated/_sign_i4.F90: Regenerated (comment change). * generated/_sign_i8.F90: Regenerated (comment change). * generated/_sign_r10.F90: Regenerated (comment change). * generated/_sign_r16.F90: Regenerated (comment change). * generated/_sign_r4.F90: Regenerated (comment change). * generated/_sign_r8.F90: Regenerated (comment change). * generated/_sinh_r10.F90: Regenerated (comment change). * generated/_sinh_r16.F90: Regenerated (comment change). * generated/_sinh_r4.F90: Regenerated (comment change). * generated/_sinh_r8.F90: Regenerated (comment change). * generated/_sin_c10.F90: Regenerated (comment change). * generated/_sin_c16.F90: Regenerated (comment change). * generated/_sin_c4.F90: Regenerated (comment change). * generated/_sin_c8.F90: Regenerated (comment change). * generated/_sin_r10.F90: Regenerated (comment change). * generated/_sin_r16.F90: Regenerated (comment change). * generated/_sin_r4.F90: Regenerated (comment change). * generated/_sin_r8.F90: Regenerated (comment change). * generated/_sqrt_c10.F90: Regenerated (comment change). * generated/_sqrt_c16.F90: Regenerated (comment change). * generated/_sqrt_c4.F90: Regenerated (comment change). * generated/_sqrt_c8.F90: Regenerated (comment change). * generated/_sqrt_r10.F90: Regenerated (comment change). * generated/_sqrt_r16.F90: Regenerated (comment change). * generated/_sqrt_r4.F90: Regenerated (comment change). * generated/_sqrt_r8.F90: Regenerated (comment change). * generated/_tanh_r10.F90: Regenerated (comment change). * generated/_tanh_r16.F90: Regenerated (comment change). * generated/_tanh_r4.F90: Regenerated (comment change). * generated/_tanh_r8.F90: Regenerated (comment change). * generated/_tan_r10.F90: Regenerated (comment change). * generated/_tan_r16.F90: Regenerated (comment change). * generated/_tan_r4.F90: Regenerated (comment change). * generated/_tan_r8.F90: Regenerated (comment change). From-SVN: r178140
2011-08-28 12:08:50 +02: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 07:55:10 +02: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 18:22:31 +01: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 07:55:10 +02:00
continue_loop = 1;
while (continue_loop)
{
const GFC_INTEGER_1 * restrict src;
GFC_INTEGER_1 result;
src = base;
{
result = 0;
if (len <= 0)
*dest = 0;
else
{
for (n = 0; n < len; n++, src += delta)
{
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++;
if (n == rank)
{
/* Break out of the look. */
continue_loop = 0;
break;
}
else
{
count[n]++;
base += sstride[n];
dest += dstride[n];
}
}
}
}
extern void miany_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
gfc_array_l1 * const restrict);
export_proto(miany_i1);
void
miany_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;
int rank;
int dim;
index_type n;
index_type len;
index_type delta;
index_type mdelta;
int mask_kind;
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 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 18:22:31 +01: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 07:55:10 +02: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 18:22:31 +01: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 07:55:10 +02: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);
}
Introduce xmallocarray, an overflow checking variant of xmalloc. 2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-17 05:50:34 +02: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 07:55:10 +02:00
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
return;
}
else
Introduce xmallocarray, an overflow checking variant of xmalloc. 2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-17 05:50:34 +02: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 07:55:10 +02:00
}
else
{
if (rank != GFC_DESCRIPTOR_RANK (retarray))
runtime_error ("rank of return array incorrect in IANY intrinsic");
if (unlikely (compile_options.bounds_check))
{
bounds_ifunction_return ((array_t *) retarray, extent,
"return value", "IANY");
bounds_equal_extents ((array_t *) mask, (array_t *) array,
"MASK argument", "IANY");
}
}
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 18:22:31 +01: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 07:55:10 +02:00
while (base)
{
const GFC_INTEGER_1 * restrict src;
const GFC_LOGICAL_1 * restrict msrc;
GFC_INTEGER_1 result;
src = base;
msrc = mbase;
{
result = 0;
bessel.m4: Remove useless statement. 2012-10-28 Tobias Burnus <burnus@net-b.de> * m4/bessel.m4: Remove useless statement. * m4/ifunction.m4: Remove unreachable code. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/bessel_r4.c: Regenerated. * generated/bessel_r8.c: Regenerated. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. From-SVN: r192895
2012-10-28 17:54:44 +01: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 07:55:10 +02:00
{
if (*msrc)
result |= *src;
}
bessel.m4: Remove useless statement. 2012-10-28 Tobias Burnus <burnus@net-b.de> * m4/bessel.m4: Remove useless statement. * m4/ifunction.m4: Remove unreachable code. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/bessel_r4.c: Regenerated. * generated/bessel_r8.c: Regenerated. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. From-SVN: r192895
2012-10-28 17:54:44 +01: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 07:55:10 +02: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++;
if (n == rank)
{
/* Break out of the look. */
base = NULL;
break;
}
else
{
count[n]++;
base += sstride[n];
mbase += mstride[n];
dest += dstride[n];
}
}
}
}
extern void siany_i1 (gfc_array_i1 * const restrict,
gfc_array_i1 * const restrict, const index_type * const restrict,
GFC_LOGICAL_4 *);
export_proto(siany_i1);
void
siany_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;
if (*mask)
{
iany_i1 (retarray, array, pdim);
return;
}
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
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 18:22:31 +01: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 07:55:10 +02: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;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
Introduce xmallocarray, an overflow checking variant of xmalloc. 2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-17 05:50:34 +02: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 07:55:10 +02:00
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
return;
}
else
Introduce xmallocarray, an overflow checking variant of xmalloc. 2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-17 05:50:34 +02: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 07:55:10 +02:00
}
else
{
if (rank != GFC_DESCRIPTOR_RANK (retarray))
runtime_error ("rank of return array incorrect in"
" IANY 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"
" IANY 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 18:22:31 +01: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 07:55:10 +02: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++;
if (n == rank)
return;
else
{
count[n]++;
dest += dstride[n];
}
}
}
}
#endif