diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-14 19:48:31 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-14 19:48:31 +0000 |
commit | 02013060b6833482f7f0f191caea397cbbae8758 (patch) | |
tree | ea9d35216d30a0f95f4bdaf4358cdd30d1cf0613 /libgfortran/generated | |
parent | c18d1f2a333abb4617c85222ac42d91a11af5f83 (diff) | |
download | gcc-02013060b6833482f7f0f191caea397cbbae8758.tar.gz |
2005-11-14 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/21468
* Makefile.am: Add -ftree-vectorize for compiling matmul.
* m4/matmul.m4: Add const and restrict to type declarations as
appropriate.
* m4/matmull.m4: Likewise.
* Makefile.in: Regenerated.
* generated/matmul_*.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106898 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated')
-rw-r--r-- | libgfortran/generated/matmul_c10.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_c16.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_c4.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_c8.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_i16.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_i4.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_i8.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_l16.c | 16 | ||||
-rw-r--r-- | libgfortran/generated/matmul_l4.c | 16 | ||||
-rw-r--r-- | libgfortran/generated/matmul_l8.c | 16 | ||||
-rw-r--r-- | libgfortran/generated/matmul_r10.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_r16.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_r4.c | 24 | ||||
-rw-r--r-- | libgfortran/generated/matmul_r8.c | 24 |
14 files changed, 159 insertions, 153 deletions
diff --git a/libgfortran/generated/matmul_c10.c b/libgfortran/generated/matmul_c10.c index 801649aa29d..44e734f0863 100644 --- a/libgfortran/generated/matmul_c10.c +++ b/libgfortran/generated/matmul_c10.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_c10 (gfc_array_c10 * retarray, gfc_array_c10 * a, gfc_array_c10 * b); +extern void matmul_c10 (gfc_array_c10 * const restrict retarray, + gfc_array_c10 * const restrict a, gfc_array_c10 * const restrict b); export_proto(matmul_c10); void -matmul_c10 (gfc_array_c10 * retarray, gfc_array_c10 * a, gfc_array_c10 * b) +matmul_c10 (gfc_array_c10 * const restrict retarray, + gfc_array_c10 * const restrict a, gfc_array_c10 * const restrict b) { - GFC_COMPLEX_10 *abase; - GFC_COMPLEX_10 *bbase; - GFC_COMPLEX_10 *dest; + const GFC_COMPLEX_10 * restrict abase; + const GFC_COMPLEX_10 * restrict bbase; + GFC_COMPLEX_10 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_c10 (gfc_array_c10 * retarray, gfc_array_c10 * a, gfc_array_c10 * 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_c10 (gfc_array_c10 * retarray, gfc_array_c10 * a, gfc_array_c10 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_COMPLEX_10 *bbase_y; - GFC_COMPLEX_10 *dest_y; - GFC_COMPLEX_10 *abase_n; + const GFC_COMPLEX_10 * restrict bbase_y; + GFC_COMPLEX_10 * restrict dest_y; + const GFC_COMPLEX_10 * restrict abase_n; GFC_COMPLEX_10 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_c16.c b/libgfortran/generated/matmul_c16.c index fb4870cba39..451ea82f6e8 100644 --- a/libgfortran/generated/matmul_c16.c +++ b/libgfortran/generated/matmul_c16.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_c16 (gfc_array_c16 * retarray, gfc_array_c16 * a, gfc_array_c16 * b); +extern void matmul_c16 (gfc_array_c16 * const restrict retarray, + gfc_array_c16 * const restrict a, gfc_array_c16 * const restrict b); export_proto(matmul_c16); void -matmul_c16 (gfc_array_c16 * retarray, gfc_array_c16 * a, gfc_array_c16 * b) +matmul_c16 (gfc_array_c16 * const restrict retarray, + gfc_array_c16 * const restrict a, gfc_array_c16 * const restrict b) { - GFC_COMPLEX_16 *abase; - GFC_COMPLEX_16 *bbase; - GFC_COMPLEX_16 *dest; + const GFC_COMPLEX_16 * restrict abase; + const GFC_COMPLEX_16 * restrict bbase; + GFC_COMPLEX_16 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_c16 (gfc_array_c16 * retarray, gfc_array_c16 * a, gfc_array_c16 * 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_c16 (gfc_array_c16 * retarray, gfc_array_c16 * a, gfc_array_c16 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_COMPLEX_16 *bbase_y; - GFC_COMPLEX_16 *dest_y; - GFC_COMPLEX_16 *abase_n; + const GFC_COMPLEX_16 * restrict bbase_y; + GFC_COMPLEX_16 * restrict dest_y; + const GFC_COMPLEX_16 * restrict abase_n; GFC_COMPLEX_16 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_c4.c b/libgfortran/generated/matmul_c4.c index 8c9a7104ca8..5e59f1dafdc 100644 --- a/libgfortran/generated/matmul_c4.c +++ b/libgfortran/generated/matmul_c4.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_c4 (gfc_array_c4 * retarray, gfc_array_c4 * a, gfc_array_c4 * b); +extern void matmul_c4 (gfc_array_c4 * const restrict retarray, + gfc_array_c4 * const restrict a, gfc_array_c4 * const restrict b); export_proto(matmul_c4); void -matmul_c4 (gfc_array_c4 * retarray, gfc_array_c4 * a, gfc_array_c4 * b) +matmul_c4 (gfc_array_c4 * const restrict retarray, + gfc_array_c4 * const restrict a, gfc_array_c4 * const restrict b) { - GFC_COMPLEX_4 *abase; - GFC_COMPLEX_4 *bbase; - GFC_COMPLEX_4 *dest; + const GFC_COMPLEX_4 * restrict abase; + const GFC_COMPLEX_4 * restrict bbase; + GFC_COMPLEX_4 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_c4 (gfc_array_c4 * retarray, gfc_array_c4 * a, gfc_array_c4 * 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_c4 (gfc_array_c4 * retarray, gfc_array_c4 * a, gfc_array_c4 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_COMPLEX_4 *bbase_y; - GFC_COMPLEX_4 *dest_y; - GFC_COMPLEX_4 *abase_n; + const GFC_COMPLEX_4 * restrict bbase_y; + GFC_COMPLEX_4 * restrict dest_y; + const GFC_COMPLEX_4 * restrict abase_n; GFC_COMPLEX_4 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c index 7b713f1343a..cdf10e20461 100644 --- a/libgfortran/generated/matmul_c8.c +++ b/libgfortran/generated/matmul_c8.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_c8 (gfc_array_c8 * retarray, gfc_array_c8 * a, gfc_array_c8 * b); +extern void matmul_c8 (gfc_array_c8 * const restrict retarray, + gfc_array_c8 * const restrict a, gfc_array_c8 * const restrict b); export_proto(matmul_c8); void -matmul_c8 (gfc_array_c8 * retarray, gfc_array_c8 * a, gfc_array_c8 * b) +matmul_c8 (gfc_array_c8 * const restrict retarray, + gfc_array_c8 * const restrict a, gfc_array_c8 * const restrict b) { - GFC_COMPLEX_8 *abase; - GFC_COMPLEX_8 *bbase; - GFC_COMPLEX_8 *dest; + const GFC_COMPLEX_8 * restrict abase; + const GFC_COMPLEX_8 * restrict bbase; + GFC_COMPLEX_8 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_c8 (gfc_array_c8 * retarray, gfc_array_c8 * a, gfc_array_c8 * 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_c8 (gfc_array_c8 * retarray, gfc_array_c8 * a, gfc_array_c8 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_COMPLEX_8 *bbase_y; - GFC_COMPLEX_8 *dest_y; - GFC_COMPLEX_8 *abase_n; + const GFC_COMPLEX_8 * restrict bbase_y; + GFC_COMPLEX_8 * restrict dest_y; + const GFC_COMPLEX_8 * restrict abase_n; GFC_COMPLEX_8 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_i16.c b/libgfortran/generated/matmul_i16.c index adbfbedaeb2..a5a40b487f9 100644 --- a/libgfortran/generated/matmul_i16.c +++ b/libgfortran/generated/matmul_i16.c @@ -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) diff --git a/libgfortran/generated/matmul_i4.c b/libgfortran/generated/matmul_i4.c index abace324d95..dca23987e71 100644 --- a/libgfortran/generated/matmul_i4.c +++ b/libgfortran/generated/matmul_i4.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_i4 (gfc_array_i4 * retarray, gfc_array_i4 * a, gfc_array_i4 * b); +extern void matmul_i4 (gfc_array_i4 * const restrict retarray, + gfc_array_i4 * const restrict a, gfc_array_i4 * const restrict b); export_proto(matmul_i4); void -matmul_i4 (gfc_array_i4 * retarray, gfc_array_i4 * a, gfc_array_i4 * b) +matmul_i4 (gfc_array_i4 * const restrict retarray, + gfc_array_i4 * const restrict a, gfc_array_i4 * const restrict b) { - GFC_INTEGER_4 *abase; - GFC_INTEGER_4 *bbase; - GFC_INTEGER_4 *dest; + const GFC_INTEGER_4 * restrict abase; + const GFC_INTEGER_4 * restrict bbase; + GFC_INTEGER_4 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_i4 (gfc_array_i4 * retarray, gfc_array_i4 * a, gfc_array_i4 * 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_i4 (gfc_array_i4 * retarray, gfc_array_i4 * a, gfc_array_i4 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_INTEGER_4 *bbase_y; - GFC_INTEGER_4 *dest_y; - GFC_INTEGER_4 *abase_n; + const GFC_INTEGER_4 * restrict bbase_y; + GFC_INTEGER_4 * restrict dest_y; + const GFC_INTEGER_4 * restrict abase_n; GFC_INTEGER_4 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c index 9820e405cd0..ceadbe3c801 100644 --- a/libgfortran/generated/matmul_i8.c +++ b/libgfortran/generated/matmul_i8.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * b); +extern void matmul_i8 (gfc_array_i8 * const restrict retarray, + gfc_array_i8 * const restrict a, gfc_array_i8 * const restrict b); export_proto(matmul_i8); void -matmul_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * b) +matmul_i8 (gfc_array_i8 * const restrict retarray, + gfc_array_i8 * const restrict a, gfc_array_i8 * const restrict b) { - GFC_INTEGER_8 *abase; - GFC_INTEGER_8 *bbase; - GFC_INTEGER_8 *dest; + const GFC_INTEGER_8 * restrict abase; + const GFC_INTEGER_8 * restrict bbase; + GFC_INTEGER_8 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * 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_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_INTEGER_8 *bbase_y; - GFC_INTEGER_8 *dest_y; - GFC_INTEGER_8 *abase_n; + const GFC_INTEGER_8 * restrict bbase_y; + GFC_INTEGER_8 * restrict dest_y; + const GFC_INTEGER_8 * restrict abase_n; GFC_INTEGER_8 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_l16.c b/libgfortran/generated/matmul_l16.c index 28dce3a2422..caa1b11910e 100644 --- a/libgfortran/generated/matmul_l16.c +++ b/libgfortran/generated/matmul_l16.c @@ -38,15 +38,17 @@ Boston, MA 02110-1301, USA. */ /* Dimensions: retarray(x,y) a(x, count) b(count,y). Either a or b can be rank 1. In this case x or y is 1. */ -extern void matmul_l16 (gfc_array_l16 *, gfc_array_l4 *, gfc_array_l4 *); +extern void matmul_l16 (gfc_array_l16 * const restrict, + gfc_array_l4 * const restrict, gfc_array_l4 * const restrict); export_proto(matmul_l16); void -matmul_l16 (gfc_array_l16 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) +matmul_l16 (gfc_array_l16 * const restrict retarray, + gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b) { - GFC_INTEGER_4 *abase; - GFC_INTEGER_4 *bbase; - GFC_LOGICAL_16 *dest; + const GFC_INTEGER_4 * restrict abase; + const GFC_INTEGER_4 * restrict bbase; + GFC_LOGICAL_16 * restrict dest; index_type rxstride; index_type rystride; index_type xcount; @@ -56,8 +58,8 @@ matmul_l16 (gfc_array_l16 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) index_type x; index_type y; - GFC_INTEGER_4 *pa; - GFC_INTEGER_4 *pb; + const GFC_INTEGER_4 * restrict pa; + const GFC_INTEGER_4 * restrict pb; index_type astride; index_type bstride; index_type count; diff --git a/libgfortran/generated/matmul_l4.c b/libgfortran/generated/matmul_l4.c index da6681479a5..9a89113bbc6 100644 --- a/libgfortran/generated/matmul_l4.c +++ b/libgfortran/generated/matmul_l4.c @@ -38,15 +38,17 @@ Boston, MA 02110-1301, USA. */ /* Dimensions: retarray(x,y) a(x, count) b(count,y). Either a or b can be rank 1. In this case x or y is 1. */ -extern void matmul_l4 (gfc_array_l4 *, gfc_array_l4 *, gfc_array_l4 *); +extern void matmul_l4 (gfc_array_l4 * const restrict, + gfc_array_l4 * const restrict, gfc_array_l4 * const restrict); export_proto(matmul_l4); void -matmul_l4 (gfc_array_l4 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) +matmul_l4 (gfc_array_l4 * const restrict retarray, + gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b) { - GFC_INTEGER_4 *abase; - GFC_INTEGER_4 *bbase; - GFC_LOGICAL_4 *dest; + const GFC_INTEGER_4 * restrict abase; + const GFC_INTEGER_4 * restrict bbase; + GFC_LOGICAL_4 * restrict dest; index_type rxstride; index_type rystride; index_type xcount; @@ -56,8 +58,8 @@ matmul_l4 (gfc_array_l4 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) index_type x; index_type y; - GFC_INTEGER_4 *pa; - GFC_INTEGER_4 *pb; + const GFC_INTEGER_4 * restrict pa; + const GFC_INTEGER_4 * restrict pb; index_type astride; index_type bstride; index_type count; diff --git a/libgfortran/generated/matmul_l8.c b/libgfortran/generated/matmul_l8.c index 22c1a660941..bd01f1642d3 100644 --- a/libgfortran/generated/matmul_l8.c +++ b/libgfortran/generated/matmul_l8.c @@ -38,15 +38,17 @@ Boston, MA 02110-1301, USA. */ /* Dimensions: retarray(x,y) a(x, count) b(count,y). Either a or b can be rank 1. In this case x or y is 1. */ -extern void matmul_l8 (gfc_array_l8 *, gfc_array_l4 *, gfc_array_l4 *); +extern void matmul_l8 (gfc_array_l8 * const restrict, + gfc_array_l4 * const restrict, gfc_array_l4 * const restrict); export_proto(matmul_l8); void -matmul_l8 (gfc_array_l8 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) +matmul_l8 (gfc_array_l8 * const restrict retarray, + gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b) { - GFC_INTEGER_4 *abase; - GFC_INTEGER_4 *bbase; - GFC_LOGICAL_8 *dest; + const GFC_INTEGER_4 * restrict abase; + const GFC_INTEGER_4 * restrict bbase; + GFC_LOGICAL_8 * restrict dest; index_type rxstride; index_type rystride; index_type xcount; @@ -56,8 +58,8 @@ matmul_l8 (gfc_array_l8 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) index_type x; index_type y; - GFC_INTEGER_4 *pa; - GFC_INTEGER_4 *pb; + const GFC_INTEGER_4 * restrict pa; + const GFC_INTEGER_4 * restrict pb; index_type astride; index_type bstride; index_type count; diff --git a/libgfortran/generated/matmul_r10.c b/libgfortran/generated/matmul_r10.c index 8aa342da2f4..b0ebbeda6c4 100644 --- a/libgfortran/generated/matmul_r10.c +++ b/libgfortran/generated/matmul_r10.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_r10 (gfc_array_r10 * retarray, gfc_array_r10 * a, gfc_array_r10 * b); +extern void matmul_r10 (gfc_array_r10 * const restrict retarray, + gfc_array_r10 * const restrict a, gfc_array_r10 * const restrict b); export_proto(matmul_r10); void -matmul_r10 (gfc_array_r10 * retarray, gfc_array_r10 * a, gfc_array_r10 * b) +matmul_r10 (gfc_array_r10 * const restrict retarray, + gfc_array_r10 * const restrict a, gfc_array_r10 * const restrict b) { - GFC_REAL_10 *abase; - GFC_REAL_10 *bbase; - GFC_REAL_10 *dest; + const GFC_REAL_10 * restrict abase; + const GFC_REAL_10 * restrict bbase; + GFC_REAL_10 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_r10 (gfc_array_r10 * retarray, gfc_array_r10 * a, gfc_array_r10 * 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_r10 (gfc_array_r10 * retarray, gfc_array_r10 * a, gfc_array_r10 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_REAL_10 *bbase_y; - GFC_REAL_10 *dest_y; - GFC_REAL_10 *abase_n; + const GFC_REAL_10 * restrict bbase_y; + GFC_REAL_10 * restrict dest_y; + const GFC_REAL_10 * restrict abase_n; GFC_REAL_10 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_r16.c b/libgfortran/generated/matmul_r16.c index 549f39ea6ca..313f8d2d6d8 100644 --- a/libgfortran/generated/matmul_r16.c +++ b/libgfortran/generated/matmul_r16.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_r16 (gfc_array_r16 * retarray, gfc_array_r16 * a, gfc_array_r16 * b); +extern void matmul_r16 (gfc_array_r16 * const restrict retarray, + gfc_array_r16 * const restrict a, gfc_array_r16 * const restrict b); export_proto(matmul_r16); void -matmul_r16 (gfc_array_r16 * retarray, gfc_array_r16 * a, gfc_array_r16 * b) +matmul_r16 (gfc_array_r16 * const restrict retarray, + gfc_array_r16 * const restrict a, gfc_array_r16 * const restrict b) { - GFC_REAL_16 *abase; - GFC_REAL_16 *bbase; - GFC_REAL_16 *dest; + const GFC_REAL_16 * restrict abase; + const GFC_REAL_16 * restrict bbase; + GFC_REAL_16 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_r16 (gfc_array_r16 * retarray, gfc_array_r16 * a, gfc_array_r16 * 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_r16 (gfc_array_r16 * retarray, gfc_array_r16 * a, gfc_array_r16 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_REAL_16 *bbase_y; - GFC_REAL_16 *dest_y; - GFC_REAL_16 *abase_n; + const GFC_REAL_16 * restrict bbase_y; + GFC_REAL_16 * restrict dest_y; + const GFC_REAL_16 * restrict abase_n; GFC_REAL_16 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_r4.c b/libgfortran/generated/matmul_r4.c index b1d3eb77c9d..74a4e1c23b9 100644 --- a/libgfortran/generated/matmul_r4.c +++ b/libgfortran/generated/matmul_r4.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_r4 (gfc_array_r4 * retarray, gfc_array_r4 * a, gfc_array_r4 * b); +extern void matmul_r4 (gfc_array_r4 * const restrict retarray, + gfc_array_r4 * const restrict a, gfc_array_r4 * const restrict b); export_proto(matmul_r4); void -matmul_r4 (gfc_array_r4 * retarray, gfc_array_r4 * a, gfc_array_r4 * b) +matmul_r4 (gfc_array_r4 * const restrict retarray, + gfc_array_r4 * const restrict a, gfc_array_r4 * const restrict b) { - GFC_REAL_4 *abase; - GFC_REAL_4 *bbase; - GFC_REAL_4 *dest; + const GFC_REAL_4 * restrict abase; + const GFC_REAL_4 * restrict bbase; + GFC_REAL_4 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_r4 (gfc_array_r4 * retarray, gfc_array_r4 * a, gfc_array_r4 * 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_r4 (gfc_array_r4 * retarray, gfc_array_r4 * a, gfc_array_r4 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_REAL_4 *bbase_y; - GFC_REAL_4 *dest_y; - GFC_REAL_4 *abase_n; + const GFC_REAL_4 * restrict bbase_y; + GFC_REAL_4 * restrict dest_y; + const GFC_REAL_4 * restrict abase_n; GFC_REAL_4 bbase_yn; if (rystride == ycount) diff --git a/libgfortran/generated/matmul_r8.c b/libgfortran/generated/matmul_r8.c index df9fc3e6a0e..72560f111d4 100644 --- a/libgfortran/generated/matmul_r8.c +++ b/libgfortran/generated/matmul_r8.c @@ -48,15 +48,17 @@ Boston, MA 02110-1301, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ -extern void matmul_r8 (gfc_array_r8 * retarray, gfc_array_r8 * a, gfc_array_r8 * b); +extern void matmul_r8 (gfc_array_r8 * const restrict retarray, + gfc_array_r8 * const restrict a, gfc_array_r8 * const restrict b); export_proto(matmul_r8); void -matmul_r8 (gfc_array_r8 * retarray, gfc_array_r8 * a, gfc_array_r8 * b) +matmul_r8 (gfc_array_r8 * const restrict retarray, + gfc_array_r8 * const restrict a, gfc_array_r8 * const restrict b) { - GFC_REAL_8 *abase; - GFC_REAL_8 *bbase; - GFC_REAL_8 *dest; + const GFC_REAL_8 * restrict abase; + const GFC_REAL_8 * restrict bbase; + GFC_REAL_8 * restrict dest; index_type rxstride, rystride, axstride, aystride, bxstride, bystride; index_type x, y, n, count, xcount, ycount; @@ -105,12 +107,10 @@ matmul_r8 (gfc_array_r8 * retarray, gfc_array_r8 * a, gfc_array_r8 * 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_r8 (gfc_array_r8 * retarray, gfc_array_r8 * a, gfc_array_r8 * b) if (rxstride == 1 && axstride == 1 && bxstride == 1) { - GFC_REAL_8 *bbase_y; - GFC_REAL_8 *dest_y; - GFC_REAL_8 *abase_n; + const GFC_REAL_8 * restrict bbase_y; + GFC_REAL_8 * restrict dest_y; + const GFC_REAL_8 * restrict abase_n; GFC_REAL_8 bbase_yn; if (rystride == ycount) |