]> gcc.gnu.org Git - gcc.git/blobdiff - libgfortran/generated/matmul_i16.c
re PR libfortran/21468 (vectorizing libfortran)
[gcc.git] / libgfortran / generated / matmul_i16.c
index adbfbedaeb2e5ba9341c056e0fe4e229d038c73a..a5a40b487f9aaedbbaa2754c2cdaf1b3d0197cf5 100644 (file)
@@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA.  */
          C(I,J) = C(I,J)+A(I,K)*B(K,J)
 */
 
-extern void matmul_i16 (gfc_array_i16 * retarray, gfc_array_i16 * a, gfc_array_i16 * b);
+extern void matmul_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict a, gfc_array_i16 * const restrict b);
 export_proto(matmul_i16);
 
 void
-matmul_i16 (gfc_array_i16 * retarray, gfc_array_i16 * a, gfc_array_i16 * b)
+matmul_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict a, gfc_array_i16 * const restrict b)
 {
-  GFC_INTEGER_16 *abase;
-  GFC_INTEGER_16 *bbase;
-  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_16 * restrict abase;
+  const GFC_INTEGER_16 * restrict bbase;
+  GFC_INTEGER_16 * restrict dest;
 
   index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
   index_type x, y, n, count, xcount, ycount;
@@ -105,12 +107,10 @@ matmul_i16 (gfc_array_i16 * retarray, gfc_array_i16 * a, gfc_array_i16 * b)
       retarray->offset = 0;
     }
 
-  abase = a->data;
-  bbase = b->data;
-  dest = retarray->data;
-
   if (retarray->dim[0].stride == 0)
     retarray->dim[0].stride = 1;
+
+  /* This prevents constifying the input arguments.  */
   if (a->dim[0].stride == 0)
     a->dim[0].stride = 1;
   if (b->dim[0].stride == 0)
@@ -175,9 +175,9 @@ matmul_i16 (gfc_array_i16 * retarray, gfc_array_i16 * a, gfc_array_i16 * b)
 
   if (rxstride == 1 && axstride == 1 && bxstride == 1)
     {
-      GFC_INTEGER_16 *bbase_y;
-      GFC_INTEGER_16 *dest_y;
-      GFC_INTEGER_16 *abase_n;
+      const GFC_INTEGER_16 * restrict bbase_y;
+      GFC_INTEGER_16 * restrict dest_y;
+      const GFC_INTEGER_16 * restrict abase_n;
       GFC_INTEGER_16 bbase_yn;
 
       if (rystride == ycount)
This page took 0.033444 seconds and 5 git commands to generate.