1 /* Declarations for SH64 opcodes.
2 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
18 #ifndef _SH64_OPC_INCLUDED_H
19 #define _SH64_OPC_INCLUDED_H
26 /* Bit number for where to insert operand. */
31 } shmedia_nibble_type;
34 /* First a placeholder. */
61 /* This one is only used in a shmedia_get_operand. */
64 /* Copy of previous register. */
67 /* Unsigned 5-bit operand. */
70 /* Signed 6-bit operand. */
73 /* Signed operand, 6 bits << 5. */
76 /* Unsigned 6-bit operand. */
79 /* Signed 10-bit operand. */
82 /* Signed operand, 10 bits << 0. */
85 /* Signed operand, 10 bits << 1. */
88 /* Signed operand, 10 bits << 2. */
91 /* Signed operand, 10 bits << 3. */
94 /* Signed 16-bit operand. */
97 /* Unsigned 16-bit operand. */
100 /* PC-relative signed operand, 16 bits << 2, for PTA and PTB insns. */
103 /* PC relative signed operand, 16 bits << 2, for PT insns. Also adjusts
104 the opcode to be PTA or PTB. */
110 shmedia_arg_type arg[4];
111 shmedia_nibble_type nibbles[4];
112 unsigned long opcode_base;
113 } shmedia_opcode_info;
115 extern const shmedia_opcode_info shmedia_table[];
122 extern const shmedia_creg_info shmedia_creg_table[];
124 #define SHMEDIA_LIKELY_BIT 0x00000200
125 #define SHMEDIA_PT_OPC 0xe8000000
126 #define SHMEDIA_PTB_BIT 0x04000000
127 #define SHMEDIA_PTA_OPC 0xe8000000
128 #define SHMEDIA_PTB_OPC 0xec000000
130 /* Note that this is ptrel/u. "Or" in SHMEDIA_LIKELY_BIT for ptrel/l. */
131 #define SHMEDIA_PTREL_OPC 0x6bf50000
132 #define SHMEDIA_MOVI_OPC 0xcc000000
133 #define SHMEDIA_SHORI_OPC 0xc8000000
134 #define SHMEDIA_ADDI_OPC 0xd0000000
135 #define SHMEDIA_ADD_OPC 0x00090000
136 #define SHMEDIA_NOP_OPC 0x6ff0fff0
137 #define SHMEDIA_TEMP_REG 25
139 #endif /* _SH64_OPC_INCLUDED_H */