/* cris.h -- Header file for CRIS opcode and register tables.
Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
Contributed by Axis Communications AB, Lund, Sweden.
Originally written for GAS 1.38.1 by Mikael Asker.
Updated, BFDized and GNUified by Hans-Peter Nilsson.
This file is part of GAS, GDB and the GNU binutils.
GAS, GDB, and GNU binutils is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at your
option) any later version.
GAS, GDB, and GNU binutils are distributed in the hope that they will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see . */
#ifndef __CRIS_H_INCLUDED_
#define __CRIS_H_INCLUDED_
#if !defined(__STDC__) && !defined(const)
#define const
#endif
/* Registers. */
#define MAX_REG (15)
#define CRIS_REG_SP (14)
#define CRIS_REG_PC (15)
/* CPU version control of disassembly and assembly of instructions.
May affect how the instruction is assembled, at least the size of
immediate operands. */
enum cris_insn_version_usage
{
/* Any version. */
cris_ver_version_all=0,
/* Indeterminate (intended for disassembly only, or obsolete). */
cris_ver_warning,
/* Only for v0..3 (Etrax 1..4). */
cris_ver_v0_3,
/* Only for v3 or higher (ETRAX 4 and beyond). */
cris_ver_v3p,
/* Only for v8 (Etrax 100). */
cris_ver_v8,
/* Only for v8 or higher (ETRAX 100, ETRAX 100 LX). */
cris_ver_v8p,
/* Only for v0..10. FIXME: Not sure what to do with this. */
cris_ver_sim_v0_10,
/* Only for v0..10. */
cris_ver_v0_10,
/* Only for v3..10. (ETRAX 4, ETRAX 100 and ETRAX 100 LX). */
cris_ver_v3_10,
/* Only for v8..10 (ETRAX 100 and ETRAX 100 LX). */
cris_ver_v8_10,
/* Only for v10 (ETRAX 100 LX) and same series. */
cris_ver_v10,
/* Only for v10 (ETRAX 100 LX) and same series. */
cris_ver_v10p,
/* Only for v32 or higher (codename GUINNESS).
Of course some or all these of may change to cris_ver_v32p if/when
there's a new revision. */
cris_ver_v32p
};
/* Special registers. */
struct cris_spec_reg
{
const char *const name;
unsigned int number;
/* The size of the register. */
unsigned int reg_size;
/* What CPU version the special register of that name is implemented
in. If cris_ver_warning, emit an unimplemented-warning. */
enum cris_insn_version_usage applicable_version;
/* There might be a specific warning for using a special register
here. */
const char *const warning;
};
extern const struct cris_spec_reg cris_spec_regs[];
/* Support registers (kind of special too, but not named as such). */
struct cris_support_reg
{
const char *const name;
unsigned int number;
};
extern const struct cris_support_reg cris_support_regs[];
/* Opcode-dependent constants. */
#define AUTOINCR_BIT (0x04)
/* Prefixes. */
#define BDAP_QUICK_OPCODE (0x0100)
#define BDAP_QUICK_Z_BITS (0x0e00)
#define BIAP_OPCODE (0x0540)
#define BIAP_Z_BITS (0x0a80)
#define DIP_OPCODE (0x0970)
#define DIP_Z_BITS (0xf280)
#define BDAP_INDIR_LOW (0x40)
#define BDAP_INDIR_LOW_Z (0x80)
#define BDAP_INDIR_HIGH (0x09)
#define BDAP_INDIR_HIGH_Z (0x02)
#define BDAP_INDIR_OPCODE (BDAP_INDIR_HIGH * 0x0100 + BDAP_INDIR_LOW)
#define BDAP_INDIR_Z_BITS (BDAP_INDIR_HIGH_Z * 0x100 + BDAP_INDIR_LOW_Z)
#define BDAP_PC_LOW (BDAP_INDIR_LOW + CRIS_REG_PC)
#define BDAP_INCR_HIGH (BDAP_INDIR_HIGH + AUTOINCR_BIT)
/* No prefix must have this code for its "match" bits in the
opcode-table. "BCC .+2" will do nicely. */
#define NO_CRIS_PREFIX 0
/* Definitions for condition codes. */
#define CC_CC 0x0
#define CC_HS 0x0
#define CC_CS 0x1
#define CC_LO 0x1
#defin