summaryrefslogtreecommitdiff
path: root/sim/mn10200
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>1999-04-16 01:35:26 +0000
committerStan Shebs <shebs@apple.com>1999-04-16 01:35:26 +0000
commit14cd51f7793a9ce07bc435069f57269450141363 (patch)
tree280a2da48f771d61be5b451ddbacdf9ef8e9ad13 /sim/mn10200
downloadgdb-14cd51f7793a9ce07bc435069f57269450141363.tar.gz
Initial revision
Diffstat (limited to 'sim/mn10200')
-rw-r--r--sim/mn10200/ChangeLog424
-rw-r--r--sim/mn10200/Makefile.in52
-rw-r--r--sim/mn10200/acconfig.h15
-rw-r--r--sim/mn10200/config.in158
-rwxr-xr-xsim/mn10200/configure3892
-rw-r--r--sim/mn10200/configure.in10
-rw-r--r--sim/mn10200/gencode.c154
-rw-r--r--sim/mn10200/interp.c800
-rw-r--r--sim/mn10200/mn10200_sim.h297
-rw-r--r--sim/mn10200/simops.c2449
10 files changed, 8251 insertions, 0 deletions
diff --git a/sim/mn10200/ChangeLog b/sim/mn10200/ChangeLog
new file mode 100644
index 00000000000..ce38f139e4a
--- /dev/null
+++ b/sim/mn10200/ChangeLog
@@ -0,0 +1,424 @@
+Wed Jun 17 11:37:59 1998 Mark Alexander <marka@cygnus.com>
+
+ * Makefile.in: Define NL_TARGET so that targ-vals.h will be used
+ instead of syscall.h.
+ * simops.c: Use targ-vals.h instead of syscall.h.
+
+Tue Apr 28 18:33:31 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Sun Apr 26 15:31:55 1998 Tom Tromey <tromey@creche>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Sun Apr 26 15:19:58 1998 Tom Tromey <tromey@cygnus.com>
+
+ * acconfig.h: New file.
+ * configure.in: Reverted change of Apr 24; use sinclude again.
+
+Fri Apr 24 14:16:40 1998 Tom Tromey <tromey@creche>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Fri Apr 24 11:19:13 1998 Tom Tromey <tromey@cygnus.com>
+
+ * configure.in: Don't call sinclude.
+
+Thu Apr 23 09:48:14 1998 Tom Tromey <tromey@creche>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Sat Apr 4 20:36:25 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Fri Mar 27 16:15:52 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Wed Mar 25 12:35:29 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Wed Mar 18 12:38:12 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Tue Feb 17 12:46:22 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_store_register, sim_fetch_register): Pass in
+ length parameter. Return -1.
+
+Sun Feb 1 16:47:51 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Sat Jan 31 18:15:41 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Mon Jan 19 22:26:29 1998 Doug Evans <devans@seba>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Tue Jan 13 00:01:40 1998 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Stores to abs16 memory addresses zero extend the
+ abs16 address.
+
+Mon Dec 15 23:17:11 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Thu Dec 4 09:21:05 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Wed Oct 22 14:43:00 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_load): Pass lma_p and sim_write args to
+ sim_load_file.
+
+Fri Oct 3 09:28:00 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Wed Sep 24 17:38:57 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Tue Sep 23 11:04:38 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Mon Sep 22 11:46:20 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Fri Sep 19 17:45:25 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Mon Sep 15 17:36:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Thu Sep 4 17:21:23 1997 Doug Evans <dje@seba>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Tue Sep 2 18:41:23 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: PC relative instructions are relative to the next
+ instruction, not the current instruction.
+
+Wed Aug 27 18:13:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Tue Aug 26 10:40:45 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_kill): Delete.
+ (sim_create_inferior): Add ABFD argument.
+ (sim_load): Move setting of PC from here.
+ (sim_create_inferior): To here.
+
+Mon Aug 25 17:50:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Mon Aug 25 16:14:44 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_open): Add ABFD argument.
+
+Tue Jun 24 13:44:08 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (sim_resume): Clear State.exited.
+ (sim_stop_reason): If State.exited is nonzero, then indicate that
+ the simulator exited instead of stopped.
+ * mn10200_sim.h (struct _state): Add exited field.
+ * simops.c (syscall): Set State.exited for SYS_exit.
+
+Tue May 20 17:45:47 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c: Replace all references to load_mem and store_mem
+ with references to load_byte, load_half, load_3_byte, load_word
+ and store_byte, store_half, store_3_byte, store_word.
+ (INLINE): Delete definition.
+ (load_mem_big): Likewise.
+ (max_mem): Make it global.
+ (dispatch): Make this function inline.
+ (load_mem, store_mem): Delete functions.
+ * mn10200_sim.h (INLINE): Define.
+ (RLW): Delete unused definition.
+ (load_mem, store_mem): Delete declarations.
+ (load_mem_big): New definition.
+ (load_byte, load_half, load_3_byte, load_word): New functions.
+ (store_byte, store_half, store_3_byte, store_word): New functions.
+ * simops.c: Replace all references to load_mem and store_mem
+ with references to load_byte, load_half, load_3_byte, load_word
+ and store_byte, store_half, store_3_byte, store_word.
+
+Tue May 20 10:21:00 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_open): Add callback argument.
+ (sim_set_callbacks): Delete SIM_DESC argument.
+
+Sun May 18 16:59:09 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (compare_simops): New function.
+ (sim_open): Sort the Simops table before inserting entries
+ into the hash table.
+
+Fri May 16 16:29:18 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (load_mem): Fix formatting/indention problems with
+ last change. If we get a load from an out of range address,
+ abort instead of returning zero.
+ (store_mem): Abort if we try to store to an out of range address.
+
+Wed May 14 21:21:30 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * simops.c (OP_F010): Fix some arguments to correspond
+ with reality (types of arguments passed to lseek, read,
+ write, open).
+
+ * interp.c (max_mem): New variable.
+ (load_mem): Check memory address against max_mem to
+ avoid some self-destructive behaviors.
+
+Tue May 13 21:45:24 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix typo in cc0 setting for lsr.
+
+Tue May 6 13:22:12 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c: Random typo/thinko cleanups.
+
+Thu Apr 24 00:39:51 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Mon Apr 21 10:29:30 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix typo in "open" syscall emulation.
+
+Fri Apr 18 14:04:31 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_stop): Add stub function.
+
+Thu Apr 17 03:23:58 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (SIM_OBJS): Add sim-load.o.
+ * interp.c (sim_kind, myname): New static locals.
+ (sim_open): Set sim_kind, myname. Ignore -E arg.
+ (sim_load): Return SIM_RC. New arg abfd. Call sim_load_file to
+ load file into simulator. Set start address from bfd.
+ (sim_create_inferior): Return SIM_RC. Delete arg start_address.
+
+Wed Apr 16 18:06:50 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * simops.c (OP_F010): SYS_execv, SYS_time, SYS_times, SYS_utime
+ only include if implemented by host.
+
+Mon Apr 7 15:45:02 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Fri Apr 4 20:01:56 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Change mn10200-opc.o to m10200-opc.o, to match
+ corresponding change in opcodes directory.
+
+Wed Apr 2 15:06:28 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * interp.c (sim_open): New arg `kind'.
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Wed Apr 2 14:34:19 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Thu Mar 20 20:28:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200_sim.h: Protect uses of "signed" to cater to broken
+ non-ansi compilers (HPs). Don't use #error for the same reason.
+
+Tue Mar 18 12:23:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Don't sign-extend immediate for "mov imm16,an".
+ Simplify "sub" handling. Fix "mul" to properly sign extend
+ operands. Set CF appropriately for btst imm16,dn. Implement "rti".
+
+ * gencode.c: Delete unused "Opcodes" and "curop" variables.
+
+Wed Mar 19 01:14:00 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+
+Mon Mar 17 15:10:07 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * configure: Re-generate.
+
+Fri Mar 14 10:34:11 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure: Regenerate to track ../common/aclocal.m4 changes.
+
+Thu Mar 13 12:53:14 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * interp.c (sim_open): New SIM_DESC result. Argument is now
+ in argv form.
+ (other sim_*): New SIM_DESC argument.
+
+Wed Mar 12 15:02:35 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix typo for "bclr".
+
+Wed Feb 26 16:46:13 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Handle new calling convention in emulated syscall
+ code.
+
+Mon Feb 24 14:25:11 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (load_mem_big): Add some missing parens.
+
+Wed Feb 19 23:19:08 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Don't use "long long" data types for intermediate
+ values in "divu", "mul" and "mulu" instructions.
+
+Fri Feb 14 02:46:46 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (hash): Rework to be more efficient.
+ (dispatch): Renamed from lookup_hash. Dispatch to the target
+ function and update the PC here.
+ (load_mem_big): Now a macro.
+ (sim_resume): Restructure code to read an insn, determine its
+ length, call dispatch routines, etc to be much more efficient.
+
+Fri Feb 7 12:59:36 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (MAX_HASH): Redefine to 127.
+ (struct hash_entry): Add "count" field when HASH_STAT is defined.
+ (hash): Improve hashing for many heavily used opcodes.
+ (lookup_hash): Bump counters if HASH_STAT is defined.
+ (sim_open): Don't put the same opcode in the hash table more
+ than once. Clear counters if HASH_STAT is defined.
+ (sim_resume): After program exits, dump hash table stats if
+ HASH_STAT is defined.
+
+Wed Feb 5 10:28:37 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix register extraction for "ext dn".
+
+Tue Feb 4 17:27:41 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix register extractions for "movbu (an), dm".
+
+Tue Feb 4 13:33:30 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (@COMMON_MAKEFILE_FRAG): Use
+ COMMON_{PRE,POST}_CONFIG_FRAG instead.
+ * configure.in: sinclude ../common/aclocal.m4.
+ * configure: Regenerated.
+
+Fri Jan 31 01:19:02 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Get carry-in bit right for rol. Just clear the
+ NF flag for btst imm8,dn.
+
+Wed Jan 29 15:47:42 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Properly compute ZF flag for many insns.
+
+Sat Jan 25 17:06:55 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Properly truncate divisor and dividend before
+ performing "divu" operation.
+
+Fri Jan 24 10:47:48 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c (init_system): Allocate 2^19 bytes of space for
+ the simulator.
+
+Thu Jan 23 21:17:33 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Rework code to extract arguments for emulated
+ syscalls to handle 24bit pointers.
+
+Thu Jan 23 14:06:04 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure configure.in Makefile.in: Update to new configure
+ scheme which is more compatible with WinGDB builds.
+ * configure.in: Improve comment on how to run autoconf.
+ * configure: Re-run autoconf to get new ../common/aclocal.m4.
+ * Makefile.in: Use autoconf substitution to install common
+ makefile fragment.
+
+Thu Jan 23 12:04:38 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix destination register for "mov (abs24),an".
+
+Tue Jan 21 15:59:21 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: "rts" adds 4 to the stack pointer.
+
+ * simops.c: Fix CF and CX computation for add instructions.
+
+ * simops.c: Leave the upper 8 bits alone for logical ops.
+ Mask off high 8 bits before doing any shifts/rotates.
+ Fix carry bit handling in rotates again.
+
+Mon Jan 20 10:45:08 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Don't lose the sign bit for "asr".
+
+Fri Jan 17 01:45:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix overflow computation for "cmp" and "sub"
+ instructions.
+
+ * simops.c: Use the right register for "jmp (an)" and "jsr (an)".
+
+ * interp.c (hash): Improve hashing for 3 byte instructions.
+
+ * simops.c: Fix extraction of 16/24bit immediates for some
+ instructions. "cmp" instructions only modify the PSW.
+ Fix various thinkos when extracting register operands too.
+
+Thu Jan 16 07:47:56 1997 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Fix "rol" and "ror".
+
+ * simops.c: Truncate PC to 24bits after modifying it.
+ Closer stab at emulated system calls.
+
+Tue Jan 14 12:33:12 1997 Jeffrey A Law (law@cygnus.com)
+
+ * interp.c (hash): Improve hashing of two byte insns.
+ (store_mem): Handle storing 3 byte quantities.
+
+ * simops.c: Fix various typos/thinkos.
+
+ * interp.c (load_mem_big, load_mem, store_mem): Fix thinko in
+ code to handle 24bit addresses.
+ * simops.c (REG0_8, REG0_16): Fix typo.
+
+Mon Jan 6 16:17:09 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200_sim.h: Various fixes for mixed 16/24bit architecture.
+ * interp.c: Similarly.
+ * simops.c: Similarly.
+
+ * Makefile.in, config.in, configure, configure.in: New files.
+ * gencode.c, interp.c, mn10200_sim.h, simops.c: New files.
+
diff --git a/sim/mn10200/Makefile.in b/sim/mn10200/Makefile.in
new file mode 100644
index 00000000000..dd9581ced26
--- /dev/null
+++ b/sim/mn10200/Makefile.in
@@ -0,0 +1,52 @@
+# Makefile template for Configure for the mn10200 sim library.
+# Copyright (C) 1997 Free Software Foundation, Inc.
+# Written by Cygnus Support.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+## COMMON_PRE_CONFIG_FRAG
+
+SIM_OBJS = interp.o table.o simops.o sim-load.o
+SIM_EXTRA_CFLAGS = -I$(srcdir)/../../newlib/libc/sys/sysmec
+SIM_EXTRA_CLEAN = clean-extra
+
+# Select mn10200 support in nltvals.def.
+NL_TARGET = -DNL_TARGET_mn10200
+
+INCLUDE = mn10200_sim.h $(srcdir)/../../include/callback.h
+
+## COMMON_POST_CONFIG_FRAG
+
+simops.h: gencode
+ ./gencode -h >$@
+
+table.c: gencode simops.h
+ ./gencode >$@
+
+gencode.o: gencode.c $(INCLUDE)
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gencode.c
+
+m10200-opc.o: $(srcdir)/../../opcodes/m10200-opc.c
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/../../opcodes/m10200-opc.c
+
+gencode: gencode.o m10200-opc.o
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o gencode gencode.o m10200-opc.o $(BUILD_LIB)
+
+clean-extra:
+ rm -f table.c simops.h gencode
+
+interp.o: interp.c table.c $(INCLUDE)
+simops.o: simops.c $(INCLUDE)
+table.o: table.c
diff --git a/sim/mn10200/acconfig.h b/sim/mn10200/acconfig.h
new file mode 100644
index 00000000000..f9b87a10c60
--- /dev/null
+++ b/sim/mn10200/acconfig.h
@@ -0,0 +1,15 @@
+
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext. */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Define as 1 if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
diff --git a/sim/mn10200/config.in b/sim/mn10200/config.in
new file mode 100644
index 00000000000..1f87a2bee4e
--- /dev/null
+++ b/sim/mn10200/config.in
@@ -0,0 +1,158 @@
+/* config.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if using alloca.c. */
+#undef C_ALLOCA
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Define as 1 if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define if you have the __argz_count function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the __argz_next function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the __argz_stringify function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define if you have the __setfpucw function. */
+#undef HAVE___SETFPUCW
+
+/* Define if you have the dcgettext function. */
+#undef HAVE_DCGETTEXT
+
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getpagesize function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the getrusage function. */
+#undef HAVE_GETRUSAGE
+
+/* Define if you have the munmap function. */
+#undef HAVE_MUNMAP
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
+/* Define if you have the setlocale function. */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the sigaction function. */
+#undef HAVE_SIGACTION
+
+/* Define if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the time function. */
+#undef HAVE_TIME
+
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <fpu_control.h> header file. */
+#undef HAVE_FPU_CONTROL_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
diff --git a/sim/mn10200/configure b/sim/mn10200/configure
new file mode 100755
index 00000000000..e646fa8a499
--- /dev/null
+++ b/sim/mn10200/configure
@@ -0,0 +1,3892 @@
+#! /bin/sh
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+sim_inline="-DDEFAULT_INLINE=0"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# This file is derived from `gettext.m4'. The difference is that the
+# included macros assume Cygnus-style source and build trees.
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 3
+
+
+
+
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+
+
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+
+
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.2
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --disable-nls do not use Native Language Support"
+ac_help="$ac_help
+ --with-included-gettext use the GNU gettext library included here"
+ac_help="$ac_help
+ --enable-maintainer-mode Enable developer functionality."
+ac_help="$ac_help
+ --enable-sim-bswap Use Host specific BSWAP instruction."
+ac_help="$ac_help
+ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator"
+ac_help="$ac_help
+ --enable-sim-debug=opts Enable debugging flags"
+ac_help="$ac_help
+ --enable-sim-stdio Specify whether to use stdio for console input/output."
+ac_help="$ac_help
+ --enable-sim-trace=opts Enable tracing flags"
+ac_help="$ac_help
+ --enable-sim-profile=opts Enable profiling flags"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.2"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=Makefile.in
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:677: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 692 "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:698: \"$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
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 709 "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:715: \"$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
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 726 "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:732: \"$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
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:757: 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
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:784: 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
+ echo "$ac_t""yes" 1>&6
+ ISC=yes # If later tests want to check for ISC.
+ cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+ if test "$GCC" = yes; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
+else
+ echo "$ac_t""no" 1>&6
+ ISC=
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:805: 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 810 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:818: \"$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*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f 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 835 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+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 853 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 874 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:909: 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 914 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:984: 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 991 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:1024: 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 1029 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_off_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1057: 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 1062 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_size_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+# 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:1092: 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 1097 "configure"
+#include "confdefs.h"
+#include <alloca.h>
+int main() {
+char *p = alloca(2 * sizeof(int));
+; return 0; }
+EOF
+if { (eval echo configure:1104: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_alloca_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
+if test $ac_cv_header_alloca_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA_H 1
+EOF
+
+fi
+
+echo $ac_n "checking for alloca""... $ac_c" 1>&6
+echo "configure:1125: 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 1130 "configure"
+#include "confdefs.h"
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int main() {
+char *p = (char *) alloca(1);
+; return 0; }
+EOF
+if { (eval echo configure:1158: \"$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 "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_func_alloca_works=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA 1
+EOF
+
+fi
+
+if test $ac_cv_func_alloca_works = no; then
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+ # that cause trouble. Some versions do not even contain alloca or
+ # contain a buggy version. If you still want to use their alloca,
+ # use ar to extract alloca.o from them instead of compiling alloca.c.
+ ALLOCA=alloca.${ac_objext}
+ cat >> confdefs.h <<\EOF
+#define C_ALLOCA 1
+EOF
+
+
+echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:1190: 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 1195 "configure"
+#include "confdefs.h"
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "webecray" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_os_cray=yes
+else
+ rm -rf conftest*
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_os_cray" 1>&6
+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:1220: 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 1225 "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:1248: \"$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
+ cat >> confdefs.h <<EOF
+#define CRAY_STACKSEG_END $ac_func
+EOF
+
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+done
+fi
+
+echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:1275: 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
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_stack_direction=0
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1283 "configure"
+#include "confdefs.h"
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+ exit (find_stack_direction() < 0);
+}
+EOF
+if { (eval echo configure:1302: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_c_stack_direction=-1
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
+cat >> confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
+
+fi
+
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1327: 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 1332 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1337: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1366: 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 1371 "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:1394: \"$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
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:1419: 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
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1427 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the filesystem buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propogated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* This mess was copied from the GNU getpagesize.h. */
+#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+/* Assume that all systems that can run configure have sys/param.h. */
+# ifndef HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize();
+
+ /*
+ * First, make a file with some known garbage in it.
+ */
+ data = malloc(pagesize);
+ if (!data)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand();
+ umask(0);
+ fd = creat("conftestmmap", 0600);
+ if (fd < 0)
+ exit(1);
+ if (write(fd, data, pagesize) != pagesize)
+ exit(1);
+ close(fd);
+
+ /*
+ * Next, try to mmap the file at a fixed address which
+ * already has something else allocated at it. If we can,
+ * also make sure that we see the same garbage.
+ */
+ fd = open("conftestmmap", O_RDWR);
+ if (fd < 0)
+ exit(1);
+ data2 = malloc(2 * pagesize);
+ if (!data2)
+ exit(1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit(1);
+
+ /*
+ * Finally, make sure that changes to the mapped area
+ * do not percolate back to the file as seen by read().
+ * (This is a bug on some variants of i386 svr4.0.)
+ */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = malloc(pagesize);
+ if (!data3)
+ exit(1);
+ if (read(fd, data3, pagesize) != pagesize)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit(1);
+ close(fd);
+ unlink("conftestmmap");
+ exit(0);
+}
+
+EOF
+if { (eval echo configure:1567: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+
+
+# autoconf.info says this should be called right after AC_INIT.
+
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1640: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:1661: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1679: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+# 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:1723: 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
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # 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:1752: 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
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # 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:1802: 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
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1833: 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.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 1843 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1847: \"$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
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; 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:1867: 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:1872: 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
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1881: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1900: 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
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# 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:1943: 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
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+else
+ CC_FOR_BUILD=gcc
+fi
+
+
+
+
+AR=${AR-ar}
+
+# 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:2009: 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
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ALL_LINGUAS=
+
+ for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2043: 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 2048 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2053: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2083: 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 2088 "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:2111: \"$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
+
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ for ac_func in stpcpy
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2140: 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 2145 "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:2168: \"$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
+
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STPCPY 1
+EOF
+
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
+echo "configure:2202: 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 2207 "configure"
+#include "confdefs.h"
+#include <locale.h>
+int main() {
+return LC_MESSAGES
+; return 0; }
+EOF
+if { (eval echo configure:2214: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LC_MESSAGES 1
+EOF
+
+ fi
+ fi
+ echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
+echo "configure:2235: 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"
+ USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ echo "$ac_t""$USE_NLS" 1>&6
+
+
+ USE_INCLUDED_LIBINTL=no
+
+ if test "$USE_NLS" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define ENABLE_NLS 1
+EOF
+
+ echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
+echo "configure:2255: 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"
+ nls_cv_force_use_gnu_gettext=$withval
+else
+ nls_cv_force_use_gnu_gettext=no
+fi
+
+ echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
+echo "configure:2274: 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 2279 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2284: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+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:2301: 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 2306 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:2313: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gt_cv_func_gettext_libc=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
+echo "configure:2329: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2337 "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
+ builtin and then its argument prototype would still apply. */
+char bindtextdomain();
+
+int main() {
+bindtextdomain()
+; return 0; }
+EOF
+if { (eval echo configure:2348: \"$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 "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+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:2364: 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 2369 "configure"
+#include "confdefs.h"
+
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:2376: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gt_cv_func_gettext_libintl=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ # 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:2404: 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
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ if test "$MSGFMT" != "no"; then
+ for ac_func in dcgettext
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2438: 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 2443 "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:2466: \"$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
+
+ # 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:2493: 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
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # 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:2528: 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
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ cat > conftest.$ac_ext <<EOF
+#line 2560 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr
+; return 0; }
+EOF
+if { (eval echo configure:2568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ CATOBJEXT=.gmo
+ DATADIRNAME=share
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
+fi
+rm -f conftest*
+ INSTOBJEXT=.mo
+ fi
+ fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+ if test "$CATOBJEXT" = "NONE"; then
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ INTLOBJS="\$(GETTOBJS)"
+ # 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:2600: 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
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # 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:2634: 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
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # 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:2669: 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
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INSTOBJEXT=.mo
+ DATADIRNAME=share
+ INTLDEPS='$(top_builddir)/../intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=libintl.h
+ nls_cv_header_libgt=libgettext.h
+ fi
+
+ if test "$XGETTEXT" != ":"; then
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=libintl.h
+ nls_cv_header_libgt=libgettext.h
+ fi
+
+ # If this is used in GNU gettext we have to set USE_NLS to `yes'
+ # because some of the sources are only built for this goal.
+ if test "$PACKAGE" = gettext; then
+ USE_NLS=yes
+ USE_INCLUDED_LIBINTL=yes
+ fi
+
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
+echo "configure:2759: checking for catalogs to be installed" >&5
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ echo "$ac_t""$LINGUAS" 1>&6
+ fi
+
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+
+
+ if test -f $srcdir/po2tbl.sed.in; then
+ 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:2787: 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 2792 "configure"
+#include "confdefs.h"
+#include <linux/version.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2797: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ msgformat=linux
+else
+ echo "$ac_t""no" 1>&6
+msgformat=xopen
+fi
+
+
+ sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
+ fi
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/po2tbl.sed.in > po2tbl.sed
+ fi
+
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+
+
+
+ MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
+
+
+ l=
+
+
+ if test -d $srcdir/po; then
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ fi
+
+
+# Check for common headers.
+# FIXME: Seems to me this can cause problems for i386-windows hosts.
+# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
+for ac_hdr in stdlib.h string.h strings.h unistd.h time.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2866: 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 2871 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2876: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in sys/time.h sys/resource.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2906: 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 2911 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2916: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in fcntl.h fpu_control.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2946: 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 2951 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2956: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getrusage time sigaction __setfpucw
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2985: 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 2990 "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:3013: \"$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
+
+
+# Check for socket libraries
+echo $ac_n "checking for bind in -lsocket""... $ac_c" 1>&6
+echo "configure:3040: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3048 "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
+ builtin and then its argument prototype would still apply. */
+char bind();
+
+int main() {
+bind()
+; return 0; }
+EOF
+if { (eval echo configure:3059: \"$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 "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:3087: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lnsl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3095 "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
+ builtin and then its argument prototype would still apply. */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:3106: \"$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 "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+. ${srcdir}/../../bfd/configure.host
+
+
+
+USE_MAINTAINER_MODE=no
+# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ case "${enableval}" in
+ yes) MAINT="" USE_MAINTAINER_MODE=yes ;;
+ no) MAINT="#" ;;
+ *) { echo "configure: error: "--enable-maintainer-mode does not take a value"" 1>&2; exit 1; }; MAINT="#" ;;
+esac
+if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
+ echo "Setting maintainer mode" 6>&1
+fi
+else
+ MAINT="#"
+fi
+
+
+
+# Check whether --enable-sim-bswap or --disable-sim-bswap was given.
+if test "${enable_sim_bswap+set}" = set; then
+ enableval="$enable_sim_bswap"
+ case "${enableval}" in
+ yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
+ no) sim_bswap="-DWITH_BSWAP=0";;
+ *) { echo "configure: error: "--enable-sim-bswap does not take a value"" 1>&2; exit 1; }; sim_bswap="";;
+esac
+if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
+ echo "Setting bswap flags = $sim_bswap" 6>&1
+fi
+else
+ sim_bswap=""
+fi
+
+
+
+# Check whether --enable-sim-cflags or --disable-sim-cflags was given.
+if test "${enable_sim_cflags+set}" = set; then
+ enableval="$enable_sim_cflags"
+ case "${enableval}" in
+ yes) sim_cflags="-O2 -fomit-frame-pointer";;
+ trace) { echo "configure: error: "Please use --enable-sim-debug instead."" 1>&2; exit 1; }; sim_cflags="";;
+ no) sim_cflags="";;
+ *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
+ echo "Setting sim cflags = $sim_cflags" 6>&1
+fi
+else
+ sim_cflags=""
+fi
+
+
+
+# Check whether --enable-sim-debug or --disable-sim-debug was given.
+if test "${enable_sim_debug+set}" = set; then
+ enableval="$enable_sim_debug"
+ case "${enableval}" in
+ yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
+ no) sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
+ *) sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
+esac
+if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
+ echo "Setting sim debug = $sim_debug" 6>&1
+fi
+else
+ sim_debug=""
+fi
+
+
+
+# Check whether --enable-sim-stdio or --disable-sim-stdio was given.
+if test "${enable_sim_stdio+set}" = set; then
+ enableval="$enable_sim_stdio"
+ case "${enableval}" in
+ yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
+ no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
+ *) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-stdio"" 1>&2; exit 1; }; sim_stdio="";;
+esac
+if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
+ echo "Setting stdio flags = $sim_stdio" 6>&1
+fi
+else
+ sim_stdio=""
+fi
+
+
+
+# Check whether --enable-sim-trace or --disable-sim-trace was given.
+if test "${enable_sim_trace+set}" = set; then
+ enableval="$enable_sim_trace"
+ case "${enableval}" in
+ yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
+ no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
+ [-0-9]*)
+ sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
+ [a-z]*)
+ sim_trace=""
+ for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
+ if test x"$sim_trace" = x; then
+ sim_trace="-DWITH_TRACE='(TRACE_$x"
+ else
+ sim_trace="${sim_trace}|TRACE_$x"
+ fi
+ done
+ sim_trace="$sim_trace)'" ;;
+esac
+if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
+ echo "Setting sim trace = $sim_trace" 6>&1
+fi
+else
+ sim_trace=""
+fi
+
+
+
+# Check whether --enable-sim-profile or --disable-sim-profile was given.
+if test "${enable_sim_profile+set}" = set; then
+ enableval="$enable_sim_profile"
+ case "${enableval}" in
+ yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
+ no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
+ [-0-9]*)
+ sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
+ [a-z]*)
+ sim_profile=""
+ for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
+ if test x"$sim_profile" = x; then
+ sim_profile="-DWITH_PROFILE='(PROFILE_$x"
+ else
+ sim_profile="${sim_profile}|PROFILE_$x"
+ fi
+ done
+ sim_profile="$sim_profile)'" ;;
+esac
+if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
+ echo "Setting sim profile = $sim_profile" 6>&1
+fi
+else
+ sim_profile=""
+fi
+
+
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:3282: 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 3287 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:3304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:3324: 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 "$CYGWIN32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*
+fi
+
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+echo "$ac_t""${am_cv_exeext}" 1>&6
+
+
+sim_link_files=
+sim_link_links=
+
+sim_link_links=tconfig.h
+if test -f ${srcdir}/tconfig.in
+then
+ sim_link_files=tconfig.in
+else
+ sim_link_files=../common/tconfig.in
+fi
+
+# targ-vals.def points to the libc macro description file.
+case "${target}" in
+*-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
+esac
+sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
+sim_link_links="${sim_link_links} targ-vals.def"
+
+
+
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3372: 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 3377 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3382: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.2"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@sim_environment@%$sim_environment%g
+s%@sim_alignment@%$sim_alignment%g
+s%@sim_assert@%$sim_assert%g
+s%@sim_bitsize@%$sim_bitsize%g
+s%@sim_endian@%$sim_endian%g
+s%@sim_hostendian@%$sim_hostendian%g
+s%@sim_float@%$sim_float%g
+s%@sim_scache@%$sim_scache%g
+s%@sim_default_model@%$sim_default_model%g
+s%@sim_hw_cflags@%$sim_hw_cflags%g
+s%@sim_hw_objs@%$sim_hw_objs%g
+s%@sim_hw@%$sim_hw%g
+s%@sim_inline@%$sim_inline%g
+s%@sim_packages@%$sim_packages%g
+s%@sim_regparm@%$sim_regparm%g
+s%@sim_reserved_bits@%$sim_reserved_bits%g
+s%@sim_smp@%$sim_smp%g
+s%@sim_stdcall@%$sim_stdcall%g
+s%@sim_xor_endian@%$sim_xor_endian%g
+s%@build_warnings@%$build_warnings%g
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@CC@%$CC%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
+s%@HDEFINES@%$HDEFINES%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CPP@%$CPP%g
+s%@ALLOCA@%$ALLOCA%g
+s%@USE_NLS@%$USE_NLS%g
+s%@MSGFMT@%$MSGFMT%g
+s%@GMSGFMT@%$GMSGFMT%g
+s%@XGETTEXT@%$XGETTEXT%g
+s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
+s%@CATALOGS@%$CATALOGS%g
+s%@CATOBJEXT@%$CATOBJEXT%g
+s%@DATADIRNAME@%$DATADIRNAME%g
+s%@GMOFILES@%$GMOFILES%g
+s%@INSTOBJEXT@%$INSTOBJEXT%g
+s%@INTLDEPS@%$INTLDEPS%g
+s%@INTLLIBS@%$INTLLIBS%g
+s%@INTLOBJS@%$INTLOBJS%g
+s%@POFILES@%$POFILES%g
+s%@POSUB@%$POSUB%g
+s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
+s%@GT_NO@%$GT_NO%g
+s%@GT_YES@%$GT_YES%g
+s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
+s%@l@%$l%g
+s%@MAINT@%$MAINT%g
+s%@sim_bswap@%$sim_bswap%g
+s%@sim_cflags@%$sim_cflags%g
+s%@sim_debug@%$sim_debug%g
+s%@sim_stdio@%$sim_stdio%g
+s%@sim_trace@%$sim_trace%g
+s%@sim_profile@%$sim_profile%g
+s%@EXEEXT@%$EXEEXT%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h:config.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+ac_sources="$sim_link_files"
+ac_dests="$sim_link_links"
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+srcdir=$ac_given_srcdir
+while test -n "$ac_sources"; do
+ set $ac_dests; ac_dest=$1; shift; ac_dests=$*
+ set $ac_sources; ac_source=$1; shift; ac_sources=$*
+
+ echo "linking $srcdir/$ac_source to $ac_dest"
+
+ if test ! -r $srcdir/$ac_source; then
+ { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
+ fi
+ rm -f $ac_dest
+
+ # Make relative symlinks.
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
+ # The dest file is in a subdirectory.
+ test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
+ ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dest_dir_suffix.
+ ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dest_dir_suffix= ac_dots=
+ fi
+
+ case "$srcdir" in
+ [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
+ *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
+ esac
+
+ # Make a symlink if possible; otherwise try a hard link.
+ if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
+ ln $srcdir/$ac_source $ac_dest; then :
+ else
+ { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
+ fi
+done
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+case "x$CONFIG_FILES" in
+ xMakefile*)
+ echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
+ rm -f Makesim1.tmp Makesim2.tmp Makefile
+ sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
+ sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
+ sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
+ -e '/^## COMMON_POST_/ r Makesim2.tmp' \
+ <Makefile.sim >Makefile
+ rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
+ ;;
+ esac
+ case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+
diff --git a/sim/mn10200/configure.in b/sim/mn10200/configure.in
new file mode 100644
index 00000000000..033b0bc1615
--- /dev/null
+++ b/sim/mn10200/configure.in
@@ -0,0 +1,10 @@
+dnl Process this file with autoconf to produce a configure script.
+sinclude(../common/aclocal.m4)
+AC_PREREQ(2.5)dnl
+AC_INIT(Makefile.in)
+
+SIM_AC_COMMON
+
+AC_CHECK_HEADERS(unistd.h)
+
+SIM_AC_OUTPUT
diff --git a/sim/mn10200/gencode.c b/sim/mn10200/gencode.c
new file mode 100644
index 00000000000..8ba873eb224
--- /dev/null
+++ b/sim/mn10200/gencode.c
@@ -0,0 +1,154 @@
+#include "mn10200_sim.h"
+
+static void write_header PARAMS ((void));
+static void write_opcodes PARAMS ((void));
+static void write_template PARAMS ((void));
+
+int
+main (argc, argv)
+ int argc;
+ char *argv[];
+{
+ if ((argc > 1) && (strcmp (argv[1], "-h") == 0))
+ write_header();
+ else if ((argc > 1) && (strcmp (argv[1], "-t") == 0))
+ write_template ();
+ else
+ write_opcodes();
+ return 0;
+}
+
+
+static void
+write_header ()
+{
+ struct mn10200_opcode *opcode;
+
+ for (opcode = (struct mn10200_opcode *)mn10200_opcodes; opcode->name; opcode++)
+ printf("void OP_%X PARAMS ((unsigned long, unsigned long));\t\t/* %s */\n",
+ opcode->opcode, opcode->name);
+}
+
+
+/* write_template creates a file all required functions, ready */
+/* to be filled out */
+
+static void
+write_template ()
+{
+ struct mn10200_opcode *opcode;
+ int i,j;
+
+ printf ("#include \"mn10200_sim.h\"\n");
+ printf ("#include \"simops.h\"\n");
+
+ for (opcode = (struct mn10200_opcode *)mn10200_opcodes; opcode->name; opcode++)
+ {
+ printf("/* %s */\nvoid\nOP_%X (insn, extension)\n unsigned long insn, extension;\n{\n", opcode->name, opcode->opcode);
+
+ /* count operands */
+ j = 0;
+ for (i = 0; i < 6; i++)
+ {
+ int flags = mn10200_operands[opcode->operands[i]].flags;
+
+ if (flags)
+ j++;
+ }
+ switch (j)
+ {
+ case 0:
+ printf ("printf(\" %s\\n\");\n", opcode->name);
+ break;
+ case 1:
+ printf ("printf(\" %s\\t%%x\\n\", OP[0]);\n", opcode->name);
+ break;
+ case 2:
+ printf ("printf(\" %s\\t%%x,%%x\\n\",OP[0],OP[1]);\n",
+ opcode->name);
+ break;
+ case 3:
+ printf ("printf(\" %s\\t%%x,%%x,%%x\\n\",OP[0],OP[1],OP[2]);\n",
+ opcode->name);
+ break;
+ default:
+ fprintf (stderr,"Too many operands: %d\n", j);
+ }
+ printf ("}\n\n");
+ }
+}
+
+static void
+write_opcodes ()
+{
+ struct mn10200_opcode *opcode;
+ int i, j;
+ int numops;
+
+ /* write out opcode table */
+ printf ("#include \"mn10200_sim.h\"\n");
+ printf ("#include \"simops.h\"\n\n");
+ printf ("struct simops Simops[] = {\n");
+
+ for (opcode = (struct mn10200_opcode *)mn10200_opcodes; opcode->name; opcode++)
+ {
+ int size;
+
+ if (opcode->format == FMT_1)
+ size = 1;
+ else if (opcode->format == FMT_2 || opcode->format == FMT_4)
+ size = 2;
+ else if (opcode->format == FMT_3 || opcode->format == FMT_5)
+ size = 3;
+ else if (opcode->format == FMT_6)
+ size = 4;
+ else if (opcode->format == FMT_7)
+ size = 5;
+ else
+ abort ();
+
+ printf (" { 0x%x,0x%x,OP_%X,%d,%d,",
+ opcode->opcode, opcode->mask, opcode->opcode,
+ size, opcode->format);
+
+ /* count operands */
+ j = 0;
+ for (i = 0; i < 6; i++)
+ {
+ int flags = mn10200_operands[opcode->operands[i]].flags;
+
+ if (flags)
+ j++;
+ }
+ printf ("%d,{",j);
+
+ j = 0;
+ numops = 0;
+ for (i = 0; i < 6; i++)
+ {
+ int flags = mn10200_operands[opcode->operands[i]].flags;
+ int shift = mn10200_operands[opcode->operands[i]].shift;
+
+ if (flags)
+ {
+ if (j)
+ printf (", ");
+ printf ("%d,%d,%d", shift,
+ mn10200_operands[opcode->operands[i]].bits,flags);
+ j = 1;
+ numops++;
+ }
+ }
+
+ switch (numops)
+ {
+ case 0:
+ printf ("0,0,0");
+ case 1:
+ printf (",0,0,0");
+ }
+
+ printf ("}},\n");
+ }
+ printf ("{ 0,0,NULL,0,0,0,{0,0,0,0,0,0}},\n};\n");
+}
diff --git a/sim/mn10200/interp.c b/sim/mn10200/interp.c
new file mode 100644
index 00000000000..df95b7c7ba5
--- /dev/null
+++ b/sim/mn10200/interp.c
@@ -0,0 +1,800 @@
+#include <signal.h>
+#include "sysdep.h"
+#include "bfd.h"
+
+#include "mn10200_sim.h"
+
+host_callback *mn10200_callback;
+int mn10200_debug;
+static SIM_OPEN_KIND sim_kind;
+static char *myname;
+
+static void dispatch PARAMS ((uint32, uint32, int));
+static long hash PARAMS ((long));
+static void init_system PARAMS ((void));
+#define MAX_HASH 127
+
+struct hash_entry
+{
+ struct hash_entry *next;
+ long opcode;
+ long mask;
+ struct simops *ops;
+#ifdef HASH_STAT
+ unsigned long count;
+#endif
+};
+
+int max_mem = 0;
+struct hash_entry hash_table[MAX_HASH+1];
+
+
+/* This probably doesn't do a very good job at bucket filling, but
+ it's simple... */
+static INLINE long
+hash(insn)
+ long insn;
+{
+ /* These are one byte insns. */
+ if ((insn & 0xffffff00) == 0x00)
+ {
+ if ((insn & 0xf0) != 0x80)
+ return ((insn & 0xf0) >> 4) & 0x7f;
+
+ if ((insn & 0xf0) == 0x80
+ && (insn & 0x0c) >> 2 != (insn & 0x03))
+ return (insn & 0xf0) & 0x7f;
+
+ return (insn & 0xff) & 0x7f;
+ }
+
+ if ((insn & 0xffff0000) == 0)
+ {
+ if ((insn & 0xf000) == 0xd000)
+ return ((insn & 0xfc00) >> 10) & 0x7f;
+
+ if ((insn & 0xf000) == 0xe000)
+ return ((insn & 0xff00) >> 8) & 0x7f;
+
+ if ((insn & 0xf200) == 0xf200)
+ return ((insn & 0xfff0) >> 4) & 0x7f;
+
+ if ((insn & 0xc000) == 0x4000
+ || (insn & 0xf000) == 0x8000)
+ return ((insn & 0xf000) >> 8) & 0x7f;
+
+ if ((insn & 0xf200) == 0xf000)
+ return ((insn & 0xffc0) >> 8) & 0x7f;
+
+ return ((insn & 0xff00) >> 8) & 0x7f;
+ }
+
+ if ((insn & 0xff000000) == 0)
+ {
+
+ if ((insn & 0xf00000) != 0xf00000
+ || (insn & 0xfc0000) == 0xf80000)
+ return ((insn & 0xfc0000) >> 16) & 0x7f;
+
+ if ((insn & 0xff0000) == 0xf50000)
+ return ((insn & 0xfff000) >> 12) & 0x7f;
+ return ((insn & 0xff0000) >> 16) & 0x7f;
+ }
+
+ return ((insn & 0xfff0000) >> 20) & 0x7f;
+}
+
+static INLINE void
+dispatch (insn, extension, length)
+ uint32 insn;
+ uint32 extension;
+ int length;
+{
+ struct hash_entry *h;
+
+ h = &hash_table[hash(insn)];
+
+ while ((insn & h->mask) != h->opcode
+ || (length != h->ops->length))
+ {
+ if (!h->next)
+ {
+ (*mn10200_callback->printf_filtered) (mn10200_callback,
+ "ERROR looking up hash for 0x%x, PC=0x%x\n", insn, PC);
+ exit(1);
+ }
+ h = h->next;
+ }
+
+
+#ifdef HASH_STAT
+ h->count++;
+#endif
+
+ /* Now call the right function. */
+ (h->ops->func)(insn, extension);
+ PC += length;
+}
+
+/* FIXME These would more efficient to use than load_mem/store_mem,
+ but need to be changed to use the memory map. */
+
+uint32
+get_word (x)
+ uint8 *x;
+{
+ uint8 *a = x;
+ return (a[3]<<24) + (a[2]<<16) + (a[1]<<8) + (a[0]);
+}
+
+void
+put_word (addr, data)
+ uint8 *addr;
+ uint32 data;
+{
+ uint8 *a = addr;
+ a[0] = data & 0xff;
+ a[1] = (data >> 8) & 0xff;
+ a[2] = (data >> 16) & 0xff;
+ a[3] = (data >> 24) & 0xff;
+}
+
+void
+sim_size (power)
+ int power;
+
+{
+ if (State.mem)
+ free (State.mem);
+
+ max_mem = 1 << power;
+ State.mem = (uint8 *) calloc (1, 1 << power);
+ if (!State.mem)
+ {
+ (*mn10200_callback->printf_filtered) (mn10200_callback, "Allocation of main memory failed.\n");
+ exit (1);
+ }
+}
+
+static void
+init_system ()
+{
+ if (!State.mem)
+ sim_size(19);
+}
+
+int
+sim_write (sd,addr, buffer, size)
+ SIM_DESC sd;
+ SIM_ADDR addr;
+ unsigned char *buffer;
+ int size;
+{
+ int i;
+
+ init_system ();
+
+ for (i = 0; i < size; i++)
+ store_byte (addr + i, buffer[i]);
+
+ return size;
+}
+
+/* Compare two opcode table entries for qsort. */
+static int
+compare_simops (arg1, arg2)
+ const PTR arg1;
+ const PTR arg2;
+{
+ unsigned long code1 = ((struct simops *)arg1)->opcode;
+ unsigned long code2 = ((struct simops *)arg2)->opcode;
+
+ if (code1 < code2)
+ return -1;
+ if (code2 < code1)
+ return 1;
+ return 0;
+}
+
+SIM_DESC
+sim_open (kind, cb, abfd, argv)
+ SIM_OPEN_KIND kind;
+ host_callback *cb;
+ struct _bfd *abfd;
+ char **argv;
+{
+ struct simops *s;
+ struct hash_entry *h;
+ char **p;
+ int i;
+
+ mn10200_callback = cb;
+
+ /* Sort the opcode array from smallest opcode to largest.
+ This will generally improve simulator performance as the smaller
+ opcodes are generally preferred to the larger opcodes. */
+ for (i = 0, s = Simops; s->func; s++, i++)
+ ;
+ qsort (Simops, i, sizeof (Simops[0]), compare_simops);
+
+ sim_kind = kind;
+ myname = argv[0];
+
+ for (p = argv + 1; *p; ++p)
+ {
+ if (strcmp (*p, "-E") == 0)
+ ++p; /* ignore endian spec */
+ else
+#ifdef DEBUG
+ if (strcmp (*p, "-t") == 0)
+ mn10200_debug = DEBUG;
+ else
+#endif
+ (*mn10200_callback->printf_filtered) (mn10200_callback, "ERROR: unsupported option(s): %s\n",*p);
+ }
+
+ /* put all the opcodes in the hash table */
+ for (s = Simops; s->func; s++)
+ {
+ h = &hash_table[hash(s->opcode)];
+
+ /* go to the last entry in the chain */
+ while (h->next)
+ {
+ /* Don't insert the same opcode more than once. */
+ if (h->opcode == s->opcode
+ && h->mask == s->mask
+ && h->ops == s)
+ break;
+ else
+ h = h->next;
+ }
+
+ /* Don't insert the same opcode more than once. */
+ if (h->opcode == s->opcode
+ && h->mask == s->mask
+ && h->ops == s)
+ continue;
+
+ if (h->ops)
+ {
+ h->next = calloc(1,sizeof(struct hash_entry));
+ h = h->next;
+ }
+ h->ops = s;
+ h->mask = s->mask;
+ h->opcode = s->opcode;
+#ifdef HASH_STAT
+ h->count = 0;
+#endif
+ }
+
+ /* fudge our descriptor for now */
+ return (SIM_DESC) 1;
+}
+
+
+void
+sim_set_profile (n)
+ int n;
+{
+ (*mn10200_callback->printf_filtered) (mn10200_callback, "sim_set_profile %d\n", n);
+}
+
+void
+sim_set_profile_size (n)
+ int n;
+{
+ (*mn10200_callback->printf_filtered) (mn10200_callback, "sim_set_profile_size %d\n", n);
+}
+
+int
+sim_stop (sd)
+ SIM_DESC sd;
+{
+ return 0;
+}
+
+void
+sim_resume (sd, step, siggnal)
+ SIM_DESC sd;
+ int step, siggnal;
+{
+ uint32 inst;
+
+ if (step)
+ State.exception = SIGTRAP;
+ else
+ State.exception = 0;
+
+ State.exited = 0;
+
+ do
+ {
+ unsigned long insn, extension;
+
+ /* Fetch the current instruction, fetch a double word to
+ avoid redundant fetching for the common cases below. */
+ inst = load_mem_big (PC, 2);
+
+ /* Using a giant case statement may seem like a waste because of the
+ code/rodata size the table itself will consume. However, using
+ a giant case statement speeds up the simulator by 10-15% by avoiding
+ cascading if/else statements or cascading case statements. */
+ switch ((inst >> 8) & 0xff)
+ {
+ /* All the single byte insns except 0x80, which must
+ be handled specially. */
+ case 0x00:
+ case 0x01:
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ case 0x07:
+ case 0x08:
+ case 0x09:
+ case 0x0a:
+ case 0x0b:
+ case 0x0c:
+ case 0x0d:
+ case 0x0e:
+ case 0x0f:
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ case 0x16:
+ case 0x17:
+ case 0x18:
+ case 0x19:
+ case 0x1a:
+ case 0x1b:
+ case 0x1c:
+ case 0x1d:
+ case 0x1e:
+ case 0x1f:
+ case 0x20:
+ case 0x21:
+ case 0x22:
+ case 0x23:
+ case 0x24:
+ case 0x25:
+ case 0x26:
+ case 0x27:
+ case 0x28:
+ case 0x29:
+ case 0x2a:
+ case 0x2b:
+ case 0x2c:
+ case 0x2d:
+ case 0x2e:
+ case 0x2f:
+ case 0x30:
+ case 0x31:
+ case 0x32:
+ case 0x33:
+ case 0x34:
+ case 0x35:
+ case 0x36:
+ case 0x37:
+ case 0x38:
+ case 0x39:
+ case 0x3a:
+ case 0x3b:
+ case 0x3c:
+ case 0x3d:
+ case 0x3e:
+ case 0x3f:
+ case 0x90:
+ case 0x91:
+ case 0x92:
+ case 0x93:
+ case 0x94:
+ case 0x95:
+ case 0x96:
+ case 0x97:
+ case 0x98:
+ case 0x99:
+ case 0x9a:
+ case 0x9b:
+ case 0x9c:
+ case 0x9d:
+ case 0x9e:
+ case 0x9f:
+ case 0xa0:
+ case 0xa1:
+ case 0xa2:
+ case 0xa3:
+ case 0xa4:
+ case 0xa5:
+ case 0xa6:
+ case 0xa7:
+ case 0xa8:
+ case 0xa9:
+ case 0xaa:
+ case 0xab:
+ case 0xac:
+ case 0xad:
+ case 0xae:
+ case 0xaf:
+ case 0xb0:
+ case 0xb1:
+ case 0xb2:
+ case 0xb3:
+ case 0xb4:
+ case 0xb5:
+ case 0xb6:
+ case 0xb7:
+ case 0xb8:
+ case 0xb9:
+ case 0xba:
+ case 0xbb:
+ case 0xbc:
+ case 0xbd:
+ case 0xbe:
+ case 0xbf:
+ case 0xeb:
+ case 0xf6:
+ case 0xfe:
+ case 0xff:
+ insn = (inst >> 8) & 0xff;
+ extension = 0;
+ dispatch (insn, extension, 1);
+ break;
+
+ /* Special case as mov dX,dX really means mov imm8,dX. */
+ case 0x80:
+ case 0x85:
+ case 0x8a:
+ case 0x8f:
+ /* Fetch the full instruction. */
+ insn = inst;
+ extension = 0;
+ dispatch (insn, extension, 2);
+ break;
+
+ case 0x81:
+ case 0x82:
+ case 0x83:
+ case 0x84:
+ case 0x86:
+ case 0x87:
+ case 0x88:
+ case 0x89:
+ case 0x8b:
+ case 0x8c:
+ case 0x8d:
+ case 0x8e:
+ insn = (inst >> 8) & 0xff;
+ extension = 0;
+ dispatch (insn, extension, 1);
+ break;
+
+ /* And the two byte insns. */
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ case 0x48:
+ case 0x49:
+ case 0x4a:
+ case 0x4b:
+ case 0x4c:
+ case 0x4d:
+ case 0x4e:
+ case 0x4f:
+ case 0x50:
+ case 0x51:
+ case 0x52:
+ case 0x53:
+ case 0x54:
+ case 0x55:
+ case 0x56:
+ case 0x57:
+ case 0x58:
+ case 0x59:
+ case 0x5a:
+ case 0x5b:
+ case 0x5c:
+ case 0x5d:
+ case 0x5e:
+ case 0x5f:
+ case 0x60:
+ case 0x61:
+ case 0x62:
+ case 0x63:
+ case 0x64:
+ case 0x65:
+ case 0x66:
+ case 0x67:
+ case 0x68:
+ case 0x69:
+ case 0x6a:
+ case 0x6b:
+ case 0x6c:
+ case 0x6d:
+ case 0x6e:
+ case 0x6f:
+ case 0x70:
+ case 0x71:
+ case 0x72:
+ case 0x73:
+ case 0x74:
+ case 0x75:
+ case 0x76:
+ case 0x77:
+ case 0x78:
+ case 0x79:
+ case 0x7a:
+ case 0x7b:
+ case 0x7c:
+ case 0x7d:
+ case 0x7e:
+ case 0x7f:
+ case 0xd0:
+ case 0xd1:
+ case 0xd2:
+ case 0xd3:
+ case 0xd4:
+ case 0xd5:
+ case 0xd6:
+ case 0xd7:
+ case 0xd8:
+ case 0xd9:
+ case 0xda:
+ case 0xdb:
+ case 0xe0:
+ case 0xe1:
+ case 0xe2:
+ case 0xe3:
+ case 0xe4:
+ case 0xe5:
+ case 0xe6:
+ case 0xe7:
+ case 0xe8:
+ case 0xe9:
+ case 0xea:
+ case 0xf0:
+ case 0xf1:
+ case 0xf2:
+ case 0xf3:
+ /* Fetch the full instruction. */
+ insn = inst;
+ extension = 0;
+ dispatch (insn, extension, 2);
+ break;
+
+ /* And the 3 byte insns with a 16bit operand in little
+ endian format. */
+ case 0xc0:
+ case 0xc1:
+ case 0xc2:
+ case 0xc3:
+ case 0xc4:
+ case 0xc5:
+ case 0xc6:
+ case 0xc7:
+ case 0xc8:
+ case 0xc9:
+ case 0xca:
+ case 0xcb:
+ case 0xcc:
+ case 0xcd:
+ case 0xce:
+ case 0xcf:
+ case 0xdc:
+ case 0xdd:
+ case 0xde:
+ case 0xdf:
+ case 0xec:
+ case 0xed:
+ case 0xee:
+ case 0xef:
+ case 0xf8:
+ case 0xf9:
+ case 0xfa:
+ case 0xfb:
+ case 0xfc:
+ case 0xfd:
+ insn = load_byte (PC);
+ insn <<= 16;
+ insn |= load_half (PC + 1);
+ extension = 0;
+ dispatch (insn, extension, 3);
+ break;
+
+ /* 3 byte insns without 16bit operand. */
+ case 0xf5:
+ insn = load_mem_big (PC, 3);
+ extension = 0;
+ dispatch (insn, extension, 3);
+ break;
+
+ /* 4 byte insns. */
+ case 0xf7:
+ insn = inst;
+ insn <<= 16;
+ insn |= load_half (PC + 2);
+ extension = 0;
+ dispatch (insn, extension, 4);
+ break;
+
+ case 0xf4:
+ insn = inst;
+ insn <<= 16;
+ insn |= load_mem_big (PC + 4, 1) << 8;
+ insn |= load_mem_big (PC + 3, 1);
+ extension = load_mem_big (PC + 2, 1);
+ dispatch (insn, extension, 5);
+ break;
+
+ default:
+ abort ();
+ }
+ }
+ while (!State.exception);
+
+#ifdef HASH_STAT
+ {
+ int i;
+ for (i = 0; i < MAX_HASH; i++)
+ {
+ struct hash_entry *h;
+ h = &hash_table[i];
+
+ printf("hash 0x%x:\n", i);
+
+ while (h)
+ {
+ printf("h->opcode = 0x%x, count = 0x%x\n", h->opcode, h->count);
+ h = h->next;
+ }
+
+ printf("\n\n");
+ }
+ fflush (stdout);
+ }
+#endif
+
+}
+
+
+void
+sim_close (sd, quitting)
+ SIM_DESC sd;
+ int quitting;
+{
+ /* nothing to do */
+}
+
+int
+sim_trace (sd)
+ SIM_DESC sd;
+{
+#ifdef DEBUG
+ mn10200_debug = DEBUG;
+#endif
+ sim_resume (sd, 0, 0);
+ return 1;
+}
+
+void
+sim_info (sd, verbose)
+ SIM_DESC sd;
+ int verbose;
+{
+ (*mn10200_callback->printf_filtered) (mn10200_callback, "sim_info\n");
+}
+
+SIM_RC
+sim_create_inferior (sd, abfd, argv, env)
+ SIM_DESC sd;
+ struct _bfd *abfd;
+ char **argv;
+ char **env;
+{
+ if (abfd != NULL)
+ PC = bfd_get_start_address (abfd);
+ else
+ PC = 0;
+ return SIM_RC_OK;
+}
+
+void
+sim_set_callbacks (p)
+ host_callback *p;
+{
+ mn10200_callback = p;
+}
+
+/* All the code for exiting, signals, etc needs to be revamped.
+
+ This is enough to get c-torture limping though. */
+
+void
+sim_stop_reason (sd, reason, sigrc)
+ SIM_DESC sd;
+ enum sim_stop *reason;
+ int *sigrc;
+{
+ if (State.exited)
+ *reason = sim_exited;
+ else
+ *reason = sim_stopped;
+ if (State.exception == SIGQUIT)
+ *sigrc = 0;
+ else
+ *sigrc = State.exception;
+}
+
+int
+sim_fetch_register (sd, rn, memory, length)
+ SIM_DESC sd;
+ int rn;
+ unsigned char *memory;
+ int length;
+{
+ put_word (memory, State.regs[rn]);
+ return -1;
+}
+
+int
+sim_store_register (sd, rn, memory, length)
+ SIM_DESC sd;
+ int rn;
+ unsigned char *memory;
+ int length;
+{
+ State.regs[rn] = get_word (memory);
+ return -1;
+}
+
+int
+sim_read (sd, addr, buffer, size)
+ SIM_DESC sd;
+ SIM_ADDR addr;
+ unsigned char *buffer;
+ int size;
+{
+ int i;
+ for (i = 0; i < size; i++)
+ buffer[i] = load_byte (addr + i);
+
+ return size;
+}
+
+void
+sim_do_command (sd, cmd)
+ SIM_DESC sd;
+ char *cmd;
+{
+ (*mn10200_callback->printf_filtered) (mn10200_callback, "\"%s\" is not a valid mn10200 simulator command.\n", cmd);
+}
+
+SIM_RC
+sim_load (sd, prog, abfd, from_tty)
+ SIM_DESC sd;
+ char *prog;
+ bfd *abfd;
+ int from_tty;
+{
+ extern bfd *sim_load_file (); /* ??? Don't know where this should live. */
+ bfd *prog_bfd;
+
+ prog_bfd = sim_load_file (sd, myname, mn10200_callback, prog, abfd,
+ sim_kind == SIM_OPEN_DEBUG,
+ 0, sim_write);
+ if (prog_bfd == NULL)
+ return SIM_RC_FAIL;
+ if (abfd == NULL)
+ bfd_close (prog_bfd);
+ return SIM_RC_OK;
+}
diff --git a/sim/mn10200/mn10200_sim.h b/sim/mn10200/mn10200_sim.h
new file mode 100644
index 00000000000..a7b7c4d888c
--- /dev/null
+++ b/sim/mn10200/mn10200_sim.h
@@ -0,0 +1,297 @@
+#include <stdio.h>
+#include <ctype.h>
+#include "ansidecl.h"
+#include "callback.h"
+#include "opcode/mn10200.h"
+#include <limits.h>
+#include "remote-sim.h"
+
+#ifndef INLINE
+#ifdef __GNUC__
+#define INLINE inline
+#else
+#define INLINE
+#endif
+#endif
+
+extern host_callback *mn10200_callback;
+
+#define DEBUG_TRACE 0x00000001
+#define DEBUG_VALUES 0x00000002
+
+extern int mn10200_debug;
+
+#ifdef __STDC__
+#define SIGNED signed
+#else
+#define SIGNED
+#endif
+
+#if UCHAR_MAX == 255
+typedef unsigned char uint8;
+typedef SIGNED char int8;
+#else
+error "Char is not an 8-bit type"
+#endif
+
+#if SHRT_MAX == 32767
+typedef unsigned short uint16;
+typedef SIGNED short int16;
+#else
+error "Short is not a 16-bit type"
+#endif
+
+#if INT_MAX == 2147483647
+
+typedef unsigned int uint32;
+typedef SIGNED int int32;
+
+#else
+# if LONG_MAX == 2147483647
+
+typedef unsigned long uint32;
+typedef SIGNED long int32;
+
+# else
+ error "Neither int nor long is a 32-bit type"
+# endif
+#endif
+
+typedef uint32 reg_t;
+
+struct simops
+{
+ long opcode;
+ long mask;
+ void (*func)();
+ int length;
+ int format;
+ int numops;
+ int operands[16];
+};
+
+/* The current state of the processor; registers, memory, etc. */
+
+struct _state
+{
+ reg_t regs[11]; /* registers, d0-d3, a0-a3, pc, mdr, psw */
+ uint8 *mem; /* main memory */
+ int exception; /* Actually a signal number. */
+ int exited; /* Did the program exit? */
+} State;
+
+extern uint32 OP[4];
+extern struct simops Simops[];
+
+#define PC (State.regs[8])
+
+#define PSW (State.regs[10])
+#define PSW_ZF 0x1
+#define PSW_NF 0x2
+#define PSW_CF 0x4
+#define PSW_VF 0x8
+#define PSW_ZX 0x10
+#define PSW_NX 0x20
+#define PSW_CX 0x40
+#define PSW_VX 0x80
+
+#define REG_D0 0
+#define REG_A0 4
+#define REG_SP 7
+#define REG_PC 8
+#define REG_MDR 9
+#define REG_PSW 10
+
+#define SEXT3(x) ((((x)&0x7)^(~0x3))+0x4)
+
+/* sign-extend a 4-bit number */
+#define SEXT4(x) ((((x)&0xf)^(~0x7))+0x8)
+
+/* sign-extend a 5-bit number */
+#define SEXT5(x) ((((x)&0x1f)^(~0xf))+0x10)
+
+/* sign-extend an 8-bit number */
+#define SEXT8(x) ((((x)&0xff)^(~0x7f))+0x80)
+
+/* sign-extend a 9-bit number */
+#define SEXT9(x) ((((x)&0x1ff)^(~0xff))+0x100)
+
+/* sign-extend a 16-bit number */
+#define SEXT16(x) ((((x)&0xffff)^(~0x7fff))+0x8000)
+
+/* sign-extend a 22-bit number */
+#define SEXT22(x) ((((x)&0x3fffff)^(~0x1fffff))+0x200000)
+
+/* sign-extend a 24-bit number */
+#define SEXT24(x) ((((x)&0xffffff)^(~0x7fffff))+0x800000)
+
+#ifdef _WIN32
+#define SIGTRAP 5
+#define SIGQUIT 3
+#endif
+
+extern int max_mem;
+
+#define load_mem_big(addr,len) \
+ (len == 1 ? *(((addr) & 0xffffff) + State.mem) : \
+ len == 2 ? ((*(((addr) & 0xffffff) + State.mem) << 8) \
+ | *((((addr) + 1) & 0xffffff) + State.mem)) : \
+ ((*(((addr) & 0xffffff) + State.mem) << 16) \
+ | (*((((addr) + 1) & 0xffffff) + State.mem) << 8) \
+ | *((((addr) + 2) & 0xffffff) + State.mem)))
+
+static INLINE uint32
+load_byte (addr)
+ SIM_ADDR addr;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ return p[0];
+}
+
+static INLINE uint32
+load_half (addr)
+ SIM_ADDR addr;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ return p[1] << 8 | p[0];
+}
+
+static INLINE uint32
+load_3_byte (addr)
+ SIM_ADDR addr;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ return p[2] << 16 | p[1] << 8 | p[0];
+}
+
+static INLINE uint32
+load_word (addr)
+ SIM_ADDR addr;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ return p[3] << 24 | p[2] << 16 | p[1] << 8 | p[0];
+}
+
+static INLINE uint32
+load_mem (addr, len)
+ SIM_ADDR addr;
+ int len;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ switch (len)
+ {
+ case 1:
+ return p[0];
+ case 2:
+ return p[1] << 8 | p[0];
+ case 3:
+ return p[2] << 16 | p[1] << 8 | p[0];
+ case 4:
+ return p[3] << 24 | p[2] << 16 | p[1] << 8 | p[0];
+ default:
+ abort ();
+ }
+}
+
+static INLINE void
+store_byte (addr, data)
+ SIM_ADDR addr;
+ uint32 data;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ p[0] = data;
+}
+
+static INLINE void
+store_half (addr, data)
+ SIM_ADDR addr;
+ uint32 data;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ p[0] = data;
+ p[1] = data >> 8;
+}
+
+static INLINE void
+store_3_byte (addr, data)
+ SIM_ADDR addr;
+ uint32 data;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ p[0] = data;
+ p[1] = data >> 8;
+ p[2] = data >> 16;
+}
+
+static INLINE void
+store_word (addr, data)
+ SIM_ADDR addr;
+ uint32 data;
+{
+ uint8 *p = (addr & 0xffffff) + State.mem;
+
+#ifdef CHECK_ADDR
+ if ((addr & 0xffffff) > max_mem)
+ abort ();
+#endif
+
+ p[0] = data;
+ p[1] = data >> 8;
+ p[2] = data >> 16;
+ p[3] = data >> 24;
+}
+
+/* Function declarations. */
+
+uint32 get_word PARAMS ((uint8 *));
+void put_word PARAMS ((uint8 *, uint32));
+
+extern uint8 *map PARAMS ((SIM_ADDR addr));
diff --git a/sim/mn10200/simops.c b/sim/mn10200/simops.c
new file mode 100644
index 00000000000..ecceccae92f
--- /dev/null
+++ b/sim/mn10200/simops.c
@@ -0,0 +1,2449 @@
+#include "config.h"
+
+#include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include "mn10200_sim.h"
+#include "simops.h"
+#include "targ-vals.h"
+#include "bfd.h"
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/times.h>
+#include <sys/time.h>
+
+#define REG0(X) ((X) & 0x3)
+#define REG1(X) (((X) & 0xc) >> 2)
+#define REG0_4(X) (((X) & 0x30) >> 4)
+#define REG0_8(X) (((X) & 0x300) >> 8)
+#define REG1_8(X) (((X) & 0xc00) >> 10)
+#define REG0_16(X) (((X) & 0x30000) >> 16)
+#define REG1_16(X) (((X) & 0xc0000) >> 18)
+#define TRUNC(X) ((X) & 0xffffff)
+
+/* mov imm8, dn */
+void OP_8000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_8 (insn)] = SEXT8 (insn & 0xff);
+}
+
+/* mov dn, dm */
+void OP_80 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_D0 + REG1 (insn)];
+}
+
+/* mov dm, an */
+void OP_F230 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0 (insn)] = State.regs[REG_D0 + REG1 (insn)];
+}
+
+/* mov an, dm */
+void OP_F2F0 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_A0 + REG1 (insn)];
+}
+
+/* mov an, am */
+void OP_F270 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0 (insn)] = State.regs[REG_A0 + REG1 (insn)];
+}
+
+/* mov psw, dn */
+void OP_F3F0 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = PSW & 0xffff;
+}
+
+/* mov dn, psw */
+void OP_F3D0 (insn, extension)
+ unsigned long insn, extension;
+{
+ PSW = State.regs[REG_D0 + REG1 (insn)] & 0xffff ;
+}
+
+/* mov mdr, dn */
+void OP_F3E0 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_MDR] & 0xffff;
+}
+
+/* mov dn, mdr */
+void OP_F3C0 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_MDR] = State.regs[REG_D0 + REG1 (insn)] & 0xffff;
+}
+
+/* mov (an), dm */
+void OP_20 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)]
+ = SEXT16 (load_half (State.regs[REG_A0 + REG1 (insn)]));
+}
+
+/* mov (d8,an), dm */
+void OP_6000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_8 (insn)]
+ = SEXT16 (load_half ((State.regs[REG_A0 + REG1_8 (insn)]
+ + SEXT8 (insn & 0xff))));
+}
+
+/* mov (d16,an), dm */
+void OP_F7C00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT16 (load_half ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT16 (insn & 0xffff))));
+}
+
+/* mov (d24,am), dn */
+void OP_F4800000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT16 (load_half ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension))));
+}
+
+/* mov (di,an), dm */
+void OP_F140 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)]
+ = SEXT16 (load_half ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)])));
+}
+
+/* mov (abs16), dn */
+void OP_C80000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)] = SEXT16 (load_half ((insn & 0xffff)));
+}
+
+/* mov (abs24), dn */
+void OP_F4C00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT16 (load_half ((((insn & 0xffff) << 8) + extension)));
+}
+
+/* mov (d8,an), am */
+void OP_7000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_8 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1_8 (insn)]
+ + SEXT8 (insn & 0xff))));
+}
+
+/* mov (d16,an), am */
+void OP_F7B00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_16 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT16 (insn & 0xffff))));
+}
+
+/* mov (d24,am), an */
+void OP_F4F00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_16 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension))));
+}
+
+/* mov (di,an), am */
+void OP_F100 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)])));
+}
+
+/* mov (abs16), an */
+void OP_F7300000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_16 (insn)] = SEXT24 (load_3_byte ((insn & 0xffff)));
+}
+
+/* mov (abs24), an */
+void OP_F4D00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_16 (insn)]
+ = SEXT24 (load_3_byte ((((insn & 0xffff) << 8) + extension)));
+}
+
+/* mov dm, (an) */
+void OP_0 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half (State.regs[REG_A0 + REG1 (insn)],
+ State.regs[REG_D0 + REG0 (insn)]);
+}
+
+/* mov dm, (d8,an) */
+void OP_4000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half (State.regs[REG_A0 + REG1_8 (insn)] + SEXT8 (insn & 0xff),
+ State.regs[REG_D0 + REG0_8 (insn)]);
+}
+
+/* mov dm, (d16,an) */
+void OP_F7800000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half (State.regs[REG_A0 + REG1_16 (insn)] + SEXT16 (insn & 0xffff),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* mov dm, (d24,am) */
+void OP_F4000000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension)),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* mov dm, (di,an) */
+void OP_F1C0 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)]),
+ State.regs[REG_D0 + REG0 (insn)]);
+}
+
+/* mov dn, (abs16) */
+void OP_C00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half ((insn & 0xffff), State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* mov dn, (abs24) */
+void OP_F4400000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_half (SEXT24 (((insn & 0xffff) << 8) + extension),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* mov am, (d8,an) */
+void OP_5000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte (State.regs[REG_A0 + REG1_8 (insn)] + SEXT8 (insn & 0xff),
+ State.regs[REG_A0 + REG0_8 (insn)]);
+}
+
+/* mov am, (d16,an) */
+void OP_F7A00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte (State.regs[REG_A0 + REG1_16 (insn)] + SEXT16 (insn & 0xffff),
+ State.regs[REG_A0 + REG0_16 (insn)]);
+}
+
+/* mov am, (d24,an) */
+void OP_F4100000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension)),
+ State.regs[REG_A0 + REG0_16 (insn)]);
+}
+
+/* mov am, (di,an) */
+void OP_F180 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)]),
+ State.regs[REG_A0 + REG0 (insn)]);
+}
+
+/* mov an, (abs16) */
+void OP_F7200000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte ((insn & 0xffff), State.regs[REG_A0 + REG0_16 (insn)]);
+}
+
+/* mov an, (abs24) */
+void OP_F4500000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte (SEXT24 (((insn & 0xffff) << 8) + extension),
+ State.regs[REG_A0 + REG0_16 (insn)]);
+}
+
+/* mov imm16, dn */
+void OP_F80000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)] = SEXT16 (insn & 0xffff);
+}
+
+/* mov imm24, dn */
+void OP_F4700000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT24 (((insn & 0xffff) << 8) + extension);
+}
+
+/* mov imm16, an */
+void OP_DC0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_16 (insn)] = insn & 0xffff;
+}
+
+/* mov imm24, an */
+void OP_F4740000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_A0 + REG0_16 (insn)]
+ = SEXT24 (((insn & 0xffff) << 8) + extension);
+}
+
+/* movx (d8,an), dm */
+void OP_F57000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_8 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1_8 (insn)]
+ + SEXT8 (insn & 0xff))));
+}
+
+/* movx (d16,an), dm */
+void OP_F7700000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT16 (insn & 0xffff))));
+}
+
+/* movx (d24,am), dn */
+void OP_F4B00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT24 (load_3_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension))));
+}
+
+/* movx dm, (d8,an) */
+void OP_F55000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte (State.regs[REG_A0 + REG1_8 (insn)] + SEXT8 (insn & 0xff),
+ State.regs[REG_D0 + REG0_8 (insn)]);
+}
+
+/* movx dm, (d16,an) */
+void OP_F7600000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte (State.regs[REG_A0 + REG1_16 (insn)] + SEXT16 (insn & 0xffff),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* movx dm, (d24,am) */
+void OP_F4300000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_3_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension)),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* movb (d8,an), dm */
+void OP_F52000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_8 (insn)]
+ = SEXT8 (load_byte ((State.regs[REG_A0 + REG1_8 (insn)]
+ + SEXT8 (insn & 0xff))));
+}
+
+/* movb (d16,an), dm */
+void OP_F7D00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT8 (load_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT16 (insn & 0xffff))));
+}
+
+/* movb (d24,am), dn */
+void OP_F4A00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT8 (load_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension))));
+}
+
+/* movb (di,an), dm */
+void OP_F040 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)]
+ = SEXT8 (load_byte ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)])));
+}
+
+/* mov (abs24), dn */
+void OP_F4C40000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = SEXT8 (load_byte ((((insn & 0xffff) << 8) + extension)));
+}
+
+/* movb dm, (an) */
+void OP_10 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte (State.regs[REG_A0 + REG1 (insn)],
+ State.regs[REG_D0 + REG0 (insn)]);
+}
+
+/* movb dm, (d8,an) */
+void OP_F51000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte (State.regs[REG_A0 + REG1_8 (insn)] + SEXT8 (insn & 0xff),
+ State.regs[REG_D0 + REG0_8 (insn)]);
+}
+
+/* movb dm, (d16,an) */
+void OP_F7900000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte (State.regs[REG_A0 + REG1_16 (insn)] + SEXT16 (insn & 0xffff),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* movb dm, (d24,am) */
+void OP_F4200000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension)),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* movb dm, (di,an) */
+void OP_F0C0 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)]),
+ State.regs[REG_D0 + REG0 (insn)]);
+}
+
+/* movb dn, (abs16) */
+void OP_C40000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte ((insn & 0xffff), State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* movb dn, (abs24) */
+void OP_F4440000 (insn, extension)
+ unsigned long insn, extension;
+{
+ store_byte (SEXT24 (((insn & 0xffff) << 8) + extension),
+ State.regs[REG_D0 + REG0_16 (insn)]);
+}
+
+/* movbu (an), dm */
+void OP_30 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)]
+ = load_byte (State.regs[REG_A0 + REG1 (insn)]);
+}
+
+/* movbu (d8,an), dm */
+void OP_F53000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_8 (insn)]
+ = load_byte ((State.regs[REG_A0 + REG1_8 (insn)] + SEXT8 (insn & 0xff)));
+}
+
+/* movbu (d16,an), dm */
+void OP_F7500000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = load_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT16 (insn & 0xffff)));
+}
+
+/* movbu (d24,am), dn */
+void OP_F4900000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = load_byte ((State.regs[REG_A0 + REG1_16 (insn)]
+ + SEXT24 (((insn & 0xffff) << 8) + extension)));
+}
+
+/* movbu (di,an), dm */
+void OP_F080 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)]
+ = load_byte ((State.regs[REG_A0 + REG1 (insn)]
+ + State.regs[REG_D0 + REG0_4 (insn)]));
+}
+
+/* movbu (abs16), dn */
+void OP_CC0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)] = load_byte ((insn & 0xffff));
+}
+
+/* movbu (abs24), dn */
+void OP_F4C80000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0_16 (insn)]
+ = load_byte ((((insn & 0xffff) << 8) + extension));
+}
+
+/* ext dn */
+void OP_F3C1 (insn, extension)
+ unsigned long insn, extension;
+{
+ if (State.regs[REG_D0 + REG1 (insn)] & 0x8000)
+ State.regs[REG_MDR] = 0xffff;
+ else
+ State.regs[REG_MDR] = 0;
+}
+
+/* extx dn */
+void OP_B0 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = SEXT16 (State.regs[REG_D0 + REG0 (insn)]);
+}
+
+/* extxu dn */
+void OP_B4 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_D0 + REG0 (insn)] & 0xffff;
+}
+
+/* extxb dn */
+void OP_B8 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = SEXT8 (State.regs[REG_D0 + REG0 (insn)]);
+}
+
+/* extxbu dn */
+void OP_BC (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_D0 + REG0 (insn)] & 0xff;
+}
+
+/* add dn,dm */
+void OP_90 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg1 + reg2);
+ State.regs[REG_D0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (reg2 & 0xffff));
+ cx = (value < reg1) || (value < reg2);
+ v = ((reg2 & 0x8000) == (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) == (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add dm, an */
+void OP_F200 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_A0 + REG0 (insn)]);
+ value = TRUNC (reg1 + reg2);
+ State.regs[REG_A0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (reg2 & 0xffff));
+ cx = (value < reg1) || (value < reg2);
+ v = ((reg2 & 0x8000) == (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) == (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add an, dm */
+void OP_F2C0 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg1 + reg2);
+ State.regs[REG_D0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (reg2 & 0xffff));
+ cx = (value < reg1) || (value < reg2);
+ v = ((reg2 & 0x8000) == (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) == (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add an,am */
+void OP_F240 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_A0 + REG0 (insn)]);
+ value = TRUNC (reg1 + reg2);
+ State.regs[REG_A0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (reg2 & 0xffff));
+ cx = (value < reg1) || (value < reg2);
+ v = ((reg2 & 0x8000) == (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) == (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add imm8, dn */
+void OP_D400 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_8 (insn)]);
+ imm = TRUNC (SEXT8 (insn & 0xff));
+ value = TRUNC (reg1 + imm);
+ State.regs[REG_D0 + REG0_8 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (imm & 0xffff));
+ cx = (value < reg1) || (value < imm);
+ v = ((reg1 & 0x8000) == (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) == (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add imm16, dn */
+void OP_F7180000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_16 (insn)]);
+ imm = TRUNC (SEXT16 (insn & 0xffff));
+ value = TRUNC (reg1 + imm);
+ State.regs[REG_D0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (imm & 0xffff));
+ cx = (value < reg1) || (value < imm);
+ v = ((reg1 & 0x8000) == (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) == (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add imm24,dn */
+void OP_F4600000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_16 (insn)]);
+ imm = TRUNC (((insn & 0xffff) << 8) + extension);
+ value = TRUNC (reg1 + imm);
+ State.regs[REG_D0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (imm & 0xffff));
+ cx = (value < reg1) || (value < imm);
+ v = ((reg1 & 0x8000) == (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) == (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add imm8, an */
+void OP_D000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_8 (insn)]);
+ imm = TRUNC (SEXT8 (insn & 0xff));
+ value = TRUNC (reg1 + imm);
+ State.regs[REG_A0 + REG0_8 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (imm & 0xffff));
+ cx = (value < reg1) || (value < imm);
+ v = ((reg1 & 0x8000) == (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) == (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add imm16, an */
+void OP_F7080000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_16 (insn)]);
+ imm = TRUNC (SEXT16 (insn & 0xffff));
+ value = TRUNC (reg1 + imm);
+ State.regs[REG_A0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (imm & 0xffff));
+ cx = (value < reg1) || (value < imm);
+ v = ((reg1 & 0x8000) == (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) == (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* add imm24, an */
+void OP_F4640000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_16 (insn)]);
+ imm = TRUNC (((insn & 0xffff) << 8) + extension);
+ value = TRUNC (reg1 + imm);
+ State.regs[REG_A0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff)) || ((value & 0xffff) < (imm & 0xffff));
+ cx = (value < reg1) || (value < imm);
+ v = ((reg1 & 0x8000) == (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) == (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* addc dm,dn */
+void OP_F280 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg1 + reg2 + ((PSW & PSW_CF) != 0));
+ State.regs[REG_D0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((value & 0xffff) < (reg1 & 0xffff))
+ || ((value & 0xffff) < (reg2 & 0xffff));
+ cx = (value < reg1) || (value < reg2);
+ v = ((reg2 & 0x8000) == (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) == (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* addnf imm8, an */
+void OP_F50C00 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long reg1, imm, value;
+
+ reg1 = State.regs[REG_A0 + REG0_8 (insn)];
+ imm = SEXT8 (insn & 0xff);
+ value = reg1 + imm;
+ State.regs[REG_A0 + REG0_8 (insn)] = TRUNC (value);
+}
+
+/* sub dn, dm */
+void OP_A0 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+ State.regs[REG_D0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub dm, an */
+void OP_F210 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_A0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+ State.regs[REG_A0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub an, dm */
+void OP_F2D0 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+ State.regs[REG_D0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub an, am */
+void OP_F250 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_A0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+ State.regs[REG_A0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub imm16, dn */
+void OP_F71C0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_16 (insn)]);
+ imm = TRUNC (SEXT16 (insn & 0xffff));
+ value = TRUNC (reg1 - imm);
+ State.regs[REG_D0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub imm24, dn */
+void OP_F4680000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_16 (insn)]);
+ imm = TRUNC (((insn & 0xffff) << 8) + extension);
+ value = TRUNC (reg1 - imm);
+ State.regs[REG_D0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub imm16, an */
+void OP_F70C0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_16 (insn)]);
+ imm = TRUNC (SEXT16 (insn & 0xffff));
+ value = TRUNC (reg1 - imm);
+ State.regs[REG_A0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* sub imm24, an */
+void OP_F46C0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_16 (insn)]);
+ imm = TRUNC (((insn & 0xffff) << 8) + extension);
+ value = TRUNC (reg1 - imm);
+ State.regs[REG_A0 + REG0_16 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* subc dm, dn */
+void OP_F290 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1 - ((PSW & PSW_CF) != 0));
+ State.regs[REG_D0 + REG0 (insn)] = value;
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* mul dn, dm */
+void OP_F340 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int n, z;
+
+ temp = (SEXT16 (State.regs[REG_D0 + REG0 (insn)] & 0xffff)
+ * SEXT16 ((State.regs[REG_D0 + REG1 (insn)] & 0xffff)));
+ State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffff;
+ State.regs[REG_MDR] = temp >> 16;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* mulu dn, dm */
+void OP_F350 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int n, z;
+
+ temp = ((State.regs[REG_D0 + REG0 (insn)] & 0xffff)
+ * (State.regs[REG_D0 + REG1 (insn)] & 0xffff));
+ State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffff;
+ State.regs[REG_MDR] = temp >> 16;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+
+/* divu dm, dn */
+void OP_F360 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int n, z;
+
+ temp = State.regs[REG_MDR];
+ temp &= 0xffff;
+ temp <<= 16;
+ temp |= (State.regs[REG_D0 + REG0 (insn)] & 0xffff);
+ State.regs[REG_MDR] = (temp
+ % (unsigned long)(State.regs[REG_D0 + REG1 (insn)] & 0xffff));
+ temp /= (unsigned long)(State.regs[REG_D0 + REG1 (insn)] & 0xffff);
+ State.regs[REG_D0 + REG0 (insn)] = temp & 0xffff;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* cmp imm8, dn */
+void OP_D800 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_8 (insn)]);
+ imm = TRUNC (SEXT8 (insn & 0xff));
+ value = TRUNC (reg1 - imm);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+}
+
+/* cmp dn, dm */
+void OP_F390 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp dm, an */
+void OP_F220 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_A0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp an, dm */
+void OP_F2E0 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_D0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp an, am */
+void OP_F260 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, reg2, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG1 (insn)]);
+ reg2 = TRUNC (State.regs[REG_A0 + REG0 (insn)]);
+ value = TRUNC (reg2 - reg1);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) > (reg2 & 0xffff));
+ cx = (reg1 > reg2);
+ v = ((reg2 & 0x8000) != (reg1 & 0x8000)
+ && (reg2 & 0x8000) != (value & 0x8000));
+ vx = ((reg2 & 0x800000) != (reg1 & 0x800000)
+ && (reg2 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp imm16, dn */
+void OP_F7480000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_16 (insn)]);
+ imm = TRUNC (SEXT16 (insn & 0xffff));
+ value = TRUNC (reg1 - imm);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp imm24, dn */
+void OP_F4780000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_D0 + REG0_16 (insn)]);
+ imm = TRUNC (((insn & 0xffff) << 8) + extension);
+ value = TRUNC (reg1 - imm);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp imm16, an */
+void OP_EC0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_16 (insn)]);
+ imm = TRUNC (insn & 0xffff);
+ value = TRUNC (reg1 - imm);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* cmp imm24, an */
+void OP_F47C0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, c, n, v, zx, cx, nx, vx;
+ unsigned long reg1, imm, value;
+
+ reg1 = TRUNC (State.regs[REG_A0 + REG0_16 (insn)]);
+ imm = TRUNC (((insn & 0xffff) << 8) + extension);
+ value = TRUNC (reg1 - imm);
+
+ z = ((value & 0xffff) == 0);
+ zx = (value == 0);
+ n = (value & 0x8000);
+ nx = (value & 0x800000);
+ c = ((reg1 & 0xffff) < (imm & 0xffff));
+ cx = (reg1 < imm);
+ v = ((reg1 & 0x8000) != (imm & 0x8000)
+ && (reg1 & 0x8000) != (value & 0x8000));
+ vx = ((reg1 & 0x800000) != (imm & 0x800000)
+ && (reg1 & 0x800000) != (value & 0x800000));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF
+ | PSW_ZX | PSW_NX | PSW_CX | PSW_VX);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0)
+ | (zx ? PSW_ZX : 0) | (nx ? PSW_NX : 0)
+ | (cx ? PSW_CX : 0) | (vx ? PSW_VX : 0));
+
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | ( n ? PSW_NF : 0)
+ | (c ? PSW_CF : 0) | (v ? PSW_VF : 0));
+}
+
+/* and dn, dm */
+void OP_F300 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0 (insn)] & State.regs[REG_D0 + REG1 (insn)];
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* and imm8, dn */
+void OP_F50000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0_8 (insn)] & (insn & 0xff);
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0_8 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0_8 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0_8 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* and imm16, dn */
+void OP_F7000000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0_16 (insn)] & (insn & 0xffff);
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0_16 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0_16 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0_16 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* and imm16, psw */
+void OP_F7100000 (insn, extension)
+ unsigned long insn, extension;
+{
+ PSW &= (insn & 0xffff);
+}
+
+/* or dn, dm */
+void OP_F310 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0 (insn)] | State.regs[REG_D0 + REG1 (insn)];
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* or imm8, dn */
+void OP_F50800 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0_8 (insn)] | (insn & 0xff);
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0_8 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0_8 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0_8 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* or imm16, dn */
+void OP_F7400000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0_16 (insn)] | (insn & 0xffff);
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0_16 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0_16 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0_16 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* or imm16, psw */
+void OP_F7140000 (insn, extension)
+ unsigned long insn, extension;
+{
+ PSW |= (insn & 0xffff);
+}
+
+/* xor dn, dm */
+void OP_F320 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0 (insn)] ^ State.regs[REG_D0 + REG1 (insn)];
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* xor imm16, dn */
+void OP_F74C0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = State.regs[REG_D0 + REG0_16 (insn)] ^ (insn & 0xffff);
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0_16 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0_16 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0_16 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* not dn */
+void OP_F3E4 (insn, extension)
+ unsigned long insn, extension;
+{
+ int n, z;
+ unsigned long temp;
+
+ temp = ~State.regs[REG_D0 + REG0 (insn)];
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0));
+}
+
+/* asr dn */
+void OP_F338 (insn, extension)
+ unsigned long insn, extension;
+{
+ long temp;
+ int z, n, c, high;
+
+ temp = State.regs[REG_D0 + REG0 (insn)] & 0xffff;
+ c = temp & 1;
+ high = temp & 0x8000;
+ temp >>= 1;
+ temp |= high;
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0) | (c ? PSW_CF : 0));
+}
+
+/* lsr dn */
+void OP_F33C (insn, extension)
+ unsigned long insn, extension;
+{
+ int z, n, c;
+ long temp;
+
+ temp = State.regs[REG_D0 + REG0 (insn)] & 0xffff;
+ c = temp & 1;
+ temp >>= 1;
+ temp &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= temp;
+ z = (State.regs[REG_D0 + REG0 (insn)] & 0xffff) == 0;
+ n = (State.regs[REG_D0 + REG0 (insn)] & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0) | (c ? PSW_CF : 0));
+}
+
+/* ror dn */
+void OP_F334 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long value;
+ int c,n,z;
+
+ value = State.regs[REG_D0 + REG0 (insn)] & 0xffff;
+ c = (value & 0x1);
+
+ value >>= 1;
+ value |= (PSW & PSW_CF ? 0x8000 : 0);
+ value &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= value;
+ z = (value == 0);
+ n = (value & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0) | (c ? PSW_CF : 0));
+}
+
+/* rol dn */
+void OP_F330 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long value;
+ int c,n,z;
+
+ value = State.regs[REG_D0 + REG0 (insn)] & 0xffff;
+ c = (value & 0x8000) ? 1 : 0;
+
+ value <<= 1;
+ value |= (PSW & PSW_CF ? 0x1 : 0);
+ value &= 0xffff;
+ State.regs[REG_D0 + REG0 (insn)] &= ~0xffff;
+ State.regs[REG_D0 + REG0 (insn)] |= value;
+ z = (value == 0);
+ n = (value & 0x8000) != 0;
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= ((z ? PSW_ZF : 0) | (n ? PSW_NF : 0) | (c ? PSW_CF : 0));
+}
+
+/* btst imm8, dn */
+void OP_F50400 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int z;
+
+ temp = State.regs[REG_D0 + REG0_8 (insn)];
+ temp &= (insn & 0xff);
+ z = (temp == 0);
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= (z ? PSW_ZF : 0);
+}
+
+/* btst imm16, dn */
+void OP_F7040000 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int z, n, c;
+
+ temp = State.regs[REG_D0 + REG0_16 (insn)];
+ c = temp & 0x1;
+ temp &= (insn & 0xffff);
+ n = (temp & 0x8000) != 0;
+ z = (temp == 0);
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= (z ? PSW_ZF : 0) | (n ? PSW_NF : 0) | (c ? PSW_CF : 0);
+}
+
+/* bset dm, (an) */
+void OP_F020 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int z;
+
+ temp = load_byte (State.regs[REG_A0 + REG1 (insn)]);
+ z = (temp & State.regs[REG_D0 + REG0 (insn)]) == 0;
+ temp |= State.regs[REG_D0 + REG0 (insn)];
+ store_byte (State.regs[REG_A0 + REG1 (insn)], temp);
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= (z ? PSW_ZF : 0);
+}
+
+/* bclr dm, (an) */
+void OP_F030 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned long temp;
+ int z;
+
+ temp = load_byte (State.regs[REG_A0 + REG1 (insn)]);
+ z = (temp & State.regs[REG_D0 + REG0 (insn)]) == 0;
+ temp = temp & ~State.regs[REG_D0 + REG0 (insn)];
+ store_byte (State.regs[REG_A0 + REG1 (insn)], temp);
+ PSW &= ~(PSW_ZF | PSW_NF | PSW_CF | PSW_VF);
+ PSW |= (z ? PSW_ZF : 0);
+}
+
+/* beqx label:8 */
+void OP_F5E800 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_ZX)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bnex label:8 */
+void OP_F5E900 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_ZX))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bgtx label:8 */
+void OP_F5E100 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!((PSW & PSW_ZX)
+ || (((PSW & PSW_NX) != 0) ^ ((PSW & PSW_VX) != 0))))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bgex label:8 */
+void OP_F5E200 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(((PSW & PSW_NX) != 0) ^ ((PSW & PSW_VX) != 0)))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* blex label:8 */
+void OP_F5E300 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if ((PSW & PSW_ZX)
+ || (((PSW & PSW_NX) != 0) ^ ((PSW & PSW_VX) != 0)))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bltx label:8 */
+void OP_F5E000 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (((PSW & PSW_NX) != 0) ^ ((PSW & PSW_VX) != 0))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bhix label:8 */
+void OP_F5E500 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(((PSW & PSW_CX) != 0) || (PSW & PSW_ZX) != 0))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bccx label:8 */
+void OP_F5E600 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_CX))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* blsx label:8 */
+void OP_F5E700 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (((PSW & PSW_CX) != 0) || (PSW & PSW_ZX) != 0)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bcsx label:8 */
+void OP_F5E400 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_CX)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bvcx label:8 */
+void OP_F5EC00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_VX))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bvsx label:8 */
+void OP_F5ED00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_VX)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bncx label:8 */
+void OP_F5EE00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_NX))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bnsx label:8 */
+void OP_F5EF00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_NX)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* beq label:8 */
+void OP_E800 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_ZF)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bne label:8 */
+void OP_E900 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_ZF))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bgt label:8 */
+void OP_E100 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (!((PSW & PSW_ZF)
+ || (((PSW & PSW_NF) != 0) ^ ((PSW & PSW_VF) != 0))))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bge label:8 */
+void OP_E200 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (!(((PSW & PSW_NF) != 0) ^ ((PSW & PSW_VF) != 0)))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* ble label:8 */
+void OP_E300 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if ((PSW & PSW_ZF)
+ || (((PSW & PSW_NF) != 0) ^ ((PSW & PSW_VF) != 0)))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* blt label:8 */
+void OP_E000 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (((PSW & PSW_NF) != 0) ^ ((PSW & PSW_VF) != 0))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bhi label:8 */
+void OP_E500 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (!(((PSW & PSW_CF) != 0) || (PSW & PSW_ZF) != 0))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bcc label:8 */
+void OP_E600 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_CF))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bls label:8 */
+void OP_E700 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (((PSW & PSW_CF) != 0) || (PSW & PSW_ZF) != 0)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bcs label:8 */
+void OP_E400 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_CF)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bvc label:8 */
+void OP_F5FC00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_VF))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bvs label:8 */
+void OP_F5FD00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_VF)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bnc label:8 */
+void OP_F5FE00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (!(PSW & PSW_NF))
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bns label:8 */
+void OP_F5FF00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 3 after we return, so
+ we subtract two here to make things right. */
+ if (PSW & PSW_NF)
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* bra label:8 */
+void OP_EA00 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* The dispatching code will add 2 after we return, so
+ we subtract two here to make things right. */
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT8 (insn & 0xff));
+}
+
+/* jmp (an) */
+void OP_F000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_PC] = TRUNC (State.regs[REG_A0 + REG1 (insn)] - 2);
+}
+
+/* jmp label:16 */
+void OP_FC0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT16 (insn & 0xffff));
+}
+
+/* jmp label:24 */
+void OP_F4E00000 (insn, extension)
+ unsigned long insn, extension;
+{
+ State.regs[REG_PC]
+ = TRUNC (State.regs[REG_PC] + (((insn & 0xffff) << 8) + extension));
+}
+
+/* jsr (an) */
+void OP_F001 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned int next_pc, sp;
+
+ sp = State.regs[REG_SP];
+ sp -= 4;
+ State.regs[REG_SP] = sp;
+ next_pc = State.regs[REG_PC] + 2;
+ State.mem[sp] = next_pc & 0xff;
+ State.mem[sp+1] = (next_pc & 0xff00) >> 8;
+ State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
+ State.regs[REG_PC] = TRUNC (State.regs[REG_A0 + REG1 (insn)] - 2);
+}
+
+/* jsr label:16 */
+void OP_FD0000 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned int next_pc, sp;
+
+ sp = State.regs[REG_SP];
+ sp -= 4;
+ State.regs[REG_SP] = sp;
+ next_pc = State.regs[REG_PC] + 3;
+ State.mem[sp] = next_pc & 0xff;
+ State.mem[sp+1] = (next_pc & 0xff00) >> 8;
+ State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
+ State.regs[REG_PC] = TRUNC (State.regs[REG_PC] + SEXT16 (insn & 0xffff));
+}
+
+/* jsr label:24 */
+void OP_F4E10000 (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned int next_pc, sp;
+
+ sp = State.regs[REG_SP];
+ sp -= 4;
+ State.regs[REG_SP] = sp;
+ next_pc = State.regs[REG_PC] + 5;
+ State.mem[sp] = next_pc & 0xff;
+ State.mem[sp+1] = (next_pc & 0xff00) >> 8;
+ State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
+ State.regs[REG_PC]
+ = TRUNC (State.regs[REG_PC] + (((insn & 0xffff) << 8) + extension));
+}
+
+/* rts */
+void OP_FE (insn, extension)
+ unsigned long insn, extension;
+{
+ unsigned int sp;
+
+ sp = State.regs[REG_SP];
+ State.regs[REG_PC] = (State.mem[sp] | (State.mem[sp+1] << 8)
+ | (State.mem[sp+2] << 16));
+ State.regs[REG_PC] -= 1;
+ State.regs[REG_SP] += 4;
+}
+
+/* rti */
+void OP_EB (insn, extension)
+ unsigned long insn, extension;
+{
+ PSW = load_half (State.regs[REG_A0 + 3]);
+ State.regs[REG_PC] = load_3_byte (State.regs[REG_A0 + 3] + 2) - 1;
+ State.regs[REG_A0 + 3] += 6;
+}
+
+/* syscall */
+void OP_F010 (insn, extension)
+ unsigned long insn, extension;
+{
+ /* We use this for simulated system calls; we may need to change
+ it to a reserved instruction if we conflict with uses at
+ Matsushita. */
+ int save_errno = errno;
+ int offset = 6;
+ errno = 0;
+
+/* Registers passed to syscall 0 */
+
+/* Function number. */
+#define FUNC (State.regs[0])
+
+#define PARM1 (State.regs[1])
+
+/* Parameters. */
+#define PARM(x, y) (load_mem (State.regs[REG_SP] + x, y))
+
+/* Registers set by syscall 0 */
+
+#define RETVAL State.regs[0] /* return value */
+#define RETERR State.regs[1] /* return error code */
+
+/* Turn a pointer in a register into a pointer into real memory. */
+
+#define MEMPTR(x) (State.mem + (x & 0xffffff))
+
+ switch (FUNC)
+ {
+#if !defined(__GO32__) && !defined(_WIN32)
+#ifdef TARGET_SYS_fork
+ case TARGET_SYS_fork:
+ RETVAL = fork ();
+ break;
+#endif
+#ifdef TARGET_SYS_execve
+ case TARGET_SYS_execve:
+ RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM (4, 4)),
+ (char **)MEMPTR (PARM (8, 4)));
+ break;
+#endif
+#ifdef TARGET_SYS_execv
+ case TARGET_SYS_execv:
+ RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM (4, 4)), NULL);
+ break;
+#endif
+#endif
+
+ case TARGET_SYS_read:
+ RETVAL = mn10200_callback->read (mn10200_callback, PARM1,
+ MEMPTR (PARM (4, 4)), PARM (8, 4));
+ break;
+ case TARGET_SYS_write:
+ RETVAL = (int)mn10200_callback->write (mn10200_callback, PARM1,
+ MEMPTR (PARM (4, 4)),
+ PARM (8, 4));
+ break;
+ case TARGET_SYS_lseek:
+ RETVAL = mn10200_callback->lseek (mn10200_callback, PARM1,
+ PARM (4, 4), PARM (8, 2));
+ break;
+ case TARGET_SYS_close:
+ RETVAL = mn10200_callback->close (mn10200_callback, PARM1);
+ break;
+ case TARGET_SYS_open:
+ RETVAL = mn10200_callback->open (mn10200_callback, MEMPTR (PARM1),
+ PARM (4, 2));
+ break;
+ case TARGET_SYS_exit:
+ /* EXIT - caller can look in PARM1 to work out the
+ reason */
+ if (PARM1 == 0xdead)
+ State.exception = SIGABRT;
+ else
+ State.exception = SIGQUIT;
+ State.exited = 1;
+ break;
+
+ case TARGET_SYS_stat: /* added at hmsi */
+ /* stat system call */
+ {
+ struct stat host_stat;
+ reg_t buf;
+
+ RETVAL = stat (MEMPTR (PARM1), &host_stat);
+
+ buf = PARM (4, 4);
+
+ /* Just wild-assed guesses. */
+ store_half (buf, host_stat.st_dev);
+ store_half (buf + 2, host_stat.st_ino);
+ store_word (buf + 4, host_stat.st_mode);
+ store_half (buf + 8, host_stat.st_nlink);
+ store_half (buf + 10, host_stat.st_uid);
+ store_half (buf + 12, host_stat.st_gid);
+ store_half (buf + 14, host_stat.st_rdev);
+ store_word (buf + 16, host_stat.st_size);
+ store_word (buf + 20, host_stat.st_atime);
+ store_word (buf + 28, host_stat.st_mtime);
+ store_word (buf + 36, host_stat.st_ctime);
+ }
+ break;
+
+#ifdef TARGET_SYS_chown
+ case TARGET_SYS_chown:
+ RETVAL = chown (MEMPTR (PARM1), PARM (4, 2), PARM (6, 2));
+ break;
+#endif
+ case TARGET_SYS_chmod:
+ RETVAL = chmod (MEMPTR (PARM1), PARM (4, 2));
+ break;
+#ifdef TARGET_SYS_time
+ case TARGET_SYS_time:
+ RETVAL = time ((time_t *)MEMPTR (PARM1));
+ break;
+#endif
+#ifdef TARGET_SYS_times
+ case TARGET_SYS_times:
+ {
+ struct tms tms;
+ RETVAL = times (&tms);
+ store_word (PARM1, tms.tms_utime);
+ store_word (PARM1 + 4, tms.tms_stime);
+ store_word (PARM1 + 8, tms.tms_cutime);
+ store_word (PARM1 + 12, tms.tms_cstime);
+ break;
+ }
+#endif
+#ifdef TARGET_SYS_gettimeofday
+ case TARGET_SYS_gettimeofday:
+ {
+ struct timeval t;
+ struct timezone tz;
+ RETVAL = gettimeofday (&t, &tz);
+ store_word (PARM1, t.tv_sec);
+ store_word (PARM1 + 4, t.tv_usec);
+ store_word (PARM (4, 4), tz.tz_minuteswest);
+ store_word (PARM (4, 4) + 4, tz.tz_dsttime);
+ break;
+ }
+#endif
+#ifdef TARGET_SYS_utime
+ case TARGET_SYS_utime:
+ /* Cast the second argument to void *, to avoid type mismatch
+ if a prototype is present. */
+ RETVAL = utime (MEMPTR (PARM1), (void *) MEMPTR (PARM (4, 4)));
+ break;
+#endif
+ default:
+ abort ();
+ }
+ RETERR = errno;
+ errno = save_errno;
+}
+
+/* nop */
+void OP_F6 (insn, extension)
+ unsigned long insn, extension;
+{
+}
+
+/* breakpoint */
+void
+OP_FF (insn, extension)
+ unsigned long insn, extension;
+{
+ State.exception = SIGTRAP;
+ PC -= 1;
+}