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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [opc-opinst.scm] - Rev 6

Compare with Previous | Blame | View Log

; Operand instance support.
; Copyright (C) 2000, 2009 Red Hat, Inc.
; This file is part of CGEN.
; Return C code to define one instance of operand object OP.
; TYPE is one of "INPUT" or "OUTPUT".
"  { "", ""\"""\", "", "; FIXME: Revisit CGEN_ prefix, use MODE (FOO) instead.
"CGEN_"", "; FIXME: We don't handle memory properly yet.  Later.
"0, 0""0, 0""0, 0""OP_ENT (""), 0""0, ""0, 0"", ""COND_REF""0"" },\n"; Return C code to define arrays of operand instances read from and written
; to by <sformat> SFMT.
; This is based on the semantics of the instruction.
; ??? All runtime chosen values (e.g. a particular register in a register bank)
; is assumed to be selected statically by the instruction.  When some cpu
; violates this assumption (say because a previous instruction determines
; which register(s) the next instruction operates on), this will need
; additional support.
; This used to exclude outputing anything if there were no ins or outs.
; sanitize based on the example insn
"static const CGEN_OPINST ""_ops[] ATTRIBUTE_UNUSED = {\n""INPUT""OUTPUT""  { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }\n};\n\n""\
/* Operand references.  */
 
""OP_ENT(op) @ARCH@_OPERAND_""op""\
#define INPUT CGEN_OPINST_INPUT
#define OUTPUT CGEN_OPINST_OUTPUT
#define END CGEN_OPINST_END
#define COND_REF CGEN_OPINST_COND_REF
 
""\
#undef OP_ENT
#undef INPUT
#undef OUTPUT
#undef END
#undef COND_REF
 
"; Return C code for INSN's operand instance table.
"0""& ""_ops[0]"; Return C code to define a table to lookup an insn's operand instance table.
"/* Operand instance lookup table.  */\n\n""static const CGEN_OPINST *@arch@_cgen_opinst_table[MAX_INSNS] = {\n""  0,\n"; null first entry
"  & ""_ops[0],\n""};\n\n""\
/* Function to call before using the operand instance table.  */
 
void
@arch@_cgen_init_opinst_table (cd)
     CGEN_CPU_DESC cd;
{
  int i;
  const CGEN_OPINST **oi = & @arch@_cgen_opinst_table[0];
  CGEN_INSN *insns = (CGEN_INSN *) cd->insn_table.init_entries;
  for (i = 0; i < MAX_INSNS; ++i)
    insns[i].opinst = oi[i];
}
"; Return the maximum number of operand instances used by any insn.
; If not generating the operand instance table, use a heuristic.
; FIXME: for now
; Generate $arch-opinst.c.
"Generating ""-opinst.c ...\n"; If instruction semantics haven't been analyzed, do that now.
"Instruction semantics weren't analyzed when .cpu file was loaded.\n""Doing so now ...\n"; include aliases
; -opcodes-build-operand-instance-table?
"Semantic operand instances for @arch@.""\
#include \"sysdep.h\"
#include \"ansidecl.h\"
#include \"bfd.h\"
#include \"symcat.h\"
#include \"@prefix@-desc.h\"
#include \"@prefix@-opc.h\"
\n"

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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