* iresolve.c (gfc_resolve_pack): Choose function depending if mask
is scalar.
+ PR fortran/17631
+ * intrinsic.c (add_sym_5): Remove.
+ (add_subroutines): Add resolution function for MVBITS.
+ * intrinsic.h (gfc_resolve_mvbits): Declare resolution function for
+ MVBITS
+ * iresolve.c (gfc_resolve_mvbits): New function.
+ (gfc_resolve_random_number): Remove empty line at end of function.
+
2004-10-04 Erik Schnetter <schnetter@aei.mpg.de>
* scanner.c (preprocessor_line): Accept preprocessor lines without
}
-static void add_sym_5 (const char *name, int elemental, int actual_ok, bt type,
- int kind,
- try (*check)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
- gfc_expr *(*simplify)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
- void (*resolve)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
- const char* a1, bt type1, int kind1, int optional1,
- const char* a2, bt type2, int kind2, int optional2,
- const char* a3, bt type3, int kind3, int optional3,
- const char* a4, bt type4, int kind4, int optional4,
- const char* a5, bt type5, int kind5, int optional5
- ) {
- gfc_check_f cf;
- gfc_simplify_f sf;
- gfc_resolve_f rf;
-
- cf.f5 = check;
- sf.f5 = simplify;
- rf.f5 = resolve;
-
- add_sym (name, elemental, actual_ok, type, kind, cf, sf, rf,
- a1, type1, kind1, optional1,
- a2, type2, kind2, optional2,
- a3, type3, kind3, optional3,
- a4, type4, kind4, optional4,
- a5, type5, kind5, optional5,
- (void*)0);
-}
-
-
static void add_sym_5s
(
const char *name, int elemental, int actual_ok, bt type, int kind,
trim_name, BT_LOGICAL, dl, 1);
- /* This needs changing to add_sym_5s if it gets a resolution function. */
- add_sym_5 ("mvbits", 1, 1, BT_UNKNOWN, 0,
- gfc_check_mvbits, gfc_simplify_mvbits, NULL,
- f, BT_INTEGER, di, 0, fp, BT_INTEGER, di, 0,
- ln, BT_INTEGER, di, 0, t, BT_INTEGER, di, 0,
- tp, BT_INTEGER, di, 0);
+ add_sym_5s ("mvbits", 1, 1, BT_UNKNOWN, 0,
+ gfc_check_mvbits, gfc_simplify_mvbits, gfc_resolve_mvbits,
+ f, BT_INTEGER, di, 0, fp, BT_INTEGER, di, 0,
+ ln, BT_INTEGER, di, 0, t, BT_INTEGER, di, 0,
+ tp, BT_INTEGER, di, 0);
add_sym_1s ("random_number", 0, 1, BT_UNKNOWN, 0,
gfc_check_random_number, NULL, gfc_resolve_random_number,
/* Intrinsic subroutine resolution. */
void gfc_resolve_cpu_time (gfc_code *);
+void gfc_resolve_mvbits (gfc_code *);
void gfc_resolve_system_clock(gfc_code *);
void gfc_resolve_random_number (gfc_code *);
void gfc_resolve_getarg (gfc_code *);
}
+void
+gfc_resolve_mvbits (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ kind = c->ext.actual->expr->ts.kind;
+ name = gfc_get_string (PREFIX("mvbits_i%d"), kind);
+
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
void
gfc_resolve_random_number (gfc_code * c ATTRIBUTE_UNUSED)
{
name = gfc_get_string (PREFIX("arandom_r%d"), kind);
c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
-
}
PR fortran/17283
* gfortran.fortran-torture/execute/intrinsic_pack.f90: Add more tests.
+ PR fortran/17631
+ * gfortran.fortran-torture/execute/intrinsic_mvbits.f90: New test.
+
2004-10-04 Chao-ying Fu <fu@mips.com>
* gcc.dg/vect/pr16105.c: Enable for mipsisa64*-*-*.
--- /dev/null
+! Test the MVBITS intrinsic subroutine
+INTEGER*4 :: from, to, result
+
+DATA from / z'0003FFFC' /
+DATA to / z'77760000' /
+DATA result / z'7777FFFE' /
+
+CALL mvbits(from, 2, 16, to, 1)
+if (to /= result) CALL abort()
+end
* runtime/memory.c (internal_malloc, internal_malloc64): Allow
allocating zero memory.
+ PR fortran/17631
+ * Makefile.am (gfor_helper_src): Add intrinsics/mvbits.h.
+ * Makefile.in: Regenerate.
+ * intrinsics/mvbits.h: New file.
+
2004-10-04 Paul Brook <paul@codesourcery.com>
Bud Davis <bdavis9659@comcast.net>
intrinsics/getcwd.c \
intrinsics/getXid.c \
intrinsics/ishftc.c \
+intrinsics/mvbits.c \
intrinsics/pack_generic.c \
intrinsics/size.c \
intrinsics/spread_generic.c \
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
am__objects_33 = associated.lo abort.lo args.lo bessel.lo \
c99_functions.lo cpu_time.lo cshift0.lo date_and_time.lo \
env.lo erf.lo eoshift0.lo eoshift2.lo etime.lo getcwd.lo \
- getXid.lo ishftc.lo pack_generic.lo size.lo spread_generic.lo \
- string_intrinsics.lo rand.lo random.lo reshape_generic.lo \
- reshape_packed.lo selected_int_kind.lo selected_real_kind.lo \
- system_clock.lo transpose_generic.lo unpack_generic.lo \
- in_pack_generic.lo in_unpack_generic.lo normalize.lo
+ getXid.lo ishftc.lo mvbits.lo pack_generic.lo size.lo \
+ spread_generic.lo string_intrinsics.lo rand.lo random.lo \
+ reshape_generic.lo reshape_packed.lo selected_int_kind.lo \
+ selected_real_kind.lo system_clock.lo transpose_generic.lo \
+ unpack_generic.lo in_pack_generic.lo in_unpack_generic.lo \
+ normalize.lo
am__objects_34 =
am__objects_35 = _abs_c4.lo _abs_c8.lo _abs_i4.lo _abs_i8.lo \
_abs_r4.lo _abs_r8.lo _exp_r4.lo _exp_r8.lo _exp_c4.lo \
intrinsics/getcwd.c \
intrinsics/getXid.c \
intrinsics/ishftc.c \
+intrinsics/mvbits.c \
intrinsics/pack_generic.c \
intrinsics/size.c \
intrinsics/spread_generic.c \
-test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
+ test "$$dir" = "$$p" && dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
ishftc.lo: intrinsics/ishftc.c
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ishftc.lo `test -f 'intrinsics/ishftc.c' || echo '$(srcdir)/'`intrinsics/ishftc.c
+mvbits.o: intrinsics/mvbits.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mvbits.o `test -f 'intrinsics/mvbits.c' || echo '$(srcdir)/'`intrinsics/mvbits.c
+
+mvbits.obj: intrinsics/mvbits.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mvbits.obj `if test -f 'intrinsics/mvbits.c'; then $(CYGPATH_W) 'intrinsics/mvbits.c'; else $(CYGPATH_W) '$(srcdir)/intrinsics/mvbits.c'; fi`
+
+mvbits.lo: intrinsics/mvbits.c
+ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mvbits.lo `test -f 'intrinsics/mvbits.c' || echo '$(srcdir)/'`intrinsics/mvbits.c
+
pack_generic.o: intrinsics/pack_generic.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_generic.o `test -f 'intrinsics/pack_generic.c' || echo '$(srcdir)/'`intrinsics/pack_generic.c
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac