]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/33197 (Fortran 2008: math functions)
authorTobias Burnus <burnus@net-b.de>
Fri, 27 Aug 2010 19:17:45 +0000 (21:17 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 27 Aug 2010 19:17:45 +0000 (21:17 +0200)
gcc/fortran/
2010-08-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
        * gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
        gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
        gfc_resolve_parity): New prototypes.
        * gcc/fortran/gfortran.h (gfc_isym_id): New enum items
        GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
        * gcc/fortran/iresolve.c (gfc_resolve_norm2,
        gfc_resolve_parity): New functions.
        * gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
        New functions.
        * gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
        gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
        * gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
        * gcc/fortran/simplify.c (simplify_transformation_to_array):
        Add post-processing opterator.
        (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
        gfc_simplify_product, gfc_simplify_sum): Update call.
        (add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
        gfc_simplify_parity): New functions.

gcc/testsuite/
2010-08-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * gcc/testsuite/gfortran.dg/norm2_1.f90: New.
        * gcc/testsuite/gfortran.dg/norm2_2.f90: New.
        * gcc/testsuite/gfortran.dg/norm2_3.f90: New.
        * gcc/testsuite/gfortran.dg/norm2_4.f90: New.
        * gcc/testsuite/gfortran.dg/parity_1.f90: New.
        * gcc/testsuite/gfortran.dg/parity_2.f90: New.
        * gcc/testsuite/gfortran.dg/parity_3.f90: New.

libgfortran/
2010-08-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
        ARRAY_FUNCTION): Allow expression after loop.
        * libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
        * libgfortran/m4/parity.m4: New for
        * _gfortran_parity_l{1,2,4,8,16}.
        * libgfortran/gfortran.map: Add new functions.
        * libgfortran/Makefile.am: Ditto.
        * libgfortran/m4/minloc1.m4: Add empty argument for
        * ARRAY_FUNCTION.
        * libgfortran/m4/maxloc1.m4: Ditto.
        * libgfortran/m4/all.m4: Ditto.
        * libgfortran/m4/minval.m4: Ditto.
        * libgfortran/m4/maxval.m4: Ditto.
        * libgfortran/m4/count.m4: Ditto.
        * libgfortran/m4/product.m4: Ditto.
        * libgfortran/m4/any.m4: Ditto.
        * Makefile.in: Regenerated.
        * generated/minval_r8.c: Regenerated.
        * generated/maxloc1_4_r8.c: Regenerated.
        * generated/minloc1_16_r16.c: Regenerated.
        * generated/norm2_r4.c: Regenerated.
        * generated/sum_i8.c: Regenerated.
        * generated/parity_l2.c: Regenerated.
        * generated/any_l16.c: Regenerated.
        * generated/maxval_i2.c: Regenerated.
        * generated/any_l2.c: Regenerated.
        * generated/product_r4.c: Regenerated.
        * generated/maxloc1_8_i4.c: Regenerated.
        * generated/parity_l16.c: Regenerated.
        * generated/all_l1.c: Regenerated.
        * generated/product_i2.c: Regenerated.
        * generated/minloc1_8_r16.c: Regenerated.
        * generated/maxloc1_8_r16.c: Regenerated.
        * generated/sum_r16.c: Regenerated.
        * generated/sum_i1.c: Regenerated.
        * generated/minloc1_4_r8.c: Regenerated.
        * generated/maxloc1_16_r16.c: Regenerated.
        * generated/minloc1_16_i4.c: Regenerated.
        * generated/maxloc1_16_i4.c: Regenerated.
        * generated/maxval_r16.c: Regenerated.
        * generated/product_c10.c: Regenerated.
        * generated/minloc1_8_i4.c: Regenerated.
        * generated/all_l2.c: Regenerated.
        * generated/product_c4.c: Regenerated.
        * generated/sum_r4.c: Regenerated.
        * generated/all_l16.c: Regenerated.
        * generated/minloc1_16_r10.c: Regenerated.
        * generated/sum_i2.c: Regenerated.
        * generated/maxloc1_8_r8.c: Regenerated.
        * generated/minval_i16.c: Regenerated.
        * generated/parity_l4.c: Regenerated.
        * generated/maxval_i4.c: Regenerated.
        * generated/any_l4.c: Regenerated.
        * generated/minval_i8.c: Regenerated.
        * generated/maxloc1_4_i8.c: Regenerated.
        * generated/minloc1_4_i16.c: Regenerated.
        * generated/maxloc1_4_i16.c: Regenerated.
        * generated/minloc1_8_r10.c: Regenerated.
        * generated/product_i4.c: Regenerated.
        * generated/maxloc1_8_r10.c: Regenerated.
        * generated/sum_c16.c: Regenerated.
        * generated/minloc1_16_r8.c: Regenerated.
        * generated/maxloc1_16_r8.c: Regenerated.
        * generated/count_4_l.c: Regenerated.
        * generated/sum_r10.c: Regenerated.
        * generated/count_8_l.c: Regenerated.
        * generated/sum_c4.c: Regenerated.
        * generated/maxloc1_16_r10.c: Regenerated.
        * generated/minloc1_8_r8.c: Regenerated.
        * generated/maxval_r10.c: Regenerated.
        * generated/minval_i1.c: Regenerated.
        * generated/maxloc1_4_i1.c: Regenerated.
        * generated/minloc1_4_i8.c: Regenerated.
        * generated/product_i16.c: Regenerated.
        * generated/all_l4.c: Regenerated.
        * generated/norm2_r16.c: Regenerated.
        * generated/minval_r4.c: Regenerated.
        * generated/maxloc1_4_r4.c: Regenerated.
        * generated/sum_i4.c: Regenerated.
        * generated/maxval_r8.c: Regenerated.
        * generated/norm2_r8.c: Regenerated.
        * generated/minloc1_4_i1.c: Regenerated.
        * generated/minval_r16.c: Regenerated.
        * generated/minval_i2.c: Regenerated.
        * generated/maxloc1_4_i2.c: Regenerated.
        * generated/product_r8.c: Regenerated.
        * generated/maxloc1_8_i8.c: Regenerated.
        * generated/sum_c10.c: Regenerated.
        * generated/minloc1_4_r16.c: Regenerated.
        * generated/maxloc1_4_r16.c: Regenerated.
        * generated/count_1_l.c: Regenerated.
        * generated/minloc1_4_r4.c: Regenerated.
        * generated/minloc1_16_i8.c: Regenerated.
        * generated/maxloc1_16_i8.c: Regenerated.
        * generated/minloc1_4_i2.c: Regenerated.
        * generated/maxloc1_8_i1.c: Regenerated.
        * generated/minloc1_8_i8.c: Regenerated.
        * generated/product_r16.c: Regenerated.
        * generated/product_c8.c: Regenerated.
        * generated/sum_r8.c: Regenerated.
        * generated/norm2_r10.c: Regenerated.
        * generated/minloc1_16_i16.c: Regenerated.
        * generated/maxloc1_8_r4.c: Regenerated.
        * generated/minloc1_16_i1.c: Regenerated.
        * generated/maxloc1_16_i1.c: Regenerated.
        * generated/minval_r10.c: Regenerated.
        * generated/count_16_l.c: Regenerated.
        * generated/parity_l8.c: Regenerated.
        * generated/minloc1_8_i1.c: Regenerated.
        * generated/minval_i4.c: Regenerated.
        * generated/maxloc1_4_i4.c: Regenerated.
        * generated/maxloc1_8_i2.c: Regenerated.
        * generated/maxval_i8.c: Regenerated.
        * generated/any_l8.c: Regenerated.
        * generated/minloc1_4_r10.c: Regenerated.
        * generated/minloc1_8_i16.c: Regenerated.
        * generated/maxloc1_4_r10.c: Regenerated.
        * generated/maxloc1_8_i16.c: Regenerated.
        * generated/minloc1_16_r4.c: Regenerated.
        * generated/maxloc1_16_r4.c: Regenerated.
        * generated/product_i8.c: Regenerated.
        * generated/sum_i16.c: Regenerated.
        * generated/count_2_l.c: Regenerated.
        * generated/maxloc1_16_i16.c: Regenerated.
        * generated/minloc1_8_r4.c: Regenerated.
        * generated/sum_c8.c: Regenerated.
        * generated/minloc1_16_i2.c: Regenerated.
        * generated/maxloc1_16_i2.c: Regenerated.
        * generated/parity_l1.c: Regenerated.
        * generated/maxval_i16.c: Regenerated.
        * generated/maxval_i1.c: Regenerated.
        * generated/minloc1_4_i4.c: Regenerated.
        * generated/any_l1.c: Regenerated.
        * generated/minloc1_8_i2.c: Regenerated.
        * generated/product_c16.c: Regenerated.
        * generated/product_r10.c: Regenerated.
        * generated/product_i1.c: Regenerated.
        * generated/all_l8.c: Regenerated.
        * generated/maxval_r4.c: Regenerated.

From-SVN: r163595

154 files changed:
gcc/fortran/ChangeLog
gcc/fortran/check.c
gcc/fortran/gfortran.h
gcc/fortran/intrinsic.c
gcc/fortran/intrinsic.h
gcc/fortran/intrinsic.texi
gcc/fortran/iresolve.c
gcc/fortran/simplify.c
gcc/fortran/trans-intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/norm2_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/norm2_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/norm2_3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/norm_4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/parity_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/parity_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/parity_3.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/Makefile.am
libgfortran/Makefile.in
libgfortran/generated/all_l1.c
libgfortran/generated/all_l16.c
libgfortran/generated/all_l2.c
libgfortran/generated/all_l4.c
libgfortran/generated/all_l8.c
libgfortran/generated/any_l1.c
libgfortran/generated/any_l16.c
libgfortran/generated/any_l2.c
libgfortran/generated/any_l4.c
libgfortran/generated/any_l8.c
libgfortran/generated/count_16_l.c
libgfortran/generated/count_1_l.c
libgfortran/generated/count_2_l.c
libgfortran/generated/count_4_l.c
libgfortran/generated/count_8_l.c
libgfortran/generated/maxloc1_16_i1.c
libgfortran/generated/maxloc1_16_i16.c
libgfortran/generated/maxloc1_16_i2.c
libgfortran/generated/maxloc1_16_i4.c
libgfortran/generated/maxloc1_16_i8.c
libgfortran/generated/maxloc1_16_r10.c
libgfortran/generated/maxloc1_16_r16.c
libgfortran/generated/maxloc1_16_r4.c
libgfortran/generated/maxloc1_16_r8.c
libgfortran/generated/maxloc1_4_i1.c
libgfortran/generated/maxloc1_4_i16.c
libgfortran/generated/maxloc1_4_i2.c
libgfortran/generated/maxloc1_4_i4.c
libgfortran/generated/maxloc1_4_i8.c
libgfortran/generated/maxloc1_4_r10.c
libgfortran/generated/maxloc1_4_r16.c
libgfortran/generated/maxloc1_4_r4.c
libgfortran/generated/maxloc1_4_r8.c
libgfortran/generated/maxloc1_8_i1.c
libgfortran/generated/maxloc1_8_i16.c
libgfortran/generated/maxloc1_8_i2.c
libgfortran/generated/maxloc1_8_i4.c
libgfortran/generated/maxloc1_8_i8.c
libgfortran/generated/maxloc1_8_r10.c
libgfortran/generated/maxloc1_8_r16.c
libgfortran/generated/maxloc1_8_r4.c
libgfortran/generated/maxloc1_8_r8.c
libgfortran/generated/maxval_i1.c
libgfortran/generated/maxval_i16.c
libgfortran/generated/maxval_i2.c
libgfortran/generated/maxval_i4.c
libgfortran/generated/maxval_i8.c
libgfortran/generated/maxval_r10.c
libgfortran/generated/maxval_r16.c
libgfortran/generated/maxval_r4.c
libgfortran/generated/maxval_r8.c
libgfortran/generated/minloc1_16_i1.c
libgfortran/generated/minloc1_16_i16.c
libgfortran/generated/minloc1_16_i2.c
libgfortran/generated/minloc1_16_i4.c
libgfortran/generated/minloc1_16_i8.c
libgfortran/generated/minloc1_16_r10.c
libgfortran/generated/minloc1_16_r16.c
libgfortran/generated/minloc1_16_r4.c
libgfortran/generated/minloc1_16_r8.c
libgfortran/generated/minloc1_4_i1.c
libgfortran/generated/minloc1_4_i16.c
libgfortran/generated/minloc1_4_i2.c
libgfortran/generated/minloc1_4_i4.c
libgfortran/generated/minloc1_4_i8.c
libgfortran/generated/minloc1_4_r10.c
libgfortran/generated/minloc1_4_r16.c
libgfortran/generated/minloc1_4_r4.c
libgfortran/generated/minloc1_4_r8.c
libgfortran/generated/minloc1_8_i1.c
libgfortran/generated/minloc1_8_i16.c
libgfortran/generated/minloc1_8_i2.c
libgfortran/generated/minloc1_8_i4.c
libgfortran/generated/minloc1_8_i8.c
libgfortran/generated/minloc1_8_r10.c
libgfortran/generated/minloc1_8_r16.c
libgfortran/generated/minloc1_8_r4.c
libgfortran/generated/minloc1_8_r8.c
libgfortran/generated/minval_i1.c
libgfortran/generated/minval_i16.c
libgfortran/generated/minval_i2.c
libgfortran/generated/minval_i4.c
libgfortran/generated/minval_i8.c
libgfortran/generated/minval_r10.c
libgfortran/generated/minval_r16.c
libgfortran/generated/minval_r4.c
libgfortran/generated/minval_r8.c
libgfortran/generated/norm2_r10.c [new file with mode: 0644]
libgfortran/generated/norm2_r16.c [new file with mode: 0644]
libgfortran/generated/norm2_r4.c [new file with mode: 0644]
libgfortran/generated/norm2_r8.c [new file with mode: 0644]
libgfortran/generated/parity_l1.c [new file with mode: 0644]
libgfortran/generated/parity_l16.c [new file with mode: 0644]
libgfortran/generated/parity_l2.c [new file with mode: 0644]
libgfortran/generated/parity_l4.c [new file with mode: 0644]
libgfortran/generated/parity_l8.c [new file with mode: 0644]
libgfortran/generated/product_c10.c
libgfortran/generated/product_c16.c
libgfortran/generated/product_c4.c
libgfortran/generated/product_c8.c
libgfortran/generated/product_i1.c
libgfortran/generated/product_i16.c
libgfortran/generated/product_i2.c
libgfortran/generated/product_i4.c
libgfortran/generated/product_i8.c
libgfortran/generated/product_r10.c
libgfortran/generated/product_r16.c
libgfortran/generated/product_r4.c
libgfortran/generated/product_r8.c
libgfortran/generated/sum_c10.c
libgfortran/generated/sum_c16.c
libgfortran/generated/sum_c4.c
libgfortran/generated/sum_c8.c
libgfortran/generated/sum_i1.c
libgfortran/generated/sum_i16.c
libgfortran/generated/sum_i2.c
libgfortran/generated/sum_i4.c
libgfortran/generated/sum_i8.c
libgfortran/generated/sum_r10.c
libgfortran/generated/sum_r16.c
libgfortran/generated/sum_r4.c
libgfortran/generated/sum_r8.c
libgfortran/gfortran.map
libgfortran/m4/all.m4
libgfortran/m4/any.m4
libgfortran/m4/count.m4
libgfortran/m4/ifunction.m4
libgfortran/m4/maxloc1.m4
libgfortran/m4/maxval.m4
libgfortran/m4/minloc1.m4
libgfortran/m4/minval.m4
libgfortran/m4/norm2.m4 [new file with mode: 0644]
libgfortran/m4/parity.m4 [new file with mode: 0644]
libgfortran/m4/product.m4

