198b9484cSchristos /* Definitions for decoding the picoJava opcode table. 2*aab831ceSchristos Copyright (C) 1999-2024 Free Software Foundation, Inc. 398b9484cSchristos Contributed by Steve Chamberlain of Transmeta (sac@pobox.com). 498b9484cSchristos 598b9484cSchristos This program is free software; you can redistribute it and/or modify 698b9484cSchristos it under the terms of the GNU General Public License as published by 798b9484cSchristos the Free Software Foundation; either version 3 of the License, or 898b9484cSchristos (at your option) any later version. 998b9484cSchristos 1098b9484cSchristos This program is distributed in the hope that it will be useful, 1198b9484cSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 1298b9484cSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1398b9484cSchristos GNU General Public License for more details. 1498b9484cSchristos 1598b9484cSchristos You should have received a copy of the GNU General Public License 1698b9484cSchristos along with this program; if not, write to the Free Software 1798b9484cSchristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 1898b9484cSchristos MA 02110-1301, USA. */ 1998b9484cSchristos 2098b9484cSchristos /* Names used to describe the type of instruction arguments, used by 2198b9484cSchristos the assembler and disassembler. Attributes are encoded in various fields. */ 2298b9484cSchristos 2398b9484cSchristos /* reloc size pcrel uns */ 2498b9484cSchristos #define O_N 0 2598b9484cSchristos #define O_16 (1<<4 | 2 | (0<<6) | (0<<3)) 2698b9484cSchristos #define O_U16 (1<<4 | 2 | (0<<6) | (1<<3)) 2798b9484cSchristos #define O_R16 (2<<4 | 2 | (1<<6) | (0<<3)) 2898b9484cSchristos #define O_8 (3<<4 | 1 | (0<<6) | (0<<3)) 2998b9484cSchristos #define O_U8 (3<<4 | 1 | (0<<6) | (1<<3)) 3098b9484cSchristos #define O_R8 (4<<4 | 1 | (0<<6) | (0<<3)) 3198b9484cSchristos #define O_R32 (5<<4 | 4 | (1<<6) | (0<<3)) 3298b9484cSchristos #define O_32 (6<<4 | 4 | (0<<6) | (0<<3)) 3398b9484cSchristos 3498b9484cSchristos #define ASIZE(x) ((x) & 0x7) 3598b9484cSchristos #define PCREL(x) (!!((x) & (1<<6))) 3698b9484cSchristos #define UNS(x) (!!((x) & (1<<3))) 3798b9484cSchristos 3898b9484cSchristos 3998b9484cSchristos typedef struct pj_opc_info_t 4098b9484cSchristos { 4198b9484cSchristos short opcode; 4298b9484cSchristos short opcode_next; 4398b9484cSchristos char len; 4498b9484cSchristos unsigned char arg[2]; 4598b9484cSchristos union { 4698b9484cSchristos const char *name; 4798b9484cSchristos void (*func) (struct pj_opc_info_t *, char *); 4898b9484cSchristos } u; 4998b9484cSchristos } pj_opc_info_t; 50