1 /* TI C6X opcode table.
3 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
18 MA 02110-1301, USA. */
20 /* Define the INSN macro before including this file; it takes as
21 arguments the fields from tic6x_opcode (defined in tic6x.h). The
22 name is given as an identifier; the subsequent four operands should
23 have "tic6x_func_unit_", "tic6x_insn_format_", "tic6x_pipeline_"
24 and "TIC6X_INSN_", respectively, prepended to them by the macro
25 definition. Also define INSNE, which has a second argument that
26 goes after tic6x_opcode_NAME_ to form the enumeration value for
27 this instruction, where the value otherwise formed from the name,
28 functional unit and format is ambiguous, but otherwise has the same
31 #define TIC6X_INSN_C64X_AND_C67X TIC6X_INSN_C64X|TIC6X_INSN_C67X
32 #define tic6x_insn_format_nfu_s_branch_nop_cst \
33 tic6x_insn_format_s_branch_nop_cst
34 #define tic6x_insn_format_s_l_1_or_2_src tic6x_insn_format_l_1_or_2_src
35 #define RAN(id, min, max) { CONCAT2(tic6x_field_,id), (min), (max) }
36 #define FIX(id, val) RAN(id, val, val)
37 #define FIX0() 0, { { 0, 0, 0 } }
38 #define FIX1(a) 1, { a }
39 #define FIX2(a, b) 2, { a, b }
40 #define FIX3(a, b, c) 3, { a, b, c }
41 #define FIX4(a, b, c, d) 4, { a, b, c, d }
42 #define OP0() 0, { { 0, 0, FALSE, 0, 0, 0, 0 } }
43 #define OP1(a) 1, { a }
44 #define OP2(a, b) 2, { a, b }
45 #define OP3(a, b, c) 3, { a, b, c }
46 #define OP4(a, b, c, d) 4, { a, b, c, d }
47 #define OACST { tic6x_operand_asm_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
48 #define OLCST { tic6x_operand_link_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
49 #define OFULIST { tic6x_operand_func_unit, 0, tic6x_rw_none, 0, 0, 0, 0 }
50 #define ORIRP1 { tic6x_operand_irp, 4, tic6x_rw_read, 1, 1, 0, 0 }
51 #define ORNRP1 { tic6x_operand_nrp, 4, tic6x_rw_read, 1, 1, 0, 0 }
52 #define OWREG1 { tic6x_operand_reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
53 #define OWRETREG1 { tic6x_operand_retreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
54 #define ORREG1 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
55 #define ORDREG1 { tic6x_operand_dreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
56 #define ORWREG1 { tic6x_operand_reg, 4, tic6x_rw_read_write, 1, 1, 0, 0 }
57 #define ORAREG1 { tic6x_operand_areg, 4, tic6x_rw_read, 1, 1, 0, 0 }
58 #define ORXREG1 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
59 #define ORREG12 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 2, 0, 0 }
60 #define ORREG14 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 4, 0, 0 }
61 #define ORXREG14 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 4, 0, 0 }
62 #define OWREG2 { tic6x_operand_reg, 4, tic6x_rw_write, 2, 2, 0, 0 }
63 #define OWREG4 { tic6x_operand_reg, 4, tic6x_rw_write, 4, 4, 0, 0 }
64 #define OWREG9 { tic6x_operand_reg, 4, tic6x_rw_write, 9, 9, 0, 0 }
65 #define OWDREG5 { tic6x_operand_dreg, 4, tic6x_rw_write, 5, 5, 0, 0 }
66 #define OWREGL1 { tic6x_operand_regpair, 5, tic6x_rw_write, 1, 1, 1, 1 }
67 #define ORREGL1 { tic6x_operand_regpair, 5, tic6x_rw_read, 1, 1, 1, 1 }
68 #define OWREGD1 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 1, 1 }
69 #define OWREGD12 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 2, 2 }
70 #define OWREGD4 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 4, 4 }
71 #define ORREGD1 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
72 #define OWREGD45 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 5, 5 }
73 #define OWREGD67 { tic6x_operand_regpair, 8, tic6x_rw_write, 6, 6, 7, 7 }
74 #define ORDREGD1 { tic6x_operand_dregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
75 #define OWDREGD5 { tic6x_operand_dregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
76 #define ORREGD12 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
77 #define ORXREGD12 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
78 #define ORREGD1234 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 2, 3, 4 }
79 #define ORREGD1324 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 3, 2, 4 }
80 #define OWREGD910 { tic6x_operand_regpair, 8, tic6x_rw_write, 9, 9, 10, 10 }
81 #define ORCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_read, 1, 1, 0, 0 }
82 #define OWCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_write, 1, 1, 0, 0 }
83 #define ORMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_read, 3, 3, 0, 0 }
84 #define OWMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_write, 3, 3, 0, 0 }
85 #define ORMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_read, 3, 3, 0, 0 }
86 #define OWMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_write, 3, 3, 0, 0 }
87 #define ORMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_read, 3, 3, 0, 0 }
88 #define OWMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_write, 3, 3, 0, 0 }
89 #define ORMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_read, 3, 3, 0, 0 }
90 #define OWMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_write, 3, 3, 0, 0 }
91 #define ORMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_read, 3, 3, 0, 0 }
92 #define OWMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_write, 3, 3, 0, 0 }
93 #define ORMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_read, 3, 3, 0, 0 }
94 #define OWMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_write, 3, 3, 0, 0 }
95 #define ORMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_read, 3, 3, 0, 0 }
96 #define OWMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_write, 3, 3, 0, 0 }
97 #define ORMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_read, 3, 3, 0, 0 }
98 #define OWMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_write, 3, 3, 0, 0 }
99 #define ORMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_read, 3, 3, 0, 0 }
100 #define OWMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_write, 3, 3, 0, 0 }
101 #define ENC(id, meth, op) { \
102 CONCAT2(tic6x_field_,id), \
103 CONCAT2(tic6x_coding_,meth), \
106 #define ENC0() 0, { { 0, 0, 0 } }
107 #define ENC1(a) 1, { a }
108 #define ENC2(a, b) 2, { a, b }
109 #define ENC3(a, b, c) 3, { a, b, c }
110 #define ENC4(a, b, c, d) 4, { a, b, c, d }
111 #define ENC5(a, b, c, d, e) 5, { a, b, c, d, e }
112 #define ENC6(a, b, c, d, e, f) 6, { a, b, c, d, e, f }
113 #define ENC7(a, b, c, d, e, f, g) 7, { a, b, c, d, e, f, g }
115 INSN(abs, l, unary, 1cycle, C62X, 0,
117 OP2(ORXREG1, OWREG1),
118 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
120 INSN(abs, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
121 FIX3(FIX(op, 0x38), FIX(x, 0), FIX(src1, 0)),
122 OP2(ORREGL1, OWREGL1),
123 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
125 INSN(abs2, l, unary, 1cycle, C64X, 0,
127 OP2(ORXREG1, OWREG1),
128 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
131 INSN(absdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
132 FIX3(FIX(op, 0x2c), FIX(x, 0), FIX(src1, 0)),
133 OP2(ORREGD1, OWREGD12),
134 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
136 INSN(abssp, s, unary, 1cycle, C67X, 0,
138 OP2(ORXREG1, OWREG1),
139 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
142 INSNE(add, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
144 OP3(ORREG1, ORXREG1, OWREG1),
145 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
146 ENC(src2, reg, 1), ENC(dst, reg, 2)))
147 INSNE(add, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, 0,
149 OP3(ORREG1, ORXREG1, OWREGL1),
150 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
151 ENC(src2, reg, 1), ENC(dst, reg, 2)))
152 INSNE(add, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
154 OP3(ORXREG1, ORREGL1, OWREGL1),
155 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
156 ENC(src2, reg, 1), ENC(dst, reg, 2)))
157 INSNE(add, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
159 OP3(OACST, ORXREG1, OWREG1),
160 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
161 ENC(src2, reg, 1), ENC(dst, reg, 2)))
162 INSNE(add, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
163 FIX2(FIX(op, 0x20), FIX(x, 0)),
164 OP3(OACST, ORREGL1, OWREGL1),
165 ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
167 INSNE(add, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
169 OP3(ORREG1, ORXREG1, OWREG1),
170 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
171 ENC(src2, reg, 1), ENC(dst, reg, 2)))
172 INSNE(add, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
174 OP3(OACST, ORXREG1, OWREG1),
175 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
176 ENC(src2, reg, 1), ENC(dst, reg, 2)))
177 INSNE(add, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
178 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
180 OP3(ORREG1, ORREG1, OWREG1),
181 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
183 INSNE(add, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
184 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
186 OP3(ORREG1, OACST, OWREG1),
187 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
189 INSNE(add, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
191 OP3(ORREG1, ORXREG1, OWREG1),
192 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
193 ENC(src2, reg, 1), ENC(dst, reg, 2)))
194 INSNE(add, d_xsi_s5_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
196 OP3(ORXREG1, OACST, OWREG1),
197 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
198 ENC(src1, scst, 1), ENC(dst, reg, 2)))
200 INSNE(addab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
202 OP3(ORREG1, ORREG1, OWREG1),
203 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
205 INSNE(addab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
206 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
208 OP3(ORREG1, OACST, OWREG1),
209 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
211 INSN(addab, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
213 OP3(ORAREG1, OLCST, OWREG1),
214 ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 1),
217 INSNE(addad, d_si_si_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
220 OP3(ORREG1, ORREG1, OWREG1),
221 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
223 INSNE(addad, d_si_u5_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
226 OP3(ORREG1, OACST, OWREG1),
227 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
230 INSNE(addah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
232 OP3(ORREG1, ORREG1, OWREG1),
233 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
235 INSNE(addah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
236 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
238 OP3(ORREG1, OACST, OWREG1),
239 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
241 INSN(addah, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
243 OP3(ORAREG1, OLCST, OWREG1),
244 ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 1),
247 INSNE(addaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
249 OP3(ORREG1, ORREG1, OWREG1),
250 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
252 INSNE(addaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
253 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
255 OP3(ORREG1, OACST, OWREG1),
256 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
258 INSN(addaw, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
260 OP3(ORAREG1, OLCST, OWREG1),
261 ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 1),
264 INSN(adddp, l, 1_or_2_src, addsubdp, C67X, 0,
266 OP3(ORREGD12, ORXREGD12, OWREGD67),
267 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
268 ENC(src2, reg, 1), ENC(dst, reg, 2)))
269 INSN(adddp, s, l_1_or_2_src, addsubdp, C67XP, 0,
271 OP3(ORREGD12, ORXREGD12, OWREGD67),
272 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
273 ENC(src2, reg, 1), ENC(dst, reg, 2)))
275 INSN(addk, s, addk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
278 ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
280 INSN(addkpc, s, addkpc, 1cycle, C64X,
281 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_SIDE_B_ONLY,
283 OP3(OLCST, OWREG1, OACST),
284 ENC3(ENC(src1, pcrel, 0), ENC(dst, reg, 1), ENC(src2, ucst, 2)))
286 INSN(addsp, l, 1_or_2_src, 4cycle, C67X, 0,
288 OP3(ORREG1, ORXREG1, OWREG4),
289 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
290 ENC(src2, reg, 1), ENC(dst, reg, 2)))
291 INSN(addsp, s, l_1_or_2_src, 4cycle, C67XP, 0,
293 OP3(ORREG1, ORXREG1, OWREG4),
294 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
295 ENC(src2, reg, 1), ENC(dst, reg, 2)))
297 INSN(addsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
299 OP3(ORREG1, ORXREG1, OWREGD1),
300 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
301 ENC(src2, reg, 1), ENC(dst, reg, 2)))
303 INSN(addsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
305 OP3(ORREG1, ORXREG1, OWREGD1),
306 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
307 ENC(src2, reg, 1), ENC(dst, reg, 2)))
309 INSNE(addu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, 0,
311 OP3(ORREG1, ORXREG1, OWREGL1),
312 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
313 ENC(src2, reg, 1), ENC(dst, reg, 2)))
314 INSNE(addu, l_xui_ul_ul, l, 1_or_2_src, 1cycle, C62X, 0,
316 OP3(ORXREG1, ORREGL1, OWREGL1),
317 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
318 ENC(src2, reg, 1), ENC(dst, reg, 2)))
320 INSN(add2, s, 1_or_2_src, 1cycle, C62X, 0,
322 OP3(ORREG1, ORXREG1, OWREG1),
323 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
324 ENC(src2, reg, 1), ENC(dst, reg, 2)))
325 INSN(add2, l, 1_or_2_src, 1cycle, C64X, 0,
327 OP3(ORREG1, ORXREG1, OWREG1),
328 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
329 ENC(src2, reg, 1), ENC(dst, reg, 2)))
330 INSN(add2, d, ext_1_or_2_src, 1cycle, C64X, 0,
332 OP3(ORREG1, ORXREG1, OWREG1),
333 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
334 ENC(src2, reg, 1), ENC(dst, reg, 2)))
336 INSN(add4, l, 1_or_2_src, 1cycle, C64X, 0,
338 OP3(ORREG1, ORXREG1, OWREG1),
339 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
340 ENC(src2, reg, 1), ENC(dst, reg, 2)))
342 INSNE(and, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
344 OP3(ORREG1, ORXREG1, OWREG1),
345 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
346 ENC(src2, reg, 1), ENC(dst, reg, 2)))
347 INSNE(and, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
349 OP3(OACST, ORXREG1, OWREG1),
350 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
351 ENC(src2, reg, 1), ENC(dst, reg, 2)))
352 INSNE(and, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
354 OP3(ORREG1, ORXREG1, OWREG1),
355 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
356 ENC(src2, reg, 1), ENC(dst, reg, 2)))
357 INSNE(and, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
359 OP3(OACST, ORXREG1, OWREG1),
360 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
361 ENC(src2, reg, 1), ENC(dst, reg, 2)))
362 INSNE(and, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
364 OP3(ORREG1, ORXREG1, OWREG1),
365 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
366 ENC(src2, reg, 1), ENC(dst, reg, 2)))
367 INSNE(and, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
369 OP3(OACST, ORXREG1, OWREG1),
370 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
371 ENC(src2, reg, 1), ENC(dst, reg, 2)))
373 INSN(andn, l, 1_or_2_src, 1cycle, C64X, 0,
375 OP3(ORREG1, ORXREG1, OWREG1),
376 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
377 ENC(src2, reg, 1), ENC(dst, reg, 2)))
378 INSN(andn, s, ext_1_or_2_src, 1cycle, C64X, 0,
380 OP3(ORREG1, ORXREG1, OWREG1),
381 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
382 ENC(src2, reg, 1), ENC(dst, reg, 2)))
383 INSN(andn, d, ext_1_or_2_src, 1cycle, C64X, 0,
385 OP3(ORREG1, ORXREG1, OWREG1),
386 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
387 ENC(src2, reg, 1), ENC(dst, reg, 2)))
389 INSN(avg2, m, compound, 1616_m, C64X, 0,
391 OP3(ORREG1, ORXREG1, OWREG2),
392 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
393 ENC(src2, reg, 1), ENC(dst, reg, 2)))
395 INSN(avgu4, m, compound, 1616_m, C64X, 0,
397 OP3(ORREG1, ORXREG1, OWREG2),
398 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
399 ENC(src2, reg, 1), ENC(dst, reg, 2)))
401 INSN(b, s, ext_branch_cond_imm, branch, C62X, TIC6X_FLAG_NO_CROSS,
404 ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
405 INSN(b, s, branch, branch, C62X, TIC6X_FLAG_SIDE_B_ONLY,
408 ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
409 INSN(b, s, b_irp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
410 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
413 INSN(b, s, b_nrp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
414 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
418 INSN(bdec, s, bdec, branch, C64X, TIC6X_FLAG_NO_CROSS,
421 ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
423 INSN(bitc4, m, unary, 1616_m, C64X, 0,
425 OP2(ORXREG1, OWREG2),
426 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
429 INSN(bitr, m, unary, 1616_m, C64X, 0,
431 OP2(ORXREG1, OWREG2),
432 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
435 INSN(bnop, s, branch_nop_cst, branch, C64X,
436 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
439 ENC3(ENC(s, fu, 0), ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
440 INSN(bnop, nfu, s_branch_nop_cst, branch, C64XP,
441 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP,
444 ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
445 INSN(bnop, s, branch_nop_reg, branch, C64X,
446 TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP,
449 ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
451 INSN(bpos, s, bpos, branch, C64X, TIC6X_FLAG_NO_CROSS,
454 ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
456 INSN(call, s, ext_branch_cond_imm, branch, C62X,
457 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
460 ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
461 INSN(call, s, branch, branch, C62X,
462 TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
465 ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
466 INSN(call, s, b_irp, branch, C62X,
467 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
468 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
471 INSN(call, s, b_nrp, branch, C62X,
472 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
473 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
477 INSN(callnop, s, branch_nop_cst, branch, C64X,
478 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
481 ENC3(ENC(s, fu, 0), ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
482 INSN(callnop, nfu, s_branch_nop_cst, branch, C64XP,
483 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
486 ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
487 INSN(callnop, s, branch_nop_reg, branch, C64X,
488 TIC6X_FLAG_MACRO|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
491 ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
493 INSN(callp, s, call_imm_nop, branch, C64XP,
494 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
496 OP2(OLCST, OWRETREG1),
497 ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
499 INSN(callret, s, ext_branch_cond_imm, branch, C62X,
500 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
503 ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
504 INSN(callret, s, branch, branch, C62X,
505 TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
508 ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
509 INSN(callret, s, b_irp, branch, C62X,
510 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
511 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
514 INSN(callret, s, b_nrp, branch, C62X,
515 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
516 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
520 INSN(clr, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
522 OP4(ORREG1, OACST, OACST, OWREG1),
523 ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
524 ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
525 INSN(clr, s, 1_or_2_src, 1cycle, C62X, 0,
527 OP3(ORXREG1, ORREG1, OWREG1),
528 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
529 ENC(src1, reg, 1), ENC(dst, reg, 2)))
531 INSNE(cmpeq, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
533 OP3(ORREG1, ORXREG1, OWREG1),
534 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
535 ENC(src2, reg, 1), ENC(dst, reg, 2)))
536 INSNE(cmpeq, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
538 OP3(OACST, ORXREG1, OWREG1),
539 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
540 ENC(src2, reg, 1), ENC(dst, reg, 2)))
541 INSNE(cmpeq, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
543 OP3(ORXREG1, ORREGL1, OWREG1),
544 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
545 ENC(src2, reg, 1), ENC(dst, reg, 2)))
546 INSNE(cmpeq, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
547 FIX2(FIX(op, 0x50), FIX(x, 0)),
548 OP3(OACST, ORREGL1, OWREG1),
549 ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
552 INSN(cmpeq2, s, 1_or_2_src, 1cycle, C64X, 0,
554 OP3(ORREG1, ORXREG1, OWREG1),
555 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
556 ENC(src2, reg, 1), ENC(dst, reg, 2)))
558 INSN(cmpeq4, s, 1_or_2_src, 1cycle, C64X, 0,
560 OP3(ORREG1, ORXREG1, OWREG1),
561 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
562 ENC(src2, reg, 1), ENC(dst, reg, 2)))
564 INSN(cmpeqdp, s, 1_or_2_src, dpcmp, C67X, 0,
566 OP3(ORREGD12, ORXREGD12, OWREG2),
567 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
568 ENC(src2, reg, 1), ENC(dst, reg, 2)))
570 INSN(cmpeqsp, s, 1_or_2_src, 1cycle, C67X, 0,
572 OP3(ORREG1, ORXREG1, OWREG1),
573 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
574 ENC(src2, reg, 1), ENC(dst, reg, 2)))
576 INSNE(cmpgt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
578 OP3(ORREG1, ORXREG1, OWREG1),
579 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
580 ENC(src2, reg, 1), ENC(dst, reg, 2)))
581 INSNE(cmpgt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
583 OP3(OACST, ORXREG1, OWREG1),
584 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
585 ENC(src2, reg, 1), ENC(dst, reg, 2)))
586 INSNE(cmpgt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
588 OP3(ORXREG1, ORREGL1, OWREG1),
589 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
590 ENC(src2, reg, 1), ENC(dst, reg, 2)))
591 INSNE(cmpgt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
592 FIX2(FIX(op, 0x44), FIX(x, 0)),
593 OP3(OACST, ORREGL1, OWREG1),
594 ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
596 INSNE(cmpgt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
597 TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
599 OP3(ORXREG1, ORREG1, OWREG1),
600 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
601 ENC(src2, reg, 0), ENC(dst, reg, 2)))
602 INSNE(cmpgt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
604 OP3(ORXREG1, OACST, OWREG1),
605 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
606 ENC(src2, reg, 0), ENC(dst, reg, 2)))
607 INSNE(cmpgt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
609 OP3(ORREGL1, ORXREG1, OWREG1),
610 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
611 ENC(src2, reg, 0), ENC(dst, reg, 2)))
612 INSNE(cmpgt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
613 TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
614 FIX2(FIX(op, 0x54), FIX(x, 0)),
615 OP3(ORREGL1, OACST, OWREG1),
616 ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
619 INSN(cmpgt2, s, 1_or_2_src, 1cycle, C64X, 0,
621 OP3(ORREG1, ORXREG1, OWREG1),
622 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
623 ENC(src2, reg, 1), ENC(dst, reg, 2)))
625 INSN(cmpgtdp, s, 1_or_2_src, dpcmp, C67X, 0,
627 OP3(ORREGD12, ORXREGD12, OWREG2),
628 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
629 ENC(src2, reg, 1), ENC(dst, reg, 2)))
631 INSN(cmpgtsp, s, 1_or_2_src, 1cycle, C67X, 0,
633 OP3(ORREG1, ORXREG1, OWREG1),
634 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
635 ENC(src2, reg, 1), ENC(dst, reg, 2)))
637 INSNE(cmpgtu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
639 OP3(ORREG1, ORXREG1, OWREG1),
640 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
641 ENC(src2, reg, 1), ENC(dst, reg, 2)))
642 INSNE(cmpgtu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
643 FIX2(FIX(op, 0x4e), RAN(src1, 0, 15)),
644 OP3(OACST, ORXREG1, OWREG1),
645 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
646 ENC(src2, reg, 1), ENC(dst, reg, 2)))
647 /* Although not mentioned in SPRUFE8, CMPGTU and CMPLTU support a
648 5-bit unsigned constant operand on C64X and above. */
649 INSNE(cmpgtu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
650 FIX2(FIX(op, 0x4e), RAN(src1, 16, 31)),
651 OP3(OACST, ORXREG1, OWREG1),
652 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
653 ENC(src2, reg, 1), ENC(dst, reg, 2)))
654 INSNE(cmpgtu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
656 OP3(ORXREG1, ORREGL1, OWREG1),
657 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
658 ENC(src2, reg, 1), ENC(dst, reg, 2)))
659 INSNE(cmpgtu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
660 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
661 FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 0, 15)),
662 OP3(OACST, ORREGL1, OWREG1),
663 ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
665 INSNE(cmpgtu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
666 FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 16, 31)),
667 OP3(OACST, ORREGL1, OWREG1),
668 ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
671 INSN(cmpgtu4, s, 1_or_2_src, 1cycle, C64X, 0,
673 OP3(ORREG1, ORXREG1, OWREG1),
674 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
675 ENC(src2, reg, 1), ENC(dst, reg, 2)))
677 INSNE(cmplt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
679 OP3(ORREG1, ORXREG1, OWREG1),
680 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
681 ENC(src2, reg, 1), ENC(dst, reg, 2)))
682 INSNE(cmplt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
684 OP3(OACST, ORXREG1, OWREG1),
685 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
686 ENC(src2, reg, 1), ENC(dst, reg, 2)))
687 INSNE(cmplt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
689 OP3(ORXREG1, ORREGL1, OWREG1),
690 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
691 ENC(src2, reg, 1), ENC(dst, reg, 2)))
692 INSNE(cmplt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
693 FIX2(FIX(op, 0x54), FIX(x, 0)),
694 OP3(OACST, ORREGL1, OWREG1),
695 ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
697 INSNE(cmplt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
698 TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
700 OP3(ORXREG1, ORREG1, OWREG1),
701 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
702 ENC(src2, reg, 0), ENC(dst, reg, 2)))
703 INSNE(cmplt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
705 OP3(ORXREG1, OACST, OWREG1),
706 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
707 ENC(src2, reg, 0), ENC(dst, reg, 2)))
708 INSNE(cmplt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
710 OP3(ORREGL1, ORXREG1, OWREG1),
711 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
712 ENC(src2, reg, 0), ENC(dst, reg, 2)))
713 INSNE(cmplt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
714 TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
715 FIX2(FIX(op, 0x44), FIX(x, 0)),
716 OP3(ORREGL1, OACST, OWREG1),
717 ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
720 INSN(cmplt2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
722 OP3(ORXREG1, ORREG1, OWREG1),
723 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
724 ENC(src1, reg, 1), ENC(dst, reg, 2)))
726 INSN(cmpltdp, s, 1_or_2_src, dpcmp, C67X, 0,
728 OP3(ORREGD12, ORXREGD12, OWREG2),
729 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
730 ENC(src2, reg, 1), ENC(dst, reg, 2)))
732 INSN(cmpltsp, s, 1_or_2_src, 1cycle, C67X, 0,
734 OP3(ORREG1, ORXREG1, OWREG1),
735 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
736 ENC(src2, reg, 1), ENC(dst, reg, 2)))
738 INSNE(cmpltu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
740 OP3(ORREG1, ORXREG1, OWREG1),
741 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
742 ENC(src2, reg, 1), ENC(dst, reg, 2)))
743 INSNE(cmpltu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
744 FIX2(FIX(op, 0x5e), RAN(src1, 0, 15)),
745 OP3(OACST, ORXREG1, OWREG1),
746 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
747 ENC(src2, reg, 1), ENC(dst, reg, 2)))
748 INSNE(cmpltu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
749 FIX2(FIX(op, 0x5e), RAN(src1, 16, 31)),
750 OP3(OACST, ORXREG1, OWREG1),
751 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
752 ENC(src2, reg, 1), ENC(dst, reg, 2)))
753 INSNE(cmpltu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
755 OP3(ORXREG1, ORREGL1, OWREG1),
756 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
757 ENC(src2, reg, 1), ENC(dst, reg, 2)))
758 INSNE(cmpltu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
759 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
760 FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 0, 15)),
761 OP3(OACST, ORREGL1, OWREG1),
762 ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
764 INSNE(cmpltu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
765 FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 16, 31)),
766 OP3(OACST, ORREGL1, OWREG1),
767 ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
770 INSN(cmpltu4, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
772 OP3(ORXREG1, ORREG1, OWREG1),
773 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
774 ENC(src1, reg, 1), ENC(dst, reg, 2)))
776 INSN(cmpy, m, 1_or_2_src, 4cycle, C64XP, 0,
778 OP3(ORREG1, ORXREG1, OWREGD4),
779 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
780 ENC(src2, reg, 1), ENC(dst, reg, 2)))
782 INSN(cmpyr, m, 1_or_2_src, 4cycle, C64XP, 0,
784 OP3(ORREG1, ORXREG1, OWREG4),
785 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
786 ENC(src2, reg, 1), ENC(dst, reg, 2)))
788 INSN(cmpyr1, m, 1_or_2_src, 4cycle, C64XP, 0,
790 OP3(ORREG1, ORXREG1, OWREG4),
791 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
792 ENC(src2, reg, 1), ENC(dst, reg, 2)))
794 INSN(cmtl, d, 1_or_2_src, load, C64XP,
795 TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
796 FIX3(FIX(s, 1), FIX(op, 0xe), FIX(src1, 0)),
797 OP2(ORMEMDW, OWDREG5),
798 ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
800 INSN(ddotp4, m, 1_or_2_src, 4cycle, C64XP, 0,
802 OP3(ORREG1, ORXREG1, OWREGD4),
803 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
804 ENC(src2, reg, 1), ENC(dst, reg, 2)))
806 INSN(ddotph2, m, 1_or_2_src, 4cycle, C64XP, 0,
808 OP3(ORREGD1, ORXREG1, OWREGD4),
809 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
810 ENC(src2, reg, 1), ENC(dst, reg, 2)))
812 INSN(ddotph2r, m, 1_or_2_src, 4cycle, C64XP, 0,
814 OP3(ORREGD1, ORXREG1, OWREG4),
815 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
816 ENC(src2, reg, 1), ENC(dst, reg, 2)))
818 INSN(ddotpl2, m, 1_or_2_src, 4cycle, C64XP, 0,
820 OP3(ORREGD1, ORXREG1, OWREGD4),
821 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
822 ENC(src2, reg, 1), ENC(dst, reg, 2)))
824 INSN(ddotpl2r, m, 1_or_2_src, 4cycle, C64XP, 0,
826 OP3(ORREGD1, ORXREG1, OWREG4),
827 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
828 ENC(src2, reg, 1), ENC(dst, reg, 2)))
830 INSN(deal, m, unary, 1616_m, C64X, 0,
832 OP2(ORXREG1, OWREG2),
833 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
836 INSN(dint, nfu, dint, 1cycle, C64XP, 0,
841 INSN(dmv, s, ext_1_or_2_src, 1cycle, C64XP, 0,
843 OP3(ORREG1, ORXREG1, OWREGD1),
844 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
845 ENC(src2, reg, 1), ENC(dst, reg, 2)))
847 INSNE(dotp2, m_s2_xs2_si, m, compound, 4cycle, C64X, 0,
849 OP3(ORREG1, ORXREG1, OWREG4),
850 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
851 ENC(src2, reg, 1), ENC(dst, reg, 2)))
852 INSNE(dotp2, m_s2_xs2_sll, m, compound, 4cycle, C64X, 0,
854 OP3(ORREG1, ORXREG1, OWREGD4),
855 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
856 ENC(src2, reg, 1), ENC(dst, reg, 2)))
858 INSN(dotpn2, m, compound, 4cycle, C64X, 0,
860 OP3(ORREG1, ORXREG1, OWREG4),
861 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
862 ENC(src2, reg, 1), ENC(dst, reg, 2)))
864 INSN(dotpnrsu2, m, compound, 4cycle, C64X, 0,
866 OP3(ORREG1, ORXREG1, OWREG4),
867 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
868 ENC(src2, reg, 1), ENC(dst, reg, 2)))
870 INSN(dotpnrus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
872 OP3(ORXREG1, ORREG1, OWREG4),
873 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
874 ENC(src1, reg, 1), ENC(dst, reg, 2)))
876 INSN(dotprsu2, m, compound, 4cycle, C64X, 0,
878 OP3(ORREG1, ORXREG1, OWREG4),
879 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
880 ENC(src2, reg, 1), ENC(dst, reg, 2)))
882 INSN(dotprus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
884 OP3(ORXREG1, ORREG1, OWREG4),
885 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
886 ENC(src1, reg, 1), ENC(dst, reg, 2)))
888 INSN(dotpsu4, m, compound, 4cycle, C64X, 0,
890 OP3(ORREG1, ORXREG1, OWREG4),
891 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
892 ENC(src2, reg, 1), ENC(dst, reg, 2)))
894 INSN(dotpus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
896 OP3(ORXREG1, ORREG1, OWREG4),
897 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
898 ENC(src1, reg, 1), ENC(dst, reg, 2)))
900 INSN(dotpu4, m, compound, 4cycle, C64X, 0,
902 OP3(ORREG1, ORXREG1, OWREG4),
903 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
904 ENC(src2, reg, 1), ENC(dst, reg, 2)))
906 INSN(dpack2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
908 OP3(ORREG1, ORXREG1, OWREGD1),
909 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
910 ENC(src2, reg, 1), ENC(dst, reg, 2)))
912 INSN(dpackx2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
914 OP3(ORREG1, ORXREG1, OWREGD1),
915 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
916 ENC(src2, reg, 1), ENC(dst, reg, 2)))
918 INSN(dpint, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
919 FIX3(FIX(op, 0x8), FIX(x, 0), FIX(src1, 0)),
920 OP2(ORREGD1, OWREG4),
921 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
923 INSN(dpsp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
924 FIX3(FIX(op, 0x9), FIX(x, 0), FIX(src1, 0)),
925 OP2(ORREGD1, OWREG4),
926 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
928 INSN(dptrunc, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
929 FIX3(FIX(op, 0x1), FIX(x, 0), FIX(src1, 0)),
930 OP2(ORREGD1, OWREG4),
931 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
933 INSN(ext, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
935 OP4(ORREG1, OACST, OACST, OWREG1),
936 ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
937 ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
938 INSN(ext, s, 1_or_2_src, 1cycle, C62X, 0,
940 OP3(ORXREG1, ORREG1, OWREG1),
941 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
942 ENC(src1, reg, 1), ENC(dst, reg, 2)))
944 INSN(extu, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
946 OP4(ORREG1, OACST, OACST, OWREG1),
947 ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
948 ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
949 INSN(extu, s, 1_or_2_src, 1cycle, C62X, 0,
951 OP3(ORXREG1, ORREG1, OWREG1),
952 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
953 ENC(src1, reg, 1), ENC(dst, reg, 2)))
955 INSN(gmpy, m, 1_or_2_src, 4cycle, C64XP, TIC6X_FLAG_NO_CROSS,
956 FIX2(FIX(op, 0x1f), FIX(x, 0)),
957 OP3(ORREG1, ORREG1, OWREG4),
958 ENC4(ENC(s, fu, 0), ENC(src1, reg, 0), ENC(src2, reg, 1),
961 /* This instruction can be predicated as usual; SPRUFE8 is incorrect
962 where it shows the "z" field as fixed to 1. */
963 INSN(gmpy4, m, compound, 4cycle, C64X, 0,
965 OP3(ORREG1, ORXREG1, OWREG4),
966 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
967 ENC(src2, reg, 1), ENC(dst, reg, 2)))
969 INSN(idle, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MCNOP,
970 FIX2(FIX(s, 0), FIX(op, 0xf)),
974 INSN(intdp, l, 1_or_2_src, intdp, C67X, 0,
975 FIX2(FIX(op, 0x39), FIX(src1, 0)),
976 OP2(ORXREG1, OWREGD45),
977 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
980 INSN(intdpu, l, 1_or_2_src, intdp, C67X, 0,
981 FIX2(FIX(op, 0x3b), FIX(src1, 0)),
982 OP2(ORXREG1, OWREGD45),
983 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
986 INSN(intsp, l, 1_or_2_src, 4cycle, C67X, 0,
987 FIX2(FIX(op, 0x4a), FIX(src1, 0)),
988 OP2(ORXREG1, OWREG4),
989 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
992 INSN(intspu, l, 1_or_2_src, 4cycle, C67X, 0,
993 FIX2(FIX(op, 0x49), FIX(src1, 0)),
994 OP2(ORXREG1, OWREG4),
995 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
998 INSN(ldb, d, load_store, load, C62X,
999 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
1000 FIX2(FIX(op, 2), FIX(r, 0)),
1001 OP2(ORMEMSB, OWDREG5),
1002 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1003 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1004 ENC(srcdst, reg, 1)))
1005 INSN(ldb, d, load_store_long, load, C62X,
1006 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
1008 OP2(ORMEMLB, OWDREG5),
1009 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
1012 INSN(ldbu, d, load_store, load, C62X,
1013 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
1014 FIX2(FIX(op, 1), FIX(r, 0)),
1015 OP2(ORMEMSB, OWDREG5),
1016 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1017 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1018 ENC(srcdst, reg, 1)))
1019 INSN(ldbu, d, load_store_long, load, C62X,
1020 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
1022 OP2(ORMEMLB, OWDREG5),
1023 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
1026 INSN(lddw, d, load_store, load, C64X_AND_C67X,
1027 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS,
1028 FIX2(FIX(op, 6), FIX(r, 1)),
1029 OP2(ORMEMSD, OWDREGD5),
1030 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1031 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1032 ENC(srcdst, reg, 1)))
1034 INSN(ldh, d, load_store, load, C62X,
1035 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
1036 FIX2(FIX(op, 4), FIX(r, 0)),
1037 OP2(ORMEMSH, OWDREG5),
1038 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1039 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1040 ENC(srcdst, reg, 1)))
1041 INSN(ldh, d, load_store_long, load, C62X,
1042 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
1044 OP2(ORMEMLH, OWDREG5),
1045 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
1048 INSN(ldhu, d, load_store, load, C62X,
1049 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
1050 FIX2(FIX(op, 0), FIX(r, 0)),
1051 OP2(ORMEMSH, OWDREG5),
1052 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1053 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1054 ENC(srcdst, reg, 1)))
1055 INSN(ldhu, d, load_store_long, load, C62X,
1056 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
1058 OP2(ORMEMLH, OWDREG5),
1059 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
1062 INSN(ldndw, d, load_nonaligned, load, C64X,
1063 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
1065 OP2(ORMEMND, OWDREGD5),
1066 ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1067 ENC(offsetR, mem_offset_noscale, 0), ENC(baseR, reg, 0),
1068 ENC(sc, scaled, 0), ENC(dst, reg_shift, 1)))
1070 INSN(ldnw, d, load_store, load, C64X,
1071 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
1072 FIX2(FIX(op, 3), FIX(r, 1)),
1073 OP2(ORMEMSW, OWDREG5),
1074 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1075 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1076 ENC(srcdst, reg, 1)))
1078 INSN(ldw, d, load_store, load, C62X,
1079 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
1080 FIX2(FIX(op, 6), FIX(r, 0)),
1081 OP2(ORMEMSW, OWDREG5),
1082 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
1083 ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
1084 ENC(srcdst, reg, 1)))
1085 INSN(ldw, d, load_store_long, load, C62X,
1086 TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
1088 OP2(ORMEMLW, OWDREG5),
1089 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 0),
1092 INSN(ll, d, 1_or_2_src, load, C64XP,
1093 TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
1094 FIX3(FIX(s, 1), FIX(op, 0xc), FIX(src1, 0)),
1095 OP2(ORMEMDW, OWDREG5),
1096 ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
1098 INSNE(lmbd, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
1099 FIX1(FIX(op, 0x6b)),
1100 OP3(ORREG1, ORXREG1, OWREG1),
1101 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1102 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1103 INSNE(lmbd, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
1104 FIX1(FIX(op, 0x6a)),
1105 OP3(OACST, ORXREG1, OWREG1),
1106 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1107 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1109 INSN(max2, l, 1_or_2_src, 1cycle, C64X, 0,
1110 FIX1(FIX(op, 0x42)),
1111 OP3(ORREG1, ORXREG1, OWREG1),
1112 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1113 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1114 INSN(max2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
1116 OP3(ORREG1, ORXREG1, OWREG1),
1117 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1118 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1120 INSN(maxu4, l, 1_or_2_src, 1cycle, C64X, 0,
1121 FIX1(FIX(op, 0x43)),
1122 OP3(ORREG1, ORXREG1, OWREG1),
1123 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1124 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1126 INSN(min2, l, 1_or_2_src, 1cycle, C64X, 0,
1127 FIX1(FIX(op, 0x41)),
1128 OP3(ORREG1, ORXREG1, OWREG1),
1129 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1130 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1131 INSN(min2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
1133 OP3(ORREG1, ORXREG1, OWREG1),
1134 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1135 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1137 INSN(minu4, l, 1_or_2_src, 1cycle, C64X, 0,
1138 FIX1(FIX(op, 0x48)),
1139 OP3(ORREG1, ORXREG1, OWREG1),
1140 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1141 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1143 INSNE(mpy, m_sl16_xsl16_si, m, mpy, 1616_m, C62X, 0,
1144 FIX1(FIX(op, 0x19)),
1145 OP3(ORREG1, ORXREG1, OWREG2),
1146 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1147 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1148 INSNE(mpy, m_s5_xsl16_si, m, mpy, 1616_m, C62X, 0,
1149 FIX1(FIX(op, 0x18)),
1150 OP3(OACST, ORXREG1, OWREG2),
1151 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1152 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1154 INSN(mpydp, m, mpy, mpydp, C67X, TIC6X_FLAG_NO_CROSS,
1155 FIX2(FIX(op, 0x0e), FIX(x, 0)),
1156 OP3(ORREGD1234, ORREGD1324, OWREGD910),
1157 ENC4(ENC(s, fu, 0), ENC(src1, reg, 0), ENC(src2, reg, 1),
1160 INSN(mpyh, m, mpy, 1616_m, C62X, 0,
1161 FIX1(FIX(op, 0x01)),
1162 OP3(ORREG1, ORXREG1, OWREG2),
1163 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1164 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1166 INSN(mpyhi, m, compound, 4cycle, C64X, 0,
1167 FIX1(FIX(op, 0x14)),
1168 OP3(ORREG1, ORXREG1, OWREGD4),
1169 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1170 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1172 INSN(mpyhir, m, compound, 4cycle, C64X, 0,
1173 FIX1(FIX(op, 0x10)),
1174 OP3(ORREG1, ORXREG1, OWREG4),
1175 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1176 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1178 INSN(mpyhl, m, mpy, 1616_m, C62X, 0,
1179 FIX1(FIX(op, 0x09)),
1180 OP3(ORREG1, ORXREG1, OWREG2),
1181 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1182 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1184 INSN(mpyhlu, m, mpy, 1616_m, C62X, 0,
1185 FIX1(FIX(op, 0x0f)),
1186 OP3(ORREG1, ORXREG1, OWREG2),
1187 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1188 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1190 INSN(mpyhslu, m, mpy, 1616_m, C62X, 0,
1191 FIX1(FIX(op, 0x0b)),
1192 OP3(ORREG1, ORXREG1, OWREG2),
1193 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1194 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1196 INSN(mpyhsu, m, mpy, 1616_m, C62X, 0,
1197 FIX1(FIX(op, 0x03)),
1198 OP3(ORREG1, ORXREG1, OWREG2),
1199 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1200 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1202 INSN(mpyhu, m, mpy, 1616_m, C62X, 0,
1203 FIX1(FIX(op, 0x07)),
1204 OP3(ORREG1, ORXREG1, OWREG2),
1205 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1206 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1208 INSN(mpyhuls, m, mpy, 1616_m, C62X, 0,
1209 FIX1(FIX(op, 0x0d)),
1210 OP3(ORREG1, ORXREG1, OWREG2),
1211 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1212 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1214 INSN(mpyhus, m, mpy, 1616_m, C62X, 0,
1215 FIX1(FIX(op, 0x05)),
1216 OP3(ORREG1, ORXREG1, OWREG2),
1217 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1218 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1220 INSNE(mpyi, m_si_xsi_si, m, mpy, mpyi, C67X, 0,
1221 FIX1(FIX(op, 0x04)),
1222 OP3(ORREG14, ORXREG14, OWREG9),
1223 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1224 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1225 INSNE(mpyi, m_s5_xsi_si, m, mpy, mpyi, C67X, 0,
1226 FIX1(FIX(op, 0x06)),
1227 OP3(OACST, ORXREG14, OWREG9),
1228 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1229 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1231 INSNE(mpyid, m_si_xsi_sll, m, mpy, mpyid, C67X, 0,
1232 FIX1(FIX(op, 0x08)),
1233 OP3(ORREG14, ORXREG14, OWREGD910),
1234 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1235 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1236 INSNE(mpyid, m_s5_xsi_sll, m, mpy, mpyid, C67X, 0,
1237 FIX1(FIX(op, 0x0c)),
1238 OP3(OACST, ORXREG14, OWREGD910),
1239 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1240 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1242 INSN(mpyih, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
1243 FIX1(FIX(op, 0x14)),
1244 OP3(ORXREG1, ORREG1, OWREGD4),
1245 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1246 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1248 INSN(mpyihr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
1249 FIX1(FIX(op, 0x10)),
1250 OP3(ORXREG1, ORREG1, OWREG4),
1251 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1252 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1254 INSN(mpyil, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
1255 FIX1(FIX(op, 0x15)),
1256 OP3(ORXREG1, ORREG1, OWREGD4),
1257 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1258 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1260 INSN(mpyilr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
1261 FIX1(FIX(op, 0x0e)),
1262 OP3(ORXREG1, ORREG1, OWREG4),
1263 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1264 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1266 INSN(mpylh, m, mpy, 1616_m, C62X, 0,
1267 FIX1(FIX(op, 0x11)),
1268 OP3(ORREG1, ORXREG1, OWREG2),
1269 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1270 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1272 INSN(mpylhu, m, mpy, 1616_m, C62X, 0,
1273 FIX1(FIX(op, 0x17)),
1274 OP3(ORREG1, ORXREG1, OWREG2),
1275 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1276 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1278 INSN(mpyli, m, compound, 4cycle, C64X, 0,
1279 FIX1(FIX(op, 0x15)),
1280 OP3(ORREG1, ORXREG1, OWREGD4),
1281 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1282 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1284 INSN(mpylir, m, compound, 4cycle, C64X, 0,
1285 FIX1(FIX(op, 0x0e)),
1286 OP3(ORREG1, ORXREG1, OWREG4),
1287 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1288 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1290 INSN(mpylshu, m, mpy, 1616_m, C62X, 0,
1291 FIX1(FIX(op, 0x13)),
1292 OP3(ORREG1, ORXREG1, OWREG2),
1293 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1294 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1296 INSN(mpyluhs, m, mpy, 1616_m, C62X, 0,
1297 FIX1(FIX(op, 0x15)),
1298 OP3(ORREG1, ORXREG1, OWREG2),
1299 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1300 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1302 INSN(mpysp, m, mpy, 4cycle, C67X, 0,
1303 FIX1(FIX(op, 0x1c)),
1304 OP3(ORREG1, ORXREG1, OWREG4),
1305 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1306 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1308 /* Contrary to SPRU733A, MPYSPDP and MPYSP2DP are on both C67X and
1310 INSN(mpyspdp, m, compound, mpyspdp, C67X, 0,
1311 FIX1(FIX(op, 0x16)),
1312 OP3(ORREG12, ORXREGD12, OWREGD67),
1313 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1314 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1316 INSN(mpysp2dp, m, compound, mpyspdp, C67X, 0,
1317 FIX1(FIX(op, 0x17)),
1318 OP3(ORREG1, ORXREG1, OWREGD45),
1319 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1320 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1322 INSNE(mpysu, m_sl16_xul16_si, m, mpy, 1616_m, C62X, 0,
1323 FIX1(FIX(op, 0x1b)),
1324 OP3(ORREG1, ORXREG1, OWREG2),
1325 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1326 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1327 INSNE(mpysu, m_s5_xul16_si, m, mpy, 1616_m, C62X, 0,
1328 FIX1(FIX(op, 0x1e)),
1329 OP3(OACST, ORXREG1, OWREG2),
1330 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1331 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1333 INSN(mpysu4, m, compound, 4cycle, C64X, 0,
1334 FIX1(FIX(op, 0x05)),
1335 OP3(ORREG1, ORXREG1, OWREGD4),
1336 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1337 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1339 INSN(mpyu, m, mpy, 1616_m, C62X, 0,
1340 FIX1(FIX(op, 0x1f)),
1341 OP3(ORREG1, ORXREG1, OWREG2),
1342 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1343 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1345 INSN(mpyu4, m, compound, 4cycle, C64X, 0,
1346 FIX1(FIX(op, 0x04)),
1347 OP3(ORREG1, ORXREG1, OWREGD4),
1348 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1349 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1351 INSN(mpyus, m, mpy, 1616_m, C62X, 0,
1352 FIX1(FIX(op, 0x1d)),
1353 OP3(ORREG1, ORXREG1, OWREG2),
1354 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1355 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1357 INSN(mpyus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
1358 FIX1(FIX(op, 0x05)),
1359 OP3(ORXREG1, ORREG1, OWREGD4),
1360 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1361 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1363 INSN(mpy2, m, compound, 4cycle, C64X, 0,
1364 FIX1(FIX(op, 0x00)),
1365 OP3(ORREG1, ORXREG1, OWREGD4),
1366 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1367 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1369 INSN(mpy2ir, m, 1_or_2_src, 4cycle, C64XP, 0,
1370 FIX1(FIX(op, 0x0f)),
1371 OP3(ORREG1, ORXREG1, OWREGD4),
1372 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1373 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1375 INSNE(mpy32, 32_32_32, m, mpy, 4cycle, C64XP, 0,
1376 FIX1(FIX(op, 0x10)),
1377 OP3(ORREG1, ORXREG1, OWREG4),
1378 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1379 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1380 INSNE(mpy32, 32_32_64, m, mpy, 4cycle, C64XP, 0,
1381 FIX1(FIX(op, 0x14)),
1382 OP3(ORREG1, ORXREG1, OWREGD4),
1383 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1384 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1386 INSN(mpy32su, m, mpy, 4cycle, C64XP, 0,
1387 FIX1(FIX(op, 0x16)),
1388 OP3(ORREG1, ORXREG1, OWREGD4),
1389 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1390 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1392 INSN(mpy32u, m, compound, 4cycle, C64XP, 0,
1393 FIX1(FIX(op, 0x18)),
1394 OP3(ORREG1, ORXREG1, OWREGD4),
1395 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1396 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1398 INSN(mpy32us, m, compound, 4cycle, C64XP, 0,
1399 FIX1(FIX(op, 0x19)),
1400 OP3(ORREG1, ORXREG1, OWREGD4),
1401 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1402 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1404 /* "or" forms of "mv" are preferred over "add" forms when available
1405 because "or" uses less power. However, 40-bit moves are only
1406 available through "add", and before C64X D-unit moves are only
1407 available through "add" (without cross paths being available). */
1408 INSNE(mv, l_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
1409 FIX2(FIX(op, 0x7e), FIX(src1, 0)),
1410 OP2(ORXREG1, OWREG1),
1411 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1413 INSNE(mv, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
1414 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
1415 FIX3(FIX(op, 0x20), FIX(x, 0), FIX(src1, 0)),
1416 OP2(ORREGL1, OWREGL1),
1417 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
1418 INSNE(mv, s_xui_ui, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
1419 FIX2(FIX(op, 0x1a), FIX(src1, 0)),
1420 OP2(ORXREG1, OWREG1),
1421 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1423 INSNE(mv, d_si_si, d, 1_or_2_src, 1cycle, C62X,
1424 TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(0),
1425 FIX2(FIX(op, 0x12), FIX(src1, 0)),
1426 OP2(ORREG1, OWREG1),
1427 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
1428 INSNE(mv, d_xui_ui, d, ext_1_or_2_src, 1cycle, C64X,
1429 TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
1430 FIX2(FIX(op, 0x3), FIX(src1, 0)),
1431 OP2(ORXREG1, OWREG1),
1432 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1435 INSNE(mvc, from_cr, s, 1_or_2_src, 1cycle, C62X,
1436 TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_NO_CROSS,
1437 FIX3(FIX(s, 1), FIX(op, 0x0f), FIX(x, 0)),
1438 OP2(ORCREG1, OWREG1),
1439 ENC3(ENC(src1, crhi, 0), ENC(src2, crlo, 0), ENC(dst, reg, 1)))
1440 INSNE(mvc, to_cr, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_SIDE_B_ONLY,
1441 FIX2(FIX(s, 1), FIX(op, 0x0e)),
1442 OP2(ORXREG1, OWCREG1),
1443 ENC4(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, crhi, 1),
1446 INSN(mvd, m, unary, 4cycle, C64X, 0,
1447 FIX1(FIX(op, 0x1a)),
1448 OP2(ORXREG1, OWREG4),
1449 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1452 INSN(mvk, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1455 ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
1456 INSN(mvk, l, unary, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
1457 FIX2(FIX(x, 0), FIX(op, 0x05)),
1459 ENC3(ENC(s, fu, 0), ENC(src2, scst, 0), ENC(dst, reg, 1)))
1460 INSN(mvk, d, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
1461 FIX2(FIX(op, 0x00), FIX(src2, 0)),
1463 ENC3(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(dst, reg, 1)))
1465 INSN(mvkh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1468 ENC3(ENC(s, fu, 0), ENC(cst, lcst_high16, 0), ENC(dst, reg, 1)))
1470 INSN(mvklh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
1473 ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
1475 INSN(mvkl, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
1478 ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
1480 INSNE(neg, s_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
1481 FIX2(FIX(op, 0x16), FIX(src1, 0)),
1482 OP2(ORXREG1, OWREG1),
1483 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1485 INSNE(neg, l_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
1486 FIX2(FIX(op, 0x06), FIX(src1, 0)),
1487 OP2(ORXREG1, OWREG1),
1488 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1490 INSNE(neg, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
1491 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
1492 FIX2(FIX(op, 0x24), FIX(src1, 0)),
1493 OP2(ORREGL1, OWREGL1),
1494 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1497 INSN(nop, nfu, nop_idle, nop, C62X, 0,
1498 FIX2(FIX(s, 0), RAN(op, 0, 8)),
1500 ENC1(ENC(op, ucst_minus_one, 0)))
1501 INSNE(nop, 1, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MACRO,
1502 FIX2(FIX(s, 0), FIX(op, 0)),
1506 INSNE(norm, l_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
1507 FIX2(FIX(op, 0x63), FIX(src1, 0)),
1508 OP2(ORXREG1, OWREG1),
1509 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1511 INSNE(norm, l_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1512 FIX3(FIX(op, 0x60), FIX(x, 0), FIX(src1, 0)),
1513 OP2(ORREGL1, OWREG1),
1514 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
1516 INSN(not, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
1517 FIX2(FIX(op, 0x6e), FIX(src1, 0x1f)),
1518 OP2(ORXREG1, OWREG1),
1519 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1521 INSN(not, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
1522 FIX2(FIX(op, 0x0a), FIX(src1, 0x1f)),
1523 OP2(ORXREG1, OWREG1),
1524 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1526 INSN(not, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
1527 FIX2(FIX(op, 0xf), FIX(src1, 0x1f)),
1528 OP2(ORXREG1, OWREG1),
1529 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1532 INSNE(or, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
1534 OP3(ORREG1, ORXREG1, OWREG1),
1535 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1536 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1537 INSNE(or, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
1539 OP3(OACST, ORXREG1, OWREG1),
1540 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1541 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1542 INSNE(or, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
1543 FIX1(FIX(op, 0x7f)),
1544 OP3(ORREG1, ORXREG1, OWREG1),
1545 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1546 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1547 INSNE(or, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
1548 FIX1(FIX(op, 0x7e)),
1549 OP3(OACST, ORXREG1, OWREG1),
1550 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1551 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1552 INSNE(or, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
1553 FIX1(FIX(op, 0x1b)),
1554 OP3(ORREG1, ORXREG1, OWREG1),
1555 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1556 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1557 INSNE(or, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
1558 FIX1(FIX(op, 0x1a)),
1559 OP3(OACST, ORXREG1, OWREG1),
1560 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1561 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1563 INSN(pack2, l, 1_or_2_src, 1cycle, C64X, 0,
1565 OP3(ORREG1, ORXREG1, OWREG1),
1566 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1567 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1568 INSN(pack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
1570 OP3(ORREG1, ORXREG1, OWREG1),
1571 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1572 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1574 INSN(packh2, l, 1_or_2_src, 1cycle, C64X, 0,
1575 FIX1(FIX(op, 0x1e)),
1576 OP3(ORREG1, ORXREG1, OWREG1),
1577 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1578 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1579 INSN(packh2, s, 1_or_2_src, 1cycle, C64X, 0,
1581 OP3(ORREG1, ORXREG1, OWREG1),
1582 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1583 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1585 INSN(packh4, l, 1_or_2_src, 1cycle, C64X, 0,
1586 FIX1(FIX(op, 0x69)),
1587 OP3(ORREG1, ORXREG1, OWREG1),
1588 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1589 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1591 INSN(packhl2, l, 1_or_2_src, 1cycle, C64X, 0,
1592 FIX1(FIX(op, 0x1c)),
1593 OP3(ORREG1, ORXREG1, OWREG1),
1594 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1595 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1596 INSN(packhl2, s, 1_or_2_src, 1cycle, C64X, 0,
1598 OP3(ORREG1, ORXREG1, OWREG1),
1599 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1600 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1602 INSN(packlh2, l, 1_or_2_src, 1cycle, C64X, 0,
1603 FIX1(FIX(op, 0x1b)),
1604 OP3(ORREG1, ORXREG1, OWREG1),
1605 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1606 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1607 INSN(packlh2, s, 1_or_2_src, 1cycle, C64X, 0,
1608 FIX1(FIX(op, 0x10)),
1609 OP3(ORREG1, ORXREG1, OWREG1),
1610 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1611 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1613 INSN(packl4, l, 1_or_2_src, 1cycle, C64X, 0,
1614 FIX1(FIX(op, 0x68)),
1615 OP3(ORREG1, ORXREG1, OWREG1),
1616 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1617 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1619 INSN(rcpdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
1620 FIX3(FIX(op, 0x2d), FIX(x, 0), FIX(src1, 0)),
1621 OP2(ORREGD1, OWREGD12),
1622 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
1624 INSN(rcpsp, s, 1_or_2_src, 1cycle, C67X, 0,
1625 FIX2(FIX(op, 0x3d), FIX(src1, 0)),
1626 OP2(ORXREG1, OWREG1),
1627 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1630 INSN(ret, s, ext_branch_cond_imm, branch, C62X,
1631 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
1634 ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
1635 INSN(ret, s, branch, branch, C62X,
1636 TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
1639 ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
1640 INSN(ret, s, b_irp, branch, C62X,
1641 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
1642 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
1645 INSN(ret, s, b_nrp, branch, C62X,
1646 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
1647 FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
1651 INSN(retp, s, call_imm_nop, branch, C64XP,
1652 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
1654 OP2(OLCST, OWRETREG1),
1655 ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
1657 INSN(rint, nfu, rint, 1cycle, C64XP, 0,
1662 INSNE(rotl, m_ui_xui_ui, m, compound, 1616_m, C64X, 0,
1663 FIX1(FIX(op, 0x1d)),
1664 OP3(ORXREG1, ORREG1, OWREG2),
1665 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1666 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1667 INSNE(rotl, m_u5_xui_ui, m, compound, 1616_m, C64X, 0,
1668 FIX1(FIX(op, 0x1e)),
1669 OP3(ORXREG1, OACST, OWREG2),
1670 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1671 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1673 INSN(rpack2, s, ext_1_or_2_src_noncond, 1cycle, C64XP, 0,
1674 FIX2(FIX(op, 0xb), FIX(z, 1)),
1675 OP3(ORREG1, ORXREG1, OWREG1),
1676 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1677 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1679 INSN(rsqrdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
1680 FIX3(FIX(op, 0x2e), FIX(x, 0), FIX(src1, 0)),
1681 OP2(ORREGD1, OWREGD12),
1682 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
1684 INSN(rsqrsp, s, 1_or_2_src, 1cycle, C67X, 0,
1685 FIX2(FIX(op, 0x3e), FIX(src1, 0)),
1686 OP2(ORXREG1, OWREG1),
1687 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1690 INSNE(sadd, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
1691 FIX1(FIX(op, 0x13)),
1692 OP3(ORREG1, ORXREG1, OWREG1),
1693 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1694 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1695 INSNE(sadd, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
1696 FIX1(FIX(op, 0x31)),
1697 OP3(ORXREG1, ORREGL1, OWREGL1),
1698 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1699 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1700 INSNE(sadd, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
1701 FIX1(FIX(op, 0x12)),
1702 OP3(OACST, ORXREG1, OWREG1),
1703 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1704 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1705 INSNE(sadd, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1706 FIX1(FIX(op, 0x30)),
1707 OP3(OACST, ORREGL1, OWREGL1),
1708 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
1709 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1710 INSNE(sadd, s_si_xsi_si, s, 1_or_2_src, 1cycle, C64X, 0,
1711 FIX1(FIX(op, 0x20)),
1712 OP3(ORREG1, ORXREG1, OWREG1),
1713 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1714 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1716 INSN(sadd2, s, ext_1_or_2_src, 1cycle, C64X, 0,
1718 OP3(ORREG1, ORXREG1, OWREG1),
1719 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1720 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1722 INSN(saddsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
1723 FIX1(FIX(op, 0x0e)),
1724 OP3(ORREG1, ORXREG1, OWREGD1),
1725 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1726 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1728 INSN(saddsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
1729 FIX1(FIX(op, 0x0f)),
1730 OP3(ORREG1, ORXREG1, OWREGD1),
1731 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1732 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1734 INSN(saddsu2, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
1736 OP3(ORXREG1, ORREG1, OWREG1),
1737 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1738 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1740 INSN(saddus2, s, ext_1_or_2_src, 1cycle, C64X, 0,
1742 OP3(ORREG1, ORXREG1, OWREG1),
1743 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1744 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1746 INSN(saddu4, s, ext_1_or_2_src, 1cycle, C64X, 0,
1748 OP3(ORREG1, ORXREG1, OWREG1),
1749 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1750 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1752 INSN(sat, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1753 FIX3(FIX(op, 0x40), FIX(x, 0), FIX(src1, 0)),
1754 OP2(ORREGL1, OWREG1),
1755 ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
1757 INSN(set, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1759 OP4(ORREG1, OACST, OACST, OWREG1),
1760 ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
1761 ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
1762 INSN(set, s, 1_or_2_src, 1cycle, C62X, 0,
1763 FIX1(FIX(op, 0x3b)),
1764 OP3(ORXREG1, ORREG1, OWREG1),
1765 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1766 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1768 INSN(shfl, m, unary, 1616_m, C64X, 0,
1769 FIX1(FIX(op, 0x1c)),
1770 OP2(ORXREG1, OWREG2),
1771 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1774 INSN(shfl3, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
1775 FIX1(FIX(op, 0x36)),
1776 OP3(ORREG1, ORXREG1, OWREGD1),
1777 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1778 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1780 INSNE(shl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
1781 FIX1(FIX(op, 0x33)),
1782 OP3(ORXREG1, ORREG1, OWREG1),
1783 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1784 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1785 INSNE(shl, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1786 FIX2(FIX(op, 0x31), FIX(x, 0)),
1787 OP3(ORREGL1, ORREG1, OWREGL1),
1788 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
1790 INSNE(shl, s_xui_ui_ul, s, 1_or_2_src, 1cycle, C62X, 0,
1791 FIX1(FIX(op, 0x13)),
1792 OP3(ORXREG1, ORREG1, OWREGL1),
1793 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1794 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1795 INSNE(shl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
1796 FIX1(FIX(op, 0x32)),
1797 OP3(ORXREG1, OACST, OWREG1),
1798 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1799 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1800 INSNE(shl, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1801 FIX2(FIX(op, 0x30), FIX(x, 0)),
1802 OP3(ORREGL1, OACST, OWREGL1),
1803 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
1805 INSNE(shl, s_xui_u5_ul, s, 1_or_2_src, 1cycle, C62X, 0,
1806 FIX1(FIX(op, 0x12)),
1807 OP3(ORXREG1, OACST, OWREGL1),
1808 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1809 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1811 INSN(shlmb, l, 1_or_2_src, 1cycle, C64X, 0,
1812 FIX1(FIX(op, 0x61)),
1813 OP3(ORREG1, ORXREG1, OWREG1),
1814 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1815 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1816 INSN(shlmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
1818 OP3(ORREG1, ORXREG1, OWREG1),
1819 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1820 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1822 INSNE(shr, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
1823 FIX1(FIX(op, 0x37)),
1824 OP3(ORXREG1, ORREG1, OWREG1),
1825 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1826 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1827 INSNE(shr, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1828 FIX2(FIX(op, 0x35), FIX(x, 0)),
1829 OP3(ORREGL1, ORREG1, OWREGL1),
1830 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
1832 INSNE(shr, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
1833 FIX1(FIX(op, 0x36)),
1834 OP3(ORXREG1, OACST, OWREG1),
1835 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1836 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1837 INSNE(shr, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1838 FIX2(FIX(op, 0x34), FIX(x, 0)),
1839 OP3(ORREGL1, OACST, OWREGL1),
1840 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
1843 INSNE(shr2, s_xs2_ui_s2, s, ext_1_or_2_src, 1cycle, C64X, 0,
1845 OP3(ORXREG1, ORREG1, OWREG1),
1846 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1847 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1848 INSNE(shr2, s_xs2_u5_s2, s, 1_or_2_src, 1cycle, C64X, 0,
1849 FIX1(FIX(op, 0x18)),
1850 OP3(ORXREG1, OACST, OWREG1),
1851 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1852 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1854 INSN(shrmb, l, 1_or_2_src, 1cycle, C64X, 0,
1855 FIX1(FIX(op, 0x62)),
1856 OP3(ORREG1, ORXREG1, OWREG1),
1857 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1858 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1859 INSN(shrmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
1861 OP3(ORREG1, ORXREG1, OWREG1),
1862 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1863 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1865 INSNE(shru, s_xui_ui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
1866 FIX1(FIX(op, 0x27)),
1867 OP3(ORXREG1, ORREG1, OWREG1),
1868 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1869 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1870 INSNE(shru, s_ul_ui_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1871 FIX2(FIX(op, 0x25), FIX(x, 0)),
1872 OP3(ORREGL1, ORREG1, OWREGL1),
1873 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
1875 INSNE(shru, s_xui_u5_ui, s, 1_or_2_src, 1cycle, C62X, 0,
1876 FIX1(FIX(op, 0x26)),
1877 OP3(ORXREG1, OACST, OWREG1),
1878 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1879 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1880 INSNE(shru, s_ul_u5_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
1881 FIX2(FIX(op, 0x24), FIX(x, 0)),
1882 OP3(ORREGL1, OACST, OWREGL1),
1883 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
1886 INSNE(shru2, s_xu2_ui_u2, s, ext_1_or_2_src, 1cycle, C64X, 0,
1888 OP3(ORXREG1, ORREG1, OWREG1),
1889 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1890 ENC(src1, reg, 1), ENC(dst, reg, 2)))
1891 INSNE(shru2, s_xu2_u5_u2, s, 1_or_2_src, 1cycle, C64X, 0,
1892 FIX1(FIX(op, 0x19)),
1893 OP3(ORXREG1, OACST, OWREG1),
1894 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1895 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
1897 INSN(sl, d, 1_or_2_src, store, C64XP,
1898 TIC6X_FLAG_STORE|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
1899 FIX3(FIX(s, 1), FIX(op, 0xd), FIX(src1, 0)),
1900 OP2(ORDREG1, OWMEMDW),
1901 ENC2(ENC(dst, reg, 0), ENC(src2, reg, 1)))
1903 INSN(smpy, m, mpy, 1616_m, C62X, 0,
1904 FIX1(FIX(op, 0x1a)),
1905 OP3(ORREG1, ORXREG1, OWREG2),
1906 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1907 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1909 INSN(smpyh, m, mpy, 1616_m, C62X, 0,
1910 FIX1(FIX(op, 0x02)),
1911 OP3(ORREG1, ORXREG1, OWREG2),
1912 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1913 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1915 INSN(smpyhl, m, mpy, 1616_m, C62X, 0,
1916 FIX1(FIX(op, 0x0a)),
1917 OP3(ORREG1, ORXREG1, OWREG2),
1918 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1919 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1921 INSN(smpylh, m, mpy, 1616_m, C62X, 0,
1922 FIX1(FIX(op, 0x12)),
1923 OP3(ORREG1, ORXREG1, OWREG2),
1924 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1925 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1927 INSN(smpy2, m, compound, 4cycle, C64X, 0,
1928 FIX1(FIX(op, 0x01)),
1929 OP3(ORREG1, ORXREG1, OWREGD4),
1930 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1931 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1933 /* Contrary to SPRUFE8, this is the correct operand order for this
1935 INSN(smpy32, m, 1_or_2_src, 4cycle, C64XP, 0,
1936 FIX1(FIX(op, 0x19)),
1937 OP3(ORREG1, ORXREG1, OWREG4),
1938 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1939 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1941 INSN(spack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
1943 OP3(ORREG1, ORXREG1, OWREG1),
1944 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1945 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1947 INSN(spacku4, s, ext_1_or_2_src, 1cycle, C64X, 0,
1949 OP3(ORREG1, ORXREG1, OWREG1),
1950 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
1951 ENC(src2, reg, 1), ENC(dst, reg, 2)))
1953 INSN(spdp, s, 1_or_2_src, 2cycle_dp, C67X, 0,
1954 FIX2(FIX(op, 0x02), FIX(src1, 0)),
1955 OP2(ORXREG1, OWREGD12),
1956 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1959 INSN(spint, l, 1_or_2_src, 4cycle, C67X, 0,
1960 FIX2(FIX(op, 0x0a), FIX(src1, 0)),
1961 OP2(ORXREG1, OWREG4),
1962 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
1965 INSNE(spkernel, nfu_2, nfu, spkernel, 1cycle, C64XP,
1966 TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
1969 ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
1970 INSNE(spkernel, nfu_0, nfu, spkernel, 1cycle, C64XP,
1971 TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL|TIC6X_FLAG_MACRO,
1972 FIX2(FIX(s, 0), FIX(fstgfcyc, 0)),
1976 INSN(spkernelr, nfu, spkernelr, 1cycle, C64XP,
1977 TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
1982 INSN(sploop, nfu, loop_buffer, 1cycle, C64XP,
1983 TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
1984 FIX4(FIX(s, 0), FIX(op, 0xc), FIX(csta, 0), RAN(cstb, 0, 13)),
1986 ENC1(ENC(cstb, ucst_minus_one, 0)))
1988 INSN(sploopd, nfu, loop_buffer, 1cycle, C64XP,
1989 TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
1990 FIX4(FIX(s, 0), FIX(op, 0xd), FIX(csta, 0), RAN(cstb, 0, 13)),
1992 ENC1(ENC(cstb, ucst_minus_one, 0)))
1994 INSN(sploopw, nfu, loop_buffer, 1cycle, C64XP,
1995 TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
1996 FIX4(FIX(s, 0), FIX(op, 0xf), FIX(csta, 0), RAN(cstb, 0, 13)),
1998 ENC1(ENC(cstb, ucst_minus_one, 0)))
2000 /* Contrary to SPRUFE8, this is the correct encoding for this
2002 INSN(spmask, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
2003 FIX2(FIX(s, 0), FIX(op, 0x8)),
2005 ENC1(ENC(mask, spmask, 0)))
2007 INSN(spmaskr, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
2008 FIX2(FIX(s, 0), FIX(op, 0x9)),
2010 ENC1(ENC(mask, spmask, 0)))
2012 INSN(sptrunc, l, 1_or_2_src, 4cycle, C67X, 0,
2013 FIX2(FIX(op, 0x0b), FIX(src1, 0)),
2014 OP2(ORXREG1, OWREG4),
2015 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2018 INSNE(sshl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
2019 FIX1(FIX(op, 0x23)),
2020 OP3(ORXREG1, ORREG1, OWREG1),
2021 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2022 ENC(src1, reg, 1), ENC(dst, reg, 2)))
2023 INSNE(sshl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
2024 FIX1(FIX(op, 0x22)),
2025 OP3(ORXREG1, OACST, OWREG1),
2026 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2027 ENC(src1, ucst, 1), ENC(dst, reg, 2)))
2029 INSN(sshvl, m, compound, 1616_m, C64X, 0,
2030 FIX1(FIX(op, 0x1c)),
2031 OP3(ORXREG1, ORREG1, OWREG2),
2032 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2033 ENC(src1, reg, 1), ENC(dst, reg, 2)))
2035 /* Contrary to SPRUFE8, this is the correct encoding for this
2037 INSN(sshvr, m, compound, 1616_m, C64X, 0,
2038 FIX1(FIX(op, 0x1a)),
2039 OP3(ORXREG1, ORREG1, OWREG2),
2040 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2041 ENC(src1, reg, 1), ENC(dst, reg, 2)))
2043 INSNE(ssub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
2044 FIX1(FIX(op, 0x0f)),
2045 OP3(ORREG1, ORXREG1, OWREG1),
2046 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2047 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2048 INSNE(ssub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
2049 FIX1(FIX(op, 0x1f)),
2050 OP3(ORXREG1, ORREG1, OWREG1),
2051 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2052 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2053 INSNE(ssub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
2054 FIX1(FIX(op, 0x0e)),
2055 OP3(OACST, ORXREG1, OWREG1),
2056 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2057 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2058 INSNE(ssub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2059 FIX1(FIX(op, 0x2c)),
2060 OP3(OACST, ORREGL1, OWREGL1),
2061 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2062 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2064 INSN(ssub2, l, 1_or_2_src, 1cycle, C64XP, 0,
2065 FIX1(FIX(op, 0x64)),
2066 OP3(ORREG1, ORXREG1, OWREG1),
2067 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2068 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2070 INSN(stb, d, load_store, store, C62X,
2071 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
2072 FIX2(FIX(op, 3), FIX(r, 0)),
2073 OP2(ORDREG1, OWMEMSB),
2074 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
2075 ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
2076 ENC(srcdst, reg, 0)))
2077 INSN(stb, d, load_store_long, store, C62X,
2078 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
2080 OP2(ORDREG1, OWMEMLB),
2081 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_byte, 1),
2084 INSN(stdw, d, load_store, store, C64X, TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS,
2085 FIX2(FIX(op, 4), FIX(r, 1)),
2086 OP2(ORDREGD1, OWMEMSD),
2087 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
2088 ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
2089 ENC(srcdst, reg, 0)))
2091 INSN(sth, d, load_store, store, C62X,
2092 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
2093 FIX2(FIX(op, 5), FIX(r, 0)),
2094 OP2(ORDREG1, OWMEMSH),
2095 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
2096 ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
2097 ENC(srcdst, reg, 0)))
2098 INSN(sth, d, load_store_long, store, C62X,
2099 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
2101 OP2(ORDREG1, OWMEMLH),
2102 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_half, 1),
2105 INSN(stndw, d, store_nonaligned, store, C64X,
2106 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
2108 OP2(ORDREGD1, OWMEMND),
2109 ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
2110 ENC(offsetR, mem_offset_noscale, 1), ENC(baseR, reg, 1),
2111 ENC(sc, scaled, 1), ENC(src, reg_shift, 0)))
2113 INSN(stnw, d, load_store, store, C64X,
2114 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
2115 FIX2(FIX(op, 5), FIX(r, 1)),
2116 OP2(ORDREG1, OWMEMSW),
2117 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
2118 ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
2119 ENC(srcdst, reg, 0)))
2121 INSN(stw, d, load_store, store, C62X,
2122 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
2123 FIX2(FIX(op, 7), FIX(r, 0)),
2124 OP2(ORDREG1, OWMEMSW),
2125 ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
2126 ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
2127 ENC(srcdst, reg, 0)))
2128 INSN(stw, d, load_store_long, store, C62X,
2129 TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
2131 OP2(ORDREG1, OWMEMLW),
2132 ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_word, 1),
2135 INSNE(sub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
2136 FIX1(FIX(op, 0x07)),
2137 OP3(ORREG1, ORXREG1, OWREG1),
2138 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2139 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2140 INSNE(sub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
2141 FIX1(FIX(op, 0x17)),
2142 OP3(ORXREG1, ORREG1, OWREG1),
2143 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2144 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2145 INSNE(sub, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
2146 FIX1(FIX(op, 0x27)),
2147 OP3(ORREG1, ORXREG1, OWREGL1),
2148 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2149 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2150 INSNE(sub, l_xsi_si_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
2151 FIX1(FIX(op, 0x37)),
2152 OP3(ORXREG1, ORREG1, OWREGL1),
2153 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2154 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2155 INSNE(sub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
2156 FIX1(FIX(op, 0x06)),
2157 OP3(OACST, ORXREG1, OWREG1),
2158 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2159 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2160 INSNE(sub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2161 FIX1(FIX(op, 0x24)),
2162 OP3(OACST, ORREGL1, OWREGL1),
2163 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2164 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2165 INSNE(sub, l_xsi_s5_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
2167 OP3(ORXREG1, OACST, OWREG1),
2168 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
2169 ENC(src2, reg, 0), ENC(dst, reg, 2)))
2170 INSNE(sub, l_sl_s5_sl, l, 1_or_2_src, 1cycle, C62X,
2171 TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
2172 FIX2(FIX(op, 0x20), FIX(x, 0)),
2173 OP3(ORREGL1, OACST, OWREGL1),
2174 ENC4(ENC(s, fu, 0), ENC(src1, scst_negate, 1), ENC(src2, reg, 0),
2176 INSNE(sub, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
2177 FIX1(FIX(op, 0x17)),
2178 OP3(ORREG1, ORXREG1, OWREG1),
2179 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2180 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2181 INSNE(sub, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
2182 FIX1(FIX(op, 0x16)),
2183 OP3(OACST, ORXREG1, OWREG1),
2184 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2185 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2186 /* Contrary to SPRUFE8, this is the correct encoding for this
2187 instruction; this instruction can be predicated. */
2188 INSNE(sub, s_xsi_si_si, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
2190 OP3(ORXREG1, ORREG1, OWREG1),
2191 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2192 ENC(src1, reg, 1), ENC(dst, reg, 2)))
2193 INSNE(sub, s_xsi_s5_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
2195 OP3(ORXREG1, OACST, OWREG1),
2196 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
2197 ENC(src2, reg, 0), ENC(dst, reg, 2)))
2198 INSNE(sub, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
2199 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
2200 FIX1(FIX(op, 0x11)),
2201 OP3(ORREG1, ORREG1, OWREG1),
2202 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
2204 INSNE(sub, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2205 FIX1(FIX(op, 0x13)),
2206 OP3(ORREG1, OACST, OWREG1),
2207 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
2209 INSNE(sub, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
2211 OP3(ORREG1, ORXREG1, OWREG1),
2212 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2213 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2215 INSNE(subab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2216 FIX1(FIX(op, 0x31)),
2217 OP3(ORREG1, ORREG1, OWREG1),
2218 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
2220 INSNE(subab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2221 FIX1(FIX(op, 0x33)),
2222 OP3(ORREG1, OACST, OWREG1),
2223 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
2226 INSN(subabs4, l, 1_or_2_src, 1cycle, C64X, 0,
2227 FIX1(FIX(op, 0x5a)),
2228 OP3(ORREG1, ORXREG1, OWREG1),
2229 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2230 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2232 INSNE(subah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2233 FIX1(FIX(op, 0x35)),
2234 OP3(ORREG1, ORREG1, OWREG1),
2235 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
2237 INSNE(subah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2238 FIX1(FIX(op, 0x37)),
2239 OP3(ORREG1, OACST, OWREG1),
2240 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
2243 INSNE(subaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2244 FIX1(FIX(op, 0x39)),
2245 OP3(ORREG1, ORREG1, OWREG1),
2246 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
2248 INSNE(subaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
2249 FIX1(FIX(op, 0x3b)),
2250 OP3(ORREG1, OACST, OWREG1),
2251 ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
2254 INSN(subc, l, 1_or_2_src, 1cycle, C62X, 0,
2255 FIX1(FIX(op, 0x4b)),
2256 OP3(ORREG1, ORXREG1, OWREG1),
2257 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2258 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2260 INSNE(subdp, l_dp_xdp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(1),
2261 FIX1(FIX(op, 0x19)),
2262 OP3(ORREGD12, ORXREGD12, OWREGD67),
2263 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2264 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2265 INSNE(subdp, l_xdp_dp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(0),
2266 FIX1(FIX(op, 0x1d)),
2267 OP3(ORXREGD12, ORREGD12, OWREGD67),
2268 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2269 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2270 INSNE(subdp, s_dp_xdp_dp, s, l_1_or_2_src, addsubdp, C67XP,
2271 TIC6X_FLAG_PREFER(1),
2272 FIX1(FIX(op, 0x73)),
2273 OP3(ORREGD12, ORXREGD12, OWREGD67),
2274 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2275 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2276 INSNE(subdp, s_xdp_dp_dp, s, l_1_or_2_src, addsubdp, C67XP,
2277 TIC6X_FLAG_PREFER(0),
2278 FIX1(FIX(op, 0x77)),
2279 OP3(ORXREGD12, ORREGD12, OWREGD67),
2280 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2281 ENC(src1, reg, 1), ENC(dst, reg, 2)))
2283 INSNE(subsp, l_sp_xsp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(1),
2284 FIX1(FIX(op, 0x11)),
2285 OP3(ORREG1, ORXREG1, OWREG4),
2286 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2287 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2288 INSNE(subsp, l_xsp_sp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(0),
2289 FIX1(FIX(op, 0x15)),
2290 OP3(ORXREG1, ORREG1, OWREG4),
2291 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2292 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2293 INSNE(subsp, s_sp_xsp_sp, s, l_1_or_2_src, 4cycle, C67XP,
2294 TIC6X_FLAG_PREFER(1),
2295 FIX1(FIX(op, 0x71)),
2296 OP3(ORREG1, ORXREG1, OWREG4),
2297 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2298 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2299 INSNE(subsp, s_xsp_sp_sp, s, l_1_or_2_src, 4cycle, C67XP,
2300 TIC6X_FLAG_PREFER(0),
2301 FIX1(FIX(op, 0x75)),
2302 OP3(ORXREG1, ORREG1, OWREG4),
2303 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2304 ENC(src1, reg, 1), ENC(dst, reg, 2)))
2306 INSNE(subu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
2307 FIX1(FIX(op, 0x2f)),
2308 OP3(ORREG1, ORXREG1, OWREGL1),
2309 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2310 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2311 INSNE(subu, l_xui_ui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
2312 FIX1(FIX(op, 0x3f)),
2313 OP3(ORXREG1, ORREG1, OWREGL1),
2314 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2315 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2317 INSN(sub2, l, 1_or_2_src, 1cycle, C64X, 0,
2318 FIX1(FIX(op, 0x04)),
2319 OP3(ORREG1, ORXREG1, OWREG1),
2320 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2321 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2322 INSN(sub2, s, 1_or_2_src, 1cycle, C62X, 0,
2323 FIX1(FIX(op, 0x11)),
2324 OP3(ORREG1, ORXREG1, OWREG1),
2325 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2326 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2327 INSN(sub2, d, ext_1_or_2_src, 1cycle, C64X, 0,
2329 OP3(ORREG1, ORXREG1, OWREG1),
2330 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2331 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2333 INSN(sub4, l, 1_or_2_src, 1cycle, C64X, 0,
2334 FIX1(FIX(op, 0x66)),
2335 OP3(ORREG1, ORXREG1, OWREG1),
2336 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2337 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2339 INSN(swap2, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
2340 FIX2(FIX(op, 0x1b), FIX(x, 0)),
2341 OP2(ORREG1, OWREG1),
2342 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2343 ENC(src2, reg, 0), ENC(dst, reg, 1)))
2344 INSN(swap2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
2345 FIX2(FIX(op, 0x10), FIX(x, 0)),
2346 OP2(ORREG1, OWREG1),
2347 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2348 ENC(src2, reg, 0), ENC(dst, reg, 1)))
2350 /* Contrary to SPRUFE8, this is the correct encoding for this
2352 INSN(swap4, l, unary, 1cycle, C64X, 0,
2354 OP2(ORXREG1, OWREG1),
2355 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2358 INSN(swe, nfu, swe, 1cycle, C64XP, 0,
2363 INSN(swenr, nfu, swenr, 1cycle, C64XP, 0,
2368 INSN(unpkhu4, l, unary, 1cycle, C64X, 0,
2369 FIX1(FIX(op, 0x03)),
2370 OP2(ORXREG1, OWREG1),
2371 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2373 INSN(unpkhu4, s, unary, 1cycle, C64X, 0,
2374 FIX1(FIX(op, 0x03)),
2375 OP2(ORXREG1, OWREG1),
2376 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2379 INSN(unpklu4, l, unary, 1cycle, C64X, 0,
2380 FIX1(FIX(op, 0x02)),
2381 OP2(ORXREG1, OWREG1),
2382 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2384 INSN(unpklu4, s, unary, 1cycle, C64X, 0,
2385 FIX1(FIX(op, 0x02)),
2386 OP2(ORXREG1, OWREG1),
2387 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2390 INSNE(xor, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
2391 FIX1(FIX(op, 0x6f)),
2392 OP3(ORREG1, ORXREG1, OWREG1),
2393 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2394 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2395 INSNE(xor, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
2396 FIX1(FIX(op, 0x6e)),
2397 OP3(OACST, ORXREG1, OWREG1),
2398 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2399 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2400 INSNE(xor, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
2401 FIX1(FIX(op, 0x0b)),
2402 OP3(ORREG1, ORXREG1, OWREG1),
2403 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2404 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2405 INSNE(xor, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
2406 FIX1(FIX(op, 0x0a)),
2407 OP3(OACST, ORXREG1, OWREG1),
2408 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2409 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2410 INSNE(xor, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
2412 OP3(ORREG1, ORXREG1, OWREG1),
2413 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2414 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2415 INSNE(xor, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
2417 OP3(OACST, ORXREG1, OWREG1),
2418 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
2419 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2421 INSN(xormpy, m, 1_or_2_src, 4cycle, C64XP, 0,
2422 FIX1(FIX(op, 0x1b)),
2423 OP3(ORREG1, ORXREG1, OWREG4),
2424 ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2425 ENC(src2, reg, 1), ENC(dst, reg, 2)))
2427 INSN(xpnd2, m, unary, 1616_m, C64X, 0,
2428 FIX1(FIX(op, 0x19)),
2429 OP2(ORXREG1, OWREG2),
2430 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2433 INSN(xpnd4, m, unary, 1616_m, C64X, 0,
2434 FIX1(FIX(op, 0x18)),
2435 OP2(ORXREG1, OWREG2),
2436 ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
2439 INSN(zero, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
2440 FIX2(FIX(h, 0), FIX(cst, 0)),
2442 ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
2443 INSN(zero, l, unary, 1cycle, C64X,
2444 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
2445 FIX3(FIX(x, 0), FIX(op, 0x05), FIX(src2, 0)),
2447 ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
2448 INSNE(zero, l_sub, l, 1_or_2_src, 1cycle, C62X,
2449 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
2450 FIX2(FIX(op, 0x07), FIX(x, 0)),
2452 ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
2454 INSNE(zero, l_sub_sl, l, 1_or_2_src, 1cycle, C62X,
2455 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
2456 FIX2(FIX(op, 0x27), FIX(x, 0)),
2458 ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
2460 INSNE(zero, d_mvk, d, 1_or_2_src, 1cycle, C64X,
2461 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
2462 FIX3(FIX(op, 0x00), FIX(src1, 0), FIX(src2, 0)),
2464 ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
2465 INSNE(zero, d_sub, d, 1_or_2_src, 1cycle, C62X,
2466 TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
2467 FIX1(FIX(op, 0x11)),
2469 ENC4(ENC(s, fu, 0), ENC(src2, reg_unused, 0), ENC(src1, reg_unused, 0),
2472 #undef TIC6X_INSN_C64X_AND_C67X
2473 #undef tic6x_insn_format_nfu_s_branch_nop_cst
2474 #undef tic6x_insn_format_s_l_1_or_2_src