Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 1 | `/* Implementation of the SUM intrinsic |
Jakub Jelinek | 99dee82 | 2021-01-04 10:26:59 +0100 | [diff] [blame] | 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 3 | Contributed by Paul Brook <paul@nowt.org> |
| 4 | |
Toon Moene | 57dea9f | 2005-01-12 22:27:33 +0100 | [diff] [blame] | 5 | This file is part of the GNU Fortran 95 runtime library (libgfortran). |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 6 | |
| 7 | Libgfortran is free software; you can redistribute it and/or |
Toon Moene | 57dea9f | 2005-01-12 22:27:33 +0100 | [diff] [blame] | 8 | modify it under the terms of the GNU General Public |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 9 | License as published by the Free Software Foundation; either |
Jakub Jelinek | 748086b | 2009-04-09 17:00:19 +0200 | [diff] [blame] | 10 | version 3 of the License, or (at your option) any later version. |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 11 | |
| 12 | Libgfortran is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Toon Moene | 57dea9f | 2005-01-12 22:27:33 +0100 | [diff] [blame] | 15 | GNU General Public License for more details. |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 16 | |
Jakub Jelinek | 748086b | 2009-04-09 17:00:19 +0200 | [diff] [blame] | 17 | Under Section 7 of GPL version 3, you are granted additional |
| 18 | permissions described in the GCC Runtime Library Exception, version |
| 19 | 3.1, as published by the Free Software Foundation. |
| 20 | |
| 21 | You should have received a copy of the GNU General Public License and |
| 22 | a copy of the GCC Runtime Library Exception along with this program; |
| 23 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 24 | <http://www.gnu.org/licenses/>. */ |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 25 | |
Francois-Xavier Coudert | 887d9b8 | 2016-12-21 10:41:57 +0000 | [diff] [blame] | 26 | #include "libgfortran.h"' |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 27 | |
| 28 | include(iparm.m4)dnl |
| 29 | include(ifunction.m4)dnl |
François-Xavier Coudert | 644cb69 | 2005-10-03 07:22:20 +0000 | [diff] [blame] | 30 | |
| 31 | `#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)' |
| 32 | |
Diego Novillo | 6de9cd9 | 2004-05-13 02:41:07 -0400 | [diff] [blame] | 33 | ARRAY_FUNCTION(0, |
| 34 | ` result = 0;', |
| 35 | ` result += *src;') |
| 36 | |
| 37 | MASKED_ARRAY_FUNCTION(0, |
| 38 | ` result = 0;', |
| 39 | ` if (*msrc) |
| 40 | result += *src;') |
François-Xavier Coudert | 644cb69 | 2005-10-03 07:22:20 +0000 | [diff] [blame] | 41 | |
Thomas Koenig | 97a6203 | 2006-03-20 21:56:00 +0000 | [diff] [blame] | 42 | SCALAR_ARRAY_FUNCTION(0) |
| 43 | |
François-Xavier Coudert | 644cb69 | 2005-10-03 07:22:20 +0000 | [diff] [blame] | 44 | #endif |