133965Sjdp/* Definitions for decoding the picoJava opcode table. 233965Sjdp Copyright 1999, 2002, 2003, 2010 Free Software Foundation, Inc. 333965Sjdp Contributed by Steve Chamberlain of Transmeta (sac@pobox.com). 4218822Sdim 533965Sjdp This program is free software; you can redistribute it and/or modify 6218822Sdim it under the terms of the GNU General Public License as published by 733965Sjdp the Free Software Foundation; either version 3 of the License, or 8218822Sdim (at your option) any later version. 933965Sjdp 10218822Sdim This program is distributed in the hope that it will be useful, 11218822Sdim but WITHOUT ANY WARRANTY; without even the implied warranty of 12218822Sdim MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13218822Sdim GNU General Public License for more details. 1433965Sjdp 15218822Sdim You should have received a copy of the GNU General Public License 16218822Sdim along with this program; if not, write to the Free Software 17218822Sdim Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 18218822Sdim MA 02110-1301, USA. */ 1933965Sjdp 2033965Sjdp/* Names used to describe the type of instruction arguments, used by 21218822Sdim the assembler and disassembler. Attributes are encoded in various fields. */ 22218822Sdim 23218822Sdim/* reloc size pcrel uns */ 2433965Sjdp#define O_N 0 2533965Sjdp#define O_16 (1<<4 | 2 | (0<<6) | (0<<3)) 2633965Sjdp#define O_U16 (1<<4 | 2 | (0<<6) | (1<<3)) 2733965Sjdp#define O_R16 (2<<4 | 2 | (1<<6) | (0<<3)) 2833965Sjdp#define O_8 (3<<4 | 1 | (0<<6) | (0<<3)) 2933965Sjdp#define O_U8 (3<<4 | 1 | (0<<6) | (1<<3)) 3033965Sjdp#define O_R8 (4<<4 | 1 | (0<<6) | (0<<3)) 3133965Sjdp#define O_R32 (5<<4 | 4 | (1<<6) | (0<<3)) 3233965Sjdp#define O_32 (6<<4 | 4 | (0<<6) | (0<<3)) 3333965Sjdp 3433965Sjdp#define ASIZE(x) ((x) & 0x7) 3533965Sjdp#define PCREL(x) (!!((x) & (1<<6))) 3633965Sjdp#define UNS(x) (!!((x) & (1<<3))) 3733965Sjdp 3833965Sjdp 3933965Sjdptypedef struct pj_opc_info_t 4033965Sjdp{ 4133965Sjdp short opcode; 4233965Sjdp short opcode_next; 4333965Sjdp char len; 4433965Sjdp unsigned char arg[2]; 4533965Sjdp union { 4633965Sjdp const char *name; 4733965Sjdp void (*func) (struct pj_opc_info_t *, char *); 4833965Sjdp } u; 4933965Sjdp} pj_opc_info_t; 5033965Sjdp