index a15c13663ef216c163ac7b1b2028956b69bb0564..ba1ee59c9170b6cd9190b3247d2eafb80aa29a84 100644 (file)
@@ -1,3 +1,26 @@
+2010-08-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33197
+       * gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
+       * gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
+       gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
+       gfc_resolve_parity): New prototypes.
+       * gcc/fortran/gfortran.h (gfc_isym_id): New enum items
+       GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
+       * gcc/fortran/iresolve.c (gfc_resolve_norm2,
+       gfc_resolve_parity): New functions.
+       * gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
+       New functions.
+       * gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
+       gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
+       * gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
+       * gcc/fortran/simplify.c (simplify_transformation_to_array):
+       Add post-processing opterator.
+       (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
+       gfc_simplify_product, gfc_simplify_sum): Update call.
+       (add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
+       gfc_simplify_parity): New functions.
+
 2010-08-27  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/45420
index 36efffa6dfa3c8fc062037cc0b80452534cd9fa2..0ff6b6e4cee4b5330dd4ecc14a0603849e136f5f 100644 (file)
@@ -2431,6 +2431,21 @@ gfc_check_new_line (gfc_expr *a)
 }
 
 
+gfc_try
+gfc_check_norm2 (gfc_expr *array, gfc_expr *dim)
+{
+  if (type_check (array, 0, BT_REAL) == FAILURE)
+    return FAILURE;
+
+  if (array_check (array, 0) == FAILURE)
+    return FAILURE;
+
+  if (dim_rank_check (dim, array, false) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
+}
+
 gfc_try
 gfc_check_null (gfc_expr *mold)
 {
@@ -2539,6 +2554,22 @@ gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
 }
 
 
+gfc_try
+gfc_check_parity (gfc_expr *mask, gfc_expr *dim)
+{
+  if (type_check (mask, 0, BT_LOGICAL) == FAILURE)
+    return FAILURE;
+
+  if (array_check (mask, 0) == FAILURE)
+    return FAILURE;
+
+  if (dim_rank_check (dim, mask, false) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
+}
+
+
 gfc_try
 gfc_check_precision (gfc_expr *x)
 {
index c84c63387a21343338c4785f71475fc938a2809e..0a2f52f9e9ab8dc7f217a875e58b2a451568a254 100644 (file)
@@ -464,11 +464,13 @@ enum gfc_isym_id
   GFC_ISYM_NEAREST,
   GFC_ISYM_NEW_LINE,
   GFC_ISYM_NINT,
+  GFC_ISYM_NORM2,
   GFC_ISYM_NOT,
   GFC_ISYM_NULL,
   GFC_ISYM_NUMIMAGES,
   GFC_ISYM_OR,
   GFC_ISYM_PACK,
+  GFC_ISYM_PARITY,
   GFC_ISYM_PERROR,
   GFC_ISYM_PRECISION,
   GFC_ISYM_PRESENT,
index 9087106d9586a93ed64632a0735dd15c88398f5c..2ce3482e3a1cc4ae1d0bf8a6a1a514ad399a04f7 100644 (file)
@@ -2268,6 +2268,13 @@ add_functions (void)
 
   make_generic ("not", GFC_ISYM_NOT, GFC_STD_F95);
 
+  add_sym_2 ("norm2", GFC_ISYM_NORM2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr,
+            GFC_STD_F2008, gfc_check_norm2, gfc_simplify_norm2, gfc_resolve_norm2,
+            x, BT_REAL, dr, REQUIRED,
+            dm, BT_INTEGER, ii, OPTIONAL);
+
+  make_generic ("norm2", GFC_ISYM_NORM2, GFC_STD_F2008);
+
   add_sym_1 ("null", GFC_ISYM_NULL, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
             gfc_check_null, gfc_simplify_null, NULL,
             mo, BT_INTEGER, di, OPTIONAL);
@@ -2284,6 +2291,14 @@ add_functions (void)
 
   make_generic ("pack", GFC_ISYM_PACK, GFC_STD_F95);
 
+
+  add_sym_2 ("parity", GFC_ISYM_PARITY, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_LOGICAL, dl,
+            GFC_STD_F2008, gfc_check_parity, gfc_simplify_parity, gfc_resolve_parity,
+            msk, BT_LOGICAL, dl, REQUIRED,
+            dm, BT_INTEGER, ii, OPTIONAL);
+
+  make_generic ("parity", GFC_ISYM_PARITY, GFC_STD_F2008);
+
   add_sym_1 ("precision", GFC_ISYM_PRECISION, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
             gfc_check_precision, gfc_simplify_precision, NULL,
             x, BT_UNKNOWN, 0, REQUIRED);
index 5de0116ecdba60eb9e4cdab279883d24f23b5ab0..2c101d391be6a00f347e7fe6be17a97a54bfb210 100644 (file)
@@ -108,8 +108,10 @@ gfc_try gfc_check_minloc_maxloc (gfc_actual_arglist *);
 gfc_try gfc_check_minval_maxval (gfc_actual_arglist *);
 gfc_try gfc_check_nearest (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_new_line (gfc_expr *);
+gfc_try gfc_check_norm2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_null (gfc_expr *);
 gfc_try gfc_check_pack (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_parity (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_precision (gfc_expr *);
 gfc_try gfc_check_present (gfc_expr *);
 gfc_try gfc_check_product_sum (gfc_actual_arglist *);
@@ -307,12 +309,14 @@ gfc_expr *gfc_simplify_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
 gfc_expr *gfc_simplify_nearest (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_new_line (gfc_expr *);
 gfc_expr *gfc_simplify_nint (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_norm2 (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_null (gfc_expr *);
 gfc_expr *gfc_simplify_num_images (void);
 gfc_expr *gfc_simplify_idnint (gfc_expr *);
 gfc_expr *gfc_simplify_not (gfc_expr *);
 gfc_expr *gfc_simplify_or (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_pack (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_parity (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_precision (gfc_expr *);
 gfc_expr *gfc_simplify_product (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_radix (gfc_expr *);
@@ -473,9 +477,11 @@ void gfc_resolve_mod (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_modulo (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_nearest (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_nint (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_norm2 (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_not (gfc_expr *, gfc_expr *);
 void gfc_resolve_or (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_pack (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_parity (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_product (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_real (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_realpart (gfc_expr *, gfc_expr *);
index f258e517674d3bbb807361b609bc0ca065e1b52b..c4767f5a6eb2bb93ca3bfa72db427a5196650689 100644 (file)
@@ -203,11 +203,13 @@ Some basic guidelines for editing this document:
 * @code{NEAREST}:       NEAREST,   Nearest representable number
 * @code{NEW_LINE}:      NEW_LINE,  New line character
 * @code{NINT}:          NINT,      Nearest whole number
+* @code{NORM2}:         NORM2,     Euclidean vector norm
 * @code{NOT}:           NOT,       Logical negation
 * @code{NULL}:          NULL,      Function that returns an disassociated pointer
 * @code{NUM_IMAGES}:    NUM_IMAGES, Number of images
 * @code{OR}:            OR,        Bitwise logical OR
 * @code{PACK}:          PACK,      Pack an array into an array of rank one
+* @code{PARITY}:        PARITY,    Reduction with exclusive OR
 * @code{PERROR}:        PERROR,    Print system error message
 * @code{PRECISION}:     PRECISION, Decimal precision of a real kind
 * @code{PRESENT}:       PRESENT,   Determine whether an optional dummy argument is specified
@@ -8471,6 +8473,57 @@ end program test_nint
 
 
 
+@node NORM2
+@section @code{NORM2} --- Euclidean vector norms
+@fnindex NORM2
+@cindex Euclidean vector norm
+@cindex L2 vector norm
+@cindex norm, Euclidean
+
+@table @asis
+@item @emph{Description}:
+Calculates the Euclidean vector norm (@math{L_2}) norm of
+of @var{ARRAY} along dimension @var{DIM}.
+
+@item @emph{Standard}:
+Fortran 2008 and later
+
+@item @emph{Class}:
+Transformational function
+
+@item @emph{Syntax}:
+@multitable @columnfractions .80
+@item @code{RESULT = NORM2(ARRAY[, DIM])}
+@end multitable
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{ARRAY} @tab Shall be an array of type @code{REAL}
+@item @var{DIM}   @tab (Optional) shall be a scalar of type 
+@code{INTEGER} with a value in the range from 1 to n, where n 
+equals the rank of @var{ARRAY}.
+@end multitable
+
+@item @emph{Return value}:
+The result is of the same type as @var{ARRAY}.
+
+If @var{DIM} is absent, a scalar with the square root of the sum of all
+elements in @var{ARRAY} squared  is returned. Otherwise, an array of
+rank @math{n-1}, where @math{n} equals the rank of @var{ARRAY}, and a
+shape similar to that of @var{ARRAY} with dimension @var{DIM} dropped
+is returned.
+
+@item @emph{Example}:
+@smallexample
+PROGRAM test_sum
+  REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
+  print *, NORM2(x)  ! = sqrt(55.) ~ 7.416
+END PROGRAM
+@end smallexample
+@end table
+
+
+
 @node NOT
 @section @code{NOT} --- Logical negation
 @fnindex NOT
@@ -8717,6 +8770,58 @@ END PROGRAM
 
 
 
+@node PARITY
+@section @code{PARITY} --- Reduction with exclusive OR
+@fnindex PARITY
+@cindex Parity
+@cindex Reduction, XOR
+@cindex XOR reduction
+
+@table @asis
+@item @emph{Description}:
+Calculates the partity, i.e. the reduction using @code{.XOR.},
+of @var{MASK} along dimension @var{DIM}.
+
+@item @emph{Standard}:
+Fortran 2008 and later
+
+@item @emph{Class}:
+Transformational function
+
+@item @emph{Syntax}:
+@multitable @columnfractions .80
+@item @code{RESULT = PARITY(MASK[, DIM])}
+@end multitable
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{LOGICAL} @tab Shall be an array of type @code{LOGICAL}
+@item @var{DIM}   @tab (Optional) shall be a scalar of type 
+@code{INTEGER} with a value in the range from 1 to n, where n 
+equals the rank of @var{MASK}.
+@end multitable
+
+@item @emph{Return value}:
+The result is of the same type as @var{MASK}.
+
+If @var{DIM} is absent, a scalar with the parity of all elements in
+@var{MASK} is returned, i.e. true if an odd number of elements is
+@code{.true.} and false otherwise.  If @var{DIM} is present, an array
+of rank @math{n-1}, where @math{n} equals the rank of @var{ARRAY},
+and a shape similar to that of @var{MASK} with dimension @var{DIM}
+dropped is returned.
+
+@item @emph{Example}:
+@smallexample
+PROGRAM test_sum
+  LOGICAL :: x(2) = [ .true., .false. ]
+  print *, PARITY(x) ! prints "T" (true).
+END PROGRAM
+@end smallexample
+@end table
+
+
+
 @node PERROR
 @section @code{PERROR} --- Print system error message
 @fnindex PERROR
index 6565187423eaa43abbcf5e37ae0f2f481a4f2392..5a187ee455e35a7bdd58ce0da9c895063572c7dd 100644 (file)
@@ -1824,6 +1824,23 @@ gfc_resolve_nint (gfc_expr *f, gfc_expr *a, gfc_expr *kind)
 }
 
 
+void
+gfc_resolve_norm2 (gfc_expr *f, gfc_expr *array, gfc_expr *dim)
+{
+  f->ts = array->ts;
+
+  if (dim != NULL)
+    {
+      f->rank = array->rank - 1;
+      f->shape = gfc_copy_shape_excluding (array->shape, array->rank, dim);
+      gfc_resolve_dim_arg (dim);
+    }
+
+  f->value.function.name
+    = gfc_get_string (PREFIX ("norm2_r%d"), array->ts.kind);
+}
+
+
 void
 gfc_resolve_not (gfc_expr *f, gfc_expr *i)
 {
@@ -1888,6 +1905,25 @@ gfc_resolve_pack (gfc_expr *f, gfc_expr *array, gfc_expr *mask,
 }
 
 
+void
+gfc_resolve_parity (gfc_expr *f, gfc_expr *array, gfc_expr *dim)
+{
+  f->ts = array->ts;
+
+  if (dim != NULL)
+    {
+      f->rank = array->rank - 1;
+      f->shape = gfc_copy_shape_excluding (array->shape, array->rank, dim);
+      gfc_resolve_dim_arg (dim);
+    }
+
+  resolve_mask_arg (array);
+
+  f->value.function.name
+    = gfc_get_string (PREFIX ("parity_l%d"), array->ts.kind);
+}
+
+
 void
 gfc_resolve_product (gfc_expr *f, gfc_expr *array, gfc_expr *dim,
                     gfc_expr *mask)
index 4cb29fbfc6780b42aac6d596df1fe1f63fbee61b..98955bb0a3e50fb6d055a0a9fd518bc6460bed94 100644 (file)
@@ -488,11 +488,12 @@ simplify_transformation_to_scalar (gfc_expr *result, gfc_expr *array, gfc_expr *
      REAL, PARAMETER :: array(n, m) = ...
      REAL, PARAMETER :: s(n) = PROD(array, DIM=1)
 
-  where OP == gfc_multiply().  */
+  where OP == gfc_multiply(). The result might be post processed using post_op. */ 
 
 static gfc_expr *
 simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *dim,
-                                 gfc_expr *mask, transformational_op op)
+                                 gfc_expr *mask, transformational_op op,
+                                 transformational_op post_op)
 {
   mpz_t size;
   int done, i, n, arraysize, resultsize, dim_index, dim_extent, dim_stride;
@@ -606,7 +607,10 @@ simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *d
   result_ctor = gfc_constructor_first (result->value.constructor);
   for (i = 0; i < resultsize; ++i)
     {
-      result_ctor->expr = resultvec[i];
+      if (post_op)
+       result_ctor->expr = post_op (result_ctor->expr, resultvec[i]);
+      else
+       result_ctor->expr = resultvec[i];
       result_ctor = gfc_constructor_next (result_ctor);
     }
 
@@ -896,7 +900,7 @@ gfc_simplify_all (gfc_expr *mask, gfc_expr *dim)
 
   return !dim || mask->rank == 1 ?
     simplify_transformation_to_scalar (result, mask, NULL, gfc_and) :
-    simplify_transformation_to_array (result, mask, dim, NULL, gfc_and);
+    simplify_transformation_to_array (result, mask, dim, NULL, gfc_and, NULL);
 }
 
 
@@ -982,7 +986,7 @@ gfc_simplify_any (gfc_expr *mask, gfc_expr *dim)
 
   return !dim || mask->rank == 1 ?
     simplify_transformation_to_scalar (result, mask, NULL, gfc_or) :
-    simplify_transformation_to_array (result, mask, dim, NULL, gfc_or);
+    simplify_transformation_to_array (result, mask, dim, NULL, gfc_or, NULL);
 }
 
 
@@ -1679,7 +1683,7 @@ gfc_simplify_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind)
      Whenever gfc_count is called, '1' is added to the result.  */
   return !dim || mask->rank == 1 ?
     simplify_transformation_to_scalar (result, mask, mask, gfc_count) :
-    simplify_transformation_to_array (result, mask, dim, mask, gfc_count);
+    simplify_transformation_to_array (result, mask, dim, mask, gfc_count, NULL);
 }
 
 
@@ -4048,6 +4052,65 @@ gfc_simplify_idnint (gfc_expr *e)
 }
 
 
+static gfc_expr *
+add_squared (gfc_expr *result, gfc_expr *e)
+{
+  mpfr_t tmp;
+
+  gcc_assert (e->ts.type == BT_REAL && e->expr_type == EXPR_CONSTANT);
+  gcc_assert (result->ts.type == BT_REAL
+             && result->expr_type == EXPR_CONSTANT);
+
+  gfc_set_model_kind (result->ts.kind);
+  mpfr_init (tmp);
+  mpfr_pow_ui (tmp, e->value.real, 2, GFC_RND_MODE);
+  mpfr_add (result->value.real, result->value.real, tmp,
+           GFC_RND_MODE);
+  mpfr_clear (tmp);
+
+  return result;
+}
+
+
+static gfc_expr *
+do_sqrt (gfc_expr *result, gfc_expr *e)
+{
+  gcc_assert (e->ts.type == BT_REAL && e->expr_type == EXPR_CONSTANT);
+  gcc_assert (result->ts.type == BT_REAL
+             && result->expr_type == EXPR_CONSTANT);
+
+  mpfr_set (result->value.real, e->value.real, GFC_RND_MODE);
+  mpfr_sqrt (result->value.real, result->value.real, GFC_RND_MODE);
+  return result;
+}
+
+
+gfc_expr *
+gfc_simplify_norm2 (gfc_expr *e, gfc_expr *dim)
+{
+  gfc_expr *result;
+
+  if (!is_constant_array_expr (e)
+      || (dim != NULL && !gfc_is_constant_expr (dim)))
+    return NULL;
+
+  result = transformational_result (e, dim, e->ts.type, e->ts.kind, &e->where);
+  init_result_expr (result, 0, NULL);
+
+  if (!dim || e->rank == 1)
+    {
+      result = simplify_transformation_to_scalar (result, e, NULL,
+                                                 add_squared);
+      mpfr_sqrt (result->value.real, result->value.real, GFC_RND_MODE);
+    }
+  else
+    result = simplify_transformation_to_array (result, e, dim, NULL,
+                                              add_squared, &do_sqrt);
+
+  return result;
+}
+
+
 gfc_expr *
 gfc_simplify_not (gfc_expr *e)
 {
@@ -4198,6 +4261,37 @@ gfc_simplify_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
 }
 
 
+static gfc_expr *
+do_xor (gfc_expr *result, gfc_expr *e)
+{
+  gcc_assert (e->ts.type == BT_LOGICAL && e->expr_type == EXPR_CONSTANT);
+  gcc_assert (result->ts.type == BT_LOGICAL
+             && result->expr_type == EXPR_CONSTANT);
+
+  result->value.logical = result->value.logical != e->value.logical;
+  return result;
+}
+
+
+
+gfc_expr *
+gfc_simplify_parity (gfc_expr *e, gfc_expr *dim)
+{
+  gfc_expr *result;
+
+  if (!is_constant_array_expr (e)
+      || (dim != NULL && !gfc_is_constant_expr (dim)))
+    return NULL;
+
+  result = transformational_result (e, dim, e->ts.type, e->ts.kind, &e->where);
+  init_result_expr (result, 0, NULL);
+
+  return (!dim || e->rank == 1)
+    ? simplify_transformation_to_scalar (result, e, NULL, do_xor)
+    : simplify_transformation_to_array (result, e, dim, NULL, do_xor, NULL);
+}
+
+
 gfc_expr *
 gfc_simplify_precision (gfc_expr *e)
 {
@@ -4227,7 +4321,7 @@ gfc_simplify_product (gfc_expr *array, gfc_expr *dim, gfc_expr *mask)
 
   return !dim || array->rank == 1 ?
     simplify_transformation_to_scalar (result, array, mask, gfc_multiply) :
-    simplify_transformation_to_array (result, array, dim, mask, gfc_multiply);
+    simplify_transformation_to_array (result, array, dim, mask, gfc_multiply, NULL);
 }
 
 
@@ -5390,7 +5484,7 @@ gfc_simplify_sum (gfc_expr *array, gfc_expr *dim, gfc_expr *mask)
 
   return !dim || array->rank == 1 ?
     simplify_transformation_to_scalar (result, array, mask, gfc_add) :
-    simplify_transformation_to_array (result, array, dim, mask, gfc_add);
+    simplify_transformation_to_array (result, array, dim, mask, gfc_add, NULL);
 }
 
 
index 373770fef7d339104a7222b7d20c66eab92b15bb..e0805d09571e32a10252ba0b4d49fce4f4fa0cf0 100644 (file)
@@ -1810,9 +1810,11 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr)
 
 /* Inline implementation of the sum and product intrinsics.  */
 static void
-gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op)
+gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
+                         bool norm2)
 {
   tree resvar;
+  tree scale = NULL_TREE;
   tree type;
   stmtblock_t body;
   stmtblock_t block;
@@ -1835,8 +1837,20 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op)
   type = gfc_typenode_for_spec (&expr->ts);
   /* Initialize the result.  */
   resvar = gfc_create_var (type, "val");
-  if (op == PLUS_EXPR)
+  if (norm2)
+    {
+      /* result = 0.0;
+        scale = 1.0.  */
+      scale = gfc_create_var (type, "scale");
+      gfc_add_modify (&se->pre, scale,
+                     gfc_build_const (type, integer_one_node));
+      tmp = gfc_build_const (type, integer_zero_node);
+    }
+  else if (op == PLUS_EXPR)
     tmp = gfc_build_const (type, integer_zero_node);
+  else if (op == NE_EXPR)
+    /* PARITY.  */
+    tmp = convert (type, boolean_false_node);
   else
     tmp = gfc_build_const (type, integer_one_node);
 
@@ -1848,9 +1862,16 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op)
   arrayss = gfc_walk_expr (arrayexpr);
   gcc_assert (arrayss != gfc_ss_terminator);
 
-  actual = actual->next->next;
-  gcc_assert (actual);
-  maskexpr = actual->expr;
+  if (op == NE_EXPR || norm2)
+    /* PARITY and NORM2.  */
+    maskexpr = NULL;
+  else
+    {
+      actual = actual->next->next;
+      gcc_assert (actual);
+      maskexpr = actual->expr;
+    }
+
   if (maskexpr && maskexpr->rank != 0)
     {
       maskss = gfc_walk_expr (maskexpr);
@@ -1896,15 +1917,77 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op)
   gfc_conv_expr_val (&arrayse, arrayexpr);
   gfc_add_block_to_block (&block, &arrayse.pre);
 
-  tmp = fold_build2 (op, type, resvar, arrayse.expr);
-  gfc_add_modify (&block, resvar, tmp);
+  if (norm2)
+    {
+      /* if (x(i) != 0.0)
+          {
+            absX = abs(x(i))
+            if (absX > scale)
+              {
+                 val = scale/absX;
+                result = 1.0 + result * val * val;
+                scale = absX;
+              }
+            else
+              {
+                 val = absX/scale;
+                result += val * val;
+              }
+          }  */
+      tree res1, res2, cond, absX, val;
+      stmtblock_t ifblock1, ifblock2, ifblock3;
+
+      gfc_init_block (&ifblock1);
+
+      absX = gfc_create_var (type, "absX");
+      gfc_add_modify (&ifblock1, absX,
+                     fold_build1 (ABS_EXPR, type, arrayse.expr));
+      val = gfc_create_var (type, "val");
+      gfc_add_expr_to_block (&ifblock1, val);
+
+      gfc_init_block (&ifblock2);
+      gfc_add_modify (&ifblock2, val,
+                     fold_build2 (RDIV_EXPR, type, scale, absX));
+      res1 = fold_build2 (MULT_EXPR, type, val, val); 
+      res1 = fold_build2 (MULT_EXPR, type, resvar, res1);
+      res1 = fold_build2 (PLUS_EXPR, type, res1,
+                         gfc_build_const (type, integer_one_node));
+      gfc_add_modify (&ifblock2, resvar, res1);
+      gfc_add_modify (&ifblock2, scale, absX);
+      res1 = gfc_finish_block (&ifblock2); 
+
+      gfc_init_block (&ifblock3);
+      gfc_add_modify (&ifblock3, val,
+                     fold_build2 (RDIV_EXPR, type, absX, scale));
+      res2 = fold_build2 (MULT_EXPR, type, val, val); 
+      res2 = fold_build2 (PLUS_EXPR, type, resvar, res2);
+      gfc_add_modify (&ifblock3, resvar, res2);
+      res2 = gfc_finish_block (&ifblock3);
+
+      cond = fold_build2 (GT_EXPR, boolean_type_node, absX, scale);
+      tmp = build3_v (COND_EXPR, cond, res1, res2);
+      gfc_add_expr_to_block (&ifblock1, tmp);  
+      tmp = gfc_finish_block (&ifblock1);
+
+      cond = fold_build2 (NE_EXPR, boolean_type_node, arrayse.expr,
+                         gfc_build_const (type, integer_zero_node));
+
+      tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location));
+      gfc_add_expr_to_block (&block, tmp);  
+    }
+  else
+    {
+      tmp = fold_build2 (op, type, resvar, arrayse.expr);
+      gfc_add_modify (&block, resvar, tmp);
+    }
+
   gfc_add_block_to_block (&block, &arrayse.post);
 
   if (maskss)
     {
       /* We enclose the above in if (mask) {...} .  */
-      tmp = gfc_finish_block (&block);
 
+      tmp = gfc_finish_block (&block);
       tmp = build3_v (COND_EXPR, maskse.expr, tmp,
                      build_empty_stmt (input_location));
     }
@@ -1937,6 +2020,16 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op)
 
   gfc_cleanup_loop (&loop);
 
+  if (norm2)
+    {
+      /* result = scale * sqrt(result).  */
+      tree sqrt;
+      sqrt = builtin_decl_for_float_kind (BUILT_IN_SQRT, expr->ts.kind);
+      resvar = build_call_expr_loc (input_location,
+                                   sqrt, 1, resvar);
+      resvar = fold_build2 (MULT_EXPR, type, scale, resvar);
+    }
+
   se->expr = resvar;
 }
 
@@ -5288,6 +5381,10 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
       gfc_conv_intrinsic_nearest (se, expr);
       break;
 
+    case GFC_ISYM_NORM2:
+      gfc_conv_intrinsic_arith (se, expr, PLUS_EXPR, true);
+      break;
+
     case GFC_ISYM_NOT:
       gfc_conv_intrinsic_not (se, expr);
       break;
@@ -5296,12 +5393,16 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
       gfc_conv_intrinsic_bitop (se, expr, BIT_IOR_EXPR);
       break;
 
+    case GFC_ISYM_PARITY:
+      gfc_conv_intrinsic_arith (se, expr, NE_EXPR, false);
+      break;
+
     case GFC_ISYM_PRESENT:
       gfc_conv_intrinsic_present (se, expr);
       break;
 
     case GFC_ISYM_PRODUCT:
-      gfc_conv_intrinsic_arith (se, expr, MULT_EXPR);
+      gfc_conv_intrinsic_arith (se, expr, MULT_EXPR, false);
       break;
 
     case GFC_ISYM_RRSPACING:
@@ -5338,7 +5439,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
       break;
 
     case GFC_ISYM_SUM:
-      gfc_conv_intrinsic_arith (se, expr, PLUS_EXPR);
+      gfc_conv_intrinsic_arith (se, expr, PLUS_EXPR, false);
       break;
 
     case GFC_ISYM_TRANSFER:
@@ -5508,6 +5609,8 @@ gfc_is_intrinsic_libcall (gfc_expr * expr)
     case GFC_ISYM_MAXVAL:
     case GFC_ISYM_MINLOC:
     case GFC_ISYM_MINVAL:
+    case GFC_ISYM_NORM2:
+    case GFC_ISYM_PARITY:
     case GFC_ISYM_PRODUCT:
     case GFC_ISYM_SUM:
     case GFC_ISYM_SHAPE:
index bf917998c9396f026086dfa095e2560f3f59b72c..d1f0a8cc38debbf10197d7c5eb91d45a4c2915ea 100644 (file)
@@ -1,3 +1,14 @@
+2010-08-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33197
+       * gcc/testsuite/gfortran.dg/norm2_1.f90: New.
+       * gcc/testsuite/gfortran.dg/norm2_2.f90: New.
+       * gcc/testsuite/gfortran.dg/norm2_3.f90: New.
+       * gcc/testsuite/gfortran.dg/norm2_4.f90: New.
+       * gcc/testsuite/gfortran.dg/parity_1.f90: New.
+       * gcc/testsuite/gfortran.dg/parity_2.f90: New.
+       * gcc/testsuite/gfortran.dg/parity_3.f90: New.
+
 2010-08-27  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/45420
diff --git a/gcc/testsuite/gfortran.dg/norm2_1.f90 b/gcc/testsuite/gfortran.dg/norm2_1.f90
new file mode 100644 (file)
index 0000000..6d69e6b
--- /dev/null
@@ -0,0 +1,91 @@
+! { dg-do run }
+!
+! PR fortran/33197
+!
+! Check implementation of L2 norm (Euclidean vector norm)
+!
+implicit none
+
+real :: a(3) = [real :: 1, 2, huge(3.0)]
+real :: b(3) = [real :: 1, 2, 3]
+real :: c(4) = [real :: 1, 2, 3, -1]
+real :: e(0) = [real :: ]
+real :: f(4) = [real :: 0, 0, 3, 0 ]
+
+real :: d(4,1) = RESHAPE ([real :: 1, 2, 3, -1], [4,1])
+real :: g(4,1) = RESHAPE ([real :: 0, 0, 4, -1], [4,1])
+
+! Check compile-time version
+
+if (abs (NORM2 ([real :: 1, 2, huge(3.0)])   - huge(3.0)) &
+    > epsilon(0.0)*huge(3.0)) call abort()
+
+if (abs (SNORM2([real :: 1, 2, huge(3.0)],3) - huge(3.0)) &
+    > epsilon(0.0)*huge(3.0)) call abort()
+
+if (abs (SNORM2([real :: 1, 2, 3],3) - NORM2([real :: 1, 2, 3])) &
+    > epsilon(0.0)*SNORM2([real :: 1, 2, 3],3)) call abort()
+
+if (NORM2([real :: ]) /= 0.0) call abort()
+if (abs (NORM2([real :: 0, 0, 3, 0]) - 3.0) > epsilon(0.0)) call abort()
+
+! Check TREE version
+
+if (abs (NORM2 (a)   - huge(3.0)) &
+    > epsilon(0.0)*huge(3.0)) call abort()
+
+if (abs (SNORM2(b,3) - NORM2(b)) &
+    > epsilon(0.0)*SNORM2(b,3)) call abort()
+
+if (abs (SNORM2(c,4) - NORM2(c)) &
+    > epsilon(0.0)*SNORM2(c,4)) call abort()
+
+if (ANY (abs (abs(d(:,1)) - NORM2(d, 2)) &
+    > epsilon(0.0))) call abort()
+
+! Check libgfortran version
+
+if (ANY (abs (SNORM2(d,4) - NORM2(d, 1)) &
+    > epsilon(0.0)*SNORM2(d,4))) call abort()
+
+if (abs (SNORM2(f,4) - NORM2(f, 1)) &
+    > epsilon(0.0)*SNORM2(d,4)) call abort()
+
+if (ANY (abs (abs(g(:,1)) - NORM2(g, 2)) &
+    > epsilon(0.0))) call abort()
+
+contains
+   ! NORM2 algorithm based on BLAS, cf.
+   ! http://www.netlib.org/blas/snrm2.f
+   REAL FUNCTION SNORM2 (X,n)
+      INTEGER, INTENT(IN) :: n
+      REAL, INTENT(IN) :: X(n)
+
+      REAL :: absXi, scale, SSQ
+      INTEGER :: i
+
+      INTRINSIC :: ABS, SQRT
+
+      IF (N < 1) THEN
+        snorm2 = 0.0
+      ELSE IF (N == 1) THEN
+        snorm2 = ABS(X(1))
+      ELSE
+          scale = 0.0
+          SSQ = 1.0
+
+          DO i = 1, N
+              IF (X(i) /= 0.0) THEN
+                  absXi = ABS(X(i))
+                  IF (scale < absXi) THEN
+                      SSQ = 1.0 + SSQ * (scale/absXi)**2
+                      scale = absXi
+                  ELSE
+                      SSQ = SSQ + (absXi/scale)**2
+                  END IF
+              END IF
+          END DO
+          snorm2 = scale * SQRT(SSQ)
+      END IF
+   END FUNCTION SNORM2
+end
diff --git a/gcc/testsuite/gfortran.dg/norm2_2.f90 b/gcc/testsuite/gfortran.dg/norm2_2.f90
new file mode 100644 (file)
index 0000000..d6ad7aa
--- /dev/null
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+!
+! PR fortran/33197
+!
+! Check implementation of L2 norm (Euclidean vector norm)
+!
+implicit none
+
+print *, norm2([1, 2]) ! { dg-error "must be REAL" }
+print *, norm2([cmplx(1.0,2.0)]) ! { dg-error "must be REAL" }
+print *, norm2(1.0) ! { dg-error "must be an array" }
+print *, norm2([1.0, 2.0], dim=2) ! { dg-error "not a valid dimension index" }
+end
diff --git a/gcc/testsuite/gfortran.dg/norm2_3.f90 b/gcc/testsuite/gfortran.dg/norm2_3.f90
new file mode 100644 (file)
index 0000000..a1a3b3f
--- /dev/null
@@ -0,0 +1,95 @@
+! { dg-do run }
+! { dg-require-effective-target fortran_large_real }
+!
+!
+! PR fortran/33197
+!
+! Check implementation of L2 norm (Euclidean vector norm)
+!
+implicit none
+
+integer,parameter :: qp = selected_real_kind (precision (0.0d0)+1)
+
+real(qp) :: a(3) = [real(qp) :: 1, 2, huge(3.0_qp)]
+real(qp) :: b(3) = [real(qp) :: 1, 2, 3]
+real(qp) :: c(4) = [real(qp) :: 1, 2, 3, -1]
+real(qp) :: e(0) = [real(qp) :: ]
+real(qp) :: f(4) = [real(qp) :: 0, 0, 3, 0 ]
+
+real(qp) :: d(4,1) = RESHAPE ([real(qp) :: 1, 2, 3, -1], [4,1])
+real(qp) :: g(4,1) = RESHAPE ([real(qp) :: 0, 0, 4, -1], [4,1])
+
+! Check compile-time version
+
+if (abs (NORM2 ([real(qp) :: 1, 2, huge(3.0_qp)])   - huge(3.0_qp)) &
+    > epsilon(0.0_qp)*huge(3.0_qp)) call abort()
+
+if (abs (SNORM2([real(qp) :: 1, 2, huge(3.0_qp)],3) - huge(3.0_qp)) &
+    > epsilon(0.0_qp)*huge(3.0_qp)) call abort()
+
+if (abs (SNORM2([real(qp) :: 1, 2, 3],3) - NORM2([real(qp) :: 1, 2, 3])) &
+    > epsilon(0.0_qp)*SNORM2([real(qp) :: 1, 2, 3],3)) call abort()
+
+if (NORM2([real(qp) :: ]) /= 0.0_qp) call abort()
+if (abs (NORM2([real(qp) :: 0, 0, 3, 0]) - 3.0_qp) > epsilon(0.0_qp)) call abort()
+
+! Check TREE version
+
+if (abs (NORM2 (a)   - huge(3.0_qp)) &
+    > epsilon(0.0_qp)*huge(3.0_qp)) call abort()
+
+if (abs (SNORM2(b,3) - NORM2(b)) &
+    > epsilon(0.0_qp)*SNORM2(b,3)) call abort()
+
+if (abs (SNORM2(c,4) - NORM2(c)) &
+    > epsilon(0.0_qp)*SNORM2(c,4)) call abort()
+
+if (ANY (abs (abs(d(:,1)) - NORM2(d, 2)) &
+    > epsilon(0.0_qp))) call abort()
+
+! Check libgfortran version
+
+if (ANY (abs (SNORM2(d,4) - NORM2(d, 1)) &
+    > epsilon(0.0_qp)*SNORM2(d,4))) call abort()
+
+if (abs (SNORM2(f,4) - NORM2(f, 1)) &
+    > epsilon(0.0_qp)*SNORM2(d,4)) call abort()
+
+if (ANY (abs (abs(g(:,1)) - NORM2(g, 2)) &
+    > epsilon(0.0_qp))) call abort()
+
+contains
+   ! NORM2 algorithm based on BLAS, cf.
+   ! http://www.netlib.org/blas/snrm2.f
+   REAL(qp) FUNCTION SNORM2 (X,n)
+      INTEGER, INTENT(IN) :: n
+      REAL(qp), INTENT(IN) :: X(n)
+
+      REAL(qp) :: absXi, scale, SSQ
+      INTEGER :: i
+
+      INTRINSIC :: ABS, SQRT
+
+      IF (N < 1) THEN
+        snorm2 = 0.0_qp
+      ELSE IF (N == 1) THEN
+        snorm2 = ABS(X(1))
+      ELSE
+          scale = 0.0_qp
+          SSQ = 1.0_qp
+
+          DO i = 1, N
+              IF (X(i) /= 0.0_qp) THEN
+                  absXi = ABS(X(i))
+                  IF (scale < absXi) THEN
+                      SSQ = 1.0_qp + SSQ * (scale/absXi)**2
+                      scale = absXi
+                  ELSE
+                      SSQ = SSQ + (absXi/scale)**2
+                  END IF
+              END IF
+          END DO
+          snorm2 = scale * SQRT(SSQ)
+      END IF
+   END FUNCTION SNORM2
+end
diff --git a/gcc/testsuite/gfortran.dg/norm_4.f90 b/gcc/testsuite/gfortran.dg/norm_4.f90
new file mode 100644 (file)
index 0000000..276b174
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! PR fortran/33197
+!
+! Check implementation of L2 norm (Euclidean vector norm)
+!
+implicit none
+
+print *, norm2([1.0, 2.0]) ! { dg-error "has no IMPLICIT type" }
+end
diff --git a/gcc/testsuite/gfortran.dg/parity_1.f90 b/gcc/testsuite/gfortran.dg/parity_1.f90
new file mode 100644 (file)
index 0000000..05f9537
--- /dev/null
@@ -0,0 +1,40 @@
+! { dg-do run }
+!
+! PR fortran/33197
+!
+! Check implementation of PARITY
+!
+implicit none
+
+integer :: i
+logical :: Lt(1) = [ .true. ]
+logical :: Lf(1) = [ .false.]
+logical :: Ltf(2) = [ .true., .false. ]
+logical :: Ltftf(4) = [.true., .false., .true.,.false.]
+
+if (parity([logical ::]) .neqv. .false.) call abort()
+if (parity([.true., .false.]) .neqv. .true.) call abort()
+if (parity([.true.]) .neqv. .true.) call abort()
+if (parity([.false.]) .neqv. .false.) call abort()
+if (parity([.true., .false., .true.,.false.]) .neqv. .false.) call abort()
+if (parity(reshape([.true., .false., .true.,.false.],[2,2])) &
+    .neqv. .false.) call abort()
+if (any (parity(reshape([.true., .false., .true.,.false.],[2,2]),dim=1) &
+         .neqv. [.true., .true.])) call abort()
+if (any (parity(reshape([.true., .false., .true.,.false.],[2,2]),dim=2) &
+         .neqv. [.false., .false.])) call abort()
+
+i = 0
+if (parity(Lt(1:i)) .neqv. .false.) call abort()
+if (parity(Ltf) .neqv. .true.) call abort()
+if (parity(Lt) .neqv. .true.) call abort()
+if (parity(Lf) .neqv. .false.) call abort()
+if (parity(Ltftf) .neqv. .false.) call abort()
+if (parity(reshape(Ltftf,[2,2])) &
+    .neqv. .false.) call abort()
+if (any (parity(reshape(Ltftf,[2,2]),dim=1) &
+         .neqv. [.true., .true.])) call abort()
+if (any (parity(reshape(Ltftf,[2,2]),dim=2) &
+         .neqv. [.false., .false.])) call abort()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/parity_2.f90 b/gcc/testsuite/gfortran.dg/parity_2.f90
new file mode 100644 (file)
index 0000000..5ff11da
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+!
+! PR fortran/33197
+!
+! Check implementation of PARITY
+!
+implicit none
+print *, parity([real ::]) ! { dg-error "must be LOGICAL" })
+print *, parity([integer ::]) ! { dg-error "must be LOGICAL" }
+print *, parity([logical ::])
+print *, parity(.true.) ! { dg-error "must be an array" }
+end
diff --git a/gcc/testsuite/gfortran.dg/parity_3.f90 b/gcc/testsuite/gfortran.dg/parity_3.f90
new file mode 100644 (file)
index 0000000..88d674d
--- /dev/null
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! PR fortran/33197
+!
+! Check implementation of PARITY
+!
+implicit none
+print *, parity([.true.]) ! { dg-error "has no IMPLICIT type" }
+end
index 0e5da98f17daa48ba07b120c2e32761eaae62558..121d471c3dce1938f3166db4333d553dc19abb3a 100644 (file)
@@ -1,3 +1,144 @@
+2010-08-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33197
+       * libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
+       ARRAY_FUNCTION): Allow expression after loop.
+       * libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
+       * libgfortran/m4/parity.m4: New for _gfortran_parity_l{1,2,4,8,16}.
+       * libgfortran/gfortran.map: Add new functions.
+       * libgfortran/Makefile.am: Ditto.
+       * libgfortran/m4/minloc1.m4: Add empty argument for ARRAY_FUNCTION.
+       * libgfortran/m4/maxloc1.m4: Ditto.
+       * libgfortran/m4/all.m4: Ditto.
+       * libgfortran/m4/minval.m4: Ditto.
+       * libgfortran/m4/maxval.m4: Ditto.
+       * libgfortran/m4/count.m4: Ditto.
+       * libgfortran/m4/product.m4: Ditto.
+       * libgfortran/m4/any.m4: Ditto.
+       * Makefile.in: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/norm2_r4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/parity_l2.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/any_l2.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/parity_l16.c: Regenerated.
+       * generated/all_l1.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/all_l2.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/all_l16.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/parity_l4.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/count_4_l.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/count_8_l.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/norm2_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/norm2_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/count_1_l.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+       * generated/norm2_r10.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/count_16_l.c: Regenerated.
+       * generated/parity_l8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/count_2_l.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/parity_l1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/any_l1.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+
 2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/fpu-387.h (has_sse): Remove cw_sse, unused.
index 8d470b79c407f9df57e7133cfc87e2278204be39..d59c6887d7fc3f8d13fc2e78c8f4fa935aa817d5 100644 (file)
@@ -326,6 +326,19 @@ $(srcdir)/generated/minval_r8.c \
 $(srcdir)/generated/minval_r10.c \
 $(srcdir)/generated/minval_r16.c
 
+i_norm2_c= \
+$(srcdir)/generated/norm2_r4.c \
+$(srcdir)/generated/norm2_r8.c \
+$(srcdir)/generated/norm2_r10.c \
+$(srcdir)/generated/norm2_r16.c
+
+i_parity_c = \
+$(srcdir)/generated/parity_l1.c \
+$(srcdir)/generated/parity_l2.c \
+$(srcdir)/generated/parity_l4.c \
+$(srcdir)/generated/parity_l8.c \
+$(srcdir)/generated/parity_l16.c
+
 i_sum_c= \
 $(srcdir)/generated/sum_i1.c \
 $(srcdir)/generated/sum_i2.c \
@@ -589,11 +602,11 @@ m4_files= m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \
     m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
     m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \
     m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \
-    m4/unpack.m4 m4/spread.m4 m4/bessel.m4
+    m4/unpack.m4 m4/spread.m4 m4/bessel.m4 m4/norm2.m4 m4/parity.m4
 
 gfor_built_src= $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
     $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \
-    $(i_product_c) $(i_sum_c) $(i_bessel_c) \
+    $(i_product_c) $(i_sum_c) $(i_bessel_c) $(i_norm2_c) $(i_parity_c) \
     $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \
     $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \
     $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
@@ -866,6 +879,12 @@ $(i_matmul_c): m4/matmul.m4 $(I_M4_DEPS)
 $(i_matmull_c): m4/matmull.m4 $(I_M4_DEPS)
        $(M4) -Dfile=$@ -I$(srcdir)/m4 matmull.m4 > $@
 
+$(i_norm2_c): m4/norm2.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 norm2.m4 > $@
+
+$(i_parity_c): m4/parity.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 parity.m4 > $@
+
 $(i_transpose_c): m4/transpose.m4 $(I_M4_DEPS)
        $(M4) -Dfile=$@ -I$(srcdir)/m4 transpose.m4 > $@
 
index d4b5146f16834ea389888ad7ecb424cbf397858f..c6f92260d2ccd96be366c4b8cace8729b3433d4c 100644 (file)
@@ -144,40 +144,43 @@ am__objects_12 = sum_i1.lo sum_i2.lo sum_i4.lo sum_i8.lo sum_i16.lo \
        sum_r4.lo sum_r8.lo sum_r10.lo sum_r16.lo sum_c4.lo sum_c8.lo \
        sum_c10.lo sum_c16.lo
 am__objects_13 = bessel_r4.lo bessel_r8.lo bessel_r10.lo bessel_r16.lo
-am__objects_14 = matmul_i1.lo matmul_i2.lo matmul_i4.lo matmul_i8.lo \
+am__objects_14 = norm2_r4.lo norm2_r8.lo norm2_r10.lo norm2_r16.lo
+am__objects_15 = parity_l1.lo parity_l2.lo parity_l4.lo parity_l8.lo \
+       parity_l16.lo
+am__objects_16 = matmul_i1.lo matmul_i2.lo matmul_i4.lo matmul_i8.lo \
        matmul_i16.lo matmul_r4.lo matmul_r8.lo matmul_r10.lo \
        matmul_r16.lo matmul_c4.lo matmul_c8.lo matmul_c10.lo \
        matmul_c16.lo
-am__objects_15 = matmul_l4.lo matmul_l8.lo matmul_l16.lo
-am__objects_16 = transpose_i4.lo transpose_i8.lo transpose_i16.lo \
+am__objects_17 = matmul_l4.lo matmul_l8.lo matmul_l16.lo
+am__objects_18 = transpose_i4.lo transpose_i8.lo transpose_i16.lo \
        transpose_r4.lo transpose_r8.lo transpose_r10.lo \
        transpose_r16.lo transpose_c4.lo transpose_c8.lo \
        transpose_c10.lo transpose_c16.lo
-am__objects_17 = shape_i4.lo shape_i8.lo shape_i16.lo
-am__objects_18 = eoshift1_4.lo eoshift1_8.lo eoshift1_16.lo
-am__objects_19 = eoshift3_4.lo eoshift3_8.lo eoshift3_16.lo
-am__objects_20 = cshift1_4.lo cshift1_8.lo cshift1_16.lo
-am__objects_21 = reshape_i4.lo reshape_i8.lo reshape_i16.lo \
+am__objects_19 = shape_i4.lo shape_i8.lo shape_i16.lo
+am__objects_20 = eoshift1_4.lo eoshift1_8.lo eoshift1_16.lo
+am__objects_21 = eoshift3_4.lo eoshift3_8.lo eoshift3_16.lo
+am__objects_22 = cshift1_4.lo cshift1_8.lo cshift1_16.lo
+am__objects_23 = reshape_i4.lo reshape_i8.lo reshape_i16.lo \
        reshape_r4.lo reshape_r8.lo reshape_r10.lo reshape_r16.lo \
        reshape_c4.lo reshape_c8.lo reshape_c10.lo reshape_c16.lo
-am__objects_22 = in_pack_i1.lo in_pack_i2.lo in_pack_i4.lo \
+am__objects_24 = in_pack_i1.lo in_pack_i2.lo in_pack_i4.lo \
        in_pack_i8.lo in_pack_i16.lo in_pack_r4.lo in_pack_r8.lo \
        in_pack_r10.lo in_pack_r16.lo in_pack_c4.lo in_pack_c8.lo \
        in_pack_c10.lo in_pack_c16.lo
-am__objects_23 = in_unpack_i1.lo in_unpack_i2.lo in_unpack_i4.lo \
+am__objects_25 = in_unpack_i1.lo in_unpack_i2.lo in_unpack_i4.lo \
        in_unpack_i8.lo in_unpack_i16.lo in_unpack_r4.lo \
        in_unpack_r8.lo in_unpack_r10.lo in_unpack_r16.lo \
        in_unpack_c4.lo in_unpack_c8.lo in_unpack_c10.lo \
        in_unpack_c16.lo
-am__objects_24 = exponent_r4.lo exponent_r8.lo exponent_r10.lo \
+am__objects_26 = exponent_r4.lo exponent_r8.lo exponent_r10.lo \
        exponent_r16.lo
-am__objects_25 = fraction_r4.lo fraction_r8.lo fraction_r10.lo \
+am__objects_27 = fraction_r4.lo fraction_r8.lo fraction_r10.lo \
        fraction_r16.lo
-am__objects_26 = nearest_r4.lo nearest_r8.lo nearest_r10.lo \
+am__objects_28 = nearest_r4.lo nearest_r8.lo nearest_r10.lo \
        nearest_r16.lo
-am__objects_27 = set_exponent_r4.lo set_exponent_r8.lo \
+am__objects_29 = set_exponent_r4.lo set_exponent_r8.lo \
        set_exponent_r10.lo set_exponent_r16.lo
-am__objects_28 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \
+am__objects_30 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \
        pow_c8_i4.lo pow_c10_i4.lo pow_c16_i4.lo pow_i4_i8.lo \
        pow_i8_i8.lo pow_i16_i8.lo pow_r4_i8.lo pow_r8_i8.lo \
        pow_r10_i8.lo pow_r16_i8.lo pow_c4_i8.lo pow_c8_i8.lo \
@@ -185,26 +188,26 @@ am__objects_28 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \
        pow_i16_i16.lo pow_r4_i16.lo pow_r8_i16.lo pow_r10_i16.lo \
        pow_r16_i16.lo pow_c4_i16.lo pow_c8_i16.lo pow_c10_i16.lo \
        pow_c16_i16.lo
-am__objects_29 = rrspacing_r4.lo rrspacing_r8.lo rrspacing_r10.lo \
+am__objects_31 = rrspacing_r4.lo rrspacing_r8.lo rrspacing_r10.lo \
        rrspacing_r16.lo
-am__objects_30 = spacing_r4.lo spacing_r8.lo spacing_r10.lo \
+am__objects_32 = spacing_r4.lo spacing_r8.lo spacing_r10.lo \
        spacing_r16.lo
-am__objects_31 = pack_i1.lo pack_i2.lo pack_i4.lo pack_i8.lo \
+am__objects_33 = pack_i1.lo pack_i2.lo pack_i4.lo pack_i8.lo \
        pack_i16.lo pack_r4.lo pack_r8.lo pack_r10.lo pack_r16.lo \
        pack_c4.lo pack_c8.lo pack_c10.lo pack_c16.lo
-am__objects_32 = unpack_i1.lo unpack_i2.lo unpack_i4.lo unpack_i8.lo \
+am__objects_34 = unpack_i1.lo unpack_i2.lo unpack_i4.lo unpack_i8.lo \
        unpack_i16.lo unpack_r4.lo unpack_r8.lo unpack_r10.lo \
        unpack_r16.lo unpack_c4.lo unpack_c8.lo unpack_c10.lo \
        unpack_c16.lo
-am__objects_33 = spread_i1.lo spread_i2.lo spread_i4.lo spread_i8.lo \
+am__objects_35 = spread_i1.lo spread_i2.lo spread_i4.lo spread_i8.lo \
        spread_i16.lo spread_r4.lo spread_r8.lo spread_r10.lo \
        spread_r16.lo spread_c4.lo spread_c8.lo spread_c10.lo \
        spread_c16.lo
-am__objects_34 = cshift0_i1.lo cshift0_i2.lo cshift0_i4.lo \
+am__objects_36 = cshift0_i1.lo cshift0_i2.lo cshift0_i4.lo \
        cshift0_i8.lo cshift0_i16.lo cshift0_r4.lo cshift0_r8.lo \
        cshift0_r10.lo cshift0_r16.lo cshift0_c4.lo cshift0_c8.lo \
        cshift0_c10.lo cshift0_c16.lo
-am__objects_35 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
+am__objects_37 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
        $(am__objects_5) $(am__objects_6) $(am__objects_7) \
        $(am__objects_8) $(am__objects_9) $(am__objects_10) \
        $(am__objects_11) $(am__objects_12) $(am__objects_13) \
@@ -214,11 +217,12 @@ am__objects_35 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
        $(am__objects_23) $(am__objects_24) $(am__objects_25) \
        $(am__objects_26) $(am__objects_27) $(am__objects_28) \
        $(am__objects_29) $(am__objects_30) $(am__objects_31) \
-       $(am__objects_32) $(am__objects_33) $(am__objects_34)
-am__objects_36 = close.lo file_pos.lo format.lo inquire.lo \
+       $(am__objects_32) $(am__objects_33) $(am__objects_34) \
+       $(am__objects_35) $(am__objects_36)
+am__objects_38 = close.lo file_pos.lo format.lo inquire.lo \
        intrinsics.lo list_read.lo lock.lo open.lo read.lo \
        size_from_kind.lo transfer.lo unit.lo unix.lo write.lo fbuf.lo
-am__objects_37 = associated.lo abort.lo access.lo args.lo \
+am__objects_39 = associated.lo abort.lo access.lo args.lo \
        bit_intrinsics.lo c99_functions.lo chdir.lo chmod.lo clock.lo \
        cpu_time.lo cshift0.lo ctime.lo date_and_time.lo dtime.lo \
        env.lo eoshift0.lo eoshift2.lo erfc_scaled.lo etime.lo exit.lo \
@@ -233,8 +237,8 @@ am__objects_37 = associated.lo abort.lo access.lo args.lo \
        system_clock.lo time.lo transpose_generic.lo umask.lo \
        unlink.lo unpack_generic.lo in_pack_generic.lo \
        in_unpack_generic.lo
-am__objects_38 =
-am__objects_39 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
+am__objects_40 =
+am__objects_41 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
        _abs_i4.lo _abs_i8.lo _abs_i16.lo _abs_r4.lo _abs_r8.lo \
        _abs_r10.lo _abs_r16.lo _aimag_c4.lo _aimag_c8.lo \
        _aimag_c10.lo _aimag_c16.lo _exp_r4.lo _exp_r8.lo _exp_r10.lo \
@@ -258,18 +262,18 @@ am__objects_39 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
        _conjg_c4.lo _conjg_c8.lo _conjg_c10.lo _conjg_c16.lo \
        _aint_r4.lo _aint_r8.lo _aint_r10.lo _aint_r16.lo _anint_r4.lo \
        _anint_r8.lo _anint_r10.lo _anint_r16.lo
-am__objects_40 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \
+am__objects_42 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \
        _sign_r8.lo _sign_r10.lo _sign_r16.lo _dim_i4.lo _dim_i8.lo \
        _dim_i16.lo _dim_r4.lo _dim_r8.lo _dim_r10.lo _dim_r16.lo \
        _atan2_r4.lo _atan2_r8.lo _atan2_r10.lo _atan2_r16.lo \
        _mod_i4.lo _mod_i8.lo _mod_i16.lo _mod_r4.lo _mod_r8.lo \
        _mod_r10.lo _mod_r16.lo
-am__objects_41 = misc_specifics.lo
-am__objects_42 = $(am__objects_39) $(am__objects_40) $(am__objects_41) \
+am__objects_43 = misc_specifics.lo
+am__objects_44 = $(am__objects_41) $(am__objects_42) $(am__objects_43) \
        dprod_r8.lo f2c_specifics.lo
-am__objects_43 = $(am__objects_1) $(am__objects_35) $(am__objects_36) \
-       $(am__objects_37) $(am__objects_38) $(am__objects_42)
-@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_43)
+am__objects_45 = $(am__objects_1) $(am__objects_37) $(am__objects_38) \
+       $(am__objects_39) $(am__objects_40) $(am__objects_44)
+@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_45)
 @onestep_TRUE@am_libgfortran_la_OBJECTS = libgfortran_c.lo
 libgfortran_la_OBJECTS = $(am_libgfortran_la_OBJECTS)
 libgfortranbegin_la_LIBADD =
@@ -742,6 +746,19 @@ $(srcdir)/generated/minval_r8.c \
 $(srcdir)/generated/minval_r10.c \
 $(srcdir)/generated/minval_r16.c
 
+i_norm2_c = \
+$(srcdir)/generated/norm2_r4.c \
+$(srcdir)/generated/norm2_r8.c \
+$(srcdir)/generated/norm2_r10.c \
+$(srcdir)/generated/norm2_r16.c
+
+i_parity_c = \
+$(srcdir)/generated/parity_l1.c \
+$(srcdir)/generated/parity_l2.c \
+$(srcdir)/generated/parity_l4.c \
+$(srcdir)/generated/parity_l8.c \
+$(srcdir)/generated/parity_l16.c
+
 i_sum_c = \
 $(srcdir)/generated/sum_i1.c \
 $(srcdir)/generated/sum_i2.c \
@@ -1004,11 +1021,11 @@ m4_files = m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \
     m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
     m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \
     m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \
-    m4/unpack.m4 m4/spread.m4 m4/bessel.m4
+    m4/unpack.m4 m4/spread.m4 m4/bessel.m4 m4/norm2.m4 m4/parity.m4
 
 gfor_built_src = $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
     $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \
-    $(i_product_c) $(i_sum_c) $(i_bessel_c) \
+    $(i_product_c) $(i_sum_c) $(i_bessel_c) $(i_norm2_c) $(i_parity_c) \
     $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \
     $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \
     $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
@@ -1598,6 +1615,10 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r16.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r4.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r8.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c10.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c16.Plo@am__quote@
@@ -1613,6 +1634,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r16.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r4.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l8.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c10_i16.Plo@am__quote@
@@ -3495,6 +3521,69 @@ bessel_r16.lo: $(srcdir)/generated/bessel_r16.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r16.lo `test -f '$(srcdir)/generated/bessel_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r16.c
 
+norm2_r4.lo: $(srcdir)/generated/norm2_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r4.lo -MD -MP -MF $(DEPDIR)/norm2_r4.Tpo -c -o norm2_r4.lo `test -f '$(srcdir)/generated/norm2_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r4.Tpo $(DEPDIR)/norm2_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r4.c' object='norm2_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r4.lo `test -f '$(srcdir)/generated/norm2_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r4.c
+
+norm2_r8.lo: $(srcdir)/generated/norm2_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r8.lo -MD -MP -MF $(DEPDIR)/norm2_r8.Tpo -c -o norm2_r8.lo `test -f '$(srcdir)/generated/norm2_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r8.Tpo $(DEPDIR)/norm2_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r8.c' object='norm2_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r8.lo `test -f '$(srcdir)/generated/norm2_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r8.c
+
+norm2_r10.lo: $(srcdir)/generated/norm2_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r10.lo -MD -MP -MF $(DEPDIR)/norm2_r10.Tpo -c -o norm2_r10.lo `test -f '$(srcdir)/generated/norm2_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r10.Tpo $(DEPDIR)/norm2_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r10.c' object='norm2_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r10.lo `test -f '$(srcdir)/generated/norm2_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r10.c
+
+norm2_r16.lo: $(srcdir)/generated/norm2_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r16.lo -MD -MP -MF $(DEPDIR)/norm2_r16.Tpo -c -o norm2_r16.lo `test -f '$(srcdir)/generated/norm2_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r16.Tpo $(DEPDIR)/norm2_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r16.c' object='norm2_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r16.lo `test -f '$(srcdir)/generated/norm2_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r16.c
+
+parity_l1.lo: $(srcdir)/generated/parity_l1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l1.lo -MD -MP -MF $(DEPDIR)/parity_l1.Tpo -c -o parity_l1.lo `test -f '$(srcdir)/generated/parity_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l1.Tpo $(DEPDIR)/parity_l1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l1.c' object='parity_l1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l1.lo `test -f '$(srcdir)/generated/parity_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l1.c
+
+parity_l2.lo: $(srcdir)/generated/parity_l2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l2.lo -MD -MP -MF $(DEPDIR)/parity_l2.Tpo -c -o parity_l2.lo `test -f '$(srcdir)/generated/parity_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l2.Tpo $(DEPDIR)/parity_l2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l2.c' object='parity_l2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l2.lo `test -f '$(srcdir)/generated/parity_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l2.c
+
+parity_l4.lo: $(srcdir)/generated/parity_l4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l4.lo -MD -MP -MF $(DEPDIR)/parity_l4.Tpo -c -o parity_l4.lo `test -f '$(srcdir)/generated/parity_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l4.Tpo $(DEPDIR)/parity_l4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l4.c' object='parity_l4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l4.lo `test -f '$(srcdir)/generated/parity_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l4.c
+
+parity_l8.lo: $(srcdir)/generated/parity_l8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l8.lo -MD -MP -MF $(DEPDIR)/parity_l8.Tpo -c -o parity_l8.lo `test -f '$(srcdir)/generated/parity_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l8.Tpo $(DEPDIR)/parity_l8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l8.c' object='parity_l8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l8.lo `test -f '$(srcdir)/generated/parity_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l8.c
+
+parity_l16.lo: $(srcdir)/generated/parity_l16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l16.lo -MD -MP -MF $(DEPDIR)/parity_l16.Tpo -c -o parity_l16.lo `test -f '$(srcdir)/generated/parity_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l16.Tpo $(DEPDIR)/parity_l16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l16.c' object='parity_l16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l16.lo `test -f '$(srcdir)/generated/parity_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l16.c
+
 matmul_i1.lo: $(srcdir)/generated/matmul_i1.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i1.lo -MD -MP -MF $(DEPDIR)/matmul_i1.Tpo -c -o matmul_i1.lo `test -f '$(srcdir)/generated/matmul_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i1.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_i1.Tpo $(DEPDIR)/matmul_i1.Plo
@@ -5603,6 +5692,12 @@ fpu-target.h: $(srcdir)/$(FPU_HOST_HEADER)
 @MAINTAINER_MODE_TRUE@$(i_matmull_c): m4/matmull.m4 $(I_M4_DEPS)
 @MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 matmull.m4 > $@
 
+@MAINTAINER_MODE_TRUE@$(i_norm2_c): m4/norm2.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 norm2.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_parity_c): m4/parity.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 parity.m4 > $@
+
 @MAINTAINER_MODE_TRUE@$(i_transpose_c): m4/transpose.m4 $(I_M4_DEPS)
 @MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 transpose.m4 > $@
 
index 486bab2e436227fed18d818f90cd0ffa1d27804b..400cfd9011514b5cd7fbdd10f58e238bea379ddd 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ALL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 35f8a9621b45443ce32db333bde672fffe991884..abe10d7b388944e4371191e8e19eee02bb9b65a5 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ALL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 81532ea431b6a0b003c25093a82eff57a36e1b10..2cbd1266b7404422d491b2918f7d1f3560b91abb 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ALL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 6657e15cd894f06054587729bdeb7bf515ad6533..14b6303494983ac0ce9f1452ced5001fd5600a8e 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ALL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 4c3d5563f838102b65678b53f122f4543bea8f06..ae5e6faf3c34cc13e89b6b5cbb56389367d09929 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ALL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index a69f22e6f82befb7d212eb8dadc52b7b85177b17..f8af5447a401ad005d16597a97ba39c78928a83a 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ANY intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index b5ab5b214acb9dea03097a17edec64316495da05..f92d7152b129e81ba0ec490eba50e1c379304206 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ANY intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 05673e8daba57723a7c819ce86b4bbe221c15e74..9c5e90a03b80f0440fff632a2a57a282a44ce02e 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ANY intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 8f82741701fe7933b97803509f7c7a04ba03b30a..44d5ed97e6bc51eef27d1071b210a2427e1ded38 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ANY intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 2a094f0a5fe38e087d587374c1f83971a955c987..eabf8300dcb5f2092aa9859f97a862af7d11fad7 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the ANY intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 8c3fc7d9a165ca2bd719631ea5ed62a8913a3bb2..d65999aff5ae6f684b930924d06abd5c3f80b183 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the COUNT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index faf9176943c3cac2de23319052251de1044f334b..b2d89f4af3721afcdb0cf6a6b25d565769b4c946 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the COUNT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 0d1a22339e9edc294301c45eeccfd6c943e8856c..8369a94feb89f2b2db2b04fc833ec541465ff77b 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the COUNT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index d4bfbd47ef34a119d9f5d6bf89fbe5e04ffcb64b..8b5cbb0faa38057055e23879c796c95412cf804b 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the COUNT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 2a62ea87bd4894fb3915513a771b50a69e774d5d..9cb6a26f2f1bc9831e4afd8c23c51f0582d0adf0 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the COUNT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
index 7319f57beb49b0466e6aa85004c3934422c1b37a..a3aafcf6f80ddc8e431a20fba82aae10797361b9 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 4d9b57be9897f7be207459d32921d1e3a728f9cd..8dc8ef79d2331d7716ab78ed538590b607798c36 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index fcca4b791d998b5a3ee21062a9415a67c8771af0..d13257299963d754e013ec1a5fa6d83df9e3556c 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 714869760a2d7fb101b60576b077b605666e9cc4..995b1e44f0372921c2be4e37fdaa55a84c9f8136 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 48c0bd040ad3533abb2cd0b0f127eac945714348..5376bcb32139ac73f38f09b3a96757748f99aa52 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 991830bebd85997f89c335fe2520c7787df12336..a23655da94767025015517fb67baa86ef5dcd842 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index eb9dd4d456620c3be493131d52b2e87c533e68be..9e47498169f278a9eec3ac03331b1955babcefab 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index ced073aeecbbaa2527fb79f4c209fc01dd8ab8f2..a551aff994551f1e16eac839f2b32be8a10f52cc 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 7dacbb8a69a578ef58467e38ad22a51f69c4e149..802ea09825f732d747c3151b6082791631f7844e 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2bda8e5a0a1dbdcd329532e8632e8f6caf195dd5..484cb0d4d45a6ffef9e09a6e46d1331e39d2d7a6 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 0f45cffaeaca19afa8010641961c9610773a00a0..353d4975505ef883bc03c257517ce147ffe31d10 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index b165d30ee6bceb758fe7c897d5423b843f70ec2a..7342ac8e1abdd02c99de430e4fff2a86df43aa65 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index bf855ca388156a814aa3169102786a7762c242e9..12b978f928986593c660cacfd0a670c6f417465c 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 603e6d65412e605d9d0c8eee24f838dd0092820d..4f5c6590bf050a702143bba77ef1a3770bce7310 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 78044462834b3b176cfe954f30a1bb83c2e9c474..5df2ca36bed402b47849ba64c8f86e4d8a09a290 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 4b0f3241007903bcfdc66b29e90f27b3f7b91aeb..c556452a2fd8b91780efb0545a4dc00c4f5a4733 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 6d02691c55ee94e4f20add316947e91db6e44a37..fecd072b2e029bd1788daeff4baee7c37785df08 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 363d93858f35cd6a88a08150ac4ab4e788e69663..a63fe367c8595f2bf594e3175eb207e03d95b1f6 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 20a95b86c92e87ef12a53e3b4b9cd458db575e7e..d70c663128c6f1324d93fa226b0bb5483bc8b277 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2909ee43a810c3a73e064a81dd044c4ff3fbbb53..ce4afb121763593a9b7eecf22b1982aa6a36fa13 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index fe29becd60b0f243cef730a3e94e4a5e57e979fb..1bffde89c9b03af04137846443ddf28adc2f6e58 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index b8e2619e1dc1012b08d8cdf4ccef7f001ab94ae1..3abd6ab6e1318f2a5e92d765610514fb9ecb5353 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 4b0a02ae643731d0b34dc06ccae3a17af27eefae..57fcae0e48d13e90b98b7548967fb67894adf6ac 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 801a3273f7ccfe7370ea197b8d24568c4ac54a89..ca8047e5ccaeccd45c59f5d66df7fd191ddabe02 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 6ec85941a611e6d797a9da8b316edf0074328671..12ab66698988bc5a6dc0d644a01889f2af772ec5 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2696304a774ba59c20014efdd1042282744b9cf1..479660e6e425369b9a8f1d0ff57c01824c196b53 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 8bbb68af2aec7a7f4e20ae623d32b79eaa0f1510..6f47a15415d446a807d4f661430a74ab14dcde2c 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 56bd2e25cfec73faaf56ee8d6445d79b1b93bb42..cb429016ce47069273406087d65f0bc413933fba 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_i1 (gfc_array_i1 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 5b21ac9295f4c88e597b2b0fc2f11f06010aac85..4f11635a0f616d698679785ec7c1b6417cb6a573 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_i16 (gfc_array_i16 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index cbf4efb8be06e8fa5922fa9bfce04322cb2ae7dd..8fb385688d879e6ddbf69c425ffe7331cb51c8f7 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_i2 (gfc_array_i2 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index d997bde1f7dfedcd28ab2861261e610844221688..c67d0cb69868e6832df0dcd31d35ccaba8bd0fb9 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_i4 (gfc_array_i4 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 476d1385326a7b307db939e8073f8211bfbfaa40..b2f33ddde86abaa3505cbbd306e975df9bc63a71 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_i8 (gfc_array_i8 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 84daf681f529eeb3a119206d94ba2f1b174efd79..75c45f93a5a1a72f40c36e539431fcd9a5cbf3bc 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_r10 (gfc_array_r10 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 05ea566f9565c468c8536a7e1e1e7f4a1d3f4fc9..4ade432b297f0df4f6b79da29fd7ab18b780719c 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_r16 (gfc_array_r16 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 212479791176efe638f3dfa2da9ee84496faebca..567ad3b40086194c97c5bec0a7dc7e0ebeb63823 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_r4 (gfc_array_r4 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 71758b8644a285aa2ca768113326cd4bf7d43853..196021cf0c2bf2ee468573bff38b5e1b02d1dbc2 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ maxval_r8 (gfc_array_r8 * const restrict retarray,
                if (*src > result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index a81e82108cb1794dd86c7336252cc9bb82b687e8..a287fee23c04aabd0c228dd422a1cae2780d0518 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2efb5013ef08fc5d946cb1968f5766ddf185cd9e..852118813b63635fee184968fe870bcdae039ce5 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 404338e39b3df13933dd5b24fdac16c934aaa4e9..f7c951c7b40bfc257282b7fbbc64686257af5dd0 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index be8e99a66ba0b8b6574a4f79edc7aeb91b4ef2b4..98ec8996daf79403c96cfab542239c242ab05946 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 53e517ce404572c3fa5c8ae238130636269f2f3b..ab0a296b7afadf775ef1188f707f83cf9216bfaf 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 67ae67bde260c118aabac27d06bad03624cae8d2..5fe952cebc484d766974f1ba4de588f68a27a83e 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 4ea3c308f360a906b38eb20f9781d778000fa5fb..d68cc7aab36b333450a2dc03f4897034dc812525 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index d786ca2253bc2f58e5aafb690415c54587d9931d..8207441618eff38d9825114ae38d6039eaf1bec8 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 0dcda10d9d7c1bed32f3bb1be5247586dddbf5cf..72bfcce648888d542f1c9cadb34de21de79a044b 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
                    result = (GFC_INTEGER_16)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index b71179044f50352f92c59d2a7b7cf66a2164c582..631645f6b08a727eff94b1fc957e1c9c1db8da15 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index f867804a1785427f67eb3af8041afc0c3f2cb2db..2096589cfec4ff8b65dca1706b3dd8551b976087 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 8d09ba5fbb9293a582c9fa6f06ee69d98d5c241e..2bdedd82d3a4f4c195552194fbb6751fcfcdf3b6 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2b8c02b96ef08fa368b5b4588f8930faec4d9a64..513b0cf8ec6e1f1c1bcb0260be8c332977e3bf2b 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index ae5049ab1b6c7da482d42f2b0d62787210a9ebaf..c15914bc7b09c08aa53fd39caf3390e55fedf4e4 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 8d14c2dc871d67c2aeb4a7bcaf9e623f74d29b48..f60262ac42a9303ce7e44f306ac51acbed493a69 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index fcb8d0cf72d4af3f5e3237e4443d17769b6628dc..e0c1e6b262dee1deb9e631716d91c23497c29d8a 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 75d43ffcf4ac65fc6a16646b1509a53f9c395f11..31104510b28ecd5ce7a5dd60c790bd511dc11f11 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 49e03203255769409c60914a8a7e03f72e56cb54..4888dd72f3d5b4f58101d030a0c16479ab41e7fb 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
                    result = (GFC_INTEGER_4)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 7104a60506de4975fd3818e1e12650ed4ef0c8c0..953460d33be26bad649c82847967de897eaa32f2 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index ac994015e85239d72e536f969e2a91f404cc0d98..9ac6de055b8b36d10aeaa984a032f782137b6851 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 73042fd95a108cb2a14d8a17da08eaeb9b3fc92f..7f4db40983150fb94e4cf0a10b077f58c79b33fe 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2eb44c45a30afa00521be450bb1e94a63acb999c..cb68b4b78f546bfe143e34df25b6b205d7db7db4 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 2a52c29d6bf241b058386796c4f1bc76c0cadf91..e6eb5c3dc039c91a856a943e1de47e75c071ca20 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index a84456d7ccd463e114f2c1e0f6ff32db6f68a044..c78b092d130e44cf489506aa2c794fd343e9cd7f 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 07f1ba530cfe7ac9f0ee4bdc70e3f192b005340e..ecd80313ca51dfc3c403c322bbe9e28f94696ff2 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 053642a7159bb65e0d491c32a0370dfd6a2d0b6d..053ef6f7e9a2765fe6ec5b7796b7be4991c4dbc6 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 88f91fd6a4c3ef5bed2de6c67e857b3af90f2523..ac06ec979331617178e9e77c6dbea4d902281073 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -174,6 +174,7 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
                    result = (GFC_INTEGER_8)n + 1;
                  }
              }
+           
            *dest = result;
          }
       }
index 341fbb787dff3d7c80c5e4e6c69aad7b4d296720..93276f977e6bfd5bbbd8b03a66f2ce82f12f29c8 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_i1 (gfc_array_i1 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 32554df3e8e4c41d5a4dccbbdb801e0792bfa228..a5ff46e9a38ac1bb142866eeec2842d1938f11f3 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index d50d9373e24a3fbb4d5cc316a8a56519266a5ec9..b4e8dd556678cd7bbc2633a9d3d2731fc54ce0a5 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_i2 (gfc_array_i2 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index bfcf5435f55fb6f88caa26576aa6beb2cb42e209..3f9e0682b76001abaf790e0bc9fd56e7a23ffc57 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_i4 (gfc_array_i4 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 242c8b74c3f3e1d8c1b40afe7f91c15a70c6c969..725093e21ed6c2b693e72198713952730e6b2540 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_i8 (gfc_array_i8 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index e99765300781d0104bf8e80d62382f6ced1a6924..dacbb7094009f6a16196ed4705ebc2f2cdeba622 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_r10 (gfc_array_r10 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 539193f5c3d0361865747d47c993f95637ef2a8d..93289ba0974207ead02731d38f476dab9aec1083 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_r16 (gfc_array_r16 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index e782829d0cc97da14a716d0ef9dd79d86cf38efc..4d5b8b0cfb36236f8eaa64af1f8a6fbd6a37f86d 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_r4 (gfc_array_r4 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
index 0496a421e561693f29e7ce2b964c7a064e319be2..7b0fdb88fb750b3295b8a42353a3959236ab2c71 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -166,6 +166,7 @@ minval_r8 (gfc_array_r8 * const restrict retarray,
                if (*src < result)
                  result = *src;
              }
+           
            *dest = result;
          }
       }
diff --git a/libgfortran/generated/norm2_r10.c b/libgfortran/generated/norm2_r10.c
new file mode 100644 (file)
index 0000000..64cf404
--- /dev/null
@@ -0,0 +1,208 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10)
+
+
+extern void norm2_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(norm2_r10);
+
+void
+norm2_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * 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_REAL_10 * restrict base;
+  GFC_REAL_10 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM 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", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_REAL_10 result;
+      src = base;
+      {
+
+       GFC_REAL_10 scale;
+       result = 0.0L;
+       scale = 1.0L;
+       if (len <= 0)
+         *dest = 0.0L;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0.0L)
+           {
+             GFC_REAL_10 absX, val;
+             absX = fabsl (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1.0L + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * sqrtl (result);
+           *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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/norm2_r16.c b/libgfortran/generated/norm2_r16.c
new file mode 100644 (file)
index 0000000..1fc79ae
--- /dev/null
@@ -0,0 +1,208 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16)
+
+
+extern void norm2_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(norm2_r16);
+
+void
+norm2_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * 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_REAL_16 * restrict base;
+  GFC_REAL_16 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM 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", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_REAL_16 result;
+      src = base;
+      {
+
+       GFC_REAL_16 scale;
+       result = 0.0L;
+       scale = 1.0L;
+       if (len <= 0)
+         *dest = 0.0L;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0.0L)
+           {
+             GFC_REAL_16 absX, val;
+             absX = fabsl (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1.0L + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * sqrtl (result);
+           *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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/norm2_r4.c b/libgfortran/generated/norm2_r4.c
new file mode 100644 (file)
index 0000000..78f28dc
--- /dev/null
@@ -0,0 +1,208 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4)
+
+
+extern void norm2_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(norm2_r4);
+
+void
+norm2_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * 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_REAL_4 * restrict base;
+  GFC_REAL_4 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM 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", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_REAL_4 result;
+      src = base;
+      {
+
+       GFC_REAL_4 scale;
+       result = 0.0F;
+       scale = 1.0F;
+       if (len <= 0)
+         *dest = 0.0F;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0.0F)
+           {
+             GFC_REAL_4 absX, val;
+             absX = fabsf (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1.0F + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * sqrtf (result);
+           *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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/norm2_r8.c b/libgfortran/generated/norm2_r8.c
new file mode 100644 (file)
index 0000000..fd9aba7
--- /dev/null
@@ -0,0 +1,208 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8)
+
+
+extern void norm2_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(norm2_r8);
+
+void
+norm2_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * 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_REAL_8 * restrict base;
+  GFC_REAL_8 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM 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", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_REAL_8 result;
+      src = base;
+      {
+
+       GFC_REAL_8 scale;
+       result = 0.0;
+       scale = 1.0;
+       if (len <= 0)
+         *dest = 0.0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0.0)
+           {
+             GFC_REAL_8 absX, val;
+             absX = fabs (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1.0 + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * sqrt (result);
+           *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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/parity_l1.c b/libgfortran/generated/parity_l1.c
new file mode 100644 (file)
index 0000000..4fef277
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_1) && defined (HAVE_GFC_LOGICAL_1)
+
+
+extern void parity_l1 (gfc_array_l1 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(parity_l1);
+
+void
+parity_l1 (gfc_array_l1 * const restrict retarray, 
+       gfc_array_l1 * 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_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY 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", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_1 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = 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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/parity_l16.c b/libgfortran/generated/parity_l16.c
new file mode 100644 (file)
index 0000000..45f4457
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_16) && defined (HAVE_GFC_LOGICAL_16)
+
+
+extern void parity_l16 (gfc_array_l16 * const restrict, 
+       gfc_array_l16 * const restrict, const index_type * const restrict);
+export_proto(parity_l16);
+
+void
+parity_l16 (gfc_array_l16 * const restrict retarray, 
+       gfc_array_l16 * 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_LOGICAL_16 * restrict base;
+  GFC_LOGICAL_16 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY 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", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_16 * restrict src;
+      GFC_LOGICAL_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = 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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/parity_l2.c b/libgfortran/generated/parity_l2.c
new file mode 100644 (file)
index 0000000..13e77bd
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_2) && defined (HAVE_GFC_LOGICAL_2)
+
+
+extern void parity_l2 (gfc_array_l2 * const restrict, 
+       gfc_array_l2 * const restrict, const index_type * const restrict);
+export_proto(parity_l2);
+
+void
+parity_l2 (gfc_array_l2 * const restrict retarray, 
+       gfc_array_l2 * 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_LOGICAL_2 * restrict base;
+  GFC_LOGICAL_2 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY 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", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_2 * restrict src;
+      GFC_LOGICAL_2 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = 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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/parity_l4.c b/libgfortran/generated/parity_l4.c
new file mode 100644 (file)
index 0000000..5d7fbbe
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_4) && defined (HAVE_GFC_LOGICAL_4)
+
+
+extern void parity_l4 (gfc_array_l4 * const restrict, 
+       gfc_array_l4 * const restrict, const index_type * const restrict);
+export_proto(parity_l4);
+
+void
+parity_l4 (gfc_array_l4 * const restrict retarray, 
+       gfc_array_l4 * 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_LOGICAL_4 * restrict base;
+  GFC_LOGICAL_4 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY 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", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_4 * restrict src;
+      GFC_LOGICAL_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = 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];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/libgfortran/generated/parity_l8.c b/libgfortran/generated/parity_l8.c
new file mode 100644 (file)
index 0000000..1d9ba82
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_8) && defined (HAVE_GFC_LOGICAL_8)
+
+
+extern void parity_l8 (gfc_array_l8 * const restrict, 
+       gfc_array_l8 * const restrict, const index_type * const restrict);
+export_proto(parity_l8);
+
+void
+parity_l8 (gfc_array_l8 * const restrict retarray, 
+       gfc_array_l8 * 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_LOGICAL_8 * restrict base;
+  GFC_LOGICAL_8 * 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;
+    }
+
+  if (retarray->data == NULL)
+    {
+      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;
+
+      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY 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", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       len = 0;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_8 * restrict src;
+      GFC_LOGICAL_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = 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];
+           }
+       }
+    }
+}
+
+#endif
index ee1da3cb90b7b7f71d194a76f4756c860f2a3814..125c44d1e0ec4fdcc903310ee44e8208d70315c1 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_c10 (gfc_array_c10 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index eeeeb66448ba93a2eccbe3447220285db4409a91..6a64e656209d3867bb365596a7868ea51d851e28 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_c16 (gfc_array_c16 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 1a44948b8f037fe32c6d744037410552ef47560d..9c092eb4670cb499e054be84b305ddd53230c375 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_c4 (gfc_array_c4 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index ad3f11155f0c69ceed67515398470f99c2f06252..a6b3c3db12b25c5d5e275f23b34331147da4bc58 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_c8 (gfc_array_c8 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 202d0cb4f73485dfbab8e1f1ed38845f68f45b00..96c4f9c45d61d1e698f8ec02c441f1e5ba898242 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_i1 (gfc_array_i1 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 5e471863e83910b5fdc76105ed9622639c04897d..bae7554a75befab5f64c574c6623101dd63c91c4 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_i16 (gfc_array_i16 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index c5bfc293e55b57ac2d7d3d1dcdfabfe963a29e83..5546f59e389851e9c8f5fa249d02f574e18b8699 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_i2 (gfc_array_i2 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 034144531404c15570bacec3772a6dcdc2783797..acb2f9780dc5eb8dc6aae838a5e8f1f51253e7d9 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_i4 (gfc_array_i4 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index d0bfb858c1cbe8286f026963774c30d919e9eed0..bb2e63147fa70c9fe44c2209a88a03a707428380 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_i8 (gfc_array_i8 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 694cc86dacc92e2d56d5ef17046fc8e094d77b22..ae86e7204977c1a9073138c0bf7d80f40a88bc22 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_r10 (gfc_array_r10 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index dcad0eda649bed8926c325c5847c3944e0b47061..71bc8cc0fdb2a4a1944b9713a7a02a832856c0a7 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_r16 (gfc_array_r16 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 26fad0ddb0e56b3987c2f47034d274325af8de18..142b7c3ddf8d974a2eb75665de94cc13998aeabe 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_r4 (gfc_array_r4 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 06ee57d1f180882a78cf6dae233347f6367c3ede..8e50e01d2af9ab9bcf33f9a6f380fa4667414d46 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -152,6 +152,7 @@ product_r8 (gfc_array_r8 * const restrict retarray,
 
   result *= *src;
              }
+           
            *dest = result;
          }
       }
index 4008607ea6923a86f61014bae84b38c6b0ffe07d..f254190d4c08529c0d9421afe4805039941782f6 100644 (file)
@@ -152,6 +152,7 @@ sum_c10 (gfc_array_c10 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 426eb108866ca2331dcf962a55cbab375677170e..5505647ff1fc9f476433cfbe635eebe7154f867d 100644 (file)
@@ -152,6 +152,7 @@ sum_c16 (gfc_array_c16 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 1991a3e817b50d5d5737e67041dc60ae3c19292e..99a6e35207c49e06924a351f2f73d7f742deed95 100644 (file)
@@ -152,6 +152,7 @@ sum_c4 (gfc_array_c4 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 3272bbc495390a89fa7bd4d9b717382b3e002d97..505050761dabceeff9b54d1202a7abd3afd03e4d 100644 (file)
@@ -152,6 +152,7 @@ sum_c8 (gfc_array_c8 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index df8338d3b87c1604075f364ea58723572b6e6715..d839b0fee68e40d7bca27862440a1ae4f9091bd5 100644 (file)
@@ -152,6 +152,7 @@ sum_i1 (gfc_array_i1 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 50ff8aba70a60cbf83241efe6773d389691ba839..d02a1714695c8734fa434abd643f3adf9dd02e83 100644 (file)
@@ -152,6 +152,7 @@ sum_i16 (gfc_array_i16 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 3fb848f2c47d519cc7ddc7194737232a8783ef72..d5b16dd01a9a1b465cb3afb772888e1981fbdb86 100644 (file)
@@ -152,6 +152,7 @@ sum_i2 (gfc_array_i2 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 7ad317c4846e67809348e8d37ae145e2487013a2..db0ad0e4a63411235d1f0e66dce07f3cb6e27ac2 100644 (file)
@@ -152,6 +152,7 @@ sum_i4 (gfc_array_i4 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 050e596de8a57cc6920d18fc86ce124dedb1c1bd..f872bd4dc3abda23e73e51ef538ad31ad8cfd9a7 100644 (file)
@@ -152,6 +152,7 @@ sum_i8 (gfc_array_i8 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 333dbb4404c8a5c4d37995fb41d439ac8df85dac..a1bf9facf54797aa67daf1312bbfb87816d8daec 100644 (file)
@@ -152,6 +152,7 @@ sum_r10 (gfc_array_r10 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index a765758559d12a038d66d9a26adb725d2ce58dd4..d38170230ef065376a8d4f1e561ab6aa0e76ba1d 100644 (file)
@@ -152,6 +152,7 @@ sum_r16 (gfc_array_r16 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 235195aa88535e0e740d4e0e688fbbe390717f29..53787f959dfbe6cd24b8396e14c44974d39a1cb1 100644 (file)
@@ -152,6 +152,7 @@ sum_r4 (gfc_array_r4 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index d5c5bbbcac79e35f87e1961d80a188d7427c76c6..c4ab3ca8adf8cb2b7d8a822da7aa433f2e278f33 100644 (file)
@@ -152,6 +152,7 @@ sum_r8 (gfc_array_r8 * const restrict retarray,
 
   result += *src;
              }
+           
            *dest = result;
          }
       }
index 8c0978d3eb39ad8fb83b4ba0310d106b34a8225a..f33167b1a30a78a9e26dae83aab0d006bc03a735 100644 (file)
@@ -1115,6 +1115,15 @@ GFORTRAN_1.4 {
     _gfortran_bessel_yn_r8;
     _gfortran_bessel_yn_r10;
     _gfortran_bessel_yn_r16;
+    _gfortran_norm2_r4;
+    _gfortran_norm2_r8;
+    _gfortran_norm2_r10;
+    _gfortran_norm2_r16;
+    _gfortran_parity_l1;
+    _gfortran_parity_l2;
+    _gfortran_parity_l4;
+    _gfortran_parity_l8;
+    _gfortran_parity_l16;
 } GFORTRAN_1.3; 
 
 F2C_1.0 {
index 4dc4d1dc2a15e2516fb916c64f811d1fec5972e9..cc174207817d66cfbee6b33336390166323e8ac6 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the ALL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -39,6 +39,6 @@ ARRAY_FUNCTION(1,
     {
       result = 0;
       break;
-    }')`
+    }', `')`
 
 #endif'
index e2a22705faff1108affce5e0bd7b8f3a45b777ed..81ec31046f555bd32d86bd4358e8db392616c699 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the ANY intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -39,6 +39,6 @@ ARRAY_FUNCTION(0,
     {
       result = 1;
       break;
-    }')`
+    }', `')`
 
 #endif'
index 5a669954c50ed490421f3cdd856ca945a2c260df..5998c20e685fbaa334df1301f0f9a575eca08b72 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the COUNT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -35,6 +35,6 @@ include(ifunction_logical.m4)dnl
 ARRAY_FUNCTION(0,
 `  result = 0;',
 `  if (*src)
-    result++;')`
+    result++;', `')`
 
 #endif'
index 6c34eb9d7ae5cfecd22859360b42afc001e726e9..3d425e0108efc5cec511cb43f72210425f3f55eb 100644 (file)
@@ -1,6 +1,6 @@
 dnl Support macro file for intrinsic functions.
 dnl Contains the generic sections of the array functions.
-dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran)
+dnl This file is part of the GNU Fortran Runtime Library (libgfortran)
 dnl Distributed under the GNU GPL with exception.  See COPYING for details.
 dnl
 dnl Pass the implementation for a single section as the parameter to
@@ -140,6 +140,7 @@ define(START_ARRAY_BLOCK,
 ')dnl
 define(FINISH_ARRAY_FUNCTION,
 `            }
