Joern Rennecke [Wed, 21 May 2003 14:10:46 +0000 (14:10 +0000)]
* cpu/sh.cpu: Amend comments to refer to SuperH.
* cpu/sh64-compact.cpu: Change comment to refer to SuperH.
* cpu/sh64-media.cpu: Likewise.
(Saturation): Update manual reference.
Doug Evans [Thu, 15 May 2003 07:25:03 +0000 (07:25 +0000)]
* Makefile.am (srcroot): New var.
(html): New rule.
* Makefile.in: Regenerate.
* cgen-doc.scm: New file.
* html.scm: New file.
* gen-all-doc: New file.
* dev.scm (cload): Handle DOC application.
(load-doc): New fn.
* machs.scm (machs-for-cpu): New fn.
* model.scm (models-for-cpu): New fn.
* utils.scm (gen-c-copyright): Renamed from gen-copyright.
All uses updated.
(iota): Rewrite to be identical to pmacro version. All uses updated.
* utils-cgen.scm (alpha-sort-obj-list): New fn.
Dave Brolley [Wed, 16 Apr 2003 18:17:43 +0000 (18:17 +0000)]
2003-04-16 Dave Brolley <brolley@redhat.com>
* doc/rtl.texi (Iiming): Correct example to use 'model-name'.
* utils.scm (copyright-fsf): Update generate copyright years.
(copyright-cygnus): Ditto.
* sid.scm (-op-gen-set-trace): Generate code to fill in bitmask of modified
operands.
(-gen-arch-model-decls): Don't generate unit enum declaration or MAX_UNITS
here.
(<operand>'gen-profile-code): New parameter 'when'.
(<iunit>'gen-profile-code): Ditto.
(<insn>'gen-profile-code): Ditto.
(<unit>'gen-profile-code): Ditto. Only generate 'referenced' and
'insn_reference' for the 'after' function.
* model.scm (unit:enum): Moved to sim-model.scm.
* sim-model.scm (unit:enum): Moved from model.scm.
* sid-decode.scm (-gen-scache-decls): Generate the 'written' field.
* cgen-sid.scm (sim-arguments): Document the generation of model.h.
* sid-model.scm (unit:enum): New version for sid.
(gen-model-class-name): New function.
(gen-model-unit-fn-decl): New function.
(gen-model-fn-decls): Call gen-model-unit-fn-decl.
(gen-model-unit-fn-name): New parameter 'when'.
(-gen-model-insn-fn-name): Ditto.
(-gen-model-insn-qualified-fn-name): New function.
(-gen-model-insn-fn-decl): New function.
(-gen-model-insn-fn-decls): New function.
(-gen-model-insn-fn): New parameter 'when'. Call
-gen-model-insn-qualified-fn-name.
(-gen-model-insn-fns): Generate the constructor for the model. Generate
functions for modelling insn before and after execution.
(-gen-model-class-decls): New function.
(" (gen-model-class-name model) "): New function.
(gen-model-classes): New function.
(-gen-insn-timing): Generate functions for modelling insn before and after
execution.
(-gen-insn-unit-timing): Generate class-qualified names.
(-gen-model-timing-table): Ditto.
(cgen-model.cxx): Generate #include for @cpu@.h. Omit generation of code
not needed (yet) by sid.
(cgen-model.h): New function.
Dave Brolley [Wed, 16 Apr 2003 18:09:06 +0000 (18:09 +0000)]
2003-04-16 Dave Brolley <brolley@redhat.com>
* doc/rtl.texi (Iiming): Correct example to use 'model-name'.
* utils.scm (copyright-fsf): Update generate copyright years.
(copyright-cygnus): Ditto.
* sid.scm (-op-gen-set-trace): Generate code to fill in bitmask of modified
operands.
(-gen-arch-model-decls): Don't generate unit enum declaration or MAX_UNITS
here.
(<operand>'gen-profile-code): New parameter 'when'.
(<iunit>'gen-profile-code): Ditto.
(<insn>'gen-profile-code): Ditto.
(<unit>'gen-profile-code): Ditto. Only generate 'referenced' and
'insn_reference' for the 'after' function.
* model.scm (unit:enum): Moved to sim-model.scm.
* sim-model.scm (unit:enum): Moved from model.scm.
* sid-decode.scm (-gen-scache-decls): Generate the 'written' field.
* cgen-sid.scm (sim-arguments): Document the generation of model.h.
* sid-model.scm (unit:enum): New version for sid.
(gen-model-class-name): New function.
(gen-model-unit-fn-decl): New function.
(gen-model-fn-decls): Call gen-model-unit-fn-decl.
(gen-model-unit-fn-name): New parameter 'when'.
(-gen-model-insn-fn-name): Ditto.
(-gen-model-insn-qualified-fn-name): New function.
(-gen-model-insn-fn-decl): New function.
(-gen-model-insn-fn-decls): New function.
(-gen-model-insn-fn): New parameter 'when'. Call
-gen-model-insn-qualified-fn-name.
(-gen-model-insn-fns): Generate the constructor for the model. Generate
functions for modelling insn before and after execution.
(-gen-model-class-decls): New function.
(" (gen-model-class-name model) "): New function.
(gen-model-classes): New function.
(-gen-insn-timing): Generate functions for modelling insn before and after
execution.
(-gen-insn-unit-timing): Generate class-qualified names.
(-gen-model-timing-table): Ditto.
(cgen-model.cxx): Generate #include for @cpu@.h. Omit generation of code
not needed (yet) by sid.
(cgen-model.h): New function.
DJ Delorie [Fri, 21 Mar 2003 06:15:55 +0000 (06:15 +0000)]
* cpu/xstormy16.cpu (basic-psw): New argument ws (wordsize),
which indicates if the sign flag is set from bit 15 or 7.
Adjust all callers.
(set-psw): New argument ws, propogate it.
(set-psw-nowrite): Likewise.
(set-mem-psw): Likewise.
(set-psw-carry): Likewise. Use temporaries to prevent
prematurely overwriting needed inputs.
(set-psw-rrotate17): Fix logic.
(shrgrgr): Preserve carry for zero-bit shifts.
(shrgrimm): Likewise.
(shlgrgr): Likewise.
(shlgrimm): Likewise.
(asrgrgr): Likewise.
(asrgrimm): Likewise.
(reset): New.
DJ Delorie [Tue, 18 Feb 2003 22:57:08 +0000 (22:57 +0000)]
* xstormy16.cpu (set-mem-alignfix-psw): Remove.
(movlmemimm): Just mask the address.
(movhmemimm): Likewise.
(movlmemgr): Likewise.
(movhmemgr): Likewise.
(set-psw): Always set the psw last.
(set-psw-carry): Likewise.
(set-psw-add): Likewise.
(set-psw-sub): Likewise.
* xstormy16.cpu (set-psw-rrotate17): New. Choose the correct set
of 16 patterns from the set-psw-rotate17 function.
(movgrigr, movgripostincgr, movgripredecgr, movgriigr,
movgriipostincgr, movgriipredecgr): Set psw correctly.
(movfgrigr, movfgripostincgr, movfgripredecgr, movfgriigr,
movfgriipostincgr, movfgriipredecgr): Fix semantics.
(rrcgrgr, rrcgrimm4): Use new set-psw-rrotate17 function.
Dave Brolley [Wed, 12 Feb 2003 22:31:31 +0000 (22:31 +0000)]
2003-02-11 Dave Brolley <brolley@redhat.com>
* desc-cpu.scm (gen-ifld-defns): Add all ifields to the
@arch@_cgen-ifld_table.
(gen-maybe-multi-ifld): Use the ifield enumerators to index the
@arch@_cgen-ifld_table.
Doug Evans [Fri, 20 Dec 2002 07:58:32 +0000 (07:58 +0000)]
* utils-sim.scm (gen-profile-sym): New fn.
(<operand>,sbuf-profile-sym): New method.
(<operand>,sbuf-profile-elm): Use it.
* sim.scm (<operand>,gen-record-profile): Use sbuf-profile-sym instead
of hardcoding symbol name.
(<operand>,gen-profile-code): Ditto.
(<unit>,gen-profile-code): Use gen-profile-sym instead of hardcoding
symbol name.
Doug Evans [Fri, 20 Dec 2002 06:39:04 +0000 (06:39 +0000)]
* mode.scm (mode-sem-mode): New fn.
* operand.scm (op:new-mode): Update. mode-name.
(op-natural-mode?) New fn.
* rtl.scm (hw): Set hw-name,mode-name.
plus some comment tweaks
Doug Evans [Fri, 20 Dec 2002 02:22:22 +0000 (02:22 +0000)]
Back out sim*.scm changes of 2001-04-02 Ben Elliston <bje@redhat.com>
Instead do:
* sim-decode.scm (-gen-decode-insn-globals): Use @PREFIX@_INSN__MAX
as size of IDESC-TABLE-VAR.
(@prefix@_init_idesc_table): Ditto.
* sim-model.scm (-gen-mach-defns): Ditto.
* sim.scm (gen-cpu-insn-enum-decl): Rename last elm from max to -max.
* utils-scm.scm (-gen-decode-insn-entry): Fix some spacing in output.
DJ Delorie [Tue, 17 Dec 2002 03:54:41 +0000 (03:54 +0000)]
* cpu/xstormy16.cpu (imm16): Call handler immediate16.
* cpu/xstormy16.opc (parse_small_immediate): Return on '@'.
(parse_immediate16): Handle immediate16 values, which now include
@hi(label) and @lo(label)
Alan Modra [Mon, 2 Dec 2002 21:53:53 +0000 (21:53 +0000)]
* desc-cpu.scm (gen-maybe-multi-ifld): Remove superfluous parens.
Add braces and cast for union field.
(gen-multi-ifield-nodes): Add braces and cast for union field.
(cgen_operand_table): Similarly fix sentinel.
(cgen_cpu_close): Constify "insns". Formatting.
(cgen-desc.c): Include xregex.h.
* cpu/ip2k.opc (ip2k_cgen_insn_supported): Move to opc.c section.
Prototype.
<opc.c>: Include safe-ctype.h.
(ip2k_asm_hash): Use ISSPACE and TOLOWER.
(PARSE_FUNC_DECL): Declare. Use to prototype parse_fr, parse_addr16,
parse_addr16_p, parse_addr16_cjp, parse_lit8 and parse_bit3.
(parse_fr): Constify "old_strp". Correct type of "tempvalue".
Don't test it for >= 0. Use ISSPACE rather than isspace. Formatting.
(parse_addr16): Correct type of "value". Formatting.
(parse_addr16_p): Likewise.
(parse_addr16_cjp): Likewise.
(parse_lit8): Likewise.
(parse_bit3): Formatting.
(PRINT_FUNC_DECL): Define. Use to prototype print_fr, print_dollarhex,
print_dollarhex8, print_dollarhex16, print_dollarhex_addr16h,
print_dollarhex_addr16l, print_dollarhex_p, print_dollarhex_cj and
print_decimal.
(print_fr): Add ATTRIBUTE_UNUSED on unused args. Formatting.
(print_dollarhex): Add ATTRIBUTE_UNUSED on unused args.
(print_dollarhex8): Likewise.
(print_dollarhex16): Likewise.
(print_dollarhex_addr16h): Likewise.
(print_dollarhex_addr16l): Likewise.
(print_dollarhex_p): Likewise.
(print_dollarhex_cj): Likewise.
(print_decimal): Likewise.
* cpu/xstormy16.opc (parse_mem8): Use ISALNUM rather than isalnum.
* doc/rtl.texi (Model variants): Mention current limitations for
unit inputs and outputs.
(Hardware elements) <attribute PROFILE>: Be slightly more
verbose.
(Instructions) <timing>: input/output overrides have a direction
operand.
* cpu/sh64-compact.cpu (movw5): Use Correct operand field for reg.
* cpu/sh64-media.cpu (-ldhi-byte, -ldhi-word, -ldhi-long): New macros.
(-ldlo-byte, -ldlo-word, -ldlo-long): Likewise.
(-sthi-word, -sthi-long -stlo-byte, -stlo-word, -stlo-long): Likewise.
(ldhil, ldhiq, ldlol, ldloq, stlol, stloq): Implement.
(mshfhib, mshfhil, mshfhiw, mshflob, mshflol, mshflow): Fix indices.
(-sthi-byte): If there is a single byte to store, store it at
proper address.
(sthil, sthiq): Fix big-endian behaviour.
(mcnvslw, mcnvswb, mcnvswub, mmacfxwl, mmacnfx.wl): Fix indices.
(mmulfxl, mmulfxw, mmulfxrpw, mmulhiwl, mmullowl): Likewise.
(saturate): Use Dimode to check if saturation operation is required.
(usaturate): Likewise.
(mpermw): Fix mask.
(-maddsl, -maddsub): Compute to-be-saturated value in wider mode.
(-maddsw, mmacfxwl, mmacnfx.wl, -mshaldsl, -mshaldsw): Likewise.
(-mshardl, -mshardw, -msubsl, -msubsub, -msubsw): Likewise.
(msadubq): Fix subword index in second operand of first subtraction.
* doc/rtl.texi: Fix typo: define-attr, not define-attribute.
(Enumerated constants): Mention that an ifield must not specify a
multi-ifield.
(Instruction operands): Ditto for index.
(Expressions) <parallel>: Remove misplaced mention of local
variables.
<if>: Mention that mode must be specified and non-VOID when the
result is used.
* doc/porting.texi: When referring to *.opc, mention they are in
the cpu subdir. Call top-level directory toplevel, not devo.
Close string in define-normal-insn example.
Matthew Green [Fri, 11 Jan 2002 07:24:49 +0000 (07:24 +0000)]
[cgen/ChangeLog]
* cpu/xstormy16.cpu (gr-Rbj-names): Rename this ...
(gr-Rb-names): ... to this.
(h-Rb): New hardware peice.
(h-Rbj): Use gr-Rb-names.
(Rb): Use h-Rb.
Dave Brolley [Thu, 3 Jan 2002 18:30:26 +0000 (18:30 +0000)]
2002-01-03 Dave Brolley <brolley@redhat.com>
* decode.scm (-distinguishing-bit-population): Compute num-insns, the
number of insns in the list. Update the population count function to
identify and prioritize 3 catgories of useful bits.
(-population-top-few): Don't consider bits with a population count of
zero.
(-build-decode-table-entry): Don't call
filter-harmlessly-ambiguous-insns. Filter out non-specialized and
identical insns at the next tree level.
* insn.scm (filter-harmlessly-ambiguous-insns): Note in a comment that
this function is no longer used.
(filter-non-specialized-ambiguous-insns): New function.
(filter-identical-ambiguous-insns): New function.
(find-identical-insn): New function.
(filter-harmlessly-ambiguous-insns): Removed.
* insn.scm (syntax-break-out): Change $ escape specifier
from \$ to $$, to reduce interactions with scheme and C escaping
conventions.
* doc/rtl.texi (Instructions): Document change.
* more 16/32-bit insn set support; simulator (sid)
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
* sid-cpu.scm (-gen-mach-params): New proc to emit ...CHUNK_BITSIZE...
(cgen-desc.h): Call it.
* sid-decode.scm (-gen-decode-fn): Use base-insn-bitsize as
decode-size.
* utils-sim.scm (-gen-decode-insn-entry): For SID only, prepare
entire_insn for extraction, if it's shorter than base-insn-bitsize.
* some support for funny-endian 16/32-bit insn sets
[cgen/ChangeLog]
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
* desc-cpu.scm (-gen-mach-table-defns): Emit fourth field: the
mach->cpu insn-chunk-bitsize.
(-gen-cpu-open): In @arch@_cgen_rebuild_tables, process above new
field toward CGEN_CPU_TABLE->insn_chunk_bitsize.
* mach.scm (<cpu>): New field insn-chunk-bitsize.
(-cpu-parse, -cpu-read): Parse/initialize it.
* doc/rtl.texi (define-cpu): Document it.
[opcodes/ChangeLog]
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
* cgen-dis.in (print_insn): Use cgen_get_insn_value instead of
bfd_get_bits.
* cgen-opc.c (cgen_get_insn_value, cgen_put_insn_value): Respect
non-zero CGEN_CPU_DESC->insn_chunk_bitsize.
[include/opcode/ChangeLog]
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
Ben Elliston [Thu, 5 Jul 2001 12:45:47 +0000 (12:45 +0000)]
2001-07-05 Ben Elliston <bje@redhat.com>
* README: Update.
* read.scm (include): Include files from srcdir/cpu.
(-cgen): Likewise for loading .cpu files.
* *.cpu: Move all cpu descriptions into cpu subdirectory.
* *.opc: Likewise.
* simplify.inc: Likewise.
Ben Elliston [Wed, 4 Jul 2001 06:49:02 +0000 (06:49 +0000)]
2001-07-04 Ben Elliston <bje@redhat.com>
* read.scm (include): Log "Including file" message at level 1,
rather than outputting it with (display).
(cpu-load): Log "Loading cpu description" and "Processing cpu
description" messages at levels 1 and 2, respectively, rather than
using (display).
* cgen-asm.c (cgen_parse_keyword): When looking for the
boundaries of a keyword, allow any special characters
that are actually in one of the allowed keyword.
* cgen-opc.c (cgen_keyword_add): Add any special characters
to the nonalpha_chars field.
Geoff Keating [Thu, 14 Jun 2001 19:52:57 +0000 (19:52 +0000)]
* gas-test.scm (gen-gas-test): Create 8 testcases, not just 5.
(<operand> 'test-data): Involve both the index and the hardware
in testcase generation.
(<hw-indx> 'test-data): Generate test data from the underlying
object.
(<ifield> 'test-data): Generate test data by computing bit
patterns for the field, then decoding them.
(<hw-address> 'test-data): Allow for new calling convention.
(<hw-iaddress> 'test-data): Likewise.
(<keyword> 'test-data): Convert index values into keywords.
(<hw-asm> 'test-data): Convert index values into integer strings.