URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Subversion Repositories scarts
[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [minsn.scm] - Rev 6
Compare with Previous | Blame | View Log
; Macro instruction definitions. ; Copyright (C) 2000, 2009 Red Hat, Inc. ; This file is part of CGEN. ; See file COPYING.CGEN for details. ; Expansion: ; If the macro expands to a string, arguments in the input string ; are refered to with %N. Multiple insns are separated with '\n'. ; String expansion is a special case of the normal form which is a Scheme ; expression that controls the expansion. The Scheme expression will be able ; to refer to the current assembly state to decide how to perform the ; expansion. Special expression `emit' is used to call the assembler emitter ; for a particular insn. Special expression `expand' is used to return a ; string to be reparsed (which is special cased). ; Parse a list of macro-instruction expansion descriptions. ; This is the main routine for building an minsn-expansion object from a ; description in the .cpu file. ; All arguments are in raw (non-evaluated) form. ; ??? At present we only support macros that are aliases of one real insn. ; Object to describe a macro-insn. ; syntax of the macro ; list of expansion expressions ; Accessor fns ; Return a list of the machs that support MINSN. ; Return macro-instruction mnemonic. ; This is computed from the syntax string. ; Return enum cgen_minsn_types value for MINSN. "@ARCH@_MINSN_"; Parse a macro-insn expansion description. ; ??? At present we only support unconditional simple expansion. "invalid macro expansion""invalid macro expansion, must be `(emit ...)'"; Parse a macro-instruction description. ; This is the main routine for building a macro-insn object from a ; description in the .cpu file. ; All arguments are in raw (non-evaluated) form. ; The result is the parsed object or #f if object isn't for selected mach(s). "Processing macro-insn "" ...\n""invalid macro expansion list";; Pick out name first to augment the error context. "cgen_minsn""Ignoring "".\n"; Read a macro-insn description ; This is the main routine for analyzing macro-insns in the .cpu file. ; CONTEXT is a <context> object for error messages. ; ARG-LIST is an associative list of field name and field value. ; -minsn-parse is invoked to create the `macro-insn' object. """"; Loop over each element in ARG-LIST, recording what's found. "invalid macro-insn arg"; Now that we've identified the elements, build the object. ; Define a macro-insn object, name/value pair list version. ; don't waste time if simulator "define-minsn"; Define a macro-insn object, all arguments specified. ; This only supports one expansion. ; Use define-minsn for the general case (??? which is of course not implemented ; yet :-). ; don't waste time if simulator "define-full-minsn"; Compute the ifield list for an alias macro-insn. ; This involves making a copy of REAL-INSN's ifield list and assigning ; known quantities to operands that have fixed values in the macro-insn. ; List of "free variables", i.e. operands. ; Names of fields in `ifld-ops'. As elements of minsn-iflds are ; parsed the associated element in ifld-names is deleted. At the ; end ifld-names must be empty. delq! can't delete the first ; element in a list, so we insert a fencepost. ;(logit 3 "Computing ifld list, operand field names: " ifld-names "\n") ; For each macro-insn ifield expression, look it up in the real insn's ; ifield list. If an operand without a prespecified value, leave ; unchanged. If an operand or ifield with a value, assign the value to ; the ifield entry. ; If `op-name' is an operand, use its ifield. ; Otherwise `op-name' must be an ifield name. ;(logit 3 "Processing ifield " f-name " ...\n") "unknown operand"; Ensure `f' is an operand. "not an operand""incomplete operand list, missing: "; Create an aliased real insn from an alias macro-insn. ; Must emit exactly one real insn. "not an alias macro-insn""unknown real insn in expansion"": "; ifield-assertion ; semantics ; timing ; FIXME: use same format entry as real insn, ; build mask and test value at run time. ; (car (ifmt-analyze i #f)))) ;(insn-set-ifmt! i (insn-ifmt alias-of)) ; Called before a .cpu file is read in. "\ Define a macro instruction, name/value pair list version. ""\ Define a macro instruction, all arguments specified. "; Called after the .cpu file has been read in.