diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-09-06 07:55:10 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-09-06 07:55:10 +0200 |
commit | 195a95c4300bd699e86aae541119b3b41b407e38 (patch) | |
tree | b60ae679f939f761998c881713e1adbe57c96041 /libgfortran/m4 | |
parent | 1c53d72bec3e943a4f57f9b5530626a2e6882eef (diff) | |
download | gcc-195a95c4300bd699e86aae541119b3b41b407e38.zip gcc-195a95c4300bd699e86aae541119b3b41b407e38.tar.gz gcc-195a95c4300bd699e86aae541119b3b41b407e38.tar.bz2 |
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
Diffstat (limited to 'libgfortran/m4')
-rw-r--r-- | libgfortran/m4/iall.m4 | 46 | ||||
-rw-r--r-- | libgfortran/m4/iany.m4 | 46 | ||||
-rw-r--r-- | libgfortran/m4/iparity.m4 | 46 |
3 files changed, 138 insertions, 0 deletions
diff --git a/libgfortran/m4/iall.m4 b/libgfortran/m4/iall.m4 new file mode 100644 index 0000000..2e6667e --- /dev/null +++ b/libgfortran/m4/iall.m4 @@ -0,0 +1,46 @@ +`/* Implementation of the IALL intrinsic + Copyright 2010 Free Software Foundation, Inc. + 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>' + +include(iparm.m4)dnl +include(ifunction.m4)dnl + +`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)' + +ARRAY_FUNCTION(0, +` result = ('rtype_name`) -1;', +` result &= *src;') + +MASKED_ARRAY_FUNCTION(0, +` result = 0;', +` if (*msrc) + result &= *src;') + +SCALAR_ARRAY_FUNCTION(0) + +#endif diff --git a/libgfortran/m4/iany.m4 b/libgfortran/m4/iany.m4 new file mode 100644 index 0000000..a17d951 --- /dev/null +++ b/libgfortran/m4/iany.m4 @@ -0,0 +1,46 @@ +`/* Implementation of the IANY intrinsic + Copyright 2010 Free Software Foundation, Inc. + 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>' + +include(iparm.m4)dnl +include(ifunction.m4)dnl + +`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)' + +ARRAY_FUNCTION(0, +` result = 0;', +` result |= *src;') + +MASKED_ARRAY_FUNCTION(0, +` result = 0;', +` if (*msrc) + result |= *src;') + +SCALAR_ARRAY_FUNCTION(0) + +#endif diff --git a/libgfortran/m4/iparity.m4 b/libgfortran/m4/iparity.m4 new file mode 100644 index 0000000..78dbc3d --- /dev/null +++ b/libgfortran/m4/iparity.m4 @@ -0,0 +1,46 @@ +`/* Implementation of the IPARITY intrinsic + Copyright 2010 Free Software Foundation, Inc. + 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>' + +include(iparm.m4)dnl +include(ifunction.m4)dnl + +`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)' + +ARRAY_FUNCTION(0, +` result = 0;', +` result ^= *src;') + +MASKED_ARRAY_FUNCTION(0, +` result = 0;', +` if (*msrc) + result ^= *src;') + +SCALAR_ARRAY_FUNCTION(0) + +#endif |