diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2018-08-25 21:31:30 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2018-08-25 21:31:30 +0000 |
commit | 4f4fabd73312efba10f80f132d2ce59a292ddd97 (patch) | |
tree | 332d44ca7342e070ab53768b1c83f53df8006a76 /libgfortran/generated | |
parent | 75e96bc80cf32a302c27bdbbec1ec7119a690857 (diff) | |
download | gcc-4f4fabd73312efba10f80f132d2ce59a292ddd97.zip gcc-4f4fabd73312efba10f80f132d2ce59a292ddd97.tar.gz gcc-4f4fabd73312efba10f80f132d2ce59a292ddd97.tar.bz2 |
re PR fortran/86704 (Segmentation fault when using matmul in combination with transpose)
2018-08-25 Thomas Koenig <tkoenig@gcc.gnu.org>
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 <tkoenig@gcc.gnu.org>
PR libfortran/86704
* gfortran.dg/matmul_19.f90: New test.
From-SVN: r263856
Diffstat (limited to 'libgfortran/generated')
26 files changed, 637 insertions, 182 deletions
diff --git a/libgfortran/generated/matmul_c10.c b/libgfortran/generated/matmul_c10.c index 7cd8a6d..462d71e 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 d93099e..2062739 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 eeef369..91d193d 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 7a73f67..425af85 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 f355916..0c9335d 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 c8a08eb..b9334b3 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 ae8a459..e4246e9 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 9a3822b..78cf27c 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 88bfd62..cf8c401 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 d4f1311..e4309c8 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 f56d1c3..1ab5546 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 a5677b9..97dba98 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 d9acdd9..5e4c950 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 69ad45b..5cb0f6a 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 0bf8ba3..66272fe 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 0763d5d..f6e06e2 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 d440784..accc69c 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 efa3461..48b15c8 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 3c0e606..319321e 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 1da7f25..4d8945b 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 ca7de54..acaa00a 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 731e55d..56e8516 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 190e41c..880c9d9 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 2994ed3..328e251 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 4f18b50..013a180 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 443d742..4da59f9 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; |