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