OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [desc.scm] - Rev 26

Go to most recent revision | Compare with Previous | Blame | View Log

; General cpu info generator support.
; Copyright (C) 2000, 2003, 2009 Red Hat, Inc.
; This file is part of CGEN.
;
; This file generates C versions of the more salient parts of the description
; file.  It's currently part of opcodes or simulator support,
; and doesn't exist as its own "application" (i.e. user of cgen),
; though that's not precluded.
; strip-mnemonic?: If each mnemonic is constant, the insn table doesn't need
; to record them in the syntax field as the mnemonic field also contains it.
; Furthermore, the insn table can be hashed on complete mnemonic.
; ??? Should live in <derived-arch-data> or some such.
; Attribute support code.
"const CGEN_ATTR_TABLE ""@arch@_cgen_""_attr_table[] =\n{\n""  { ""\"""\", ""&bool_attr[0], &bool_attr[0]""& ""_attr[0], & ""_attr[0]"" },\n""  { 0, 0, 0 }\n""};\n\n""Generating attribute table defns ...\n""\
/* Attributes.  */
 
static const CGEN_ATTR_ENTRY bool_attr[] =
{
  { \"#f\", 0 },
  { \"#t\", 1 },
  { 0, 0 }
};
 
"; Generate tables mapping names to values for all the non-boolean attrs.
; Generate tables for each domain (ifld, insn, etc.) mapping attribute type
; to index.
"ifield""hardware""operand""insn"; HW-ASM is the base class for supporting hardware elements in the opcode table
; (aka assembler/disassembler).
; Return the C declaration.
; It is up to a derived class to redefine this as necessary.
""; Return the C definition.
; It is up to a derived class to redefine this as necessary.
"""0""""CGEN_ASM_NONE, 0, "; Prefix of global variables describing operand values.
"@arch@_cgen_opval_"; Emit a C reference to a value operand.
; Usually the operand's details are stored in a struct so in the default
; case return that struct (?correct?).  The caller must add the "&" if desired.
; Keyword support.
; Keyword operands.
; Return the C declaration of a keyword list.
"extern CGEN_KEYWORD "";\n"; Return the C definition of a keyword list.
"static CGEN_KEYWORD_ENTRY ""_entries""[] =\n{\n"; Delete trailing ",\n" [don't want the ,]
"  { \""; operand name
"\", "; value
", {0, {{{0, 0}}}}, 0, 0"" },\n""\n};\n\n""CGEN_KEYWORD "" =\n{\n""  & ""_entries[0],\n""  "",\n""  0, 0, 0, 0, \"\"\n""};\n\n"; Return a reference to a keyword table.
"& ""CGEN_ASM_KEYWORD, (PTR) "", "; Return the C code to initialize a keyword.
; If the `hash' attr is present, the values are hashed.  Currently this is
; done by calling back to GAS to have it add the registers to its symbol table.
; FIXME: Currently unused.  Should be done either in the open routine or
; lazily upon lookup.
"  @arch@_cgen_asm_hash_keywords ("");\n"""; Operand support.
; Return a reference to the operand's attributes.
"& CGEN_OPERAND_ATTRS (CGEN_SYM (operand_table)) ""[""]"; Name of C variable that is a pointer to the fields struct.
"fields"; Given FIELD, an `ifield' object, return an lvalue for the operand in
; IFIELDS-VAR.
"->"; Basic description init,finish,analyzer support.
; Return a boolean indicating if all insns have a constant mnemonic
; (ie: no $'s in insn's name in `syntax' field).
; If constant, one can build the assembler hash table using the entire
; mnemonic.
; FIXME
; Initialize any "desc" specific things before loading the .cpu file.
; N.B. Since "desc" is always a part of another application, that
; application's init! routine must call this one.
; Finish any "desc" specific things after loading the .cpu file.
; This is separate from analyze-data! as cpu-load performs some
; consistency checks in between.
; N.B. Since "desc" is always a part of another application, that
; application's finish! routine must call this one.
; Compute various needed globals and assign any computed fields of
; the various objects.  This is the standard routine that is called after
; a .cpu file is loaded.
; N.B. Since "desc" is always a part of another application, that
; application's analyze! routine must call this one.
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.