sse4_1-roundps-1.c: Remove ASM_SUFFIX define.
[gcc.git] / libgfortran / generated / product_r16.c
index 71bc8cc0fdb2a4a1944b9713a7a02a832856c0a7..377bed61e5e4f1c12ecc74315c00ef84a2dc71c0 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -79,7 +79,7 @@ product_r16 (gfc_array_r16 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -97,9 +97,9 @@ product_r16 (gfc_array_r16 * const restrict retarray,
       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];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
       if (alloc_size == 0)
        {
          /* Make sure we have a zero-sized array.  */
@@ -107,8 +107,6 @@ product_r16 (gfc_array_r16 * const restrict retarray,
          return;
 
        }
-      else
-       retarray->data = internal_malloc_size (alloc_size);
     }
   else
     {
@@ -128,11 +126,11 @@ product_r16 (gfc_array_r16 * const restrict retarray,
       count[n] = 0;
       dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
       if (extent[n] <= 0)
-       len = 0;
+       return;
     }
 
-  base = array->data;
-  dest = retarray->data;
+  base = array->base_addr;
+  dest = retarray->base_addr;
 
   continue_loop = 1;
   while (continue_loop)
@@ -222,7 +220,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
   if (len <= 0)
     return;
 
-  mbase = mask->data;
+  mbase = mask->base_addr;
 
   mask_kind = GFC_DESCRIPTOR_SIZE (mask);
 
@@ -258,7 +256,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -273,8 +271,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
 
        }
 
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -286,7 +283,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
          return;
        }
       else
-       retarray->data = internal_malloc_size (alloc_size);
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
     }
   else
@@ -311,8 +308,8 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
        return;
     }
 
-  dest = retarray->data;
-  base = array->data;
+  dest = retarray->base_addr;
+  base = array->base_addr;
 
   while (base)
     {
@@ -324,18 +321,13 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
       {
 
   result = 1;
-       if (len <= 0)
-         *dest = 1;
-       else
+       for (n = 0; n < len; n++, src += delta, msrc += mdelta)
          {
-           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-             {
 
   if (*msrc)
     result *= *src;
-             }
-           *dest = result;
          }
+       *dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
@@ -418,7 +410,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -436,8 +428,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
       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];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
        {
@@ -446,7 +437,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
          return;
        }
       else
-       retarray->data = internal_malloc_size (alloc_size);
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
     }
   else
     {
@@ -478,7 +469,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
       dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
     }
 
-  dest = retarray->data;
+  dest = retarray->base_addr;
 
   while(1)
     {