xref: /netbsd-src/external/gpl3/binutils/dist/include/opcode/tic6x-opcode-table.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
145548106Schristos /* TI C6X opcode table.
2*cb63e24eSchristos    Copyright (C) 2010-2024 Free Software Foundation, Inc.
345548106Schristos 
445548106Schristos    This program is free software; you can redistribute it and/or modify
545548106Schristos    it under the terms of the GNU General Public License as published by
645548106Schristos    the Free Software Foundation; either version 3 of the License, or
745548106Schristos    (at your option) any later version.
845548106Schristos 
945548106Schristos    This program is distributed in the hope that it will be useful,
1045548106Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1145548106Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1245548106Schristos    GNU General Public License for more details.
1345548106Schristos 
1445548106Schristos    You should have received a copy of the GNU General Public License
1545548106Schristos    along with this program; if not, write to the Free Software
1645548106Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1745548106Schristos    MA 02110-1301, USA.  */
1845548106Schristos 
1945548106Schristos /* Define the INSN macro before including this file; it takes as
2045548106Schristos    arguments the fields from tic6x_opcode (defined in tic6x.h).  The
2145548106Schristos    name is given as an identifier; the subsequent four operands should
2245548106Schristos    have "tic6x_func_unit_", "tic6x_insn_format_", "tic6x_pipeline_"
2345548106Schristos    and "TIC6X_INSN_", respectively, prepended to them by the macro
2445548106Schristos    definition.  Also define INSNE, which has a second argument that
2545548106Schristos    goes after tic6x_opcode_NAME_ to form the enumeration value for
2645548106Schristos    this instruction, where the value otherwise formed from the name,
2745548106Schristos    functional unit and format is ambiguous, but otherwise has the same
2845548106Schristos    arguments as INSN.  */
2945548106Schristos 
3045548106Schristos #define TIC6X_INSN_C64X_AND_C67X TIC6X_INSN_C64X|TIC6X_INSN_C67X
3145548106Schristos #define tic6x_insn_format_nfu_s_branch_nop_cst	\
3245548106Schristos   tic6x_insn_format_s_branch_nop_cst
3345548106Schristos #define tic6x_insn_format_s_l_1_or_2_src tic6x_insn_format_l_1_or_2_src
3445548106Schristos #define RAN(id, min, max) { CONCAT2(tic6x_field_,id), (min), (max) }
3545548106Schristos #define FIX(id, val) RAN(id, val, val)
3645548106Schristos #define FIX0() 0, { { 0, 0, 0 } }
3745548106Schristos #define FIX1(a) 1, { a }
3845548106Schristos #define FIX2(a, b) 2, { a, b }
3945548106Schristos #define FIX3(a, b, c) 3, { a, b, c }
4045548106Schristos #define FIX4(a, b, c, d) 4, { a, b, c, d }
414f645668Schristos #define OP0() 0, { { 0, 0, false, 0, 0, 0, 0 } }
4245548106Schristos #define OP1(a) 1, { a }
4345548106Schristos #define OP2(a, b) 2, { a, b }
4445548106Schristos #define OP3(a, b, c) 3, { a, b, c }
4545548106Schristos #define OP4(a, b, c, d) 4, { a, b, c, d }
4645548106Schristos #define OACST { tic6x_operand_asm_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
4745548106Schristos #define OLCST { tic6x_operand_link_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
489573673dSchristos #define OHWCSTM1 { tic6x_operand_hw_const_minus_1, 0, tic6x_rw_none, 0, 0, 0, 0 }
499573673dSchristos #define OHWCST0 { tic6x_operand_hw_const_0, 0, tic6x_rw_none, 0, 0, 0, 0 }
509573673dSchristos #define OHWCST1 { tic6x_operand_hw_const_1, 0, tic6x_rw_none, 0, 0, 0, 0 }
519573673dSchristos #define OHWCST5 { tic6x_operand_hw_const_5, 0, tic6x_rw_none, 0, 0, 0, 0 }
529573673dSchristos #define OHWCST16 { tic6x_operand_hw_const_16, 0, tic6x_rw_none, 0, 0, 0, 0 }
539573673dSchristos #define OHWCST24 { tic6x_operand_hw_const_24, 0, tic6x_rw_none, 0, 0, 0, 0 }
549573673dSchristos #define OHWCST31 { tic6x_operand_hw_const_31, 0, tic6x_rw_none, 0, 0, 0, 0 }
5545548106Schristos #define OFULIST { tic6x_operand_func_unit, 0, tic6x_rw_none, 0, 0, 0, 0 }
5645548106Schristos #define ORIRP1 { tic6x_operand_irp, 4, tic6x_rw_read, 1, 1, 0, 0 }
5745548106Schristos #define ORNRP1 { tic6x_operand_nrp, 4, tic6x_rw_read, 1, 1, 0, 0 }
5845548106Schristos #define OWREG1 { tic6x_operand_reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
599573673dSchristos #define OWREG1Z { tic6x_operand_zreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
609573673dSchristos #define OWREG1NORS { tic6x_operand_reg_nors, 4, tic6x_rw_write, 1, 1, 0, 0 }
619573673dSchristos #define ORREG1B { tic6x_operand_reg_bside, 4, tic6x_rw_write, 1, 1, 0, 0 }
629573673dSchristos #define ORREG1BNORS { tic6x_operand_reg_bside_nors, 4, tic6x_rw_write, 1, 1, 0, 0 }
6345548106Schristos #define OWRETREG1 { tic6x_operand_retreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
6445548106Schristos #define ORREG1 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
6545548106Schristos #define ORDREG1 { tic6x_operand_dreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
669573673dSchristos #define ORTREG1 { tic6x_operand_treg, 4, tic6x_rw_read, 1, 1, 0, 0 }
6745548106Schristos #define ORWREG1 { tic6x_operand_reg, 4, tic6x_rw_read_write, 1, 1, 0, 0 }
689573673dSchristos #define ORB15REG1 { tic6x_operand_b15reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
699573673dSchristos #define OWB15REG1 { tic6x_operand_b15reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
7045548106Schristos #define ORAREG1 { tic6x_operand_areg, 4, tic6x_rw_read, 1, 1, 0, 0 }
7145548106Schristos #define ORXREG1 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
7245548106Schristos #define ORREG12 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 2, 0, 0 }
7345548106Schristos #define ORREG14 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 4, 0, 0 }
7445548106Schristos #define ORXREG14 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 4, 0, 0 }
7545548106Schristos #define OWREG2 { tic6x_operand_reg, 4, tic6x_rw_write, 2, 2, 0, 0 }
7645548106Schristos #define OWREG4 { tic6x_operand_reg, 4, tic6x_rw_write, 4, 4, 0, 0 }
7745548106Schristos #define OWREG9 { tic6x_operand_reg, 4, tic6x_rw_write, 9, 9, 0, 0 }
7845548106Schristos #define OWDREG5 { tic6x_operand_dreg, 4, tic6x_rw_write, 5, 5, 0, 0 }
799573673dSchristos #define OWTREG5 { tic6x_operand_treg, 4, tic6x_rw_write, 5, 5, 0, 0 }
8045548106Schristos #define OWREGL1 { tic6x_operand_regpair, 5, tic6x_rw_write, 1, 1, 1, 1 }
8145548106Schristos #define ORREGL1 { tic6x_operand_regpair, 5, tic6x_rw_read, 1, 1, 1, 1 }
8245548106Schristos #define OWREGD1 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 1, 1 }
8345548106Schristos #define OWREGD12 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 2, 2 }
8445548106Schristos #define OWREGD4 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 4, 4 }
8545548106Schristos #define ORREGD1 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
8645548106Schristos #define OWREGD45 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 5, 5 }
8745548106Schristos #define OWREGD67 { tic6x_operand_regpair, 8, tic6x_rw_write, 6, 6, 7, 7 }
8845548106Schristos #define ORDREGD1 { tic6x_operand_dregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
899573673dSchristos #define ORTREGD1 { tic6x_operand_tregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
9045548106Schristos #define OWDREGD5 { tic6x_operand_dregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
919573673dSchristos #define OWTREGD5 { tic6x_operand_tregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
9245548106Schristos #define ORREGD12 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
9345548106Schristos #define ORXREGD12 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
9445548106Schristos #define ORREGD1234 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 2, 3, 4 }
959573673dSchristos #define ORXREGD1324 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 3, 2, 4 }
9645548106Schristos #define OWREGD910 { tic6x_operand_regpair, 8, tic6x_rw_write, 9, 9, 10, 10 }
9745548106Schristos #define ORCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_read, 1, 1, 0, 0 }
9845548106Schristos #define OWCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_write, 1, 1, 0, 0 }
999573673dSchristos #define OWILC1 { tic6x_operand_ilc, 4, tic6x_rw_write, 1, 1, 0, 0 }
10045548106Schristos #define ORMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_read, 3, 3, 0, 0 }
10145548106Schristos #define OWMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_write, 3, 3, 0, 0 }
10245548106Schristos #define ORMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_read, 3, 3, 0, 0 }
10345548106Schristos #define OWMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_write, 3, 3, 0, 0 }
10445548106Schristos #define ORMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_read, 3, 3, 0, 0 }
10545548106Schristos #define OWMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_write, 3, 3, 0, 0 }
10645548106Schristos #define ORMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_read, 3, 3, 0, 0 }
10745548106Schristos #define OWMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_write, 3, 3, 0, 0 }
10845548106Schristos #define ORMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_read, 3, 3, 0, 0 }
10945548106Schristos #define OWMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_write, 3, 3, 0, 0 }
11045548106Schristos #define ORMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_read, 3, 3, 0, 0 }
11145548106Schristos #define OWMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_write, 3, 3, 0, 0 }
11245548106Schristos #define ORMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_read, 3, 3, 0, 0 }
11345548106Schristos #define OWMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_write, 3, 3, 0, 0 }
11445548106Schristos #define ORMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_read, 3, 3, 0, 0 }
11545548106Schristos #define OWMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_write, 3, 3, 0, 0 }
11645548106Schristos #define ORMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_read, 3, 3, 0, 0 }
11745548106Schristos #define OWMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_write, 3, 3, 0, 0 }
11845548106Schristos #define ENC(id, meth, op) {			\
11945548106Schristos     CONCAT2(tic6x_field_,id),			\
12045548106Schristos     CONCAT2(tic6x_coding_,meth),		\
12145548106Schristos     op						\
12245548106Schristos   }
12345548106Schristos #define ENC0() 0, { { 0, 0, 0 } }
12445548106Schristos #define ENC1(a) 1, { a }
12545548106Schristos #define ENC2(a, b) 2, { a, b }
12645548106Schristos #define ENC3(a, b, c) 3, { a, b, c }
12745548106Schristos #define ENC4(a, b, c, d) 4, { a, b, c, d }
12845548106Schristos #define ENC5(a, b, c, d, e) 5, { a, b, c, d, e }
12945548106Schristos #define ENC6(a, b, c, d, e, f) 6, { a, b, c, d, e, f }
13045548106Schristos #define ENC7(a, b, c, d, e, f, g) 7, { a, b, c, d, e, f, g }
13145548106Schristos 
13245548106Schristos INSN(abs, l, unary, 1cycle, C62X, 0,
13345548106Schristos      FIX1(FIX(op, 0)),
13445548106Schristos      OP2(ORXREG1, OWREG1),
13545548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
13645548106Schristos 	  ENC(dst, reg, 1)))
13745548106Schristos INSN(abs, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
13845548106Schristos      FIX3(FIX(op, 0x38), FIX(x, 0), FIX(src1, 0)),
13945548106Schristos      OP2(ORREGL1, OWREGL1),
14045548106Schristos      ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
14145548106Schristos 
14245548106Schristos INSN(abs2, l, unary, 1cycle, C64X, 0,
14345548106Schristos      FIX1(FIX(op, 0x4)),
14445548106Schristos      OP2(ORXREG1, OWREG1),
14545548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
14645548106Schristos 	  ENC(dst, reg, 1)))
14745548106Schristos 
14845548106Schristos INSN(absdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
1499573673dSchristos      FIX2(FIX(op, 0x2c), FIX(x, 0)),
15045548106Schristos      OP2(ORREGD1, OWREGD12),
1519573673dSchristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
1529573673dSchristos 	  ENC(dst, reg, 1)))
15345548106Schristos 
15445548106Schristos INSN(abssp, s, unary, 1cycle, C67X, 0,
15545548106Schristos      FIX1(FIX(op, 0)),
15645548106Schristos      OP2(ORXREG1, OWREG1),
15745548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
15845548106Schristos 	  ENC(dst, reg, 1)))
15945548106Schristos 
16045548106Schristos INSNE(add, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
16145548106Schristos       FIX1(FIX(op, 0x3)),
16245548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
16345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
16545548106Schristos INSNE(add, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, 0,
16645548106Schristos       FIX1(FIX(op, 0x23)),
16745548106Schristos       OP3(ORREG1, ORXREG1, OWREGL1),
16845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
17045548106Schristos INSNE(add, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
17145548106Schristos       FIX1(FIX(op, 0x21)),
17245548106Schristos       OP3(ORXREG1, ORREGL1, OWREGL1),
17345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
17445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
17545548106Schristos INSNE(add, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
17645548106Schristos       FIX1(FIX(op, 0x2)),
17745548106Schristos       OP3(OACST, ORXREG1, OWREG1),
17845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
17945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
18045548106Schristos INSNE(add, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
18145548106Schristos       FIX2(FIX(op, 0x20), FIX(x, 0)),
18245548106Schristos       OP3(OACST, ORREGL1, OWREGL1),
18345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
18445548106Schristos 	   ENC(dst, reg, 2)))
18545548106Schristos INSNE(add, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
18645548106Schristos       FIX1(FIX(op, 0x7)),
18745548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
18845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
18945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
19045548106Schristos INSNE(add, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
19145548106Schristos       FIX1(FIX(op, 0x6)),
19245548106Schristos       OP3(OACST, ORXREG1, OWREG1),
19345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
19445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
19545548106Schristos INSNE(add, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
19645548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
19745548106Schristos       FIX1(FIX(op, 0x10)),
19845548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
19945548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
20045548106Schristos 	   ENC(dst, reg, 2)))
20145548106Schristos INSNE(add, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
20245548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
20345548106Schristos       FIX1(FIX(op, 0x12)),
20445548106Schristos       OP3(ORREG1, OACST, OWREG1),
20545548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
20645548106Schristos 	   ENC(dst, reg, 2)))
20745548106Schristos INSNE(add, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
20845548106Schristos       FIX1(FIX(op, 0xa)),
20945548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
21045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
21145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
21245548106Schristos INSNE(add, d_xsi_s5_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
21345548106Schristos       FIX1(FIX(op, 0xb)),
21445548106Schristos       OP3(ORXREG1, OACST, OWREG1),
21545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
21645548106Schristos 	   ENC(src1, scst, 1), ENC(dst, reg, 2)))
21745548106Schristos 
2189573673dSchristos /* 16 bits insn */
2199573673dSchristos INSN(add, l, l3_sat_0, 1cycle, C64XP, 0,
2209573673dSchristos      FIX1(FIX(op, 0x0)),
2219573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
2229573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2239573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
2249573673dSchristos INSN(add, l, l3i, 1cycle, C64XP, 0,
2259573673dSchristos      FIX0(),
2269573673dSchristos      OP3(OACST, ORXREG1, OWREG1),
2279573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(cst, scst_l3i, 0),
2289573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
2299573673dSchristos INSN(add, l, lx1, 1cycle, C64XP,
2309573673dSchristos      TIC6X_FLAG_NO_CROSS,
2319573673dSchristos      FIX1(FIX(op, 0x3)),
2329573673dSchristos      OP3(OHWCSTM1, ORREG1, OWREG1),
2339573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
2349573673dSchristos INSN(add, s, s3_sat_0, 1cycle, C64XP, 0,
2359573673dSchristos      FIX1(FIX(op, 0x0)),
2369573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
2379573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
2389573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
2399573673dSchristos INSN(add, s, sx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
2409573673dSchristos       FIX1(FIX(op, 0x3)),
2419573673dSchristos       OP3(OHWCSTM1, ORREG1, OWREG1),
2429573673dSchristos       ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
2439573673dSchristos INSN(add, s, sx2op, 1cycle, C64XP, 0,
2449573673dSchristos       FIX1(FIX(op, 0x0)),
2459573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1),
2469573673dSchristos       ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2),
2479573673dSchristos            ENC(src2, reg, 1), ENC(x, xpath, 1)))
2489573673dSchristos INSN(add, d, dx2op, 1cycle, C64XP, 0,
2499573673dSchristos      FIX1(FIX(op, 0x0)),
2509573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
2519573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 1), ENC(srcdst, reg, 0),
2529573673dSchristos           ENC(src2, reg, 1), ENC(srcdst, reg, 2)))
2539573673dSchristos INSNU(add, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
2549573673dSchristos      FIX2(FIX(op, 0x5), FIX(unit, 0x0)),
2559573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
2569573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
2579573673dSchristos INSNU(add, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
2589573673dSchristos      FIX2(FIX(op, 0x5), FIX(unit, 0x1)),
2599573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
2609573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
2619573673dSchristos INSNU(add, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
2629573673dSchristos      FIX2(FIX(op, 0x5), FIX(unit, 0x2)),
2639573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
2649573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
2659573673dSchristos /**/
2669573673dSchristos 
26745548106Schristos INSNE(addab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
26845548106Schristos       FIX1(FIX(op, 0x30)),
26945548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
27045548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
27145548106Schristos 	   ENC(dst, reg, 2)))
27245548106Schristos INSNE(addab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
27345548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
27445548106Schristos       FIX1(FIX(op, 0x32)),
27545548106Schristos       OP3(ORREG1, OACST, OWREG1),
27645548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
27745548106Schristos 	   ENC(dst, reg, 2)))
27845548106Schristos INSN(addab, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
27945548106Schristos      FIX1(FIX(op, 3)),
28045548106Schristos      OP3(ORAREG1, OLCST, OWREG1),
28145548106Schristos      ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 1),
28245548106Schristos 	  ENC(dst, reg, 2)))
28345548106Schristos 
28445548106Schristos INSNE(addad, d_si_si_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
28545548106Schristos       TIC6X_FLAG_NO_CROSS,
28645548106Schristos       FIX1(FIX(op, 0x3c)),
28745548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
28845548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
28945548106Schristos 	   ENC(dst, reg, 2)))
29045548106Schristos INSNE(addad, d_si_u5_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
29145548106Schristos       TIC6X_FLAG_NO_CROSS,
29245548106Schristos       FIX1(FIX(op, 0x3d)),
29345548106Schristos       OP3(ORREG1, OACST, OWREG1),
29445548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
29545548106Schristos 	   ENC(dst, reg, 2)))
29645548106Schristos 
29745548106Schristos INSNE(addah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
29845548106Schristos       FIX1(FIX(op, 0x34)),
29945548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
30045548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
30145548106Schristos 	   ENC(dst, reg, 2)))
30245548106Schristos INSNE(addah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
30345548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
30445548106Schristos       FIX1(FIX(op, 0x36)),
30545548106Schristos       OP3(ORREG1, OACST, OWREG1),
30645548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
30745548106Schristos 	   ENC(dst, reg, 2)))
30845548106Schristos INSN(addah, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
30945548106Schristos      FIX1(FIX(op, 5)),
31045548106Schristos      OP3(ORAREG1, OLCST, OWREG1),
31145548106Schristos      ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 1),
31245548106Schristos 	  ENC(dst, reg, 2)))
31345548106Schristos 
31445548106Schristos INSNE(addaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
31545548106Schristos       FIX1(FIX(op, 0x38)),
31645548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
31745548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
31845548106Schristos 	   ENC(dst, reg, 2)))
31945548106Schristos INSNE(addaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
32045548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
32145548106Schristos       FIX1(FIX(op, 0x3a)),
32245548106Schristos       OP3(ORREG1, OACST, OWREG1),
32345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
32445548106Schristos 	   ENC(dst, reg, 2)))
32545548106Schristos INSN(addaw, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
32645548106Schristos      FIX1(FIX(op, 7)),
32745548106Schristos      OP3(ORAREG1, OLCST, OWREG1),
32845548106Schristos      ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 1),
32945548106Schristos 	  ENC(dst, reg, 2)))
33045548106Schristos 
3319573673dSchristos /* 16 bits insn */
3329573673dSchristos INSN(addaw, d, dx5, 1cycle, C64XP, TIC6X_FLAG_INSN16_BSIDE,
3339573673dSchristos      FIX0(),
3349573673dSchristos      OP3(ORB15REG1, OACST, OWREG1),
3359573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 1), ENC(dst, reg, 2)))
3369573673dSchristos INSN(addaw, d, dx5p, 1cycle, C64XP, TIC6X_FLAG_INSN16_BSIDE,
3379573673dSchristos      FIX1(FIX(op, 0)),
3389573673dSchristos      OP3(ORB15REG1, OACST, OWB15REG1),
3399573673dSchristos      ENC2(ENC(s, fu, 0), ENC(cst, ucst, 1)))
3409573673dSchristos /**/
3419573673dSchristos 
34245548106Schristos INSN(adddp, l, 1_or_2_src, addsubdp, C67X, 0,
34345548106Schristos      FIX1(FIX(op, 0x18)),
34445548106Schristos      OP3(ORREGD12, ORXREGD12, OWREGD67),
34545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
34645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
34745548106Schristos INSN(adddp, s, l_1_or_2_src, addsubdp, C67XP, 0,
34845548106Schristos      FIX1(FIX(op, 0x72)),
34945548106Schristos      OP3(ORREGD12, ORXREGD12, OWREGD67),
35045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
35145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
35245548106Schristos 
35345548106Schristos INSN(addk, s, addk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
35445548106Schristos      FIX0(),
35545548106Schristos      OP2(OLCST, OWREG1),
35645548106Schristos      ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
35745548106Schristos 
3589573673dSchristos /* 16 bits insn */
3599573673dSchristos INSN(addk, s, sx5, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
3609573673dSchristos      FIX0(),
3619573673dSchristos      OP2(OACST, OWREG1),
3629573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
3639573673dSchristos /**/
3649573673dSchristos 
36545548106Schristos INSN(addkpc, s, addkpc, 1cycle, C64X,
36645548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_SIDE_B_ONLY,
36745548106Schristos      FIX1(FIX(s, 1)),
36845548106Schristos      OP3(OLCST, OWREG1, OACST),
36945548106Schristos      ENC3(ENC(src1, pcrel, 0), ENC(dst, reg, 1), ENC(src2, ucst, 2)))
37045548106Schristos 
37145548106Schristos INSN(addsp, l, 1_or_2_src, 4cycle, C67X, 0,
37245548106Schristos      FIX1(FIX(op, 0x10)),
37345548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
37445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
37545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
37645548106Schristos INSN(addsp, s, l_1_or_2_src, 4cycle, C67XP, 0,
37745548106Schristos      FIX1(FIX(op, 0x70)),
37845548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
37945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
38045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
38145548106Schristos 
38245548106Schristos INSN(addsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
38345548106Schristos      FIX1(FIX(op, 0xc)),
38445548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
38545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
38645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
38745548106Schristos 
38845548106Schristos INSN(addsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
38945548106Schristos      FIX1(FIX(op, 0xd)),
39045548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
39145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
39245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
39345548106Schristos 
39445548106Schristos INSNE(addu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, 0,
39545548106Schristos       FIX1(FIX(op, 0x2b)),
39645548106Schristos       OP3(ORREG1, ORXREG1, OWREGL1),
39745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
39845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
39945548106Schristos INSNE(addu, l_xui_ul_ul, l, 1_or_2_src, 1cycle, C62X, 0,
40045548106Schristos       FIX1(FIX(op, 0x29)),
40145548106Schristos       OP3(ORXREG1, ORREGL1, OWREGL1),
40245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
40345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
40445548106Schristos 
40545548106Schristos INSN(add2, s, 1_or_2_src, 1cycle, C62X, 0,
40645548106Schristos      FIX1(FIX(op, 0x1)),
40745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
40845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
40945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
41045548106Schristos INSN(add2, l, 1_or_2_src, 1cycle, C64X, 0,
41145548106Schristos      FIX1(FIX(op, 0x5)),
41245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
41345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
41445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
41545548106Schristos INSN(add2, d, ext_1_or_2_src, 1cycle, C64X, 0,
41645548106Schristos      FIX1(FIX(op, 0x4)),
41745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
41845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
41945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
42045548106Schristos 
42145548106Schristos INSN(add4, l, 1_or_2_src, 1cycle, C64X, 0,
42245548106Schristos      FIX1(FIX(op, 0x65)),
42345548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
42445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
42545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
42645548106Schristos 
42745548106Schristos INSNE(and, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
42845548106Schristos       FIX1(FIX(op, 0x7b)),
42945548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
43045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
43145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
43245548106Schristos INSNE(and, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
43345548106Schristos       FIX1(FIX(op, 0x7a)),
43445548106Schristos       OP3(OACST, ORXREG1, OWREG1),
43545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
43645548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
43745548106Schristos INSNE(and, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
43845548106Schristos       FIX1(FIX(op, 0x1f)),
43945548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
44045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
44145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
44245548106Schristos INSNE(and, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
44345548106Schristos       FIX1(FIX(op, 0x1e)),
44445548106Schristos       OP3(OACST, ORXREG1, OWREG1),
44545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
44645548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
44745548106Schristos INSNE(and, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
44845548106Schristos       FIX1(FIX(op, 0x6)),
44945548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
45045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
45145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
45245548106Schristos INSNE(and, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
45345548106Schristos       FIX1(FIX(op, 0x7)),
45445548106Schristos       OP3(OACST, ORXREG1, OWREG1),
45545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
45645548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
45745548106Schristos 
4589573673dSchristos /* 16 bits insn */
4599573673dSchristos INSN(and, l, l2c, 1cycle, C64XP, 0,
4609573673dSchristos       FIX1(FIX(op, 0)),
4619573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
4629573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
4639573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
4649573673dSchristos /**/
4659573673dSchristos 
46645548106Schristos INSN(andn, l, 1_or_2_src, 1cycle, C64X, 0,
46745548106Schristos      FIX1(FIX(op, 0x7c)),
46845548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
46945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
47045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
47145548106Schristos INSN(andn, s, ext_1_or_2_src, 1cycle, C64X, 0,
47245548106Schristos      FIX1(FIX(op, 0x6)),
47345548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
47445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
47545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
47645548106Schristos INSN(andn, d, ext_1_or_2_src, 1cycle, C64X, 0,
47745548106Schristos      FIX1(FIX(op, 0x0)),
47845548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
47945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
48045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
48145548106Schristos 
48245548106Schristos INSN(avg2, m, compound, 1616_m, C64X, 0,
48345548106Schristos      FIX1(FIX(op, 0x13)),
48445548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
48545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
48645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
48745548106Schristos 
48845548106Schristos INSN(avgu4, m, compound, 1616_m, C64X, 0,
48945548106Schristos      FIX1(FIX(op, 0x12)),
49045548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
49145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
49245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
49345548106Schristos 
49445548106Schristos INSN(b, s, ext_branch_cond_imm, branch, C62X, TIC6X_FLAG_NO_CROSS,
49545548106Schristos      FIX0(),
49645548106Schristos      OP1(OLCST),
49745548106Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
49845548106Schristos INSN(b, s, branch, branch, C62X, TIC6X_FLAG_SIDE_B_ONLY,
49945548106Schristos      FIX1(FIX(s, 1)),
50045548106Schristos      OP1(ORXREG1),
50145548106Schristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
50245548106Schristos INSN(b, s, b_irp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
50345548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
50445548106Schristos      OP1(ORIRP1),
50545548106Schristos      ENC0())
50645548106Schristos INSN(b, s, b_nrp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
50745548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
50845548106Schristos      OP1(ORNRP1),
50945548106Schristos      ENC0())
51045548106Schristos 
51145548106Schristos INSN(bdec, s, bdec, branch, C64X, TIC6X_FLAG_NO_CROSS,
51245548106Schristos      FIX0(),
51345548106Schristos      OP2(OLCST, ORWREG1),
51445548106Schristos      ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
51545548106Schristos 
51645548106Schristos INSN(bitc4, m, unary, 1616_m, C64X, 0,
51745548106Schristos      FIX1(FIX(op, 0x1e)),
51845548106Schristos      OP2(ORXREG1, OWREG2),
51945548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
52045548106Schristos 	  ENC(dst, reg, 1)))
52145548106Schristos 
52245548106Schristos INSN(bitr, m, unary, 1616_m, C64X, 0,
52345548106Schristos      FIX1(FIX(op, 0x1f)),
52445548106Schristos      OP2(ORXREG1, OWREG2),
52545548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
52645548106Schristos 	  ENC(dst, reg, 1)))
52745548106Schristos 
52845548106Schristos INSN(bnop, s, branch_nop_cst, branch, C64X,
52945548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
53045548106Schristos      FIX0(),
53145548106Schristos      OP2(OLCST, OACST),
5329573673dSchristos      ENC3(ENC(s, fu, 0), ENC(src2, pcrel_half, 0), ENC(src1, ucst, 1)))
53345548106Schristos INSN(bnop, nfu, s_branch_nop_cst, branch, C64XP,
53445548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP,
53545548106Schristos      FIX1(FIX(s, 0)),
53645548106Schristos      OP2(OLCST, OACST),
53745548106Schristos      ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
53845548106Schristos INSN(bnop, s, branch_nop_reg, branch, C64X,
53945548106Schristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP,
54045548106Schristos      FIX1(FIX(s, 1)),
54145548106Schristos      OP2(ORXREG1, OACST),
54245548106Schristos      ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
54345548106Schristos 
5449573673dSchristos /* 16 bits insn format */
5459573673dSchristos INSN(bnop, s, sbu8, branch, C64XP,
5469573673dSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
5479573673dSchristos      FIX0(),
5489573673dSchristos      OP2(OLCST, OHWCST5),
5499573673dSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel_half_unsigned, 0)))
5509573673dSchristos INSN(bnop, s, sbs7, branch, C64XP,
5519573673dSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
5529573673dSchristos      FIX0(),
5539573673dSchristos      OP2(OLCST, OACST),
5549573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, pcrel_half, 0), ENC(n, ucst, 1)))
5559573673dSchristos INSN(bnop, s, sbu8c, branch, C64XP,
5569573673dSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_INSN16_SPRED,
5579573673dSchristos      FIX0(),
5589573673dSchristos      OP2(OLCST, OHWCST5),
5599573673dSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel_half_unsigned, 0)))
5609573673dSchristos INSN(bnop, s, sbs7c, branch, C64XP,
5619573673dSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_INSN16_SPRED,
5629573673dSchristos      FIX0(),
5639573673dSchristos      OP2(OLCST, OACST),
5649573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, pcrel_half, 0), ENC(n, ucst, 1)))
5659573673dSchristos INSN(bnop, s, sx1b, branch, C64XP,
5669573673dSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
5679573673dSchristos      FIX0(),
5689573673dSchristos      OP2(ORREG1BNORS, OACST),
5699573673dSchristos      ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(n, ucst, 1)))
5709573673dSchristos /**/
5719573673dSchristos 
57245548106Schristos INSN(bpos, s, bpos, branch, C64X, TIC6X_FLAG_NO_CROSS,
57345548106Schristos      FIX0(),
57445548106Schristos      OP2(OLCST, ORREG1),
57545548106Schristos      ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
57645548106Schristos 
57745548106Schristos INSN(call, s, ext_branch_cond_imm, branch, C62X,
57845548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
57945548106Schristos      FIX0(),
58045548106Schristos      OP1(OLCST),
58145548106Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
58245548106Schristos INSN(call, s, branch, branch, C62X,
58345548106Schristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
58445548106Schristos      FIX1(FIX(s, 1)),
58545548106Schristos      OP1(ORXREG1),
58645548106Schristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
58745548106Schristos INSN(call, s, b_irp, branch, C62X,
58845548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
58945548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
59045548106Schristos      OP1(ORIRP1),
59145548106Schristos      ENC0())
59245548106Schristos INSN(call, s, b_nrp, branch, C62X,
59345548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
59445548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
59545548106Schristos      OP1(ORNRP1),
59645548106Schristos      ENC0())
59745548106Schristos 
59845548106Schristos INSN(callnop, s, branch_nop_cst, branch, C64X,
59945548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
60045548106Schristos      FIX0(),
60145548106Schristos      OP2(OLCST, OACST),
60245548106Schristos      ENC3(ENC(s, fu, 0), ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
60345548106Schristos INSN(callnop, nfu, s_branch_nop_cst, branch, C64XP,
60445548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
60545548106Schristos      FIX1(FIX(s, 0)),
60645548106Schristos      OP2(OLCST, OACST),
60745548106Schristos      ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
60845548106Schristos INSN(callnop, s, branch_nop_reg, branch, C64X,
60945548106Schristos      TIC6X_FLAG_MACRO|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
61045548106Schristos      FIX1(FIX(s, 1)),
61145548106Schristos      OP2(ORXREG1, OACST),
61245548106Schristos      ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
61345548106Schristos 
6149573673dSchristos 
61545548106Schristos INSN(callp, s, call_imm_nop, branch, C64XP,
61645548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
61745548106Schristos      FIX1(FIX(z, 1)),
61845548106Schristos      OP2(OLCST, OWRETREG1),
61945548106Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
62045548106Schristos 
6219573673dSchristos /* 16 bits insn format */
6229573673dSchristos INSN(callp, s, scs10, branch, C64XP,
6239573673dSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
6249573673dSchristos      FIX0(),
6259573673dSchristos      OP2(OLCST, OWRETREG1),
6269573673dSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
6279573673dSchristos /**/
6289573673dSchristos 
62945548106Schristos INSN(callret, s, ext_branch_cond_imm, branch, C62X,
63045548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
63145548106Schristos      FIX0(),
63245548106Schristos      OP1(OLCST),
63345548106Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
63445548106Schristos INSN(callret, s, branch, branch, C62X,
63545548106Schristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
63645548106Schristos      FIX1(FIX(s, 1)),
63745548106Schristos      OP1(ORXREG1),
63845548106Schristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
63945548106Schristos INSN(callret, s, b_irp, branch, C62X,
64045548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
64145548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
64245548106Schristos      OP1(ORIRP1),
64345548106Schristos      ENC0())
64445548106Schristos INSN(callret, s, b_nrp, branch, C62X,
64545548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
64645548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
64745548106Schristos      OP1(ORNRP1),
64845548106Schristos      ENC0())
64945548106Schristos 
65045548106Schristos INSN(clr, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
65145548106Schristos      FIX1(FIX(op, 0x3)),
65245548106Schristos      OP4(ORREG1, OACST, OACST, OWREG1),
65345548106Schristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
65445548106Schristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
65545548106Schristos INSN(clr, s, 1_or_2_src, 1cycle, C62X, 0,
65645548106Schristos      FIX1(FIX(op, 0x3f)),
65745548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
65845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
65945548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
66045548106Schristos 
6619573673dSchristos /* 16 bits insn */
6629573673dSchristos INSN(clr, s, sc5, 1cycle, C64XP, 0,
6639573673dSchristos      FIX1(FIX(op, 2)),
6649573673dSchristos      OP4(ORREG1, OACST, OACST, OWREG1),
6659573673dSchristos      ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1),
6669573673dSchristos           ENC(cst, ucst, 2), ENC(srcdst, reg, 3)))
6679573673dSchristos /**/
6689573673dSchristos 
66945548106Schristos INSNE(cmpeq, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
67045548106Schristos       FIX1(FIX(op, 0x53)),
67145548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
67245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
67345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
67445548106Schristos INSNE(cmpeq, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
67545548106Schristos       FIX1(FIX(op, 0x52)),
67645548106Schristos       OP3(OACST, ORXREG1, OWREG1),
67745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
67845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
67945548106Schristos INSNE(cmpeq, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
68045548106Schristos       FIX1(FIX(op, 0x51)),
68145548106Schristos       OP3(ORXREG1, ORREGL1, OWREG1),
68245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
68345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
68445548106Schristos INSNE(cmpeq, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
68545548106Schristos       FIX2(FIX(op, 0x50), FIX(x, 0)),
68645548106Schristos       OP3(OACST, ORREGL1, OWREG1),
68745548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
68845548106Schristos 	   ENC(dst, reg, 2)))
68945548106Schristos 
6909573673dSchristos /* 16 bits insn */
6919573673dSchristos INSN(cmpeq, l, lx3c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
6929573673dSchristos       FIX0(),
6939573673dSchristos       OP3(OACST, ORXREG1, OWREG1),
6949573673dSchristos       ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
6959573673dSchristos            ENC(dst, reg, 2)))
6969573673dSchristos 
6979573673dSchristos INSN(cmpeq, l, l2c, 1cycle, C64XP, 0,
6989573673dSchristos       FIX1(FIX(op, 3)),
6999573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
7009573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
7019573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
7029573673dSchristos /**/
7039573673dSchristos 
70445548106Schristos INSN(cmpeq2, s, 1_or_2_src, 1cycle, C64X, 0,
70545548106Schristos      FIX1(FIX(op, 0x1d)),
70645548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
70745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
70845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
70945548106Schristos 
71045548106Schristos INSN(cmpeq4, s, 1_or_2_src, 1cycle, C64X, 0,
71145548106Schristos      FIX1(FIX(op, 0x1c)),
71245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
71345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
71445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
71545548106Schristos 
71645548106Schristos INSN(cmpeqdp, s, 1_or_2_src, dpcmp, C67X, 0,
71745548106Schristos      FIX1(FIX(op, 0x28)),
71845548106Schristos      OP3(ORREGD12, ORXREGD12, OWREG2),
71945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
72045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
72145548106Schristos 
72245548106Schristos INSN(cmpeqsp, s, 1_or_2_src, 1cycle, C67X, 0,
72345548106Schristos      FIX1(FIX(op, 0x38)),
72445548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
72545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
72645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
72745548106Schristos 
72845548106Schristos INSNE(cmpgt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
72945548106Schristos       FIX1(FIX(op, 0x47)),
73045548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
73145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
73245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
73345548106Schristos INSNE(cmpgt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
73445548106Schristos       FIX1(FIX(op, 0x46)),
73545548106Schristos       OP3(OACST, ORXREG1, OWREG1),
73645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
73745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
73845548106Schristos INSNE(cmpgt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
73945548106Schristos       FIX1(FIX(op, 0x45)),
74045548106Schristos       OP3(ORXREG1, ORREGL1, OWREG1),
74145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
74245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
74345548106Schristos INSNE(cmpgt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
74445548106Schristos       FIX2(FIX(op, 0x44), FIX(x, 0)),
74545548106Schristos       OP3(OACST, ORREGL1, OWREG1),
74645548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
74745548106Schristos 	   ENC(dst, reg, 2)))
74845548106Schristos INSNE(cmpgt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
74945548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
75045548106Schristos       FIX1(FIX(op, 0x57)),
75145548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
75245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
75345548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
75445548106Schristos INSNE(cmpgt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
75545548106Schristos       FIX1(FIX(op, 0x56)),
75645548106Schristos       OP3(ORXREG1, OACST, OWREG1),
75745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
75845548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
75945548106Schristos INSNE(cmpgt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
76045548106Schristos       FIX1(FIX(op, 0x55)),
76145548106Schristos       OP3(ORREGL1, ORXREG1, OWREG1),
76245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
76345548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
76445548106Schristos INSNE(cmpgt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
76545548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
76645548106Schristos       FIX2(FIX(op, 0x54), FIX(x, 0)),
76745548106Schristos       OP3(ORREGL1, OACST, OWREG1),
76845548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
76945548106Schristos 	   ENC(dst, reg, 2)))
77045548106Schristos 
7719573673dSchristos /* 16 bits insn */
7729573673dSchristos INSN(cmpgt, l, lx1c, 1cycle, C64XP, 0,
7739573673dSchristos      FIX1(FIX(op, 1)),
7749573673dSchristos      OP3(OACST, ORREG1, OWREG1),
7759573673dSchristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
7769573673dSchristos           ENC(dst, reg, 2)))
7779573673dSchristos INSN(cmpgt, l, l2c, 1cycle, C64XP, 0,
7789573673dSchristos       FIX1(FIX(op, 5)),
7799573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
7809573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
7819573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
7829573673dSchristos /**/
7839573673dSchristos 
78445548106Schristos INSN(cmpgt2, s, 1_or_2_src, 1cycle, C64X, 0,
78545548106Schristos      FIX1(FIX(op, 0x14)),
78645548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
78745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
78845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
78945548106Schristos 
79045548106Schristos INSN(cmpgtdp, s, 1_or_2_src, dpcmp, C67X, 0,
79145548106Schristos      FIX1(FIX(op, 0x29)),
79245548106Schristos      OP3(ORREGD12, ORXREGD12, OWREG2),
79345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
79445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
79545548106Schristos 
79645548106Schristos INSN(cmpgtsp, s, 1_or_2_src, 1cycle, C67X, 0,
79745548106Schristos      FIX1(FIX(op, 0x39)),
79845548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
79945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
80045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
80145548106Schristos 
80245548106Schristos INSNE(cmpgtu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
80345548106Schristos       FIX1(FIX(op, 0x4f)),
80445548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
80545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
80645548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
80745548106Schristos INSNE(cmpgtu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
80845548106Schristos       FIX2(FIX(op, 0x4e), RAN(src1, 0, 15)),
80945548106Schristos       OP3(OACST, ORXREG1, OWREG1),
81045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
81145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
81245548106Schristos /* Although not mentioned in SPRUFE8, CMPGTU and CMPLTU support a
81345548106Schristos    5-bit unsigned constant operand on C64X and above.  */
81445548106Schristos INSNE(cmpgtu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
81545548106Schristos       FIX2(FIX(op, 0x4e), RAN(src1, 16, 31)),
81645548106Schristos       OP3(OACST, ORXREG1, OWREG1),
81745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
81845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
81945548106Schristos INSNE(cmpgtu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
82045548106Schristos       FIX1(FIX(op, 0x4d)),
82145548106Schristos       OP3(ORXREG1, ORREGL1, OWREG1),
82245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
82345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
82445548106Schristos INSNE(cmpgtu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
82545548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
82645548106Schristos       FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 0, 15)),
82745548106Schristos       OP3(OACST, ORREGL1, OWREG1),
82845548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
82945548106Schristos 	   ENC(dst, reg, 2)))
83045548106Schristos INSNE(cmpgtu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
83145548106Schristos       FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 16, 31)),
83245548106Schristos       OP3(OACST, ORREGL1, OWREG1),
83345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
83445548106Schristos 	   ENC(dst, reg, 2)))
83545548106Schristos 
8369573673dSchristos /* 16 bits insn */
8379573673dSchristos INSN(cmpgtu, l, lx1c, 1cycle, C64XP, 0,
8389573673dSchristos      FIX1(FIX(op, 3)),
8399573673dSchristos      OP3(OACST, ORREG1, OWREG1),
8409573673dSchristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
8419573673dSchristos           ENC(dst, reg, 2)))
8429573673dSchristos INSN(cmpgtu, l, l2c, 1cycle, C64XP, 0,
8439573673dSchristos       FIX1(FIX(op, 7)),
8449573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
8459573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
8469573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
8479573673dSchristos /**/
8489573673dSchristos 
84945548106Schristos INSN(cmpgtu4, s, 1_or_2_src, 1cycle, C64X, 0,
85045548106Schristos      FIX1(FIX(op, 0x15)),
85145548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
85245548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
85345548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
85445548106Schristos 
85545548106Schristos INSNE(cmplt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
85645548106Schristos       FIX1(FIX(op, 0x57)),
85745548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
85845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
85945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
86045548106Schristos INSNE(cmplt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
86145548106Schristos       FIX1(FIX(op, 0x56)),
86245548106Schristos       OP3(OACST, ORXREG1, OWREG1),
86345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
86445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
86545548106Schristos INSNE(cmplt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
86645548106Schristos       FIX1(FIX(op, 0x55)),
86745548106Schristos       OP3(ORXREG1, ORREGL1, OWREG1),
86845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
86945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
87045548106Schristos INSNE(cmplt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
87145548106Schristos       FIX2(FIX(op, 0x54), FIX(x, 0)),
87245548106Schristos       OP3(OACST, ORREGL1, OWREG1),
87345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
87445548106Schristos 	   ENC(dst, reg, 2)))
87545548106Schristos INSNE(cmplt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
87645548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
87745548106Schristos       FIX1(FIX(op, 0x47)),
87845548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
87945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
88045548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
88145548106Schristos INSNE(cmplt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
88245548106Schristos       FIX1(FIX(op, 0x46)),
88345548106Schristos       OP3(ORXREG1, OACST, OWREG1),
88445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
88545548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
88645548106Schristos INSNE(cmplt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
88745548106Schristos       FIX1(FIX(op, 0x45)),
88845548106Schristos       OP3(ORREGL1, ORXREG1, OWREG1),
88945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
89045548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
89145548106Schristos INSNE(cmplt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
89245548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
89345548106Schristos       FIX2(FIX(op, 0x44), FIX(x, 0)),
89445548106Schristos       OP3(ORREGL1, OACST, OWREG1),
89545548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
89645548106Schristos 	   ENC(dst, reg, 2)))
89745548106Schristos 
8989573673dSchristos /* 16 bits insn */
8999573673dSchristos INSN(cmplt, l, lx1c, 1cycle, C64XP, 0,
9009573673dSchristos      FIX1(FIX(op, 0)),
9019573673dSchristos      OP3(OACST, ORREG1, OWREG1),
9029573673dSchristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
9039573673dSchristos           ENC(dst, reg, 2)))
9049573673dSchristos INSN(cmplt, l, l2c, 1cycle, C64XP, 0,
9059573673dSchristos       FIX1(FIX(op, 4)),
9069573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
9079573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
9089573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
9099573673dSchristos /**/
9109573673dSchristos 
91145548106Schristos INSN(cmplt2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
91245548106Schristos      FIX1(FIX(op, 0x14)),
91345548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
91445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
91545548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
91645548106Schristos 
91745548106Schristos INSN(cmpltdp, s, 1_or_2_src, dpcmp, C67X, 0,
91845548106Schristos      FIX1(FIX(op, 0x2a)),
91945548106Schristos      OP3(ORREGD12, ORXREGD12, OWREG2),
92045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
92145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
92245548106Schristos 
92345548106Schristos INSN(cmpltsp, s, 1_or_2_src, 1cycle, C67X, 0,
92445548106Schristos      FIX1(FIX(op, 0x3a)),
92545548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
92645548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
92745548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
92845548106Schristos 
92945548106Schristos INSNE(cmpltu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
93045548106Schristos       FIX1(FIX(op, 0x5f)),
93145548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
93245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
93345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
93445548106Schristos INSNE(cmpltu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
93545548106Schristos       FIX2(FIX(op, 0x5e), RAN(src1, 0, 15)),
93645548106Schristos       OP3(OACST, ORXREG1, OWREG1),
93745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
93845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
93945548106Schristos INSNE(cmpltu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
94045548106Schristos       FIX2(FIX(op, 0x5e), RAN(src1, 16, 31)),
94145548106Schristos       OP3(OACST, ORXREG1, OWREG1),
94245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
94345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
94445548106Schristos INSNE(cmpltu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
94545548106Schristos       FIX1(FIX(op, 0x5d)),
94645548106Schristos       OP3(ORXREG1, ORREGL1, OWREG1),
94745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
94845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
94945548106Schristos INSNE(cmpltu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
95045548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
95145548106Schristos       FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 0, 15)),
95245548106Schristos       OP3(OACST, ORREGL1, OWREG1),
95345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
95445548106Schristos 	   ENC(dst, reg, 2)))
95545548106Schristos INSNE(cmpltu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
95645548106Schristos       FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 16, 31)),
95745548106Schristos       OP3(OACST, ORREGL1, OWREG1),
95845548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
95945548106Schristos 	   ENC(dst, reg, 2)))
96045548106Schristos 
9619573673dSchristos /* 16 bits insn */
9629573673dSchristos INSN(cmpltu, l, lx1c, 1cycle, C64XP, 0,
9639573673dSchristos      FIX1(FIX(op, 2)),
9649573673dSchristos      OP3(OACST, ORREG1, OWREG1),
9659573673dSchristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
9669573673dSchristos           ENC(dst, reg, 2)))
9679573673dSchristos INSN(cmpltu, l, l2c, 1cycle, C64XP, 0,
9689573673dSchristos       FIX1(FIX(op, 6)),
9699573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
9709573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
9719573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
9729573673dSchristos /**/
9739573673dSchristos 
97445548106Schristos INSN(cmpltu4, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
97545548106Schristos      FIX1(FIX(op, 0x15)),
97645548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
97745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
97845548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
97945548106Schristos 
98045548106Schristos INSN(cmpy, m, 1_or_2_src, 4cycle, C64XP, 0,
98145548106Schristos      FIX1(FIX(op, 0xa)),
98245548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
98345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
98445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
98545548106Schristos 
98645548106Schristos INSN(cmpyr, m, 1_or_2_src, 4cycle, C64XP, 0,
98745548106Schristos      FIX1(FIX(op, 0xb)),
98845548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
98945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
99045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
99145548106Schristos 
99245548106Schristos INSN(cmpyr1, m, 1_or_2_src, 4cycle, C64XP, 0,
99345548106Schristos      FIX1(FIX(op, 0xc)),
99445548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
99545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
99645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
99745548106Schristos 
998883529b6Schristos INSN(cmtl, d, 1_or_2_src, load, C64XP,
99945548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
100045548106Schristos      FIX3(FIX(s, 1), FIX(op, 0xe), FIX(src1, 0)),
100145548106Schristos      OP2(ORMEMDW, OWDREG5),
100245548106Schristos      ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
100345548106Schristos 
100445548106Schristos INSN(ddotp4, m, 1_or_2_src, 4cycle, C64XP, 0,
100545548106Schristos      FIX1(FIX(op, 0x18)),
100645548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
100745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
100845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
100945548106Schristos 
101045548106Schristos INSN(ddotph2, m, 1_or_2_src, 4cycle, C64XP, 0,
101145548106Schristos      FIX1(FIX(op, 0x17)),
101245548106Schristos      OP3(ORREGD1, ORXREG1, OWREGD4),
101345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
101445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
101545548106Schristos 
101645548106Schristos INSN(ddotph2r, m, 1_or_2_src, 4cycle, C64XP, 0,
101745548106Schristos      FIX1(FIX(op, 0x15)),
101845548106Schristos      OP3(ORREGD1, ORXREG1, OWREG4),
101945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
102045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
102145548106Schristos 
102245548106Schristos INSN(ddotpl2, m, 1_or_2_src, 4cycle, C64XP, 0,
102345548106Schristos      FIX1(FIX(op, 0x16)),
102445548106Schristos      OP3(ORREGD1, ORXREG1, OWREGD4),
102545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
102645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
102745548106Schristos 
102845548106Schristos INSN(ddotpl2r, m, 1_or_2_src, 4cycle, C64XP, 0,
102945548106Schristos      FIX1(FIX(op, 0x14)),
103045548106Schristos      OP3(ORREGD1, ORXREG1, OWREG4),
103145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
103245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
103345548106Schristos 
103445548106Schristos INSN(deal, m, unary, 1616_m, C64X, 0,
103545548106Schristos      FIX1(FIX(op, 0x1d)),
103645548106Schristos      OP2(ORXREG1, OWREG2),
103745548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
103845548106Schristos 	  ENC(dst, reg, 1)))
103945548106Schristos 
104045548106Schristos INSN(dint, nfu, dint, 1cycle, C64XP, 0,
104145548106Schristos      FIX1(FIX(s, 0)),
104245548106Schristos      OP0(),
104345548106Schristos      ENC0())
104445548106Schristos 
104545548106Schristos INSN(dmv, s, ext_1_or_2_src, 1cycle, C64XP, 0,
104645548106Schristos      FIX1(FIX(op, 0xb)),
104745548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
104845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
104945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
105045548106Schristos 
105145548106Schristos INSNE(dotp2, m_s2_xs2_si, m, compound, 4cycle, C64X, 0,
105245548106Schristos       FIX1(FIX(op, 0xc)),
105345548106Schristos       OP3(ORREG1, ORXREG1, OWREG4),
105445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
105545548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
105645548106Schristos INSNE(dotp2, m_s2_xs2_sll, m, compound, 4cycle, C64X, 0,
105745548106Schristos       FIX1(FIX(op, 0xb)),
105845548106Schristos       OP3(ORREG1, ORXREG1, OWREGD4),
105945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
106045548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
106145548106Schristos 
106245548106Schristos INSN(dotpn2, m, compound, 4cycle, C64X, 0,
106345548106Schristos      FIX1(FIX(op, 0x9)),
106445548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
106545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
106645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
106745548106Schristos 
106845548106Schristos INSN(dotpnrsu2, m, compound, 4cycle, C64X, 0,
106945548106Schristos      FIX1(FIX(op, 0x7)),
107045548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
107145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
107245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
107345548106Schristos 
107445548106Schristos INSN(dotpnrus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
107545548106Schristos      FIX1(FIX(op, 0x7)),
107645548106Schristos      OP3(ORXREG1, ORREG1, OWREG4),
107745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
107845548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
107945548106Schristos 
108045548106Schristos INSN(dotprsu2, m, compound, 4cycle, C64X, 0,
108145548106Schristos      FIX1(FIX(op, 0xd)),
108245548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
108345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
108445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
108545548106Schristos 
108645548106Schristos INSN(dotprus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
108745548106Schristos      FIX1(FIX(op, 0xd)),
108845548106Schristos      OP3(ORXREG1, ORREG1, OWREG4),
108945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
109045548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
109145548106Schristos 
109245548106Schristos INSN(dotpsu4, m, compound, 4cycle, C64X, 0,
109345548106Schristos      FIX1(FIX(op, 0x2)),
109445548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
109545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
109645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
109745548106Schristos 
109845548106Schristos INSN(dotpus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
109945548106Schristos      FIX1(FIX(op, 0x2)),
110045548106Schristos      OP3(ORXREG1, ORREG1, OWREG4),
110145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
110245548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
110345548106Schristos 
110445548106Schristos INSN(dotpu4, m, compound, 4cycle, C64X, 0,
110545548106Schristos      FIX1(FIX(op, 0x6)),
110645548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
110745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
110845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
110945548106Schristos 
111045548106Schristos INSN(dpack2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
111145548106Schristos      FIX1(FIX(op, 0x34)),
111245548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
111345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
111445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
111545548106Schristos 
111645548106Schristos INSN(dpackx2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
111745548106Schristos      FIX1(FIX(op, 0x33)),
111845548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
111945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
112045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
112145548106Schristos 
112245548106Schristos INSN(dpint, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
11239573673dSchristos      FIX2(FIX(op, 0x8), FIX(x, 0)),
112445548106Schristos      OP2(ORREGD1, OWREG4),
11259573673dSchristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
11269573673dSchristos 	  ENC(dst, reg, 1)))
112745548106Schristos 
112845548106Schristos INSN(dpsp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
11299573673dSchristos      FIX2(FIX(op, 0x9), FIX(x, 0)),
113045548106Schristos      OP2(ORREGD1, OWREG4),
11319573673dSchristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
11329573673dSchristos 	  ENC(dst, reg, 1)))
113345548106Schristos 
113445548106Schristos INSN(dptrunc, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
11359573673dSchristos      FIX2(FIX(op, 0x1), FIX(x, 0)),
113645548106Schristos      OP2(ORREGD1, OWREG4),
11379573673dSchristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
11389573673dSchristos 	  ENC(dst, reg, 1)))
113945548106Schristos 
114045548106Schristos INSN(ext, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
114145548106Schristos      FIX1(FIX(op, 0x1)),
114245548106Schristos      OP4(ORREG1, OACST, OACST, OWREG1),
114345548106Schristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
114445548106Schristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
114545548106Schristos INSN(ext, s, 1_or_2_src, 1cycle, C62X, 0,
114645548106Schristos      FIX1(FIX(op, 0x2f)),
114745548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
114845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
114945548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
115045548106Schristos 
11519573673dSchristos /* 16 bits insn */
11529573673dSchristos INSNE(ext, hwcst16, s, s2ext, 1cycle, C64XP, 0,
11539573673dSchristos      FIX1(FIX(op, 0x0)),
11549573673dSchristos      OP4(ORREG1, OHWCST16, OHWCST16, OWREG1),
11559573673dSchristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
11569573673dSchristos INSNE(ext, hwcst24, s, s2ext, 1cycle, C64XP, 0,
11579573673dSchristos      FIX1(FIX(op, 0x1)),
11589573673dSchristos      OP4(ORREG1, OHWCST24, OHWCST24, OWREG1),
11599573673dSchristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
11609573673dSchristos /**/
11619573673dSchristos 
116245548106Schristos INSN(extu, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
116345548106Schristos      FIX1(FIX(op, 0x0)),
116445548106Schristos      OP4(ORREG1, OACST, OACST, OWREG1),
116545548106Schristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
116645548106Schristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
116745548106Schristos INSN(extu, s, 1_or_2_src, 1cycle, C62X, 0,
116845548106Schristos      FIX1(FIX(op, 0x2b)),
116945548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
117045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
117145548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
117245548106Schristos 
11739573673dSchristos /* 16 bits insn */
11749573673dSchristos INSNE(extu, hwcst16, s, s2ext, 1cycle, C64XP, 0,
11759573673dSchristos      FIX1(FIX(op, 0x2)),
11769573673dSchristos      OP4(ORREG1, OHWCST16, OHWCST16, OWREG1),
11779573673dSchristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
11789573673dSchristos INSNE(extu, hwcst24, s, s2ext, 1cycle, C64XP, 0,
11799573673dSchristos      FIX1(FIX(op, 0x3)),
11809573673dSchristos      OP4(ORREG1, OHWCST24, OHWCST24, OWREG1),
11819573673dSchristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
11829573673dSchristos INSN(extu, s, sc5, 1cycle, C64XP, 0,
11839573673dSchristos      FIX1(FIX(op, 0)),
11849573673dSchristos      OP4(ORREG1, OACST, OHWCST31, OWREG1Z),
11859573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1)))
11869573673dSchristos /**/
11879573673dSchristos 
118845548106Schristos INSN(gmpy, m, 1_or_2_src, 4cycle, C64XP, TIC6X_FLAG_NO_CROSS,
118945548106Schristos      FIX2(FIX(op, 0x1f), FIX(x, 0)),
119045548106Schristos      OP3(ORREG1, ORREG1, OWREG4),
119145548106Schristos      ENC4(ENC(s, fu, 0), ENC(src1, reg, 0), ENC(src2, reg, 1),
119245548106Schristos 	  ENC(dst, reg, 2)))
119345548106Schristos 
119445548106Schristos /* This instruction can be predicated as usual; SPRUFE8 is incorrect
119545548106Schristos    where it shows the "z" field as fixed to 1.  */
119645548106Schristos INSN(gmpy4, m, compound, 4cycle, C64X, 0,
119745548106Schristos      FIX1(FIX(op, 0x11)),
119845548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
119945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
120045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
120145548106Schristos 
120245548106Schristos INSN(idle, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MCNOP,
120345548106Schristos      FIX2(FIX(s, 0), FIX(op, 0xf)),
120445548106Schristos      OP0(),
120545548106Schristos      ENC0())
120645548106Schristos 
120745548106Schristos INSN(intdp, l, 1_or_2_src, intdp, C67X, 0,
120845548106Schristos      FIX2(FIX(op, 0x39), FIX(src1, 0)),
120945548106Schristos      OP2(ORXREG1, OWREGD45),
121045548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
121145548106Schristos 	  ENC(dst, reg, 1)))
121245548106Schristos 
121345548106Schristos INSN(intdpu, l, 1_or_2_src, intdp, C67X, 0,
121445548106Schristos      FIX2(FIX(op, 0x3b), FIX(src1, 0)),
121545548106Schristos      OP2(ORXREG1, OWREGD45),
121645548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
121745548106Schristos 	  ENC(dst, reg, 1)))
121845548106Schristos 
121945548106Schristos INSN(intsp, l, 1_or_2_src, 4cycle, C67X, 0,
122045548106Schristos      FIX2(FIX(op, 0x4a), FIX(src1, 0)),
122145548106Schristos      OP2(ORXREG1, OWREG4),
122245548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
122345548106Schristos 	  ENC(dst, reg, 1)))
122445548106Schristos 
122545548106Schristos INSN(intspu, l, 1_or_2_src, 4cycle, C67X, 0,
122645548106Schristos      FIX2(FIX(op, 0x49), FIX(src1, 0)),
122745548106Schristos      OP2(ORXREG1, OWREG4),
122845548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
122945548106Schristos 	  ENC(dst, reg, 1)))
123045548106Schristos 
123145548106Schristos INSN(ldb, d, load_store, load, C62X,
123245548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
123345548106Schristos      FIX2(FIX(op, 2), FIX(r, 0)),
123445548106Schristos      OP2(ORMEMSB, OWDREG5),
123545548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
123645548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
123745548106Schristos 	  ENC(srcdst, reg, 1)))
123845548106Schristos INSN(ldb, d, load_store_long, load, C62X,
123945548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
124045548106Schristos      FIX1(FIX(op, 2)),
124145548106Schristos      OP2(ORMEMLB, OWDREG5),
124245548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
124345548106Schristos 	  ENC(dst, reg, 1)))
124445548106Schristos 
12459573673dSchristos /* 16 bits insn */
12469573673dSchristos INSN(ldb, d, doff4_dsz_x01, load, C64XP,
12479573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
12489573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
12499573673dSchristos      OP2(ORMEMSB, OWTREG5),
12509573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
12519573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
12529573673dSchristos INSN(ldb, d, dind_dsz_x01, load, C64XP,
12539573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
12549573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
12559573673dSchristos      OP2(ORMEMSB, OWTREG5),
12569573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
12579573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
12589573673dSchristos INSN(ldb, d, dinc_dsz_x01, load, C64XP,
12599573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
12609573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
12619573673dSchristos      OP2(ORMEMSB, OWTREG5),
12629573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
12639573673dSchristos           ENC(ptr, reg_ptr, 0),  ENC(cst, mem_offset_minus_one, 0)))
12649573673dSchristos INSN(ldb, d, ddec_dsz_x01, load, C64XP,
12659573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
12669573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
12679573673dSchristos      OP2(ORMEMSB, OWTREG5),
12689573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
12699573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
12709573673dSchristos /**/
12719573673dSchristos 
127245548106Schristos INSN(ldbu, d, load_store, load, C62X,
127345548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
127445548106Schristos      FIX2(FIX(op, 1), FIX(r, 0)),
127545548106Schristos      OP2(ORMEMSB, OWDREG5),
127645548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
127745548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
127845548106Schristos 	  ENC(srcdst, reg, 1)))
127945548106Schristos INSN(ldbu, d, load_store_long, load, C62X,
128045548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
128145548106Schristos      FIX1(FIX(op, 1)),
128245548106Schristos      OP2(ORMEMLB, OWDREG5),
128345548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
128445548106Schristos 	  ENC(dst, reg, 1)))
128545548106Schristos 
12869573673dSchristos /* 16 bits insn */
12879573673dSchristos INSN(ldbu, d, dinc_dsz_000, load, C64XP,
12889573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
12899573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
12909573673dSchristos      OP2(ORMEMSB, OWTREG5),
12919573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_minus_one, 0),
12929573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
12939573673dSchristos INSN(ldbu, d, dind_dsz_000, load, C64XP,
12949573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
12959573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
12969573673dSchristos      OP2(ORMEMSB, OWTREG5),
12979573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 0),
12989573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
12999573673dSchristos INSN(ldbu, d, doff4_dsz_000, load, C64XP,
13009573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
13019573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
13029573673dSchristos      OP2(ORMEMSB, OWTREG5),
13039573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
13049573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
13059573673dSchristos INSN(ldbu, d, ddec_dsz_000, load, C64XP,
13069573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
13079573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
13089573673dSchristos      OP2(ORMEMSB, OWTREG5),
13099573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_minus_one, 0),
13109573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
13119573673dSchristos /**/
13129573673dSchristos 
131345548106Schristos INSN(lddw, d, load_store, load, C64X_AND_C67X,
131445548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS,
131545548106Schristos      FIX2(FIX(op, 6), FIX(r, 1)),
131645548106Schristos      OP2(ORMEMSD, OWDREGD5),
131745548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
131845548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
131945548106Schristos 	  ENC(srcdst, reg, 1)))
132045548106Schristos 
13219573673dSchristos /* 16 bits insn */
13229573673dSchristos INSN(lddw, d, dpp, load, C64XP,
13239573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREINCR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
13249573673dSchristos      FIX2(FIX(op, 1), FIX(dw, 1)),
13259573673dSchristos      OP2(ORMEMSD, OWDREGD5),
13269573673dSchristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
13279573673dSchristos 	  ENC(cst, mem_offset_minus_one, 0)))
13289573673dSchristos INSN(lddw, d, ddecdw, load, C64XP,
13299573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
13309573673dSchristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
13319573673dSchristos      OP2(ORMEMSD, OWTREGD5),
13329573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
13339573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
13349573673dSchristos INSN(lddw, d, dincdw, load, C64XP,
13359573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
13369573673dSchristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
13379573673dSchristos      OP2(ORMEMSD, OWTREGD5),
13389573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
13399573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
13409573673dSchristos INSN(lddw, d, dinddw, load, C64XP,
13419573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
13429573673dSchristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
13439573673dSchristos      OP2(ORMEMSD, OWTREGD5),
13449573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 0),
13459573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
13469573673dSchristos INSN(lddw, d, doff4dw, load, C64XP,
13479573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
13489573673dSchristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
13499573673dSchristos      OP2(ORMEMSD, OWTREGD5),
13509573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
13519573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
13529573673dSchristos /**/
13539573673dSchristos 
135445548106Schristos INSN(ldh, d, load_store, load, C62X,
135545548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
135645548106Schristos      FIX2(FIX(op, 4), FIX(r, 0)),
135745548106Schristos      OP2(ORMEMSH, OWDREG5),
135845548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
135945548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
136045548106Schristos 	  ENC(srcdst, reg, 1)))
136145548106Schristos INSN(ldh, d, load_store_long, load, C62X,
136245548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
136345548106Schristos      FIX1(FIX(op, 4)),
136445548106Schristos      OP2(ORMEMLH, OWDREG5),
136545548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
136645548106Schristos 	  ENC(dst, reg, 1)))
136745548106Schristos 
13689573673dSchristos /* 16 bits insn */
13699573673dSchristos INSN(ldh, d, doff4_dsz_x11, load, C64XP,
13709573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
13719573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
13729573673dSchristos      OP2(ORMEMSH, OWTREG5),
13739573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
13749573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
13759573673dSchristos INSN(ldh, d, dind_dsz_x11, load, C64XP,
13769573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
13779573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
13789573673dSchristos      OP2(ORMEMSH, OWTREG5),
13799573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
13809573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
13819573673dSchristos INSN(ldh, d, dinc_dsz_x11, load, C64XP,
13829573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
13839573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
13849573673dSchristos      OP2(ORMEMSH, OWTREG5),
13859573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
13869573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
13879573673dSchristos INSN(ldh, d, ddec_dsz_x11, load, C64XP,
13889573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
13899573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
13909573673dSchristos      OP2(ORMEMSH, OWTREG5),
13919573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
13929573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
13939573673dSchristos /**/
13949573673dSchristos 
139545548106Schristos INSN(ldhu, d, load_store, load, C62X,
139645548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
139745548106Schristos      FIX2(FIX(op, 0), FIX(r, 0)),
139845548106Schristos      OP2(ORMEMSH, OWDREG5),
139945548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
140045548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
140145548106Schristos 	  ENC(srcdst, reg, 1)))
140245548106Schristos INSN(ldhu, d, load_store_long, load, C62X,
140345548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
140445548106Schristos      FIX1(FIX(op, 0)),
140545548106Schristos      OP2(ORMEMLH, OWDREG5),
140645548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
140745548106Schristos 	  ENC(dst, reg, 1)))
140845548106Schristos 
14099573673dSchristos /* 16 bits insn */
14109573673dSchristos INSN(ldhu, d, doff4_dsz_010, load, C64XP,
14119573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
14129573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14139573673dSchristos      OP2(ORMEMSH, OWTREG5),
14149573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
14159573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
14169573673dSchristos INSN(ldhu, d, dind_dsz_010, load, C64XP,
14179573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
14189573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14199573673dSchristos      OP2(ORMEMSH, OWTREG5),
14209573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
14219573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
14229573673dSchristos INSN(ldhu, d, dinc_dsz_010, load, C64XP,
14239573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
14249573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14259573673dSchristos      OP2(ORMEMSH, OWTREG5),
14269573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
14279573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
14289573673dSchristos INSN(ldhu, d, ddec_dsz_010, load, C64XP,
14299573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
14309573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14319573673dSchristos      OP2(ORMEMSH, OWTREG5),
14329573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
14339573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
14349573673dSchristos /**/
14359573673dSchristos 
143645548106Schristos INSN(ldndw, d, load_nonaligned, load, C64X,
143745548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
143845548106Schristos      FIX0(),
143945548106Schristos      OP2(ORMEMND, OWDREGD5),
144045548106Schristos      ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
144145548106Schristos 	  ENC(offsetR, mem_offset_noscale, 0), ENC(baseR, reg, 0),
144245548106Schristos 	  ENC(sc, scaled, 0), ENC(dst, reg_shift, 1)))
144345548106Schristos 
14449573673dSchristos /* 16 bits insn */
14459573673dSchristos INSN(ldndw, d, ddecdw, load, C64XP,
14469573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
14479573673dSchristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
14489573673dSchristos      OP2(ORMEMND, OWTREGD5),
14499573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
14509573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one_noscale, 0)))
14519573673dSchristos INSN(ldndw, d, dincdw, load, C64XP,
14529573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
14539573673dSchristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
14549573673dSchristos      OP2(ORMEMND, OWTREGD5),
14559573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
14569573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one_noscale, 0)))
14579573673dSchristos INSN(ldndw, d, dinddw, load, C64XP,
14589573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
14599573673dSchristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
14609573673dSchristos      OP2(ORMEMND, OWTREGD5),
14619573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset_noscale, 0),
14629573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
14639573673dSchristos INSN(ldndw, d, doff4dw, load, C64XP,
14649573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
14659573673dSchristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
14669573673dSchristos      OP2(ORMEMND, OWTREGD5),
14679573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_noscale, 0),
14689573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
14699573673dSchristos /**/
14709573673dSchristos 
147145548106Schristos INSN(ldnw, d, load_store, load, C64X,
147245548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
147345548106Schristos      FIX2(FIX(op, 3), FIX(r, 1)),
147445548106Schristos      OP2(ORMEMSW, OWDREG5),
147545548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
147645548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
147745548106Schristos 	  ENC(srcdst, reg, 1)))
147845548106Schristos 
14799573673dSchristos /* 16 bits insn */
14809573673dSchristos INSN(ldnw, d, doff4_dsz_110, load, C64XP,
14819573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
14829573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14839573673dSchristos      OP2(ORMEMSW, OWTREG5),
14849573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
14859573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
14869573673dSchristos INSN(ldnw, d, dind_dsz_110, load, C64XP,
14879573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
14889573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14899573673dSchristos      OP2(ORMEMSW, OWTREG5),
14909573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
14919573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
14929573673dSchristos INSN(ldnw, d, dinc_dsz_110, load, C64XP,
14939573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
14949573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
14959573673dSchristos      OP2(ORMEMSW, OWTREG5),
14969573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
14979573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
14989573673dSchristos INSN(ldnw, d, ddec_dsz_110, load, C64XP,
14999573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
15009573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
15019573673dSchristos      OP2(ORMEMSW, OWTREG5),
15029573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15039573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
15049573673dSchristos /**/
15059573673dSchristos 
150645548106Schristos INSN(ldw, d, load_store, load, C62X,
150745548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
150845548106Schristos      FIX2(FIX(op, 6), FIX(r, 0)),
150945548106Schristos      OP2(ORMEMSW, OWDREG5),
151045548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
151145548106Schristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
151245548106Schristos 	  ENC(srcdst, reg, 1)))
151345548106Schristos INSN(ldw, d, load_store_long, load, C62X,
151445548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
151545548106Schristos      FIX1(FIX(op, 6)),
151645548106Schristos      OP2(ORMEMLW, OWDREG5),
151745548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 0),
151845548106Schristos 	  ENC(dst, reg, 1)))
151945548106Schristos 
15209573673dSchristos /* 16 bits insn */
15219573673dSchristos INSN(ldw, d, doff4_dsz_0xx, load, C64XP,
15229573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
15239573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 0)),
15249573673dSchristos      OP2(ORMEMSW, OWTREG5),
15259573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15269573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
15279573673dSchristos INSN(ldw, d, doff4_dsz_100, load, C64XP,
15289573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
15299573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
15309573673dSchristos      OP2(ORMEMSW, OWTREG5),
15319573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15329573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
15339573673dSchristos INSN(ldw, d, dind_dsz_0xx, load, C64XP,
15349573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
15359573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 0)),
15369573673dSchristos      OP2(ORMEMSW, OWTREG5),
15379573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15389573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
15399573673dSchristos INSN(ldw, d, dind_dsz_100, load, C64XP,
15409573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
15419573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
15429573673dSchristos      OP2(ORMEMSW, OWTREG5),
15439573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15449573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
15459573673dSchristos INSN(ldw, d, dinc_dsz_0xx, load, C64XP,
15469573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
15479573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 0)),
15489573673dSchristos      OP2(ORMEMSW, OWTREG5),
15499573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15509573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
15519573673dSchristos INSN(ldw, d, dinc_dsz_100, load, C64XP,
15529573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
15539573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
15549573673dSchristos      OP2(ORMEMSW, OWTREG5),
15559573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15569573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
15579573673dSchristos INSN(ldw, d, ddec_dsz_0xx, load, C64XP,
15589573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
15599573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 0)),
15609573673dSchristos      OP2(ORMEMSW, OWTREG5),
15619573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15629573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
15639573673dSchristos INSN(ldw, d, ddec_dsz_100, load, C64XP,
15649573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
15659573673dSchristos      FIX2(FIX(op, 1), FIX(sz, 1)),
15669573673dSchristos      OP2(ORMEMSW, OWTREG5),
15679573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15689573673dSchristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
15699573673dSchristos INSN(ldw, d, dpp, load, C64XP,
15709573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREINCR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
15719573673dSchristos      FIX2(FIX(op, 1), FIX(dw, 0)),
15729573673dSchristos      OP2(ORMEMSW, OWTREG5),
15739573673dSchristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0),  ENC(srcdst, reg, 1),
15749573673dSchristos 	  ENC(cst, mem_offset_minus_one, 0)))
15759573673dSchristos INSN(ldw, d, dstk, load, C64XP,
15769573673dSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE)|TIC6X_FLAG_INSN16_B15PTR,
15779573673dSchristos      FIX2(FIX(op, 0x1), FIX(s, 1)),
15789573673dSchristos      OP2(ORMEMSW, OWTREG5),
15799573673dSchristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
15809573673dSchristos 	  ENC(cst, mem_offset, 0)))
15819573673dSchristos /**/
15829573673dSchristos 
1583883529b6Schristos INSN(ll, d, 1_or_2_src, load, C64XP,
158445548106Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
158545548106Schristos      FIX3(FIX(s, 1), FIX(op, 0xc), FIX(src1, 0)),
158645548106Schristos      OP2(ORMEMDW, OWDREG5),
158745548106Schristos      ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
158845548106Schristos 
158945548106Schristos INSNE(lmbd, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
159045548106Schristos       FIX1(FIX(op, 0x6b)),
159145548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
159245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
159345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
159445548106Schristos INSNE(lmbd, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
159545548106Schristos       FIX1(FIX(op, 0x6a)),
159645548106Schristos       OP3(OACST, ORXREG1, OWREG1),
159745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
159845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
159945548106Schristos 
160045548106Schristos INSN(max2, l, 1_or_2_src, 1cycle, C64X, 0,
160145548106Schristos      FIX1(FIX(op, 0x42)),
160245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
160345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
160445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
160545548106Schristos INSN(max2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
160645548106Schristos      FIX1(FIX(op, 0xd)),
160745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
160845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
160945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
161045548106Schristos 
161145548106Schristos INSN(maxu4, l, 1_or_2_src, 1cycle, C64X, 0,
161245548106Schristos      FIX1(FIX(op, 0x43)),
161345548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
161445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
161545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
161645548106Schristos 
161745548106Schristos INSN(min2, l, 1_or_2_src, 1cycle, C64X, 0,
161845548106Schristos      FIX1(FIX(op, 0x41)),
161945548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
162045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
162145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
162245548106Schristos INSN(min2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
162345548106Schristos      FIX1(FIX(op, 0xc)),
162445548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
162545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
162645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
162745548106Schristos 
162845548106Schristos INSN(minu4, l, 1_or_2_src, 1cycle, C64X, 0,
162945548106Schristos      FIX1(FIX(op, 0x48)),
163045548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
163145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
163245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
163345548106Schristos 
163445548106Schristos INSNE(mpy, m_sl16_xsl16_si, m, mpy, 1616_m, C62X, 0,
163545548106Schristos       FIX1(FIX(op, 0x19)),
163645548106Schristos       OP3(ORREG1, ORXREG1, OWREG2),
163745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
163845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
163945548106Schristos INSNE(mpy, m_s5_xsl16_si, m, mpy, 1616_m, C62X, 0,
164045548106Schristos       FIX1(FIX(op, 0x18)),
164145548106Schristos       OP3(OACST, ORXREG1, OWREG2),
164245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
164345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
164445548106Schristos 
16459573673dSchristos /* 16-bit insn.  */
16469573673dSchristos INSN(mpy, m, m3_sat_0, 1616_m, C67X, 0,
16479573673dSchristos       FIX1(FIX(op, 0x0)),
16489573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
16499573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16509573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
16519573673dSchristos 
16529573673dSchristos INSN(mpydp, m, mpy, mpydp, C67X, 0,
16539573673dSchristos      FIX1(FIX(op, 0x0e)),
16549573673dSchristos      OP3(ORREGD1234, ORXREGD1324, OWREGD910),
16559573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16569573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
165745548106Schristos 
165845548106Schristos INSN(mpyh, m, mpy, 1616_m, C62X, 0,
165945548106Schristos      FIX1(FIX(op, 0x01)),
166045548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
166145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
166245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
166345548106Schristos 
16649573673dSchristos /* 16 bits insn */
16659573673dSchristos INSN(mpyh, m, m3_sat_0, 1616_m, C67X, 0,
16669573673dSchristos       FIX1(FIX(op, 0x1)),
16679573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
16689573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16699573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
16709573673dSchristos /**/
16719573673dSchristos 
167245548106Schristos INSN(mpyhi, m, compound, 4cycle, C64X, 0,
167345548106Schristos      FIX1(FIX(op, 0x14)),
167445548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
167545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
167645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
167745548106Schristos 
167845548106Schristos INSN(mpyhir, m, compound, 4cycle, C64X, 0,
167945548106Schristos      FIX1(FIX(op, 0x10)),
168045548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
168145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
168245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
168345548106Schristos 
168445548106Schristos INSN(mpyhl, m, mpy, 1616_m, C62X, 0,
168545548106Schristos      FIX1(FIX(op, 0x09)),
168645548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
168745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
168845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
168945548106Schristos 
16909573673dSchristos /* 16 bits insn */
16919573673dSchristos INSN(mpyhl, m, m3_sat_0, 1616_m, C67X, 0,
16929573673dSchristos       FIX1(FIX(op, 0x3)),
16939573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
16949573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16959573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
16969573673dSchristos /**/
16979573673dSchristos 
169845548106Schristos INSN(mpyhlu, m, mpy, 1616_m, C62X, 0,
169945548106Schristos      FIX1(FIX(op, 0x0f)),
170045548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
170145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
170245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
170345548106Schristos 
170445548106Schristos INSN(mpyhslu, m, mpy, 1616_m, C62X, 0,
170545548106Schristos      FIX1(FIX(op, 0x0b)),
170645548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
170745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
170845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
170945548106Schristos 
171045548106Schristos INSN(mpyhsu, m, mpy, 1616_m, C62X, 0,
171145548106Schristos      FIX1(FIX(op, 0x03)),
171245548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
171345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
171445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
171545548106Schristos 
171645548106Schristos INSN(mpyhu, m, mpy, 1616_m, C62X, 0,
171745548106Schristos      FIX1(FIX(op, 0x07)),
171845548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
171945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
172045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
172145548106Schristos 
172245548106Schristos INSN(mpyhuls, m, mpy, 1616_m, C62X, 0,
172345548106Schristos      FIX1(FIX(op, 0x0d)),
172445548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
172545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
172645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
172745548106Schristos 
172845548106Schristos INSN(mpyhus, m, mpy, 1616_m, C62X, 0,
172945548106Schristos      FIX1(FIX(op, 0x05)),
173045548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
173145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
173245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
173345548106Schristos 
173445548106Schristos INSNE(mpyi, m_si_xsi_si, m, mpy, mpyi, C67X, 0,
173545548106Schristos       FIX1(FIX(op, 0x04)),
173645548106Schristos       OP3(ORREG14, ORXREG14, OWREG9),
173745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
173845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
173945548106Schristos INSNE(mpyi, m_s5_xsi_si, m, mpy, mpyi, C67X, 0,
174045548106Schristos       FIX1(FIX(op, 0x06)),
174145548106Schristos       OP3(OACST, ORXREG14, OWREG9),
174245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
174345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
174445548106Schristos 
174545548106Schristos INSNE(mpyid, m_si_xsi_sll, m, mpy, mpyid, C67X, 0,
174645548106Schristos       FIX1(FIX(op, 0x08)),
174745548106Schristos       OP3(ORREG14, ORXREG14, OWREGD910),
174845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
174945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
175045548106Schristos INSNE(mpyid, m_s5_xsi_sll, m, mpy, mpyid, C67X, 0,
175145548106Schristos       FIX1(FIX(op, 0x0c)),
175245548106Schristos       OP3(OACST, ORXREG14, OWREGD910),
175345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
175445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
175545548106Schristos 
175645548106Schristos INSN(mpyih, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
175745548106Schristos      FIX1(FIX(op, 0x14)),
175845548106Schristos      OP3(ORXREG1, ORREG1, OWREGD4),
175945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
176045548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
176145548106Schristos 
176245548106Schristos INSN(mpyihr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
176345548106Schristos      FIX1(FIX(op, 0x10)),
176445548106Schristos      OP3(ORXREG1, ORREG1, OWREG4),
176545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
176645548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
176745548106Schristos 
176845548106Schristos INSN(mpyil, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
176945548106Schristos      FIX1(FIX(op, 0x15)),
177045548106Schristos      OP3(ORXREG1, ORREG1, OWREGD4),
177145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
177245548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
177345548106Schristos 
177445548106Schristos INSN(mpyilr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
177545548106Schristos      FIX1(FIX(op, 0x0e)),
177645548106Schristos      OP3(ORXREG1, ORREG1, OWREG4),
177745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
177845548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
177945548106Schristos 
178045548106Schristos INSN(mpylh, m, mpy, 1616_m, C62X, 0,
178145548106Schristos      FIX1(FIX(op, 0x11)),
178245548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
178345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
178445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
178545548106Schristos 
17869573673dSchristos /* 16 bits insn */
17879573673dSchristos INSN(mpylh, m, m3_sat_0, 1616_m, C67X, 0,
17889573673dSchristos       FIX1(FIX(op, 0x2)),
17899573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
17909573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
17919573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
17929573673dSchristos /**/
17939573673dSchristos 
179445548106Schristos INSN(mpylhu, m, mpy, 1616_m, C62X, 0,
179545548106Schristos      FIX1(FIX(op, 0x17)),
179645548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
179745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
179845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
179945548106Schristos 
180045548106Schristos INSN(mpyli, m, compound, 4cycle, C64X, 0,
180145548106Schristos      FIX1(FIX(op, 0x15)),
180245548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
180345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
180445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
180545548106Schristos 
180645548106Schristos INSN(mpylir, m, compound, 4cycle, C64X, 0,
180745548106Schristos      FIX1(FIX(op, 0x0e)),
180845548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
180945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
181045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
181145548106Schristos 
181245548106Schristos INSN(mpylshu, m, mpy, 1616_m, C62X, 0,
181345548106Schristos      FIX1(FIX(op, 0x13)),
181445548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
181545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
181645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
181745548106Schristos 
181845548106Schristos INSN(mpyluhs, m, mpy, 1616_m, C62X, 0,
181945548106Schristos      FIX1(FIX(op, 0x15)),
182045548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
182145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
182245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
182345548106Schristos 
182445548106Schristos INSN(mpysp, m, mpy, 4cycle, C67X, 0,
182545548106Schristos      FIX1(FIX(op, 0x1c)),
182645548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
182745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
182845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
182945548106Schristos 
183045548106Schristos /* Contrary to SPRU733A, MPYSPDP and MPYSP2DP are on both C67X and
183145548106Schristos    C67X+.  */
183245548106Schristos INSN(mpyspdp, m, compound, mpyspdp, C67X, 0,
183345548106Schristos      FIX1(FIX(op, 0x16)),
183445548106Schristos      OP3(ORREG12, ORXREGD12, OWREGD67),
183545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
183645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
183745548106Schristos 
183845548106Schristos INSN(mpysp2dp, m, compound, mpyspdp, C67X, 0,
183945548106Schristos      FIX1(FIX(op, 0x17)),
184045548106Schristos      OP3(ORREG1, ORXREG1, OWREGD45),
184145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
184245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
184345548106Schristos 
184445548106Schristos INSNE(mpysu, m_sl16_xul16_si, m, mpy, 1616_m, C62X, 0,
184545548106Schristos       FIX1(FIX(op, 0x1b)),
184645548106Schristos       OP3(ORREG1, ORXREG1, OWREG2),
184745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
184845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
184945548106Schristos INSNE(mpysu, m_s5_xul16_si, m, mpy, 1616_m, C62X, 0,
185045548106Schristos       FIX1(FIX(op, 0x1e)),
185145548106Schristos       OP3(OACST, ORXREG1, OWREG2),
185245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
185345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
185445548106Schristos 
185545548106Schristos INSN(mpysu4, m, compound, 4cycle, C64X, 0,
185645548106Schristos      FIX1(FIX(op, 0x05)),
185745548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
185845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
185945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
186045548106Schristos 
186145548106Schristos INSN(mpyu, m, mpy, 1616_m, C62X, 0,
186245548106Schristos      FIX1(FIX(op, 0x1f)),
186345548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
186445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
186545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
186645548106Schristos 
186745548106Schristos INSN(mpyu4, m, compound, 4cycle, C64X, 0,
186845548106Schristos      FIX1(FIX(op, 0x04)),
186945548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
187045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
187145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
187245548106Schristos 
187345548106Schristos INSN(mpyus, m, mpy, 1616_m, C62X, 0,
187445548106Schristos      FIX1(FIX(op, 0x1d)),
187545548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
187645548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
187745548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
187845548106Schristos 
187945548106Schristos INSN(mpyus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
188045548106Schristos      FIX1(FIX(op, 0x05)),
188145548106Schristos      OP3(ORXREG1, ORREG1, OWREGD4),
188245548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
188345548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
188445548106Schristos 
188545548106Schristos INSN(mpy2, m, compound, 4cycle, C64X, 0,
188645548106Schristos      FIX1(FIX(op, 0x00)),
188745548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
188845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
188945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
189045548106Schristos 
189145548106Schristos INSN(mpy2ir, m, 1_or_2_src, 4cycle, C64XP, 0,
189245548106Schristos      FIX1(FIX(op, 0x0f)),
189345548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
189445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
189545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
189645548106Schristos 
189745548106Schristos INSNE(mpy32, 32_32_32, m, mpy, 4cycle, C64XP, 0,
189845548106Schristos       FIX1(FIX(op, 0x10)),
189945548106Schristos       OP3(ORREG1, ORXREG1, OWREG4),
190045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
190145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
190245548106Schristos INSNE(mpy32, 32_32_64, m, mpy, 4cycle, C64XP, 0,
190345548106Schristos       FIX1(FIX(op, 0x14)),
190445548106Schristos       OP3(ORREG1, ORXREG1, OWREGD4),
190545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
190645548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
190745548106Schristos 
190845548106Schristos INSN(mpy32su, m, mpy, 4cycle, C64XP, 0,
190945548106Schristos      FIX1(FIX(op, 0x16)),
191045548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
191145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
191245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
191345548106Schristos 
191445548106Schristos INSN(mpy32u, m, compound, 4cycle, C64XP, 0,
191545548106Schristos      FIX1(FIX(op, 0x18)),
191645548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
191745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
191845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
191945548106Schristos 
192045548106Schristos INSN(mpy32us, m, compound, 4cycle, C64XP, 0,
192145548106Schristos      FIX1(FIX(op, 0x19)),
192245548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
192345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
192445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
192545548106Schristos 
192645548106Schristos /* "or" forms of "mv" are preferred over "add" forms when available
192745548106Schristos    because "or" uses less power.  However, 40-bit moves are only
192845548106Schristos    available through "add", and before C64X D-unit moves are only
192945548106Schristos    available through "add" (without cross paths being available).  */
193045548106Schristos INSNE(mv, l_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
193145548106Schristos       FIX2(FIX(op, 0x7e), FIX(src1, 0)),
193245548106Schristos       OP2(ORXREG1, OWREG1),
193345548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
193445548106Schristos 	   ENC(dst, reg, 1)))
193545548106Schristos INSNE(mv, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
193645548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
193745548106Schristos       FIX3(FIX(op, 0x20), FIX(x, 0), FIX(src1, 0)),
193845548106Schristos       OP2(ORREGL1, OWREGL1),
193945548106Schristos       ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
194045548106Schristos INSNE(mv, s_xui_ui, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
194145548106Schristos       FIX2(FIX(op, 0x1a), FIX(src1, 0)),
194245548106Schristos       OP2(ORXREG1, OWREG1),
194345548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
194445548106Schristos 	   ENC(dst, reg, 1)))
194545548106Schristos INSNE(mv, d_si_si, d, 1_or_2_src, 1cycle, C62X,
194645548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(0),
194745548106Schristos       FIX2(FIX(op, 0x12), FIX(src1, 0)),
194845548106Schristos       OP2(ORREG1, OWREG1),
194945548106Schristos       ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
195045548106Schristos INSNE(mv, d_xui_ui, d, ext_1_or_2_src, 1cycle, C64X,
195145548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
195245548106Schristos       FIX2(FIX(op, 0x3), FIX(src1, 0)),
195345548106Schristos       OP2(ORXREG1, OWREG1),
195445548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
195545548106Schristos 	   ENC(dst, reg, 1)))
195645548106Schristos 
19579573673dSchristos /* 16 bits insn */
19589573673dSchristos INSNU(mv, l, lsdmvto, 1cycle, C64X, 0,
19599573673dSchristos       FIX1(FIX(unit, 0x0)),
19609573673dSchristos       OP2(ORXREG1, OWREG1),
19619573673dSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
19629573673dSchristos 
19639573673dSchristos INSNU(mv, s, lsdmvto, 1cycle, C64X, 0,
19649573673dSchristos       FIX1(FIX(unit, 0x1)),
19659573673dSchristos       OP2(ORXREG1, OWREG1),
19669573673dSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
19679573673dSchristos 
19689573673dSchristos INSNU(mv, d, lsdmvto, 1cycle, C64X, 0,
19699573673dSchristos       FIX1(FIX(unit, 0x2)),
19709573673dSchristos       OP2(ORXREG1, OWREG1),
19719573673dSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
19729573673dSchristos 
19739573673dSchristos INSNU(mv, l, lsdmvfr, 1cycle, C64X, 0,
19749573673dSchristos       FIX1(FIX(unit, 0x0)),
19759573673dSchristos       OP2(ORXREG1, OWREG1),
19769573673dSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
19779573673dSchristos 
19789573673dSchristos INSNU(mv, s, lsdmvfr, 1cycle, C64X, 0,
19799573673dSchristos       FIX1(FIX(unit, 0x1)),
19809573673dSchristos       OP2(ORXREG1, OWREG1),
19819573673dSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
19829573673dSchristos 
19839573673dSchristos INSNU(mv, d, lsdmvfr, 1cycle, C64X, 0,
19849573673dSchristos       FIX1(FIX(unit, 0x2)),
19859573673dSchristos       OP2(ORXREG1, OWREG1),
19869573673dSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
19879573673dSchristos /**/
19889573673dSchristos 
198945548106Schristos INSNE(mvc, from_cr, s, 1_or_2_src, 1cycle, C62X,
199045548106Schristos       TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_NO_CROSS,
199145548106Schristos       FIX3(FIX(s, 1), FIX(op, 0x0f), FIX(x, 0)),
199245548106Schristos       OP2(ORCREG1, OWREG1),
199345548106Schristos       ENC3(ENC(src1, crhi, 0), ENC(src2, crlo, 0), ENC(dst, reg, 1)))
199445548106Schristos INSNE(mvc, to_cr, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_SIDE_B_ONLY,
199545548106Schristos       FIX2(FIX(s, 1), FIX(op, 0x0e)),
199645548106Schristos       OP2(ORXREG1, OWCREG1),
199745548106Schristos       ENC4(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, crhi, 1),
199845548106Schristos 	   ENC(dst, crlo, 1)))
199945548106Schristos 
20009573673dSchristos /* 16 bits insn */
20019573673dSchristos INSN(mvc, s, sx1, 1cycle, C64XP,
20029573673dSchristos       TIC6X_FLAG_NO_CROSS,
20039573673dSchristos       FIX1(FIX(op, 0x6)),
20049573673dSchristos       OP2(ORREG1B, OWILC1),
20059573673dSchristos       ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 0)))
20069573673dSchristos /**/
20079573673dSchristos 
200845548106Schristos INSN(mvd, m, unary, 4cycle, C64X, 0,
200945548106Schristos      FIX1(FIX(op, 0x1a)),
201045548106Schristos      OP2(ORXREG1, OWREG4),
201145548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
201245548106Schristos 	  ENC(dst, reg, 1)))
201345548106Schristos 
201445548106Schristos INSN(mvk, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
201545548106Schristos      FIX1(FIX(h, 0)),
201645548106Schristos      OP2(OLCST, OWREG1),
201745548106Schristos      ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
201845548106Schristos INSN(mvk, l, unary, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
201945548106Schristos      FIX2(FIX(x, 0), FIX(op, 0x05)),
202045548106Schristos      OP2(OACST, OWREG1),
202145548106Schristos      ENC3(ENC(s, fu, 0), ENC(src2, scst, 0), ENC(dst, reg, 1)))
202245548106Schristos INSN(mvk, d, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
202345548106Schristos      FIX2(FIX(op, 0x00), FIX(src2, 0)),
202445548106Schristos      OP2(OACST, OWREG1),
202545548106Schristos      ENC3(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(dst, reg, 1)))
202645548106Schristos 
20279573673dSchristos /* 16 bits insn */
20289573673dSchristos INSN(mvk, l, lx5, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20299573673dSchristos      FIX0(),
20309573673dSchristos      OP2(OLCST, OWREG1),
20319573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
20329573673dSchristos INSN(mvk, s, smvk8, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20339573673dSchristos      FIX0(),
20349573673dSchristos      OP2(OLCST, OWREG1),
20359573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
20369573673dSchristos INSNU(mvk, l, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
20379573673dSchristos      FIX1(FIX(unit, 0x0)),
20389573673dSchristos      OP2(OACST, OWREG1),
20399573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
20409573673dSchristos INSNU(mvk, s, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
20419573673dSchristos      FIX1(FIX(unit, 0x1)),
20429573673dSchristos      OP2(OACST, OWREG1),
20439573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
20449573673dSchristos INSNU(mvk, d, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
20459573673dSchristos      FIX1(FIX(unit, 0x2)),
20469573673dSchristos      OP2(OACST, OWREG1),
20479573673dSchristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
20489573673dSchristos INSNUE(mvk, zero, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20499573673dSchristos      FIX2(FIX(op, 0), FIX(unit, 0x0)),
20509573673dSchristos      OP2(OHWCST0, OWREG1),
20519573673dSchristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
20529573673dSchristos INSNUE(mvk, zero, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20539573673dSchristos      FIX2(FIX(op, 0), FIX(unit, 0x1)),
20549573673dSchristos      OP2(OHWCST0, OWREG1),
20559573673dSchristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
20569573673dSchristos INSNUE(mvk, zero, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20579573673dSchristos      FIX2(FIX(op, 0), FIX(unit, 0x2)),
20589573673dSchristos      OP2(OHWCST0, OWREG1),
20599573673dSchristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
20609573673dSchristos INSNUE(mvk, one, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20619573673dSchristos      FIX2(FIX(op, 1), FIX(unit, 0x0)),
20629573673dSchristos      OP2(OHWCST1, OWREG1),
20639573673dSchristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
20649573673dSchristos INSNUE(mvk, one, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20659573673dSchristos      FIX2(FIX(op, 1), FIX(unit, 0x1)),
20669573673dSchristos      OP2(OHWCST1, OWREG1),
20679573673dSchristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
20689573673dSchristos INSNUE(mvk, one, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
20699573673dSchristos      FIX2(FIX(op, 1), FIX(unit, 0x2)),
20709573673dSchristos      OP2(OHWCST1, OWREG1),
20719573673dSchristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
20729573673dSchristos /**/
20739573673dSchristos 
207445548106Schristos INSN(mvkh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
207545548106Schristos      FIX1(FIX(h, 1)),
207645548106Schristos      OP2(OLCST, OWREG1),
207745548106Schristos      ENC3(ENC(s, fu, 0), ENC(cst, lcst_high16, 0), ENC(dst, reg, 1)))
207845548106Schristos 
207945548106Schristos INSN(mvklh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
208045548106Schristos      FIX1(FIX(h, 1)),
208145548106Schristos      OP2(OLCST, OWREG1),
208245548106Schristos      ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
208345548106Schristos 
208445548106Schristos INSN(mvkl, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
208545548106Schristos      FIX1(FIX(h, 0)),
208645548106Schristos      OP2(OLCST, OWREG1),
208745548106Schristos      ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
208845548106Schristos 
208945548106Schristos INSNE(neg, s_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
209045548106Schristos       FIX2(FIX(op, 0x16), FIX(src1, 0)),
209145548106Schristos       OP2(ORXREG1, OWREG1),
209245548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
209345548106Schristos 	   ENC(dst, reg, 1)))
209445548106Schristos INSNE(neg, l_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
209545548106Schristos       FIX2(FIX(op, 0x06), FIX(src1, 0)),
209645548106Schristos       OP2(ORXREG1, OWREG1),
209745548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
209845548106Schristos 	   ENC(dst, reg, 1)))
209945548106Schristos INSNE(neg, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
210045548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
210145548106Schristos       FIX2(FIX(op, 0x24), FIX(src1, 0)),
210245548106Schristos       OP2(ORREGL1, OWREGL1),
210345548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
210445548106Schristos 	   ENC(dst, reg, 1)))
210545548106Schristos 
210645548106Schristos INSN(nop, nfu, nop_idle, nop, C62X, 0,
210745548106Schristos      FIX2(FIX(s, 0), RAN(op, 0, 8)),
210845548106Schristos      OP1(OACST),
210945548106Schristos      ENC1(ENC(op, ucst_minus_one, 0)))
211045548106Schristos INSNE(nop, 1, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MACRO,
211145548106Schristos       FIX2(FIX(s, 0), FIX(op, 0)),
211245548106Schristos       OP0(),
211345548106Schristos       ENC0())
211445548106Schristos 
21159573673dSchristos /* 16 bits insn */
21169573673dSchristos /* contrary to sprufe8b.pdf p767, and accordingly to
21179573673dSchristos  * dis6x.exe output, unop3 opcode is decoded as NOP N3 + 1 */
21189573673dSchristos INSN(nop, nfu, unop, nop, C64XP, 0,
21199573673dSchristos      FIX0(),
21209573673dSchristos      OP1(OACST),
21219573673dSchristos      ENC1(ENC(n, ucst_minus_one, 0)))
21229573673dSchristos /**/
21239573673dSchristos 
212445548106Schristos INSNE(norm, l_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
212545548106Schristos       FIX2(FIX(op, 0x63), FIX(src1, 0)),
212645548106Schristos       OP2(ORXREG1, OWREG1),
212745548106Schristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
212845548106Schristos 	   ENC(dst, reg, 1)))
212945548106Schristos INSNE(norm, l_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
213045548106Schristos       FIX3(FIX(op, 0x60), FIX(x, 0), FIX(src1, 0)),
213145548106Schristos       OP2(ORREGL1, OWREG1),
213245548106Schristos       ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
213345548106Schristos 
213445548106Schristos INSN(not, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
213545548106Schristos      FIX2(FIX(op, 0x6e), FIX(src1, 0x1f)),
213645548106Schristos      OP2(ORXREG1, OWREG1),
213745548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
213845548106Schristos 	  ENC(dst, reg, 1)))
213945548106Schristos INSN(not, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
214045548106Schristos      FIX2(FIX(op, 0x0a), FIX(src1, 0x1f)),
214145548106Schristos      OP2(ORXREG1, OWREG1),
214245548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
214345548106Schristos 	  ENC(dst, reg, 1)))
214445548106Schristos INSN(not, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
214545548106Schristos      FIX2(FIX(op, 0xf), FIX(src1, 0x1f)),
214645548106Schristos      OP2(ORXREG1, OWREG1),
214745548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
214845548106Schristos 	  ENC(dst, reg, 1)))
214945548106Schristos 
215045548106Schristos INSNE(or, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
215145548106Schristos       FIX1(FIX(op, 0x2)),
215245548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
215345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
215445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
215545548106Schristos INSNE(or, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
215645548106Schristos       FIX1(FIX(op, 0x3)),
215745548106Schristos       OP3(OACST, ORXREG1, OWREG1),
215845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
215945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
216045548106Schristos INSNE(or, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
216145548106Schristos       FIX1(FIX(op, 0x7f)),
216245548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
216345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
216445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
216545548106Schristos INSNE(or, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
216645548106Schristos       FIX1(FIX(op, 0x7e)),
216745548106Schristos       OP3(OACST, ORXREG1, OWREG1),
216845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
216945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
217045548106Schristos INSNE(or, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
217145548106Schristos       FIX1(FIX(op, 0x1b)),
217245548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
217345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
217445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
217545548106Schristos INSNE(or, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
217645548106Schristos       FIX1(FIX(op, 0x1a)),
217745548106Schristos       OP3(OACST, ORXREG1, OWREG1),
217845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
217945548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
218045548106Schristos 
21819573673dSchristos /* 16 bits insn */
21829573673dSchristos INSN(or, l, l2c, 1cycle, C64XP, 0,
21839573673dSchristos       FIX1(FIX(op, 1)),
21849573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
21859573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
21869573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
21879573673dSchristos /**/
21889573673dSchristos 
218945548106Schristos INSN(pack2, l, 1_or_2_src, 1cycle, C64X, 0,
219045548106Schristos      FIX1(FIX(op, 0x0)),
219145548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
219245548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
219345548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
219445548106Schristos INSN(pack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
219545548106Schristos      FIX1(FIX(op, 0xf)),
219645548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
219745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
219845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
219945548106Schristos 
220045548106Schristos INSN(packh2, l, 1_or_2_src, 1cycle, C64X, 0,
220145548106Schristos      FIX1(FIX(op, 0x1e)),
220245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
220345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
220445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
220545548106Schristos INSN(packh2, s, 1_or_2_src, 1cycle, C64X, 0,
220645548106Schristos      FIX1(FIX(op, 0x9)),
220745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
220845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
220945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
221045548106Schristos 
221145548106Schristos INSN(packh4, l, 1_or_2_src, 1cycle, C64X, 0,
221245548106Schristos      FIX1(FIX(op, 0x69)),
221345548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
221445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
221545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
221645548106Schristos 
221745548106Schristos INSN(packhl2, l, 1_or_2_src, 1cycle, C64X, 0,
221845548106Schristos      FIX1(FIX(op, 0x1c)),
221945548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
222045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
222145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
222245548106Schristos INSN(packhl2, s, 1_or_2_src, 1cycle, C64X, 0,
222345548106Schristos      FIX1(FIX(op, 0x8)),
222445548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
222545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
222645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
222745548106Schristos 
222845548106Schristos INSN(packlh2, l, 1_or_2_src, 1cycle, C64X, 0,
222945548106Schristos      FIX1(FIX(op, 0x1b)),
223045548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
223145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
223245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
223345548106Schristos INSN(packlh2, s, 1_or_2_src, 1cycle, C64X, 0,
223445548106Schristos      FIX1(FIX(op, 0x10)),
223545548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
223645548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
223745548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
223845548106Schristos 
223945548106Schristos INSN(packl4, l, 1_or_2_src, 1cycle, C64X, 0,
224045548106Schristos      FIX1(FIX(op, 0x68)),
224145548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
224245548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
224345548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
224445548106Schristos 
224545548106Schristos INSN(rcpdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
22469573673dSchristos      FIX2(FIX(op, 0x2d), FIX(x, 0)),
224745548106Schristos      OP2(ORREGD1, OWREGD12),
22489573673dSchristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
22499573673dSchristos 	  ENC(dst, reg, 1)))
225045548106Schristos 
225145548106Schristos INSN(rcpsp, s, 1_or_2_src, 1cycle, C67X, 0,
225245548106Schristos      FIX2(FIX(op, 0x3d), FIX(src1, 0)),
225345548106Schristos      OP2(ORXREG1, OWREG1),
225445548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
225545548106Schristos 	  ENC(dst, reg, 1)))
225645548106Schristos 
225745548106Schristos INSN(ret, s, ext_branch_cond_imm, branch, C62X,
225845548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
225945548106Schristos      FIX0(),
226045548106Schristos      OP1(OLCST),
226145548106Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
226245548106Schristos INSN(ret, s, branch, branch, C62X,
226345548106Schristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
226445548106Schristos      FIX1(FIX(s, 1)),
226545548106Schristos      OP1(ORXREG1),
226645548106Schristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
226745548106Schristos INSN(ret, s, b_irp, branch, C62X,
226845548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
226945548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
227045548106Schristos      OP1(ORIRP1),
227145548106Schristos      ENC0())
227245548106Schristos INSN(ret, s, b_nrp, branch, C62X,
227345548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
227445548106Schristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
227545548106Schristos      OP1(ORNRP1),
227645548106Schristos      ENC0())
227745548106Schristos 
227845548106Schristos INSN(retp, s, call_imm_nop, branch, C64XP,
227945548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
228045548106Schristos      FIX1(FIX(z, 1)),
228145548106Schristos      OP2(OLCST, OWRETREG1),
228245548106Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
228345548106Schristos 
228445548106Schristos INSN(rint, nfu, rint, 1cycle, C64XP, 0,
228545548106Schristos      FIX1(FIX(s, 0)),
228645548106Schristos      OP0(),
228745548106Schristos      ENC0())
228845548106Schristos 
228945548106Schristos INSNE(rotl, m_ui_xui_ui, m, compound, 1616_m, C64X, 0,
229045548106Schristos       FIX1(FIX(op, 0x1d)),
229145548106Schristos       OP3(ORXREG1, ORREG1, OWREG2),
229245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
229345548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
229445548106Schristos INSNE(rotl, m_u5_xui_ui, m, compound, 1616_m, C64X, 0,
229545548106Schristos       FIX1(FIX(op, 0x1e)),
229645548106Schristos       OP3(ORXREG1, OACST, OWREG2),
229745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
229845548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
229945548106Schristos 
230045548106Schristos INSN(rpack2, s, ext_1_or_2_src_noncond, 1cycle, C64XP, 0,
230145548106Schristos      FIX2(FIX(op, 0xb), FIX(z, 1)),
230245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
230345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
230445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
230545548106Schristos 
230645548106Schristos INSN(rsqrdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
23079573673dSchristos      FIX2(FIX(op, 0x2e), FIX(x, 0)),
230845548106Schristos      OP2(ORREGD1, OWREGD12),
23099573673dSchristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
23109573673dSchristos 	  ENC(dst, reg, 1)))
231145548106Schristos 
231245548106Schristos INSN(rsqrsp, s, 1_or_2_src, 1cycle, C67X, 0,
231345548106Schristos      FIX2(FIX(op, 0x3e), FIX(src1, 0)),
231445548106Schristos      OP2(ORXREG1, OWREG1),
231545548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
231645548106Schristos 	  ENC(dst, reg, 1)))
231745548106Schristos 
231845548106Schristos INSNE(sadd, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
231945548106Schristos       FIX1(FIX(op, 0x13)),
232045548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
232145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
232245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
232345548106Schristos INSNE(sadd, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
232445548106Schristos       FIX1(FIX(op, 0x31)),
232545548106Schristos       OP3(ORXREG1, ORREGL1, OWREGL1),
232645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
232745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
232845548106Schristos INSNE(sadd, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
232945548106Schristos       FIX1(FIX(op, 0x12)),
233045548106Schristos       OP3(OACST, ORXREG1, OWREG1),
233145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
233245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
233345548106Schristos INSNE(sadd, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
233445548106Schristos       FIX1(FIX(op, 0x30)),
233545548106Schristos       OP3(OACST, ORREGL1, OWREGL1),
233645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
233745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
233845548106Schristos INSNE(sadd, s_si_xsi_si, s, 1_or_2_src, 1cycle, C64X, 0,
233945548106Schristos       FIX1(FIX(op, 0x20)),
234045548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
234145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
234245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
234345548106Schristos 
23449573673dSchristos /* 16 bits insn */
23459573673dSchristos INSN(sadd, l, l3_sat_1, 1cycle, C64XP, 0,
23469573673dSchristos      FIX1(FIX(op, 0)),
23479573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
23489573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
23499573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
23509573673dSchristos 
23519573673dSchristos INSN(sadd, s, s3_sat_1, 1cycle, C64XP,0,
23529573673dSchristos      FIX1(FIX(op, 0x0)),
23539573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
23549573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
23559573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
23569573673dSchristos /**/
23579573673dSchristos 
235845548106Schristos INSN(sadd2, s, ext_1_or_2_src, 1cycle, C64X, 0,
235945548106Schristos      FIX1(FIX(op, 0x0)),
236045548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
236145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
236245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
236345548106Schristos 
236445548106Schristos INSN(saddsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
236545548106Schristos      FIX1(FIX(op, 0x0e)),
236645548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
236745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
236845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
236945548106Schristos 
237045548106Schristos INSN(saddsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
237145548106Schristos      FIX1(FIX(op, 0x0f)),
237245548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
237345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
237445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
237545548106Schristos 
237645548106Schristos INSN(saddsu2, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
237745548106Schristos      FIX1(FIX(op, 0x1)),
237845548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
237945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
238045548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
238145548106Schristos 
238245548106Schristos INSN(saddus2, s, ext_1_or_2_src, 1cycle, C64X, 0,
238345548106Schristos      FIX1(FIX(op, 0x1)),
238445548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
238545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
238645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
238745548106Schristos 
238845548106Schristos INSN(saddu4, s, ext_1_or_2_src, 1cycle, C64X, 0,
238945548106Schristos      FIX1(FIX(op, 0x3)),
239045548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
239145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
239245548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
239345548106Schristos 
239445548106Schristos INSN(sat, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
239545548106Schristos      FIX3(FIX(op, 0x40), FIX(x, 0), FIX(src1, 0)),
239645548106Schristos      OP2(ORREGL1, OWREG1),
239745548106Schristos      ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
239845548106Schristos 
239945548106Schristos INSN(set, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
240045548106Schristos      FIX1(FIX(op, 0x2)),
240145548106Schristos      OP4(ORREG1, OACST, OACST, OWREG1),
240245548106Schristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
240345548106Schristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
240445548106Schristos INSN(set, s, 1_or_2_src, 1cycle, C62X, 0,
240545548106Schristos      FIX1(FIX(op, 0x3b)),
240645548106Schristos      OP3(ORXREG1, ORREG1, OWREG1),
240745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
240845548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
240945548106Schristos 
24109573673dSchristos /* 16 bits insn */
24119573673dSchristos INSN(set, s, sc5, 1cycle, C64XP, 0,
24129573673dSchristos      FIX1(FIX(op, 1)),
24139573673dSchristos      OP4(ORREG1, OACST, OACST, OWREG1),
24149573673dSchristos      ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1),
24159573673dSchristos           ENC(cst, ucst, 2), ENC(srcdst, reg, 3)))
24169573673dSchristos /**/
24179573673dSchristos 
241845548106Schristos INSN(shfl, m, unary, 1616_m, C64X, 0,
241945548106Schristos      FIX1(FIX(op, 0x1c)),
242045548106Schristos      OP2(ORXREG1, OWREG2),
242145548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
242245548106Schristos 	  ENC(dst, reg, 1)))
242345548106Schristos 
242445548106Schristos INSN(shfl3, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
242545548106Schristos      FIX1(FIX(op, 0x36)),
242645548106Schristos      OP3(ORREG1, ORXREG1, OWREGD1),
242745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
242845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
242945548106Schristos 
243045548106Schristos INSNE(shl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
243145548106Schristos       FIX1(FIX(op, 0x33)),
243245548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
243345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
243445548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
243545548106Schristos INSNE(shl, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
243645548106Schristos       FIX2(FIX(op, 0x31), FIX(x, 0)),
243745548106Schristos       OP3(ORREGL1, ORREG1, OWREGL1),
243845548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
243945548106Schristos 	   ENC(dst, reg, 2)))
244045548106Schristos INSNE(shl, s_xui_ui_ul, s, 1_or_2_src, 1cycle, C62X, 0,
244145548106Schristos       FIX1(FIX(op, 0x13)),
244245548106Schristos       OP3(ORXREG1, ORREG1, OWREGL1),
244345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
244445548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
244545548106Schristos INSNE(shl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
244645548106Schristos       FIX1(FIX(op, 0x32)),
244745548106Schristos       OP3(ORXREG1, OACST, OWREG1),
244845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
244945548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
245045548106Schristos INSNE(shl, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
245145548106Schristos       FIX2(FIX(op, 0x30), FIX(x, 0)),
245245548106Schristos       OP3(ORREGL1, OACST, OWREGL1),
245345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
245445548106Schristos 	   ENC(dst, reg, 2)))
245545548106Schristos INSNE(shl, s_xui_u5_ul, s, 1_or_2_src, 1cycle, C62X, 0,
245645548106Schristos       FIX1(FIX(op, 0x12)),
245745548106Schristos       OP3(ORXREG1, OACST, OWREGL1),
245845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
245945548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
246045548106Schristos 
24619573673dSchristos /* 16bit insn */
24629573673dSchristos INSN(shl, s, s3i, 1cycle, C64XP, 0,
24639573673dSchristos       FIX1(FIX(op, 0x0)),
24649573673dSchristos       OP3(ORXREG1, OACST, OWREG1),
24659573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
24669573673dSchristos            ENC(cst, cst_s3i, 1), ENC(dst, reg, 2)))
24679573673dSchristos INSN(shl, s, ssh5_sat_x, 1cycle, C64XP,
24689573673dSchristos       TIC6X_FLAG_NO_CROSS,
24699573673dSchristos       FIX1(FIX(op, 0x0)),
24709573673dSchristos       OP3(ORREG1, OACST, OWREG1),
24719573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
24729573673dSchristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
24739573673dSchristos INSN(shl, s, s2sh, 1cycle, C64XP, 0,
24749573673dSchristos       FIX1(FIX(op, 0x0)),
24759573673dSchristos       OP3(ORREG1, ORREG1, OWREG1),
24769573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
24779573673dSchristos            ENC(srcdst, reg, 2)))
24789573673dSchristos /**/
24799573673dSchristos 
248045548106Schristos INSN(shlmb, l, 1_or_2_src, 1cycle, C64X, 0,
248145548106Schristos      FIX1(FIX(op, 0x61)),
248245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
248345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
248445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
248545548106Schristos INSN(shlmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
248645548106Schristos      FIX1(FIX(op, 0x9)),
248745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
248845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
248945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
249045548106Schristos 
249145548106Schristos INSNE(shr, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
249245548106Schristos       FIX1(FIX(op, 0x37)),
249345548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
249445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
249545548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
249645548106Schristos INSNE(shr, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
249745548106Schristos       FIX2(FIX(op, 0x35), FIX(x, 0)),
249845548106Schristos       OP3(ORREGL1, ORREG1, OWREGL1),
249945548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
250045548106Schristos 	   ENC(dst, reg, 2)))
250145548106Schristos INSNE(shr, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
250245548106Schristos       FIX1(FIX(op, 0x36)),
250345548106Schristos       OP3(ORXREG1, OACST, OWREG1),
250445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
250545548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
250645548106Schristos INSNE(shr, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
250745548106Schristos       FIX2(FIX(op, 0x34), FIX(x, 0)),
250845548106Schristos       OP3(ORREGL1, OACST, OWREGL1),
250945548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
251045548106Schristos 	   ENC(dst, reg, 2)))
251145548106Schristos 
25129573673dSchristos /* 16bit insn */
25139573673dSchristos INSN(shr, s, s3i, 1cycle, C64XP, 0,
25149573673dSchristos       FIX1(FIX(op, 0x1)),
25159573673dSchristos       OP3(ORXREG1, OACST, OWREG1),
25169573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
25179573673dSchristos            ENC(cst, cst_s3i, 1), ENC(dst, reg, 2)))
25189573673dSchristos INSN(shr, s, ssh5_sat_x, 1cycle, C64XP,
25199573673dSchristos       TIC6X_FLAG_NO_CROSS,
25209573673dSchristos       FIX1(FIX(op, 0x1)),
25219573673dSchristos       OP3(ORREG1, OACST, OWREG1),
25229573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
25239573673dSchristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
25249573673dSchristos INSN(shr, s, s2sh, 1cycle, C64XP, 0,
25259573673dSchristos       FIX1(FIX(op, 0x1)),
25269573673dSchristos       OP3(ORREG1, ORREG1, OWREG1),
25279573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
25289573673dSchristos            ENC(srcdst, reg, 2)))
25299573673dSchristos /**/
25309573673dSchristos 
253145548106Schristos INSNE(shr2, s_xs2_ui_s2, s, ext_1_or_2_src, 1cycle, C64X, 0,
253245548106Schristos       FIX1(FIX(op, 0x7)),
253345548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
253445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
253545548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
253645548106Schristos INSNE(shr2, s_xs2_u5_s2, s, 1_or_2_src, 1cycle, C64X, 0,
253745548106Schristos       FIX1(FIX(op, 0x18)),
253845548106Schristos       OP3(ORXREG1, OACST, OWREG1),
253945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
254045548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
254145548106Schristos 
254245548106Schristos INSN(shrmb, l, 1_or_2_src, 1cycle, C64X, 0,
254345548106Schristos      FIX1(FIX(op, 0x62)),
254445548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
254545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
254645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
254745548106Schristos INSN(shrmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
254845548106Schristos      FIX1(FIX(op, 0xa)),
254945548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
255045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
255145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
255245548106Schristos 
255345548106Schristos INSNE(shru, s_xui_ui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
255445548106Schristos       FIX1(FIX(op, 0x27)),
255545548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
255645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
255745548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
255845548106Schristos INSNE(shru, s_ul_ui_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
255945548106Schristos       FIX2(FIX(op, 0x25), FIX(x, 0)),
256045548106Schristos       OP3(ORREGL1, ORREG1, OWREGL1),
256145548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
256245548106Schristos 	   ENC(dst, reg, 2)))
256345548106Schristos INSNE(shru, s_xui_u5_ui, s, 1_or_2_src, 1cycle, C62X, 0,
256445548106Schristos       FIX1(FIX(op, 0x26)),
256545548106Schristos       OP3(ORXREG1, OACST, OWREG1),
256645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
256745548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
256845548106Schristos INSNE(shru, s_ul_u5_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
256945548106Schristos       FIX2(FIX(op, 0x24), FIX(x, 0)),
257045548106Schristos       OP3(ORREGL1, OACST, OWREGL1),
257145548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
257245548106Schristos 	   ENC(dst, reg, 2)))
257345548106Schristos 
25749573673dSchristos /* 16 bits insn */
25759573673dSchristos INSN(shru, s, ssh5_sat_0, 1cycle, C64XP,
25769573673dSchristos       TIC6X_FLAG_NO_CROSS,
25779573673dSchristos       FIX1(FIX(op, 0x2)),
25789573673dSchristos       OP3(ORREG1, OACST, OWREG1),
25799573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
25809573673dSchristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
25819573673dSchristos INSN(shru, s, s2sh, 1cycle, C64XP, 0,
25829573673dSchristos       FIX1(FIX(op, 0x2)),
25839573673dSchristos       OP3(ORREG1, ORREG1, OWREG1),
25849573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
25859573673dSchristos            ENC(srcdst, reg, 2)))
25869573673dSchristos /**/
25879573673dSchristos 
258845548106Schristos INSNE(shru2, s_xu2_ui_u2, s, ext_1_or_2_src, 1cycle, C64X, 0,
258945548106Schristos       FIX1(FIX(op, 0x8)),
259045548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
259145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
259245548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
259345548106Schristos INSNE(shru2, s_xu2_u5_u2, s, 1_or_2_src, 1cycle, C64X, 0,
259445548106Schristos       FIX1(FIX(op, 0x19)),
259545548106Schristos       OP3(ORXREG1, OACST, OWREG1),
259645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
259745548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
259845548106Schristos 
2599883529b6Schristos INSN(sl, d, 1_or_2_src, store, C64XP,
260045548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
260145548106Schristos      FIX3(FIX(s, 1), FIX(op, 0xd), FIX(src1, 0)),
260245548106Schristos      OP2(ORDREG1, OWMEMDW),
260345548106Schristos      ENC2(ENC(dst, reg, 0), ENC(src2, reg, 1)))
260445548106Schristos 
260545548106Schristos INSN(smpy, m, mpy, 1616_m, C62X, 0,
260645548106Schristos      FIX1(FIX(op, 0x1a)),
260745548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
260845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
260945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
261045548106Schristos 
26119573673dSchristos /* 16 bits insn */
26129573673dSchristos INSN(smpy, m, m3_sat_1, 1616_m, C67X, 0,
26139573673dSchristos       FIX1(FIX(op, 0x0)),
26149573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
26159573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
26169573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
26179573673dSchristos /**/
26189573673dSchristos 
261945548106Schristos INSN(smpyh, m, mpy, 1616_m, C62X, 0,
262045548106Schristos      FIX1(FIX(op, 0x02)),
262145548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
262245548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
262345548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
262445548106Schristos 
26259573673dSchristos /* 16 bits insn */
26269573673dSchristos INSN(smpyh, m, m3_sat_1, 1616_m, C67X, 0,
26279573673dSchristos       FIX1(FIX(op, 0x1)),
26289573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
26299573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
26309573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
26319573673dSchristos /**/
26329573673dSchristos 
263345548106Schristos INSN(smpyhl, m, mpy, 1616_m, C62X, 0,
263445548106Schristos      FIX1(FIX(op, 0x0a)),
263545548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
263645548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
263745548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
263845548106Schristos 
26399573673dSchristos /* 16 bits insn */
26409573673dSchristos INSN(smpyhl, m, m3_sat_1, 1616_m, C67X, 0,
26419573673dSchristos       FIX1(FIX(op, 0x3)),
26429573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
26439573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
26449573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
26459573673dSchristos /**/
26469573673dSchristos 
264745548106Schristos INSN(smpylh, m, mpy, 1616_m, C62X, 0,
264845548106Schristos      FIX1(FIX(op, 0x12)),
264945548106Schristos      OP3(ORREG1, ORXREG1, OWREG2),
265045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
265145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
265245548106Schristos 
26539573673dSchristos /* 16 bits insn */
26549573673dSchristos INSN(smpylh, m, m3_sat_1, 1616_m, C67X, 0,
26559573673dSchristos       FIX1(FIX(op, 0x2)),
26569573673dSchristos       OP3(ORREG1, ORXREG1, OWREG2),
26579573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
26589573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
26599573673dSchristos /**/
26609573673dSchristos 
266145548106Schristos INSN(smpy2, m, compound, 4cycle, C64X, 0,
266245548106Schristos      FIX1(FIX(op, 0x01)),
266345548106Schristos      OP3(ORREG1, ORXREG1, OWREGD4),
266445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
266545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
266645548106Schristos 
266745548106Schristos /* Contrary to SPRUFE8, this is the correct operand order for this
266845548106Schristos    instruction.  */
266945548106Schristos INSN(smpy32, m, 1_or_2_src, 4cycle, C64XP, 0,
267045548106Schristos      FIX1(FIX(op, 0x19)),
267145548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
267245548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
267345548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
267445548106Schristos 
267545548106Schristos INSN(spack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
267645548106Schristos      FIX1(FIX(op, 0x2)),
267745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
267845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
267945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
268045548106Schristos 
268145548106Schristos INSN(spacku4, s, ext_1_or_2_src, 1cycle, C64X, 0,
268245548106Schristos      FIX1(FIX(op, 0x4)),
268345548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
268445548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
268545548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
268645548106Schristos 
268745548106Schristos INSN(spdp, s, 1_or_2_src, 2cycle_dp, C67X, 0,
268845548106Schristos      FIX2(FIX(op, 0x02), FIX(src1, 0)),
268945548106Schristos      OP2(ORXREG1, OWREGD12),
269045548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
269145548106Schristos 	  ENC(dst, reg, 1)))
269245548106Schristos 
269345548106Schristos INSN(spint, l, 1_or_2_src, 4cycle, C67X, 0,
269445548106Schristos      FIX2(FIX(op, 0x0a), FIX(src1, 0)),
269545548106Schristos      OP2(ORXREG1, OWREG4),
269645548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
269745548106Schristos 	  ENC(dst, reg, 1)))
269845548106Schristos 
269945548106Schristos INSNE(spkernel, nfu_2, nfu, spkernel, 1cycle, C64XP,
270045548106Schristos       TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
270145548106Schristos       FIX1(FIX(s, 0)),
270245548106Schristos       OP2(OACST, OACST),
270345548106Schristos       ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
270445548106Schristos INSNE(spkernel, nfu_0, nfu, spkernel, 1cycle, C64XP,
270545548106Schristos       TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL|TIC6X_FLAG_MACRO,
270645548106Schristos       FIX2(FIX(s, 0), FIX(fstgfcyc, 0)),
270745548106Schristos       OP0(),
270845548106Schristos       ENC0())
270945548106Schristos 
27109573673dSchristos /* 16 bits insn */
27119573673dSchristos INSN(spkernel, nfu, uspk, 1cycle, C64XP,
27129573673dSchristos       TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
27139573673dSchristos       FIX0(),
27149573673dSchristos       OP2(OACST, OACST),
27159573673dSchristos       ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
27169573673dSchristos /**/
27179573673dSchristos 
271845548106Schristos INSN(spkernelr, nfu, spkernelr, 1cycle, C64XP,
271945548106Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
272045548106Schristos      FIX1(FIX(s, 0)),
272145548106Schristos      OP0(),
272245548106Schristos      ENC0())
272345548106Schristos 
272445548106Schristos INSN(sploop, nfu, loop_buffer, 1cycle, C64XP,
272545548106Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
272645548106Schristos      FIX4(FIX(s, 0), FIX(op, 0xc), FIX(csta, 0), RAN(cstb, 0, 13)),
272745548106Schristos      OP1(OACST),
272845548106Schristos      ENC1(ENC(cstb, ucst_minus_one, 0)))
272945548106Schristos 
273045548106Schristos INSN(sploopd, nfu, loop_buffer, 1cycle, C64XP,
273145548106Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
273245548106Schristos      FIX4(FIX(s, 0), FIX(op, 0xd), FIX(csta, 0), RAN(cstb, 0, 13)),
273345548106Schristos      OP1(OACST),
273445548106Schristos      ENC1(ENC(cstb, ucst_minus_one, 0)))
273545548106Schristos 
273645548106Schristos INSN(sploopw, nfu, loop_buffer, 1cycle, C64XP,
273745548106Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
273845548106Schristos      FIX4(FIX(s, 0), FIX(op, 0xf), FIX(csta, 0), RAN(cstb, 0, 13)),
273945548106Schristos      OP1(OACST),
274045548106Schristos      ENC1(ENC(cstb, ucst_minus_one, 0)))
274145548106Schristos 
27429573673dSchristos /* 16 bits insn */
27439573673dSchristos INSN(sploop, nfu, uspl, 1cycle, C64XP,
27449573673dSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
27459573673dSchristos      FIX1(FIX(op, 0)),
27469573673dSchristos      OP1(OACST),
27479573673dSchristos      ENC1(ENC(ii, ucst_minus_one, 0)))
27489573673dSchristos 
27499573673dSchristos INSN(sploopd, nfu, uspl, 1cycle, C64XP,
27509573673dSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
27519573673dSchristos      FIX1(FIX(op, 1)),
27529573673dSchristos      OP1(OACST),
27539573673dSchristos      ENC1(ENC(ii, ucst_minus_one, 0)))
27549573673dSchristos 
27559573673dSchristos INSN(sploopd, nfu, uspldr, 1cycle, C64XP,
27569573673dSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP|TIC6X_FLAG_INSN16_SPRED,
27579573673dSchristos      FIX0(),
27589573673dSchristos      OP1(OACST),
27599573673dSchristos      ENC1(ENC(ii, ucst_minus_one, 0)))
27609573673dSchristos /**/
27619573673dSchristos 
27629573673dSchristos 
276345548106Schristos /* Contrary to SPRUFE8, this is the correct encoding for this
276445548106Schristos    instruction.  */
276545548106Schristos INSN(spmask, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
276645548106Schristos      FIX2(FIX(s, 0), FIX(op, 0x8)),
276745548106Schristos      OP1(OFULIST),
276845548106Schristos      ENC1(ENC(mask, spmask, 0)))
276945548106Schristos 
27709573673dSchristos /* 16 bits insn */
27719573673dSchristos INSN(spmask, nfu, uspma, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
27729573673dSchristos      FIX0(),
27739573673dSchristos      OP1(OFULIST),
27749573673dSchristos      ENC1(ENC(mask, spmask, 0)))
27759573673dSchristos /**/
27769573673dSchristos 
277745548106Schristos INSN(spmaskr, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
277845548106Schristos      FIX2(FIX(s, 0), FIX(op, 0x9)),
277945548106Schristos      OP1(OFULIST),
278045548106Schristos      ENC1(ENC(mask, spmask, 0)))
278145548106Schristos 
27829573673dSchristos /* 16 bits insn */
27839573673dSchristos INSN(spmaskr, nfu, uspmb, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
27849573673dSchristos      FIX0(),
27859573673dSchristos      OP1(OFULIST),
27869573673dSchristos      ENC1(ENC(mask, spmask, 0)))
27879573673dSchristos /**/
27889573673dSchristos 
278945548106Schristos INSN(sptrunc, l, 1_or_2_src, 4cycle, C67X, 0,
279045548106Schristos      FIX2(FIX(op, 0x0b), FIX(src1, 0)),
279145548106Schristos      OP2(ORXREG1, OWREG4),
279245548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
279345548106Schristos 	  ENC(dst, reg, 1)))
279445548106Schristos 
279545548106Schristos INSNE(sshl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
279645548106Schristos       FIX1(FIX(op, 0x23)),
279745548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
279845548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
279945548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
280045548106Schristos INSNE(sshl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
280145548106Schristos       FIX1(FIX(op, 0x22)),
280245548106Schristos       OP3(ORXREG1, OACST, OWREG1),
280345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
280445548106Schristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
280545548106Schristos 
28069573673dSchristos /* 16 bits insn */
28079573673dSchristos INSN(sshl, s, ssh5_sat_1, 1cycle, C64XP,
28089573673dSchristos       TIC6X_FLAG_NO_CROSS,
28099573673dSchristos       FIX1(FIX(op, 0x2)),
28109573673dSchristos       OP3(ORREG1, OACST, OWREG1),
28119573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
28129573673dSchristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
28139573673dSchristos INSN(sshl, s, s2sh, 1cycle, C64XP, 0,
28149573673dSchristos       FIX1(FIX(op, 0x3)),
28159573673dSchristos       OP3(ORREG1, ORREG1, OWREG1),
28169573673dSchristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
28179573673dSchristos            ENC(srcdst, reg, 2)))
28189573673dSchristos /**/
28199573673dSchristos 
282045548106Schristos INSN(sshvl, m, compound, 1616_m, C64X, 0,
282145548106Schristos      FIX1(FIX(op, 0x1c)),
282245548106Schristos      OP3(ORXREG1, ORREG1, OWREG2),
282345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
282445548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
282545548106Schristos 
282645548106Schristos /* Contrary to SPRUFE8, this is the correct encoding for this
282745548106Schristos    instruction.  */
282845548106Schristos INSN(sshvr, m, compound, 1616_m, C64X, 0,
282945548106Schristos      FIX1(FIX(op, 0x1a)),
283045548106Schristos      OP3(ORXREG1, ORREG1, OWREG2),
283145548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
283245548106Schristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
283345548106Schristos 
283445548106Schristos INSNE(ssub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
283545548106Schristos       FIX1(FIX(op, 0x0f)),
283645548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
283745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
283845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
283945548106Schristos INSNE(ssub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
284045548106Schristos       FIX1(FIX(op, 0x1f)),
284145548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
284245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
284345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
284445548106Schristos INSNE(ssub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
284545548106Schristos       FIX1(FIX(op, 0x0e)),
284645548106Schristos       OP3(OACST, ORXREG1, OWREG1),
284745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
284845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
284945548106Schristos INSNE(ssub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
285045548106Schristos       FIX1(FIX(op, 0x2c)),
285145548106Schristos       OP3(OACST, ORREGL1, OWREGL1),
285245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
285345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
285445548106Schristos 
28559573673dSchristos /* 16 bits insn */
28569573673dSchristos INSN(ssub, l, l3_sat_1, 1cycle, C64XP, 0,
28579573673dSchristos      FIX1(FIX(op, 1)),
28589573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
28599573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
28609573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
28619573673dSchristos /**/
28629573673dSchristos 
286345548106Schristos INSN(ssub2, l, 1_or_2_src, 1cycle, C64XP, 0,
286445548106Schristos      FIX1(FIX(op, 0x64)),
286545548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
286645548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
286745548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
286845548106Schristos 
286945548106Schristos INSN(stb, d, load_store, store, C62X,
287045548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
287145548106Schristos      FIX2(FIX(op, 3), FIX(r, 0)),
287245548106Schristos      OP2(ORDREG1, OWMEMSB),
287345548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
287445548106Schristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
287545548106Schristos 	  ENC(srcdst, reg, 0)))
287645548106Schristos INSN(stb, d, load_store_long, store, C62X,
287745548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
287845548106Schristos      FIX1(FIX(op, 3)),
287945548106Schristos      OP2(ORDREG1, OWMEMLB),
288045548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_byte, 1),
288145548106Schristos 	  ENC(dst, reg, 0)))
288245548106Schristos 
28839573673dSchristos /* 16 bits insn */
28849573673dSchristos INSN(stb, d, doff4_dsz_000, store, C64XP,
28859573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
28869573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
28879573673dSchristos      OP2(ORTREG1, OWMEMSB),
28889573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
28899573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
28909573673dSchristos INSN(stb, d, doff4_dsz_x01, store, C64XP,
28919573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
28929573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
28939573673dSchristos      OP2(ORTREG1, OWMEMSB),
28949573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
28959573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
28969573673dSchristos INSN(stb, d, dind_dsz_000, store, C64XP,
28979573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
28989573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
28999573673dSchristos      OP2(ORTREG1, OWMEMSB),
29009573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
29019573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg, 0)))
29029573673dSchristos INSN(stb, d, dind_dsz_x01, store, C64XP,
29039573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
29049573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29059573673dSchristos      OP2(ORTREG1, OWMEMSB),
29069573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
29079573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg, 0)))
29089573673dSchristos INSN(stb, d, dinc_dsz_000, store, C64XP,
29099573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
29109573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29119573673dSchristos      OP2(ORTREG1, OWMEMSB),
29129573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
29139573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
29149573673dSchristos INSN(stb, d, dinc_dsz_x01, store, C64XP,
29159573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
29169573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29179573673dSchristos      OP2(ORTREG1, OWMEMSB),
29189573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
29199573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
29209573673dSchristos INSN(stb, d, ddec_dsz_000, store, C64XP,
29219573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
29229573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29239573673dSchristos      OP2(ORTREG1, OWMEMSB),
29249573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
29259573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
29269573673dSchristos INSN(stb, d, ddec_dsz_x01, store, C64XP,
29279573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
29289573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29299573673dSchristos      OP2(ORTREG1, OWMEMSB),
29309573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
29319573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
29329573673dSchristos /**/
29339573673dSchristos 
293445548106Schristos INSN(stdw, d, load_store, store, C64X, TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS,
293545548106Schristos      FIX2(FIX(op, 4), FIX(r, 1)),
293645548106Schristos      OP2(ORDREGD1, OWMEMSD),
293745548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
293845548106Schristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
293945548106Schristos 	  ENC(srcdst, reg, 0)))
294045548106Schristos 
29419573673dSchristos /* 16 bits insn */
29429573673dSchristos INSN(stdw, d, dpp, store, C64XP,
29439573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTDECR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
29449573673dSchristos      FIX3(FIX(op, 0), FIX(dw, 1), FIX(s, 1)),
29459573673dSchristos      OP2(ORTREGD1, OWMEMSD),
29469573673dSchristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
29479573673dSchristos 	  ENC(cst, mem_offset_minus_one, 1)))
29489573673dSchristos INSN(stdw, d, ddecdw, store, C64XP,
29499573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
29509573673dSchristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
29519573673dSchristos      OP2(ORTREGD1, OWMEMSD),
29529573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
29539573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
29549573673dSchristos INSN(stdw, d, dincdw, store, C64XP,
29559573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
29569573673dSchristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
29579573673dSchristos      OP2(ORTREGD1, OWMEMSD),
29589573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
29599573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
29609573673dSchristos INSN(stdw, d, dinddw, store, C64XP,
29619573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
29629573673dSchristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
29639573673dSchristos      OP2(ORTREGD1, OWMEMSD),
29649573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
29659573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
29669573673dSchristos INSN(stdw, d, doff4dw, store, C64XP,
29679573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
29689573673dSchristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
29699573673dSchristos      OP2(ORTREGD1, OWMEMSD),
29709573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 1),
29719573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
29729573673dSchristos /**/
29739573673dSchristos 
297445548106Schristos INSN(sth, d, load_store, store, C62X,
297545548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
297645548106Schristos      FIX2(FIX(op, 5), FIX(r, 0)),
297745548106Schristos      OP2(ORDREG1, OWMEMSH),
297845548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
297945548106Schristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
298045548106Schristos 	  ENC(srcdst, reg, 0)))
298145548106Schristos INSN(sth, d, load_store_long, store, C62X,
298245548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
298345548106Schristos      FIX1(FIX(op, 5)),
298445548106Schristos      OP2(ORDREG1, OWMEMLH),
298545548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_half, 1),
298645548106Schristos 	  ENC(dst, reg, 0)))
298745548106Schristos 
29889573673dSchristos /* 16 bits insn */
29899573673dSchristos INSN(sth, d, doff4_dsz_01x, store, C64XP,
29909573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
29919573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29929573673dSchristos      OP2(ORTREG1, OWMEMSH),
29939573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
29949573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
29959573673dSchristos INSN(sth, d, doff4_dsz_111, store, C64XP,
29969573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
29979573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
29989573673dSchristos      OP2(ORTREG1, OWMEMSH),
29999573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30009573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
30019573673dSchristos INSN(sth, d, dind_dsz_01x, store, C64XP,
30029573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
30039573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30049573673dSchristos      OP2(ORTREG1, OWMEMSH),
30059573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30069573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
30079573673dSchristos INSN(sth, d, dind_dsz_111, store, C64XP,
30089573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
30099573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30109573673dSchristos      OP2(ORTREG1, OWMEMSH),
30119573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30129573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
30139573673dSchristos INSN(sth, d, dinc_dsz_01x, store, C64XP,
30149573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
30159573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30169573673dSchristos      OP2(ORTREG1, OWMEMSH),
30179573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30189573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
30199573673dSchristos INSN(sth, d, dinc_dsz_111, store, C64XP,
30209573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
30219573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30229573673dSchristos      OP2(ORTREG1, OWMEMSH),
30239573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30249573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
30259573673dSchristos INSN(sth, d, ddec_dsz_01x, store, C64XP,
30269573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
30279573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30289573673dSchristos      OP2(ORTREG1, OWMEMSH),
30299573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30309573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
30319573673dSchristos INSN(sth, d, ddec_dsz_111, store, C64XP,
30329573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
30339573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30349573673dSchristos      OP2(ORTREG1, OWMEMSH),
30359573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30369573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
30379573673dSchristos /**/
30389573673dSchristos 
303945548106Schristos INSN(stndw, d, store_nonaligned, store, C64X,
304045548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
304145548106Schristos      FIX0(),
304245548106Schristos      OP2(ORDREGD1, OWMEMND),
304345548106Schristos      ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
304445548106Schristos 	  ENC(offsetR, mem_offset_noscale, 1), ENC(baseR, reg, 1),
304545548106Schristos 	  ENC(sc, scaled, 1), ENC(src, reg_shift, 0)))
304645548106Schristos 
30479573673dSchristos /* 16 bits insn */
30489573673dSchristos INSN(stndw, d, ddecdw, store, C64XP,
30499573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
30509573673dSchristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
30519573673dSchristos      OP2(ORTREGD1, OWMEMND),
30529573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
30539573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one_noscale, 1)))
30549573673dSchristos INSN(stndw, d, dincdw, store, C64XP,
30559573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
30569573673dSchristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
30579573673dSchristos      OP2(ORTREGD1, OWMEMND),
30589573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
30599573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one_noscale, 1)))
30609573673dSchristos INSN(stndw, d, dinddw, store, C64XP,
30619573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
30629573673dSchristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
30639573673dSchristos      OP2(ORTREGD1, OWMEMND),
30649573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset_noscale, 1),
30659573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
30669573673dSchristos INSN(stndw, d, doff4dw, store, C64XP,
30679573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
30689573673dSchristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
30699573673dSchristos      OP2(ORTREGD1, OWMEMND),
30709573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_noscale, 1),
30719573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
30729573673dSchristos /**/
30739573673dSchristos 
307445548106Schristos INSN(stnw, d, load_store, store, C64X,
307545548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
307645548106Schristos      FIX2(FIX(op, 5), FIX(r, 1)),
307745548106Schristos      OP2(ORDREG1, OWMEMSW),
307845548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
307945548106Schristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
308045548106Schristos 	  ENC(srcdst, reg, 0)))
308145548106Schristos 
30829573673dSchristos /* 16 bits insn */
30839573673dSchristos INSN(stnw, d, doff4_dsz_110, store, C64XP,
30849573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
30859573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30869573673dSchristos      OP2(ORTREG1, OWMEMSW),
30879573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30889573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
30899573673dSchristos INSN(stnw, d, dind_dsz_110, store, C64XP,
30909573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
30919573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30929573673dSchristos      OP2(ORTREG1, OWMEMSW),
30939573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
30949573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
30959573673dSchristos INSN(stnw, d, dinc_dsz_110, store, C64XP,
30969573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
30979573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
30989573673dSchristos      OP2(ORTREG1, OWMEMSW),
30999573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31009573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
31019573673dSchristos INSN(stnw, d, ddec_dsz_110, store, C64XP,
31029573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
31039573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
31049573673dSchristos      OP2(ORTREG1, OWMEMSW),
31059573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31069573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
31079573673dSchristos /**/
31089573673dSchristos 
310945548106Schristos INSN(stw, d, load_store, store, C62X,
311045548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
311145548106Schristos      FIX2(FIX(op, 7), FIX(r, 0)),
311245548106Schristos      OP2(ORDREG1, OWMEMSW),
311345548106Schristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
311445548106Schristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
311545548106Schristos 	  ENC(srcdst, reg, 0)))
311645548106Schristos INSN(stw, d, load_store_long, store, C62X,
311745548106Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
311845548106Schristos      FIX1(FIX(op, 7)),
311945548106Schristos      OP2(ORDREG1, OWMEMLW),
312045548106Schristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_word, 1),
312145548106Schristos 	  ENC(dst, reg, 0)))
312245548106Schristos 
31239573673dSchristos /* 16 bits insn */
31249573673dSchristos INSN(stw, d, doff4_dsz_0xx, store, C64XP,
31259573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
31269573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 0)),
31279573673dSchristos      OP2(ORTREG1, OWMEMSW),
31289573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31299573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
31309573673dSchristos INSN(stw, d, doff4_dsz_100, store, C64XP,
31319573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
31329573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
31339573673dSchristos      OP2(ORTREG1, OWMEMSW),
31349573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31359573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
31369573673dSchristos INSN(stw, d, dind_dsz_0xx, store, C64XP,
31379573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
31389573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 0)),
31399573673dSchristos      OP2(ORTREG1, OWMEMSW),
31409573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31419573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
31429573673dSchristos INSN(stw, d, dind_dsz_100, store, C64XP,
31439573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
31449573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
31459573673dSchristos      OP2(ORTREG1, OWMEMSW),
31469573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31479573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
31489573673dSchristos INSN(stw, d, dinc_dsz_0xx, store, C64XP,
31499573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
31509573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 0)),
31519573673dSchristos      OP2(ORTREG1, OWMEMSW),
31529573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31539573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
31549573673dSchristos INSN(stw, d, dinc_dsz_100, store, C64XP,
31559573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
31569573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
31579573673dSchristos      OP2(ORTREG1, OWMEMSW),
31589573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31599573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
31609573673dSchristos INSN(stw, d, ddec_dsz_0xx, store, C64XP,
31619573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
31629573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 0)),
31639573673dSchristos      OP2(ORTREG1, OWMEMSW),
31649573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31659573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
31669573673dSchristos INSN(stw, d, ddec_dsz_100, store, C64XP,
31679573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
31689573673dSchristos      FIX2(FIX(op, 0), FIX(sz, 1)),
31699573673dSchristos      OP2(ORTREG1, OWMEMSW),
31709573673dSchristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31719573673dSchristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
31729573673dSchristos INSN(stw, d, dpp, store, C64XP,
31739573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTDECR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
31749573673dSchristos      FIX2(FIX(op, 0), FIX(dw, 0)),
31759573673dSchristos      OP2(ORTREG1, OWMEMSW),
31769573673dSchristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31779573673dSchristos 	  ENC(cst, mem_offset_minus_one, 1)))
31789573673dSchristos INSN(stw, d, dstk, store, C64XP,
31799573673dSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE)|TIC6X_FLAG_INSN16_B15PTR,
31809573673dSchristos      FIX2(FIX(op, 0x0), FIX(s, 1)),
31819573673dSchristos      OP2(ORTREG1, OWMEMSW),
31829573673dSchristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
31839573673dSchristos 	  ENC(cst, mem_offset, 1)))
31849573673dSchristos /**/
31859573673dSchristos 
318645548106Schristos INSNE(sub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
318745548106Schristos       FIX1(FIX(op, 0x07)),
318845548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
318945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
319045548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
319145548106Schristos INSNE(sub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
319245548106Schristos       FIX1(FIX(op, 0x17)),
319345548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
319445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
319545548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
319645548106Schristos INSNE(sub, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
319745548106Schristos       FIX1(FIX(op, 0x27)),
319845548106Schristos       OP3(ORREG1, ORXREG1, OWREGL1),
319945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
320045548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
320145548106Schristos INSNE(sub, l_xsi_si_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
320245548106Schristos       FIX1(FIX(op, 0x37)),
320345548106Schristos       OP3(ORXREG1, ORREG1, OWREGL1),
320445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
320545548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
320645548106Schristos INSNE(sub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
320745548106Schristos       FIX1(FIX(op, 0x06)),
320845548106Schristos       OP3(OACST, ORXREG1, OWREG1),
320945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
321045548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
321145548106Schristos INSNE(sub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
321245548106Schristos       FIX1(FIX(op, 0x24)),
321345548106Schristos       OP3(OACST, ORREGL1, OWREGL1),
321445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
321545548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
321645548106Schristos INSNE(sub, l_xsi_s5_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
321745548106Schristos       FIX1(FIX(op, 0x2)),
321845548106Schristos       OP3(ORXREG1, OACST, OWREG1),
321945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
322045548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
322145548106Schristos INSNE(sub, l_sl_s5_sl, l, 1_or_2_src, 1cycle, C62X,
322245548106Schristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
322345548106Schristos       FIX2(FIX(op, 0x20), FIX(x, 0)),
322445548106Schristos       OP3(ORREGL1, OACST, OWREGL1),
322545548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, scst_negate, 1), ENC(src2, reg, 0),
322645548106Schristos 	   ENC(dst, reg, 2)))
322745548106Schristos INSNE(sub, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
322845548106Schristos       FIX1(FIX(op, 0x17)),
322945548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
323045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
323145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
323245548106Schristos INSNE(sub, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
323345548106Schristos       FIX1(FIX(op, 0x16)),
323445548106Schristos       OP3(OACST, ORXREG1, OWREG1),
323545548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
323645548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
323745548106Schristos /* Contrary to SPRUFE8, this is the correct encoding for this
323845548106Schristos    instruction; this instruction can be predicated.  */
323945548106Schristos INSNE(sub, s_xsi_si_si, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
324045548106Schristos       FIX1(FIX(op, 0x5)),
324145548106Schristos       OP3(ORXREG1, ORREG1, OWREG1),
324245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
324345548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
324445548106Schristos INSNE(sub, s_xsi_s5_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
324545548106Schristos       FIX1(FIX(op, 0x6)),
324645548106Schristos       OP3(ORXREG1, OACST, OWREG1),
324745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
324845548106Schristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
324945548106Schristos INSNE(sub, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
325045548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
325145548106Schristos       FIX1(FIX(op, 0x11)),
325245548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
325345548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
325445548106Schristos 	   ENC(dst, reg, 2)))
325545548106Schristos INSNE(sub, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
325645548106Schristos       FIX1(FIX(op, 0x13)),
325745548106Schristos       OP3(ORREG1, OACST, OWREG1),
325845548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
325945548106Schristos 	   ENC(dst, reg, 2)))
326045548106Schristos INSNE(sub, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
326145548106Schristos       FIX1(FIX(op, 0xc)),
326245548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
326345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
326445548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
326545548106Schristos 
32669573673dSchristos /* 16 bits insn */
32679573673dSchristos INSN(sub, l, l3_sat_0, 1cycle, C64XP, 0,
32689573673dSchristos      FIX1(FIX(op, 0x1)),
32699573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
32709573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
32719573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
32729573673dSchristos INSN(sub, l, lx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
32739573673dSchristos      FIX1(FIX(op, 0x2)),
32749573673dSchristos      OP3(OHWCST0, ORREG1, OWREG1),
32759573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
32769573673dSchristos INSN(sub, s, sx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
32779573673dSchristos       FIX1(FIX(op, 0x2)),
32789573673dSchristos       OP3(OHWCST0, ORREG1, OWREG1),
32799573673dSchristos       ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
32809573673dSchristos INSN(sub, s, sx2op, 1cycle, C64XP, 0,
32819573673dSchristos       FIX1(FIX(op, 0x1)),
32829573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1),
32839573673dSchristos       ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2),
32849573673dSchristos            ENC(src2, reg, 1), ENC(x, xpath, 1)))
32859573673dSchristos INSN(sub, s, s3_sat_x, 1cycle, C64XP, 0,
32869573673dSchristos      FIX1(FIX(op, 0x1)),
32879573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
32889573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
32899573673dSchristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
32909573673dSchristos INSN(sub, d, dx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
32919573673dSchristos      FIX1(FIX(op, 0x3)),
32929573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
32939573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
32949573673dSchristos INSN(sub, d, dx2op, 1cycle, C64XP, 0,
32959573673dSchristos      FIX1(FIX(op, 0x1)),
32969573673dSchristos      OP3(ORREG1, ORXREG1, OWREG1),
32979573673dSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(srcdst, reg, 0),
32989573673dSchristos           ENC(src2, reg, 1), ENC(srcdst, reg, 2)))
32999573673dSchristos /**/
33009573673dSchristos 
330145548106Schristos INSNE(subab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
330245548106Schristos       FIX1(FIX(op, 0x31)),
330345548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
330445548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
330545548106Schristos 	   ENC(dst, reg, 2)))
330645548106Schristos INSNE(subab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
330745548106Schristos       FIX1(FIX(op, 0x33)),
330845548106Schristos       OP3(ORREG1, OACST, OWREG1),
330945548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
331045548106Schristos 	   ENC(dst, reg, 2)))
331145548106Schristos 
331245548106Schristos INSN(subabs4, l, 1_or_2_src, 1cycle, C64X, 0,
331345548106Schristos      FIX1(FIX(op, 0x5a)),
331445548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
331545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
331645548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
331745548106Schristos 
331845548106Schristos INSNE(subah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
331945548106Schristos       FIX1(FIX(op, 0x35)),
332045548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
332145548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
332245548106Schristos 	   ENC(dst, reg, 2)))
332345548106Schristos INSNE(subah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
332445548106Schristos       FIX1(FIX(op, 0x37)),
332545548106Schristos       OP3(ORREG1, OACST, OWREG1),
332645548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
332745548106Schristos 	   ENC(dst, reg, 2)))
332845548106Schristos 
332945548106Schristos INSNE(subaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
333045548106Schristos       FIX1(FIX(op, 0x39)),
333145548106Schristos       OP3(ORREG1, ORREG1, OWREG1),
333245548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
333345548106Schristos 	   ENC(dst, reg, 2)))
333445548106Schristos INSNE(subaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
333545548106Schristos       FIX1(FIX(op, 0x3b)),
333645548106Schristos       OP3(ORREG1, OACST, OWREG1),
333745548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
333845548106Schristos 	   ENC(dst, reg, 2)))
333945548106Schristos 
33409573673dSchristos /* 16 bits insn */
33419573673dSchristos INSN(subaw, d, dx5p, 1cycle, C64XP, 0,
33429573673dSchristos      FIX1(FIX(op, 1)),
33439573673dSchristos      OP3(ORB15REG1, OACST, OWB15REG1),
33449573673dSchristos      ENC2(ENC(s, fu, 0), ENC(cst, ucst, 1)))
33459573673dSchristos /**/
33469573673dSchristos 
334745548106Schristos INSN(subc, l, 1_or_2_src, 1cycle, C62X, 0,
334845548106Schristos      FIX1(FIX(op, 0x4b)),
334945548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
335045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
335145548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
335245548106Schristos 
335345548106Schristos INSNE(subdp, l_dp_xdp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(1),
335445548106Schristos       FIX1(FIX(op, 0x19)),
335545548106Schristos       OP3(ORREGD12, ORXREGD12, OWREGD67),
335645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
335745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
335845548106Schristos INSNE(subdp, l_xdp_dp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(0),
335945548106Schristos       FIX1(FIX(op, 0x1d)),
336045548106Schristos       OP3(ORXREGD12, ORREGD12, OWREGD67),
336145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
336245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
336345548106Schristos INSNE(subdp, s_dp_xdp_dp, s, l_1_or_2_src, addsubdp, C67XP,
336445548106Schristos       TIC6X_FLAG_PREFER(1),
336545548106Schristos       FIX1(FIX(op, 0x73)),
336645548106Schristos       OP3(ORREGD12, ORXREGD12, OWREGD67),
336745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
336845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
336945548106Schristos INSNE(subdp, s_xdp_dp_dp, s, l_1_or_2_src, addsubdp, C67XP,
337045548106Schristos       TIC6X_FLAG_PREFER(0),
337145548106Schristos       FIX1(FIX(op, 0x77)),
337245548106Schristos       OP3(ORXREGD12, ORREGD12, OWREGD67),
337345548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
337445548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
337545548106Schristos 
337645548106Schristos INSNE(subsp, l_sp_xsp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(1),
337745548106Schristos       FIX1(FIX(op, 0x11)),
337845548106Schristos       OP3(ORREG1, ORXREG1, OWREG4),
337945548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
338045548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
338145548106Schristos INSNE(subsp, l_xsp_sp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(0),
338245548106Schristos       FIX1(FIX(op, 0x15)),
338345548106Schristos       OP3(ORXREG1, ORREG1, OWREG4),
338445548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
338545548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
338645548106Schristos INSNE(subsp, s_sp_xsp_sp, s, l_1_or_2_src, 4cycle, C67XP,
338745548106Schristos       TIC6X_FLAG_PREFER(1),
338845548106Schristos       FIX1(FIX(op, 0x71)),
338945548106Schristos       OP3(ORREG1, ORXREG1, OWREG4),
339045548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
339145548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
339245548106Schristos INSNE(subsp, s_xsp_sp_sp, s, l_1_or_2_src, 4cycle, C67XP,
339345548106Schristos       TIC6X_FLAG_PREFER(0),
339445548106Schristos       FIX1(FIX(op, 0x75)),
339545548106Schristos       OP3(ORXREG1, ORREG1, OWREG4),
339645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
339745548106Schristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
339845548106Schristos 
339945548106Schristos INSNE(subu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
340045548106Schristos       FIX1(FIX(op, 0x2f)),
340145548106Schristos       OP3(ORREG1, ORXREG1, OWREGL1),
340245548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
340345548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
340445548106Schristos INSNE(subu, l_xui_ui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
340545548106Schristos       FIX1(FIX(op, 0x3f)),
340645548106Schristos       OP3(ORXREG1, ORREG1, OWREGL1),
340745548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
340845548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
340945548106Schristos 
341045548106Schristos INSN(sub2, l, 1_or_2_src, 1cycle, C64X, 0,
341145548106Schristos      FIX1(FIX(op, 0x04)),
341245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
341345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
341445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
341545548106Schristos INSN(sub2, s, 1_or_2_src, 1cycle, C62X, 0,
341645548106Schristos      FIX1(FIX(op, 0x11)),
341745548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
341845548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
341945548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
342045548106Schristos INSN(sub2, d, ext_1_or_2_src, 1cycle, C64X, 0,
342145548106Schristos      FIX1(FIX(op, 0x5)),
342245548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
342345548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
342445548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
342545548106Schristos 
342645548106Schristos INSN(sub4, l, 1_or_2_src, 1cycle, C64X, 0,
342745548106Schristos      FIX1(FIX(op, 0x66)),
342845548106Schristos      OP3(ORREG1, ORXREG1, OWREG1),
342945548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
343045548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
343145548106Schristos 
343245548106Schristos INSN(swap2, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
343345548106Schristos      FIX2(FIX(op, 0x1b), FIX(x, 0)),
343445548106Schristos      OP2(ORREG1, OWREG1),
343545548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
343645548106Schristos 	  ENC(src2, reg, 0), ENC(dst, reg, 1)))
343745548106Schristos INSN(swap2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
343845548106Schristos      FIX2(FIX(op, 0x10), FIX(x, 0)),
343945548106Schristos      OP2(ORREG1, OWREG1),
344045548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
344145548106Schristos 	  ENC(src2, reg, 0), ENC(dst, reg, 1)))
344245548106Schristos 
344345548106Schristos /* Contrary to SPRUFE8, this is the correct encoding for this
344445548106Schristos    instruction.  */
344545548106Schristos INSN(swap4, l, unary, 1cycle, C64X, 0,
344645548106Schristos      FIX1(FIX(op, 0x1)),
344745548106Schristos      OP2(ORXREG1, OWREG1),
344845548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
344945548106Schristos 	  ENC(dst, reg, 1)))
345045548106Schristos 
345145548106Schristos INSN(swe, nfu, swe, 1cycle, C64XP, 0,
345245548106Schristos      FIX1(FIX(s, 0)),
345345548106Schristos      OP0(),
345445548106Schristos      ENC0())
345545548106Schristos 
345645548106Schristos INSN(swenr, nfu, swenr, 1cycle, C64XP, 0,
345745548106Schristos      FIX1(FIX(s, 0)),
345845548106Schristos      OP0(),
345945548106Schristos      ENC0())
346045548106Schristos 
346145548106Schristos INSN(unpkhu4, l, unary, 1cycle, C64X, 0,
346245548106Schristos      FIX1(FIX(op, 0x03)),
346345548106Schristos      OP2(ORXREG1, OWREG1),
346445548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
346545548106Schristos 	  ENC(dst, reg, 1)))
346645548106Schristos INSN(unpkhu4, s, unary, 1cycle, C64X, 0,
346745548106Schristos      FIX1(FIX(op, 0x03)),
346845548106Schristos      OP2(ORXREG1, OWREG1),
346945548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
347045548106Schristos 	  ENC(dst, reg, 1)))
347145548106Schristos 
347245548106Schristos INSN(unpklu4, l, unary, 1cycle, C64X, 0,
347345548106Schristos      FIX1(FIX(op, 0x02)),
347445548106Schristos      OP2(ORXREG1, OWREG1),
347545548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
347645548106Schristos 	  ENC(dst, reg, 1)))
347745548106Schristos INSN(unpklu4, s, unary, 1cycle, C64X, 0,
347845548106Schristos      FIX1(FIX(op, 0x02)),
347945548106Schristos      OP2(ORXREG1, OWREG1),
348045548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
348145548106Schristos 	  ENC(dst, reg, 1)))
348245548106Schristos 
348345548106Schristos INSNE(xor, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
348445548106Schristos       FIX1(FIX(op, 0x6f)),
348545548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
348645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
348745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
348845548106Schristos INSNE(xor, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
348945548106Schristos       FIX1(FIX(op, 0x6e)),
349045548106Schristos       OP3(OACST, ORXREG1, OWREG1),
349145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
349245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
349345548106Schristos INSNE(xor, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
349445548106Schristos       FIX1(FIX(op, 0x0b)),
349545548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
349645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
349745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
349845548106Schristos INSNE(xor, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
349945548106Schristos       FIX1(FIX(op, 0x0a)),
350045548106Schristos       OP3(OACST, ORXREG1, OWREG1),
350145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
350245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
350345548106Schristos INSNE(xor, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
350445548106Schristos       FIX1(FIX(op, 0xe)),
350545548106Schristos       OP3(ORREG1, ORXREG1, OWREG1),
350645548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
350745548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
350845548106Schristos INSNE(xor, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
350945548106Schristos       FIX1(FIX(op, 0xf)),
351045548106Schristos       OP3(OACST, ORXREG1, OWREG1),
351145548106Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
351245548106Schristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
351345548106Schristos 
35149573673dSchristos /* 16 bits insn */
35159573673dSchristos INSN(xor, l, l2c, 1cycle, C64XP, 0,
35169573673dSchristos       FIX1(FIX(op, 0x2)),
35179573673dSchristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
35189573673dSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
35199573673dSchristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
35209573673dSchristos INSNU(xor, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
35219573673dSchristos      FIX2(FIX(op, 0x7), FIX(unit, 0x0)),
35229573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
35239573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
35249573673dSchristos INSNU(xor, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
35259573673dSchristos      FIX2(FIX(op, 0x7), FIX(unit, 0x1)),
35269573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
35279573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
35289573673dSchristos INSNU(xor, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
35299573673dSchristos      FIX2(FIX(op, 0x7), FIX(unit, 0x2)),
35309573673dSchristos      OP3(ORREG1, OHWCST1, OWREG1),
35319573673dSchristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
35329573673dSchristos /**/
35339573673dSchristos 
353445548106Schristos INSN(xormpy, m, 1_or_2_src, 4cycle, C64XP, 0,
353545548106Schristos      FIX1(FIX(op, 0x1b)),
353645548106Schristos      OP3(ORREG1, ORXREG1, OWREG4),
353745548106Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
353845548106Schristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
353945548106Schristos 
354045548106Schristos INSN(xpnd2, m, unary, 1616_m, C64X, 0,
354145548106Schristos      FIX1(FIX(op, 0x19)),
354245548106Schristos      OP2(ORXREG1, OWREG2),
354345548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
354445548106Schristos 	  ENC(dst, reg, 1)))
354545548106Schristos 
354645548106Schristos INSN(xpnd4, m, unary, 1616_m, C64X, 0,
354745548106Schristos      FIX1(FIX(op, 0x18)),
354845548106Schristos      OP2(ORXREG1, OWREG2),
354945548106Schristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
355045548106Schristos 	  ENC(dst, reg, 1)))
355145548106Schristos 
355245548106Schristos INSN(zero, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
355345548106Schristos      FIX2(FIX(h, 0), FIX(cst, 0)),
355445548106Schristos      OP1(OWREG1),
355545548106Schristos      ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
355645548106Schristos INSN(zero, l, unary, 1cycle, C64X,
355745548106Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
355845548106Schristos      FIX3(FIX(x, 0), FIX(op, 0x05), FIX(src2, 0)),
355945548106Schristos      OP1(OWREG1),
356045548106Schristos      ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
356145548106Schristos INSNE(zero, l_sub, l, 1_or_2_src, 1cycle, C62X,
356245548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
356345548106Schristos       FIX2(FIX(op, 0x07), FIX(x, 0)),
356445548106Schristos       OP1(OWREG1),
356545548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
356645548106Schristos 	   ENC(dst, reg, 0)))
356745548106Schristos INSNE(zero, l_sub_sl, l, 1_or_2_src, 1cycle, C62X,
356845548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
356945548106Schristos       FIX2(FIX(op, 0x27), FIX(x, 0)),
357045548106Schristos       OP1(OWREGL1),
357145548106Schristos       ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
357245548106Schristos 	   ENC(dst, reg, 0)))
357345548106Schristos INSNE(zero, d_mvk, d, 1_or_2_src, 1cycle, C64X,
357445548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
357545548106Schristos       FIX3(FIX(op, 0x00), FIX(src1, 0), FIX(src2, 0)),
357645548106Schristos       OP1(OWREG1),
357745548106Schristos       ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
357845548106Schristos INSNE(zero, d_sub, d, 1_or_2_src, 1cycle, C62X,
357945548106Schristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
358045548106Schristos       FIX1(FIX(op, 0x11)),
358145548106Schristos       OP1(OWREG1),
358245548106Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg_unused, 0), ENC(src1, reg_unused, 0),
358345548106Schristos 	   ENC(dst, reg, 0)))
358445548106Schristos 
358545548106Schristos #undef TIC6X_INSN_C64X_AND_C67X
358645548106Schristos #undef tic6x_insn_format_nfu_s_branch_nop_cst
358745548106Schristos #undef tic6x_insn_format_s_l_1_or_2_src
358845548106Schristos #undef RAN
358945548106Schristos #undef FIX
359045548106Schristos #undef FIX0
359145548106Schristos #undef FIX1
359245548106Schristos #undef FIX2
359345548106Schristos #undef FIX3
359445548106Schristos #undef FIX4
359545548106Schristos #undef OP0
359645548106Schristos #undef OP1
359745548106Schristos #undef OP2
359845548106Schristos #undef OP3
359945548106Schristos #undef OP4
360045548106Schristos #undef OACST
360145548106Schristos #undef OLCST
36029573673dSchristos #undef OHWCSTM1
36039573673dSchristos #undef OHWCST0
36049573673dSchristos #undef OHWCST1
36059573673dSchristos #undef OHWCST5
36069573673dSchristos #undef OHWCST16
36079573673dSchristos #undef OHWCST24
36089573673dSchristos #undef OHWCST31
360945548106Schristos #undef OFULIST
361045548106Schristos #undef ORIRP1
361145548106Schristos #undef ORNRP1
361245548106Schristos #undef OWREG1
361345548106Schristos #undef OWRETREG1
361445548106Schristos #undef ORREG1
361545548106Schristos #undef ORDREG1
361645548106Schristos #undef ORWREG1
361745548106Schristos #undef ORAREG1
361845548106Schristos #undef ORXREG1
361945548106Schristos #undef ORREG12
362045548106Schristos #undef ORREG14
362145548106Schristos #undef ORXREG14
362245548106Schristos #undef OWREG2
362345548106Schristos #undef OWREG4
362445548106Schristos #undef OWREG9
362545548106Schristos #undef OWDREG5
362645548106Schristos #undef OWREGL1
362745548106Schristos #undef ORREGL1
362845548106Schristos #undef OWREGD1
36299573673dSchristos #undef ORTREG1
36309573673dSchristos #undef ORTREGD1
36319573673dSchristos #undef OWTREG5
36329573673dSchristos #undef OWTREGD5
363345548106Schristos #undef OWREGD12
363445548106Schristos #undef OWREGD4
363545548106Schristos #undef ORREGD1
363645548106Schristos #undef OWREGD45
363745548106Schristos #undef OWREGD67
363845548106Schristos #undef ORDREGD1
363945548106Schristos #undef OWDREGD5
364045548106Schristos #undef ORREGD12
364145548106Schristos #undef ORXREGD12
36429573673dSchristos #undef ORXREGD1234
364345548106Schristos #undef ORREGD1324
364445548106Schristos #undef OWREGD910
36459573673dSchristos #undef OWILC1
364645548106Schristos #undef ORCREG1
364745548106Schristos #undef OWCREG1
36489573673dSchristos #undef OWREG1Z
36499573673dSchristos #undef ORB15REG1
36509573673dSchristos #undef OWB15REG1
365145548106Schristos #undef ORMEMDW
365245548106Schristos #undef OWMEMDW
365345548106Schristos #undef ORMEMSB
365445548106Schristos #undef OWMEMSB
365545548106Schristos #undef ORMEMLB
365645548106Schristos #undef OWMEMLB
365745548106Schristos #undef ORMEMSH
365845548106Schristos #undef OWMEMSH
365945548106Schristos #undef ORMEMLH
366045548106Schristos #undef OWMEMLH
366145548106Schristos #undef ORMEMSW
366245548106Schristos #undef OWMEMSW
366345548106Schristos #undef ORMEMLW
366445548106Schristos #undef OWMEMLW
366545548106Schristos #undef ORMEMSD
366645548106Schristos #undef OWMEMSD
366745548106Schristos #undef ORMEMND
366845548106Schristos #undef OWMEMND
366945548106Schristos #undef ENC
367045548106Schristos #undef ENC0
367145548106Schristos #undef ENC1
367245548106Schristos #undef ENC2
367345548106Schristos #undef ENC3
367445548106Schristos #undef ENC4
367545548106Schristos #undef ENC5
367645548106Schristos #undef ENC6
367745548106Schristos #undef ENC7
3678