From 824bbc4849b364faa16054cecc940ab214b42379 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Fri, 28 Jul 2000 04:11:52 +0000 Subject: CGEN 1.0 import --- cgen/AUTHORS | 1 + cgen/COPYING.CGEN | 44 + cgen/ChangeLog | 4263 +++++++++++++++++++++++++++++++++++++++++++++++ cgen/INSTALL | 182 ++ cgen/Makefile.am | 124 ++ cgen/Makefile.in | 449 +++++ cgen/NEWS | 3 + cgen/README | 191 +++ cgen/aclocal.m4 | 137 ++ cgen/arm.cpu | 404 +++++ cgen/arm.sim | 39 + cgen/arm7.cpu | 1995 ++++++++++++++++++++++ cgen/attr.scm | 910 ++++++++++ cgen/cgen-gas.scm | 80 + cgen/cgen-opc.scm | 99 ++ cgen/cgen-sim.scm | 112 ++ cgen/cgen-stest.scm | 79 + cgen/configure | 1374 +++++++++++++++ cgen/configure.in | 18 + cgen/cos.scm | 1336 +++++++++++++++ cgen/decode.scm | 640 +++++++ cgen/desc-cpu.scm | 954 +++++++++++ cgen/desc.scm | 238 +++ cgen/dev.scm | 179 ++ cgen/doc/Makefile.am | 17 + cgen/doc/Makefile.in | 335 ++++ cgen/doc/app.texi | 430 +++++ cgen/doc/cgen.texi | 118 ++ cgen/doc/credits.texi | 27 + cgen/doc/glossary.texi | 29 + cgen/doc/internals.texi | 377 +++++ cgen/doc/intro.texi | 759 +++++++++ cgen/doc/notes.texi | 237 +++ cgen/doc/opcodes.texi | 186 +++ cgen/doc/pmacros.texi | 457 +++++ cgen/doc/porting.texi | 863 ++++++++++ cgen/doc/rtl.texi | 2276 +++++++++++++++++++++++++ cgen/doc/running.texi | 9 + cgen/doc/sim.texi | 45 + cgen/doc/stamp-vti | 3 + cgen/doc/version.texi | 3 + cgen/enum.scm | 391 +++++ cgen/fixup.scm | 38 + cgen/fr30.cpu | 1845 ++++++++++++++++++++ cgen/fr30.opc | 242 +++ cgen/gas-test.scm | 227 +++ cgen/hardware.scm | 1172 +++++++++++++ cgen/i960.cpu | 1320 +++++++++++++++ cgen/i960.opc | 32 + cgen/ia32.cpu | 917 ++++++++++ cgen/ia64.cpu | 2355 ++++++++++++++++++++++++++ cgen/ifield.scm | 1164 +++++++++++++ cgen/iformat.scm | 614 +++++++ cgen/insn.scm | 958 +++++++++++ cgen/m32r.cpu | 2088 +++++++++++++++++++++++ cgen/m32r.opc | 264 +++ cgen/m68k.cpu | 253 +++ cgen/mach.scm | 1473 ++++++++++++++++ cgen/minsn.scm | 259 +++ cgen/mode.scm | 471 ++++++ cgen/model.scm | 304 ++++ cgen/opc-asmdis.scm | 182 ++ cgen/opc-ibld.scm | 319 ++++ cgen/opc-itab.scm | 724 ++++++++ cgen/opc-opinst.scm | 168 ++ cgen/opcodes.scm | 804 +++++++++ cgen/operand.scm | 1559 +++++++++++++++++ cgen/pgmr-tools.scm | 183 ++ cgen/play.cpu | 265 +++ cgen/pmacros.scm | 562 +++++++ cgen/profile.scm | 180 ++ cgen/read.scm | 1198 +++++++++++++ cgen/rtl-c.scm | 1662 ++++++++++++++++++ cgen/rtl.scm | 2205 ++++++++++++++++++++++++ cgen/rtx-funcs.scm | 1002 +++++++++++ cgen/sem-frags.scm | 1236 ++++++++++++++ cgen/semantics.scm | 879 ++++++++++ cgen/sim-arch.scm | 181 ++ cgen/sim-cpu.scm | 1231 ++++++++++++++ cgen/sim-decode.scm | 592 +++++++ cgen/sim-model.scm | 394 +++++ cgen/sim-test.scm | 244 +++ cgen/sim.scm | 2019 ++++++++++++++++++++++ cgen/simplify.inc | 198 +++ cgen/slib/genwrite.scm | 270 +++ cgen/slib/pp.scm | 10 + cgen/slib/sort.scm | 151 ++ cgen/sparc.cpu | 612 +++++++ cgen/sparc.opc | 180 ++ cgen/sparc32.cpu | 170 ++ cgen/sparc64.cpu | 422 +++++ cgen/sparccom.cpu | 766 +++++++++ cgen/sparcfpu.cpu | 527 ++++++ cgen/stamp-h.in | 1 + cgen/thumb.cpu | 842 ++++++++++ cgen/types.scm | 278 +++ cgen/utils-cgen.scm | 654 ++++++++ cgen/utils-gen.scm | 506 ++++++ cgen/utils-sim.scm | 955 +++++++++++ cgen/utils.scm | 1268 ++++++++++++++ 100 files changed, 62008 insertions(+) create mode 100644 cgen/AUTHORS create mode 100644 cgen/COPYING.CGEN create mode 100644 cgen/ChangeLog create mode 100644 cgen/INSTALL create mode 100644 cgen/Makefile.am create mode 100644 cgen/Makefile.in create mode 100644 cgen/NEWS create mode 100644 cgen/README create mode 100644 cgen/aclocal.m4 create mode 100644 cgen/arm.cpu create mode 100644 cgen/arm.sim create mode 100644 cgen/arm7.cpu create mode 100644 cgen/attr.scm create mode 100644 cgen/cgen-gas.scm create mode 100644 cgen/cgen-opc.scm create mode 100644 cgen/cgen-sim.scm create mode 100644 cgen/cgen-stest.scm create mode 100755 cgen/configure create mode 100644 cgen/configure.in create mode 100644 cgen/cos.scm create mode 100644 cgen/decode.scm create mode 100644 cgen/desc-cpu.scm create mode 100644 cgen/desc.scm create mode 100644 cgen/dev.scm create mode 100644 cgen/doc/Makefile.am create mode 100644 cgen/doc/Makefile.in create mode 100644 cgen/doc/app.texi create mode 100644 cgen/doc/cgen.texi create mode 100644 cgen/doc/credits.texi create mode 100644 cgen/doc/glossary.texi create mode 100644 cgen/doc/internals.texi create mode 100644 cgen/doc/intro.texi create mode 100644 cgen/doc/notes.texi create mode 100644 cgen/doc/opcodes.texi create mode 100644 cgen/doc/pmacros.texi create mode 100644 cgen/doc/porting.texi create mode 100644 cgen/doc/rtl.texi create mode 100644 cgen/doc/running.texi create mode 100644 cgen/doc/sim.texi create mode 100644 cgen/doc/stamp-vti create mode 100644 cgen/doc/version.texi create mode 100644 cgen/enum.scm create mode 100644 cgen/fixup.scm create mode 100644 cgen/fr30.cpu create mode 100644 cgen/fr30.opc create mode 100644 cgen/gas-test.scm create mode 100644 cgen/hardware.scm create mode 100644 cgen/i960.cpu create mode 100644 cgen/i960.opc create mode 100644 cgen/ia32.cpu create mode 100644 cgen/ia64.cpu create mode 100644 cgen/ifield.scm create mode 100644 cgen/iformat.scm create mode 100644 cgen/insn.scm create mode 100644 cgen/m32r.cpu create mode 100644 cgen/m32r.opc create mode 100644 cgen/m68k.cpu create mode 100644 cgen/mach.scm create mode 100644 cgen/minsn.scm create mode 100644 cgen/mode.scm create mode 100644 cgen/model.scm create mode 100644 cgen/opc-asmdis.scm create mode 100644 cgen/opc-ibld.scm create mode 100644 cgen/opc-itab.scm create mode 100644 cgen/opc-opinst.scm create mode 100644 cgen/opcodes.scm create mode 100644 cgen/operand.scm create mode 100644 cgen/pgmr-tools.scm create mode 100644 cgen/play.cpu create mode 100644 cgen/pmacros.scm create mode 100644 cgen/profile.scm create mode 100644 cgen/read.scm create mode 100644 cgen/rtl-c.scm create mode 100644 cgen/rtl.scm create mode 100644 cgen/rtx-funcs.scm create mode 100644 cgen/sem-frags.scm create mode 100644 cgen/semantics.scm create mode 100644 cgen/sim-arch.scm create mode 100644 cgen/sim-cpu.scm create mode 100644 cgen/sim-decode.scm create mode 100644 cgen/sim-model.scm create mode 100644 cgen/sim-test.scm create mode 100644 cgen/sim.scm create mode 100644 cgen/simplify.inc create mode 100644 cgen/slib/genwrite.scm create mode 100644 cgen/slib/pp.scm create mode 100644 cgen/slib/sort.scm create mode 100644 cgen/sparc.cpu create mode 100644 cgen/sparc.opc create mode 100644 cgen/sparc32.cpu create mode 100644 cgen/sparc64.cpu create mode 100644 cgen/sparccom.cpu create mode 100644 cgen/sparcfpu.cpu create mode 100644 cgen/stamp-h.in create mode 100644 cgen/thumb.cpu create mode 100644 cgen/types.scm create mode 100644 cgen/utils-cgen.scm create mode 100644 cgen/utils-gen.scm create mode 100644 cgen/utils-sim.scm create mode 100644 cgen/utils.scm diff --git a/cgen/AUTHORS b/cgen/AUTHORS new file mode 100644 index 00000000000..c0b497b4543 --- /dev/null +++ b/cgen/AUTHORS @@ -0,0 +1 @@ +CGEN was originally written by Doug Evans . diff --git a/cgen/COPYING.CGEN b/cgen/COPYING.CGEN new file mode 100644 index 00000000000..b64876fa992 --- /dev/null +++ b/cgen/COPYING.CGEN @@ -0,0 +1,44 @@ +CGEN - a Cpu tools GENerator +Copyright 2000 Red Hat, Inc. + +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, 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 software; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA + +As a special exception, Red Hat gives unlimited permission to copy, +distribute and modify the code that is the output of CGEN. You need +not follow the terms of the GNU General Public License when using or +distributing such code, even though portions of the text of CGEN +appear in them. The GNU General Public License (GPL) does govern all +other use of the material that constitutes the CGEN program. + +Certain portions of the CGEN source text are designed to be copied (in +certain cases, depending on the input) into the output of CGEN. We +call these the "data" portions. CPU description files are, for the +purposes of this copyright, deemed "data". The rest of the CGEN +source text consists of comments plus executable code that decides +which of the data portions to output in any given case. We call these +comments and executable code the "non-data" portions. CGEN never +copies any of the non-data portions into its output. + +This special exception to the GPL applies to versions of CGEN released +by Red Hat. When you make and distribute a modified version of CGEN, +you may extend this special exception to the GPL to apply to your +modified version as well, *unless* your modified version has the +potential to copy into its output some of the text that was the +non-data portion of the version that you started with. (In other +words, unless your change moves or copies text from the non-data +portions to the data portions.) If your modification has such +potential, you must delete any notice of this special exception to the +GPL from your modified version. diff --git a/cgen/ChangeLog b/cgen/ChangeLog new file mode 100644 index 00000000000..8f7c9449f0d --- /dev/null +++ b/cgen/ChangeLog @@ -0,0 +1,4263 @@ +2000-07-25 Ben Elliston + + * doc/credits.texi (Credits): Add Frank Eigler. + +2000-07-24 Dave Brolley + + * opc-itab.scm (gen-insn-opcode-table): Initialize the first element + fully. + * desc.scm (gen-attr-table-defn): Initialize all elements fully. + (): Initialize all elements fully. + * desc-cpu.scm (-gen-isa-table-defns): Initialize the last element + fully. + (-gen-mach-table-defns): Ditto. + (-gen-ifld-defns): Ditto. + (-gen-operand-table): Ditto. + (-gen-insn-table): Ditto. + (-gen-cpu-open): Nothing to do for the mach table. + +2000-07-13 Ben Elliston + + * doc/version.texi (UPDATED): Update. + +2000-07-05 Ben Elliston + + * configure.in (AC_PATH_PROG): Remove. + * configure: Regenerate. + * Makefile.am (GUILE): Locate guile dynamically. + * Makefile.in: Regenerate. + * doc/Makefile.in: Likewise. + +2000-07-03 Ben Elliston + + * desc-cpu.scm (cgen-desc.c): Include "libiberty.h". + * opc-itab.scm (cgen-opc.c): Likewise. + +2000-06-28 Frank Ch. Eigler + + * rtl.scm (-rtx-traverse-locals): Correct call to `symbol?' for + guile 1.4 compatibility. + (rtx-env-dump): Comment out buggy display calls. + +2000-06-15 matthew green + + * opc-itab.scm (-gen-ifmt-table-1): Add extra braces to pacify GCC. + +2000-06-14 Frank Ch. Eigler + + * Makefile.in: Regenerated. + + * desc-cpu.scm (gen-ifld-decls): Exclude derived ifields. + (gen-ifld-defns): Ditto. + * pgmr-tools.scm (pgmr-pretty-print-insn-format): Ditto. + * rtl.c (rtl-finish!): Ditto. + * opc-itab.scm (-gen-ifield-decls): Ditto. + * opcodes.scm (gen-switch): Exclude derived operands. + * operand.scm (op-iflds-used): Expand derived operands. + (hw-index-derived): New dummy function to create dummy object. + (-derived-operand-parse): Fix mode arg passed to + constructor. Set object's hw-name and index fields. + (-anyof-merge-subchoices): Set instance object's index also. + (-anyof-name): New helper function. + (anyof-merge-semantics): Correct replacement of operand names in + anyof instance. + (op-ifield): Tolerate derived-operands and their funny indices better. + * ifield.scm (ifld-known-values): Expand derived ifields. + (non-multi-ifields, non-derived-ifields): New utility functions. + (ifld-decode-mode): Tolerate objects with unbound decode field. + * iformat.scm (compute-insn-length): Expand derived ifields. + (compute-insn-base-mask): Ditto. + * insn.scm (insn-base-ifields): Remove. + (): Add iflds-values entry to cache ifld-base-ifields values. + (insn-value): Call ifld-base-ifields and ifld-constant? instead. + * mach.scm (arch-analyze-insns!): Exclude multi-insns. + * sem-frags.scm (sim-sfrag-analyze-insns!): Ditto. + (-frag-test-data): Ditto. + * sim-decode.scm (cgen-decode.h, cgen-decode.cxx): Ditto. + * utils-sim.scm (op-extract?): Handle derived operands. + + * gas-test.scm (cgen-build.sh): Quote '*' chars printed by objdump. + * semantics.scm (-build-operand!): Handle 'DFLT case during parsing. + * hardware.scm (hardware-for-mode): New function. + + * insn.scm (filter-harmlessly-ambiguous-insns): New function for + cleaning up decode tables. + (mask-superset?): Little helper function for above. + * decode.scm (-build-decode-table-entry): Call it. + (-opcode-slots): Add some more tracing. + * arm.cpu: Disable decode-splits construct due to implementation + conflict with `filter-harmlessly-ambiguous-insns' + + * decode.scm (-population-top-few): New function for better decode + bit generation. Includes minor helper functions. + (decode-get-best-bits): Call it instead. + (OLDdecode-get-best-bits): Renamed previous version of above. + + +2000-06-13 Ben Elliston + + * configure.in: Use AC_EXEEXT with Cygnus mode. Remove AC_ARG_WITH + for the Guile library directory. + * configure: Regenerate. + * Makefile.in, doc/Makefile.in: Regenerate. + + * Makefile.in, doc/Makefile.in: Regenerate. + * configure.in: Remove unnecessary tests. Move to version 1.0. + * acconfig.h, config.in: Remove. + * configure, aclocal.m4: Regenerate. + * doc/stamp-vti, doc/version.texi: Likewise. + * AUTHORS: New file. + +2000-06-07 Ben Elliston + + * fixup.scm (symbol-bound?): Reduce debugging output. + +2000-06-02 matthew green + + * insn.scm (insn-base-ifields): Returns all the instruction fields for + a given instruction, replacing derived fields with their subfields. + (insn-value): Use `insn-base-ifields' to find all constant values. + (multi-insn-instantiate!): Comment some debug messages. + +2000-06-01 Ben Elliston + + * doc/rtl.texi (Expressions): Document a hazard with the choice of + symbol names used in a (c-call ..) rtx. + + * sim-test.scm (build-test-set): Return (()) for an instruction + with no operands, so it too is included in the generated test set. + +2000-05-31 Ben Elliston + + * Makefile.am (gas-test): Ensure $(ISA) is not empty. + (sim-test): Likewise. + * Makefile.in: Regenerate. + +2000-05-30 Frank Ch. Eigler + + * read.scm (-cgen): In debugging mode (-b), ask guile for untruncated + stack traceback, in an order that resembles gdb's `bt'. + +2000-05-24 Frank Ch. Eigler + + * desc-cpu.scm (-gen-hash-defines): Use ifmt-ifields again. + * opc-itab.scm (-gen-ifmt-table-1): Ditto. + * gas-test.scm (gas-test-analyze!, cgen-build.sh): Filter out + multi insns. + * ifield.scm (multi-ifield): Define workable field-mask and field-value + virtual functions. + (ifld-base-ifields): New routine to replace ifmt-expanded-ifields. + * iformat.scm (ifmt-expanded-ifields): Gone. + (ifields-base-ifields): New function. Call ifld-base-ifields for real + work. + (-ifmt-lookup-ifmt!): Use it to expand derived/multi combos in new + ifmt entries. + + * opcodes.scm (multi-ifield gen-extract): Correct spacing in generated + code. + +2000-05-19 Frank Ch. Eigler + + * utils-gen.scm (gen-multi-ifld-extract): Fix decode hook for sim. + +2000-05-18 Frank Ch. Eigler + + * ifield.scm (-multi-ifield-parse): Add encode/decode args. + (-multi-ifield-read): Parse them. + (define-full-multi-ifield): Pass #f/#f as defaults for them. + * opcodes.scm (multi-ifield gen-insert): Add encode hook. + (multi-ifield gen-extract): Add decode hook. + * utils-gen.scm (gen-multi-ifld-extract): Add decode hook for sim. + + * insn.scm (syntax-break-out): More correctly handle \-escaped + syntax characters. + (syntax-make-elements): Ditto. + * opc-itab.scm (compute-syntax): Ditto. + + +2000-05-17 Ben Elliston + + * gas-test.scm (cgen-build.sh): Log the correct script filename. + +2000-05-15 Frank Ch. Eigler + + * gas-test.scm (build-test-set): Return (()) for an instruction + with no operands, so it too is included in the generated test set. + +2000-05-15 Frank Ch. Eigler + + * desc-cpu.scm (-gen-hash-defines): Define CGEN_ACTUAL_MAX values for + IFMT_OPERANDS and SYNTAX_BYTES. + + +2000-05-15 Frank Ch. Eigler + + * sim.scm (with-any-profile?): New function. + * utils-sim.scm (-sfmt-contents): Use above instead of `with-profile?' + to decide whether or not to include profiling counters. + +2000-05-10 Frank Ch. Eigler + + Fuller derived-operand support for opcodes. + * insn.scm (non-multi-insns): New filter to oppose `multi-insns'. + * desc-cpu.scm (-define-hash-defines): Compute CGEN_MAX_SYNTAX_BYTES. + Correctly compute ..._IFMT_OPERANDS. Omit useless ..._INSN_OPERANDS. + (gen-operand-table): Omit derived- and anyof- operands from table. + (gen-insn-table): Omit multi-insns from table. + * iformat.scm (ifmt-expanded-fields): New function to expand + subfields of derived-ifields. + (ifmt-compute!): Ignore remaining multi-insns. + * mach.scm (isa-min-insn-bitsize, isa-max-insn-bitsize): Ignore + multi-insns. + * opc-itab.scm (-gen-ifmt-table-1): Use ifmt-expanded-ifields. + (-gen-insn-enum, -gen-insn-opcode-table): Ignore multi-insns. + * opcodes.scm (derived-operand): Define abort()ing gen-insert, + gen-extract, gen-fget, gen-fset, gen-parse, gen-print functions. + (gen-switch): Omit anyof-operands. + * operand.scm (-anyof-syntax): New function. + (-anyof-merge-syntax): Call it. + * utils.scm (collect): New idiomatic function. + +2000-05-10 Ben Elliston + + * m68k.cpu: New file (work in progress). + +2000-05-05 Frank Ch. Eigler + + * Makefile.am (all-local): New target. Create stamp-cgen. + * Makefile.in: Regenerated. + * doc/Makefile.in: Regenerated. + +2000-04-26 Frank Ch. Eigler + + * operand.scm (-operand-g/setter-syntax): Correct off-by-one error. + (-operand-parse-setter): Ditto. + * utils-sim.scm (needed-iflds): Store ifield (index) in argbuf, even + for CACHE-ADDR operands. + + +2000-04-23 matthew green + + * m32r.cpu: Fix a typo. + +Fri Apr 21 22:18:48 2000 Jim Wilson + + * ia64.cpu (define-model): Change merced to Itanium. + (f-qp): Change quilifying to qualifying. + (movbr_ph, movbr_pvec): Delete. + (I-I21): Delete uses of movbr_ph and movbr_pvec. + +2000-04-07 Ben Elliston + + * doc/porting.texi (Building a simulator test suite): Clarify + where generated test cases are placed. + +2000-04-07 Ben Elliston + + * Makefile.am (gas-test): Remove dependency on `cgen'. + (sim-test): Ditto. + * Makefile.in: Regenerate. + +2000-04-04 Frank Ch. Eigler + + * hardware.scm ( parse): Allow user to set type for pc register. + * mode.scm (mode-finish!): Add placeholder code for mach-dependent + type reconfiguration. + * utils-sim.scm (-sfmt-contents): Add profile-counters only if + with-profile?. + +2000-03-30 Ben Elliston + + * doc/rtl.texi (Enumerated constants): Add concept index entries. + +2000-03-24 Ben Elliston + + * Makefile.am (stamp-cgen): Reinstate target. + * Makefile.in: Regenerate. + +2000-03-22 Ben Elliston + + * slib/ppfile.scm: Remove; unused. + * slib/defmacex.scm: Likewise. + +2000-03-21 Ben Elliston + + * doc/internals.texi (Source file overview): Document. + + * Makefile.am (GUILEDIR): Remove. + (CGEN): Ditto. Callers use $(GUILE) instead. + (GUILEFLAGS): Ditto. + (CGENFILES): Ditto. + (APPDESCFILES): Ditto. + (OPCODESFILES): Ditto. + (SIMFILES): Ditto. + (pkgdata_SCRIPTS): Ditto. + (stamp-cgen): Remove target. + * Makefile.in: Regenerate. + + * configure.in: Remove header and library tests. + * configure: Regenerate. + * config.in: Likewise. + +2000-03-20 Ben Elliston + + * read.scm: Cease loading "hob-sup.scm". + * utils.scm: Inherit the fastcall family of procedures (for now). + * hob-sup.scm: Remove. + +2000-03-20 Ben Elliston + + * configure.in (AC_OUTPUT): Do not emit .gdbinit. + * configure: Regenerate. + * gdbinit.in: Remove. + +2000-03-17 Ben Elliston + + * Makefile.am (CGEN): Use guile, not cgen. + (CGENCFLAGS, LIBIBERTY, INCLUDES): Remove. + (bin_PROGRAMS, cgen_SOURCES): Likewise. + (CGENFILES): Fold CGEN_HOB_INPUT_FILES and CGEN_NOHOB_FILES. + (HOBBIT_INPUT_FILES, HOBBIT_OUTPUT_FILE): Remove. + (HOB_OBJS): Likewise. + (CGEN_HOB_SRC, CGEN_HOB_OBJ): Likewise. + (CGENOBJS): Likewise. + (cgen_DEPENDENCIES, cgen_LDFLAGS, cgen_LDADD): Likewise. + (hobbit, hobbit.o, hobbit.c): Remove targets. + (cos.o, cgen.o, cgen-gh.o, hob-sup.o): Likewise. + (CLEANFILES): Update. + * acconfig.h (WITH_HOBBIT): Remove. + * configure.in: Do not test for 3 arg scm_make_vector. Remove + option --with-cgen-hobbit. + * cos.h, cos.c, hob-main.c, hob-sup.c, hob-sup.h, hob.sh: Remove. + * cgen-gh.h, cgen-gh.c, cgen-hob.scm, cgen.c: Likewise. + * hobbit.c, hobbit.h, hobbit.scm: Likewise. + * hobscmif.h, hobslib.scm, scmhob.h: Likewise. + * Makefile.in: Regenerate. + * config.in: Likewise. + * aclocal.m4: Likewise. + * configure: Likewise. + * README (Hobbit support): Remove. + * doc/internals.texi (Conventions): Do not mention Hobbit. + * doc/porting.texi (Supported Guile versions): Likewise. + +2000-03-16 Frank Ch. Eigler + + * mipscom.cpu (break, syscall, define-trap): Make these non-cti + insns. + * sid-cpu.scm (-gen-sem-switch-engine): Adjust calling & + callback convention to new sid sidutil::basic_cpu code. + (-gen-sfrag-engine-fn): Ditto. + * sid.scm (-create-virtual-insns!): Ditto. + (-hw-gen-set-quiet-pc): Mark delay slot execution specially in pbb + mode. + (cxmake-skip): Implement properly for pbb mode. + +2000-03-03 Ben Elliston + + * doc/internals.texi: New file. + +2000-02-29 Ben Elliston + + * doc/rtl.texi (Derived operands): Remove unnecessary footnote. + * doc/porting.texi: Formatting tweaks. + +2000-02-25 Nick Clifton + + * desc-cpu.scm (*_cgen_cpu_open): Initialise signed_overflow_ok_p + field. + +Thu Feb 24 14:09:01 2000 Doug Evans + + * operand.scm (,make!): Initialize mode-name, not + mode. + +2000-02-23 Andrew Haley + + * m32r.cpu (pcmpbz): Make pcmpbz a special (i.e. hidden) + instruction. + +2000-02-24 Ben Elliston + + * doc/rtl.texi (Derived operands): Add some cindex entries. + +2000-02-23 Ben Elliston + + * ia32.cpu (dndo): Move general purpose macro from here .. + * simplify.inc (dndo): .. to here. + +2000-02-18 Frank Ch. Eigler + + * arm.cpu (h-tbit): Add c-call setter function. + (h-mbits): Ditto. + +2000-02-17 Frank Ch. Eigler + + * sem-frags.scm (-frag-hash-compute!): Add appstuff arg for traversal. + (-frag-cost-compute!): Ditto. + * utils.scm (copyright-cygnus): Add Y2K. + * sid-cpu.scm (@prefix@_pbb_run): Add unsigned& argument. + +2000-01-25 Nick Clifton + + * desc-cpu.scm (@arch@_cgen_cpu_open): Add code to initialise + flags field of the CGEN_CPU_TABLE structure. + +Sun Dec 12 14:20:36 1999 Doug Evans + + * operand.scm (): Renamed from . + All references updated. + +Tue Nov 30 11:06:22 1999 Doug Evans + + * ia32.cpu: Rewrite addressing mode support. + + * ifield.scm (): New member `follows'. + (ifld-known-values): New proc. + (): New method set-word-offset!. + (ifld-set-word-offset!): New proc. + (ifld-new-word-offset): New proc. + (): New method next-word. + (): New method next-word. + (ifld-next-word): New proc. + (ifld-precedes?): New proc. + (-ifield-parse): New args word-offset,word-length,follows. + All callers updated. Handle CISC-style vs RISC-style ifields. + (-ifield-read): Recognize word-offset,word-length,follows specs. + (-ifld-parse-follows): New proc. + (-multi-ifield-make-default-insert): New proc. + (-multi-ifield-make-default-extract): New proc. + (-multi-ifield-parse): Provide default values for insert,extract + handlers if not specified. + (): New class. + (derived-ifield?): New predicate. + (ifld-derived-operand?): New predicate. + (f-anyof): New global. + (ifld-anyof?,ifld-anyof-operand?): New predicates. + (f-derived,ifld-derived?): Delete. + (ifield-builtin!): Delete init of f-derived. Init f-anyof. + * insn.scm (-sub-insn-ifields): New proc. + (-sub-insn-make!): New proc. + (multi-insn-instantiate!): Provide initial implementation. + (-insn-parse): If insn contains "anyof" operands, create a + object instead of a plain . + (-parse-insn-format-symbol): Rewrite derived operand handling. + Add anyof operand handling. + (-parse-insn-format-ifield-spec): Rewrite. + (-parse-insn-format-operand-spec): Delete. + (-parse-insn-format-list): Delete support for `(operand value)'. + (anyof-operand-format?): Replaces derived-operand-format?. + * operand.scm (-operand-parse-getter): Improve error messages. + (-operand-parse-setter): Ditto. + (): New members args,syntax,base-ifield,encoding, + ifield-assertion. + (): Change baseclass from to + . Delete member values. New members base-ifield,choices. + (anyof-operand?): New predicate. + (-derived-parse-encoding,-derived-parse-ifield-assertion): New procs. + (-derived-operand-parse): Rewrite. + (-derived-operand-read): Rewrite. + (-anyof-parse-choice): New proc. + (-anyof-operand-parse): Rewrite. + (-anyof-operand-read,define-anyof-operand): New procs. + (): Rewrite. + (-anyof-initial-known): New proc. + (anyof-satisfies-assertions?): New proc. + (-anyof-merge-syntax,-anyof-merge-encoding): New procs. + (-anyof-merge-getter,-anyof-merge-setter): New procs. + (-anyof-merge-semantics,-anyof-merge-ifield-assertion): New procs. + (-anyof-merge-subchoices,-anyof-all-subchoices): New procs. + (-anyof-value-from-derived): New proc. + (-anyof-all-choices-1,anyof-all-choices): New procs. + (operand-init!): Create define-anyof-operand reader command. + + * insn (syntax-break-out): Take syntax as argument instead of insn. + All callers updated. + (syntax-make): Move here, from ???. + + * types.scm (): Rename accessors from bitrange:foo to + bitrange-foo. All uses updated. + (bitrange-next-word): New proc. + + * semantics.scm (-solve-expr-fn,rtx-solve): New procs. + + * rtl.scm (rtx-canonicalize): Provide initial implementation. + (rtx-make-const,rtx-make-enum): New procs. + (rtx-arg1,rtx-arg2): Renamed from -rtx-arg[12]. All callers updated. + (rtx-mem-addr,rtx-mem-sel): New procs. + (rtx-change-address): New proc. + (rtx-make-ifield,rtx-make-operand,rtx-make-local): New proc. + (rtx-make-set,rtx-single-set?): New procs. + (rtx-combine): New proc. + + * rtl.scm (rtx-traverse): New arg `appstuff'. All callers updated. + (rtx-traverse-with-locals): Ditto. + (-rtx-traverse,-rtx-traverse-*): Ditto. + + * rtl.scm (define-subr): New proc. + (rtl-init!): Create reader command `define-subr'. + + * cos.c (_object_mi_p): Ensure argument is an object. + (indent): New function. + (_object_print_elms): Add pretty-printing support. + (_object_print): Ditto. + + * hobbit.scm (*reckless-s->c-fun-table*): Add fastcall7. + (*floats-s->c-fun-table*): Ditto. + * hobbit.c,hobbit.h: Rebuild. + * hob-sup.c (fastcall7): New proc. + * hob-sup.h (fastcall7): Declare. + * hob-sup.scm (fastcall7): New macro. + + * mach.scm (): New member subr-list. + (current-subr-list,current-subr-add!,current-subr-lookup): New procs. + (arch-finish!): Reverse recorded subr list. + + * read.scm (debug-env): New global. + (debug-var-names,debug-var,debug-repl-env): New procs. + (debug-repl): Rewrite. New arg `env-list'. All callers updated. + (debug-quit): Renamed from `continue'. + + * simplify.inc (dsmf): New pmacro. + + * utils.scm (plus-scan): New proc. + (split-bits): Rewrite. + (split-value): New proc. + +1999-10-13 Doug Evans + + * doc/Makefile.am (DOCFILES): Add notes.texi. + * doc/Makefile.in: Rebuild. + +1999-10-11 Doug Evans + + * ifield.scm (ifld-derived?): New proc. + (f-derived): New global. + (ifield-builtin!): Create ifield f-derived. + (): New class. + (multi-insn?): New predicate. + (multi-insn-instantiate!): New proc. + (-insn-parse): Create objects for insns with derived + ifields. + (-parse-insn-format-symbol): Handle derived ifields. + (-parse-insn-format-ifield-spec): New proc. + (-parse-insn-format-operand-spec): New proc. + (-parse-insn-format-list): Simplify. + (-parse-insn-format): No longer allow (ifield-object value) spec. + (derived-operand-format?): New proc. + (insn-alias?): New proc. + (non-alias-insns): Rewrite. + (insn-real?): Renamed from real-insn?, all callers updated. + (virutal-insns): Rewrite. + (multi-insns): New proc. + * mach.scm (arch-analyze-insns!): Instantiate multi-insns if present. + * operand.scm (op-ifield): Renamed from op:ifield, all callers updated. + Return #f if operand doesn't have an index or if index is not an + ifield. + (hw-index-anyof): New proc. + (-operand-parse): Allow integer indices. + (): New class. + (derived-operand?): New predicate. + (): New class. + (): New class. + (-anyof-parse-value,-anyof-operand-parse): New procs. + (-derived-operand-parse,-derived-operand-read): New procs. + (define-derived-operand,define-full-derived-operand): New procs. + (operand-init!): New reader command define-derived-operand. + + * utils.scm (list-take): Handle negative amount. + (element?): Rewrite. + +1999-10-10 Doug Evans + + * dev.scm: quick-utils.scm renamed to ~/.cgenrc. + +1999-10-04 Richard Henderson + + * ia64.cpu: Checkpoint. + +1999-09-29 Doug Evans + + * sim-cpu.scm (-gen-semantic-fn-table): Virtual insns are always valid. + + * sim.scm (sim-finish!,x-invalid): Always set pc. Set vpc based on + default-insn-bitsize. Pass vpc to sim_engine_invalid_insn. + +Wed Sep 29 14:39:39 1999 Dave Brolley + + * sim.scm (sim-finish!): Don't call sim_io_error for invalid insn. Use + PC returned by sim_engine_invalid_insn. + +1999-09-28 Doug Evans + + * ia32.cpu: New file. + +1999-09-25 Doug Evans + + * utils.scm (bit-set?): Fix off by one error. + + * rtl-c.scm (s-sequence): Fix non-void-mode result output. + + * rtl.scm (hw): Check for valid hardware element before trying to + get its mode. + + * arm.cpu (arm7f cpu): Renamed from arm. All users updated. + * arm7.cpu (bx): Fix name of target address operand in assembler spec. + (*): arm_compute_operand2_foo renamed to compute_operand2_foo. + * thumb.cpu (*): arm_compute_operand2_foo renamed to + compute_operand2_foo. + + + * rtl-c.scm (): New member output-language. + (estate-output-language-c?,estate-output-language-c++?): New procs. + (,vmake!): Handle #:output-language. + (estate-make-for-normal-rtl-c++): New proc. + (rtl-c++-parsed,rtl-c++): New proc. + (s-c-call): Invoke cpu class method if c++. + (join): Use s-c-raw-call. + + * rtl-c.scm (subword): Don't pass current_cpu to SUBWORD. + (nop): Rewrite. + + * rtl-c.scm (delay): Mark the sequence as #:delay'd. + * rtl.scm (): New member `modifiers'. + (,vmake!): Handle #:modifiers. + (estate-with-modifiers): New proc. + + * rtl.scm (rtx-side-effects?): New proc. + (rtx-canonical-bool): Don't change expr if it has side effects. + * semantics.scm (-simplify-expr-fn): Handle exprs with side-effects + better. + +1999-09-23 Doug Evans + + * sim.scm (gen-scache-type): Fix typo in last patch. + +Tue Sep 21 17:12:55 1999 Dave Brolley + + * sim.scm (gen-scache-type): Add last_insn_p flag for parallel support. + +1999-09-05 Doug Evans + + + * decode.scm (decode-build-table): Delete args startbit,index-list. + All callers updated. + * utils-sim.scm (gen-decoder): Delete args startbit,index-list. + All callers updated. + * sim-decode.scm (-gen-decode-fn): Always pass 0 for startbit + to decode-get-best-bits. + + * hardware.scm (hw-bits): New proc. + (-hw-parse): New arg layout. All callers updated. + (define-full-hardware): New arg layout. All callers updated. + (-hw-validate-layout): New proc. + (-hw-create-[gs]etter-from-layout): New procs. + (,parse!): Handle layout spec. + * types.scm (type-bits): New proc. + + * sem-frags.scm (-frag-cost-compute!): Fix calculation of + UNARY, BINARY, TRINARY rtxs. + + * attr.scm (,parse-value): Allow strings. + * enum.scm (parse-enum-vals): Use reverse! instead of reverse. + Support '- as "unused spot" indicator. + +1999-09-03 Doug Evans + + * pgmr-tools.scm (pgmr-pretty-print-insn-format): Fix typo. + +1999-09-02 Doug Evans + + * rtx-funcs.scm (subword): Fix mode spec of `value'. + + * rtl.scm (-rtx-traverse-operands): Fix debugging message + construction. + (tstate-make): New arg `depth'. All callers updated. + (tstate-depth,tstate-set-depth!): New procs. + (tstate-incr-depth!,tstate-decr-depth!): New procs. + (-rtx-traverse-operands): Indent debugging output by traversal depth. + (-rtx-traverse): Ditto. Keep track of traversal depth. + +1999-09-01 Doug Evans + + * sim-decode.scm (-gen-decoder+supporting cast): Move to utils-sim.scm. + * utils-sim.scm: Decoder generator support moved here. + (-decode-equiv-entries?,-decode-sort-entries): New procs. + (-gen-decoder-switch): Sort entries for more fall-throughs. + + * Makefile.am (gas-test,sim-test): Specify ISA when invoking cgen. + * Makefile.in: Rebuild. + * sim-test.scm (build-sim-testcase): Add logging message. + * dev.scm (cload): Recognize SIM-TEST application. + (load-stest): Set APPLICATION to SIM-TEST. + + * desc-cpu.scm (-gen-hash-defines): Add \n to output. + + * ifield.scm (-ifield-parse): Allow bit numbers up to 127. + * mach.scm (-isa-parse): Allow insn bitsizes from 8 to 128. + * mode.scm (mode-make-int,mode-make-uint): Allow values up to 64 bits. + + * insn.scm (syntax-break-out): Handle ${foo}. + +Sun Aug 29 11:11:15 1999 Doug Evans + + * Makefile.am (noinst_PROGRAMS,noinst_LIBRARIES): Delete. + (bin_PROGRAMS): Define. + (CGEN_HOB_INPUT_FILES): Remove $(srcdir)/. + (cgen-hob.c): Prepend $(srcdir)/ here. + (APPDESCFILES,OPCODESFILES,SIMFILES,pkgdata_SCRIPTS): Define. + (libcpu_a_SOURCES): Delete. + (cgen_DEPENDENCIES,cgen_LDADD): Rewrite. + (CGEN_HOB_OBJ,CGENOBJS): New variables. + * configure.in (LIBS): Replace -Wl,-rpath with -R. + Add AC_CHECK_LIB(guile,main). + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * config.in: Rebuild. + * configure: Rebuild. + +1999-08-28 Doug Evans + + Rename rtx functions from name: to name, accept optional leading + modifier and mode. + VM -> VOID, DM -> DFLT, use DFLT instead of VM for default mode. + * attr.scm (-attr-eval): Update. + * hardware.scm (hw-mode-ok?): Rename arg mode to new-mode-name. + (,mode-ok?): Disallow VOID. + (,mode-ok?): Disallow VOID. + (,mode-ok?): Disallow VOID. + * mode.scm (mode-name?): New proc. + (VOID): Renamed from VM. + (DFLT): Renamed from DM. + (mode-builtin!): Update. + * opcodes.scm (,gen-insert): Update. + (,gen-extract): Update. + (,gen-insert,gen-extract): Update. + * operand.scm (op:mode): Update. + (,make!): Update. + (op:new-mode): Update. + (-operand-read): Update. + * rtl.scm (-rtx-valid-types): Add OPTIONS, EXPLNUMMODE, + NONVOIDMODE, DFLTMODE. Rename VMMODE to VOIDMODE. + (def-rtx-dual-mode,define-rtx-dual-mode): Delete. + (-rtx-lazy-sem-mode): Renamed from -rtx-mode. All callers updated. + (rtx-make): Call -rtx-munge-mode&options. + (rtx accessors): Rewrite. + (rtx-pretty-name): Update. + (-rtx-traverse-*): Update. + (-rtx-traverse-explnummode,-rtx-traverse-nonvoidmode): New procs. + (-rtx-traverse-voidmode,-rtx-traverse-dfltmode): New procs. + (-rtx-make-traverse-table): Update. + (-rtx-traverse-operands): Update. + (-rtx-option?,-rtx-option-list?): New procs. + (-rtx-munge-mode&options): New proc. + (-rtx-traverse-expr): Call -rtx-munge-mode&options. + (-rtx-traverse): Update. + (rtx-traverse,rtx-traverse-with-locals,rtx-compile): Update. + (rtx-compile-time-constant?): Update. + (rtx-true?,rtx-false?,rtx-true,rtx-false): Update. + (rtx-value): Update. + (hw,reg,mem): Renamed from foo:. Update. All callers updated. + * rtx-funcs.scm (*): Update. + * rtl-c.scm (rtl-c-get): Update. + (rtl-c-set-quiet,rtl-c-set-trace): Update. + (s-c-call,s-c-raw-call): Update. + (s-boolifop,s-convop,s-if,s-cond): Update. + (s-case-vm,-gen-non-vm-case-test,s-case): Update. + (-par-replace-set-dests,-par-replace-set-srcs): Update. + (s-parallel,s-sequence): Update. + (rtl-c-build-table): Update. + * sem-frags.scm (-frag-hash-compute!): Update. + (-frag-cost-compute!): Improperly handle unary,binary,trinary ops + for temporary bug compatibility with previous version. + (-frag-expr-locals,-frag-expr-stmts): Update. + (-frag-compute-desired-frags,-frag-pick-best): Update. + * semantics.scm (-simplify-expr-fn): Update. + (rtx-simplify): Update. + (-rtx-ref-type): Update. Account for modifiers. + (-build-operand!,-build-reg-operand!,-build-mem-operand!): Update. + (-build-ifield-operand!): Update. + (-build-known-values): Update. + (semantic-compile): Update. + (-gen-reg-access-defns): Update. + (gen-semantic-code,-gen-sem-case): Update. + (-gen-sfrag-code,-gen-sfrag-case): Update. + * sim-cpu (gen-semantic-code): Update. + * sim.scm (,gen-write,cxmake-skip): Update. + (,gen-write,gen-set-macro,cxmake-get-raw): Update. + (-hw-cxmake-get): Update. + (,cxmake-get,gen-set-quiet,gen-write): Update. + (,cxmake-get): Update. + (,gen-type,gen-read,cxmake-get): Update. + (,gen-set-quiet,gen-set-trace): Update. + (,cxmake-get): Update. + (sim-finish!): Update. + * utils-gen.scm (-gen-ifld-extract-base): Update. + (-gen-ifld-extract-beyond): Update. + (gen-multi-ifld-extract): Update. + * *.cpu: Update. + * simplify.inc: Update. + +1999-08-20 Doug Evans + + * sim.scm (-op-gen-queued-write): Fix memory address calculation. + Prefix queue function name with sim_ instead of @cpu@_. + + * sim.scm (-with-parallel-only?): New global. + (option-init!): Initialize it. + (option-set!): Set it. + (with-parallel-only?): New proc. + * sim-decode.scm (-gen-decode-insn-globals): Don't include parallel + and writeback markers if with-parallel-only. + (-gen-idesc-init-fn): Update. + * sim-cpu.scm (cgen-cpu.h): Don't generate struct parexec if + with-generic-write. + +Wed Aug 18 15:04:30 1999 Doug Evans + + * sim-cpu.scm (-gen-semantic-fn-table): Handle unsupported insns + with the invalid insn handler. + + * utils.scm (list-maybe-ref): New proc. + + * mach.scm (-isa-parse): Signal error if isa wasn't specified in + define-arch. + (-mach-parse): Signal error if mach wasn't specified in define-arch. + + * i960.cpu (test*-*): Delete `expr' arg. + (test-op,branch-op): Update. + +1999-08-09 Doug Evans + + * sim.scm (gen-reg-getter-fn,gen-reg-setter-fn): New procs. + (gen-reg-access-decl): Replace `name' arg with `hw'. All callers + updated. + (gen-reg-access-defn): Ditto. + (-gen-hw-addr): Rewrite. + (-op-gen-queued-write): Rewrite. + * sim-cpu.scm (-gen-cpu-reg-access-decls): + (-gen-scache-semantic-fn): Handle with-generic-write. + (-gen-no-scache-semantic-fn): Ditto. + +1999-08-08 Doug Evans + + * utils-gen.scm (gen-define-ifmt-ifields): Tweak output. + + * sim.scm (-with-generic-write?): New global. + (option-init!): Initialize it. + (option-set!): Set it. + (with-generic-write?): New proc. + (-gen-hw-addr): New proc. + (-op-gen-queued-write): New proc. + (-op-gen-set-{quiet,trace}-parallel): Use it if with-generic-write?. + + * sim-cpu.scm (-gen-hardware-types): Output code with parallel support + turned off. + (-gen-sem-switch): Preserve existing with-parallel? value. + (-gen-sem-parallel-switch): Ditto. + (-gen-write-case): Add /indent support. + (cgen-write.c): Rewrite. + + * utils.scm (-current-print-state): New global. + (make-print-state): New proc. + (pstate-indent,pstate-set-indent!): New procs. + (pstate-cmd?,pstate-cmd-do): New procs. + (/indent): New global. + (/indent-set,/indent-add): New procs. + (string-write): Set -current-print-state. + (-string-write): New arg pstate, all callers updated. + Handle print-state commands. + (-string-list-flatten): New proc. + (string-list->string): Use it. + + * sim-cpu.scm (-gen-sem-fn-name): Move here from sim-decode.scm. + (-gen-sem-fn-table-entry): New proc. + (-gen-semantic-fn-table): New proc. + (-gen-scache-semantic-fn): Make fn static. + (-gen-no-scache-semantic-fn): Ditto. + (cgen-semantics.c): Define macro SEM_FN_NAME. + * sim-decode.scm (-gen-decode-insn-globals): Delete FMT,TYPE,IDX, + FAST,FULL. Update @cpu@_insn_sem contents. + (-gen-semf-fn-name): Delete. + (-gen-sem-fn-decls): Delete. + (-gen-idesc-decls): Output prototypes of @cpu@_sem_init_idesc_table, + @cpu@_semf_init_idesc_table. + (-gen-idesc-init-fn): Update. Don't initialize pointers to semantic + handlers here. + (cgen-decode.h): Print sfmt enum. + * utils-gen.scm (gen-sfmt-enum-decl): New proc. + + * iformat.scm (sfmt-build): Rename sformats from fmt-foo to sfmt-foo. + (ifmt-compute!): Ditto. + * sim-decode.scm (-gen-decoder-switch): Ditto. + + * insn.scm (insn-virtual?): New proc. + + * enum.scm (gen-enum-decl): Speed up, build string as list and then + convert to string. + * mach.scm (): attr-list is now a pair of lists. + (current-attr-list): Rewrite. + (current-attr-add!,current-attr-lookup): Rewrite. + * sim.scm (gen-cpu-insn-enum-decl): Replace append with append!. + +1999-08-06 Richard Henderson + + * ia64.cpu: Initial checkpoint. + +1999-08-06 Doug Evans + + * pmacros.scm (-pmacro-apply): Fix definition, takes only 1 arg. + (pmacros-init!): Update .apply help string. + +1999-08-03 Doug Evans + + * sim.scm (-hw-gen-set-quiet-pc): Update call to SEM_BRANCH_VIA_CACHE. + (,cxmake-skip): New method. + (,cxmake-skip): New method. + (-gen-argbuf-fields-union): Add branch_target to `chain' member. + (gen-argbuf-type): New member `skip_count'. + (sim-finish!): Update calls to @cpu@_pbb_cti_chain. + * utils-cgen.scm (atlist-cti?): Don't include SKIP-CTI insns. + + * utils-sim.scm: New file. + * dev.scm (load-sim): Load it. + (load-sid): Load it. + * cgen-sid.scm: Load it. + * cgen-sim.scm: Load it. + * iformat.scm (): New member sbuf, not initialized by + default make. + * rtx-funcs.scm (skip): Rewrite. + * rtl-c.scm (skip): Rewrite. + * m32r.cpu (sc,snc): Update `skip' usage. + * mode.scm (mode-real-mode): New proc. + * sem-frags.scm (-frag-split-by-sbuf): Rename from -frag-split-by-sfmt. + Distinguish fragments by the they use. + * sim.scm (gen-profile-index-type): Delete. + (ifield argbuf support): Move to utils-sim.scm and sim-decode.scm. + (-gen-ifld-decoded-val): Delete, use gen-extracted-ifld-value instead. + (hardware argbuf support): Move to utils-sim.scm and sim-decode.scm. + (operand argbuf support): Move to utils-sim.scm and sim-decode.scm. + (-gen-argbuf-elm): Rewrite. + (-gen-argbuf-hw-elm): Delete. + (-gen-argbuf-fields-union): Generate structs for each sbuf instead + of each sfmt. + (-sim-sformat-argbuf-list,-sim-insns-analyzed?): New globals. + (sim-init!): Initialize them. + (sim-analyze-insns!): Set them. + (current-sbuf-list): New proc. + * sim-cpu.scm (-gen-no-scache-semantic-fn): Update calls to + gen-sfmt-op-argbuf-defns,gen-sfmt-op-argbuf-assigns. + * sim-model.scm (-gen-model-insn-fn): Ditto. + * sim-decode.scm (-gen-extract-decls): Delete. + (-gen-record-argbuf-ifld,-gen-trace-argbuf-ifld): New procs. + (,gen-extract,gen-trace-extract): Move here from + sim.scm. + ( + + +1999-07-22 Doug Evans + + * cos.c (cos_init): Protect _make_x_symbol from garbage collection. + + * read.scm: Load sem-frags.scm. + * sem-frags.scm (*): Lots rewritten. + * arm.cpu (arm isa): Enable decode-splits. + * arm7.cpu (multiply insns): Rename result to mul-result. + + Rename decode-specialize to decode-split. + * decode.scm (*): Update. + * insn.scm (*): Update. + * mach.scm (*): Update. + +1999-07-19 Doug Evans + + Record objects as a smob. + * cos.c (scm_tc16_object): New static global. + (cos_init): Initialize it. + (OBJECT_P,OBJECT_ELEMENTS,OBJECT_CLASS_DESC): Update macros. + (OBJECT_CLASS,OBJECT_ELEMENT_OFFSET): Update. + (_object_tag): Delete. + (_object_make_smob): New function. + (_object_make_x,_object_make_with_values_x): Rewrite. + (_object_elements,_object_class_desc): Rewrite. + (_object_copy,object_p): Rewrite. + (_object_specialize): Rewrite. + (_object_print_elms,_object_print): New functions. + (object_smob): New static global. + (default_make_x): Use OBJECT_ELEMENT_OFFSET instead of magic number. + + * cos.c (_make_x_symbol): New static global. + (object_make): Use it. + (cos_init): Initialize it. + +1999-07-16 Doug Evans + + * frv.opc (CGEN_DIS_HASH_SIZE): Change to 128. + (CGEN_DIS_HASH): Hash on f-op ifield value. + +1999-07-15 Doug Evans + + * rtl-c.scm (ifield): Back out last patch, use estate-ifield-var? + instead to determine whether to use FLD macro. + (): New member ifield-var?. + (,vmake!): Recognize #:ifield-var?. + * utils-gen.scm (-gen-ifld-extract-base): Specify #:ifield-var? #f. + (-gen-ifld-extract-beyond,gen-multi-ifld-extract): Ditto. + + * rtl.scm (rtx-sequence-assq-locals): New proc. + + * cos.scm (-object-error): Don't crash on non-objects. + + * Makefile.am (CLEANFILES): Add hobbit. + * Makefile.in: Rebuild. + + * rtl-c.scm (s-c-call): Delete unnecessary code. + +1999-07-14 Doug Evans + + * rtl-c.scm (ifield): Always reference value via `FLD'. + + * cos.c (elm_bound_p): Return problem SCM boolean values. + + * utils-cgen.scm (display-argv): New proc. + * cgen-opc.scm (cgen): Call it. + * cgen-sim.scm (cgen): Ditto. + * cgen-gas.scm (cgen): Ditto. + * cgen-stest.scm (cgen): Ditto. + +1999-07-05 Doug Evans + + * opc-asmdis.scm (-gen-parse-switch): New local var `junk'. + * opc-ibld.scm (-gen-insert-switch): Initialize result to NULL. + (-gen-extract-switch): Initialize result to 1. + * opcodes.scm (gen-ifield-default-type): New proc. + (gen-ifield-value-decl): Renamed from gen-ifield-type. All callers + updated. + (,gen-insert): Handle non-ifield indices. + (,gen-extract): Ditto. + (,gen-parse): Ditto. + (,gen-print): Ditto. + (,gen-parse): Ditto. + (,gen-print): Ditto. + (,gen-fget): Ditto. + (,gen-fset): Ditto. + + * sim.scm (-gen-hw-index-raw): Handle scalar indices. + (-gen-hw-index): Ditto. + + * sem-frags.scm: New file. + + * attr.scm (attr-parse): Add better checking of input. + + * hardware.scm (-hw-parse-getter): Renamed from -hw-parse-get. + All uses updated. + (-hw-parse-setter): Renamed from -hw-parse-set. All uses updated. + + * ifield.scm (ifld-nil?): New proc. + + * operand.scm (): New members getter,setter. + (,make!): New args getter,setter. All uses updated. + (op:getter,op:setter): New procs. + (,field-start): Return 0 for non-ifield indices. + (,field-length): Return 0 for non-ifield indices. + (-operand-parse-getter,-operand-parse-setter): New procs. + (-operand-parse): New args getter,setter. All callers updated. + Always use hw-index-scalar for scalar operands. + (-operand-read): Handle getter,setter. + (define-full-operand): New args getter,setter. All uses updated. + * semantics.scm (-build-ifield-operand!): Update. + (-build-index-of-operand!): Update. + * sim.scm (,cxmake-get): If operand has getter, use it. + * simplify.inc (define-normal-operand): Update. + + * rtl.scm (abs,sqrt,cos,sin,min,max,umin,umax): New rtx fns. + * rtl-c.scm (s-unop): Indirect fp ops through fpu op vector. + (s-binop,s-cmpop,s-convop): Ditto. + (abs,sqrt,cos,sin,min,max,umin,umax): New rtx fns. + * sparc.cpu (insn-fmt2): Add FPOPS1,FPOPS2. + (fcc-tests): New insn-enum. + (fcc-value): Rename from fcc-type. + * sparcfpu.cpu: New file. All fp support moved here. + + * rtl.scm (): New member class. + (rtx-class-*?): New procs. + (def-rtx-node): New arg class. All callers updated. + (def-rtx-syntax-node,def-rtx-operand-node,def-rtx-dual-node): Ditto. + * rtx-funcs.scm (*): Specify class. + + * utils-cgen.scm (context-make-reader): New proc. + + * utils.scm (assert-fail-msg): New variable. + (assert): Use it. + (list-drop,list-tail-drop): New procs. + +1999-06-22 Doug Evans + + * desc-cpu.scm (-gen-hash-defines): Restore generation of + CGEN_MIN_INSN_SIZE deleted on March 22. + + * ifield.scm (,needed-iflds): New method. + (,needed-iflds): New method. + (ifld-needed-iflds): New proc. + (multi-ifield?): New proc. + * iformat.scm (): Delete member ifmt. New members length,iflds. + (-sfmt-search-key): Include insn length in key. + (-sfmt-order-iflds,-sfmt-used-iflds): New procs. + (): Delete members ifmt-key,sfmt-key. New member used-iflds. + (-ifmt-lookup-ifmt!): Compute key here. + (-ifmt-lookup-sfmt!): Compute key here. Delete arg ifmt. + All callers updated. + (ifmt-build): Delete arg desc. New args search-key,iflds. + All callers updated. + (sfmt-build): Delete args desc,ifmt. New args search-key,cti?, + in-ops,out-ops,sorted-used-iflds. All callers updated. + * minsn.scm (minsn-make-alias): Use insn-set-ifmt!. Update call + to ifmt-build. + * operand.scm (op-iflds-used): New proc. + * utils-gen.scm (gen-ifld-type): Move here from sim.scm + and sim-cpu.scm. + (gen-ifld-extract-decl,-gen-ifld-extract-base): Ditto. + (-gen-extract-word,-gen-ifld-extract-beyond): Ditto. + (gen-ifld-extract,gen-multi-ifld-extract): Ditto. + (gen-extracted-ifld-value): Ditto. + (-extract-chunk-specs): Ditto. + (gen-define-ifields,gen-define-ifmt-ifields): Ditto. + (-extract-chunk,-gen-extract-beyond-var-list): Ditto. + (gen-extract-ifields,gen-extract-ifmt-ifields): Ditto. + (-extract-insert-subfields): New function. + * sim.scm (gen-record-argbuf-ifld): Renamed from gen-ifld-extract. + (gen-record-argvar-ifld): Renamed from gen-ifld-extract-argvar. + * sim-cpu.scm (-gen-extract-ifmt-macro): Replace calls to + gen-define-ifields with gen-define-ifmt-ifields. Ditto for + gen-extract-foo. + (-gen-no-scache-semantic-fn): Ditto. + (-gen-sem-case): Ditto. + (-gen-read-case): Update calls to gen-define-ifields, + gen-extract-ifields. + * sim-decode.scm (-gen-record-args): Update. + (-gen-sfmt-argvars-assigns): Update. + (-gen-extract-case): Update. + * sim-model.scm (-gen-model-insn-fn): Replace calls to + gen-define-ifields with gen-define-ifmt-ifields. Ditto for + gen-extract-foo. + +1999-06-18 Doug Evans + + + * rtl.scm (-rtx-traverse): Output symbol shortcuts in source form, + (operand name) not (operand object), (local name) not (local object). + (rtx-traverse-with-locals): New proc. + (-compile-expr-fn): New proc. + (rtx-compile): Rewrite. + * rtl-c.scm (rtl-c-get): Handle operand/local names for src arg. + (rtl-c-set-quiet): Don't accept operand/local names for dest arg. + (rtl-c-set-trace): Ditto. + (operand define-fn): Recognize operand name argument. + (local define-fn): Recognize sequence temp name argument. + * rtx-funcs.scm (operand): Argument is operand name, not object, + so call current-op-lookup. + (local): Similarily, so call rtx-temp-lookup. + + * rtl.scm (rtx-field?): Use rtx-name instead of car. + (rtx-operand?): Ditto. + (rtx-pretty-name): Ditto. + (rtx-local-obj): Flag symbol argument as an error. + (rtx-local-name): New proc. + (rtx-sequence-locals,rtx-sequence-exprs): New procs. + + * rtl.scm (-rtx-traverse-operands): Fix debugging output of arg-types. + + * read.scm (debug-repl): Renamed from -debug-repl. All callers + updated. + + * arm7.cpu (do-word/byte-store): Use (trunc: QI rd) rather than + (and: QI rd #xff). + + * hobbit.scm (*reckless-s->c-fun-table*): Add fastcall4, fastcall6. + (*floats-s->c-fun-table*): Ditto. + * hobbit.c,hobbit.h: Rebuild. + * rtl.scm (-rtx-traverse-expr): Use fastcall6. + * semantics.scm (rtx-simplify): Use /fastcall-make. + + * iformat.scm (-sfmt-search-key): Don't include memory modes. + + * insn.scm (): Delete members condition, compiled-condition. + (,make!): Update + ( getters,setters): Update. + (-insn-parse,insn-read,define-full-insn): Update. + * minsn.scm (minsn-make-alias): Update. + * iformat.scm (ifmt-analyze): Delete insn-condition reference. + (ifmt-compute!): Ditto. + * sim.scm (sim-finish!): Update. + * simplify.inc: (define-normal-insn): Update. + + * iformat.scm (-ifmt-lookup-ifmt!): Use insn-set-ifmt!. + (-ifmt-lookup-sfmt!): Use insn-set-sfmt!. + (ifmt-compute!): Ditto. + +1999-06-16 Doug Evans + + * minsn.scm (minsn-compute-iflds): Print better error message for + missing ifields. + +1999-06-12 Doug Evans + + * rtl.scm (tstate->estate): Don't copy over expr-fn. + + * Makefile.am (HOBFLAGS): New variable. + (cgen-hob.c): Use it. + (hobbit.c): Use it. + (libcpu_a_SOURCES): Add hob-sup.c. + (hob-sup.o): New rule. + * Makefile.in: Rebuild. + * cgen.c: #include hob-sup.h. + (cgen_init_c): Call hobbit_init_support. + * hobbit.scm (*fastcall-make*,*c-symbol*): New variables. + (*special-scm->c-functions*): Add them. + (display-c-expression): Handle *c-symbol*. + (*reckless-s->c-fun-table*): Add *fastcall-make*, fastcall5. + (*floats-s->c-fun-table*): Ditto. + (normalize): Recognize /fastcall-make. + (normalize-fastcall-make): New proc. + * hobbit.c,hobbit.h: Rebuild. + * hob-sup.scm: New file. + * hob-sup.c: New file. + * hob-sup.h: New file. + * read.scm: Load hob-sup.scm. + * rtl.scm (-rtx-name-list): New variable. + (rtx-name-list): New proc. + (rtx-lookup): Try symbol first. + (def-rtx-node): Add name to -rtx-name-list. + (def-rtx-syntax-node,def-rtx-operand-node,def-rtx-macro-node): Ditto. + (-rtx-traverse-anymode): New proc. + (-rtx-traverse-{emode,intmode,floatmode,nummode,vmmode}): New procs. + (-rtx-traverse-{rtx,setrtx,testrtx,condrtx,casertx}): New procs. + (-rtx-traverse-{locals,env,attrs,symbol,string,number}): New procs. + (-rtx-traverse-{symornum,object}): New procs. + (-rtx-make-traverse-table): Rewrite. + (-rtx-traverse-operands): Rewrite arg-types handling. + Handle #f result of traverser. + (-rtx-traverse): Renamed from -rtx-traverse-normal. + Move debug handling here. + (-rtx-traverse-debug): Delete. + (rtl-finish!): Change -rtx-traverse-table into list of handlers + for each rtx. + * semantics.scm (semantic-compile:process-expr!): Fix call to + -rtx-traverse. + * utils.scm (map1-improper): New proc. + +1999-06-08 Doug Evans + + * arm.sim (h-tbit): Replace FUN-ACCESS with FUN-SET. + (h-mbits): Ditto. + +1999-06-07 Doug Evans + + * thumb.cpu (dnti): Delete timing spec. + (all insn): Update. + + * arm.cpu (arm isa): New fields condition, setup-semantics. + (thumb isa): New field setup-semantics. + (h-gr): Add attribute CACHE-ADDR. + * arm7.cpu (dnai): Delete condition. + (eval-cond): Delete. + + * mach.scm (): New member setup-semantics. + (-isa-parse-setup-semantics): New proc. + (-isa-parse): New arg setup-semantics. + (-isa-read): Recognize setup-semantics. + + * utils-cgen.scm (obj-set-name!): New proc. + + * attr.scm (-attr-eval): Rewrite calls to rtx-simplify/rtx-compile. + * iformat.scm (ifmt-analyze): Pass `insn' to semantic-compile, + semantic-attrs. + (ifmt-compute!): Delete arg `arch'. Result is list of iformats, + sformats. + * mach.scm (arch-analyze-insns!): Update call to ifmt-compute!. + * rtl-c.scm (rtl-c-get): Use DM for default mode instead of VM. + Avoid infinite loop when rtx-eval-with-estate leaves expr alone. + (attr): Rewrite test for insn owner. + (member): New rtx function. + * rtl.scm (rtx-* accessors): Define as cxr directly rather than + as separate function. + (rtx-ifield?,rtx-ifield-name): New procs. + (rtx-operand-obj): Rewrite. + (rtx-operand-name): New proc. + (rtx-cmp-op-mode,rtx-cmp-op-arg): New procs. + (rtx-number-list-values,rtx-member-value,rtx-member-set): New procs. + (tstate-make): New args owner, known. All callers updated. + (tstate-known-lookup): New proc. + (rtx-traverse): New arg owner. All callers updated. + (rtx-make-bool): New proc. + (rtl-find-ifields): Rewrite. + (rtx-simplify,rtx-simplify-eq-attr-{insn,mach}): Moved to ... + * semantics.scm: ... here. + (rtx-const-equal,rtx-const-list-equal): New procs. + (-build-known-values): New proc. + (semantic-compile): New arg `insn'. Call rtx-simplify. + (semantic-attrs): Ditto. + * rtx-funcs.scm (member,number-list): New rtx functions. + + * attr.scm (attr-remove-meta-attrs-alist): Delete leading '-' in name. + Rewrite. Delete arg `all-attrs'. All callers updated. + (attr-remove-meta-attrs): Delete leading '-' in name. All callers + updated. + * utils-cgen.scm (gen-bool-attrs): Remove meta attrs. + + * decode.scm (subdtable-add): Handle `expr' entries. + (exprtable-entry-make): Use vector. Record ifields refered to by expr. + (exprtable-entry-*): Update. + (exprtable-entry-iflds): New proc. + (exprentry-cost): New proc. + (exprtable-sort,-gen-exprtable-name): New procs. + (exprtable-make): New arg `name'. All callers updated. use vector. + (exprtable-*): Update. + (-build-decode-table-entry): Don't issue collision warning if all are + specialized insns. Sort exprtable entries before building table. + + * read.scm (-reader-process-expanded-1): Move pretty printing of + input to logging level 4. + + * utils.scm (string-list->string): New proc. + + * insn.scm (): Define setters for ifield-assertion, condition, + semantics. + (insn-read): Delete leading '-' in name. All callers updated. + (real-insn?): New proc. + (real-insns): Rewrite. + (insn-has-ifield?): New proc. + (insn-builtin!): Create insn attribute SPECIALIZED. + + * mach.scm (): Delete member app-data. + (current-raw-insn-list): New proc. + (insn-list-car,insn-list-splice!): New procs. + (): New class. + (-isa-parse-decode-specialize): New proc. + (-isa-parse-decode-specializes): New proc. + (): New members `condition', `decode-specializes'. + (-isa-parse-condition): New proc. + (-isa-parse): New args condition, decode-specializes. + (-isa-read): Recognize condition, decode-specializes. + (-isa-add-decode-specialize!): New proc. + (modify-isa): New proc. + (isa-conditional-exec?,state-conditional-exec?): New procs. + (arch-init!): New reader command `modify-isa'. + + * mode.scm (mode-class-signed?,mode-class-unsigned?): New procs. + (mode-signed,mode-unsigned?): New procs. + +Thu Jun 3 16:00:40 1999 Doug Evans + + * types.scm (): New method get-shape. + * hardware.scm (): Forward get-shape,get-num-elms + onto type. + (hw-shape,hw-num-elms): New procs. + * sim.scm (,gen-profile-index-type): Use "unsigned short" + if there's more than 255 registers. + + * hardware.scm (-hw-parse): Flag as error CACHE-ADDR specified + with get/set specs. + +1999-05-10 Ben Elliston + + * arm7.cpu: Remove coprocessor related fields, operands and insn + definitions for now. Take the undefined instruction trap instead. + (ldmda-wb): New instruction. + (ldmib-wb): Likewise. + (ldmdb-wb): Likewise. + (stmdb-wb): Likewise. + (stmib-wb): Likewise. + (stmda-wb): Likewise. + +1999-05-08 Doug Evans + + + * utils-cgen.scm (keyword-list->arg-list): Fix call to substring, + hobbit can't handle optional third arg. + +1999-05-07 Doug Evans + + * arm.cpu (h-tbit): Delete set spec. + (h-mbits): Don't call arm_mbits_set in set spec. + * arm.sim: New file. + * hardware.scm (modify-hardware): New proc. + (hardware-init!): Add modify-hardware command. + * utils-cgen.scm (keyword-list?): New proc. + (keyword-list->arg-list,arg-list-validate-name): New procs. + (arg-list-check-no-args,arg-list-symbol-arg): New procs. + + * arm7.cpu (eval-cond): Pass pc to @cpu@_eval_cond handler. + + + * attr.scm (obj-prepend-atlist!): New proc. + + * opc-opinst.scm (cgen-opinst.c): Analyze instructions if necessary. + + * sim.scm (,profilable?): Use op:type. + +1999-05-04 Doug Evans + + * utils.scm (find-index,find): Be more stack friendly. + + * arm7.cpu (arith-imm-op): Compute pc before setting cpsr. + (bic-imm): Ditto. + +1999-05-01 Doug Evans + + * arm.cpu (h-gr-usr): New hardware element. + (h-gr-fiq,h-gr-svc,h-gr-abt,h-gr-irq,h-gr-und): New hardware elements. + (arm-mode): New keyword. + (h-mbits): Add set spec. + (h-spsr): Implement get/set specs. + + * read.scm: Load slib/pp.scm, slib/genwrite.scm. + (-reader-process-expanded-1): Pretty print logging output. + + + * utils-cgen.scm (context-error): Accept variable number of + trailing args. + + * rtx-funcs.scm (error:): New rtx function. + * rtl-c.scm (s-case-vm): New proc. + (-gen-non-vm-case-get,s-case-non-vm): New procs. + (s-case): Simplify, handle non-VM result. + (error:): New rtx function. + +1999-04-30 Doug Evans + + * arm.cpu (h-pc): Add set spec to zero bottom bits. + (test-hi,test-ls): Fix cbit handling. + (shift-type,h-operand2-shifttype): Move here ... + * arm7.cpu: ... from here. + (set-cond,set-cond-maybe,dnix): Delete, unused. + (set-zn-flags,set-logical-cc,set-add-flags,set-sub-flags): Move ... + * arm.cpu: ... to here. + * thumb.cpu (cmp,alu-cmp): Use set-sub-flags. + (alu-cmn): Use set-add-flags. + (alu-tst): Use set-zn-flags. + (alu-cmp): Use set-sub-flags. + (lsl,lsr,asr): Set condition codes. + (add,addi,sub,subi,mov,addi8,subi8): Ditto. + (alu-op): Split into three: alu-logical-op,alu-arith-op, + alu-shift-op. + (hireg-op): Split sem-fn into lo-dest-sem-fn,hi-dest-sem-fn. + All callers updated. + (sub-sp): Rename from add-sp-neg. + (f-lbwl-offset): Delete. + (f-lbwl-hi,f-lbwl-lo): New ifields. + (lbwl-hi,lbwl-lo): Update. + (bl-hi): Add 4 to pc. + (push-reg,pop-reg): Simplify. + (push,push-lr): Push registers in correct order. + (pop,pop-pc): Pop registers in correct order. + (save-reg-inc,load-reg-inc): Simplify. + (ldmia): Save registers in correct order. + +1999-04-30 Ben Elliston + + * arm7.cpu (f-op-hdt): Remove; unused. + (f-ror-imm8-value,f-ror-imm-rotate): New fields. + (f-ror-imm8): New multi-ifield. + (f-operand2-bit7): Remove; use the generic `f-bit7' instead. All + callers updated. + (f-uimm12): New field. + (ror-imm8): New operand. + (uimm12): Likewise. + (hdt-offset8): Reinstate operand. + (offset4-hi,offset4-lo): Remove. + (set-cond): Remove macro; unused. + (set-cond-maybe): Likewise. + (load-word/byte): Use uimm12 operand for a true 12-bit immediate. + (store-word/byte): Likewise. + (load-halfword): Use hdt-offset8 multifield operand instead of two + 4-bit operands that are explicitly combined by semantic code. + (do-halfword-store): Bug fix. Set address when not preindexing. + (store-halfword): Also use hdt-offset8 operand. + (arith-op): Avoid clobbering source registers when one of them is + the destination register. + (arith-imm-op): Likewise. + (tst-imm): Use ror-imm8 operand. Handle special case of rot 0. + (teq-imm): Likewise. + (ldm-p): Rename to ldmdb. + (stm-pw): Rename to stmdb-wb. + (multi-action): New macro; test reg-list bits and execute a + semantic fn if the bit is set. + (ldmda,ldmib,ldmia,ldmia-wb,ldmdb): New multiple load insns. + (stmdb,stmib,stmia,stmia-wb,stmda,stmdb-wb): Store insns. + (all insns): Use dnai entries for simplicity rather than dni. + (*): Use short-form of (const ..). + +1999-04-29 Doug Evans + + * rtl.scm (): Rename member type to style. Rename + member eval to evaluator. + (rtx-foo accessors): Rename from rtx:foo. All callers updated. + (tstate-make): Delete arg op-fn. All callers updated. + (tstate-op-fn,tstate-set-op-fn!): Delete. + (rtx-traverse): Delete op-fn arg. All callers updated. + * semantics.scm (-simplify-for-compilation-process-expr): New proc, + split out of -simplify-for-compilation. + + * Makefile.am (CGEN_NONHOB_FILES,CGENFILES): New variables. + (cgen_DEPENDENCIES): Add stamp-cgen. + (stamp-cgen): New rule. + * Makefile.in: Rebuild. + + * rtl-c.scm (enum:): Define emitter for. + * rtl.scm (rtx-constant?): Rename from rtx-const? and check for + enums as well. + (rtx-constant-value,rtx-enum-value): New procs. + (-rtx-traverse-normal): Expand enum-value to (enum enum-value). + (rtx-compile-time-constant?): Return #t for enums. + (rtx-true?,rtx-false?): Handle enums. + (rtx-simplify-eq-attr-mach): Use rtx-true,rtx-false instead of + building result by hand. + (rtx-simplify-eq-attr-insn): Ditto. + * rtx-funcs.scm (enum:,enum): New rtx functions. + + * mach.scm (): New members insns-analyzed?, semantics-analyzed?, + aliases-analyzed?. + (arch-analyze-insns!): New proc. + * opcodes.scm (opcodes-analyze!): Call arch-analyze-insns! instead + of calling ifmt-compute! directly. + * sim.scm (-sim-insns-analyzed?): Delete. + (sim-analyze!): Call arch-analyze-insns! instead of calling + ifmt-compute! directly. + + * utils.scm (string-take-with-filler): New proc. + (string-take): Use it. + + * pgmr-tools.scm: New file. + * read.scm: Load it. + * insn.scm (pretty-print-insn-format): Move to pgmr.scm. + + * insn.scm (insn-base-mask): Renamed from insn:mask. + All callers updated. + (insn-base-mask-length): Renamed from insn:mask-length. + All callers updated. + (insn-foo): Renamed from insn:foo. All callers updated. + * minsn.scm (minsn-foo): Renamed from minsn:foo. All callers updated. + * iformat.scm (compute-insn-base-mask-length): Renamed from + compute-insn-mask-length. All callers updated. + (compute-insn-base-mask): Renamed from compute-insn-mask. + All callers updated. + + * enum.scm (-enum-parse-prefix): New proc. + (,make!): Don't parse enum values here. + (-enum-parse): Do it here. Call -enum-parse-prefix. + (define-full-insn-enum): Ditto. + (enum-vals-upcase): New proc. + * hardware.scm (define-keyword): Make enum prefix uppercase. + * hobscmif.h (CHAR_LOWERP,CHAR_UPPERP,CHAR_WHITEP): New macros. + + * ifield.scm (,field-mask): Allow container to be #f. + (,field-extract): New method. + (,field-extract): New method. + (ifld-extract): New proc. + * opcodes.scm (ifld-insert-fn-name): Renamed from ifld-insert. + (ifld-extract-fn-name): Renamed from ifld-extract. + + * ifield.scm (ifld-new-value): Renamed from ifield-make. + All callers updated. + + * ifield.scm (ifld-lsb0?): New proc. + (sort-ifield-list): New arg up?. All callers updated. + * iformat.scm (compute-insn-mask): Get lsb0? flag from argument, + rather than global state. + +1999-04-27 Doug Evans + + * insn.scm (pretty-print-insn-format): New proc. + + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild + * configure: Rebuild. + +Mon Apr 26 10:30:18 1999 Doug Evans + + * configure.in (AM_INIT_AUTOMAKE): Update version to 0.7.2. + * configure: Rebuild. + * aclocal.m4: Rebuild. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + * doc/version.texi: Rebuild. + +1999-04-25 Doug Evans + + * utils.scm (bits->bools): New proc. + +1999-04-23 Ben Elliston + + * arm7.cpu (ldrsh-pu): Remove. + (do-halfword-load): New pmacro. + (load-halfword): Likewise. + (do-halfword-store): Likewise. + (store-halfword): Likewise. + (strh-*): New instructions. + (ldrsb-*): Likewise. + (ldrh-*): Likewise. + (ldrsh-*): Likewise. + +1999-04-22 Doug Evans + + * ifield.scm (ifld-constant?): Delete special handling of RESERVED + fields. + + * arm7.cpu (do-word/byte-store): Fix typo. + +1999-04-22 Ben Elliston + + * arm7.cpu (do-word/byte-load): Handle cases where the destination + register is the program counter (R15). + + * arm7.cpu (do-word/byte-store,store-word/byte): New pmacros. + (str-*): Implement using store-word-byte. Remove older versions. + (bic): Use the `inv' rtx for obtaining bitwise complements. + (bic-imm): Likewise. + (mvn): Likewise. + (mvn-imm): Likewise. + (store-indev-reg): Remove crufty pmacro. + (load-indiv-reg): Likewise. + (ldm-p): Reverse the order of register processing for decrement. + (stm-p): Likewise. + (stbi): Remove; handled by the str-* insns. + +1999-04-21 Doug Evans + + * thumb.cpu (cmp): Fix carry bit computation. + (alu-cmp): Ditto. + +1999-04-20 Doug Evans + + * arm.cpu (h-tbit): Specify set spec. + (h-cpsr): Ditto. + * arm7.cpu (bx): Don't call C routine, just set h-tbit. + (set-sub-flags): Interpret "carry bit" as a borrow. + (all sub/cmp insns): Carry bit is actually a borrow bit. + * thumb.cpu (bx-rs,bx-hs): Don't call C routine, just set h-tbit. + (add-carry,sub-carry,thumb-neg,thumb-bic,thumb-inv): Delete. Use + .pmacro instead. + (hireg-add,hireg-cmp,hireg-move): Ditto. + + * read.scm (-CGEN-VERSION): Change version to 0.7.2. + (-CGEN-LANG-VERSION): Ditto. + +1999-04-18 Doug Evans + + * pmacros.scm (-pmacro-make): New arg `default-values', + all callers updated. + (-pmacro-default-values): New proc. + (-pmacro-process-keyworded-args): New proc. + (-pmacro-process-args): New proc. + (-pmacro-invoke): Process arguments before expanding macro. + (-pmacro-get-arg-spec,-pmacro-get-default-values): New procs. + (define-pmacro): Handle default values specified in arg list. + * rtl.scm (rtx-alu-op-mode,rtx-alu-op-arg): New procs. + (rtx-boolif-op-arg[01]): New procs. + (rtx-true,rtx-false,rtx-canonical-bool): New procs. + (rtx-simplify): Handle not,orif,andif. + * semantics.scm (-simplify-for-compilation): Simplify not,orif,andif. + * utils.scm (alist-copy): New proc. + * arm7.cpu (do-word/byte-load,load-word/byte): New pmacros. + (ldr*): Rewrite. + (swi): Explicitly set pc. + + * thumb.cpu (bx-rs,bx-hs): Reverse test for switch to arm mode. + +1999-04-17 Ben Elliston + + * arm7.cpu (ldr-pu): Do not add 8 to R15; the step() method + correctly adjusts the program counter now. + + * arm7.cpu (f-halfword?): Rename from `f-hdt-halfword?'. + (f-signed?): Rename from `f-hdt-signed?'. + (f-offset4-hi): Rename from `h-hdt-off4-ms'. + (f-offset4-lo): Rename from `h-hdt-off4-ls'. + (f-hdt-offset8): Use new field names. + (ldr): Use `imm12' field, not `offset12', since we do our own + address arithmetic. + (str, str-*): Likewise. + (ldu-*): Remove most; better not implemented than broken. + (ldrh*): Likewise. + (ldrsh-pu): New insn. + (stri): Likewise. + (stri-p): Likewise. + (stbi): Likewise. + (ldm-p): Likewise; replace (load-indiv-reg) version. + +1999-04-15 Doug Evans + + * arm.cpu (h-pc): Delete VIRTUAL attribute, get/set specs. + * arm7.cpu (*): Fix mode of result of arm_compute_carry_out_*. + (*): Explicitly specify mode in c-call. + (logical-op): Recognize sets of h-gr[15] as sets of pc. + (arith-op): Ditto. + (and-imm,orr-imm,xor-imm,mov-imm,bic-imm,mvn-imm): Ditto. + (arith-imm-op): New pmacro. + (add-imm,adc-imm,sub-imm,sbc-imm,rsb-imm,rsc-imm): Use it. + * thumb.cpu (bx-rs,bx-hs): Rewrite. + +1999-04-14 Doug Evans + + * rtl.scm (rtx-simplify-eq-attr-insn): Fix call to context-error. + + * rtl.scm (rtl-find-ifields): Implement. + + * utils-gen.scm: New file. + * read.scm: Load it. + * desc.scm: Move generic attribute code to utils-gen.scm. + * Makefile.am (CGEN_HOB_INPUT_FILES): Add it. + * Makefile.in: Rebuild. + + * arm7.cpu (R15-OFFSET): New attribute. + (dnai): New pmacro. + (logical-op): Delete arg `result?'. All callers updated. Use dnai. + Delete use of eval-cond (dnai specifies it). Specify R15-OFFSET of 12 + for reg-shift version. + (arith-op): Ditto. + (data processing insns): Reorganize. Use dnai. + + * attr.scm (attr-kind): New proc. + (attr-list-enum-list): Rewrite. + (-attr-sort): Split result into two lists, bools and non-bools. + (current-attr-list-for): Update. + + * thumb.cpu (bx-rs): Rename @cpu@_do_bx to @prefix@_do_bx. + (bx-hs): Ditto. + (swi): Rename @cpu@_swi to @prefix@_swi. + + * decode.scm (-build-decode-table-entry): Remove heuristic for + distinguishing insns, and use insn ifield-assertion specs. + + * desc-cpu.scm (gen-A-attr-mask): Simplify. + (gen-ifld-defns): Boolean attributes begin at number 0 now. + (gen-hw-table-defns,gen-operand-table,gen-insn-table): Ditto. + * opc-itab.scm (-gen-macro-insn-table): Ditto. + * utils-cgen.scm (gen-attr-enum-decl): Change type arg to prefix, + all callers updated. + (gen-attr-name): New proc + (gen-attr-mask): Use it. Boolean attributes start at 0 now. + (gen-obj-attr-defn): Delete num_nonbools count. + + * iformat.scm (ifmt-analyze): Handle insn-condition. + (ifmt-compute!): Ditto. + * insn.scm (): Specify default value for condition, + post-cond-trap,compiled-condition,compiled-semantics. + (,make!): New arg condition. + (): Add getters for condition,compiled-condition. + (-insn-parse): New arg condition, all callers updated. + (-insn-read): Recognize condition spec. + (define-full-insn): New arg condition. + * minsn.scm (minsn-make-alias): Update call to (make ...). + * semantics.scm (semantic-compile): Change arg sem-code to + sem-code-list. + (semantic-attrs): Ditto. + * sim.scm (sim-finish!): Update calls to define-full-insn. + * simplify.inc (define-normal-insn): Update call to define-full-insn. + +Tue Apr 13 17:04:34 1999 Doug Evans + + * Makefile.am (sim-cpu): Allow specification of ISA. + * Makefile.in: Rebuild. + +Sun Apr 11 00:37:56 1999 Jim Wilson + + * i960.cpu (sll-expr, srl-expr, sra-expr): Handle large shift counts. + +1999-04-10 Doug Evans + + * sparccom.cpu (check-fp-enable): Wrap TRAP32_FP_DIS in c-code. + + * arm.cpu (gr-names): Put pc first so it gets prefered in disassembly. + + * attr.scm (atlist?): New proc. + (-attr-eval): Rewrite. + (attr-parse): New proc. + (atlist-parse): Use it. + + * decode.scm (exprtable-entry-make): New proc. + (exprtable-entry-insn,exprtable-entry-expr): New procs. + (exprtable-make,exprtable-insns): New procs. + + * hardware.scm (hw-mode-ok?): Delete argument `set?'. + All uses updated. + (hardware-builtin!): Make h-memory a vector. + + * iformat.scm (ifmt-ifields): Renamed from ifmt-fields. + All callers updated. + (ifmt-analyze): Use csem-* accessors on result of semantic-compile. + + * insn.scm (). Rename ifld-assertions to ifield-assertion. + All uses updated. + (-insn-parse): Set semantics to #f if not specified. + (define-insn,define-full-insn): Take out code that ignores ALIAS's + if simulator. + (-parse-insn-format): Recognize `=' iformat spec. + + * mach.scm (isa-min-insn-bitsize): Ignore ALIAS's. + (isa-max-insn-bitsize): Ditto. + + * opcodes.scm (,gen-insert): Call rtl-c instead of + rtl-c-with-alist. + (,gen-extract): Ditto. + (,gen-insert,gen-extract): Ditto. + * sim-cpu.scm (gen-semantic-code): Rewrite. + * sim.scm (-gen-ifld-extract-base): Call rtl-c instead of + rtl-c-with-alist. + (-gen-ifld-extract-beyond): Ditto. + (,gen-ifld-extract): Ditto. + (,gen-get-macro,gen-set-macro): Ditto. + (<*>,cxmake-get,gen-set-quiet,gen-set-trace,gen-write): Update to new + rtl evaluation code. + (op:read): Build an to pass to gen-read. + (op:write): Build an to pass to gen-write. + (op:record-profile): Build an to pass to + gen-record-profile. + + * operand.scm (): Give `selector' default value of #f. + Give `num' default value of -1. Give `cond?' default value of #f. + (op:new-mode): Delete arg `set?', all uses updated. + + * read.scm (reader-error): Handle #f return from port-filename. + (-init-parse-cpu!): Call rtl-c-init!. + (reader-install-builtin!): Call rtl-builtin!. + + * rtl-c.scm: New file. + * semantics.scm: New file. + * read.scm: Load them. + * rtl.scm: C generation moved to rtl-c.scm. Semantic analysis moved + to semantics.scm. + (): Delete members syntax?,macro,c,expr. New members + type,eval,num. + (rtx-lookup): Renamed from -rtx-func-lookup. All callers updated. + (-rtx-num-text,-rtx-max-num): New globals. + (def-rtx-operand-node,define-rtx-operand-node): New procs. + (-rtx-macro-lookup): New proc. + (rtx-lvalue-mode-name): Renamed from rtx-expr-mode-name. + (rtx-env-stack-empty?,rtx-env-stack-head): New procs. + (rtx-env-var-list,rtx-env-empty-stack,rtx-env-init-stack1): New procs. + (rtx-env-make,rtx-env-empty?,rtx-env-make-locals): New procs. + (rtx-env-push,rtx-temp-lookup,-rtx-closure-make): New procs. + (rtx-make,rtx-kind?,rtx-const?,rtx-const-value,rtx-symbol-name, + rtx-operand?,rtx-operand-obj,rtx-local?,rtx-local-obj, rtx-xop-obj, + rtx-index-of-value,rtx-if-mode,rtx-if-test,rtx-if-then,rtx-if-else, + rtx-eq-attr-owner,rtx-eq-attr-attr,rtx-eq-attr-value): New procs. + (rtx-pretty-name): New proc. + (-rtx-traverser-table,-rtx-make-traverse-table): New procs. + (rtx-traverse-*): Rewrite rtx traversing. + (rtx-eval-*): Rewrite rtx evaluation. + (rtx-compile): New proc. + (rtx-simplify): New proc. + (rtx-simply-eq-attr-mach,rtx-simplify-eq-attr-insn): New procs. + * rtx-funcs.scm: C generation moved to rtl-c.scm. + (ifield,index-of): Rewrite. + (name): Renamed from `operand:'. + (operand,xop,local): New rtx's. + (current-insn): Rewrite. + * Makefile.am (CGEN_HOB_INPUT_FILES): Add rtl-c.scm, semantics.scm. + (cgen-hob.h): Remove rule for. + (cgen-hob.o): Depend on cgen-hob.c only. + * Makefile.in: Rebuild. + + * utils-cgen.scm (vmake): New proc. + (): New class. + (context-make-prefix,context-error): New procs. + +Fri Apr 9 19:26:28 1999 Jim Wilson + + * i960.cpu: Add some ??? comments. + (xnor, ornot): New instructions. + (*): Delete obsolete COND-CTI and UNCOND-CTI attributes. + +1999-04-08 Doug Evans + + * cos.scm (-object-error): Print better error message. + + * pmacros.scm (-pmacro-env-make): Renamed from -env-make. + (-pmacro-env-ref): Renamed from -env-ref. + +1999-03-31 Doug Evans + + * hardware.scm (,parse!): Allow get/set specs. + (h-pc): Delete. + (hardware-builtin!): Delete h-pc builtin. + * arm.cpu (h-pc): Define. + (h-gr): Delete get,set specs. Make array of 16 regs again. + * arm7.cpu (set-logical-cc-maybe): Delete. + (set-zn-flags,set-add-flags,set-sub-flags): New macros. + (data processing insns): Rewrite. + * m32r.cpu (h-pc): Define. + * fr30.cpu (h-pc): Define. + * i960.cpu (h-pc): Define. + * sparc.cpu (h-pc): Define. + + * rtl.scm (-rtx-traverse-operands): Add some error checking to LOCALS. + (s-parallel): Replace do {...} while (0) with {...}. + (s-sequence): Ditto. + + +1999-03-30 Doug Evans + + * sparccom.cpu (arith-cc-binop): New args s32-set-flags,s64-set-flags. + All callers updated. + (arith-carry-cc-binop): New arg set-flags. All callers updated. + + + * read.scm (-reader-process-expanded-1): New proc. + (-reader-process-expanded): Call it to catch nested begin's. + (reader-process): Move `begin' handling to -reader-process-expanded. + + * insn.scm (-insn-read): Fix name of `format' spec. + + * pmacros.scm (.pmacro): New builtin. + (scan-symbol): If procedure macro, return macro rather than its symbol. + (check-macro): Don't do lookup, instead check if (car expr) is + macro object. + (scan-list): Handle .pmacro. + (scan): No longer re-examine text for another macro invocation. + (-pmacro-build-lambda): New proc. + (define-pmacro): Rewrite. If defining one pmacro to be an alias of + another, fetch the other's value (rather than doing it during + expansion). + +1999-03-27 Doug Evans + + * Makefile.am (CGEN_HOB_INPUT_FILES): Add decode.scm. + * Makefile.in: Rebuild. + + * decode.scm (decode-get-best-bits): Use memq instead of element?. + (-fill-slot!): Simplify. + (-build-slots): Simplify. + + * sim-decode.scm: Replace computed goto decoder/extractor with plain + switch's. + +1999-03-26 Doug Evans + + * sim-decode.scm: Clean up pass. Move decoder computation into ... + * decode.scm: ... here. New file. + * read.scm: Load decode.scm. + + * arm.cpu (arm710 model): Add u-exec function unit. + (h-gr): Delete CACHE-ADDR for now. Make array of 15, not 16 regs. + Add get/set specs to redirect reg 15 to h-pc. + (h-*): Indicate for both ARM and THUMB isas. + (cbit,nbit,vbit,zbit): Ditto. + (h-ibit,h-fbit,h-tbit,h-mbits): New hardware elements. + (h-cpsr): Make virtual. Add get/set specs. + (h-spsr-fiq,h-spsr-svc,h-spsr-abt,h-spsr-irq,h-spsr-und): New hw. + (h-spsr): New virtual reg. + * arm7.cpu (shift-type): New explicitly defined keyword. + (h-operand2-shifttype): Use it. + (set-logical-cc-maybe): Delete carry-out arg. New args arg1,arg2. + All callers updated. Don't set cbit. + (logical-op): Add rm to ifield list. Change case to case:. Use + shift-type enum as case choices. Set cbit. + (and,orr,eor,add-imm): Uncomment out. + (undefined): Temporarily comment out. + * thumb.scm (mov,cmp,addi8,subi8,str-sprel,ldr-sprel): s/rd/bit10-rd/. + (lda-pc,lda-sp): Ditto. + (ldr-pc): Rename from ldr. + (cbranch): Mark insns as being thumb insns. + + * attr.scm (,parse-value): Recognize strings. + + + * insn.scm (,iflds): Renamed from flds. All uses updated. + (,ifld-assertions): New member. + (,make!): New arg ifld-assertions, all callers updated. + ( accessors): Change insn:foo to insn-foo. All callers updated. + (insn:fields): Delete. + (-insn-parse): New arg ifld-assertions. All callers updated. + (-insn-read,define-insn): New procs. + (define-full-insn): New arg ifld-assertions. All callers updated. + (insn-init!): New comment define-insn. + + * model.scm (-model-parse): Ensure at least one unit specified. + + * rtl.scm (-rtx-traverse-operands): Recognize environments. + (,get-name): New method. + (-rtx-make-current-closure,s-closure): New proc. + (hw:): Wrap rtx indices in a closure. + (-gen-case-prefix): New proc. + (s-case): Simplify. + * rtx-funcs.scm (case:): Fix call to s-case. + (closure): New rtx func. + + * hardware.scm (): New member isas-cache. + (,get-isas): New method. + (hardware-builtin): Indicate for all isas. + * ifield.scm (-ifield-parse): Only keep if isa+mach are kept. + * mach.scm (current-arch-mach-name-list): Return list of names. + (current-isa-mach-name-list): Ditto. + (define-arch): Install builtin objects here. + * read.scm (keep-atlist?): Only keep if both mach and isa are + being kept. + (keep-mach-atlist?): New proc. + (keep-isa-multiple?,current-keep-isa-name-list): New proc. + (reader-install-builtin!): Renamed from -install-builtin!. + * sim.scm (sim-finish!): Specify isa of added x-* virtual insns. + +1999-03-22 Doug Evans + + * thumb.cpu (cpu,mach,model): Delete. + (dntf): New pmacro. Use it for all field definitions. + (dntop): New pmacro. Use it for all operand definitions. + (asr): Correct field list. + (add,addi,sub,subi,add-sp,add-sp-neg): Ditto. + + * utils-cgen.scm (define-getters): New macro to simplify + writing class accessors. + (define-setters): Ditto. + (sanitize): Recognize isa elements. + + * sim-decode.scm (-gen-decode-switch): Ditto. + + * sim-arch.scm (-regs-for-access-fns): Delete. + (-biggest-reg-mode,-gen-arch-reg-access-decls): Delete. + (-gen-arch-reg-access-defns): Delete. + + * sim-cpu.scm (*): Replace cpu:liw-insns with state-liw-insns, + cpu:parallel-insns with state-parallel-insns, cpu:parallel-exec? + with state-parallel=exec?. + (cgen-*): Call sim-analyze-insns! here. + * sim-decode.scm (cgen-*): Ditto. + * sim-model.scm (cgen-*): Ditto. + * sim.scm (-sim-insns-analyzed): New global variable. + (sim-init!): Reset it. + (sim-analyze-insns!): Renamed from sim-analyze!. Keep track if we've + already done the analysis. + + * sim-model.scm (-gen-mach-defns): Add mach attribute number to + MACH struct. + + * arm.cpu: Only include arm7.cpu,thumb.cpu if necessary. + (arm arch): Update isa spec. + (arm,thumb isas): Define. + (arm7 cpu): default-insn-bitsize,base-insn-bitsize moved to isas. + (arm7tdmi mach): Add isa spec. + * arm7.cpu (*): Replace subreg: with subword:. Remove unnecessary + `const' on word number. + * fr30.cpu (fr30 arch): Update isa spec. + (fr30 isa): Define. + (fr30bf cpu): default-insn-bitsize,base-insn-bitsize,decode-assist, + moved to isa spec. + * i960.cpu (i960 arch): Update isa spec. + (i960 isa): Define. + (i960base cpu): default-insn-bitsize,base-insn-bitsize,decode-assist, + liw-insns,parallel-insns moved to isas spec. + * m32r.cpu (m32r arch): Update isas spec. + (m32r isa): Define. + (m32rbf cpu): default-insn-bitsize,base-insn-bitsize,decode-assist, + liw-insns,parallel-insns moved to isa spec. + * sparc.cpu (sparc arch): Update isas spec. + (sparc isa): Define. + * sparc32.cpu (sparc32 cpu): default-insn-bitsize,base-insn-bitsize, + decode-assist moved to isa spec. + * sparc64.cpu (sparc64 cpu): Ditto. + * sparccom.cpu (trap insns): Correct mode of result of c-call:. + * desc-cpu.scm (-gen-isa-table-defns): New proc. + (-gen-mach-table-defns): Output mach table. + (-gen-hash-defines): Delete insn size macros, except for + CGEN_MAX_INSN_SIZE. + (-cgen-cpu-open): Rewrite cpu_open handling. Take stdarg list of args. + (cgen-desc.h): Define MAX_ISAS. + (cgen-desc.c): Include stdarg.h. Call -gen-isa-table-defns. + * mach.scm (): Rename arch-data to data. New member isa-list. + (arch-* accessors): Renamed from arch:*. All callers updated. + (current-arch-isa-name-list): New proc. + (-arch-parse-isas): Renamed from -arch-parse-isa. + (def-isa-attr!): Rewrite. + (