106324dcfSchristos /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2ed0d50c3Schristos /* Semantic operand instances for lm32.
3ed0d50c3Schristos
4ed0d50c3Schristos THIS FILE IS MACHINE GENERATED WITH CGEN.
5ed0d50c3Schristos
6*b88e3e88Schristos Copyright (C) 1996-2020 Free Software Foundation, Inc.
7ed0d50c3Schristos
8ed0d50c3Schristos This file is part of the GNU Binutils and/or GDB, the GNU debugger.
9ed0d50c3Schristos
10ed0d50c3Schristos This file is free software; you can redistribute it and/or modify
11ed0d50c3Schristos it under the terms of the GNU General Public License as published by
12ed0d50c3Schristos the Free Software Foundation; either version 3, or (at your option)
13ed0d50c3Schristos any later version.
14ed0d50c3Schristos
15ed0d50c3Schristos It is distributed in the hope that it will be useful, but WITHOUT
16ed0d50c3Schristos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17ed0d50c3Schristos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18ed0d50c3Schristos License for more details.
19ed0d50c3Schristos
20ed0d50c3Schristos You should have received a copy of the GNU General Public License along
21ed0d50c3Schristos with this program; if not, write to the Free Software Foundation, Inc.,
22ed0d50c3Schristos 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
23ed0d50c3Schristos
24ed0d50c3Schristos */
25ed0d50c3Schristos
26ed0d50c3Schristos #include "sysdep.h"
27ed0d50c3Schristos #include "ansidecl.h"
28ed0d50c3Schristos #include "bfd.h"
29ed0d50c3Schristos #include "symcat.h"
30ed0d50c3Schristos #include "lm32-desc.h"
31ed0d50c3Schristos #include "lm32-opc.h"
32ed0d50c3Schristos
33ed0d50c3Schristos /* Operand references. */
34ed0d50c3Schristos
35ed0d50c3Schristos #define OP_ENT(op) LM32_OPERAND_##op
36ed0d50c3Schristos #define INPUT CGEN_OPINST_INPUT
37ed0d50c3Schristos #define OUTPUT CGEN_OPINST_OUTPUT
38ed0d50c3Schristos #define END CGEN_OPINST_END
39ed0d50c3Schristos #define COND_REF CGEN_OPINST_COND_REF
40ed0d50c3Schristos
41ed0d50c3Schristos static const CGEN_OPINST sfmt_empty_ops[] ATTRIBUTE_UNUSED = {
42ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
43ed0d50c3Schristos };
44ed0d50c3Schristos
45ed0d50c3Schristos static const CGEN_OPINST sfmt_add_ops[] ATTRIBUTE_UNUSED = {
46ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
47ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
48ed0d50c3Schristos { OUTPUT, "r2", HW_H_GR, CGEN_MODE_SI, OP_ENT (R2), 0, 0 },
49ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
50ed0d50c3Schristos };
51ed0d50c3Schristos
52ed0d50c3Schristos static const CGEN_OPINST sfmt_addi_ops[] ATTRIBUTE_UNUSED = {
53ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
54ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
55ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
56ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
57ed0d50c3Schristos };
58ed0d50c3Schristos
59ed0d50c3Schristos static const CGEN_OPINST sfmt_andi_ops[] ATTRIBUTE_UNUSED = {
60ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
61ed0d50c3Schristos { INPUT, "uimm", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (UIMM), 0, 0 },
62ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
63ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
64ed0d50c3Schristos };
65ed0d50c3Schristos
66ed0d50c3Schristos static const CGEN_OPINST sfmt_andhii_ops[] ATTRIBUTE_UNUSED = {
67ed0d50c3Schristos { INPUT, "hi16", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (HI16), 0, 0 },
68ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
69ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
70ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
71ed0d50c3Schristos };
72ed0d50c3Schristos
73ed0d50c3Schristos static const CGEN_OPINST sfmt_b_ops[] ATTRIBUTE_UNUSED = {
74ed0d50c3Schristos { INPUT, "f_r0", HW_H_UINT, CGEN_MODE_UINT, 0, 0, 0 },
75ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
76ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
77ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
78ed0d50c3Schristos };
79ed0d50c3Schristos
80ed0d50c3Schristos static const CGEN_OPINST sfmt_bi_ops[] ATTRIBUTE_UNUSED = {
81ed0d50c3Schristos { INPUT, "call", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (CALL), 0, 0 },
82ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
83ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
84ed0d50c3Schristos };
85ed0d50c3Schristos
86ed0d50c3Schristos static const CGEN_OPINST sfmt_be_ops[] ATTRIBUTE_UNUSED = {
87ed0d50c3Schristos { INPUT, "branch", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (BRANCH), 0, COND_REF },
88ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
89ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
90ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, COND_REF },
91ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
92ed0d50c3Schristos };
93ed0d50c3Schristos
94ed0d50c3Schristos static const CGEN_OPINST sfmt_call_ops[] ATTRIBUTE_UNUSED = {
95ed0d50c3Schristos { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
96ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
97ed0d50c3Schristos { OUTPUT, "h_gr_SI_29", HW_H_GR, CGEN_MODE_SI, 0, 29, 0 },
98ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
99ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
100ed0d50c3Schristos };
101ed0d50c3Schristos
102ed0d50c3Schristos static const CGEN_OPINST sfmt_calli_ops[] ATTRIBUTE_UNUSED = {
103ed0d50c3Schristos { INPUT, "call", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (CALL), 0, 0 },
104ed0d50c3Schristos { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
105ed0d50c3Schristos { OUTPUT, "h_gr_SI_29", HW_H_GR, CGEN_MODE_SI, 0, 29, 0 },
106ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
107ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
108ed0d50c3Schristos };
109ed0d50c3Schristos
110ed0d50c3Schristos static const CGEN_OPINST sfmt_divu_ops[] ATTRIBUTE_UNUSED = {
111ed0d50c3Schristos { INPUT, "f_r0", HW_H_UINT, CGEN_MODE_UINT, 0, 0, 0 },
112ed0d50c3Schristos { INPUT, "f_r1", HW_H_UINT, CGEN_MODE_UINT, 0, 0, 0 },
113ed0d50c3Schristos { INPUT, "f_r2", HW_H_UINT, CGEN_MODE_UINT, 0, 0, 0 },
114ed0d50c3Schristos { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
115ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
116ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
117ed0d50c3Schristos };
118ed0d50c3Schristos
119ed0d50c3Schristos static const CGEN_OPINST sfmt_lb_ops[] ATTRIBUTE_UNUSED = {
120ed0d50c3Schristos { INPUT, "h_memory_QI_add__SI_r0_ext__SI_trunc__HI_imm", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 },
121ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
122ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
123ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
124ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
125ed0d50c3Schristos };
126ed0d50c3Schristos
127ed0d50c3Schristos static const CGEN_OPINST sfmt_lh_ops[] ATTRIBUTE_UNUSED = {
128ed0d50c3Schristos { INPUT, "h_memory_HI_add__SI_r0_ext__SI_trunc__HI_imm", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 },
129ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
130ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
131ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
132ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
133ed0d50c3Schristos };
134ed0d50c3Schristos
135ed0d50c3Schristos static const CGEN_OPINST sfmt_lw_ops[] ATTRIBUTE_UNUSED = {
136ed0d50c3Schristos { INPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_imm", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
137ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
138ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
139ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
140ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
141ed0d50c3Schristos };
142ed0d50c3Schristos
143ed0d50c3Schristos static const CGEN_OPINST sfmt_ori_ops[] ATTRIBUTE_UNUSED = {
144ed0d50c3Schristos { INPUT, "lo16", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (LO16), 0, 0 },
145ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
146ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
147ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
148ed0d50c3Schristos };
149ed0d50c3Schristos
150ed0d50c3Schristos static const CGEN_OPINST sfmt_rcsr_ops[] ATTRIBUTE_UNUSED = {
151ed0d50c3Schristos { INPUT, "csr", HW_H_CSR, CGEN_MODE_SI, OP_ENT (CSR), 0, 0 },
152ed0d50c3Schristos { OUTPUT, "r2", HW_H_GR, CGEN_MODE_SI, OP_ENT (R2), 0, 0 },
153ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
154ed0d50c3Schristos };
155ed0d50c3Schristos
156ed0d50c3Schristos static const CGEN_OPINST sfmt_sb_ops[] ATTRIBUTE_UNUSED = {
157ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
158ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
159ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
160ed0d50c3Schristos { OUTPUT, "h_memory_QI_add__SI_r0_ext__SI_trunc__HI_imm", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 },
161ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
162ed0d50c3Schristos };
163ed0d50c3Schristos
164ed0d50c3Schristos static const CGEN_OPINST sfmt_sextb_ops[] ATTRIBUTE_UNUSED = {
165ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
166ed0d50c3Schristos { OUTPUT, "r2", HW_H_GR, CGEN_MODE_SI, OP_ENT (R2), 0, 0 },
167ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
168ed0d50c3Schristos };
169ed0d50c3Schristos
170ed0d50c3Schristos static const CGEN_OPINST sfmt_sh_ops[] ATTRIBUTE_UNUSED = {
171ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
172ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
173ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
174ed0d50c3Schristos { OUTPUT, "h_memory_HI_add__SI_r0_ext__SI_trunc__HI_imm", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 },
175ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
176ed0d50c3Schristos };
177ed0d50c3Schristos
178ed0d50c3Schristos static const CGEN_OPINST sfmt_sw_ops[] ATTRIBUTE_UNUSED = {
179ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
180ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
181ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
182ed0d50c3Schristos { OUTPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_imm", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
183ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
184ed0d50c3Schristos };
185ed0d50c3Schristos
186ed0d50c3Schristos static const CGEN_OPINST sfmt_user_ops[] ATTRIBUTE_UNUSED = {
187ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
188ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
189ed0d50c3Schristos { INPUT, "user", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (USER), 0, 0 },
190ed0d50c3Schristos { OUTPUT, "r2", HW_H_GR, CGEN_MODE_SI, OP_ENT (R2), 0, 0 },
191ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
192ed0d50c3Schristos };
193ed0d50c3Schristos
194ed0d50c3Schristos static const CGEN_OPINST sfmt_wcsr_ops[] ATTRIBUTE_UNUSED = {
195ed0d50c3Schristos { INPUT, "f_csr", HW_H_UINT, CGEN_MODE_UINT, 0, 0, 0 },
196ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
197ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
198ed0d50c3Schristos };
199ed0d50c3Schristos
200ed0d50c3Schristos static const CGEN_OPINST sfmt_break_ops[] ATTRIBUTE_UNUSED = {
201ed0d50c3Schristos { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
202ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
203ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
204ed0d50c3Schristos };
205ed0d50c3Schristos
206ed0d50c3Schristos static const CGEN_OPINST sfmt_bret_ops[] ATTRIBUTE_UNUSED = {
207ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
208ed0d50c3Schristos { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 },
209ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
210ed0d50c3Schristos };
211ed0d50c3Schristos
212ed0d50c3Schristos static const CGEN_OPINST sfmt_mvi_ops[] ATTRIBUTE_UNUSED = {
213ed0d50c3Schristos { INPUT, "imm", HW_H_SINT, CGEN_MODE_INT, OP_ENT (IMM), 0, 0 },
214ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
215ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
216ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
217ed0d50c3Schristos };
218ed0d50c3Schristos
219ed0d50c3Schristos static const CGEN_OPINST sfmt_mvui_ops[] ATTRIBUTE_UNUSED = {
220ed0d50c3Schristos { INPUT, "lo16", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (LO16), 0, 0 },
221ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
222ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
223ed0d50c3Schristos };
224ed0d50c3Schristos
225ed0d50c3Schristos static const CGEN_OPINST sfmt_mvhi_ops[] ATTRIBUTE_UNUSED = {
226ed0d50c3Schristos { INPUT, "hi16", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (HI16), 0, 0 },
227ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
228ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
229ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
230ed0d50c3Schristos };
231ed0d50c3Schristos
232ed0d50c3Schristos static const CGEN_OPINST sfmt_mva_ops[] ATTRIBUTE_UNUSED = {
233ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
234ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
235ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
236ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
237ed0d50c3Schristos };
238ed0d50c3Schristos
239ed0d50c3Schristos static const CGEN_OPINST sfmt_nop_ops[] ATTRIBUTE_UNUSED = {
240ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
241ed0d50c3Schristos { OUTPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
242ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
243ed0d50c3Schristos };
244ed0d50c3Schristos
245ed0d50c3Schristos static const CGEN_OPINST sfmt_lbgprel_ops[] ATTRIBUTE_UNUSED = {
246ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
247ed0d50c3Schristos { INPUT, "h_memory_QI_add__SI_r0_ext__SI_trunc__HI_gp16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 },
248ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
249ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
250ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
251ed0d50c3Schristos };
252ed0d50c3Schristos
253ed0d50c3Schristos static const CGEN_OPINST sfmt_lhgprel_ops[] ATTRIBUTE_UNUSED = {
254ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
255ed0d50c3Schristos { INPUT, "h_memory_HI_add__SI_r0_ext__SI_trunc__HI_gp16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 },
256ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
257ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
258ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
259ed0d50c3Schristos };
260ed0d50c3Schristos
261ed0d50c3Schristos static const CGEN_OPINST sfmt_lwgprel_ops[] ATTRIBUTE_UNUSED = {
262ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
263ed0d50c3Schristos { INPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_gp16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
264ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
265ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
266ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
267ed0d50c3Schristos };
268ed0d50c3Schristos
269ed0d50c3Schristos static const CGEN_OPINST sfmt_sbgprel_ops[] ATTRIBUTE_UNUSED = {
270ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
271ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
272ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
273ed0d50c3Schristos { OUTPUT, "h_memory_QI_add__SI_r0_ext__SI_trunc__HI_gp16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 },
274ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
275ed0d50c3Schristos };
276ed0d50c3Schristos
277ed0d50c3Schristos static const CGEN_OPINST sfmt_shgprel_ops[] ATTRIBUTE_UNUSED = {
278ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
279ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
280ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
281ed0d50c3Schristos { OUTPUT, "h_memory_HI_add__SI_r0_ext__SI_trunc__HI_gp16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 },
282ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
283ed0d50c3Schristos };
284ed0d50c3Schristos
285ed0d50c3Schristos static const CGEN_OPINST sfmt_swgprel_ops[] ATTRIBUTE_UNUSED = {
286ed0d50c3Schristos { INPUT, "gp16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GP16), 0, 0 },
287ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
288ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
289ed0d50c3Schristos { OUTPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_gp16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
290ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
291ed0d50c3Schristos };
292ed0d50c3Schristos
293ed0d50c3Schristos static const CGEN_OPINST sfmt_lwgotrel_ops[] ATTRIBUTE_UNUSED = {
294ed0d50c3Schristos { INPUT, "got16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOT16), 0, 0 },
295ed0d50c3Schristos { INPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_got16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
296ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
297ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
298ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
299ed0d50c3Schristos };
300ed0d50c3Schristos
301ed0d50c3Schristos static const CGEN_OPINST sfmt_orhigotoffi_ops[] ATTRIBUTE_UNUSED = {
302ed0d50c3Schristos { INPUT, "gotoffhi16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFHI16), 0, 0 },
303ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
304ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
305ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
306ed0d50c3Schristos };
307ed0d50c3Schristos
308ed0d50c3Schristos static const CGEN_OPINST sfmt_addgotoff_ops[] ATTRIBUTE_UNUSED = {
309ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
310ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
311ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
312ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
313ed0d50c3Schristos };
314ed0d50c3Schristos
315ed0d50c3Schristos static const CGEN_OPINST sfmt_swgotoff_ops[] ATTRIBUTE_UNUSED = {
316ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
317ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
318ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
319ed0d50c3Schristos { OUTPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_gotofflo16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
320ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
321ed0d50c3Schristos };
322ed0d50c3Schristos
323ed0d50c3Schristos static const CGEN_OPINST sfmt_lwgotoff_ops[] ATTRIBUTE_UNUSED = {
324ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
325ed0d50c3Schristos { INPUT, "h_memory_SI_add__SI_r0_ext__SI_trunc__HI_gotofflo16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 },
326ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
327ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
328ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
329ed0d50c3Schristos };
330ed0d50c3Schristos
331ed0d50c3Schristos static const CGEN_OPINST sfmt_shgotoff_ops[] ATTRIBUTE_UNUSED = {
332ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
333ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
334ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
335ed0d50c3Schristos { OUTPUT, "h_memory_HI_add__SI_r0_ext__SI_trunc__HI_gotofflo16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 },
336ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
337ed0d50c3Schristos };
338ed0d50c3Schristos
339ed0d50c3Schristos static const CGEN_OPINST sfmt_lhgotoff_ops[] ATTRIBUTE_UNUSED = {
340ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
341ed0d50c3Schristos { INPUT, "h_memory_HI_add__SI_r0_ext__SI_trunc__HI_gotofflo16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 },
342ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
343ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
344ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
345ed0d50c3Schristos };
346ed0d50c3Schristos
347ed0d50c3Schristos static const CGEN_OPINST sfmt_sbgotoff_ops[] ATTRIBUTE_UNUSED = {
348ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
349ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
350ed0d50c3Schristos { INPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
351ed0d50c3Schristos { OUTPUT, "h_memory_QI_add__SI_r0_ext__SI_trunc__HI_gotofflo16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 },
352ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
353ed0d50c3Schristos };
354ed0d50c3Schristos
355ed0d50c3Schristos static const CGEN_OPINST sfmt_lbgotoff_ops[] ATTRIBUTE_UNUSED = {
356ed0d50c3Schristos { INPUT, "gotofflo16", HW_H_SINT, CGEN_MODE_INT, OP_ENT (GOTOFFLO16), 0, 0 },
357ed0d50c3Schristos { INPUT, "h_memory_QI_add__SI_r0_ext__SI_trunc__HI_gotofflo16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 },
358ed0d50c3Schristos { INPUT, "r0", HW_H_GR, CGEN_MODE_SI, OP_ENT (R0), 0, 0 },
359ed0d50c3Schristos { OUTPUT, "r1", HW_H_GR, CGEN_MODE_SI, OP_ENT (R1), 0, 0 },
360ed0d50c3Schristos { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 }
361ed0d50c3Schristos };
362ed0d50c3Schristos
363ed0d50c3Schristos #undef OP_ENT
364ed0d50c3Schristos #undef INPUT
365ed0d50c3Schristos #undef OUTPUT
366ed0d50c3Schristos #undef END
367ed0d50c3Schristos #undef COND_REF
368ed0d50c3Schristos
369ed0d50c3Schristos /* Operand instance lookup table. */
370ed0d50c3Schristos
371ed0d50c3Schristos static const CGEN_OPINST *lm32_cgen_opinst_table[MAX_INSNS] = {
372ed0d50c3Schristos 0,
373ed0d50c3Schristos & sfmt_add_ops[0],
374ed0d50c3Schristos & sfmt_addi_ops[0],
375ed0d50c3Schristos & sfmt_add_ops[0],
376ed0d50c3Schristos & sfmt_andi_ops[0],
377ed0d50c3Schristos & sfmt_andhii_ops[0],
378ed0d50c3Schristos & sfmt_b_ops[0],
379ed0d50c3Schristos & sfmt_bi_ops[0],
380ed0d50c3Schristos & sfmt_be_ops[0],
381ed0d50c3Schristos & sfmt_be_ops[0],
382ed0d50c3Schristos & sfmt_be_ops[0],
383ed0d50c3Schristos & sfmt_be_ops[0],
384ed0d50c3Schristos & sfmt_be_ops[0],
385ed0d50c3Schristos & sfmt_be_ops[0],
386ed0d50c3Schristos & sfmt_call_ops[0],
387ed0d50c3Schristos & sfmt_calli_ops[0],
388ed0d50c3Schristos & sfmt_add_ops[0],
389ed0d50c3Schristos & sfmt_addi_ops[0],
390ed0d50c3Schristos & sfmt_add_ops[0],
391ed0d50c3Schristos & sfmt_addi_ops[0],
392ed0d50c3Schristos & sfmt_add_ops[0],
393ed0d50c3Schristos & sfmt_addi_ops[0],
394ed0d50c3Schristos & sfmt_add_ops[0],
395ed0d50c3Schristos & sfmt_andi_ops[0],
396ed0d50c3Schristos & sfmt_add_ops[0],
397ed0d50c3Schristos & sfmt_andi_ops[0],
398ed0d50c3Schristos & sfmt_add_ops[0],
399ed0d50c3Schristos & sfmt_addi_ops[0],
400ed0d50c3Schristos & sfmt_divu_ops[0],
401ed0d50c3Schristos & sfmt_lb_ops[0],
402ed0d50c3Schristos & sfmt_lb_ops[0],
403ed0d50c3Schristos & sfmt_lh_ops[0],
404ed0d50c3Schristos & sfmt_lh_ops[0],
405ed0d50c3Schristos & sfmt_lw_ops[0],
406ed0d50c3Schristos & sfmt_divu_ops[0],
407ed0d50c3Schristos & sfmt_add_ops[0],
408ed0d50c3Schristos & sfmt_addi_ops[0],
409ed0d50c3Schristos & sfmt_add_ops[0],
410ed0d50c3Schristos & sfmt_andi_ops[0],
411ed0d50c3Schristos & sfmt_add_ops[0],
412ed0d50c3Schristos & sfmt_ori_ops[0],
413ed0d50c3Schristos & sfmt_andhii_ops[0],
414ed0d50c3Schristos & sfmt_rcsr_ops[0],
415ed0d50c3Schristos & sfmt_sb_ops[0],
416ed0d50c3Schristos & sfmt_sextb_ops[0],
417ed0d50c3Schristos & sfmt_sextb_ops[0],
418ed0d50c3Schristos & sfmt_sh_ops[0],
419ed0d50c3Schristos & sfmt_add_ops[0],
420ed0d50c3Schristos & sfmt_addi_ops[0],
421ed0d50c3Schristos & sfmt_add_ops[0],
422ed0d50c3Schristos & sfmt_addi_ops[0],
423ed0d50c3Schristos & sfmt_add_ops[0],
424ed0d50c3Schristos & sfmt_addi_ops[0],
425ed0d50c3Schristos & sfmt_add_ops[0],
426ed0d50c3Schristos & sfmt_sw_ops[0],
427ed0d50c3Schristos & sfmt_user_ops[0],
428ed0d50c3Schristos & sfmt_wcsr_ops[0],
429ed0d50c3Schristos & sfmt_add_ops[0],
430ed0d50c3Schristos & sfmt_andi_ops[0],
431ed0d50c3Schristos & sfmt_add_ops[0],
432ed0d50c3Schristos & sfmt_andi_ops[0],
433ed0d50c3Schristos & sfmt_break_ops[0],
434ed0d50c3Schristos & sfmt_break_ops[0],
435ed0d50c3Schristos & sfmt_bret_ops[0],
436ed0d50c3Schristos & sfmt_bret_ops[0],
437ed0d50c3Schristos & sfmt_bret_ops[0],
438ed0d50c3Schristos & sfmt_sextb_ops[0],
439ed0d50c3Schristos & sfmt_mvi_ops[0],
440ed0d50c3Schristos & sfmt_mvui_ops[0],
441ed0d50c3Schristos & sfmt_mvhi_ops[0],
442ed0d50c3Schristos & sfmt_mva_ops[0],
443ed0d50c3Schristos & sfmt_sextb_ops[0],
444ed0d50c3Schristos & sfmt_nop_ops[0],
445ed0d50c3Schristos & sfmt_lbgprel_ops[0],
446ed0d50c3Schristos & sfmt_lbgprel_ops[0],
447ed0d50c3Schristos & sfmt_lhgprel_ops[0],
448ed0d50c3Schristos & sfmt_lhgprel_ops[0],
449ed0d50c3Schristos & sfmt_lwgprel_ops[0],
450ed0d50c3Schristos & sfmt_sbgprel_ops[0],
451ed0d50c3Schristos & sfmt_shgprel_ops[0],
452ed0d50c3Schristos & sfmt_swgprel_ops[0],
453ed0d50c3Schristos & sfmt_lwgotrel_ops[0],
454ed0d50c3Schristos & sfmt_orhigotoffi_ops[0],
455ed0d50c3Schristos & sfmt_addgotoff_ops[0],
456ed0d50c3Schristos & sfmt_swgotoff_ops[0],
457ed0d50c3Schristos & sfmt_lwgotoff_ops[0],
458ed0d50c3Schristos & sfmt_shgotoff_ops[0],
459ed0d50c3Schristos & sfmt_lhgotoff_ops[0],
460ed0d50c3Schristos & sfmt_lhgotoff_ops[0],
461ed0d50c3Schristos & sfmt_sbgotoff_ops[0],
462ed0d50c3Schristos & sfmt_lbgotoff_ops[0],
463ed0d50c3Schristos & sfmt_lbgotoff_ops[0],
464ed0d50c3Schristos };
465ed0d50c3Schristos
466ed0d50c3Schristos /* Function to call before using the operand instance table. */
467ed0d50c3Schristos
468ed0d50c3Schristos void
lm32_cgen_init_opinst_table(CGEN_CPU_DESC cd)469ed0d50c3Schristos lm32_cgen_init_opinst_table (CGEN_CPU_DESC cd)
470ed0d50c3Schristos {
471ed0d50c3Schristos int i;
472ed0d50c3Schristos const CGEN_OPINST **oi = & lm32_cgen_opinst_table[0];
473ed0d50c3Schristos CGEN_INSN *insns = (CGEN_INSN *) cd->insn_table.init_entries;
474ed0d50c3Schristos for (i = 0; i < MAX_INSNS; ++i)
475ed0d50c3Schristos insns[i].opinst = oi[i];
476ed0d50c3Schristos }
477