[Bug libfortran/30533] minval, maxval missing for kind=1 and kind=2

tkoenig at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Feb 7 20:08:00 GMT 2007



------- Comment #5 from tkoenig at gcc dot gnu dot org  2007-02-07 20:08 -------

> I think converting wil have a huge performance hit, so we'd better havec kind=1
> and kind=2 versions.

I agree, here's a patch to do this.

For speed reasons, we should also reverse the conversions
through the intrinsics that only make one pass through the data
(such as sum, product, or minmaxloc).

Index: Makefile.am
===================================================================
--- Makefile.am (revision 121423)
+++ Makefile.am (working copy)
@@ -176,6 +176,8 @@ generated/maxloc1_8_r16.c \
 generated/maxloc1_16_r16.c

 i_maxval_c= \
+generated/maxval_i1.c \
+generated/maxval_i2.c \
 generated/maxval_i4.c \
 generated/maxval_i8.c \
 generated/maxval_i16.c \
@@ -231,6 +233,8 @@ generated/minloc1_8_r16.c \
 generated/minloc1_16_r16.c

 i_minval_c= \
+generated/minval_i1.c \
+generated/minval_i2.c \
 generated/minval_i4.c \
 generated/minval_i8.c \
 generated/minval_i16.c \
Index: libgfortran.h
===================================================================
--- libgfortran.h       (revision 121423)
+++ libgfortran.h       (working copy)
@@ -224,6 +224,10 @@ internal_proto(l8_to_l4_offset);
 #define GFOR_POINTER_L8_TO_L4(p8) \
   (l8_to_l4_offset + (GFC_LOGICAL_4 *)(p8))

+#define GFC_INTEGER_1_HUGE \
+  (GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1)
+#define GFC_INTEGER_2_HUGE \
+  (GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 15) - 1)
 #define GFC_INTEGER_4_HUGE \
   (GFC_INTEGER_4)((((GFC_UINTEGER_4)1) << 31) - 1)
 #define GFC_INTEGER_8_HUGE \
@@ -283,6 +287,8 @@ struct {\
 /* Commonly used array descriptor types.  */
 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) gfc_array_void;
 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, char) gfc_array_char;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_1) gfc_array_i1;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_2) gfc_array_i2;
 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_4) gfc_array_i4;
 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_8) gfc_array_i8;
 #ifdef HAVE_GFC_INTEGER_16


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30533



More information about the Gcc-bugs mailing list