From: tkoenig Date: Sat, 25 Aug 2018 21:31:30 +0000 (+0000) Subject: 2018-08-25 Thomas Koenig X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6733e793a09b4af7fd9935c0750db33d8b29464;p=thirdparty%2Fgcc.git 2018-08-25 Thomas Koenig PR libfortran/86704 * m4/matmul_internal.m4: Correct calculation of needed buffer size for arrays of shape (1,n). * generated/matmul_c10.c: Regenerated * generated/matmul_c16.c: Regenerated * generated/matmul_c4.c: Regenerated * generated/matmul_c8.c: Regenerated * generated/matmul_i1.c: Regenerated * generated/matmul_i16.c: Regenerated * generated/matmul_i2.c: Regenerated * generated/matmul_i4.c: Regenerated * generated/matmul_i8.c: Regenerated * generated/matmul_r10.c: Regenerated * generated/matmul_r16.c: Regenerated * generated/matmul_r4.c: Regenerated * generated/matmul_r8.c: Regenerated * generated/matmulavx128_c10.c: Regenerated * generated/matmulavx128_c16.c: Regenerated * generated/matmulavx128_c4.c: Regenerated * generated/matmulavx128_c8.c: Regenerated * generated/matmulavx128_i1.c: Regenerated * generated/matmulavx128_i16.c: Regenerated * generated/matmulavx128_i2.c: Regenerated * generated/matmulavx128_i4.c: Regenerated * generated/matmulavx128_i8.c: Regenerated * generated/matmulavx128_r10.c: Regenerated * generated/matmulavx128_r16.c: Regenerated * generated/matmulavx128_r4.c: Regenerated * generated/matmulavx128_r8.c: Regenerated 2018-08-25 Thomas Koenig PR libfortran/86704 * gfortran.dg/matmul_19.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263856 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 13601d2de3bf..67f4cdedbb04 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-25 Thomas Koenig + + PR libfortran/86704 + * gfortran.dg/matmul_19.f90: New test. + 2018-08-25 Janus Weil PR fortran/86545 diff --git a/gcc/testsuite/gfortran.dg/matmul_19.f90 b/gcc/testsuite/gfortran.dg/matmul_19.f90 new file mode 100644 index 000000000000..c4549240c1f5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/matmul_19.f90 @@ -0,0 +1,25 @@ +! { dg-do run } +! { dg-options "-finline-matmul-limit=0" } +! PR 86704 - this used to segfault. + +program testmaticovenasobeni +implicit none + + character(len=10) :: line + write (unit=line,fmt=*) testmatmul(120,1,3) + + contains + + function testmatmul(m,n,o) + integer, intent(in) :: m,n,o + real :: A(n,m),B(n,o),C(m,o) + logical :: testmatmul + + call random_number(A) + call random_number(B) + + C=matmul(transpose(A),B) + testmatmul=.true. + end function + +end program testmaticovenasobeni diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 60bb94c86263..76228e26b693 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,35 @@ +2018-08-25 Thomas Koenig + + PR libfortran/86704 + * m4/matmul_internal.m4: Correct calculation of needed buffer size + for arrays of shape (1,n). + * generated/matmul_c10.c: Regenerated + * generated/matmul_c16.c: Regenerated + * generated/matmul_c4.c: Regenerated + * generated/matmul_c8.c: Regenerated + * generated/matmul_i1.c: Regenerated + * generated/matmul_i16.c: Regenerated + * generated/matmul_i2.c: Regenerated + * generated/matmul_i4.c: Regenerated + * generated/matmul_i8.c: Regenerated + * generated/matmul_r10.c: Regenerated + * generated/matmul_r16.c: Regenerated + * generated/matmul_r4.c: Regenerated + * generated/matmul_r8.c: Regenerated + * generated/matmulavx128_c10.c: Regenerated + * generated/matmulavx128_c16.c: Regenerated + * generated/matmulavx128_c4.c: Regenerated + * generated/matmulavx128_c8.c: Regenerated + * generated/matmulavx128_i1.c: Regenerated + * generated/matmulavx128_i16.c: Regenerated + * generated/matmulavx128_i2.c: Regenerated + * generated/matmulavx128_i4.c: Regenerated + * generated/matmulavx128_i8.c: Regenerated + * generated/matmulavx128_r10.c: Regenerated + * generated/matmulavx128_r16.c: Regenerated + * generated/matmulavx128_r4.c: Regenerated + * generated/matmulavx128_r8.c: Regenerated + 2018-08-23 David Edelsohn * async.h (ASYNC_IO): Revert _AIX test. diff --git a/libgfortran/generated/matmul_c10.c b/libgfortran/generated/matmul_c10.c index 7cd8a6d2a0dc..462d71e23f5a 100644 --- a/libgfortran/generated/matmul_c10.c +++ b/libgfortran/generated/matmul_c10.c @@ -317,8 +317,13 @@ matmul_c10_avx (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_c10_avx2 (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_c10_avx512f (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_c10_vanilla (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_c10 (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_c16.c b/libgfortran/generated/matmul_c16.c index d93099ea71e4..2062739ce1f4 100644 --- a/libgfortran/generated/matmul_c16.c +++ b/libgfortran/generated/matmul_c16.c @@ -317,8 +317,13 @@ matmul_c16_avx (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_c16_avx2 (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_c16_avx512f (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_c16_vanilla (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_c16 (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_c4.c b/libgfortran/generated/matmul_c4.c index eeef3699dcd8..91d193dca375 100644 --- a/libgfortran/generated/matmul_c4.c +++ b/libgfortran/generated/matmul_c4.c @@ -317,8 +317,13 @@ matmul_c4_avx (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_c4_avx2 (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_c4_avx512f (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_c4_vanilla (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_c4 (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c index 7a73f6719386..425af85d1bba 100644 --- a/libgfortran/generated/matmul_c8.c +++ b/libgfortran/generated/matmul_c8.c @@ -317,8 +317,13 @@ matmul_c8_avx (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_c8_avx2 (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_c8_avx512f (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_c8_vanilla (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_c8 (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_i1.c b/libgfortran/generated/matmul_i1.c index f3559163bee4..0c9335d4322f 100644 --- a/libgfortran/generated/matmul_i1.c +++ b/libgfortran/generated/matmul_i1.c @@ -317,8 +317,13 @@ matmul_i1_avx (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_i1_avx2 (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_i1_avx512f (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_i1_vanilla (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_i1 (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_i16.c b/libgfortran/generated/matmul_i16.c index c8a08eb8e602..b9334b3278fd 100644 --- a/libgfortran/generated/matmul_i16.c +++ b/libgfortran/generated/matmul_i16.c @@ -317,8 +317,13 @@ matmul_i16_avx (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_i16_avx2 (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_i16_avx512f (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_i16_vanilla (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_i16 (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_i2.c b/libgfortran/generated/matmul_i2.c index ae8a45978b0d..e4246e948df6 100644 --- a/libgfortran/generated/matmul_i2.c +++ b/libgfortran/generated/matmul_i2.c @@ -317,8 +317,13 @@ matmul_i2_avx (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_i2_avx2 (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_i2_avx512f (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_i2_vanilla (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_i2 (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_i4.c b/libgfortran/generated/matmul_i4.c index 9a3822b754a3..78cf27c4fcdb 100644 --- a/libgfortran/generated/matmul_i4.c +++ b/libgfortran/generated/matmul_i4.c @@ -317,8 +317,13 @@ matmul_i4_avx (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_i4_avx2 (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_i4_avx512f (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_i4_vanilla (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_i4 (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c index 88bfd62923fa..cf8c401400df 100644 --- a/libgfortran/generated/matmul_i8.c +++ b/libgfortran/generated/matmul_i8.c @@ -317,8 +317,13 @@ matmul_i8_avx (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_i8_avx2 (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_i8_avx512f (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_i8_vanilla (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_i8 (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_r10.c b/libgfortran/generated/matmul_r10.c index d4f13114734f..e4309c80a6b4 100644 --- a/libgfortran/generated/matmul_r10.c +++ b/libgfortran/generated/matmul_r10.c @@ -317,8 +317,13 @@ matmul_r10_avx (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_r10_avx2 (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_r10_avx512f (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_r10_vanilla (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_r10 (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_r16.c b/libgfortran/generated/matmul_r16.c index f56d1c3066dd..1ab554660d7d 100644 --- a/libgfortran/generated/matmul_r16.c +++ b/libgfortran/generated/matmul_r16.c @@ -317,8 +317,13 @@ matmul_r16_avx (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_r16_avx2 (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_r16_avx512f (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_r16_vanilla (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_r16 (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_r4.c b/libgfortran/generated/matmul_r4.c index a5677b96969f..97dba9825b1f 100644 --- a/libgfortran/generated/matmul_r4.c +++ b/libgfortran/generated/matmul_r4.c @@ -317,8 +317,13 @@ matmul_r4_avx (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_r4_avx2 (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_r4_avx512f (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_r4_vanilla (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_r4 (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmul_r8.c b/libgfortran/generated/matmul_r8.c index d9acdd9d92f9..5e4c9500260f 100644 --- a/libgfortran/generated/matmul_r8.c +++ b/libgfortran/generated/matmul_r8.c @@ -317,8 +317,13 @@ matmul_r8_avx (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -869,8 +874,13 @@ matmul_r8_avx2 (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1421,8 +1431,13 @@ matmul_r8_avx512f (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -1987,8 +2002,13 @@ matmul_r8_vanilla (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -2613,8 +2633,13 @@ matmul_r8 (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_c10.c b/libgfortran/generated/matmulavx128_c10.c index 69ad45b334cc..5cb0f6ad6f35 100644 --- a/libgfortran/generated/matmulavx128_c10.c +++ b/libgfortran/generated/matmulavx128_c10.c @@ -282,8 +282,13 @@ matmul_c10_avx128_fma3 (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_c10_avx128_fma4 (gfc_array_c10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_c16.c b/libgfortran/generated/matmulavx128_c16.c index 0bf8ba3f5991..66272fefaf91 100644 --- a/libgfortran/generated/matmulavx128_c16.c +++ b/libgfortran/generated/matmulavx128_c16.c @@ -282,8 +282,13 @@ matmul_c16_avx128_fma3 (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_c16_avx128_fma4 (gfc_array_c16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_c4.c b/libgfortran/generated/matmulavx128_c4.c index 0763d5d1707a..f6e06e2e88f3 100644 --- a/libgfortran/generated/matmulavx128_c4.c +++ b/libgfortran/generated/matmulavx128_c4.c @@ -282,8 +282,13 @@ matmul_c4_avx128_fma3 (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_c4_avx128_fma4 (gfc_array_c4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_c8.c b/libgfortran/generated/matmulavx128_c8.c index d440784c285c..accc69c4d1a2 100644 --- a/libgfortran/generated/matmulavx128_c8.c +++ b/libgfortran/generated/matmulavx128_c8.c @@ -282,8 +282,13 @@ matmul_c8_avx128_fma3 (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_c8_avx128_fma4 (gfc_array_c8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_i1.c b/libgfortran/generated/matmulavx128_i1.c index efa346145446..48b15c8074a6 100644 --- a/libgfortran/generated/matmulavx128_i1.c +++ b/libgfortran/generated/matmulavx128_i1.c @@ -282,8 +282,13 @@ matmul_i1_avx128_fma3 (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_i1_avx128_fma4 (gfc_array_i1 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_i16.c b/libgfortran/generated/matmulavx128_i16.c index 3c0e6064efe4..319321eca492 100644 --- a/libgfortran/generated/matmulavx128_i16.c +++ b/libgfortran/generated/matmulavx128_i16.c @@ -282,8 +282,13 @@ matmul_i16_avx128_fma3 (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_i16_avx128_fma4 (gfc_array_i16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_i2.c b/libgfortran/generated/matmulavx128_i2.c index 1da7f25189f0..4d8945b10a24 100644 --- a/libgfortran/generated/matmulavx128_i2.c +++ b/libgfortran/generated/matmulavx128_i2.c @@ -282,8 +282,13 @@ matmul_i2_avx128_fma3 (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_i2_avx128_fma4 (gfc_array_i2 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_i4.c b/libgfortran/generated/matmulavx128_i4.c index ca7de54b9b81..acaa00a30bbe 100644 --- a/libgfortran/generated/matmulavx128_i4.c +++ b/libgfortran/generated/matmulavx128_i4.c @@ -282,8 +282,13 @@ matmul_i4_avx128_fma3 (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_i4_avx128_fma4 (gfc_array_i4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_i8.c b/libgfortran/generated/matmulavx128_i8.c index 731e55d2f630..56e85167a3f9 100644 --- a/libgfortran/generated/matmulavx128_i8.c +++ b/libgfortran/generated/matmulavx128_i8.c @@ -282,8 +282,13 @@ matmul_i8_avx128_fma3 (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_i8_avx128_fma4 (gfc_array_i8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_r10.c b/libgfortran/generated/matmulavx128_r10.c index 190e41cbb713..880c9d921b2b 100644 --- a/libgfortran/generated/matmulavx128_r10.c +++ b/libgfortran/generated/matmulavx128_r10.c @@ -282,8 +282,13 @@ matmul_r10_avx128_fma3 (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_r10_avx128_fma4 (gfc_array_r10 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_r16.c b/libgfortran/generated/matmulavx128_r16.c index 2994ed311fe4..328e251a3a11 100644 --- a/libgfortran/generated/matmulavx128_r16.c +++ b/libgfortran/generated/matmulavx128_r16.c @@ -282,8 +282,13 @@ matmul_r16_avx128_fma3 (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_r16_avx128_fma4 (gfc_array_r16 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_r4.c b/libgfortran/generated/matmulavx128_r4.c index 4f18b5006d8a..013a1804a11d 100644 --- a/libgfortran/generated/matmulavx128_r4.c +++ b/libgfortran/generated/matmulavx128_r4.c @@ -282,8 +282,13 @@ matmul_r4_avx128_fma3 (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_r4_avx128_fma4 (gfc_array_r4 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/generated/matmulavx128_r8.c b/libgfortran/generated/matmulavx128_r8.c index 443d7426f4ff..4da59f9e69c7 100644 --- a/libgfortran/generated/matmulavx128_r8.c +++ b/libgfortran/generated/matmulavx128_r8.c @@ -282,8 +282,13 @@ matmul_r8_avx128_fma3 (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; @@ -835,8 +840,13 @@ matmul_r8_avx128_fma4 (gfc_array_r8 * const restrict retarray, return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536; diff --git a/libgfortran/m4/matmul_internal.m4 b/libgfortran/m4/matmul_internal.m4 index 6860f606122e..2020e8a50dfe 100644 --- a/libgfortran/m4/matmul_internal.m4 +++ b/libgfortran/m4/matmul_internal.m4 @@ -233,8 +233,13 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl return; /* Adjust size of t1 to what is needed. */ - index_type t1_dim; - t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1; + index_type t1_dim, a_sz; + if (aystride == 1) + a_sz = rystride; + else + a_sz = a_dim1; + + t1_dim = a_sz * 256 + b_dim1; if (t1_dim > 65536) t1_dim = 65536;