diff options
Diffstat (limited to 'libgfortran/generated/matmul_c8.c')
-rw-r--r-- | libgfortran/generated/matmul_c8.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c index 13a9e3720d3..be4ee6ce6b5 100644 --- a/libgfortran/generated/matmul_c8.c +++ b/libgfortran/generated/matmul_c8.c @@ -210,22 +210,39 @@ matmul_c8 (gfc_array_c8 * const restrict retarray, } else if (rxstride == 1 && aystride == 1 && bxstride == 1) { - const GFC_COMPLEX_8 *restrict abase_x; - const GFC_COMPLEX_8 *restrict bbase_y; - GFC_COMPLEX_8 *restrict dest_y; - GFC_COMPLEX_8 s; + if (GFC_DESCRIPTOR_RANK (a) != 1) + { + const GFC_COMPLEX_8 *restrict abase_x; + const GFC_COMPLEX_8 *restrict bbase_y; + GFC_COMPLEX_8 *restrict dest_y; + GFC_COMPLEX_8 s; - for (y = 0; y < ycount; y++) + for (y = 0; y < ycount; y++) + { + bbase_y = &bbase[y*bystride]; + dest_y = &dest[y*rystride]; + for (x = 0; x < xcount; x++) + { + abase_x = &abase[x*axstride]; + s = (GFC_COMPLEX_8) 0; + for (n = 0; n < count; n++) + s += abase_x[n] * bbase_y[n]; + dest_y[x] = s; + } + } + } + else { - bbase_y = &bbase[y*bystride]; - dest_y = &dest[y*rystride]; - for (x = 0; x < xcount; x++) + const GFC_COMPLEX_8 *restrict bbase_y; + GFC_COMPLEX_8 s; + + for (y = 0; y < ycount; y++) { - abase_x = &abase[x*axstride]; + bbase_y = &bbase[y*bystride]; s = (GFC_COMPLEX_8) 0; for (n = 0; n < count; n++) - s += abase_x[n] * bbase_y[n]; - dest_y[x] = s; + s += abase[n*axstride] * bbase_y[n]; + dest[y*rystride] = s; } } } |