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;
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)
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)