+start-sanitize-gxsim
+1998-12-01 Frank Ch. Eigler <fche@elastic.org>
+
+ * sim-gx-run.c (sim_engine_run): Use new tgx_info struct to
+ collect run-time arguments to gx block.
+ * sim-gx.h (sim_gx_function): Corresponding signature change.
+
+ * sim-gx.c (sim_gx_compiled_block_f): Remove nonfunctional code to
+ again compile a gx block source file.
+ (sim_gx_compiled_block_dispose): Uninstall obsoleted gx block
+ shared libraries.
+ (sim_gx_block_translate): Always emit new "gx_label_NNNN" labels,
+ for basic block entry points, even if !__GNUC__.
+
+end-sanitize-gxsim
1998-11-30 Doug Evans <devans@casey.cygnus.com>
* cgen-utils.c (cgen_virtual_opcode_table): Update.
}
/* call into gx function */
- rc = (*f)(& cpu->regs, block->pc_flags, block->callbacks);
+ {
+ struct tgx_info info = {& cpu->regs,
+ block->pc_flags,
+ block->callbacks };
+ rc = (*f)(& info);
+ }
/* compute pc_flags checksum */
if(! optimized)
if(f == NULL)
{
- /* compile object */
- if(gx->object_name == NULL && gx->source_name != NULL)
- {
- char compile_command[2000];
-
- gx->object_name = strdup(gx->source_name);
- /* turn *.c into *.o */
- gx->object_name[strlen(gx->object_name)]='o';
-
- /* compute command string to compile object */
- sprintf(compile_command,
- "make -f %s OBJ=%s SRC=%s gx",
-#define GX_MAKEFILE "--no-makefile-yet--"
- GX_MAKEFILE,
- gx->object_name,
- gx->source_name);
-
- rc = system(compile_command);
- if(rc != 0)
- {
- sim_io_error(sd, "Compile error rc %d for GX source %s: %s",
- rc,
- gx->source_name,
- strerror(errno));
- }
- }
-
/* load object */
if(gx->object_dlhandle == NULL && gx->object_name != NULL)
{
{
SIM_DESC sd = current_state;
int rc;
+ char compile_command[2000];
+ char la_name[2000];
/* forget dl information */
gx->function_dlhandle = NULL;
gx->object_dlhandle = NULL;
}
+ /* uninstall shared object */
+
+ strcpy(la_name, gx->object_name);
+ strcpy(strstr(la_name, ".so.0"), ".la");
+ sprintf(compile_command, "gxtool --mode=uninstall rm -f %s", la_name);
+
+ rc = system(compile_command);
+ if(rc != 0)
+ {
+ sim_io_error(sd, "Error during finish: `%s' rc %d",
+ compile_command, rc);
+ }
+
+
+ /* erase source */
+ /* sprintf(compile_command, "rm -f %s", block->source_name); */
+
/* final gasps */
zfree(gx->source_name);
zfree(gx->object_name);
sim_gx_block_add(gx);
}
- print_gx_blocks(STATE_BLOCKS(sd), "after restoring state");
+ /* print_gx_blocks(STATE_BLOCKS(sd), "after restoring state"); */
}
fprintf(block->source_file, "\n\n");
fprintf(block->source_file, "extern int\n");
fprintf(block->source_file, "%s", block->symbol_name);
- fprintf(block->source_file, "(struct tgx_cpu_regs* regs, char* pc_flags, struct tgx_callbacks* callbacks)\n");
+ fprintf(block->source_file, "(struct tgx_info* info)\n");
fprintf(block->source_file, "{\n");
fprintf(block->source_file, " int rc = 0;\n");
if(! optimized)
if((! optimized) ||
(GX_PC_FLAGS(gx, gx_cia) & GX_PCF_JUMPTARGET))
{
- fprintf(block->source_file, "#ifdef __GNUC__\n");
fprintf(block->source_file, " gx_label_%ld:\n",
((gx_cia - gx->origin) / gx->divisor));
- fprintf(block->source_file, "#else /* ! __GNUC__*/\n");
+ fprintf(block->source_file, "#ifndef __GNUC__\n");
fprintf(block->source_file, " case %ld:\n",
((gx_cia - gx->origin) / gx->divisor));
- fprintf(block->source_file, "#endif /*__GNUC__*/\n");
+ fprintf(block->source_file, "#endif /* !__GNUC__ */\n");
}
/* translate breakpoint check & exit */
/* clean up */
- sprintf(compile_command, "rm -f lib%s.la %s.lo", base_name, base_name);
+ sprintf(compile_command, "gxtool --silent --mode=uninstall rm -f lib%s.la %s.lo", base_name, base_name);
rc = system(compile_command);
if(rc != 0)
{
/* actual gx function pointer type */
-struct tgx_cpu_regs;
-typedef int (*sim_gx_function)(struct tgx_cpu_regs* cpu, char* pc_flags, struct tgx_callbacks* callbacks);
+struct tgx_info;
+typedef int (*sim_gx_function)(struct tgx_info* info);
/* return values from gx function */
+1998-12-01 Frank Ch. Eigler <fche@elastic.org>
+
+ * Makefile.in (SIM_OBJS): Don't build sim-core.o.
+ * configure.in: Added --enable-sim-inline support.
+ Look for "getenv()" function.
+ * configure: Rebuilt.
+ * config.in: Rebuilt.
+ * gx-translate.c: Include "sim-inline.c" for sim-core inlining.
+ (m32r_gx_{load,store}*): Update signature.
+ (tgx_emit_pre_function): Emit new "tgx_info" struct, update
+ callback function signatures.
+ (m32r_emit_*_insn): Use new callback signatures. For all short
+ branches in optimized mode, emit direct "goto gx_label_NNNN".
+ (tgx_optimize_test): If the GX_OPTIMIZE environment variable is
+ set, allow its integer value to override the optimization heuristic.
+ * m32r-sim.h: New empty placeholder file.
+ * sim-main.c: New empty placeholder file.
+ * sim-if.c (sim_create_inferior): Use NULL instead of &abort
+ for unimplemented register fondling functions.
+ * sim-main.h: Add multiple inclusion guard. Update callback
+ function signatures.
+ (tgx_info): New struct for collecting gx block invocation
+ arguments.
+
1998-11-13 Frank Ch. Eigler <fche@elastic.org>
* (*): New files: snapshot of gx simulator prototype.
sim-bits.o \
sim-break.o \
sim-config.o \
- sim-core.o \
sim-endian.o \
sim-events.o \
sim-fpu.o \
sim-watch.o \
sim-cpu.o \
sim-engine.o \
- sim-core.o \
sim-hload.o \
sim-hrw.o \
sim-reason.o \
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
+/* Define if you have the getenv function. */
+#undef HAVE_GETENV
+
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
--enable-sim-default-model=model Specify default model to simulate."
ac_help="$ac_help
--enable-sim-environment=environment Specify mixed, user, virtual or operating environment."
+ac_help="$ac_help
+ --enable-sim-inline=inlines Specify which functions should be inlined."
# Initialize some variables set by options.
# The variables have the same names as the options, with
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:688: checking how to run the C preprocessor" >&5
+echo "configure:690: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 703 "configure"
+#line 705 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 720 "configure"
+#line 722 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 737 "configure"
+#line 739 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:768: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:770: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
fi
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:795: checking for POSIXized ISC" >&5
+echo "configure:797: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:816: checking for ANSI C header files" >&5
+echo "configure:818: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 821 "configure"
+#line 823 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 846 "configure"
+#line 848 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 864 "configure"
+#line 866 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 885 "configure"
+#line 887 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:920: checking for working const" >&5
+echo "configure:922: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 925 "configure"
+#line 927 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:995: checking for inline" >&5
+echo "configure:997: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1002 "configure"
+#line 1004 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1035: checking for off_t" >&5
+echo "configure:1037: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1040 "configure"
+#line 1042 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1068: checking for size_t" >&5
+echo "configure:1070: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1073 "configure"
+#line 1075 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1103: checking for working alloca.h" >&5
+echo "configure:1105: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1108 "configure"
+#line 1110 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1136: checking for alloca" >&5
+echo "configure:1138: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1141 "configure"
+#line 1143 "configure"
#include "confdefs.h"
#ifdef __GNUC__
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1201: checking whether alloca needs Cray hooks" >&5
+echo "configure:1203: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1206 "configure"
+#line 1208 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1231: checking for $ac_func" >&5
+echo "configure:1233: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1236 "configure"
+#line 1238 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1286: checking stack direction for C alloca" >&5
+echo "configure:1288: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1294 "configure"
+#line 1296 "configure"
#include "confdefs.h"
find_stack_direction ()
{
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1338: checking for $ac_hdr" >&5
+echo "configure:1340: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1343 "configure"
+#line 1345 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1377: checking for $ac_func" >&5
+echo "configure:1379: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1382 "configure"
+#line 1384 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1430: checking for working mmap" >&5
+echo "configure:1432: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1438 "configure"
+#line 1440 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
}
EOF
-if { (eval echo configure:1578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1651: checking host system type" >&5
+echo "configure:1653: checking host system type" >&5
host_alias=$host
case "$host_alias" in
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1672: checking target system type" >&5
+echo "configure:1674: checking target system type" >&5
target_alias=$target
case "$target_alias" in
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1690: checking build system type" >&5
+echo "configure:1692: checking build system type" >&5
build_alias=$build
case "$build_alias" in
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1734: checking for $ac_word" >&5
+echo "configure:1736: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1763: checking for $ac_word" >&5
+echo "configure:1765: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1813: checking for $ac_word" >&5
+echo "configure:1815: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1844: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1846: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1854 "configure"
+#line 1856 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1878: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1880: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1883: checking whether we are using GNU C" >&5
+echo "configure:1885: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1911: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1913: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1954: checking for a BSD compatible install" >&5
+echo "configure:1956: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2020: checking for $ac_word" >&5
+echo "configure:2022: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2054: checking for $ac_hdr" >&5
+echo "configure:2056: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2059 "configure"
+#line 2061 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2094: checking for $ac_func" >&5
+echo "configure:2096: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2099 "configure"
+#line 2101 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2151: checking for $ac_func" >&5
+echo "configure:2153: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2156 "configure"
+#line 2158 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2213: checking for LC_MESSAGES" >&5
+echo "configure:2215: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2218 "configure"
+#line 2220 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2246: checking whether NLS is requested" >&5
+echo "configure:2248: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2266: checking whether included gettext is requested" >&5
+echo "configure:2268: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2285: checking for libintl.h" >&5
+echo "configure:2287: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2290 "configure"
+#line 2292 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2312: checking for gettext in libc" >&5
+echo "configure:2314: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2317 "configure"
+#line 2319 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2340: checking for bindtextdomain in -lintl" >&5
+echo "configure:2342: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2348 "configure"
+#line 2350 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2375: checking for gettext in libintl" >&5
+echo "configure:2377: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2380 "configure"
+#line 2382 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2415: checking for $ac_word" >&5
+echo "configure:2417: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2449: checking for $ac_func" >&5
+echo "configure:2451: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2454 "configure"
+#line 2456 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2504: checking for $ac_word" >&5
+echo "configure:2506: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2539: checking for $ac_word" >&5
+echo "configure:2541: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
cat > conftest.$ac_ext <<EOF
-#line 2571 "configure"
+#line 2573 "configure"
#include "confdefs.h"
int main() {
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2611: checking for $ac_word" >&5
+echo "configure:2613: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2645: checking for $ac_word" >&5
+echo "configure:2647: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2680: checking for $ac_word" >&5
+echo "configure:2682: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2770: checking for catalogs to be installed" >&5
+echo "configure:2772: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:2798: checking for linux/version.h" >&5
+echo "configure:2800: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2803 "configure"
+#line 2805 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2877: checking for $ac_hdr" >&5
+echo "configure:2879: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2882 "configure"
+#line 2884 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2917: checking for $ac_hdr" >&5
+echo "configure:2919: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2922 "configure"
+#line 2924 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2957: checking for $ac_hdr" >&5
+echo "configure:2959: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2962 "configure"
+#line 2964 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2997: checking for $ac_hdr" >&5
+echo "configure:2999: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3002 "configure"
+#line 3004 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
for ac_func in getrusage time sigaction __setfpucw
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3036: checking for $ac_func" >&5
+echo "configure:3038: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3041 "configure"
+#line 3043 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Check for socket libraries
echo $ac_n "checking for bind in -lsocket""... $ac_c" 1>&6
-echo "configure:3091: checking for bind in -lsocket" >&5
+echo "configure:3093: checking for bind in -lsocket" >&5
ac_lib_var=`echo socket'_'bind | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3099 "configure"
+#line 3101 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
bind()
; return 0; }
EOF
-if { (eval echo configure:3110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3138: checking for gethostbyname in -lnsl" >&5
+echo "configure:3140: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3146 "configure"
+#line 3148 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:3157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3333: checking return type of signal handlers" >&5
+echo "configure:3335: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3338 "configure"
+#line 3340 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:3355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3375: checking for executable suffix" >&5
+echo "configure:3377: checking for executable suffix" >&5
if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$cross_compiling" = "xno"; then
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3535: checking whether byte ordering is bigendian" >&5
+echo "configure:3537: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 3542 "configure"
+#line 3544 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
#endif
; return 0; }
EOF
-if { (eval echo configure:3553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 3557 "configure"
+#line 3559 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
#endif
; return 0; }
EOF
-if { (eval echo configure:3568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3588 "configure"
+#line 3590 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
fi
+default_sim_inline=""
+# Check whether --enable-sim-inline or --disable-sim-inline was given.
+if test "${enable_sim_inline+set}" = set; then
+ enableval="$enable_sim_inline"
+ sim_inline=""
+case "$enableval" in
+ no) sim_inline="-DDEFAULT_INLINE=0";;
+ 0) sim_inline="-DDEFAULT_INLINE=0";;
+ yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_C_INLINE";;
+ 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
+ *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
+ new_flag=""
+ case "$x" in
+ *_INLINE=*) new_flag="-D$x";;
+ *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
+ *_INLINE) new_flag="-D$x=ALL_C_INLINE";;
+ *) new_flag="-D$x""_INLINE=ALL_C_INLINE";;
+ esac
+ if test x"$sim_inline" = x""; then
+ sim_inline="$new_flag"
+ else
+ sim_inline="$sim_inline $new_flag"
+ fi
+ done;;
+esac
+if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
+ echo "Setting inline flags = $sim_inline" 6>&1
+fi
+else
+
+if test "x$cross_compiling" = "xno"; then
+ if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then
+ sim_inline="${default_sim_inline}"
+ if test x"$silent" != x"yes"; then
+ echo "Setting inline flags = $sim_inline" 6>&1
+ fi
+ else
+ sim_inline=""
+ fi
+else
+ sim_inline="-DDEFAULT_INLINE=0"
+fi
+fi
+
+
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3672: checking for dlopen in -ldl" >&5
+echo "configure:3719: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3680 "configure"
+#line 3727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""no" 1>&6
fi
+for ac_func in getenv
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3768: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3773 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
SIM_AC_OPTION_HOSTENDIAN
SIM_AC_OPTION_DEFAULT_MODEL(m32r/d)
SIM_AC_OPTION_ENVIRONMENT
+SIM_AC_OPTION_INLINE
AC_CHECK_LIB(dl, dlopen)
+AC_CHECK_FUNCS(getenv)
SIM_AC_OUTPUT
#include "sim-main.h"
#include "sim-base.h"
#include "sim-core.h"
+#include "sim-inline.c"
#include "sim-gx.h"
#include "sim-assert.h"
#include "targ-vals.h"
void m32r_emit_short_insn(sim_gx_block* block, PCADDR pc, unsigned insn, int optimized);
/* callback functions */
-unsigned m32r_gx_load(unsigned pc, unsigned addr);
-void m32r_gx_store(unsigned pc, unsigned addr, unsigned data);
-signed char m32r_gx_load1(unsigned pc, unsigned addr);
-void m32r_gx_store1(unsigned pc, unsigned addr, signed char data);
-signed short m32r_gx_load2(unsigned pc, unsigned addr);
-void m32r_gx_store2(unsigned pc, unsigned addr, signed short data);
-void m32r_gx_syscall(tgx_syscall_data* data);
+unsigned m32r_gx_load(tgx_info* info, unsigned pc, unsigned addr);
+void m32r_gx_store(tgx_info* info, unsigned pc, unsigned addr, unsigned data);
+signed char m32r_gx_load1(tgx_info* info, unsigned pc, unsigned addr);
+void m32r_gx_store1(tgx_info* info, unsigned pc, unsigned addr, signed char data);
+signed short m32r_gx_load2(tgx_info* info, unsigned pc, unsigned addr);
+void m32r_gx_store2(tgx_info* info, unsigned pc, unsigned addr, signed short data);
+void m32r_gx_syscall(tgx_info* info, tgx_syscall_data* data);
"} tgx_syscall_data;\n");
fprintf(block->source_file, /* match with definition in sim-main.h! */
+ "struct tgx_info;\n"
"typedef struct tgx_callbacks\n"
"{\n"
- " unsigned (*load)(unsigned pc, unsigned addr);\n"
- " void (*store)(unsigned pc, unsigned addr, unsigned data);\n"
- " signed char (*load1)(unsigned pc, unsigned addr);\n"
- " void (*store1)(unsigned pc, unsigned addr, signed char data);\n"
- " signed short (*load2)(unsigned pc, unsigned addr);\n"
- " void (*store2)(unsigned pc, unsigned addr, signed short data);\n"
- " void (*syscall)(tgx_syscall_data* data);\n"
+ " unsigned (*load)(struct tgx_info* info, unsigned pc, unsigned addr);\n"
+ " void (*store)(struct tgx_info* info, unsigned pc, unsigned addr, unsigned data);\n"
+ " signed char (*load1)(struct tgx_info* info, unsigned pc, unsigned addr);\n"
+ " void (*store1)(struct tgx_info* info, unsigned pc, unsigned addr, signed char data);\n"
+ " signed short (*load2)(struct tgx_info* info, unsigned pc, unsigned addr);\n"
+ " void (*store2)(struct tgx_info* info, unsigned pc, unsigned addr, signed short data);\n"
+ " void (*syscall)(struct tgx_info* info, tgx_syscall_data* data);\n"
"} tgx_callbacks;\n");
+
+ fprintf(block->source_file, /* match with definition in sim-main.h! */
+ "typedef struct tgx_mapping_cache\n"
+ "{\n"
+ " unsigned base;\n"
+ " unsigned bound;\n"
+ " void* buffer;\n"
+ "} tgx_mapping_cache;\n");
+
+ fprintf(block->source_file, /* match with definition in sim-main.h! */
+ "typedef struct tgx_info\n"
+ "{\n"
+ " struct tgx_cpu_regs* regs;\n"
+ " char* pc_flags;\n"
+ " struct tgx_callbacks* callbacks;\n"
+ "} tgx_info;\n");
}
ASSERT(block->source_file != NULL);
fprintf(block->source_file, /* match with definition above */
+ " tgx_cpu_regs* regs = info->regs;\n"
+ " tgx_callbacks* callbacks = info->callbacks;\n"
+ " char* pc_flags = info->pc_flags;\n"
+ "\n"
" unsigned int pc = regs->h_pc;\n"
" unsigned int npc = pc;\n"
" signed int temp;\n"
unsigned_4 current_time = time(NULL);
unsigned_4 constant_time = current_time - block->learn_last_change;
int opt;
+ char* env;
/* try another optimize run if the system has settled down */
opt = (block->compile_time != 0
&& block->learn_last_change != 0
&& constant_time > block->compile_time);
+ /* allow override by environment variable */
+#ifdef HAVE_GETENV
+ env = getenv("GX_OPTIMIZE");
+ if(env)
+ opt = atoi(env);
+#endif
+
/*
if(opt)
printf("optimize_test: now: %d, chg: %d, comp: %d, count: %d => opt %d\n",
unsigned
-m32r_gx_load(unsigned pc, unsigned addr)
+m32r_gx_load(struct tgx_info* info, unsigned pc, unsigned addr)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
void
-m32r_gx_store(unsigned pc, unsigned addr, unsigned data)
+m32r_gx_store(struct tgx_info* info, unsigned pc, unsigned addr, unsigned data)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
signed char
-m32r_gx_load1(unsigned pc, unsigned addr)
+m32r_gx_load1(struct tgx_info* info, unsigned pc, unsigned addr)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
+ signed char data = 0;
- signed char data = sim_core_read_unaligned_1 (cpu, pc, read_map, addr);
+ data = sim_core_read_unaligned_1 (cpu, pc, read_map, addr);
return data;
}
void
-m32r_gx_store1(unsigned pc, unsigned addr, signed char data)
+m32r_gx_store1(struct tgx_info* info, unsigned pc, unsigned addr, signed char data)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
signed short
-m32r_gx_load2(unsigned pc, unsigned addr)
+m32r_gx_load2(struct tgx_info* info, unsigned pc, unsigned addr)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
void
-m32r_gx_store2(unsigned pc, unsigned addr, signed short data)
+m32r_gx_store2(struct tgx_info* info, unsigned pc, unsigned addr, signed short data)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
void
-m32r_gx_syscall(tgx_syscall_data* data)
+m32r_gx_syscall(struct tgx_info* info, tgx_syscall_data* data)
{
SIM_DESC sd = CURRENT_STATE;
sim_cpu* cpu = STATE_CPU (sd, 0);
data->errcode = s.errcode;
data->result = s.result;
data->result2 = s.result2;
+
+ /* XXX: clear read/write cache in info */
}
else if(op1 == 0xa && op2 == 0x0)
{
fprintf(f, " /* STB R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " (*(callbacks->store1))(0x%08x, gr%d + %d, gr%d & 0xff);\n", (unsigned)pc, r2, lit2, r1);
+ fprintf(f, " (*(callbacks->store1))(info, 0x%08x, gr%d + %d, gr%d & 0xff);\n", (unsigned)pc, r2, lit2, r1);
}
else if(op1 == 0xa && op2 == 0x2)
{
fprintf(f, " /* STH R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " (*(callbacks->store2))(0x%08x, gr%d + %d, gr%d & 0xffff);\n", (unsigned)pc, r2, lit2, r1);
+ fprintf(f, " (*(callbacks->store2))(info, 0x%08x, gr%d + %d, gr%d & 0xffff);\n", (unsigned)pc, r2, lit2, r1);
}
else if(op1 == 0xa && op2 == 0x4)
{
fprintf(f, " /* ST R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " (*(callbacks->store))(0x%08x, gr%d + %d, gr%d);\n", (unsigned)pc, r2, lit2, r1);
+ fprintf(f, " (*(callbacks->store))(info, 0x%08x, gr%d + %d, gr%d);\n", (unsigned)pc, r2, lit2, r1);
}
else if(op1 == 0xa && op2 == 0x8)
{
fprintf(f, " /* LDB R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " gr%d = (*(callbacks->load1))(0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
+ fprintf(f, " gr%d = (*(callbacks->load1))(info, 0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
}
else if(op1 == 0xa && op2 == 0x9)
{
fprintf(f, " /* LDUB R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " gr%d = (unsigned char)(*(callbacks->load1))(0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
+ fprintf(f, " gr%d = (unsigned char)(*(callbacks->load1))(info, 0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
}
else if(op1 == 0xa && op2 == 0xa)
{
fprintf(f, " /* LDH R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " gr%d = (*(callbacks->load2))(0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
+ fprintf(f, " gr%d = (*(callbacks->load2))(info, 0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
}
else if(op1 == 0xa && op2 == 0xb)
{
fprintf(f, " /* LDUH R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " gr%d = (unsigned short)(*(callbacks->load2))(0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
+ fprintf(f, " gr%d = (unsigned short)(*(callbacks->load2))(info, 0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
}
else if(op1 == 0xa && op2 == 0xc)
{
fprintf(f, " /* LD R%d,@(%d,R%d) */\n", r1, lit2, r2);
- fprintf(f, " gr%d = (*(callbacks->load))(0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
+ fprintf(f, " gr%d = (*(callbacks->load))(info, 0x%08x, gr%d + %d);\n", r1, (unsigned)pc, r2, lit2);
}
else if(op1 == 0xb && op2 == 0x0)
fprintf(f, " /* BEQ R%d,R%d,%d */\n", r1, r2, lit2);
fprintf(f, " if (gr%d == gr%d)\n", r1, r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0x1)
fprintf(f, " /* BNE R%d,R%d,%d */\n", r1, r2, lit2);
fprintf(f, " if (gr%d != gr%d)\n", r1, r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0x8 && r1 == 0)
fprintf(f, " /* BEQZ R%d,%d */\n", r2, lit2);
fprintf(f, " if (gr%d == 0)\n", r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0x9 && r1 == 0)
fprintf(f, " /* BNEZ R%d,%d */\n", r2, lit2);
fprintf(f, " if (gr%d != 0)\n", r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0xa && r1 == 0x0)
fprintf(f, " /* BLTZ R%d,%d */\n", r2, lit2);
fprintf(f, " if (gr%d < 0)\n", r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0xb && r1 == 0x0)
fprintf(f, " /* BGEZ R%d,%d */\n", r2, lit2);
fprintf(f, " if (gr%d >= 0)\n", r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0xc && r1 == 0x0)
fprintf(f, " /* BLEZ R%d,%d */\n", r2, lit2);
fprintf(f, " if (gr%d <= 0)\n", r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xb && op2 == 0xd && r1 == 0x0)
fprintf(f, " /* BGTZ R%d,%d */\n", r2, lit2);
fprintf(f, " if (gr%d > 0)\n", r2);
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
fprintf(f, " /* BC %d */\n", lit3);
fprintf(f, " if (cond)\n");
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xf && r1 == 0xd)
fprintf(f, " /* BNC %d */\n", lit3);
fprintf(f, " if (! cond)\n");
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0xf && r1 == 0xe)
unsigned retpc = (pc & 0xfffffffc) + 4;
fprintf(f, " /* BL %d */\n", lit3);
fprintf(f, " gr14 = 0x%08x;\n", retpc);
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
}
else if(op1 == 0xf && r1 == 0xf)
{
unsigned newpc = (pc & 0xfffffffc) + (((lit3 << 8) >> 8) << 2);
fprintf(f, " /* BRA %d */\n", lit3);
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
}
else
{
fprintf(f, " {\n");
fprintf(f, " tgx_syscall_data d = { 0x%08x, gr0, gr1, gr2, gr3 };\n", (unsigned) pc);
- fprintf(f, " (*(callbacks->syscall))(&d);\n");
+ fprintf(f, " (*(callbacks->syscall))(info, &d);\n");
fprintf(f, " gr2 = d.errcode;\n");
fprintf(f, " gr1 = d.result;\n");
fprintf(f, " gr0 = d.result2;\n");
else if(op1 == 0x2 && op2 == 0x0)
{
fprintf(f, " /* STB R%d,@R%d */\n", r1, r2);
- fprintf(f, " (*(callbacks->store1))(0x%08x, gr%d, gr%d & 0xff);\n", (unsigned)pc, r2, r1);
+ fprintf(f, " (*(callbacks->store1))(info, 0x%08x, gr%d, gr%d & 0xff);\n", (unsigned)pc, r2, r1);
}
else if(op1 == 0x2 && op2 == 0x2)
{
fprintf(f, " /* STH R%d,@R%d */\n", r1, r2);
- fprintf(f, " (*(callbacks->store2))(0x%08x, gr%d, gr%d & 0x0000ffff);\n", (unsigned)pc, r2, r1);
+ fprintf(f, " (*(callbacks->store2))(info, 0x%08x, gr%d, gr%d & 0x0000ffff);\n", (unsigned)pc, r2, r1);
}
else if(op1 == 0x2 && op2 == 0x4)
{
fprintf(f, " /* ST R%d,@R%d */\n", r1, r2);
- fprintf(f, " (*(callbacks->store))(0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
+ fprintf(f, " (*(callbacks->store))(info, 0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
}
else if(op1 == 0x2 && op2 == 0x5)
{
fprintf(f, " if(lock)\n");
fprintf(f, " {\n");
fprintf(f, " lock = 0;\n");
- fprintf(f, " (*(callbacks->store))(0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
+ fprintf(f, " (*(callbacks->store))(info, 0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
fprintf(f, " }\n");
}
else if(op1 == 0x2 && op2 == 0x6)
{
fprintf(f, " /* ST R%d,@+R%d */\n", r1, r2);
fprintf(f, " gr%d = gr%d + 4;\n", r2, r2);
- fprintf(f, " (*(callbacks->store))(0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
+ fprintf(f, " (*(callbacks->store))(info, 0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
}
else if(op1 == 0x2 && op2 == 0x7)
{
fprintf(f, " /* ST R%d,@-R%d */\n", r1, r2);
fprintf(f, " gr%d = gr%d - 4;\n", r2, r2);
- fprintf(f, " (*(callbacks->store))(0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
+ fprintf(f, " (*(callbacks->store))(info, 0x%08x, gr%d, gr%d);\n", (unsigned)pc, r2, r1);
}
else if(op1 == 0x2 && op2 == 0x8)
{
fprintf(f, " /* LDB R%d,@R%d */\n", r1, r2);
- fprintf(f, " gr%d = (*(callbacks->load1))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (*(callbacks->load1))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
}
else if(op1 == 0x2 && op2 == 0x9)
{
fprintf(f, " /* LDUB R%d,@R%d */\n", r1, r2);
- fprintf(f, " gr%d = (unsigned char)(*(callbacks->load1))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (unsigned char)(*(callbacks->load1))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
}
else if(op1 == 0x2 && op2 == 0xa)
{
fprintf(f, " /* LDH R%d,@R%d */\n", r1, r2);
- fprintf(f, " gr%d = (*(callbacks->load2))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (*(callbacks->load2))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
}
else if(op1 == 0x2 && op2 == 0xb)
{
fprintf(f, " /* LDUH R%d,@R%d */\n", r1, r2);
- fprintf(f, " gr%d = (unsigned short)(*(callbacks->load2))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (unsigned short)(*(callbacks->load2))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
}
else if(op1 == 0x2 && op2 == 0xc)
{
fprintf(f, " /* LD R%d,@R%d */\n", r1, r2);
- fprintf(f, " gr%d = (*(callbacks->load))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (*(callbacks->load))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
}
else if(op1 == 0x2 && op2 == 0xd)
{
fprintf(f, " /* LOCK R%d,@R%d */\n", r1, r2);
fprintf(f, " lock = 1;\n");
- fprintf(f, " gr%d = (*(callbacks->load))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (*(callbacks->load))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
}
else if(op1 == 0x2 && op2 == 0xe)
{
fprintf(f, " /* LD R%d,@R%d+ */\n", r1, r2);
- fprintf(f, " gr%d = (*(callbacks->load))(0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
+ fprintf(f, " gr%d = (*(callbacks->load))(info, 0x%08x, gr%d);\n", r1, (unsigned)pc, r2);
fprintf(f, " gr%d = gr%d + 4;\n", r2, r2);
}
fprintf(f, " /* BC %d */\n", c);
fprintf(f, " if (cond)\n");
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0x7 && r1 == 0xd)
fprintf(f, " /* BNC %d */\n", c);
fprintf(f, " if (! cond)\n");
fprintf(f, " {\n");
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
fprintf(f, " }\n");
}
else if(op1 == 0x7 && r1 == 0xe)
unsigned retpc = (pc & 0xfffffffc) + 4;
fprintf(f, " /* BL %d */\n", c);
fprintf(f, " gr14 = 0x%08x;\n", retpc);
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
}
else if(op1 == 0x7 && r1 == 0xf)
{
unsigned newpc = (pc & 0xfffffffc) + (((int) c) << 2);
fprintf(f, " /* BRA %d */\n", c);
- fprintf(f, " npc = 0x%08x;\n", newpc);
- fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ if (optimized &&
+ (GX_PC_INCLUDES(gx,newpc)) &&
+ (GX_PC_FLAGS(gx, newpc) & GX_PCF_JUMPTARGET))
+ {
+ fprintf(f, " goto gx_label_%ld;\n",
+ ((newpc - gx->origin) / gx->divisor));
+ }
+ else
+ {
+ fprintf(f, " npc = 0x%08x;\n", newpc);
+ fprintf(f, " goto %s;\n", (GX_PC_INCLUDES(gx,newpc)) ? "shortjump" : "longjump");
+ }
}
else if(op1 == 0x7 && op2 == 0x0 && r1 == 0x0 && r1 == 0x0)
CPU_PC_STORE (current_cpu) = m32r_h_pc_set;
CPU_PC_FETCH (current_cpu) = m32r_h_pc_get;
- CPU_REG_STORE (current_cpu) = & abort;
- CPU_REG_FETCH (current_cpu) = & abort;
+ CPU_REG_STORE (current_cpu) = NULL;
+ CPU_REG_FETCH (current_cpu) = NULL;
if (abfd != NULL)
addr = bfd_get_start_address (abfd);
--- /dev/null
+/* place holder */
-/* Main header for the m32r. */
+/* Main header for the m32r-gx. */
+
+#ifndef SIM_MAIN_H
+#define SIM_MAIN_H
#define USING_SIM_BASE_H /* FIXME: quick hack */
} tgx_syscall_data;
+struct tgx_info;
+
/* match with definition in gx-translate.c! */
typedef struct tgx_callbacks
{
- unsigned (*load)(unsigned pc, unsigned addr);
- void (*store)(unsigned pc, unsigned addr, unsigned data);
- signed char (*load1)(unsigned pc, unsigned addr);
- void (*store1)(unsigned pc, unsigned addr, signed char data);
- signed short (*load2)(unsigned pc, unsigned addr);
- void (*store2)(unsigned pc, unsigned addr, signed short data);
- void (*syscall)(tgx_syscall_data* data);
+ unsigned (*load)(struct tgx_info* info, unsigned pc, unsigned addr);
+ void (*store)(struct tgx_info* info, unsigned pc, unsigned addr, unsigned data);
+ signed char (*load1)(struct tgx_info* info, unsigned pc, unsigned addr);
+ void (*store1)(struct tgx_info* info, unsigned pc, unsigned addr, signed char data);
+ signed short (*load2)(struct tgx_info* info, unsigned pc, unsigned addr);
+ void (*store2)(struct tgx_info* info, unsigned pc, unsigned addr, signed short data);
+ void (*syscall)(struct tgx_info* info, tgx_syscall_data* data);
} tgx_callbacks;
+typedef struct tgx_info
+{
+ struct tgx_cpu_regs* regs;
+ char* pc_flags;
+ struct tgx_callbacks* callbacks;
+} tgx_info;
+
struct _sim_cpu
{
appropriate handler. */
SI h_gr_get (SIM_CPU *, UINT);
void h_gr_set (SIM_CPU *, UINT, SI);
+
+
+#endif /* SIM_MAIN_H */