aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/generated/matmul_l16.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/matmul_l16.c')
-rw-r--r--libgfortran/generated/matmul_l16.c65
1 files changed, 40 insertions, 25 deletions
diff --git a/libgfortran/generated/matmul_l16.c b/libgfortran/generated/matmul_l16.c
index 7e7f2f9c658..b2b86ecfed1 100644
--- a/libgfortran/generated/matmul_l16.c
+++ b/libgfortran/generated/matmul_l16.c
@@ -1,5 +1,5 @@
/* Implementation of the MATMUL intrinsic
- Copyright 2002, 2005, 2006 Free Software Foundation, Inc.
+ Copyright 2002, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -28,10 +28,10 @@ License along with libgfortran; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-#include "config.h"
+#include "libgfortran.h"
#include <stdlib.h>
#include <assert.h>
-#include "libgfortran.h"
+
#if defined (HAVE_GFC_LOGICAL_16)
@@ -39,15 +39,15 @@ Boston, MA 02110-1301, USA. */
Either a or b can be rank 1. In this case x or y is 1. */
extern void matmul_l16 (gfc_array_l16 * const restrict,
- gfc_array_l4 * const restrict, gfc_array_l4 * const restrict);
+ gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
export_proto(matmul_l16);
void
matmul_l16 (gfc_array_l16 * const restrict retarray,
- gfc_array_l4 * const restrict a, gfc_array_l4 * const restrict b)
+ gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
{
- const GFC_INTEGER_4 * restrict abase;
- const GFC_INTEGER_4 * restrict bbase;
+ const GFC_LOGICAL_1 * restrict abase;
+ const GFC_LOGICAL_1 * restrict bbase;
GFC_LOGICAL_16 * restrict dest;
index_type rxstride;
index_type rystride;
@@ -57,9 +57,11 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
index_type ystride;
index_type x;
index_type y;
+ int a_kind;
+ int b_kind;
- const GFC_INTEGER_4 * restrict pa;
- const GFC_INTEGER_4 * restrict pb;
+ const GFC_LOGICAL_1 * restrict pa;
+ const GFC_LOGICAL_1 * restrict pb;
index_type astride;
index_type bstride;
index_type count;
@@ -99,17 +101,29 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
abase = a->data;
- if (GFC_DESCRIPTOR_SIZE (a) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (a) == 8);
- abase = GFOR_POINTER_L8_TO_L4 (abase);
- }
+ a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+ if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || a_kind == 16
+#endif
+ )
+ abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
bbase = b->data;
- if (GFC_DESCRIPTOR_SIZE (b) != 4)
- {
- assert (GFC_DESCRIPTOR_SIZE (b) == 8);
- bbase = GFOR_POINTER_L8_TO_L4 (bbase);
- }
+ b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+ if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+ || b_kind == 16
+#endif
+ )
+ bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+ else
+ internal_error (NULL, "Funny sized logical array");
+
dest = retarray->data;
@@ -128,7 +142,7 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
one. */
if (GFC_DESCRIPTOR_RANK (a) == 1)
{
- astride = a->dim[0].stride;
+ astride = a->dim[0].stride * a_kind;
count = a->dim[0].ubound + 1 - a->dim[0].lbound;
xstride = 0;
rxstride = 0;
@@ -136,14 +150,14 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
else
{
- astride = a->dim[1].stride;
+ astride = a->dim[1].stride * a_kind;
count = a->dim[1].ubound + 1 - a->dim[1].lbound;
- xstride = a->dim[0].stride;
+ xstride = a->dim[0].stride * a_kind;
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
if (GFC_DESCRIPTOR_RANK (b) == 1)
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
ystride = 0;
rystride = 0;
@@ -151,9 +165,9 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
else
{
- bstride = b->dim[0].stride;
+ bstride = b->dim[0].stride * b_kind;
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
- ystride = b->dim[1].stride;
+ ystride = b->dim[1].stride * b_kind;
ycount = b->dim[1].ubound + 1 - b->dim[1].lbound;
}
@@ -189,3 +203,4 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
#endif
+