+           '$1`
            *dest = result;
          }
       }
@@ -496,7 +497,7 @@ define(ARRAY_FUNCTION,
 $2
 START_ARRAY_BLOCK($1)
 $3
-FINISH_ARRAY_FUNCTION')dnl
+FINISH_ARRAY_FUNCTION($4)')dnl
 define(MASKED_ARRAY_FUNCTION,
 `START_MASKED_ARRAY_FUNCTION
 $2
index 84b5a35c5c44ea47edf7ad2580369b8abe7f250b..44872ee61a0c1fc1f8061728a351ef33a223d829 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the MAXLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -56,7 +56,7 @@ ARRAY_FUNCTION(0,
                  {
                    maxval = *src;
                    result = (rtype_name)n + 1;
-                 }')
+                 }', `')
 
 MASKED_ARRAY_FUNCTION(0,
 `      atype_name maxval;
index 7557eb130a1cce2a3496362ad57732aad1f45439..15390688056b6598c92bcaa9b66c7a2ffa47978c 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the MAXVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -48,7 +48,7 @@ ARRAY_FUNCTION(atype_min,
              {
 #endif
                if (*src > result)
-                 result = *src;')
+                 result = *src;', `')
 
 MASKED_ARRAY_FUNCTION(atype_min,
 `#if defined ('atype_inf`)
index 6fa5e69ccc75d26842e101e03e590d1592c56a1b..e0bd3cd88ceda8e3c166602e82f29beba0f1d3ea 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -94,7 +94,7 @@ MASKED_ARRAY_FUNCTION(0,
                  {
                    minval = *src;
                    result = (rtype_name)n + 1;
-                 }')
+                 }', `')
 
 SCALAR_ARRAY_FUNCTION(0)
 
index 3acae2eaa88e647c7bb0e56f3bb295ffef511e44..037dd6725956684fccbe1f2d2c06e5800c210314 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the MINVAL intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -81,7 +81,7 @@ MASKED_ARRAY_FUNCTION(atype_max,
              {
 #endif
                if (*msrc && *src < result)
-                 result = *src;')
+                 result = *src;', `')
 
 SCALAR_ARRAY_FUNCTION(atype_max)
 
diff --git a/libgfortran/m4/norm2.m4 b/libgfortran/m4/norm2.m4
new file mode 100644 (file)
index 0000000..e1d6b97
--- /dev/null
@@ -0,0 +1,59 @@
+`/* Implementation of the NORM2 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 <math.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+include(`mtype.m4')dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(`0.0'Q,
+`      'rtype_name` scale;
+       result = 0.0'Q`;
+       scale = 1.0'Q`;',
+`        if (*src != 0.0'Q`)
+           {
+             'rtype_name` absX, val;
+             absX = fabs'q` (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1.0'Q` + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }',
+`   result = scale * sqrt'q` (result);')
+
+#endif
diff --git a/libgfortran/m4/parity.m4 b/libgfortran/m4/parity.m4
new file mode 100644 (file)
index 0000000..037e96d
--- /dev/null
@@ -0,0 +1,40 @@
+`/* Implementation of the NORM2 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 <math.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 = result != *src;', `')
+
+#endif
index 669b106e0c255e1f0d959d1ccb621435596506cc..6f6f2c01184398f9d52747f0f958f98f88385679 100644 (file)
@@ -1,8 +1,8 @@
 `/* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+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
@@ -34,7 +34,7 @@ include(ifunction.m4)dnl
 
 ARRAY_FUNCTION(1,
 `  result = 1;',
-`  result *= *src;')
+`  result *= *src;', `')
 
 MASKED_ARRAY_FUNCTION(1,
 `  result = 1;',