* utils-cgen.scm (gen-define-with-symcat): Remove K&R support.
* utils-sim.scm (compute-sformat-argbufs!): Use more consistent name
for name of empty sbuf.
* iformat.scm (/sfmt-search-key, /ifmt-lookup-sfmt!): Add assert.
* insn.scm (<insn>): Add initial value for members fmt-desc, ifmt,
sfmt, tmp.
(/sub-insn-ifields): Delete old commented out code.
(/sub-insn-make!, /parse-insn-format-symbol): Ditto.
* operand.scm (/anyof-merge-setter, anyof-merge-semantics): Ditto.
* sim-decode.scm (/gen-decode-insn-globals): Tweak formatting of
generated code.
+2010-02-11 Doug Evans <dje@sebabeach.org>
+
+ * desc-cpu.scm (/gen-cpu-open): Remove comment on K&R support.
+ * utils-cgen.scm (gen-define-with-symcat): Remove K&R support.
+
+ * utils-sim.scm (compute-sformat-argbufs!): Use more consistent name
+ for name of empty sbuf.
+
+ * iformat.scm (/sfmt-search-key, /ifmt-lookup-sfmt!): Add assert.
+
+ * insn.scm (<insn>): Add initial value for members fmt-desc, ifmt,
+ sfmt, tmp.
+ (/sub-insn-ifields): Delete old commented out code.
+ (/sub-insn-make!, /parse-insn-format-symbol): Ditto.
+ * operand.scm (/anyof-merge-setter, anyof-merge-semantics): Ditto.
+
+ * sim-decode.scm (/gen-decode-insn-globals): Tweak formatting of
+ generated code.
+
2010-02-10 Doug Evans <dje@sebabeach.org>
* gen-all: Print options.
CGEN_CPU_OPEN_END: terminates arguments
??? Simultaneous multiple isas might not make sense, but it's not (yet)
- precluded.
-
- ??? We only support ISO C stdargs here, not K&R.
- Laziness, plus experiment to see if anything requires K&R - eventually
- K&R will no longer be supported - e.g. GDB is currently trying this. */
+ precluded. */
CGEN_CPU_DESC
@arch@_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...)
; fragments in pbb simulators). Don't cause spurious differences.
(define (/sfmt-search-key insn cti? sorted-used-iflds sem-in-ops sem-out-ops)
+ (assert (insn-ifmt insn))
+
(let ((op-key (lambda (op)
(string-append " ("
(or (->string (obj-attr-value insn 'sanitize))
; We assume INSN's <iformat> has already been recorded.
(define (/ifmt-lookup-sfmt! insn fmt-desc sfmt-list)
+ (assert (insn-ifmt insn))
+
(let* ((search-key (/sfmt-search-key insn (-fmt-desc-cti? fmt-desc)
(-fmt-desc-used-iflds fmt-desc)
(-fmt-desc-in-ops fmt-desc)
; The <fmt-desc> of the insn.
; This is used to help calculate the ifmt,sfmt members.
- fmt-desc
+ (fmt-desc . #f)
; The <iformat> of the insn.
- ifmt
+ (ifmt . #f)
; The <sformat> of the insn.
- sfmt
+ (sfmt . #f)
; Temp slot for use by applications.
- tmp
+ (tmp . #f)
; Instruction semantics.
; This is the rtl in source form, as provided in the
; {value-names} is a list of names of {anyof-operands}.
(define (/sub-insn-ifields insn anyof-operands value-names new-values)
- ; (debug-repl-env insn anyof-operands value-names new-values)
-
; Delete ifields of {anyof-operands} and add those for {new-values}.
(let ((iflds
(append!
; IFLD-LIST is an unsorted list of <ifield> elements.
(find-preceder
(lambda (ifld-list owner)
- ;(debug-repl-env ifld-list owner)
(cond ((ifield? owner)
owner)
((anyof-operand? owner)
(anyof-instance? (derived-ifield-owner f))
(eq? name (obj:name (anyof-instance-parent (derived-ifield-owner f))))))
ifld-list)))
- ;(debug-repl-env ifld-list owner)
(assert result)
result))
((operand? owner) ; derived operands are handled here too
; ANYOF-OPERANDS. Each element is a <derived-operand>.
(define (/sub-insn-make! insn anyof-operands new-values)
- ;(debug-repl-env insn anyof-operands new-values)
(assert (= (length anyof-operands) (length new-values)))
(assert (all-true? (map anyof-operand? anyof-operands)))
(assert (all-true? (map derived-operand? new-values)))
anyof-operands new-values)
" ...\n")
-; (if (eq? '@sib+disp8-QI-disp32-8
-; (obj:name (car new-values)))
-; (debug-repl-env insn anyof-operands new-values))
-
(let* ((value-names (map obj:name anyof-operands))
(ifields (/sub-insn-ifields insn anyof-operands value-names new-values))
(known-values (ifld-known-values ifields)))
; Subroutine of /parse-insn-format to parse a symbol ifield spec.
(define (/parse-insn-format-symbol context isa-name-list sym)
- ;(debug-repl-env sym)
(let ((op (current-op-lookup sym isa-name-list)))
(if op
(cond ((derived-operand? op)
; ((add a b)-object), then return (mem QI (add a b)).
(define (/anyof-merge-getter getter value-names values)
- ;(debug-repl-env getter value-names values)
; ??? This implementation is a quick hack, intended to evolve or be replaced.
(cond ((not getter)
#f)
; ??? `newval' in this context is a reserved word.
(define (/anyof-merge-setter setter value-names values)
- ;(debug-repl-env setter value-names values)
; ??? This implementation is a quick hack, intended to evolve or be replaced.
(cond ((not setter)
#f)
; ((add a b)-object), then return (mem QI (add a b)).
(define (anyof-merge-semantics semantics value-names values)
- ;(debug-repl-env semantics value-names values)
; ??? This implementation is a quick hack, intended to evolve or be replaced.
(let ((result
(cond ((not semantics)
"\
};
-static const struct insn_sem @prefix@_insn_sem_invalid = {
+static const struct insn_sem @prefix@_insn_sem_invalid =
+{
VIRTUAL_INSN_X_INVALID, @PREFIX@_INSN_X_INVALID, @PREFIX@_SFMT_EMPTY"
(if (and (with-parallel?) (not (with-parallel-only?)))
", NOPAR, NOPAR"
*UNSPECIFIED*
)
-;; Return a pair of definitions for a C macro that concatenates its
-;; argument symbols. The definitions are conditional on ANSI C
-;; semantics: one contains ANSI concat operators (##), and the other
-;; uses the empty-comment trick (/**/). We must do this, rather than
-;; use CONCATn(...) as defined in include/symcat.h, in order to avoid
-;; spuriously expanding our macro's args.
+;; Return the definition of a C macro that concatenates its argument symbols.
(define (gen-define-with-symcat head . args)
(string-append
- "\
-#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
-#define "
- head (string-map (lambda (elm) (string-append "##" elm)) args)
- "
-#else
-#define "
- head (string-map (lambda (elm) (string-append "/**/" elm)) args)
- "
-#endif
-"
- )
+ "#define "
+ head
+ (string-map (lambda (elm) (string-append "##" elm)) args)
+ "\n")
)
; itself.
(let ((nub-sbufs (list (build-sbuf (car sfmt-contents))))
(empty-sbuf (make <sformat-argbuf>
- 'fmt-empty "no operands" atlist-empty
+ 'sfmt-empty "no operands" atlist-empty
nil))
)
(sfmt-set-sbuf! (caar sfmt-contents) (car nub-sbufs))