* cgen/opcodes fix
[deliverable/binutils-gdb.git] / include / opcode / cgen.h
index 84542a37ce1dda679933d498a9a9e6de5a6cabf7..1db272bbb11fa98b6dd9e557b19a96fac86b2c6d 100644 (file)
@@ -1,6 +1,6 @@
 /* Header file for targets using CGEN: Cpu tools GENerator.
 
-Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GDB, the GNU debugger, and the GNU Binutils.
 
@@ -735,10 +735,18 @@ typedef struct
    into the operand table.  The operand table doesn't exist in C, per se, as
    the data is recorded in the parse/insert/extract/print switch statements. */
 
-#ifndef CGEN_MAX_SYNTAX_BYTES
-#define CGEN_MAX_SYNTAX_BYTES 16
+/* This should be at least as large as necessary for any target. */
+#define CGEN_MAX_SYNTAX_BYTES 32
+
+/* A target may know its own precise maximum.  Assert that it falls below
+   the above limit. */
+#ifdef CGEN_ACTUAL_MAX_SYNTAX_BYTES
+#if CGEN_ACTUAL_MAX_SYNTAX_BYTES > CGEN_MAX_SYNTAX_BYTES
+#error "CGEN_ACTUAL_MAX_SYNTAX_BYTES too high - enlarge CGEN_MAX_SYNTAX_BYTES"
+#endif
 #endif
 
+
 typedef struct
 {
   unsigned char syntax[CGEN_MAX_SYNTAX_BYTES];
@@ -824,10 +832,18 @@ typedef struct {
 #define CGEN_IFMT_IFLD_IFLD(ii) ((ii)->ifld)
 } CGEN_IFMT_IFLD;
 
-#ifndef CGEN_MAX_IFMT_OPERANDS
-#define CGEN_MAX_IFMT_OPERANDS 1
+/* This should be at least as large as necessary for any target. */
+#define CGEN_MAX_IFMT_OPERANDS 16
+
+/* A target may know its own precise maximum.  Assert that it falls below
+   the above limit. */
+#ifdef CGEN_ACTUAL_MAX_IFMT_OPERANDS
+#if CGEN_ACTUAL_MAX_IFMT_OPERANDS > CGEN_MAX_IFMT_OPERANDS
+#error "CGEN_ACTUAL_MAX_IFMT_OPERANDS too high - enlarge CGEN_MAX_IFMT_OPERANDS"
+#endif
 #endif
 
+
 typedef struct
 {
   /* Length that MASK and VALUE have been calculated to
@@ -1037,6 +1053,12 @@ extern int cgen_macro_insn_count PARAMS ((CGEN_CPU_DESC));
 /* Return value of base part of INSN.  */
 #define CGEN_INSN_BASE_VALUE(insn) \
   CGEN_OPCODE_BASE_VALUE (CGEN_INSN_OPCODE (insn))
+
+/* Standard way to test whether INSN is supported by MACH.
+   MACH is one of enum mach_attr.
+   The "|1" is because the base mach is always selected.  */
+#define CGEN_INSN_MACH_HAS_P(insn, mach) \
+((CGEN_INSN_ATTR_VALUE ((insn), CGEN_INSN_MACH) & ((1 << (mach)) | 1)) != 0)
 \f
 /* Macro instructions.
    Macro insns aren't real insns, they map to one or more real insns.
@@ -1275,6 +1297,10 @@ typedef struct cgen_cpu_desc
   /* Disassembler instruction hash table.  */
   CGEN_INSN_LIST **dis_hash_table;
   CGEN_INSN_LIST *dis_hash_table_entries;
+
+  /* This field could be turned into a bitfield if room for other flags is needed.  */
+  unsigned int signed_overflow_ok_p;
+       
 } CGEN_CPU_TABLE;
 
 /* wip */
@@ -1377,4 +1403,13 @@ extern void cgen_put_insn_value
 extern const char * cgen_read_cpu_file
      PARAMS ((CGEN_CPU_DESC, const char * filename_));
 
+/* Allow signed overflow of instruction fields.  */
+extern void cgen_set_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
+
+/* Generate an error message if a signed field in an instruction overflows.  */
+extern void cgen_clear_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
+
+/* Will an error message be generated if a signed field in an instruction overflows ? */
+extern unsigned int cgen_signed_overflow_ok_p PARAMS ((CGEN_CPU_DESC));
+
 #endif /* CGEN_H */
This page took 0.024869 seconds and 4 git commands to generate.