xref: /netbsd-src/external/gpl3/gdb/dist/include/opcode/tic6x-opcode-table.h (revision aab831cebf6361fb2b518a47c70732e608d9abd2)
198b9484cSchristos /* TI C6X opcode table.
2*aab831ceSchristos    Copyright (C) 2010-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This program is free software; you can redistribute it and/or modify
598b9484cSchristos    it under the terms of the GNU General Public License as published by
698b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
798b9484cSchristos    (at your option) any later version.
898b9484cSchristos 
998b9484cSchristos    This program is distributed in the hope that it will be useful,
1098b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1198b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1298b9484cSchristos    GNU General Public License for more details.
1398b9484cSchristos 
1498b9484cSchristos    You should have received a copy of the GNU General Public License
1598b9484cSchristos    along with this program; if not, write to the Free Software
1698b9484cSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1798b9484cSchristos    MA 02110-1301, USA.  */
1898b9484cSchristos 
1998b9484cSchristos /* Define the INSN macro before including this file; it takes as
2098b9484cSchristos    arguments the fields from tic6x_opcode (defined in tic6x.h).  The
2198b9484cSchristos    name is given as an identifier; the subsequent four operands should
2298b9484cSchristos    have "tic6x_func_unit_", "tic6x_insn_format_", "tic6x_pipeline_"
2398b9484cSchristos    and "TIC6X_INSN_", respectively, prepended to them by the macro
2498b9484cSchristos    definition.  Also define INSNE, which has a second argument that
2598b9484cSchristos    goes after tic6x_opcode_NAME_ to form the enumeration value for
2698b9484cSchristos    this instruction, where the value otherwise formed from the name,
2798b9484cSchristos    functional unit and format is ambiguous, but otherwise has the same
2898b9484cSchristos    arguments as INSN.  */
2998b9484cSchristos 
3098b9484cSchristos #define TIC6X_INSN_C64X_AND_C67X TIC6X_INSN_C64X|TIC6X_INSN_C67X
3198b9484cSchristos #define tic6x_insn_format_nfu_s_branch_nop_cst	\
3298b9484cSchristos   tic6x_insn_format_s_branch_nop_cst
3398b9484cSchristos #define tic6x_insn_format_s_l_1_or_2_src tic6x_insn_format_l_1_or_2_src
3498b9484cSchristos #define RAN(id, min, max) { CONCAT2(tic6x_field_,id), (min), (max) }
3598b9484cSchristos #define FIX(id, val) RAN(id, val, val)
3698b9484cSchristos #define FIX0() 0, { { 0, 0, 0 } }
3798b9484cSchristos #define FIX1(a) 1, { a }
3898b9484cSchristos #define FIX2(a, b) 2, { a, b }
3998b9484cSchristos #define FIX3(a, b, c) 3, { a, b, c }
4098b9484cSchristos #define FIX4(a, b, c, d) 4, { a, b, c, d }
414b169a6bSchristos #define OP0() 0, { { 0, 0, false, 0, 0, 0, 0 } }
4298b9484cSchristos #define OP1(a) 1, { a }
4398b9484cSchristos #define OP2(a, b) 2, { a, b }
4498b9484cSchristos #define OP3(a, b, c) 3, { a, b, c }
4598b9484cSchristos #define OP4(a, b, c, d) 4, { a, b, c, d }
4698b9484cSchristos #define OACST { tic6x_operand_asm_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
4798b9484cSchristos #define OLCST { tic6x_operand_link_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
4803467a24Schristos #define OHWCSTM1 { tic6x_operand_hw_const_minus_1, 0, tic6x_rw_none, 0, 0, 0, 0 }
4903467a24Schristos #define OHWCST0 { tic6x_operand_hw_const_0, 0, tic6x_rw_none, 0, 0, 0, 0 }
5003467a24Schristos #define OHWCST1 { tic6x_operand_hw_const_1, 0, tic6x_rw_none, 0, 0, 0, 0 }
5103467a24Schristos #define OHWCST5 { tic6x_operand_hw_const_5, 0, tic6x_rw_none, 0, 0, 0, 0 }
5203467a24Schristos #define OHWCST16 { tic6x_operand_hw_const_16, 0, tic6x_rw_none, 0, 0, 0, 0 }
5303467a24Schristos #define OHWCST24 { tic6x_operand_hw_const_24, 0, tic6x_rw_none, 0, 0, 0, 0 }
5403467a24Schristos #define OHWCST31 { tic6x_operand_hw_const_31, 0, tic6x_rw_none, 0, 0, 0, 0 }
5598b9484cSchristos #define OFULIST { tic6x_operand_func_unit, 0, tic6x_rw_none, 0, 0, 0, 0 }
5698b9484cSchristos #define ORIRP1 { tic6x_operand_irp, 4, tic6x_rw_read, 1, 1, 0, 0 }
5798b9484cSchristos #define ORNRP1 { tic6x_operand_nrp, 4, tic6x_rw_read, 1, 1, 0, 0 }
5898b9484cSchristos #define OWREG1 { tic6x_operand_reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
5903467a24Schristos #define OWREG1Z { tic6x_operand_zreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
6003467a24Schristos #define OWREG1NORS { tic6x_operand_reg_nors, 4, tic6x_rw_write, 1, 1, 0, 0 }
6103467a24Schristos #define ORREG1B { tic6x_operand_reg_bside, 4, tic6x_rw_write, 1, 1, 0, 0 }
6203467a24Schristos #define ORREG1BNORS { tic6x_operand_reg_bside_nors, 4, tic6x_rw_write, 1, 1, 0, 0 }
6398b9484cSchristos #define OWRETREG1 { tic6x_operand_retreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
6498b9484cSchristos #define ORREG1 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
6598b9484cSchristos #define ORDREG1 { tic6x_operand_dreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
6603467a24Schristos #define ORTREG1 { tic6x_operand_treg, 4, tic6x_rw_read, 1, 1, 0, 0 }
6798b9484cSchristos #define ORWREG1 { tic6x_operand_reg, 4, tic6x_rw_read_write, 1, 1, 0, 0 }
6803467a24Schristos #define ORB15REG1 { tic6x_operand_b15reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
6903467a24Schristos #define OWB15REG1 { tic6x_operand_b15reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
7098b9484cSchristos #define ORAREG1 { tic6x_operand_areg, 4, tic6x_rw_read, 1, 1, 0, 0 }
7198b9484cSchristos #define ORXREG1 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
7298b9484cSchristos #define ORREG12 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 2, 0, 0 }
7398b9484cSchristos #define ORREG14 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 4, 0, 0 }
7498b9484cSchristos #define ORXREG14 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 4, 0, 0 }
7598b9484cSchristos #define OWREG2 { tic6x_operand_reg, 4, tic6x_rw_write, 2, 2, 0, 0 }
7698b9484cSchristos #define OWREG4 { tic6x_operand_reg, 4, tic6x_rw_write, 4, 4, 0, 0 }
7798b9484cSchristos #define OWREG9 { tic6x_operand_reg, 4, tic6x_rw_write, 9, 9, 0, 0 }
7898b9484cSchristos #define OWDREG5 { tic6x_operand_dreg, 4, tic6x_rw_write, 5, 5, 0, 0 }
7903467a24Schristos #define OWTREG5 { tic6x_operand_treg, 4, tic6x_rw_write, 5, 5, 0, 0 }
8098b9484cSchristos #define OWREGL1 { tic6x_operand_regpair, 5, tic6x_rw_write, 1, 1, 1, 1 }
8198b9484cSchristos #define ORREGL1 { tic6x_operand_regpair, 5, tic6x_rw_read, 1, 1, 1, 1 }
8298b9484cSchristos #define OWREGD1 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 1, 1 }
8398b9484cSchristos #define OWREGD12 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 2, 2 }
8498b9484cSchristos #define OWREGD4 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 4, 4 }
8598b9484cSchristos #define ORREGD1 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
8698b9484cSchristos #define OWREGD45 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 5, 5 }
8798b9484cSchristos #define OWREGD67 { tic6x_operand_regpair, 8, tic6x_rw_write, 6, 6, 7, 7 }
8898b9484cSchristos #define ORDREGD1 { tic6x_operand_dregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
8903467a24Schristos #define ORTREGD1 { tic6x_operand_tregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
9098b9484cSchristos #define OWDREGD5 { tic6x_operand_dregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
9103467a24Schristos #define OWTREGD5 { tic6x_operand_tregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
9298b9484cSchristos #define ORREGD12 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
9398b9484cSchristos #define ORXREGD12 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
9498b9484cSchristos #define ORREGD1234 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 2, 3, 4 }
9503467a24Schristos #define ORXREGD1324 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 3, 2, 4 }
9698b9484cSchristos #define OWREGD910 { tic6x_operand_regpair, 8, tic6x_rw_write, 9, 9, 10, 10 }
9798b9484cSchristos #define ORCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_read, 1, 1, 0, 0 }
9898b9484cSchristos #define OWCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_write, 1, 1, 0, 0 }
9903467a24Schristos #define OWILC1 { tic6x_operand_ilc, 4, tic6x_rw_write, 1, 1, 0, 0 }
10098b9484cSchristos #define ORMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_read, 3, 3, 0, 0 }
10198b9484cSchristos #define OWMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_write, 3, 3, 0, 0 }
10298b9484cSchristos #define ORMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_read, 3, 3, 0, 0 }
10398b9484cSchristos #define OWMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_write, 3, 3, 0, 0 }
10498b9484cSchristos #define ORMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_read, 3, 3, 0, 0 }
10598b9484cSchristos #define OWMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_write, 3, 3, 0, 0 }
10698b9484cSchristos #define ORMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_read, 3, 3, 0, 0 }
10798b9484cSchristos #define OWMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_write, 3, 3, 0, 0 }
10898b9484cSchristos #define ORMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_read, 3, 3, 0, 0 }
10998b9484cSchristos #define OWMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_write, 3, 3, 0, 0 }
11098b9484cSchristos #define ORMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_read, 3, 3, 0, 0 }
11198b9484cSchristos #define OWMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_write, 3, 3, 0, 0 }
11298b9484cSchristos #define ORMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_read, 3, 3, 0, 0 }
11398b9484cSchristos #define OWMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_write, 3, 3, 0, 0 }
11498b9484cSchristos #define ORMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_read, 3, 3, 0, 0 }
11598b9484cSchristos #define OWMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_write, 3, 3, 0, 0 }
11698b9484cSchristos #define ORMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_read, 3, 3, 0, 0 }
11798b9484cSchristos #define OWMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_write, 3, 3, 0, 0 }
11898b9484cSchristos #define ENC(id, meth, op) {			\
11998b9484cSchristos     CONCAT2(tic6x_field_,id),			\
12098b9484cSchristos     CONCAT2(tic6x_coding_,meth),		\
12198b9484cSchristos     op						\
12298b9484cSchristos   }
12398b9484cSchristos #define ENC0() 0, { { 0, 0, 0 } }
12498b9484cSchristos #define ENC1(a) 1, { a }
12598b9484cSchristos #define ENC2(a, b) 2, { a, b }
12698b9484cSchristos #define ENC3(a, b, c) 3, { a, b, c }
12798b9484cSchristos #define ENC4(a, b, c, d) 4, { a, b, c, d }
12898b9484cSchristos #define ENC5(a, b, c, d, e) 5, { a, b, c, d, e }
12998b9484cSchristos #define ENC6(a, b, c, d, e, f) 6, { a, b, c, d, e, f }
13098b9484cSchristos #define ENC7(a, b, c, d, e, f, g) 7, { a, b, c, d, e, f, g }
13198b9484cSchristos 
13298b9484cSchristos INSN(abs, l, unary, 1cycle, C62X, 0,
13398b9484cSchristos      FIX1(FIX(op, 0)),
13498b9484cSchristos      OP2(ORXREG1, OWREG1),
13598b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
13698b9484cSchristos 	  ENC(dst, reg, 1)))
13798b9484cSchristos INSN(abs, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
13898b9484cSchristos      FIX3(FIX(op, 0x38), FIX(x, 0), FIX(src1, 0)),
13998b9484cSchristos      OP2(ORREGL1, OWREGL1),
14098b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
14198b9484cSchristos 
14298b9484cSchristos INSN(abs2, l, unary, 1cycle, C64X, 0,
14398b9484cSchristos      FIX1(FIX(op, 0x4)),
14498b9484cSchristos      OP2(ORXREG1, OWREG1),
14598b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
14698b9484cSchristos 	  ENC(dst, reg, 1)))
14798b9484cSchristos 
14898b9484cSchristos INSN(absdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
14903467a24Schristos      FIX2(FIX(op, 0x2c), FIX(x, 0)),
15098b9484cSchristos      OP2(ORREGD1, OWREGD12),
15103467a24Schristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
15203467a24Schristos 	  ENC(dst, reg, 1)))
15398b9484cSchristos 
15498b9484cSchristos INSN(abssp, s, unary, 1cycle, C67X, 0,
15598b9484cSchristos      FIX1(FIX(op, 0)),
15698b9484cSchristos      OP2(ORXREG1, OWREG1),
15798b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
15898b9484cSchristos 	  ENC(dst, reg, 1)))
15998b9484cSchristos 
16098b9484cSchristos INSNE(add, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
16198b9484cSchristos       FIX1(FIX(op, 0x3)),
16298b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
16398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
16598b9484cSchristos INSNE(add, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, 0,
16698b9484cSchristos       FIX1(FIX(op, 0x23)),
16798b9484cSchristos       OP3(ORREG1, ORXREG1, OWREGL1),
16898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
16998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
17098b9484cSchristos INSNE(add, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
17198b9484cSchristos       FIX1(FIX(op, 0x21)),
17298b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREGL1),
17398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
17498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
17598b9484cSchristos INSNE(add, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
17698b9484cSchristos       FIX1(FIX(op, 0x2)),
17798b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
17898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
17998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
18098b9484cSchristos INSNE(add, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
18198b9484cSchristos       FIX2(FIX(op, 0x20), FIX(x, 0)),
18298b9484cSchristos       OP3(OACST, ORREGL1, OWREGL1),
18398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
18498b9484cSchristos 	   ENC(dst, reg, 2)))
18598b9484cSchristos INSNE(add, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
18698b9484cSchristos       FIX1(FIX(op, 0x7)),
18798b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
18898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
18998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
19098b9484cSchristos INSNE(add, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
19198b9484cSchristos       FIX1(FIX(op, 0x6)),
19298b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
19398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
19498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
19598b9484cSchristos INSNE(add, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
19698b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
19798b9484cSchristos       FIX1(FIX(op, 0x10)),
19898b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
19998b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
20098b9484cSchristos 	   ENC(dst, reg, 2)))
20198b9484cSchristos INSNE(add, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
20298b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
20398b9484cSchristos       FIX1(FIX(op, 0x12)),
20498b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
20598b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
20698b9484cSchristos 	   ENC(dst, reg, 2)))
20798b9484cSchristos INSNE(add, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
20898b9484cSchristos       FIX1(FIX(op, 0xa)),
20998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
21098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
21198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
21298b9484cSchristos INSNE(add, d_xsi_s5_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
21398b9484cSchristos       FIX1(FIX(op, 0xb)),
21498b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
21598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
21698b9484cSchristos 	   ENC(src1, scst, 1), ENC(dst, reg, 2)))
21798b9484cSchristos 
21803467a24Schristos /* 16 bits insn */
21903467a24Schristos INSN(add, l, l3_sat_0, 1cycle, C64XP, 0,
22003467a24Schristos      FIX1(FIX(op, 0x0)),
22103467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
22203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
22303467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
22403467a24Schristos INSN(add, l, l3i, 1cycle, C64XP, 0,
22503467a24Schristos      FIX0(),
22603467a24Schristos      OP3(OACST, ORXREG1, OWREG1),
22703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(cst, scst_l3i, 0),
22803467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
22903467a24Schristos INSN(add, l, lx1, 1cycle, C64XP,
23003467a24Schristos      TIC6X_FLAG_NO_CROSS,
23103467a24Schristos      FIX1(FIX(op, 0x3)),
23203467a24Schristos      OP3(OHWCSTM1, ORREG1, OWREG1),
23303467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
23403467a24Schristos INSN(add, s, s3_sat_0, 1cycle, C64XP, 0,
23503467a24Schristos      FIX1(FIX(op, 0x0)),
23603467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
23703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
23803467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
23903467a24Schristos INSN(add, s, sx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
24003467a24Schristos       FIX1(FIX(op, 0x3)),
24103467a24Schristos       OP3(OHWCSTM1, ORREG1, OWREG1),
24203467a24Schristos       ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
24303467a24Schristos INSN(add, s, sx2op, 1cycle, C64XP, 0,
24403467a24Schristos       FIX1(FIX(op, 0x0)),
24503467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1),
24603467a24Schristos       ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2),
24703467a24Schristos            ENC(src2, reg, 1), ENC(x, xpath, 1)))
24803467a24Schristos INSN(add, d, dx2op, 1cycle, C64XP, 0,
24903467a24Schristos      FIX1(FIX(op, 0x0)),
25003467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
25103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 1), ENC(srcdst, reg, 0),
25203467a24Schristos           ENC(src2, reg, 1), ENC(srcdst, reg, 2)))
25303467a24Schristos INSNU(add, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
25403467a24Schristos      FIX2(FIX(op, 0x5), FIX(unit, 0x0)),
25503467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
25603467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
25703467a24Schristos INSNU(add, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
25803467a24Schristos      FIX2(FIX(op, 0x5), FIX(unit, 0x1)),
25903467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
26003467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
26103467a24Schristos INSNU(add, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
26203467a24Schristos      FIX2(FIX(op, 0x5), FIX(unit, 0x2)),
26303467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
26403467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
26503467a24Schristos /**/
26603467a24Schristos 
26798b9484cSchristos INSNE(addab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
26898b9484cSchristos       FIX1(FIX(op, 0x30)),
26998b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
27098b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
27198b9484cSchristos 	   ENC(dst, reg, 2)))
27298b9484cSchristos INSNE(addab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
27398b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
27498b9484cSchristos       FIX1(FIX(op, 0x32)),
27598b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
27698b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
27798b9484cSchristos 	   ENC(dst, reg, 2)))
27898b9484cSchristos INSN(addab, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
27998b9484cSchristos      FIX1(FIX(op, 3)),
28098b9484cSchristos      OP3(ORAREG1, OLCST, OWREG1),
28198b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 1),
28298b9484cSchristos 	  ENC(dst, reg, 2)))
28398b9484cSchristos 
28498b9484cSchristos INSNE(addad, d_si_si_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
28598b9484cSchristos       TIC6X_FLAG_NO_CROSS,
28698b9484cSchristos       FIX1(FIX(op, 0x3c)),
28798b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
28898b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
28998b9484cSchristos 	   ENC(dst, reg, 2)))
29098b9484cSchristos INSNE(addad, d_si_u5_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
29198b9484cSchristos       TIC6X_FLAG_NO_CROSS,
29298b9484cSchristos       FIX1(FIX(op, 0x3d)),
29398b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
29498b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
29598b9484cSchristos 	   ENC(dst, reg, 2)))
29698b9484cSchristos 
29798b9484cSchristos INSNE(addah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
29898b9484cSchristos       FIX1(FIX(op, 0x34)),
29998b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
30098b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
30198b9484cSchristos 	   ENC(dst, reg, 2)))
30298b9484cSchristos INSNE(addah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
30398b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
30498b9484cSchristos       FIX1(FIX(op, 0x36)),
30598b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
30698b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
30798b9484cSchristos 	   ENC(dst, reg, 2)))
30898b9484cSchristos INSN(addah, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
30998b9484cSchristos      FIX1(FIX(op, 5)),
31098b9484cSchristos      OP3(ORAREG1, OLCST, OWREG1),
31198b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 1),
31298b9484cSchristos 	  ENC(dst, reg, 2)))
31398b9484cSchristos 
31498b9484cSchristos INSNE(addaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
31598b9484cSchristos       FIX1(FIX(op, 0x38)),
31698b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
31798b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
31898b9484cSchristos 	   ENC(dst, reg, 2)))
31998b9484cSchristos INSNE(addaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
32098b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
32198b9484cSchristos       FIX1(FIX(op, 0x3a)),
32298b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
32398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
32498b9484cSchristos 	   ENC(dst, reg, 2)))
32598b9484cSchristos INSN(addaw, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
32698b9484cSchristos      FIX1(FIX(op, 7)),
32798b9484cSchristos      OP3(ORAREG1, OLCST, OWREG1),
32898b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 1),
32998b9484cSchristos 	  ENC(dst, reg, 2)))
33098b9484cSchristos 
33103467a24Schristos /* 16 bits insn */
33203467a24Schristos INSN(addaw, d, dx5, 1cycle, C64XP, TIC6X_FLAG_INSN16_BSIDE,
33303467a24Schristos      FIX0(),
33403467a24Schristos      OP3(ORB15REG1, OACST, OWREG1),
33503467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 1), ENC(dst, reg, 2)))
33603467a24Schristos INSN(addaw, d, dx5p, 1cycle, C64XP, TIC6X_FLAG_INSN16_BSIDE,
33703467a24Schristos      FIX1(FIX(op, 0)),
33803467a24Schristos      OP3(ORB15REG1, OACST, OWB15REG1),
33903467a24Schristos      ENC2(ENC(s, fu, 0), ENC(cst, ucst, 1)))
34003467a24Schristos /**/
34103467a24Schristos 
34298b9484cSchristos INSN(adddp, l, 1_or_2_src, addsubdp, C67X, 0,
34398b9484cSchristos      FIX1(FIX(op, 0x18)),
34498b9484cSchristos      OP3(ORREGD12, ORXREGD12, OWREGD67),
34598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
34698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
34798b9484cSchristos INSN(adddp, s, l_1_or_2_src, addsubdp, C67XP, 0,
34898b9484cSchristos      FIX1(FIX(op, 0x72)),
34998b9484cSchristos      OP3(ORREGD12, ORXREGD12, OWREGD67),
35098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
35198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
35298b9484cSchristos 
35398b9484cSchristos INSN(addk, s, addk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
35498b9484cSchristos      FIX0(),
35598b9484cSchristos      OP2(OLCST, OWREG1),
35698b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
35798b9484cSchristos 
35803467a24Schristos /* 16 bits insn */
35903467a24Schristos INSN(addk, s, sx5, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
36003467a24Schristos      FIX0(),
36103467a24Schristos      OP2(OACST, OWREG1),
36203467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
36303467a24Schristos /**/
36403467a24Schristos 
36598b9484cSchristos INSN(addkpc, s, addkpc, 1cycle, C64X,
36698b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_SIDE_B_ONLY,
36798b9484cSchristos      FIX1(FIX(s, 1)),
36898b9484cSchristos      OP3(OLCST, OWREG1, OACST),
36998b9484cSchristos      ENC3(ENC(src1, pcrel, 0), ENC(dst, reg, 1), ENC(src2, ucst, 2)))
37098b9484cSchristos 
37198b9484cSchristos INSN(addsp, l, 1_or_2_src, 4cycle, C67X, 0,
37298b9484cSchristos      FIX1(FIX(op, 0x10)),
37398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
37498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
37598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
37698b9484cSchristos INSN(addsp, s, l_1_or_2_src, 4cycle, C67XP, 0,
37798b9484cSchristos      FIX1(FIX(op, 0x70)),
37898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
37998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
38098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
38198b9484cSchristos 
38298b9484cSchristos INSN(addsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
38398b9484cSchristos      FIX1(FIX(op, 0xc)),
38498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
38598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
38698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
38798b9484cSchristos 
38898b9484cSchristos INSN(addsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
38998b9484cSchristos      FIX1(FIX(op, 0xd)),
39098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
39198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
39298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
39398b9484cSchristos 
39498b9484cSchristos INSNE(addu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, 0,
39598b9484cSchristos       FIX1(FIX(op, 0x2b)),
39698b9484cSchristos       OP3(ORREG1, ORXREG1, OWREGL1),
39798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
39898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
39998b9484cSchristos INSNE(addu, l_xui_ul_ul, l, 1_or_2_src, 1cycle, C62X, 0,
40098b9484cSchristos       FIX1(FIX(op, 0x29)),
40198b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREGL1),
40298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
40398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
40498b9484cSchristos 
40598b9484cSchristos INSN(add2, s, 1_or_2_src, 1cycle, C62X, 0,
40698b9484cSchristos      FIX1(FIX(op, 0x1)),
40798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
40898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
40998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
41098b9484cSchristos INSN(add2, l, 1_or_2_src, 1cycle, C64X, 0,
41198b9484cSchristos      FIX1(FIX(op, 0x5)),
41298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
41398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
41498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
41598b9484cSchristos INSN(add2, d, ext_1_or_2_src, 1cycle, C64X, 0,
41698b9484cSchristos      FIX1(FIX(op, 0x4)),
41798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
41898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
41998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
42098b9484cSchristos 
42198b9484cSchristos INSN(add4, l, 1_or_2_src, 1cycle, C64X, 0,
42298b9484cSchristos      FIX1(FIX(op, 0x65)),
42398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
42498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
42598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
42698b9484cSchristos 
42798b9484cSchristos INSNE(and, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
42898b9484cSchristos       FIX1(FIX(op, 0x7b)),
42998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
43098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
43198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
43298b9484cSchristos INSNE(and, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
43398b9484cSchristos       FIX1(FIX(op, 0x7a)),
43498b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
43598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
43698b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
43798b9484cSchristos INSNE(and, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
43898b9484cSchristos       FIX1(FIX(op, 0x1f)),
43998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
44098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
44198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
44298b9484cSchristos INSNE(and, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
44398b9484cSchristos       FIX1(FIX(op, 0x1e)),
44498b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
44598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
44698b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
44798b9484cSchristos INSNE(and, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
44898b9484cSchristos       FIX1(FIX(op, 0x6)),
44998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
45098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
45198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
45298b9484cSchristos INSNE(and, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
45398b9484cSchristos       FIX1(FIX(op, 0x7)),
45498b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
45598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
45698b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
45798b9484cSchristos 
45803467a24Schristos /* 16 bits insn */
45903467a24Schristos INSN(and, l, l2c, 1cycle, C64XP, 0,
46003467a24Schristos       FIX1(FIX(op, 0)),
46103467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
46203467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
46303467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
46403467a24Schristos /**/
46503467a24Schristos 
46698b9484cSchristos INSN(andn, l, 1_or_2_src, 1cycle, C64X, 0,
46798b9484cSchristos      FIX1(FIX(op, 0x7c)),
46898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
46998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
47098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
47198b9484cSchristos INSN(andn, s, ext_1_or_2_src, 1cycle, C64X, 0,
47298b9484cSchristos      FIX1(FIX(op, 0x6)),
47398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
47498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
47598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
47698b9484cSchristos INSN(andn, d, ext_1_or_2_src, 1cycle, C64X, 0,
47798b9484cSchristos      FIX1(FIX(op, 0x0)),
47898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
47998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
48098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
48198b9484cSchristos 
48298b9484cSchristos INSN(avg2, m, compound, 1616_m, C64X, 0,
48398b9484cSchristos      FIX1(FIX(op, 0x13)),
48498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
48598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
48698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
48798b9484cSchristos 
48898b9484cSchristos INSN(avgu4, m, compound, 1616_m, C64X, 0,
48998b9484cSchristos      FIX1(FIX(op, 0x12)),
49098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
49198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
49298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
49398b9484cSchristos 
49498b9484cSchristos INSN(b, s, ext_branch_cond_imm, branch, C62X, TIC6X_FLAG_NO_CROSS,
49598b9484cSchristos      FIX0(),
49698b9484cSchristos      OP1(OLCST),
49798b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
49898b9484cSchristos INSN(b, s, branch, branch, C62X, TIC6X_FLAG_SIDE_B_ONLY,
49998b9484cSchristos      FIX1(FIX(s, 1)),
50098b9484cSchristos      OP1(ORXREG1),
50198b9484cSchristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
50298b9484cSchristos INSN(b, s, b_irp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
50398b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
50498b9484cSchristos      OP1(ORIRP1),
50598b9484cSchristos      ENC0())
50698b9484cSchristos INSN(b, s, b_nrp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
50798b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
50898b9484cSchristos      OP1(ORNRP1),
50998b9484cSchristos      ENC0())
51098b9484cSchristos 
51198b9484cSchristos INSN(bdec, s, bdec, branch, C64X, TIC6X_FLAG_NO_CROSS,
51298b9484cSchristos      FIX0(),
51398b9484cSchristos      OP2(OLCST, ORWREG1),
51498b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
51598b9484cSchristos 
51698b9484cSchristos INSN(bitc4, m, unary, 1616_m, C64X, 0,
51798b9484cSchristos      FIX1(FIX(op, 0x1e)),
51898b9484cSchristos      OP2(ORXREG1, OWREG2),
51998b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
52098b9484cSchristos 	  ENC(dst, reg, 1)))
52198b9484cSchristos 
52298b9484cSchristos INSN(bitr, m, unary, 1616_m, C64X, 0,
52398b9484cSchristos      FIX1(FIX(op, 0x1f)),
52498b9484cSchristos      OP2(ORXREG1, OWREG2),
52598b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
52698b9484cSchristos 	  ENC(dst, reg, 1)))
52798b9484cSchristos 
52898b9484cSchristos INSN(bnop, s, branch_nop_cst, branch, C64X,
52998b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
53098b9484cSchristos      FIX0(),
53198b9484cSchristos      OP2(OLCST, OACST),
532a2e2270fSchristos      ENC3(ENC(s, fu, 0), ENC(src2, pcrel_half, 0), ENC(src1, ucst, 1)))
53398b9484cSchristos INSN(bnop, nfu, s_branch_nop_cst, branch, C64XP,
53498b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP,
53598b9484cSchristos      FIX1(FIX(s, 0)),
53698b9484cSchristos      OP2(OLCST, OACST),
53798b9484cSchristos      ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
53898b9484cSchristos INSN(bnop, s, branch_nop_reg, branch, C64X,
53998b9484cSchristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP,
54098b9484cSchristos      FIX1(FIX(s, 1)),
54198b9484cSchristos      OP2(ORXREG1, OACST),
54298b9484cSchristos      ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
54398b9484cSchristos 
54403467a24Schristos /* 16 bits insn format */
54503467a24Schristos INSN(bnop, s, sbu8, branch, C64XP,
54603467a24Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
54703467a24Schristos      FIX0(),
54803467a24Schristos      OP2(OLCST, OHWCST5),
54903467a24Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel_half_unsigned, 0)))
55003467a24Schristos INSN(bnop, s, sbs7, branch, C64XP,
55103467a24Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
55203467a24Schristos      FIX0(),
55303467a24Schristos      OP2(OLCST, OACST),
55403467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, pcrel_half, 0), ENC(n, ucst, 1)))
55503467a24Schristos INSN(bnop, s, sbu8c, branch, C64XP,
55603467a24Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_INSN16_SPRED,
55703467a24Schristos      FIX0(),
55803467a24Schristos      OP2(OLCST, OHWCST5),
55903467a24Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel_half_unsigned, 0)))
56003467a24Schristos INSN(bnop, s, sbs7c, branch, C64XP,
56103467a24Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_INSN16_SPRED,
56203467a24Schristos      FIX0(),
56303467a24Schristos      OP2(OLCST, OACST),
56403467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, pcrel_half, 0), ENC(n, ucst, 1)))
56503467a24Schristos INSN(bnop, s, sx1b, branch, C64XP,
56603467a24Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
56703467a24Schristos      FIX0(),
56803467a24Schristos      OP2(ORREG1BNORS, OACST),
56903467a24Schristos      ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(n, ucst, 1)))
57003467a24Schristos /**/
57103467a24Schristos 
57298b9484cSchristos INSN(bpos, s, bpos, branch, C64X, TIC6X_FLAG_NO_CROSS,
57398b9484cSchristos      FIX0(),
57498b9484cSchristos      OP2(OLCST, ORREG1),
57598b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
57698b9484cSchristos 
57798b9484cSchristos INSN(call, s, ext_branch_cond_imm, branch, C62X,
57898b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
57998b9484cSchristos      FIX0(),
58098b9484cSchristos      OP1(OLCST),
58198b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
58298b9484cSchristos INSN(call, s, branch, branch, C62X,
58398b9484cSchristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
58498b9484cSchristos      FIX1(FIX(s, 1)),
58598b9484cSchristos      OP1(ORXREG1),
58698b9484cSchristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
58798b9484cSchristos INSN(call, s, b_irp, branch, C62X,
58898b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
58998b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
59098b9484cSchristos      OP1(ORIRP1),
59198b9484cSchristos      ENC0())
59298b9484cSchristos INSN(call, s, b_nrp, branch, C62X,
59398b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
59498b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
59598b9484cSchristos      OP1(ORNRP1),
59698b9484cSchristos      ENC0())
59798b9484cSchristos 
59898b9484cSchristos INSN(callnop, s, branch_nop_cst, branch, C64X,
59998b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
60098b9484cSchristos      FIX0(),
60198b9484cSchristos      OP2(OLCST, OACST),
60298b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
60398b9484cSchristos INSN(callnop, nfu, s_branch_nop_cst, branch, C64XP,
60498b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
60598b9484cSchristos      FIX1(FIX(s, 0)),
60698b9484cSchristos      OP2(OLCST, OACST),
60798b9484cSchristos      ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
60898b9484cSchristos INSN(callnop, s, branch_nop_reg, branch, C64X,
60998b9484cSchristos      TIC6X_FLAG_MACRO|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
61098b9484cSchristos      FIX1(FIX(s, 1)),
61198b9484cSchristos      OP2(ORXREG1, OACST),
61298b9484cSchristos      ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
61398b9484cSchristos 
61403467a24Schristos 
61598b9484cSchristos INSN(callp, s, call_imm_nop, branch, C64XP,
61698b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
61798b9484cSchristos      FIX1(FIX(z, 1)),
61898b9484cSchristos      OP2(OLCST, OWRETREG1),
61998b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
62098b9484cSchristos 
62103467a24Schristos /* 16 bits insn format */
62203467a24Schristos INSN(callp, s, scs10, branch, C64XP,
62303467a24Schristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
62403467a24Schristos      FIX0(),
62503467a24Schristos      OP2(OLCST, OWRETREG1),
62603467a24Schristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
62703467a24Schristos /**/
62803467a24Schristos 
62998b9484cSchristos INSN(callret, s, ext_branch_cond_imm, branch, C62X,
63098b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
63198b9484cSchristos      FIX0(),
63298b9484cSchristos      OP1(OLCST),
63398b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
63498b9484cSchristos INSN(callret, s, branch, branch, C62X,
63598b9484cSchristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
63698b9484cSchristos      FIX1(FIX(s, 1)),
63798b9484cSchristos      OP1(ORXREG1),
63898b9484cSchristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
63998b9484cSchristos INSN(callret, s, b_irp, branch, C62X,
64098b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
64198b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
64298b9484cSchristos      OP1(ORIRP1),
64398b9484cSchristos      ENC0())
64498b9484cSchristos INSN(callret, s, b_nrp, branch, C62X,
64598b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
64698b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
64798b9484cSchristos      OP1(ORNRP1),
64898b9484cSchristos      ENC0())
64998b9484cSchristos 
65098b9484cSchristos INSN(clr, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
65198b9484cSchristos      FIX1(FIX(op, 0x3)),
65298b9484cSchristos      OP4(ORREG1, OACST, OACST, OWREG1),
65398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
65498b9484cSchristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
65598b9484cSchristos INSN(clr, s, 1_or_2_src, 1cycle, C62X, 0,
65698b9484cSchristos      FIX1(FIX(op, 0x3f)),
65798b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
65898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
65998b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
66098b9484cSchristos 
66103467a24Schristos /* 16 bits insn */
66203467a24Schristos INSN(clr, s, sc5, 1cycle, C64XP, 0,
66303467a24Schristos      FIX1(FIX(op, 2)),
66403467a24Schristos      OP4(ORREG1, OACST, OACST, OWREG1),
66503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1),
66603467a24Schristos           ENC(cst, ucst, 2), ENC(srcdst, reg, 3)))
66703467a24Schristos /**/
66803467a24Schristos 
66998b9484cSchristos INSNE(cmpeq, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
67098b9484cSchristos       FIX1(FIX(op, 0x53)),
67198b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
67298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
67398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
67498b9484cSchristos INSNE(cmpeq, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
67598b9484cSchristos       FIX1(FIX(op, 0x52)),
67698b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
67798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
67898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
67998b9484cSchristos INSNE(cmpeq, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
68098b9484cSchristos       FIX1(FIX(op, 0x51)),
68198b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREG1),
68298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
68398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
68498b9484cSchristos INSNE(cmpeq, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
68598b9484cSchristos       FIX2(FIX(op, 0x50), FIX(x, 0)),
68698b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
68798b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
68898b9484cSchristos 	   ENC(dst, reg, 2)))
68998b9484cSchristos 
69003467a24Schristos /* 16 bits insn */
69103467a24Schristos INSN(cmpeq, l, lx3c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
69203467a24Schristos       FIX0(),
69303467a24Schristos       OP3(OACST, ORXREG1, OWREG1),
69403467a24Schristos       ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
69503467a24Schristos            ENC(dst, reg, 2)))
69603467a24Schristos 
69703467a24Schristos INSN(cmpeq, l, l2c, 1cycle, C64XP, 0,
69803467a24Schristos       FIX1(FIX(op, 3)),
69903467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
70003467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
70103467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
70203467a24Schristos /**/
70303467a24Schristos 
70498b9484cSchristos INSN(cmpeq2, s, 1_or_2_src, 1cycle, C64X, 0,
70598b9484cSchristos      FIX1(FIX(op, 0x1d)),
70698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
70798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
70898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
70998b9484cSchristos 
71098b9484cSchristos INSN(cmpeq4, s, 1_or_2_src, 1cycle, C64X, 0,
71198b9484cSchristos      FIX1(FIX(op, 0x1c)),
71298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
71398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
71498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
71598b9484cSchristos 
71698b9484cSchristos INSN(cmpeqdp, s, 1_or_2_src, dpcmp, C67X, 0,
71798b9484cSchristos      FIX1(FIX(op, 0x28)),
71898b9484cSchristos      OP3(ORREGD12, ORXREGD12, OWREG2),
71998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
72098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
72198b9484cSchristos 
72298b9484cSchristos INSN(cmpeqsp, s, 1_or_2_src, 1cycle, C67X, 0,
72398b9484cSchristos      FIX1(FIX(op, 0x38)),
72498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
72598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
72698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
72798b9484cSchristos 
72898b9484cSchristos INSNE(cmpgt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
72998b9484cSchristos       FIX1(FIX(op, 0x47)),
73098b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
73198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
73298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
73398b9484cSchristos INSNE(cmpgt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
73498b9484cSchristos       FIX1(FIX(op, 0x46)),
73598b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
73698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
73798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
73898b9484cSchristos INSNE(cmpgt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
73998b9484cSchristos       FIX1(FIX(op, 0x45)),
74098b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREG1),
74198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
74298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
74398b9484cSchristos INSNE(cmpgt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
74498b9484cSchristos       FIX2(FIX(op, 0x44), FIX(x, 0)),
74598b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
74698b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
74798b9484cSchristos 	   ENC(dst, reg, 2)))
74898b9484cSchristos INSNE(cmpgt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
74998b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
75098b9484cSchristos       FIX1(FIX(op, 0x57)),
75198b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
75298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
75398b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
75498b9484cSchristos INSNE(cmpgt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
75598b9484cSchristos       FIX1(FIX(op, 0x56)),
75698b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
75798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
75898b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
75998b9484cSchristos INSNE(cmpgt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
76098b9484cSchristos       FIX1(FIX(op, 0x55)),
76198b9484cSchristos       OP3(ORREGL1, ORXREG1, OWREG1),
76298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
76398b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
76498b9484cSchristos INSNE(cmpgt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
76598b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
76698b9484cSchristos       FIX2(FIX(op, 0x54), FIX(x, 0)),
76798b9484cSchristos       OP3(ORREGL1, OACST, OWREG1),
76898b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
76998b9484cSchristos 	   ENC(dst, reg, 2)))
77098b9484cSchristos 
77103467a24Schristos /* 16 bits insn */
77203467a24Schristos INSN(cmpgt, l, lx1c, 1cycle, C64XP, 0,
77303467a24Schristos      FIX1(FIX(op, 1)),
77403467a24Schristos      OP3(OACST, ORREG1, OWREG1),
77503467a24Schristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
77603467a24Schristos           ENC(dst, reg, 2)))
77703467a24Schristos INSN(cmpgt, l, l2c, 1cycle, C64XP, 0,
77803467a24Schristos       FIX1(FIX(op, 5)),
77903467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
78003467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
78103467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
78203467a24Schristos /**/
78303467a24Schristos 
78498b9484cSchristos INSN(cmpgt2, s, 1_or_2_src, 1cycle, C64X, 0,
78598b9484cSchristos      FIX1(FIX(op, 0x14)),
78698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
78798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
78898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
78998b9484cSchristos 
79098b9484cSchristos INSN(cmpgtdp, s, 1_or_2_src, dpcmp, C67X, 0,
79198b9484cSchristos      FIX1(FIX(op, 0x29)),
79298b9484cSchristos      OP3(ORREGD12, ORXREGD12, OWREG2),
79398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
79498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
79598b9484cSchristos 
79698b9484cSchristos INSN(cmpgtsp, s, 1_or_2_src, 1cycle, C67X, 0,
79798b9484cSchristos      FIX1(FIX(op, 0x39)),
79898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
79998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
80098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
80198b9484cSchristos 
80298b9484cSchristos INSNE(cmpgtu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
80398b9484cSchristos       FIX1(FIX(op, 0x4f)),
80498b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
80598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
80698b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
80798b9484cSchristos INSNE(cmpgtu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
80898b9484cSchristos       FIX2(FIX(op, 0x4e), RAN(src1, 0, 15)),
80998b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
81098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
81198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
81298b9484cSchristos /* Although not mentioned in SPRUFE8, CMPGTU and CMPLTU support a
81398b9484cSchristos    5-bit unsigned constant operand on C64X and above.  */
81498b9484cSchristos INSNE(cmpgtu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
81598b9484cSchristos       FIX2(FIX(op, 0x4e), RAN(src1, 16, 31)),
81698b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
81798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
81898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
81998b9484cSchristos INSNE(cmpgtu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
82098b9484cSchristos       FIX1(FIX(op, 0x4d)),
82198b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREG1),
82298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
82398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
82498b9484cSchristos INSNE(cmpgtu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
82598b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
82698b9484cSchristos       FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 0, 15)),
82798b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
82898b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
82998b9484cSchristos 	   ENC(dst, reg, 2)))
83098b9484cSchristos INSNE(cmpgtu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
83198b9484cSchristos       FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 16, 31)),
83298b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
83398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
83498b9484cSchristos 	   ENC(dst, reg, 2)))
83598b9484cSchristos 
83603467a24Schristos /* 16 bits insn */
83703467a24Schristos INSN(cmpgtu, l, lx1c, 1cycle, C64XP, 0,
83803467a24Schristos      FIX1(FIX(op, 3)),
83903467a24Schristos      OP3(OACST, ORREG1, OWREG1),
84003467a24Schristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
84103467a24Schristos           ENC(dst, reg, 2)))
84203467a24Schristos INSN(cmpgtu, l, l2c, 1cycle, C64XP, 0,
84303467a24Schristos       FIX1(FIX(op, 7)),
84403467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
84503467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
84603467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
84703467a24Schristos /**/
84803467a24Schristos 
84998b9484cSchristos INSN(cmpgtu4, s, 1_or_2_src, 1cycle, C64X, 0,
85098b9484cSchristos      FIX1(FIX(op, 0x15)),
85198b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
85298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
85398b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
85498b9484cSchristos 
85598b9484cSchristos INSNE(cmplt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
85698b9484cSchristos       FIX1(FIX(op, 0x57)),
85798b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
85898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
85998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
86098b9484cSchristos INSNE(cmplt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
86198b9484cSchristos       FIX1(FIX(op, 0x56)),
86298b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
86398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
86498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
86598b9484cSchristos INSNE(cmplt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
86698b9484cSchristos       FIX1(FIX(op, 0x55)),
86798b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREG1),
86898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
86998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
87098b9484cSchristos INSNE(cmplt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
87198b9484cSchristos       FIX2(FIX(op, 0x54), FIX(x, 0)),
87298b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
87398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
87498b9484cSchristos 	   ENC(dst, reg, 2)))
87598b9484cSchristos INSNE(cmplt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
87698b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
87798b9484cSchristos       FIX1(FIX(op, 0x47)),
87898b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
87998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
88098b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
88198b9484cSchristos INSNE(cmplt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
88298b9484cSchristos       FIX1(FIX(op, 0x46)),
88398b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
88498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
88598b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
88698b9484cSchristos INSNE(cmplt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
88798b9484cSchristos       FIX1(FIX(op, 0x45)),
88898b9484cSchristos       OP3(ORREGL1, ORXREG1, OWREG1),
88998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
89098b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
89198b9484cSchristos INSNE(cmplt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
89298b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
89398b9484cSchristos       FIX2(FIX(op, 0x44), FIX(x, 0)),
89498b9484cSchristos       OP3(ORREGL1, OACST, OWREG1),
89598b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
89698b9484cSchristos 	   ENC(dst, reg, 2)))
89798b9484cSchristos 
89803467a24Schristos /* 16 bits insn */
89903467a24Schristos INSN(cmplt, l, lx1c, 1cycle, C64XP, 0,
90003467a24Schristos      FIX1(FIX(op, 0)),
90103467a24Schristos      OP3(OACST, ORREG1, OWREG1),
90203467a24Schristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
90303467a24Schristos           ENC(dst, reg, 2)))
90403467a24Schristos INSN(cmplt, l, l2c, 1cycle, C64XP, 0,
90503467a24Schristos       FIX1(FIX(op, 4)),
90603467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
90703467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
90803467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
90903467a24Schristos /**/
91003467a24Schristos 
91198b9484cSchristos INSN(cmplt2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
91298b9484cSchristos      FIX1(FIX(op, 0x14)),
91398b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
91498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
91598b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
91698b9484cSchristos 
91798b9484cSchristos INSN(cmpltdp, s, 1_or_2_src, dpcmp, C67X, 0,
91898b9484cSchristos      FIX1(FIX(op, 0x2a)),
91998b9484cSchristos      OP3(ORREGD12, ORXREGD12, OWREG2),
92098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
92198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
92298b9484cSchristos 
92398b9484cSchristos INSN(cmpltsp, s, 1_or_2_src, 1cycle, C67X, 0,
92498b9484cSchristos      FIX1(FIX(op, 0x3a)),
92598b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
92698b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
92798b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
92898b9484cSchristos 
92998b9484cSchristos INSNE(cmpltu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
93098b9484cSchristos       FIX1(FIX(op, 0x5f)),
93198b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
93298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
93398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
93498b9484cSchristos INSNE(cmpltu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
93598b9484cSchristos       FIX2(FIX(op, 0x5e), RAN(src1, 0, 15)),
93698b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
93798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
93898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
93998b9484cSchristos INSNE(cmpltu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
94098b9484cSchristos       FIX2(FIX(op, 0x5e), RAN(src1, 16, 31)),
94198b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
94298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
94398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
94498b9484cSchristos INSNE(cmpltu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
94598b9484cSchristos       FIX1(FIX(op, 0x5d)),
94698b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREG1),
94798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
94898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
94998b9484cSchristos INSNE(cmpltu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
95098b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
95198b9484cSchristos       FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 0, 15)),
95298b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
95398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
95498b9484cSchristos 	   ENC(dst, reg, 2)))
95598b9484cSchristos INSNE(cmpltu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
95698b9484cSchristos       FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 16, 31)),
95798b9484cSchristos       OP3(OACST, ORREGL1, OWREG1),
95898b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
95998b9484cSchristos 	   ENC(dst, reg, 2)))
96098b9484cSchristos 
96103467a24Schristos /* 16 bits insn */
96203467a24Schristos INSN(cmpltu, l, lx1c, 1cycle, C64XP, 0,
96303467a24Schristos      FIX1(FIX(op, 2)),
96403467a24Schristos      OP3(OACST, ORREG1, OWREG1),
96503467a24Schristos      ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
96603467a24Schristos           ENC(dst, reg, 2)))
96703467a24Schristos INSN(cmpltu, l, l2c, 1cycle, C64XP, 0,
96803467a24Schristos       FIX1(FIX(op, 6)),
96903467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
97003467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
97103467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
97203467a24Schristos /**/
97303467a24Schristos 
97498b9484cSchristos INSN(cmpltu4, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
97598b9484cSchristos      FIX1(FIX(op, 0x15)),
97698b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
97798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
97898b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
97998b9484cSchristos 
98098b9484cSchristos INSN(cmpy, m, 1_or_2_src, 4cycle, C64XP, 0,
98198b9484cSchristos      FIX1(FIX(op, 0xa)),
98298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
98398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
98498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
98598b9484cSchristos 
98698b9484cSchristos INSN(cmpyr, m, 1_or_2_src, 4cycle, C64XP, 0,
98798b9484cSchristos      FIX1(FIX(op, 0xb)),
98898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
98998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
99098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
99198b9484cSchristos 
99298b9484cSchristos INSN(cmpyr1, m, 1_or_2_src, 4cycle, C64XP, 0,
99398b9484cSchristos      FIX1(FIX(op, 0xc)),
99498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
99598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
99698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
99798b9484cSchristos 
99898b9484cSchristos INSN(cmtl, d, 1_or_2_src, load, C64XP,
99998b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
100098b9484cSchristos      FIX3(FIX(s, 1), FIX(op, 0xe), FIX(src1, 0)),
100198b9484cSchristos      OP2(ORMEMDW, OWDREG5),
100298b9484cSchristos      ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
100398b9484cSchristos 
100498b9484cSchristos INSN(ddotp4, m, 1_or_2_src, 4cycle, C64XP, 0,
100598b9484cSchristos      FIX1(FIX(op, 0x18)),
100698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
100798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
100898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
100998b9484cSchristos 
101098b9484cSchristos INSN(ddotph2, m, 1_or_2_src, 4cycle, C64XP, 0,
101198b9484cSchristos      FIX1(FIX(op, 0x17)),
101298b9484cSchristos      OP3(ORREGD1, ORXREG1, OWREGD4),
101398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
101498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
101598b9484cSchristos 
101698b9484cSchristos INSN(ddotph2r, m, 1_or_2_src, 4cycle, C64XP, 0,
101798b9484cSchristos      FIX1(FIX(op, 0x15)),
101898b9484cSchristos      OP3(ORREGD1, ORXREG1, OWREG4),
101998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
102098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
102198b9484cSchristos 
102298b9484cSchristos INSN(ddotpl2, m, 1_or_2_src, 4cycle, C64XP, 0,
102398b9484cSchristos      FIX1(FIX(op, 0x16)),
102498b9484cSchristos      OP3(ORREGD1, ORXREG1, OWREGD4),
102598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
102698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
102798b9484cSchristos 
102898b9484cSchristos INSN(ddotpl2r, m, 1_or_2_src, 4cycle, C64XP, 0,
102998b9484cSchristos      FIX1(FIX(op, 0x14)),
103098b9484cSchristos      OP3(ORREGD1, ORXREG1, OWREG4),
103198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
103298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
103398b9484cSchristos 
103498b9484cSchristos INSN(deal, m, unary, 1616_m, C64X, 0,
103598b9484cSchristos      FIX1(FIX(op, 0x1d)),
103698b9484cSchristos      OP2(ORXREG1, OWREG2),
103798b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
103898b9484cSchristos 	  ENC(dst, reg, 1)))
103998b9484cSchristos 
104098b9484cSchristos INSN(dint, nfu, dint, 1cycle, C64XP, 0,
104198b9484cSchristos      FIX1(FIX(s, 0)),
104298b9484cSchristos      OP0(),
104398b9484cSchristos      ENC0())
104498b9484cSchristos 
104598b9484cSchristos INSN(dmv, s, ext_1_or_2_src, 1cycle, C64XP, 0,
104698b9484cSchristos      FIX1(FIX(op, 0xb)),
104798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
104898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
104998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
105098b9484cSchristos 
105198b9484cSchristos INSNE(dotp2, m_s2_xs2_si, m, compound, 4cycle, C64X, 0,
105298b9484cSchristos       FIX1(FIX(op, 0xc)),
105398b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG4),
105498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
105598b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
105698b9484cSchristos INSNE(dotp2, m_s2_xs2_sll, m, compound, 4cycle, C64X, 0,
105798b9484cSchristos       FIX1(FIX(op, 0xb)),
105898b9484cSchristos       OP3(ORREG1, ORXREG1, OWREGD4),
105998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
106098b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
106198b9484cSchristos 
106298b9484cSchristos INSN(dotpn2, m, compound, 4cycle, C64X, 0,
106398b9484cSchristos      FIX1(FIX(op, 0x9)),
106498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
106598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
106698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
106798b9484cSchristos 
106898b9484cSchristos INSN(dotpnrsu2, m, compound, 4cycle, C64X, 0,
106998b9484cSchristos      FIX1(FIX(op, 0x7)),
107098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
107198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
107298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
107398b9484cSchristos 
107498b9484cSchristos INSN(dotpnrus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
107598b9484cSchristos      FIX1(FIX(op, 0x7)),
107698b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG4),
107798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
107898b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
107998b9484cSchristos 
108098b9484cSchristos INSN(dotprsu2, m, compound, 4cycle, C64X, 0,
108198b9484cSchristos      FIX1(FIX(op, 0xd)),
108298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
108398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
108498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
108598b9484cSchristos 
108698b9484cSchristos INSN(dotprus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
108798b9484cSchristos      FIX1(FIX(op, 0xd)),
108898b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG4),
108998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
109098b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
109198b9484cSchristos 
109298b9484cSchristos INSN(dotpsu4, m, compound, 4cycle, C64X, 0,
109398b9484cSchristos      FIX1(FIX(op, 0x2)),
109498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
109598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
109698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
109798b9484cSchristos 
109898b9484cSchristos INSN(dotpus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
109998b9484cSchristos      FIX1(FIX(op, 0x2)),
110098b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG4),
110198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
110298b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
110398b9484cSchristos 
110498b9484cSchristos INSN(dotpu4, m, compound, 4cycle, C64X, 0,
110598b9484cSchristos      FIX1(FIX(op, 0x6)),
110698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
110798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
110898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
110998b9484cSchristos 
111098b9484cSchristos INSN(dpack2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
111198b9484cSchristos      FIX1(FIX(op, 0x34)),
111298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
111398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
111498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
111598b9484cSchristos 
111698b9484cSchristos INSN(dpackx2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
111798b9484cSchristos      FIX1(FIX(op, 0x33)),
111898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
111998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
112098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
112198b9484cSchristos 
112298b9484cSchristos INSN(dpint, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
112303467a24Schristos      FIX2(FIX(op, 0x8), FIX(x, 0)),
112498b9484cSchristos      OP2(ORREGD1, OWREG4),
112503467a24Schristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
112603467a24Schristos 	  ENC(dst, reg, 1)))
112798b9484cSchristos 
112898b9484cSchristos INSN(dpsp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
112903467a24Schristos      FIX2(FIX(op, 0x9), FIX(x, 0)),
113098b9484cSchristos      OP2(ORREGD1, OWREG4),
113103467a24Schristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
113203467a24Schristos 	  ENC(dst, reg, 1)))
113398b9484cSchristos 
113498b9484cSchristos INSN(dptrunc, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
113503467a24Schristos      FIX2(FIX(op, 0x1), FIX(x, 0)),
113698b9484cSchristos      OP2(ORREGD1, OWREG4),
113703467a24Schristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
113803467a24Schristos 	  ENC(dst, reg, 1)))
113998b9484cSchristos 
114098b9484cSchristos INSN(ext, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
114198b9484cSchristos      FIX1(FIX(op, 0x1)),
114298b9484cSchristos      OP4(ORREG1, OACST, OACST, OWREG1),
114398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
114498b9484cSchristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
114598b9484cSchristos INSN(ext, s, 1_or_2_src, 1cycle, C62X, 0,
114698b9484cSchristos      FIX1(FIX(op, 0x2f)),
114798b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
114898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
114998b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
115098b9484cSchristos 
115103467a24Schristos /* 16 bits insn */
115203467a24Schristos INSNE(ext, hwcst16, s, s2ext, 1cycle, C64XP, 0,
115303467a24Schristos      FIX1(FIX(op, 0x0)),
115403467a24Schristos      OP4(ORREG1, OHWCST16, OHWCST16, OWREG1),
115503467a24Schristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
115603467a24Schristos INSNE(ext, hwcst24, s, s2ext, 1cycle, C64XP, 0,
115703467a24Schristos      FIX1(FIX(op, 0x1)),
115803467a24Schristos      OP4(ORREG1, OHWCST24, OHWCST24, OWREG1),
115903467a24Schristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
116003467a24Schristos /**/
116103467a24Schristos 
116298b9484cSchristos INSN(extu, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
116398b9484cSchristos      FIX1(FIX(op, 0x0)),
116498b9484cSchristos      OP4(ORREG1, OACST, OACST, OWREG1),
116598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
116698b9484cSchristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
116798b9484cSchristos INSN(extu, s, 1_or_2_src, 1cycle, C62X, 0,
116898b9484cSchristos      FIX1(FIX(op, 0x2b)),
116998b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
117098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
117198b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
117298b9484cSchristos 
117303467a24Schristos /* 16 bits insn */
117403467a24Schristos INSNE(extu, hwcst16, s, s2ext, 1cycle, C64XP, 0,
117503467a24Schristos      FIX1(FIX(op, 0x2)),
117603467a24Schristos      OP4(ORREG1, OHWCST16, OHWCST16, OWREG1),
117703467a24Schristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
117803467a24Schristos INSNE(extu, hwcst24, s, s2ext, 1cycle, C64XP, 0,
117903467a24Schristos      FIX1(FIX(op, 0x3)),
118003467a24Schristos      OP4(ORREG1, OHWCST24, OHWCST24, OWREG1),
118103467a24Schristos      ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
118203467a24Schristos INSN(extu, s, sc5, 1cycle, C64XP, 0,
118303467a24Schristos      FIX1(FIX(op, 0)),
118403467a24Schristos      OP4(ORREG1, OACST, OHWCST31, OWREG1Z),
118503467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1)))
118603467a24Schristos /**/
118703467a24Schristos 
118898b9484cSchristos INSN(gmpy, m, 1_or_2_src, 4cycle, C64XP, TIC6X_FLAG_NO_CROSS,
118998b9484cSchristos      FIX2(FIX(op, 0x1f), FIX(x, 0)),
119098b9484cSchristos      OP3(ORREG1, ORREG1, OWREG4),
119198b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(src1, reg, 0), ENC(src2, reg, 1),
119298b9484cSchristos 	  ENC(dst, reg, 2)))
119398b9484cSchristos 
119498b9484cSchristos /* This instruction can be predicated as usual; SPRUFE8 is incorrect
119598b9484cSchristos    where it shows the "z" field as fixed to 1.  */
119698b9484cSchristos INSN(gmpy4, m, compound, 4cycle, C64X, 0,
119798b9484cSchristos      FIX1(FIX(op, 0x11)),
119898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
119998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
120098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
120198b9484cSchristos 
120298b9484cSchristos INSN(idle, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MCNOP,
120398b9484cSchristos      FIX2(FIX(s, 0), FIX(op, 0xf)),
120498b9484cSchristos      OP0(),
120598b9484cSchristos      ENC0())
120698b9484cSchristos 
120798b9484cSchristos INSN(intdp, l, 1_or_2_src, intdp, C67X, 0,
120898b9484cSchristos      FIX2(FIX(op, 0x39), FIX(src1, 0)),
120998b9484cSchristos      OP2(ORXREG1, OWREGD45),
121098b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
121198b9484cSchristos 	  ENC(dst, reg, 1)))
121298b9484cSchristos 
121398b9484cSchristos INSN(intdpu, l, 1_or_2_src, intdp, C67X, 0,
121498b9484cSchristos      FIX2(FIX(op, 0x3b), FIX(src1, 0)),
121598b9484cSchristos      OP2(ORXREG1, OWREGD45),
121698b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
121798b9484cSchristos 	  ENC(dst, reg, 1)))
121898b9484cSchristos 
121998b9484cSchristos INSN(intsp, l, 1_or_2_src, 4cycle, C67X, 0,
122098b9484cSchristos      FIX2(FIX(op, 0x4a), FIX(src1, 0)),
122198b9484cSchristos      OP2(ORXREG1, OWREG4),
122298b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
122398b9484cSchristos 	  ENC(dst, reg, 1)))
122498b9484cSchristos 
122598b9484cSchristos INSN(intspu, l, 1_or_2_src, 4cycle, C67X, 0,
122698b9484cSchristos      FIX2(FIX(op, 0x49), FIX(src1, 0)),
122798b9484cSchristos      OP2(ORXREG1, OWREG4),
122898b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
122998b9484cSchristos 	  ENC(dst, reg, 1)))
123098b9484cSchristos 
123198b9484cSchristos INSN(ldb, d, load_store, load, C62X,
123298b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
123398b9484cSchristos      FIX2(FIX(op, 2), FIX(r, 0)),
123498b9484cSchristos      OP2(ORMEMSB, OWDREG5),
123598b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
123698b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
123798b9484cSchristos 	  ENC(srcdst, reg, 1)))
123898b9484cSchristos INSN(ldb, d, load_store_long, load, C62X,
123998b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
124098b9484cSchristos      FIX1(FIX(op, 2)),
124198b9484cSchristos      OP2(ORMEMLB, OWDREG5),
124298b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
124398b9484cSchristos 	  ENC(dst, reg, 1)))
124498b9484cSchristos 
124503467a24Schristos /* 16 bits insn */
124603467a24Schristos INSN(ldb, d, doff4_dsz_x01, load, C64XP,
124703467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
124803467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
124903467a24Schristos      OP2(ORMEMSB, OWTREG5),
125003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
125103467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
125203467a24Schristos INSN(ldb, d, dind_dsz_x01, load, C64XP,
125303467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
125403467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
125503467a24Schristos      OP2(ORMEMSB, OWTREG5),
125603467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
125703467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
125803467a24Schristos INSN(ldb, d, dinc_dsz_x01, load, C64XP,
125903467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
126003467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
126103467a24Schristos      OP2(ORMEMSB, OWTREG5),
126203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
126303467a24Schristos           ENC(ptr, reg_ptr, 0),  ENC(cst, mem_offset_minus_one, 0)))
126403467a24Schristos INSN(ldb, d, ddec_dsz_x01, load, C64XP,
126503467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
126603467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
126703467a24Schristos      OP2(ORMEMSB, OWTREG5),
126803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
126903467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
127003467a24Schristos /**/
127103467a24Schristos 
127298b9484cSchristos INSN(ldbu, d, load_store, load, C62X,
127398b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
127498b9484cSchristos      FIX2(FIX(op, 1), FIX(r, 0)),
127598b9484cSchristos      OP2(ORMEMSB, OWDREG5),
127698b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
127798b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
127898b9484cSchristos 	  ENC(srcdst, reg, 1)))
127998b9484cSchristos INSN(ldbu, d, load_store_long, load, C62X,
128098b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
128198b9484cSchristos      FIX1(FIX(op, 1)),
128298b9484cSchristos      OP2(ORMEMLB, OWDREG5),
128398b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
128498b9484cSchristos 	  ENC(dst, reg, 1)))
128598b9484cSchristos 
128603467a24Schristos /* 16 bits insn */
128703467a24Schristos INSN(ldbu, d, dinc_dsz_000, load, C64XP,
128803467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
128903467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
129003467a24Schristos      OP2(ORMEMSB, OWTREG5),
129103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_minus_one, 0),
129203467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
129303467a24Schristos INSN(ldbu, d, dind_dsz_000, load, C64XP,
129403467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
129503467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
129603467a24Schristos      OP2(ORMEMSB, OWTREG5),
129703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 0),
129803467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
129903467a24Schristos INSN(ldbu, d, doff4_dsz_000, load, C64XP,
130003467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
130103467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
130203467a24Schristos      OP2(ORMEMSB, OWTREG5),
130303467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
130403467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
130503467a24Schristos INSN(ldbu, d, ddec_dsz_000, load, C64XP,
130603467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
130703467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
130803467a24Schristos      OP2(ORMEMSB, OWTREG5),
130903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_minus_one, 0),
131003467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
131103467a24Schristos /**/
131203467a24Schristos 
131398b9484cSchristos INSN(lddw, d, load_store, load, C64X_AND_C67X,
131498b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS,
131598b9484cSchristos      FIX2(FIX(op, 6), FIX(r, 1)),
131698b9484cSchristos      OP2(ORMEMSD, OWDREGD5),
131798b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
131898b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
131998b9484cSchristos 	  ENC(srcdst, reg, 1)))
132098b9484cSchristos 
132103467a24Schristos /* 16 bits insn */
132203467a24Schristos INSN(lddw, d, dpp, load, C64XP,
132303467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREINCR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
132403467a24Schristos      FIX2(FIX(op, 1), FIX(dw, 1)),
132503467a24Schristos      OP2(ORMEMSD, OWDREGD5),
132603467a24Schristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
132703467a24Schristos 	  ENC(cst, mem_offset_minus_one, 0)))
132803467a24Schristos INSN(lddw, d, ddecdw, load, C64XP,
132903467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
133003467a24Schristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
133103467a24Schristos      OP2(ORMEMSD, OWTREGD5),
133203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
133303467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
133403467a24Schristos INSN(lddw, d, dincdw, load, C64XP,
133503467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
133603467a24Schristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
133703467a24Schristos      OP2(ORMEMSD, OWTREGD5),
133803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
133903467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
134003467a24Schristos INSN(lddw, d, dinddw, load, C64XP,
134103467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
134203467a24Schristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
134303467a24Schristos      OP2(ORMEMSD, OWTREGD5),
134403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 0),
134503467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
134603467a24Schristos INSN(lddw, d, doff4dw, load, C64XP,
134703467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
134803467a24Schristos      FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
134903467a24Schristos      OP2(ORMEMSD, OWTREGD5),
135003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
135103467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
135203467a24Schristos /**/
135303467a24Schristos 
135498b9484cSchristos INSN(ldh, d, load_store, load, C62X,
135598b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
135698b9484cSchristos      FIX2(FIX(op, 4), FIX(r, 0)),
135798b9484cSchristos      OP2(ORMEMSH, OWDREG5),
135898b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
135998b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
136098b9484cSchristos 	  ENC(srcdst, reg, 1)))
136198b9484cSchristos INSN(ldh, d, load_store_long, load, C62X,
136298b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
136398b9484cSchristos      FIX1(FIX(op, 4)),
136498b9484cSchristos      OP2(ORMEMLH, OWDREG5),
136598b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
136698b9484cSchristos 	  ENC(dst, reg, 1)))
136798b9484cSchristos 
136803467a24Schristos /* 16 bits insn */
136903467a24Schristos INSN(ldh, d, doff4_dsz_x11, load, C64XP,
137003467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
137103467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
137203467a24Schristos      OP2(ORMEMSH, OWTREG5),
137303467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
137403467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
137503467a24Schristos INSN(ldh, d, dind_dsz_x11, load, C64XP,
137603467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
137703467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
137803467a24Schristos      OP2(ORMEMSH, OWTREG5),
137903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
138003467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
138103467a24Schristos INSN(ldh, d, dinc_dsz_x11, load, C64XP,
138203467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
138303467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
138403467a24Schristos      OP2(ORMEMSH, OWTREG5),
138503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
138603467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
138703467a24Schristos INSN(ldh, d, ddec_dsz_x11, load, C64XP,
138803467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
138903467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
139003467a24Schristos      OP2(ORMEMSH, OWTREG5),
139103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
139203467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
139303467a24Schristos /**/
139403467a24Schristos 
139598b9484cSchristos INSN(ldhu, d, load_store, load, C62X,
139698b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
139798b9484cSchristos      FIX2(FIX(op, 0), FIX(r, 0)),
139898b9484cSchristos      OP2(ORMEMSH, OWDREG5),
139998b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
140098b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
140198b9484cSchristos 	  ENC(srcdst, reg, 1)))
140298b9484cSchristos INSN(ldhu, d, load_store_long, load, C62X,
140398b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
140498b9484cSchristos      FIX1(FIX(op, 0)),
140598b9484cSchristos      OP2(ORMEMLH, OWDREG5),
140698b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
140798b9484cSchristos 	  ENC(dst, reg, 1)))
140898b9484cSchristos 
140903467a24Schristos /* 16 bits insn */
141003467a24Schristos INSN(ldhu, d, doff4_dsz_010, load, C64XP,
141103467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
141203467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
141303467a24Schristos      OP2(ORMEMSH, OWTREG5),
141403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
141503467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
141603467a24Schristos INSN(ldhu, d, dind_dsz_010, load, C64XP,
141703467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
141803467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
141903467a24Schristos      OP2(ORMEMSH, OWTREG5),
142003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
142103467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
142203467a24Schristos INSN(ldhu, d, dinc_dsz_010, load, C64XP,
142303467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
142403467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
142503467a24Schristos      OP2(ORMEMSH, OWTREG5),
142603467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
142703467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
142803467a24Schristos INSN(ldhu, d, ddec_dsz_010, load, C64XP,
142903467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
143003467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
143103467a24Schristos      OP2(ORMEMSH, OWTREG5),
143203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
143303467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
143403467a24Schristos /**/
143503467a24Schristos 
143698b9484cSchristos INSN(ldndw, d, load_nonaligned, load, C64X,
143798b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
143898b9484cSchristos      FIX0(),
143998b9484cSchristos      OP2(ORMEMND, OWDREGD5),
144098b9484cSchristos      ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
144198b9484cSchristos 	  ENC(offsetR, mem_offset_noscale, 0), ENC(baseR, reg, 0),
144298b9484cSchristos 	  ENC(sc, scaled, 0), ENC(dst, reg_shift, 1)))
144398b9484cSchristos 
144403467a24Schristos /* 16 bits insn */
144503467a24Schristos INSN(ldndw, d, ddecdw, load, C64XP,
144603467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
144703467a24Schristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
144803467a24Schristos      OP2(ORMEMND, OWTREGD5),
144903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
145003467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one_noscale, 0)))
145103467a24Schristos INSN(ldndw, d, dincdw, load, C64XP,
145203467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
145303467a24Schristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
145403467a24Schristos      OP2(ORMEMND, OWTREGD5),
145503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
145603467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one_noscale, 0)))
145703467a24Schristos INSN(ldndw, d, dinddw, load, C64XP,
145803467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
145903467a24Schristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
146003467a24Schristos      OP2(ORMEMND, OWTREGD5),
146103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset_noscale, 0),
146203467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
146303467a24Schristos INSN(ldndw, d, doff4dw, load, C64XP,
146403467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
146503467a24Schristos      FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
146603467a24Schristos      OP2(ORMEMND, OWTREGD5),
146703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_noscale, 0),
146803467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
146903467a24Schristos /**/
147003467a24Schristos 
147198b9484cSchristos INSN(ldnw, d, load_store, load, C64X,
147298b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
147398b9484cSchristos      FIX2(FIX(op, 3), FIX(r, 1)),
147498b9484cSchristos      OP2(ORMEMSW, OWDREG5),
147598b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
147698b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
147798b9484cSchristos 	  ENC(srcdst, reg, 1)))
147898b9484cSchristos 
147903467a24Schristos /* 16 bits insn */
148003467a24Schristos INSN(ldnw, d, doff4_dsz_110, load, C64XP,
148103467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
148203467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
148303467a24Schristos      OP2(ORMEMSW, OWTREG5),
148403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
148503467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
148603467a24Schristos INSN(ldnw, d, dind_dsz_110, load, C64XP,
148703467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
148803467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
148903467a24Schristos      OP2(ORMEMSW, OWTREG5),
149003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
149103467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
149203467a24Schristos INSN(ldnw, d, dinc_dsz_110, load, C64XP,
149303467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
149403467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
149503467a24Schristos      OP2(ORMEMSW, OWTREG5),
149603467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
149703467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
149803467a24Schristos INSN(ldnw, d, ddec_dsz_110, load, C64XP,
149903467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
150003467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
150103467a24Schristos      OP2(ORMEMSW, OWTREG5),
150203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
150303467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
150403467a24Schristos /**/
150503467a24Schristos 
150698b9484cSchristos INSN(ldw, d, load_store, load, C62X,
150798b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
150898b9484cSchristos      FIX2(FIX(op, 6), FIX(r, 0)),
150998b9484cSchristos      OP2(ORMEMSW, OWDREG5),
151098b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
151198b9484cSchristos 	  ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
151298b9484cSchristos 	  ENC(srcdst, reg, 1)))
151398b9484cSchristos INSN(ldw, d, load_store_long, load, C62X,
151498b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
151598b9484cSchristos      FIX1(FIX(op, 6)),
151698b9484cSchristos      OP2(ORMEMLW, OWDREG5),
151798b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 0),
151898b9484cSchristos 	  ENC(dst, reg, 1)))
151998b9484cSchristos 
152003467a24Schristos /* 16 bits insn */
152103467a24Schristos INSN(ldw, d, doff4_dsz_0xx, load, C64XP,
152203467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
152303467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 0)),
152403467a24Schristos      OP2(ORMEMSW, OWTREG5),
152503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
152603467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
152703467a24Schristos INSN(ldw, d, doff4_dsz_100, load, C64XP,
152803467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
152903467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
153003467a24Schristos      OP2(ORMEMSW, OWTREG5),
153103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
153203467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
153303467a24Schristos INSN(ldw, d, dind_dsz_0xx, load, C64XP,
153403467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
153503467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 0)),
153603467a24Schristos      OP2(ORMEMSW, OWTREG5),
153703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
153803467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
153903467a24Schristos INSN(ldw, d, dind_dsz_100, load, C64XP,
154003467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
154103467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
154203467a24Schristos      OP2(ORMEMSW, OWTREG5),
154303467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
154403467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
154503467a24Schristos INSN(ldw, d, dinc_dsz_0xx, load, C64XP,
154603467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
154703467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 0)),
154803467a24Schristos      OP2(ORMEMSW, OWTREG5),
154903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
155003467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
155103467a24Schristos INSN(ldw, d, dinc_dsz_100, load, C64XP,
155203467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
155303467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
155403467a24Schristos      OP2(ORMEMSW, OWTREG5),
155503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
155603467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
155703467a24Schristos INSN(ldw, d, ddec_dsz_0xx, load, C64XP,
155803467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
155903467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 0)),
156003467a24Schristos      OP2(ORMEMSW, OWTREG5),
156103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
156203467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
156303467a24Schristos INSN(ldw, d, ddec_dsz_100, load, C64XP,
156403467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
156503467a24Schristos      FIX2(FIX(op, 1), FIX(sz, 1)),
156603467a24Schristos      OP2(ORMEMSW, OWTREG5),
156703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
156803467a24Schristos           ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
156903467a24Schristos INSN(ldw, d, dpp, load, C64XP,
157003467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREINCR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
157103467a24Schristos      FIX2(FIX(op, 1), FIX(dw, 0)),
157203467a24Schristos      OP2(ORMEMSW, OWTREG5),
157303467a24Schristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0),  ENC(srcdst, reg, 1),
157403467a24Schristos 	  ENC(cst, mem_offset_minus_one, 0)))
157503467a24Schristos INSN(ldw, d, dstk, load, C64XP,
157603467a24Schristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE)|TIC6X_FLAG_INSN16_B15PTR,
157703467a24Schristos      FIX2(FIX(op, 0x1), FIX(s, 1)),
157803467a24Schristos      OP2(ORMEMSW, OWTREG5),
157903467a24Schristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
158003467a24Schristos 	  ENC(cst, mem_offset, 0)))
158103467a24Schristos /**/
158203467a24Schristos 
158398b9484cSchristos INSN(ll, d, 1_or_2_src, load, C64XP,
158498b9484cSchristos      TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
158598b9484cSchristos      FIX3(FIX(s, 1), FIX(op, 0xc), FIX(src1, 0)),
158698b9484cSchristos      OP2(ORMEMDW, OWDREG5),
158798b9484cSchristos      ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
158898b9484cSchristos 
158998b9484cSchristos INSNE(lmbd, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
159098b9484cSchristos       FIX1(FIX(op, 0x6b)),
159198b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
159298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
159398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
159498b9484cSchristos INSNE(lmbd, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
159598b9484cSchristos       FIX1(FIX(op, 0x6a)),
159698b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
159798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
159898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
159998b9484cSchristos 
160098b9484cSchristos INSN(max2, l, 1_or_2_src, 1cycle, C64X, 0,
160198b9484cSchristos      FIX1(FIX(op, 0x42)),
160298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
160398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
160498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
160598b9484cSchristos INSN(max2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
160698b9484cSchristos      FIX1(FIX(op, 0xd)),
160798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
160898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
160998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
161098b9484cSchristos 
161198b9484cSchristos INSN(maxu4, l, 1_or_2_src, 1cycle, C64X, 0,
161298b9484cSchristos      FIX1(FIX(op, 0x43)),
161398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
161498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
161598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
161698b9484cSchristos 
161798b9484cSchristos INSN(min2, l, 1_or_2_src, 1cycle, C64X, 0,
161898b9484cSchristos      FIX1(FIX(op, 0x41)),
161998b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
162098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
162198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
162298b9484cSchristos INSN(min2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
162398b9484cSchristos      FIX1(FIX(op, 0xc)),
162498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
162598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
162698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
162798b9484cSchristos 
162898b9484cSchristos INSN(minu4, l, 1_or_2_src, 1cycle, C64X, 0,
162998b9484cSchristos      FIX1(FIX(op, 0x48)),
163098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
163198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
163298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
163398b9484cSchristos 
163498b9484cSchristos INSNE(mpy, m_sl16_xsl16_si, m, mpy, 1616_m, C62X, 0,
163598b9484cSchristos       FIX1(FIX(op, 0x19)),
163698b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG2),
163798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
163898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
163998b9484cSchristos INSNE(mpy, m_s5_xsl16_si, m, mpy, 1616_m, C62X, 0,
164098b9484cSchristos       FIX1(FIX(op, 0x18)),
164198b9484cSchristos       OP3(OACST, ORXREG1, OWREG2),
164298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
164398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
164498b9484cSchristos 
164503467a24Schristos /* 16-bit insn.  */
164603467a24Schristos INSN(mpy, m, m3_sat_0, 1616_m, C67X, 0,
164703467a24Schristos       FIX1(FIX(op, 0x0)),
164803467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
164903467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
165003467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
165103467a24Schristos 
165203467a24Schristos INSN(mpydp, m, mpy, mpydp, C67X, 0,
165303467a24Schristos      FIX1(FIX(op, 0x0e)),
165403467a24Schristos      OP3(ORREGD1234, ORXREGD1324, OWREGD910),
165503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
165603467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
165798b9484cSchristos 
165898b9484cSchristos INSN(mpyh, m, mpy, 1616_m, C62X, 0,
165998b9484cSchristos      FIX1(FIX(op, 0x01)),
166098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
166198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
166298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
166398b9484cSchristos 
166403467a24Schristos /* 16 bits insn */
166503467a24Schristos INSN(mpyh, m, m3_sat_0, 1616_m, C67X, 0,
166603467a24Schristos       FIX1(FIX(op, 0x1)),
166703467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
166803467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
166903467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
167003467a24Schristos /**/
167103467a24Schristos 
167298b9484cSchristos INSN(mpyhi, m, compound, 4cycle, C64X, 0,
167398b9484cSchristos      FIX1(FIX(op, 0x14)),
167498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
167598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
167698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
167798b9484cSchristos 
167898b9484cSchristos INSN(mpyhir, m, compound, 4cycle, C64X, 0,
167998b9484cSchristos      FIX1(FIX(op, 0x10)),
168098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
168198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
168298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
168398b9484cSchristos 
168498b9484cSchristos INSN(mpyhl, m, mpy, 1616_m, C62X, 0,
168598b9484cSchristos      FIX1(FIX(op, 0x09)),
168698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
168798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
168898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
168998b9484cSchristos 
169003467a24Schristos /* 16 bits insn */
169103467a24Schristos INSN(mpyhl, m, m3_sat_0, 1616_m, C67X, 0,
169203467a24Schristos       FIX1(FIX(op, 0x3)),
169303467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
169403467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
169503467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
169603467a24Schristos /**/
169703467a24Schristos 
169898b9484cSchristos INSN(mpyhlu, m, mpy, 1616_m, C62X, 0,
169998b9484cSchristos      FIX1(FIX(op, 0x0f)),
170098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
170198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
170298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
170398b9484cSchristos 
170498b9484cSchristos INSN(mpyhslu, m, mpy, 1616_m, C62X, 0,
170598b9484cSchristos      FIX1(FIX(op, 0x0b)),
170698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
170798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
170898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
170998b9484cSchristos 
171098b9484cSchristos INSN(mpyhsu, m, mpy, 1616_m, C62X, 0,
171198b9484cSchristos      FIX1(FIX(op, 0x03)),
171298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
171398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
171498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
171598b9484cSchristos 
171698b9484cSchristos INSN(mpyhu, m, mpy, 1616_m, C62X, 0,
171798b9484cSchristos      FIX1(FIX(op, 0x07)),
171898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
171998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
172098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
172198b9484cSchristos 
172298b9484cSchristos INSN(mpyhuls, m, mpy, 1616_m, C62X, 0,
172398b9484cSchristos      FIX1(FIX(op, 0x0d)),
172498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
172598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
172698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
172798b9484cSchristos 
172898b9484cSchristos INSN(mpyhus, m, mpy, 1616_m, C62X, 0,
172998b9484cSchristos      FIX1(FIX(op, 0x05)),
173098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
173198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
173298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
173398b9484cSchristos 
173498b9484cSchristos INSNE(mpyi, m_si_xsi_si, m, mpy, mpyi, C67X, 0,
173598b9484cSchristos       FIX1(FIX(op, 0x04)),
173698b9484cSchristos       OP3(ORREG14, ORXREG14, OWREG9),
173798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
173898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
173998b9484cSchristos INSNE(mpyi, m_s5_xsi_si, m, mpy, mpyi, C67X, 0,
174098b9484cSchristos       FIX1(FIX(op, 0x06)),
174198b9484cSchristos       OP3(OACST, ORXREG14, OWREG9),
174298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
174398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
174498b9484cSchristos 
174598b9484cSchristos INSNE(mpyid, m_si_xsi_sll, m, mpy, mpyid, C67X, 0,
174698b9484cSchristos       FIX1(FIX(op, 0x08)),
174798b9484cSchristos       OP3(ORREG14, ORXREG14, OWREGD910),
174898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
174998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
175098b9484cSchristos INSNE(mpyid, m_s5_xsi_sll, m, mpy, mpyid, C67X, 0,
175198b9484cSchristos       FIX1(FIX(op, 0x0c)),
175298b9484cSchristos       OP3(OACST, ORXREG14, OWREGD910),
175398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
175498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
175598b9484cSchristos 
175698b9484cSchristos INSN(mpyih, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
175798b9484cSchristos      FIX1(FIX(op, 0x14)),
175898b9484cSchristos      OP3(ORXREG1, ORREG1, OWREGD4),
175998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
176098b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
176198b9484cSchristos 
176298b9484cSchristos INSN(mpyihr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
176398b9484cSchristos      FIX1(FIX(op, 0x10)),
176498b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG4),
176598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
176698b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
176798b9484cSchristos 
176898b9484cSchristos INSN(mpyil, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
176998b9484cSchristos      FIX1(FIX(op, 0x15)),
177098b9484cSchristos      OP3(ORXREG1, ORREG1, OWREGD4),
177198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
177298b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
177398b9484cSchristos 
177498b9484cSchristos INSN(mpyilr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
177598b9484cSchristos      FIX1(FIX(op, 0x0e)),
177698b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG4),
177798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
177898b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
177998b9484cSchristos 
178098b9484cSchristos INSN(mpylh, m, mpy, 1616_m, C62X, 0,
178198b9484cSchristos      FIX1(FIX(op, 0x11)),
178298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
178398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
178498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
178598b9484cSchristos 
178603467a24Schristos /* 16 bits insn */
178703467a24Schristos INSN(mpylh, m, m3_sat_0, 1616_m, C67X, 0,
178803467a24Schristos       FIX1(FIX(op, 0x2)),
178903467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
179003467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
179103467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
179203467a24Schristos /**/
179303467a24Schristos 
179498b9484cSchristos INSN(mpylhu, m, mpy, 1616_m, C62X, 0,
179598b9484cSchristos      FIX1(FIX(op, 0x17)),
179698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
179798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
179898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
179998b9484cSchristos 
180098b9484cSchristos INSN(mpyli, m, compound, 4cycle, C64X, 0,
180198b9484cSchristos      FIX1(FIX(op, 0x15)),
180298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
180398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
180498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
180598b9484cSchristos 
180698b9484cSchristos INSN(mpylir, m, compound, 4cycle, C64X, 0,
180798b9484cSchristos      FIX1(FIX(op, 0x0e)),
180898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
180998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
181098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
181198b9484cSchristos 
181298b9484cSchristos INSN(mpylshu, m, mpy, 1616_m, C62X, 0,
181398b9484cSchristos      FIX1(FIX(op, 0x13)),
181498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
181598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
181698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
181798b9484cSchristos 
181898b9484cSchristos INSN(mpyluhs, m, mpy, 1616_m, C62X, 0,
181998b9484cSchristos      FIX1(FIX(op, 0x15)),
182098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
182198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
182298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
182398b9484cSchristos 
182498b9484cSchristos INSN(mpysp, m, mpy, 4cycle, C67X, 0,
182598b9484cSchristos      FIX1(FIX(op, 0x1c)),
182698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
182798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
182898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
182998b9484cSchristos 
183098b9484cSchristos /* Contrary to SPRU733A, MPYSPDP and MPYSP2DP are on both C67X and
183198b9484cSchristos    C67X+.  */
183298b9484cSchristos INSN(mpyspdp, m, compound, mpyspdp, C67X, 0,
183398b9484cSchristos      FIX1(FIX(op, 0x16)),
183498b9484cSchristos      OP3(ORREG12, ORXREGD12, OWREGD67),
183598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
183698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
183798b9484cSchristos 
183898b9484cSchristos INSN(mpysp2dp, m, compound, mpyspdp, C67X, 0,
183998b9484cSchristos      FIX1(FIX(op, 0x17)),
184098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD45),
184198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
184298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
184398b9484cSchristos 
184498b9484cSchristos INSNE(mpysu, m_sl16_xul16_si, m, mpy, 1616_m, C62X, 0,
184598b9484cSchristos       FIX1(FIX(op, 0x1b)),
184698b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG2),
184798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
184898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
184998b9484cSchristos INSNE(mpysu, m_s5_xul16_si, m, mpy, 1616_m, C62X, 0,
185098b9484cSchristos       FIX1(FIX(op, 0x1e)),
185198b9484cSchristos       OP3(OACST, ORXREG1, OWREG2),
185298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
185398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
185498b9484cSchristos 
185598b9484cSchristos INSN(mpysu4, m, compound, 4cycle, C64X, 0,
185698b9484cSchristos      FIX1(FIX(op, 0x05)),
185798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
185898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
185998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
186098b9484cSchristos 
186198b9484cSchristos INSN(mpyu, m, mpy, 1616_m, C62X, 0,
186298b9484cSchristos      FIX1(FIX(op, 0x1f)),
186398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
186498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
186598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
186698b9484cSchristos 
186798b9484cSchristos INSN(mpyu4, m, compound, 4cycle, C64X, 0,
186898b9484cSchristos      FIX1(FIX(op, 0x04)),
186998b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
187098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
187198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
187298b9484cSchristos 
187398b9484cSchristos INSN(mpyus, m, mpy, 1616_m, C62X, 0,
187498b9484cSchristos      FIX1(FIX(op, 0x1d)),
187598b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
187698b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
187798b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
187898b9484cSchristos 
187998b9484cSchristos INSN(mpyus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
188098b9484cSchristos      FIX1(FIX(op, 0x05)),
188198b9484cSchristos      OP3(ORXREG1, ORREG1, OWREGD4),
188298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
188398b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
188498b9484cSchristos 
188598b9484cSchristos INSN(mpy2, m, compound, 4cycle, C64X, 0,
188698b9484cSchristos      FIX1(FIX(op, 0x00)),
188798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
188898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
188998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
189098b9484cSchristos 
189198b9484cSchristos INSN(mpy2ir, m, 1_or_2_src, 4cycle, C64XP, 0,
189298b9484cSchristos      FIX1(FIX(op, 0x0f)),
189398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
189498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
189598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
189698b9484cSchristos 
189798b9484cSchristos INSNE(mpy32, 32_32_32, m, mpy, 4cycle, C64XP, 0,
189898b9484cSchristos       FIX1(FIX(op, 0x10)),
189998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG4),
190098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
190198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
190298b9484cSchristos INSNE(mpy32, 32_32_64, m, mpy, 4cycle, C64XP, 0,
190398b9484cSchristos       FIX1(FIX(op, 0x14)),
190498b9484cSchristos       OP3(ORREG1, ORXREG1, OWREGD4),
190598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
190698b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
190798b9484cSchristos 
190898b9484cSchristos INSN(mpy32su, m, mpy, 4cycle, C64XP, 0,
190998b9484cSchristos      FIX1(FIX(op, 0x16)),
191098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
191198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
191298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
191398b9484cSchristos 
191498b9484cSchristos INSN(mpy32u, m, compound, 4cycle, C64XP, 0,
191598b9484cSchristos      FIX1(FIX(op, 0x18)),
191698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
191798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
191898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
191998b9484cSchristos 
192098b9484cSchristos INSN(mpy32us, m, compound, 4cycle, C64XP, 0,
192198b9484cSchristos      FIX1(FIX(op, 0x19)),
192298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
192398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
192498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
192598b9484cSchristos 
192698b9484cSchristos /* "or" forms of "mv" are preferred over "add" forms when available
192798b9484cSchristos    because "or" uses less power.  However, 40-bit moves are only
192898b9484cSchristos    available through "add", and before C64X D-unit moves are only
192998b9484cSchristos    available through "add" (without cross paths being available).  */
193098b9484cSchristos INSNE(mv, l_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
193198b9484cSchristos       FIX2(FIX(op, 0x7e), FIX(src1, 0)),
193298b9484cSchristos       OP2(ORXREG1, OWREG1),
193398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
193498b9484cSchristos 	   ENC(dst, reg, 1)))
193598b9484cSchristos INSNE(mv, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
193698b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
193798b9484cSchristos       FIX3(FIX(op, 0x20), FIX(x, 0), FIX(src1, 0)),
193898b9484cSchristos       OP2(ORREGL1, OWREGL1),
193998b9484cSchristos       ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
194098b9484cSchristos INSNE(mv, s_xui_ui, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
194198b9484cSchristos       FIX2(FIX(op, 0x1a), FIX(src1, 0)),
194298b9484cSchristos       OP2(ORXREG1, OWREG1),
194398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
194498b9484cSchristos 	   ENC(dst, reg, 1)))
194598b9484cSchristos INSNE(mv, d_si_si, d, 1_or_2_src, 1cycle, C62X,
194698b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(0),
194798b9484cSchristos       FIX2(FIX(op, 0x12), FIX(src1, 0)),
194898b9484cSchristos       OP2(ORREG1, OWREG1),
194998b9484cSchristos       ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
195098b9484cSchristos INSNE(mv, d_xui_ui, d, ext_1_or_2_src, 1cycle, C64X,
195198b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
195298b9484cSchristos       FIX2(FIX(op, 0x3), FIX(src1, 0)),
195398b9484cSchristos       OP2(ORXREG1, OWREG1),
195498b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
195598b9484cSchristos 	   ENC(dst, reg, 1)))
195698b9484cSchristos 
195703467a24Schristos /* 16 bits insn */
195803467a24Schristos INSNU(mv, l, lsdmvto, 1cycle, C64X, 0,
195903467a24Schristos       FIX1(FIX(unit, 0x0)),
196003467a24Schristos       OP2(ORXREG1, OWREG1),
196103467a24Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
196203467a24Schristos 
196303467a24Schristos INSNU(mv, s, lsdmvto, 1cycle, C64X, 0,
196403467a24Schristos       FIX1(FIX(unit, 0x1)),
196503467a24Schristos       OP2(ORXREG1, OWREG1),
196603467a24Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
196703467a24Schristos 
196803467a24Schristos INSNU(mv, d, lsdmvto, 1cycle, C64X, 0,
196903467a24Schristos       FIX1(FIX(unit, 0x2)),
197003467a24Schristos       OP2(ORXREG1, OWREG1),
197103467a24Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
197203467a24Schristos 
197303467a24Schristos INSNU(mv, l, lsdmvfr, 1cycle, C64X, 0,
197403467a24Schristos       FIX1(FIX(unit, 0x0)),
197503467a24Schristos       OP2(ORXREG1, OWREG1),
197603467a24Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
197703467a24Schristos 
197803467a24Schristos INSNU(mv, s, lsdmvfr, 1cycle, C64X, 0,
197903467a24Schristos       FIX1(FIX(unit, 0x1)),
198003467a24Schristos       OP2(ORXREG1, OWREG1),
198103467a24Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
198203467a24Schristos 
198303467a24Schristos INSNU(mv, d, lsdmvfr, 1cycle, C64X, 0,
198403467a24Schristos       FIX1(FIX(unit, 0x2)),
198503467a24Schristos       OP2(ORXREG1, OWREG1),
198603467a24Schristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
198703467a24Schristos /**/
198803467a24Schristos 
198998b9484cSchristos INSNE(mvc, from_cr, s, 1_or_2_src, 1cycle, C62X,
199098b9484cSchristos       TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_NO_CROSS,
199198b9484cSchristos       FIX3(FIX(s, 1), FIX(op, 0x0f), FIX(x, 0)),
199298b9484cSchristos       OP2(ORCREG1, OWREG1),
199398b9484cSchristos       ENC3(ENC(src1, crhi, 0), ENC(src2, crlo, 0), ENC(dst, reg, 1)))
199498b9484cSchristos INSNE(mvc, to_cr, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_SIDE_B_ONLY,
199598b9484cSchristos       FIX2(FIX(s, 1), FIX(op, 0x0e)),
199698b9484cSchristos       OP2(ORXREG1, OWCREG1),
199798b9484cSchristos       ENC4(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, crhi, 1),
199898b9484cSchristos 	   ENC(dst, crlo, 1)))
199998b9484cSchristos 
200003467a24Schristos /* 16 bits insn */
200103467a24Schristos INSN(mvc, s, sx1, 1cycle, C64XP,
200203467a24Schristos       TIC6X_FLAG_NO_CROSS,
200303467a24Schristos       FIX1(FIX(op, 0x6)),
200403467a24Schristos       OP2(ORREG1B, OWILC1),
200503467a24Schristos       ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 0)))
200603467a24Schristos /**/
200703467a24Schristos 
200898b9484cSchristos INSN(mvd, m, unary, 4cycle, C64X, 0,
200998b9484cSchristos      FIX1(FIX(op, 0x1a)),
201098b9484cSchristos      OP2(ORXREG1, OWREG4),
201198b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
201298b9484cSchristos 	  ENC(dst, reg, 1)))
201398b9484cSchristos 
201498b9484cSchristos INSN(mvk, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
201598b9484cSchristos      FIX1(FIX(h, 0)),
201698b9484cSchristos      OP2(OLCST, OWREG1),
201798b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
201898b9484cSchristos INSN(mvk, l, unary, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
201998b9484cSchristos      FIX2(FIX(x, 0), FIX(op, 0x05)),
202098b9484cSchristos      OP2(OACST, OWREG1),
202198b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src2, scst, 0), ENC(dst, reg, 1)))
202298b9484cSchristos INSN(mvk, d, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
202398b9484cSchristos      FIX2(FIX(op, 0x00), FIX(src2, 0)),
202498b9484cSchristos      OP2(OACST, OWREG1),
202598b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(dst, reg, 1)))
202698b9484cSchristos 
202703467a24Schristos /* 16 bits insn */
202803467a24Schristos INSN(mvk, l, lx5, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
202903467a24Schristos      FIX0(),
203003467a24Schristos      OP2(OLCST, OWREG1),
203103467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
203203467a24Schristos INSN(mvk, s, smvk8, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
203303467a24Schristos      FIX0(),
203403467a24Schristos      OP2(OLCST, OWREG1),
203503467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
203603467a24Schristos INSNU(mvk, l, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
203703467a24Schristos      FIX1(FIX(unit, 0x0)),
203803467a24Schristos      OP2(OACST, OWREG1),
203903467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
204003467a24Schristos INSNU(mvk, s, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
204103467a24Schristos      FIX1(FIX(unit, 0x1)),
204203467a24Schristos      OP2(OACST, OWREG1),
204303467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
204403467a24Schristos INSNU(mvk, d, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
204503467a24Schristos      FIX1(FIX(unit, 0x2)),
204603467a24Schristos      OP2(OACST, OWREG1),
204703467a24Schristos      ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
204803467a24Schristos INSNUE(mvk, zero, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
204903467a24Schristos      FIX2(FIX(op, 0), FIX(unit, 0x0)),
205003467a24Schristos      OP2(OHWCST0, OWREG1),
205103467a24Schristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
205203467a24Schristos INSNUE(mvk, zero, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
205303467a24Schristos      FIX2(FIX(op, 0), FIX(unit, 0x1)),
205403467a24Schristos      OP2(OHWCST0, OWREG1),
205503467a24Schristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
205603467a24Schristos INSNUE(mvk, zero, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
205703467a24Schristos      FIX2(FIX(op, 0), FIX(unit, 0x2)),
205803467a24Schristos      OP2(OHWCST0, OWREG1),
205903467a24Schristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
206003467a24Schristos INSNUE(mvk, one, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
206103467a24Schristos      FIX2(FIX(op, 1), FIX(unit, 0x0)),
206203467a24Schristos      OP2(OHWCST1, OWREG1),
206303467a24Schristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
206403467a24Schristos INSNUE(mvk, one, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
206503467a24Schristos      FIX2(FIX(op, 1), FIX(unit, 0x1)),
206603467a24Schristos      OP2(OHWCST1, OWREG1),
206703467a24Schristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
206803467a24Schristos INSNUE(mvk, one, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
206903467a24Schristos      FIX2(FIX(op, 1), FIX(unit, 0x2)),
207003467a24Schristos      OP2(OHWCST1, OWREG1),
207103467a24Schristos      ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
207203467a24Schristos /**/
207303467a24Schristos 
207498b9484cSchristos INSN(mvkh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
207598b9484cSchristos      FIX1(FIX(h, 1)),
207698b9484cSchristos      OP2(OLCST, OWREG1),
207798b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(cst, lcst_high16, 0), ENC(dst, reg, 1)))
207898b9484cSchristos 
207998b9484cSchristos INSN(mvklh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
208098b9484cSchristos      FIX1(FIX(h, 1)),
208198b9484cSchristos      OP2(OLCST, OWREG1),
208298b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
208398b9484cSchristos 
208498b9484cSchristos INSN(mvkl, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
208598b9484cSchristos      FIX1(FIX(h, 0)),
208698b9484cSchristos      OP2(OLCST, OWREG1),
208798b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
208898b9484cSchristos 
208998b9484cSchristos INSNE(neg, s_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
209098b9484cSchristos       FIX2(FIX(op, 0x16), FIX(src1, 0)),
209198b9484cSchristos       OP2(ORXREG1, OWREG1),
209298b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
209398b9484cSchristos 	   ENC(dst, reg, 1)))
209498b9484cSchristos INSNE(neg, l_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
209598b9484cSchristos       FIX2(FIX(op, 0x06), FIX(src1, 0)),
209698b9484cSchristos       OP2(ORXREG1, OWREG1),
209798b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
209898b9484cSchristos 	   ENC(dst, reg, 1)))
209998b9484cSchristos INSNE(neg, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
210098b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
210198b9484cSchristos       FIX2(FIX(op, 0x24), FIX(src1, 0)),
210298b9484cSchristos       OP2(ORREGL1, OWREGL1),
210398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
210498b9484cSchristos 	   ENC(dst, reg, 1)))
210598b9484cSchristos 
210698b9484cSchristos INSN(nop, nfu, nop_idle, nop, C62X, 0,
210798b9484cSchristos      FIX2(FIX(s, 0), RAN(op, 0, 8)),
210898b9484cSchristos      OP1(OACST),
210998b9484cSchristos      ENC1(ENC(op, ucst_minus_one, 0)))
211098b9484cSchristos INSNE(nop, 1, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MACRO,
211198b9484cSchristos       FIX2(FIX(s, 0), FIX(op, 0)),
211298b9484cSchristos       OP0(),
211398b9484cSchristos       ENC0())
211498b9484cSchristos 
211503467a24Schristos /* 16 bits insn */
211603467a24Schristos /* contrary to sprufe8b.pdf p767, and accordingly to
211703467a24Schristos  * dis6x.exe output, unop3 opcode is decoded as NOP N3 + 1 */
211803467a24Schristos INSN(nop, nfu, unop, nop, C64XP, 0,
211903467a24Schristos      FIX0(),
212003467a24Schristos      OP1(OACST),
212103467a24Schristos      ENC1(ENC(n, ucst_minus_one, 0)))
212203467a24Schristos /**/
212303467a24Schristos 
212498b9484cSchristos INSNE(norm, l_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
212598b9484cSchristos       FIX2(FIX(op, 0x63), FIX(src1, 0)),
212698b9484cSchristos       OP2(ORXREG1, OWREG1),
212798b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
212898b9484cSchristos 	   ENC(dst, reg, 1)))
212998b9484cSchristos INSNE(norm, l_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
213098b9484cSchristos       FIX3(FIX(op, 0x60), FIX(x, 0), FIX(src1, 0)),
213198b9484cSchristos       OP2(ORREGL1, OWREG1),
213298b9484cSchristos       ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
213398b9484cSchristos 
213498b9484cSchristos INSN(not, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
213598b9484cSchristos      FIX2(FIX(op, 0x6e), FIX(src1, 0x1f)),
213698b9484cSchristos      OP2(ORXREG1, OWREG1),
213798b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
213898b9484cSchristos 	  ENC(dst, reg, 1)))
213998b9484cSchristos INSN(not, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
214098b9484cSchristos      FIX2(FIX(op, 0x0a), FIX(src1, 0x1f)),
214198b9484cSchristos      OP2(ORXREG1, OWREG1),
214298b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
214398b9484cSchristos 	  ENC(dst, reg, 1)))
214498b9484cSchristos INSN(not, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
214598b9484cSchristos      FIX2(FIX(op, 0xf), FIX(src1, 0x1f)),
214698b9484cSchristos      OP2(ORXREG1, OWREG1),
214798b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
214898b9484cSchristos 	  ENC(dst, reg, 1)))
214998b9484cSchristos 
215098b9484cSchristos INSNE(or, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
215198b9484cSchristos       FIX1(FIX(op, 0x2)),
215298b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
215398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
215498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
215598b9484cSchristos INSNE(or, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
215698b9484cSchristos       FIX1(FIX(op, 0x3)),
215798b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
215898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
215998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
216098b9484cSchristos INSNE(or, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
216198b9484cSchristos       FIX1(FIX(op, 0x7f)),
216298b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
216398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
216498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
216598b9484cSchristos INSNE(or, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
216698b9484cSchristos       FIX1(FIX(op, 0x7e)),
216798b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
216898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
216998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
217098b9484cSchristos INSNE(or, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
217198b9484cSchristos       FIX1(FIX(op, 0x1b)),
217298b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
217398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
217498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
217598b9484cSchristos INSNE(or, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
217698b9484cSchristos       FIX1(FIX(op, 0x1a)),
217798b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
217898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
217998b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
218098b9484cSchristos 
218103467a24Schristos /* 16 bits insn */
218203467a24Schristos INSN(or, l, l2c, 1cycle, C64XP, 0,
218303467a24Schristos       FIX1(FIX(op, 1)),
218403467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
218503467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
218603467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
218703467a24Schristos /**/
218803467a24Schristos 
218998b9484cSchristos INSN(pack2, l, 1_or_2_src, 1cycle, C64X, 0,
219098b9484cSchristos      FIX1(FIX(op, 0x0)),
219198b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
219298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
219398b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
219498b9484cSchristos INSN(pack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
219598b9484cSchristos      FIX1(FIX(op, 0xf)),
219698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
219798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
219898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
219998b9484cSchristos 
220098b9484cSchristos INSN(packh2, l, 1_or_2_src, 1cycle, C64X, 0,
220198b9484cSchristos      FIX1(FIX(op, 0x1e)),
220298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
220398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
220498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
220598b9484cSchristos INSN(packh2, s, 1_or_2_src, 1cycle, C64X, 0,
220698b9484cSchristos      FIX1(FIX(op, 0x9)),
220798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
220898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
220998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
221098b9484cSchristos 
221198b9484cSchristos INSN(packh4, l, 1_or_2_src, 1cycle, C64X, 0,
221298b9484cSchristos      FIX1(FIX(op, 0x69)),
221398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
221498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
221598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
221698b9484cSchristos 
221798b9484cSchristos INSN(packhl2, l, 1_or_2_src, 1cycle, C64X, 0,
221898b9484cSchristos      FIX1(FIX(op, 0x1c)),
221998b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
222098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
222198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
222298b9484cSchristos INSN(packhl2, s, 1_or_2_src, 1cycle, C64X, 0,
222398b9484cSchristos      FIX1(FIX(op, 0x8)),
222498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
222598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
222698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
222798b9484cSchristos 
222898b9484cSchristos INSN(packlh2, l, 1_or_2_src, 1cycle, C64X, 0,
222998b9484cSchristos      FIX1(FIX(op, 0x1b)),
223098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
223198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
223298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
223398b9484cSchristos INSN(packlh2, s, 1_or_2_src, 1cycle, C64X, 0,
223498b9484cSchristos      FIX1(FIX(op, 0x10)),
223598b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
223698b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
223798b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
223898b9484cSchristos 
223998b9484cSchristos INSN(packl4, l, 1_or_2_src, 1cycle, C64X, 0,
224098b9484cSchristos      FIX1(FIX(op, 0x68)),
224198b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
224298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
224398b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
224498b9484cSchristos 
224598b9484cSchristos INSN(rcpdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
224603467a24Schristos      FIX2(FIX(op, 0x2d), FIX(x, 0)),
224798b9484cSchristos      OP2(ORREGD1, OWREGD12),
224803467a24Schristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
224903467a24Schristos 	  ENC(dst, reg, 1)))
225098b9484cSchristos 
225198b9484cSchristos INSN(rcpsp, s, 1_or_2_src, 1cycle, C67X, 0,
225298b9484cSchristos      FIX2(FIX(op, 0x3d), FIX(src1, 0)),
225398b9484cSchristos      OP2(ORXREG1, OWREG1),
225498b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
225598b9484cSchristos 	  ENC(dst, reg, 1)))
225698b9484cSchristos 
225798b9484cSchristos INSN(ret, s, ext_branch_cond_imm, branch, C62X,
225898b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
225998b9484cSchristos      FIX0(),
226098b9484cSchristos      OP1(OLCST),
226198b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
226298b9484cSchristos INSN(ret, s, branch, branch, C62X,
226398b9484cSchristos      TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
226498b9484cSchristos      FIX1(FIX(s, 1)),
226598b9484cSchristos      OP1(ORXREG1),
226698b9484cSchristos      ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
226798b9484cSchristos INSN(ret, s, b_irp, branch, C62X,
226898b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
226998b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
227098b9484cSchristos      OP1(ORIRP1),
227198b9484cSchristos      ENC0())
227298b9484cSchristos INSN(ret, s, b_nrp, branch, C62X,
227398b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
227498b9484cSchristos      FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
227598b9484cSchristos      OP1(ORNRP1),
227698b9484cSchristos      ENC0())
227798b9484cSchristos 
227898b9484cSchristos INSN(retp, s, call_imm_nop, branch, C64XP,
227998b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
228098b9484cSchristos      FIX1(FIX(z, 1)),
228198b9484cSchristos      OP2(OLCST, OWRETREG1),
228298b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
228398b9484cSchristos 
228498b9484cSchristos INSN(rint, nfu, rint, 1cycle, C64XP, 0,
228598b9484cSchristos      FIX1(FIX(s, 0)),
228698b9484cSchristos      OP0(),
228798b9484cSchristos      ENC0())
228898b9484cSchristos 
228998b9484cSchristos INSNE(rotl, m_ui_xui_ui, m, compound, 1616_m, C64X, 0,
229098b9484cSchristos       FIX1(FIX(op, 0x1d)),
229198b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG2),
229298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
229398b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
229498b9484cSchristos INSNE(rotl, m_u5_xui_ui, m, compound, 1616_m, C64X, 0,
229598b9484cSchristos       FIX1(FIX(op, 0x1e)),
229698b9484cSchristos       OP3(ORXREG1, OACST, OWREG2),
229798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
229898b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
229998b9484cSchristos 
230098b9484cSchristos INSN(rpack2, s, ext_1_or_2_src_noncond, 1cycle, C64XP, 0,
230198b9484cSchristos      FIX2(FIX(op, 0xb), FIX(z, 1)),
230298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
230398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
230498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
230598b9484cSchristos 
230698b9484cSchristos INSN(rsqrdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
230703467a24Schristos      FIX2(FIX(op, 0x2e), FIX(x, 0)),
230898b9484cSchristos      OP2(ORREGD1, OWREGD12),
230903467a24Schristos      ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
231003467a24Schristos 	  ENC(dst, reg, 1)))
231198b9484cSchristos 
231298b9484cSchristos INSN(rsqrsp, s, 1_or_2_src, 1cycle, C67X, 0,
231398b9484cSchristos      FIX2(FIX(op, 0x3e), FIX(src1, 0)),
231498b9484cSchristos      OP2(ORXREG1, OWREG1),
231598b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
231698b9484cSchristos 	  ENC(dst, reg, 1)))
231798b9484cSchristos 
231898b9484cSchristos INSNE(sadd, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
231998b9484cSchristos       FIX1(FIX(op, 0x13)),
232098b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
232198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
232298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
232398b9484cSchristos INSNE(sadd, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
232498b9484cSchristos       FIX1(FIX(op, 0x31)),
232598b9484cSchristos       OP3(ORXREG1, ORREGL1, OWREGL1),
232698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
232798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
232898b9484cSchristos INSNE(sadd, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
232998b9484cSchristos       FIX1(FIX(op, 0x12)),
233098b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
233198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
233298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
233398b9484cSchristos INSNE(sadd, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
233498b9484cSchristos       FIX1(FIX(op, 0x30)),
233598b9484cSchristos       OP3(OACST, ORREGL1, OWREGL1),
233698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
233798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
233898b9484cSchristos INSNE(sadd, s_si_xsi_si, s, 1_or_2_src, 1cycle, C64X, 0,
233998b9484cSchristos       FIX1(FIX(op, 0x20)),
234098b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
234198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
234298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
234398b9484cSchristos 
234403467a24Schristos /* 16 bits insn */
234503467a24Schristos INSN(sadd, l, l3_sat_1, 1cycle, C64XP, 0,
234603467a24Schristos      FIX1(FIX(op, 0)),
234703467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
234803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
234903467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
235003467a24Schristos 
235103467a24Schristos INSN(sadd, s, s3_sat_1, 1cycle, C64XP,0,
235203467a24Schristos      FIX1(FIX(op, 0x0)),
235303467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
235403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
235503467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
235603467a24Schristos /**/
235703467a24Schristos 
235898b9484cSchristos INSN(sadd2, s, ext_1_or_2_src, 1cycle, C64X, 0,
235998b9484cSchristos      FIX1(FIX(op, 0x0)),
236098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
236198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
236298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
236398b9484cSchristos 
236498b9484cSchristos INSN(saddsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
236598b9484cSchristos      FIX1(FIX(op, 0x0e)),
236698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
236798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
236898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
236998b9484cSchristos 
237098b9484cSchristos INSN(saddsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
237198b9484cSchristos      FIX1(FIX(op, 0x0f)),
237298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
237398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
237498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
237598b9484cSchristos 
237698b9484cSchristos INSN(saddsu2, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
237798b9484cSchristos      FIX1(FIX(op, 0x1)),
237898b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
237998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
238098b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
238198b9484cSchristos 
238298b9484cSchristos INSN(saddus2, s, ext_1_or_2_src, 1cycle, C64X, 0,
238398b9484cSchristos      FIX1(FIX(op, 0x1)),
238498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
238598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
238698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
238798b9484cSchristos 
238898b9484cSchristos INSN(saddu4, s, ext_1_or_2_src, 1cycle, C64X, 0,
238998b9484cSchristos      FIX1(FIX(op, 0x3)),
239098b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
239198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
239298b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
239398b9484cSchristos 
239498b9484cSchristos INSN(sat, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
239598b9484cSchristos      FIX3(FIX(op, 0x40), FIX(x, 0), FIX(src1, 0)),
239698b9484cSchristos      OP2(ORREGL1, OWREG1),
239798b9484cSchristos      ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
239898b9484cSchristos 
239998b9484cSchristos INSN(set, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
240098b9484cSchristos      FIX1(FIX(op, 0x2)),
240198b9484cSchristos      OP4(ORREG1, OACST, OACST, OWREG1),
240298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
240398b9484cSchristos 	  ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
240498b9484cSchristos INSN(set, s, 1_or_2_src, 1cycle, C62X, 0,
240598b9484cSchristos      FIX1(FIX(op, 0x3b)),
240698b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG1),
240798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
240898b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
240998b9484cSchristos 
241003467a24Schristos /* 16 bits insn */
241103467a24Schristos INSN(set, s, sc5, 1cycle, C64XP, 0,
241203467a24Schristos      FIX1(FIX(op, 1)),
241303467a24Schristos      OP4(ORREG1, OACST, OACST, OWREG1),
241403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1),
241503467a24Schristos           ENC(cst, ucst, 2), ENC(srcdst, reg, 3)))
241603467a24Schristos /**/
241703467a24Schristos 
241898b9484cSchristos INSN(shfl, m, unary, 1616_m, C64X, 0,
241998b9484cSchristos      FIX1(FIX(op, 0x1c)),
242098b9484cSchristos      OP2(ORXREG1, OWREG2),
242198b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
242298b9484cSchristos 	  ENC(dst, reg, 1)))
242398b9484cSchristos 
242498b9484cSchristos INSN(shfl3, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
242598b9484cSchristos      FIX1(FIX(op, 0x36)),
242698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD1),
242798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
242898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
242998b9484cSchristos 
243098b9484cSchristos INSNE(shl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
243198b9484cSchristos       FIX1(FIX(op, 0x33)),
243298b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
243398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
243498b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
243598b9484cSchristos INSNE(shl, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
243698b9484cSchristos       FIX2(FIX(op, 0x31), FIX(x, 0)),
243798b9484cSchristos       OP3(ORREGL1, ORREG1, OWREGL1),
243898b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
243998b9484cSchristos 	   ENC(dst, reg, 2)))
244098b9484cSchristos INSNE(shl, s_xui_ui_ul, s, 1_or_2_src, 1cycle, C62X, 0,
244198b9484cSchristos       FIX1(FIX(op, 0x13)),
244298b9484cSchristos       OP3(ORXREG1, ORREG1, OWREGL1),
244398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
244498b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
244598b9484cSchristos INSNE(shl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
244698b9484cSchristos       FIX1(FIX(op, 0x32)),
244798b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
244898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
244998b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
245098b9484cSchristos INSNE(shl, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
245198b9484cSchristos       FIX2(FIX(op, 0x30), FIX(x, 0)),
245298b9484cSchristos       OP3(ORREGL1, OACST, OWREGL1),
245398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
245498b9484cSchristos 	   ENC(dst, reg, 2)))
245598b9484cSchristos INSNE(shl, s_xui_u5_ul, s, 1_or_2_src, 1cycle, C62X, 0,
245698b9484cSchristos       FIX1(FIX(op, 0x12)),
245798b9484cSchristos       OP3(ORXREG1, OACST, OWREGL1),
245898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
245998b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
246098b9484cSchristos 
246103467a24Schristos /* 16bit insn */
246203467a24Schristos INSN(shl, s, s3i, 1cycle, C64XP, 0,
246303467a24Schristos       FIX1(FIX(op, 0x0)),
246403467a24Schristos       OP3(ORXREG1, OACST, OWREG1),
246503467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
246603467a24Schristos            ENC(cst, cst_s3i, 1), ENC(dst, reg, 2)))
246703467a24Schristos INSN(shl, s, ssh5_sat_x, 1cycle, C64XP,
246803467a24Schristos       TIC6X_FLAG_NO_CROSS,
246903467a24Schristos       FIX1(FIX(op, 0x0)),
247003467a24Schristos       OP3(ORREG1, OACST, OWREG1),
247103467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
247203467a24Schristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
247303467a24Schristos INSN(shl, s, s2sh, 1cycle, C64XP, 0,
247403467a24Schristos       FIX1(FIX(op, 0x0)),
247503467a24Schristos       OP3(ORREG1, ORREG1, OWREG1),
247603467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
247703467a24Schristos            ENC(srcdst, reg, 2)))
247803467a24Schristos /**/
247903467a24Schristos 
248098b9484cSchristos INSN(shlmb, l, 1_or_2_src, 1cycle, C64X, 0,
248198b9484cSchristos      FIX1(FIX(op, 0x61)),
248298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
248398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
248498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
248598b9484cSchristos INSN(shlmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
248698b9484cSchristos      FIX1(FIX(op, 0x9)),
248798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
248898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
248998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
249098b9484cSchristos 
249198b9484cSchristos INSNE(shr, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
249298b9484cSchristos       FIX1(FIX(op, 0x37)),
249398b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
249498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
249598b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
249698b9484cSchristos INSNE(shr, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
249798b9484cSchristos       FIX2(FIX(op, 0x35), FIX(x, 0)),
249898b9484cSchristos       OP3(ORREGL1, ORREG1, OWREGL1),
249998b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
250098b9484cSchristos 	   ENC(dst, reg, 2)))
250198b9484cSchristos INSNE(shr, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
250298b9484cSchristos       FIX1(FIX(op, 0x36)),
250398b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
250498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
250598b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
250698b9484cSchristos INSNE(shr, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
250798b9484cSchristos       FIX2(FIX(op, 0x34), FIX(x, 0)),
250898b9484cSchristos       OP3(ORREGL1, OACST, OWREGL1),
250998b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
251098b9484cSchristos 	   ENC(dst, reg, 2)))
251198b9484cSchristos 
251203467a24Schristos /* 16bit insn */
251303467a24Schristos INSN(shr, s, s3i, 1cycle, C64XP, 0,
251403467a24Schristos       FIX1(FIX(op, 0x1)),
251503467a24Schristos       OP3(ORXREG1, OACST, OWREG1),
251603467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
251703467a24Schristos            ENC(cst, cst_s3i, 1), ENC(dst, reg, 2)))
251803467a24Schristos INSN(shr, s, ssh5_sat_x, 1cycle, C64XP,
251903467a24Schristos       TIC6X_FLAG_NO_CROSS,
252003467a24Schristos       FIX1(FIX(op, 0x1)),
252103467a24Schristos       OP3(ORREG1, OACST, OWREG1),
252203467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
252303467a24Schristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
252403467a24Schristos INSN(shr, s, s2sh, 1cycle, C64XP, 0,
252503467a24Schristos       FIX1(FIX(op, 0x1)),
252603467a24Schristos       OP3(ORREG1, ORREG1, OWREG1),
252703467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
252803467a24Schristos            ENC(srcdst, reg, 2)))
252903467a24Schristos /**/
253003467a24Schristos 
253198b9484cSchristos INSNE(shr2, s_xs2_ui_s2, s, ext_1_or_2_src, 1cycle, C64X, 0,
253298b9484cSchristos       FIX1(FIX(op, 0x7)),
253398b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
253498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
253598b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
253698b9484cSchristos INSNE(shr2, s_xs2_u5_s2, s, 1_or_2_src, 1cycle, C64X, 0,
253798b9484cSchristos       FIX1(FIX(op, 0x18)),
253898b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
253998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
254098b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
254198b9484cSchristos 
254298b9484cSchristos INSN(shrmb, l, 1_or_2_src, 1cycle, C64X, 0,
254398b9484cSchristos      FIX1(FIX(op, 0x62)),
254498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
254598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
254698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
254798b9484cSchristos INSN(shrmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
254898b9484cSchristos      FIX1(FIX(op, 0xa)),
254998b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
255098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
255198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
255298b9484cSchristos 
255398b9484cSchristos INSNE(shru, s_xui_ui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
255498b9484cSchristos       FIX1(FIX(op, 0x27)),
255598b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
255698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
255798b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
255898b9484cSchristos INSNE(shru, s_ul_ui_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
255998b9484cSchristos       FIX2(FIX(op, 0x25), FIX(x, 0)),
256098b9484cSchristos       OP3(ORREGL1, ORREG1, OWREGL1),
256198b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
256298b9484cSchristos 	   ENC(dst, reg, 2)))
256398b9484cSchristos INSNE(shru, s_xui_u5_ui, s, 1_or_2_src, 1cycle, C62X, 0,
256498b9484cSchristos       FIX1(FIX(op, 0x26)),
256598b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
256698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
256798b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
256898b9484cSchristos INSNE(shru, s_ul_u5_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
256998b9484cSchristos       FIX2(FIX(op, 0x24), FIX(x, 0)),
257098b9484cSchristos       OP3(ORREGL1, OACST, OWREGL1),
257198b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
257298b9484cSchristos 	   ENC(dst, reg, 2)))
257398b9484cSchristos 
257403467a24Schristos /* 16 bits insn */
257503467a24Schristos INSN(shru, s, ssh5_sat_0, 1cycle, C64XP,
257603467a24Schristos       TIC6X_FLAG_NO_CROSS,
257703467a24Schristos       FIX1(FIX(op, 0x2)),
257803467a24Schristos       OP3(ORREG1, OACST, OWREG1),
257903467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
258003467a24Schristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
258103467a24Schristos INSN(shru, s, s2sh, 1cycle, C64XP, 0,
258203467a24Schristos       FIX1(FIX(op, 0x2)),
258303467a24Schristos       OP3(ORREG1, ORREG1, OWREG1),
258403467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
258503467a24Schristos            ENC(srcdst, reg, 2)))
258603467a24Schristos /**/
258703467a24Schristos 
258898b9484cSchristos INSNE(shru2, s_xu2_ui_u2, s, ext_1_or_2_src, 1cycle, C64X, 0,
258998b9484cSchristos       FIX1(FIX(op, 0x8)),
259098b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
259198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
259298b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
259398b9484cSchristos INSNE(shru2, s_xu2_u5_u2, s, 1_or_2_src, 1cycle, C64X, 0,
259498b9484cSchristos       FIX1(FIX(op, 0x19)),
259598b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
259698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
259798b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
259898b9484cSchristos 
259998b9484cSchristos INSN(sl, d, 1_or_2_src, store, C64XP,
260098b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
260198b9484cSchristos      FIX3(FIX(s, 1), FIX(op, 0xd), FIX(src1, 0)),
260298b9484cSchristos      OP2(ORDREG1, OWMEMDW),
260398b9484cSchristos      ENC2(ENC(dst, reg, 0), ENC(src2, reg, 1)))
260498b9484cSchristos 
260598b9484cSchristos INSN(smpy, m, mpy, 1616_m, C62X, 0,
260698b9484cSchristos      FIX1(FIX(op, 0x1a)),
260798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
260898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
260998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
261098b9484cSchristos 
261103467a24Schristos /* 16 bits insn */
261203467a24Schristos INSN(smpy, m, m3_sat_1, 1616_m, C67X, 0,
261303467a24Schristos       FIX1(FIX(op, 0x0)),
261403467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
261503467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
261603467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
261703467a24Schristos /**/
261803467a24Schristos 
261998b9484cSchristos INSN(smpyh, m, mpy, 1616_m, C62X, 0,
262098b9484cSchristos      FIX1(FIX(op, 0x02)),
262198b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
262298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
262398b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
262498b9484cSchristos 
262503467a24Schristos /* 16 bits insn */
262603467a24Schristos INSN(smpyh, m, m3_sat_1, 1616_m, C67X, 0,
262703467a24Schristos       FIX1(FIX(op, 0x1)),
262803467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
262903467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
263003467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
263103467a24Schristos /**/
263203467a24Schristos 
263398b9484cSchristos INSN(smpyhl, m, mpy, 1616_m, C62X, 0,
263498b9484cSchristos      FIX1(FIX(op, 0x0a)),
263598b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
263698b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
263798b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
263898b9484cSchristos 
263903467a24Schristos /* 16 bits insn */
264003467a24Schristos INSN(smpyhl, m, m3_sat_1, 1616_m, C67X, 0,
264103467a24Schristos       FIX1(FIX(op, 0x3)),
264203467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
264303467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
264403467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
264503467a24Schristos /**/
264603467a24Schristos 
264798b9484cSchristos INSN(smpylh, m, mpy, 1616_m, C62X, 0,
264898b9484cSchristos      FIX1(FIX(op, 0x12)),
264998b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG2),
265098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
265198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
265298b9484cSchristos 
265303467a24Schristos /* 16 bits insn */
265403467a24Schristos INSN(smpylh, m, m3_sat_1, 1616_m, C67X, 0,
265503467a24Schristos       FIX1(FIX(op, 0x2)),
265603467a24Schristos       OP3(ORREG1, ORXREG1, OWREG2),
265703467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
265803467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
265903467a24Schristos /**/
266003467a24Schristos 
266198b9484cSchristos INSN(smpy2, m, compound, 4cycle, C64X, 0,
266298b9484cSchristos      FIX1(FIX(op, 0x01)),
266398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREGD4),
266498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
266598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
266698b9484cSchristos 
266798b9484cSchristos /* Contrary to SPRUFE8, this is the correct operand order for this
266898b9484cSchristos    instruction.  */
266998b9484cSchristos INSN(smpy32, m, 1_or_2_src, 4cycle, C64XP, 0,
267098b9484cSchristos      FIX1(FIX(op, 0x19)),
267198b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
267298b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
267398b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
267498b9484cSchristos 
267598b9484cSchristos INSN(spack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
267698b9484cSchristos      FIX1(FIX(op, 0x2)),
267798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
267898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
267998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
268098b9484cSchristos 
268198b9484cSchristos INSN(spacku4, s, ext_1_or_2_src, 1cycle, C64X, 0,
268298b9484cSchristos      FIX1(FIX(op, 0x4)),
268398b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
268498b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
268598b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
268698b9484cSchristos 
268798b9484cSchristos INSN(spdp, s, 1_or_2_src, 2cycle_dp, C67X, 0,
268898b9484cSchristos      FIX2(FIX(op, 0x02), FIX(src1, 0)),
268998b9484cSchristos      OP2(ORXREG1, OWREGD12),
269098b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
269198b9484cSchristos 	  ENC(dst, reg, 1)))
269298b9484cSchristos 
269398b9484cSchristos INSN(spint, l, 1_or_2_src, 4cycle, C67X, 0,
269498b9484cSchristos      FIX2(FIX(op, 0x0a), FIX(src1, 0)),
269598b9484cSchristos      OP2(ORXREG1, OWREG4),
269698b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
269798b9484cSchristos 	  ENC(dst, reg, 1)))
269898b9484cSchristos 
269998b9484cSchristos INSNE(spkernel, nfu_2, nfu, spkernel, 1cycle, C64XP,
270098b9484cSchristos       TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
270198b9484cSchristos       FIX1(FIX(s, 0)),
270298b9484cSchristos       OP2(OACST, OACST),
270398b9484cSchristos       ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
270498b9484cSchristos INSNE(spkernel, nfu_0, nfu, spkernel, 1cycle, C64XP,
270598b9484cSchristos       TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL|TIC6X_FLAG_MACRO,
270698b9484cSchristos       FIX2(FIX(s, 0), FIX(fstgfcyc, 0)),
270798b9484cSchristos       OP0(),
270898b9484cSchristos       ENC0())
270998b9484cSchristos 
271003467a24Schristos /* 16 bits insn */
271103467a24Schristos INSN(spkernel, nfu, uspk, 1cycle, C64XP,
271203467a24Schristos       TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
271303467a24Schristos       FIX0(),
271403467a24Schristos       OP2(OACST, OACST),
271503467a24Schristos       ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
271603467a24Schristos /**/
271703467a24Schristos 
271898b9484cSchristos INSN(spkernelr, nfu, spkernelr, 1cycle, C64XP,
271998b9484cSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
272098b9484cSchristos      FIX1(FIX(s, 0)),
272198b9484cSchristos      OP0(),
272298b9484cSchristos      ENC0())
272398b9484cSchristos 
272498b9484cSchristos INSN(sploop, nfu, loop_buffer, 1cycle, C64XP,
272598b9484cSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
272698b9484cSchristos      FIX4(FIX(s, 0), FIX(op, 0xc), FIX(csta, 0), RAN(cstb, 0, 13)),
272798b9484cSchristos      OP1(OACST),
272898b9484cSchristos      ENC1(ENC(cstb, ucst_minus_one, 0)))
272998b9484cSchristos 
273098b9484cSchristos INSN(sploopd, nfu, loop_buffer, 1cycle, C64XP,
273198b9484cSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
273298b9484cSchristos      FIX4(FIX(s, 0), FIX(op, 0xd), FIX(csta, 0), RAN(cstb, 0, 13)),
273398b9484cSchristos      OP1(OACST),
273498b9484cSchristos      ENC1(ENC(cstb, ucst_minus_one, 0)))
273598b9484cSchristos 
273698b9484cSchristos INSN(sploopw, nfu, loop_buffer, 1cycle, C64XP,
273798b9484cSchristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
273898b9484cSchristos      FIX4(FIX(s, 0), FIX(op, 0xf), FIX(csta, 0), RAN(cstb, 0, 13)),
273998b9484cSchristos      OP1(OACST),
274098b9484cSchristos      ENC1(ENC(cstb, ucst_minus_one, 0)))
274198b9484cSchristos 
274203467a24Schristos /* 16 bits insn */
274303467a24Schristos INSN(sploop, nfu, uspl, 1cycle, C64XP,
274403467a24Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
274503467a24Schristos      FIX1(FIX(op, 0)),
274603467a24Schristos      OP1(OACST),
274703467a24Schristos      ENC1(ENC(ii, ucst_minus_one, 0)))
274803467a24Schristos 
274903467a24Schristos INSN(sploopd, nfu, uspl, 1cycle, C64XP,
275003467a24Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
275103467a24Schristos      FIX1(FIX(op, 1)),
275203467a24Schristos      OP1(OACST),
275303467a24Schristos      ENC1(ENC(ii, ucst_minus_one, 0)))
275403467a24Schristos 
275503467a24Schristos INSN(sploopd, nfu, uspldr, 1cycle, C64XP,
275603467a24Schristos      TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP|TIC6X_FLAG_INSN16_SPRED,
275703467a24Schristos      FIX0(),
275803467a24Schristos      OP1(OACST),
275903467a24Schristos      ENC1(ENC(ii, ucst_minus_one, 0)))
276003467a24Schristos /**/
276103467a24Schristos 
276203467a24Schristos 
276398b9484cSchristos /* Contrary to SPRUFE8, this is the correct encoding for this
276498b9484cSchristos    instruction.  */
276598b9484cSchristos INSN(spmask, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
276698b9484cSchristos      FIX2(FIX(s, 0), FIX(op, 0x8)),
276798b9484cSchristos      OP1(OFULIST),
276898b9484cSchristos      ENC1(ENC(mask, spmask, 0)))
276998b9484cSchristos 
277003467a24Schristos /* 16 bits insn */
277103467a24Schristos INSN(spmask, nfu, uspma, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
277203467a24Schristos      FIX0(),
277303467a24Schristos      OP1(OFULIST),
277403467a24Schristos      ENC1(ENC(mask, spmask, 0)))
277503467a24Schristos /**/
277603467a24Schristos 
277798b9484cSchristos INSN(spmaskr, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
277898b9484cSchristos      FIX2(FIX(s, 0), FIX(op, 0x9)),
277998b9484cSchristos      OP1(OFULIST),
278098b9484cSchristos      ENC1(ENC(mask, spmask, 0)))
278198b9484cSchristos 
278203467a24Schristos /* 16 bits insn */
278303467a24Schristos INSN(spmaskr, nfu, uspmb, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
278403467a24Schristos      FIX0(),
278503467a24Schristos      OP1(OFULIST),
278603467a24Schristos      ENC1(ENC(mask, spmask, 0)))
278703467a24Schristos /**/
278803467a24Schristos 
278998b9484cSchristos INSN(sptrunc, l, 1_or_2_src, 4cycle, C67X, 0,
279098b9484cSchristos      FIX2(FIX(op, 0x0b), FIX(src1, 0)),
279198b9484cSchristos      OP2(ORXREG1, OWREG4),
279298b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
279398b9484cSchristos 	  ENC(dst, reg, 1)))
279498b9484cSchristos 
279598b9484cSchristos INSNE(sshl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
279698b9484cSchristos       FIX1(FIX(op, 0x23)),
279798b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
279898b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
279998b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
280098b9484cSchristos INSNE(sshl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
280198b9484cSchristos       FIX1(FIX(op, 0x22)),
280298b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
280398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
280498b9484cSchristos 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
280598b9484cSchristos 
280603467a24Schristos /* 16 bits insn */
280703467a24Schristos INSN(sshl, s, ssh5_sat_1, 1cycle, C64XP,
280803467a24Schristos       TIC6X_FLAG_NO_CROSS,
280903467a24Schristos       FIX1(FIX(op, 0x2)),
281003467a24Schristos       OP3(ORREG1, OACST, OWREG1),
281103467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
281203467a24Schristos            ENC(cst, ucst, 1),  ENC(srcdst, reg, 2)))
281303467a24Schristos INSN(sshl, s, s2sh, 1cycle, C64XP, 0,
281403467a24Schristos       FIX1(FIX(op, 0x3)),
281503467a24Schristos       OP3(ORREG1, ORREG1, OWREG1),
281603467a24Schristos       ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
281703467a24Schristos            ENC(srcdst, reg, 2)))
281803467a24Schristos /**/
281903467a24Schristos 
282098b9484cSchristos INSN(sshvl, m, compound, 1616_m, C64X, 0,
282198b9484cSchristos      FIX1(FIX(op, 0x1c)),
282298b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG2),
282398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
282498b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
282598b9484cSchristos 
282698b9484cSchristos /* Contrary to SPRUFE8, this is the correct encoding for this
282798b9484cSchristos    instruction.  */
282898b9484cSchristos INSN(sshvr, m, compound, 1616_m, C64X, 0,
282998b9484cSchristos      FIX1(FIX(op, 0x1a)),
283098b9484cSchristos      OP3(ORXREG1, ORREG1, OWREG2),
283198b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
283298b9484cSchristos 	  ENC(src1, reg, 1), ENC(dst, reg, 2)))
283398b9484cSchristos 
283498b9484cSchristos INSNE(ssub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
283598b9484cSchristos       FIX1(FIX(op, 0x0f)),
283698b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
283798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
283898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
283998b9484cSchristos INSNE(ssub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
284098b9484cSchristos       FIX1(FIX(op, 0x1f)),
284198b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
284298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
284398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
284498b9484cSchristos INSNE(ssub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
284598b9484cSchristos       FIX1(FIX(op, 0x0e)),
284698b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
284798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
284898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
284998b9484cSchristos INSNE(ssub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
285098b9484cSchristos       FIX1(FIX(op, 0x2c)),
285198b9484cSchristos       OP3(OACST, ORREGL1, OWREGL1),
285298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
285398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
285498b9484cSchristos 
285503467a24Schristos /* 16 bits insn */
285603467a24Schristos INSN(ssub, l, l3_sat_1, 1cycle, C64XP, 0,
285703467a24Schristos      FIX1(FIX(op, 1)),
285803467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
285903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
286003467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
286103467a24Schristos /**/
286203467a24Schristos 
286398b9484cSchristos INSN(ssub2, l, 1_or_2_src, 1cycle, C64XP, 0,
286498b9484cSchristos      FIX1(FIX(op, 0x64)),
286598b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
286698b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
286798b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
286898b9484cSchristos 
286998b9484cSchristos INSN(stb, d, load_store, store, C62X,
287098b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
287198b9484cSchristos      FIX2(FIX(op, 3), FIX(r, 0)),
287298b9484cSchristos      OP2(ORDREG1, OWMEMSB),
287398b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
287498b9484cSchristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
287598b9484cSchristos 	  ENC(srcdst, reg, 0)))
287698b9484cSchristos INSN(stb, d, load_store_long, store, C62X,
287798b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
287898b9484cSchristos      FIX1(FIX(op, 3)),
287998b9484cSchristos      OP2(ORDREG1, OWMEMLB),
288098b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_byte, 1),
288198b9484cSchristos 	  ENC(dst, reg, 0)))
288298b9484cSchristos 
288303467a24Schristos /* 16 bits insn */
288403467a24Schristos INSN(stb, d, doff4_dsz_000, store, C64XP,
288503467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
288603467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
288703467a24Schristos      OP2(ORTREG1, OWMEMSB),
288803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
288903467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
289003467a24Schristos INSN(stb, d, doff4_dsz_x01, store, C64XP,
289103467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
289203467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
289303467a24Schristos      OP2(ORTREG1, OWMEMSB),
289403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
289503467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
289603467a24Schristos INSN(stb, d, dind_dsz_000, store, C64XP,
289703467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
289803467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
289903467a24Schristos      OP2(ORTREG1, OWMEMSB),
290003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
290103467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg, 0)))
290203467a24Schristos INSN(stb, d, dind_dsz_x01, store, C64XP,
290303467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
290403467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
290503467a24Schristos      OP2(ORTREG1, OWMEMSB),
290603467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
290703467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg, 0)))
290803467a24Schristos INSN(stb, d, dinc_dsz_000, store, C64XP,
290903467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
291003467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
291103467a24Schristos      OP2(ORTREG1, OWMEMSB),
291203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
291303467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
291403467a24Schristos INSN(stb, d, dinc_dsz_x01, store, C64XP,
291503467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
291603467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
291703467a24Schristos      OP2(ORTREG1, OWMEMSB),
291803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
291903467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
292003467a24Schristos INSN(stb, d, ddec_dsz_000, store, C64XP,
292103467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
292203467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
292303467a24Schristos      OP2(ORTREG1, OWMEMSB),
292403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
292503467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
292603467a24Schristos INSN(stb, d, ddec_dsz_x01, store, C64XP,
292703467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
292803467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
292903467a24Schristos      OP2(ORTREG1, OWMEMSB),
293003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
293103467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
293203467a24Schristos /**/
293303467a24Schristos 
293498b9484cSchristos INSN(stdw, d, load_store, store, C64X, TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS,
293598b9484cSchristos      FIX2(FIX(op, 4), FIX(r, 1)),
293698b9484cSchristos      OP2(ORDREGD1, OWMEMSD),
293798b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
293898b9484cSchristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
293998b9484cSchristos 	  ENC(srcdst, reg, 0)))
294098b9484cSchristos 
294103467a24Schristos /* 16 bits insn */
294203467a24Schristos INSN(stdw, d, dpp, store, C64XP,
294303467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTDECR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
294403467a24Schristos      FIX3(FIX(op, 0), FIX(dw, 1), FIX(s, 1)),
294503467a24Schristos      OP2(ORTREGD1, OWMEMSD),
294603467a24Schristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
294703467a24Schristos 	  ENC(cst, mem_offset_minus_one, 1)))
294803467a24Schristos INSN(stdw, d, ddecdw, store, C64XP,
294903467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
295003467a24Schristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
295103467a24Schristos      OP2(ORTREGD1, OWMEMSD),
295203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
295303467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
295403467a24Schristos INSN(stdw, d, dincdw, store, C64XP,
295503467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
295603467a24Schristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
295703467a24Schristos      OP2(ORTREGD1, OWMEMSD),
295803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
295903467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
296003467a24Schristos INSN(stdw, d, dinddw, store, C64XP,
296103467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
296203467a24Schristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
296303467a24Schristos      OP2(ORTREGD1, OWMEMSD),
296403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
296503467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
296603467a24Schristos INSN(stdw, d, doff4dw, store, C64XP,
296703467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
296803467a24Schristos      FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
296903467a24Schristos      OP2(ORTREGD1, OWMEMSD),
297003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 1),
297103467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
297203467a24Schristos /**/
297303467a24Schristos 
297498b9484cSchristos INSN(sth, d, load_store, store, C62X,
297598b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
297698b9484cSchristos      FIX2(FIX(op, 5), FIX(r, 0)),
297798b9484cSchristos      OP2(ORDREG1, OWMEMSH),
297898b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
297998b9484cSchristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
298098b9484cSchristos 	  ENC(srcdst, reg, 0)))
298198b9484cSchristos INSN(sth, d, load_store_long, store, C62X,
298298b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
298398b9484cSchristos      FIX1(FIX(op, 5)),
298498b9484cSchristos      OP2(ORDREG1, OWMEMLH),
298598b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_half, 1),
298698b9484cSchristos 	  ENC(dst, reg, 0)))
298798b9484cSchristos 
298803467a24Schristos /* 16 bits insn */
298903467a24Schristos INSN(sth, d, doff4_dsz_01x, store, C64XP,
299003467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
299103467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
299203467a24Schristos      OP2(ORTREG1, OWMEMSH),
299303467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
299403467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
299503467a24Schristos INSN(sth, d, doff4_dsz_111, store, C64XP,
299603467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
299703467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
299803467a24Schristos      OP2(ORTREG1, OWMEMSH),
299903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
300003467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
300103467a24Schristos INSN(sth, d, dind_dsz_01x, store, C64XP,
300203467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
300303467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
300403467a24Schristos      OP2(ORTREG1, OWMEMSH),
300503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
300603467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
300703467a24Schristos INSN(sth, d, dind_dsz_111, store, C64XP,
300803467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
300903467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
301003467a24Schristos      OP2(ORTREG1, OWMEMSH),
301103467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
301203467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
301303467a24Schristos INSN(sth, d, dinc_dsz_01x, store, C64XP,
301403467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
301503467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
301603467a24Schristos      OP2(ORTREG1, OWMEMSH),
301703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
301803467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
301903467a24Schristos INSN(sth, d, dinc_dsz_111, store, C64XP,
302003467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
302103467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
302203467a24Schristos      OP2(ORTREG1, OWMEMSH),
302303467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
302403467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
302503467a24Schristos INSN(sth, d, ddec_dsz_01x, store, C64XP,
302603467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
302703467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
302803467a24Schristos      OP2(ORTREG1, OWMEMSH),
302903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
303003467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
303103467a24Schristos INSN(sth, d, ddec_dsz_111, store, C64XP,
303203467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
303303467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
303403467a24Schristos      OP2(ORTREG1, OWMEMSH),
303503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
303603467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
303703467a24Schristos /**/
303803467a24Schristos 
303998b9484cSchristos INSN(stndw, d, store_nonaligned, store, C64X,
304098b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
304198b9484cSchristos      FIX0(),
304298b9484cSchristos      OP2(ORDREGD1, OWMEMND),
304398b9484cSchristos      ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
304498b9484cSchristos 	  ENC(offsetR, mem_offset_noscale, 1), ENC(baseR, reg, 1),
304598b9484cSchristos 	  ENC(sc, scaled, 1), ENC(src, reg_shift, 0)))
304698b9484cSchristos 
304703467a24Schristos /* 16 bits insn */
304803467a24Schristos INSN(stndw, d, ddecdw, store, C64XP,
304903467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
305003467a24Schristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
305103467a24Schristos      OP2(ORTREGD1, OWMEMND),
305203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
305303467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one_noscale, 1)))
305403467a24Schristos INSN(stndw, d, dincdw, store, C64XP,
305503467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
305603467a24Schristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
305703467a24Schristos      OP2(ORTREGD1, OWMEMND),
305803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
305903467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one_noscale, 1)))
306003467a24Schristos INSN(stndw, d, dinddw, store, C64XP,
306103467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
306203467a24Schristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
306303467a24Schristos      OP2(ORTREGD1, OWMEMND),
306403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset_noscale, 1),
306503467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
306603467a24Schristos INSN(stndw, d, doff4dw, store, C64XP,
306703467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
306803467a24Schristos      FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
306903467a24Schristos      OP2(ORTREGD1, OWMEMND),
307003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_noscale, 1),
307103467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
307203467a24Schristos /**/
307303467a24Schristos 
307498b9484cSchristos INSN(stnw, d, load_store, store, C64X,
307598b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
307698b9484cSchristos      FIX2(FIX(op, 5), FIX(r, 1)),
307798b9484cSchristos      OP2(ORDREG1, OWMEMSW),
307898b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
307998b9484cSchristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
308098b9484cSchristos 	  ENC(srcdst, reg, 0)))
308198b9484cSchristos 
308203467a24Schristos /* 16 bits insn */
308303467a24Schristos INSN(stnw, d, doff4_dsz_110, store, C64XP,
308403467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
308503467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
308603467a24Schristos      OP2(ORTREG1, OWMEMSW),
308703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
308803467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
308903467a24Schristos INSN(stnw, d, dind_dsz_110, store, C64XP,
309003467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
309103467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
309203467a24Schristos      OP2(ORTREG1, OWMEMSW),
309303467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
309403467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
309503467a24Schristos INSN(stnw, d, dinc_dsz_110, store, C64XP,
309603467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
309703467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
309803467a24Schristos      OP2(ORTREG1, OWMEMSW),
309903467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
310003467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
310103467a24Schristos INSN(stnw, d, ddec_dsz_110, store, C64XP,
310203467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
310303467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
310403467a24Schristos      OP2(ORTREG1, OWMEMSW),
310503467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
310603467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
310703467a24Schristos /**/
310803467a24Schristos 
310998b9484cSchristos INSN(stw, d, load_store, store, C62X,
311098b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
311198b9484cSchristos      FIX2(FIX(op, 7), FIX(r, 0)),
311298b9484cSchristos      OP2(ORDREG1, OWMEMSW),
311398b9484cSchristos      ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
311498b9484cSchristos 	  ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
311598b9484cSchristos 	  ENC(srcdst, reg, 0)))
311698b9484cSchristos INSN(stw, d, load_store_long, store, C62X,
311798b9484cSchristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
311898b9484cSchristos      FIX1(FIX(op, 7)),
311998b9484cSchristos      OP2(ORDREG1, OWMEMLW),
312098b9484cSchristos      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_word, 1),
312198b9484cSchristos 	  ENC(dst, reg, 0)))
312298b9484cSchristos 
312303467a24Schristos /* 16 bits insn */
312403467a24Schristos INSN(stw, d, doff4_dsz_0xx, store, C64XP,
312503467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
312603467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 0)),
312703467a24Schristos      OP2(ORTREG1, OWMEMSW),
312803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
312903467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
313003467a24Schristos INSN(stw, d, doff4_dsz_100, store, C64XP,
313103467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
313203467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
313303467a24Schristos      OP2(ORTREG1, OWMEMSW),
313403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
313503467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
313603467a24Schristos INSN(stw, d, dind_dsz_0xx, store, C64XP,
313703467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
313803467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 0)),
313903467a24Schristos      OP2(ORTREG1, OWMEMSW),
314003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
314103467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
314203467a24Schristos INSN(stw, d, dind_dsz_100, store, C64XP,
314303467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
314403467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
314503467a24Schristos      OP2(ORTREG1, OWMEMSW),
314603467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
314703467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
314803467a24Schristos INSN(stw, d, dinc_dsz_0xx, store, C64XP,
314903467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
315003467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 0)),
315103467a24Schristos      OP2(ORTREG1, OWMEMSW),
315203467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
315303467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
315403467a24Schristos INSN(stw, d, dinc_dsz_100, store, C64XP,
315503467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
315603467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
315703467a24Schristos      OP2(ORTREG1, OWMEMSW),
315803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
315903467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
316003467a24Schristos INSN(stw, d, ddec_dsz_0xx, store, C64XP,
316103467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
316203467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 0)),
316303467a24Schristos      OP2(ORTREG1, OWMEMSW),
316403467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
316503467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
316603467a24Schristos INSN(stw, d, ddec_dsz_100, store, C64XP,
316703467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
316803467a24Schristos      FIX2(FIX(op, 0), FIX(sz, 1)),
316903467a24Schristos      OP2(ORTREG1, OWMEMSW),
317003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
317103467a24Schristos           ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
317203467a24Schristos INSN(stw, d, dpp, store, C64XP,
317303467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTDECR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
317403467a24Schristos      FIX2(FIX(op, 0), FIX(dw, 0)),
317503467a24Schristos      OP2(ORTREG1, OWMEMSW),
317603467a24Schristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
317703467a24Schristos 	  ENC(cst, mem_offset_minus_one, 1)))
317803467a24Schristos INSN(stw, d, dstk, store, C64XP,
317903467a24Schristos      TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE)|TIC6X_FLAG_INSN16_B15PTR,
318003467a24Schristos      FIX2(FIX(op, 0x0), FIX(s, 1)),
318103467a24Schristos      OP2(ORTREG1, OWMEMSW),
318203467a24Schristos      ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
318303467a24Schristos 	  ENC(cst, mem_offset, 1)))
318403467a24Schristos /**/
318503467a24Schristos 
318698b9484cSchristos INSNE(sub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
318798b9484cSchristos       FIX1(FIX(op, 0x07)),
318898b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
318998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
319098b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
319198b9484cSchristos INSNE(sub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
319298b9484cSchristos       FIX1(FIX(op, 0x17)),
319398b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
319498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
319598b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
319698b9484cSchristos INSNE(sub, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
319798b9484cSchristos       FIX1(FIX(op, 0x27)),
319898b9484cSchristos       OP3(ORREG1, ORXREG1, OWREGL1),
319998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
320098b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
320198b9484cSchristos INSNE(sub, l_xsi_si_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
320298b9484cSchristos       FIX1(FIX(op, 0x37)),
320398b9484cSchristos       OP3(ORXREG1, ORREG1, OWREGL1),
320498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
320598b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
320698b9484cSchristos INSNE(sub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
320798b9484cSchristos       FIX1(FIX(op, 0x06)),
320898b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
320998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
321098b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
321198b9484cSchristos INSNE(sub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
321298b9484cSchristos       FIX1(FIX(op, 0x24)),
321398b9484cSchristos       OP3(OACST, ORREGL1, OWREGL1),
321498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
321598b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
321698b9484cSchristos INSNE(sub, l_xsi_s5_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
321798b9484cSchristos       FIX1(FIX(op, 0x2)),
321898b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
321998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
322098b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
322198b9484cSchristos INSNE(sub, l_sl_s5_sl, l, 1_or_2_src, 1cycle, C62X,
322298b9484cSchristos       TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
322398b9484cSchristos       FIX2(FIX(op, 0x20), FIX(x, 0)),
322498b9484cSchristos       OP3(ORREGL1, OACST, OWREGL1),
322598b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, scst_negate, 1), ENC(src2, reg, 0),
322698b9484cSchristos 	   ENC(dst, reg, 2)))
322798b9484cSchristos INSNE(sub, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
322898b9484cSchristos       FIX1(FIX(op, 0x17)),
322998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
323098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
323198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
323298b9484cSchristos INSNE(sub, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
323398b9484cSchristos       FIX1(FIX(op, 0x16)),
323498b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
323598b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
323698b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
323798b9484cSchristos /* Contrary to SPRUFE8, this is the correct encoding for this
323898b9484cSchristos    instruction; this instruction can be predicated.  */
323998b9484cSchristos INSNE(sub, s_xsi_si_si, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
324098b9484cSchristos       FIX1(FIX(op, 0x5)),
324198b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG1),
324298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
324398b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
324498b9484cSchristos INSNE(sub, s_xsi_s5_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
324598b9484cSchristos       FIX1(FIX(op, 0x6)),
324698b9484cSchristos       OP3(ORXREG1, OACST, OWREG1),
324798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
324898b9484cSchristos 	   ENC(src2, reg, 0), ENC(dst, reg, 2)))
324998b9484cSchristos INSNE(sub, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
325098b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
325198b9484cSchristos       FIX1(FIX(op, 0x11)),
325298b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
325398b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
325498b9484cSchristos 	   ENC(dst, reg, 2)))
325598b9484cSchristos INSNE(sub, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
325698b9484cSchristos       FIX1(FIX(op, 0x13)),
325798b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
325898b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
325998b9484cSchristos 	   ENC(dst, reg, 2)))
326098b9484cSchristos INSNE(sub, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
326198b9484cSchristos       FIX1(FIX(op, 0xc)),
326298b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
326398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
326498b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
326598b9484cSchristos 
326603467a24Schristos /* 16 bits insn */
326703467a24Schristos INSN(sub, l, l3_sat_0, 1cycle, C64XP, 0,
326803467a24Schristos      FIX1(FIX(op, 0x1)),
326903467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
327003467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
327103467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
327203467a24Schristos INSN(sub, l, lx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
327303467a24Schristos      FIX1(FIX(op, 0x2)),
327403467a24Schristos      OP3(OHWCST0, ORREG1, OWREG1),
327503467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
327603467a24Schristos INSN(sub, s, sx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
327703467a24Schristos       FIX1(FIX(op, 0x2)),
327803467a24Schristos       OP3(OHWCST0, ORREG1, OWREG1),
327903467a24Schristos       ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
328003467a24Schristos INSN(sub, s, sx2op, 1cycle, C64XP, 0,
328103467a24Schristos       FIX1(FIX(op, 0x1)),
328203467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1),
328303467a24Schristos       ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2),
328403467a24Schristos            ENC(src2, reg, 1), ENC(x, xpath, 1)))
328503467a24Schristos INSN(sub, s, s3_sat_x, 1cycle, C64XP, 0,
328603467a24Schristos      FIX1(FIX(op, 0x1)),
328703467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
328803467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
328903467a24Schristos           ENC(src2, reg, 1), ENC(dst, reg, 2)))
329003467a24Schristos INSN(sub, d, dx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
329103467a24Schristos      FIX1(FIX(op, 0x3)),
329203467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
329303467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
329403467a24Schristos INSN(sub, d, dx2op, 1cycle, C64XP, 0,
329503467a24Schristos      FIX1(FIX(op, 0x1)),
329603467a24Schristos      OP3(ORREG1, ORXREG1, OWREG1),
329703467a24Schristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(srcdst, reg, 0),
329803467a24Schristos           ENC(src2, reg, 1), ENC(srcdst, reg, 2)))
329903467a24Schristos /**/
330003467a24Schristos 
330198b9484cSchristos INSNE(subab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
330298b9484cSchristos       FIX1(FIX(op, 0x31)),
330398b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
330498b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
330598b9484cSchristos 	   ENC(dst, reg, 2)))
330698b9484cSchristos INSNE(subab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
330798b9484cSchristos       FIX1(FIX(op, 0x33)),
330898b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
330998b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
331098b9484cSchristos 	   ENC(dst, reg, 2)))
331198b9484cSchristos 
331298b9484cSchristos INSN(subabs4, l, 1_or_2_src, 1cycle, C64X, 0,
331398b9484cSchristos      FIX1(FIX(op, 0x5a)),
331498b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
331598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
331698b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
331798b9484cSchristos 
331898b9484cSchristos INSNE(subah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
331998b9484cSchristos       FIX1(FIX(op, 0x35)),
332098b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
332198b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
332298b9484cSchristos 	   ENC(dst, reg, 2)))
332398b9484cSchristos INSNE(subah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
332498b9484cSchristos       FIX1(FIX(op, 0x37)),
332598b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
332698b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
332798b9484cSchristos 	   ENC(dst, reg, 2)))
332898b9484cSchristos 
332998b9484cSchristos INSNE(subaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
333098b9484cSchristos       FIX1(FIX(op, 0x39)),
333198b9484cSchristos       OP3(ORREG1, ORREG1, OWREG1),
333298b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
333398b9484cSchristos 	   ENC(dst, reg, 2)))
333498b9484cSchristos INSNE(subaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
333598b9484cSchristos       FIX1(FIX(op, 0x3b)),
333698b9484cSchristos       OP3(ORREG1, OACST, OWREG1),
333798b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
333898b9484cSchristos 	   ENC(dst, reg, 2)))
333998b9484cSchristos 
334003467a24Schristos /* 16 bits insn */
334103467a24Schristos INSN(subaw, d, dx5p, 1cycle, C64XP, 0,
334203467a24Schristos      FIX1(FIX(op, 1)),
334303467a24Schristos      OP3(ORB15REG1, OACST, OWB15REG1),
334403467a24Schristos      ENC2(ENC(s, fu, 0), ENC(cst, ucst, 1)))
334503467a24Schristos /**/
334603467a24Schristos 
334798b9484cSchristos INSN(subc, l, 1_or_2_src, 1cycle, C62X, 0,
334898b9484cSchristos      FIX1(FIX(op, 0x4b)),
334998b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
335098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
335198b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
335298b9484cSchristos 
335398b9484cSchristos INSNE(subdp, l_dp_xdp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(1),
335498b9484cSchristos       FIX1(FIX(op, 0x19)),
335598b9484cSchristos       OP3(ORREGD12, ORXREGD12, OWREGD67),
335698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
335798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
335898b9484cSchristos INSNE(subdp, l_xdp_dp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(0),
335998b9484cSchristos       FIX1(FIX(op, 0x1d)),
336098b9484cSchristos       OP3(ORXREGD12, ORREGD12, OWREGD67),
336198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
336298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
336398b9484cSchristos INSNE(subdp, s_dp_xdp_dp, s, l_1_or_2_src, addsubdp, C67XP,
336498b9484cSchristos       TIC6X_FLAG_PREFER(1),
336598b9484cSchristos       FIX1(FIX(op, 0x73)),
336698b9484cSchristos       OP3(ORREGD12, ORXREGD12, OWREGD67),
336798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
336898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
336998b9484cSchristos INSNE(subdp, s_xdp_dp_dp, s, l_1_or_2_src, addsubdp, C67XP,
337098b9484cSchristos       TIC6X_FLAG_PREFER(0),
337198b9484cSchristos       FIX1(FIX(op, 0x77)),
337298b9484cSchristos       OP3(ORXREGD12, ORREGD12, OWREGD67),
337398b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
337498b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
337598b9484cSchristos 
337698b9484cSchristos INSNE(subsp, l_sp_xsp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(1),
337798b9484cSchristos       FIX1(FIX(op, 0x11)),
337898b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG4),
337998b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
338098b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
338198b9484cSchristos INSNE(subsp, l_xsp_sp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(0),
338298b9484cSchristos       FIX1(FIX(op, 0x15)),
338398b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG4),
338498b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
338598b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
338698b9484cSchristos INSNE(subsp, s_sp_xsp_sp, s, l_1_or_2_src, 4cycle, C67XP,
338798b9484cSchristos       TIC6X_FLAG_PREFER(1),
338898b9484cSchristos       FIX1(FIX(op, 0x71)),
338998b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG4),
339098b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
339198b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
339298b9484cSchristos INSNE(subsp, s_xsp_sp_sp, s, l_1_or_2_src, 4cycle, C67XP,
339398b9484cSchristos       TIC6X_FLAG_PREFER(0),
339498b9484cSchristos       FIX1(FIX(op, 0x75)),
339598b9484cSchristos       OP3(ORXREG1, ORREG1, OWREG4),
339698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
339798b9484cSchristos 	   ENC(src1, reg, 1), ENC(dst, reg, 2)))
339898b9484cSchristos 
339998b9484cSchristos INSNE(subu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
340098b9484cSchristos       FIX1(FIX(op, 0x2f)),
340198b9484cSchristos       OP3(ORREG1, ORXREG1, OWREGL1),
340298b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
340398b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
340498b9484cSchristos INSNE(subu, l_xui_ui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
340598b9484cSchristos       FIX1(FIX(op, 0x3f)),
340698b9484cSchristos       OP3(ORXREG1, ORREG1, OWREGL1),
340798b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
340898b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
340998b9484cSchristos 
341098b9484cSchristos INSN(sub2, l, 1_or_2_src, 1cycle, C64X, 0,
341198b9484cSchristos      FIX1(FIX(op, 0x04)),
341298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
341398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
341498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
341598b9484cSchristos INSN(sub2, s, 1_or_2_src, 1cycle, C62X, 0,
341698b9484cSchristos      FIX1(FIX(op, 0x11)),
341798b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
341898b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
341998b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
342098b9484cSchristos INSN(sub2, d, ext_1_or_2_src, 1cycle, C64X, 0,
342198b9484cSchristos      FIX1(FIX(op, 0x5)),
342298b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
342398b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
342498b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
342598b9484cSchristos 
342698b9484cSchristos INSN(sub4, l, 1_or_2_src, 1cycle, C64X, 0,
342798b9484cSchristos      FIX1(FIX(op, 0x66)),
342898b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG1),
342998b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
343098b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
343198b9484cSchristos 
343298b9484cSchristos INSN(swap2, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
343398b9484cSchristos      FIX2(FIX(op, 0x1b), FIX(x, 0)),
343498b9484cSchristos      OP2(ORREG1, OWREG1),
343598b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
343698b9484cSchristos 	  ENC(src2, reg, 0), ENC(dst, reg, 1)))
343798b9484cSchristos INSN(swap2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
343898b9484cSchristos      FIX2(FIX(op, 0x10), FIX(x, 0)),
343998b9484cSchristos      OP2(ORREG1, OWREG1),
344098b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
344198b9484cSchristos 	  ENC(src2, reg, 0), ENC(dst, reg, 1)))
344298b9484cSchristos 
344398b9484cSchristos /* Contrary to SPRUFE8, this is the correct encoding for this
344498b9484cSchristos    instruction.  */
344598b9484cSchristos INSN(swap4, l, unary, 1cycle, C64X, 0,
344698b9484cSchristos      FIX1(FIX(op, 0x1)),
344798b9484cSchristos      OP2(ORXREG1, OWREG1),
344898b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
344998b9484cSchristos 	  ENC(dst, reg, 1)))
345098b9484cSchristos 
345198b9484cSchristos INSN(swe, nfu, swe, 1cycle, C64XP, 0,
345298b9484cSchristos      FIX1(FIX(s, 0)),
345398b9484cSchristos      OP0(),
345498b9484cSchristos      ENC0())
345598b9484cSchristos 
345698b9484cSchristos INSN(swenr, nfu, swenr, 1cycle, C64XP, 0,
345798b9484cSchristos      FIX1(FIX(s, 0)),
345898b9484cSchristos      OP0(),
345998b9484cSchristos      ENC0())
346098b9484cSchristos 
346198b9484cSchristos INSN(unpkhu4, l, unary, 1cycle, C64X, 0,
346298b9484cSchristos      FIX1(FIX(op, 0x03)),
346398b9484cSchristos      OP2(ORXREG1, OWREG1),
346498b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
346598b9484cSchristos 	  ENC(dst, reg, 1)))
346698b9484cSchristos INSN(unpkhu4, s, unary, 1cycle, C64X, 0,
346798b9484cSchristos      FIX1(FIX(op, 0x03)),
346898b9484cSchristos      OP2(ORXREG1, OWREG1),
346998b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
347098b9484cSchristos 	  ENC(dst, reg, 1)))
347198b9484cSchristos 
347298b9484cSchristos INSN(unpklu4, l, unary, 1cycle, C64X, 0,
347398b9484cSchristos      FIX1(FIX(op, 0x02)),
347498b9484cSchristos      OP2(ORXREG1, OWREG1),
347598b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
347698b9484cSchristos 	  ENC(dst, reg, 1)))
347798b9484cSchristos INSN(unpklu4, s, unary, 1cycle, C64X, 0,
347898b9484cSchristos      FIX1(FIX(op, 0x02)),
347998b9484cSchristos      OP2(ORXREG1, OWREG1),
348098b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
348198b9484cSchristos 	  ENC(dst, reg, 1)))
348298b9484cSchristos 
348398b9484cSchristos INSNE(xor, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
348498b9484cSchristos       FIX1(FIX(op, 0x6f)),
348598b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
348698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
348798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
348898b9484cSchristos INSNE(xor, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
348998b9484cSchristos       FIX1(FIX(op, 0x6e)),
349098b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
349198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
349298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
349398b9484cSchristos INSNE(xor, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
349498b9484cSchristos       FIX1(FIX(op, 0x0b)),
349598b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
349698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
349798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
349898b9484cSchristos INSNE(xor, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
349998b9484cSchristos       FIX1(FIX(op, 0x0a)),
350098b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
350198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
350298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
350398b9484cSchristos INSNE(xor, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
350498b9484cSchristos       FIX1(FIX(op, 0xe)),
350598b9484cSchristos       OP3(ORREG1, ORXREG1, OWREG1),
350698b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
350798b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
350898b9484cSchristos INSNE(xor, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
350998b9484cSchristos       FIX1(FIX(op, 0xf)),
351098b9484cSchristos       OP3(OACST, ORXREG1, OWREG1),
351198b9484cSchristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
351298b9484cSchristos 	   ENC(src2, reg, 1), ENC(dst, reg, 2)))
351398b9484cSchristos 
351403467a24Schristos /* 16 bits insn */
351503467a24Schristos INSN(xor, l, l2c, 1cycle, C64XP, 0,
351603467a24Schristos       FIX1(FIX(op, 0x2)),
351703467a24Schristos       OP3(ORREG1, ORXREG1, OWREG1NORS),
351803467a24Schristos       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
351903467a24Schristos            ENC(src2, reg, 1), ENC(dst, reg, 2)))
352003467a24Schristos INSNU(xor, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
352103467a24Schristos      FIX2(FIX(op, 0x7), FIX(unit, 0x0)),
352203467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
352303467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
352403467a24Schristos INSNU(xor, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
352503467a24Schristos      FIX2(FIX(op, 0x7), FIX(unit, 0x1)),
352603467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
352703467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
352803467a24Schristos INSNU(xor, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
352903467a24Schristos      FIX2(FIX(op, 0x7), FIX(unit, 0x2)),
353003467a24Schristos      OP3(ORREG1, OHWCST1, OWREG1),
353103467a24Schristos      ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
353203467a24Schristos /**/
353303467a24Schristos 
353498b9484cSchristos INSN(xormpy, m, 1_or_2_src, 4cycle, C64XP, 0,
353598b9484cSchristos      FIX1(FIX(op, 0x1b)),
353698b9484cSchristos      OP3(ORREG1, ORXREG1, OWREG4),
353798b9484cSchristos      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
353898b9484cSchristos 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
353998b9484cSchristos 
354098b9484cSchristos INSN(xpnd2, m, unary, 1616_m, C64X, 0,
354198b9484cSchristos      FIX1(FIX(op, 0x19)),
354298b9484cSchristos      OP2(ORXREG1, OWREG2),
354398b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
354498b9484cSchristos 	  ENC(dst, reg, 1)))
354598b9484cSchristos 
354698b9484cSchristos INSN(xpnd4, m, unary, 1616_m, C64X, 0,
354798b9484cSchristos      FIX1(FIX(op, 0x18)),
354898b9484cSchristos      OP2(ORXREG1, OWREG2),
354998b9484cSchristos      ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
355098b9484cSchristos 	  ENC(dst, reg, 1)))
355198b9484cSchristos 
355298b9484cSchristos INSN(zero, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
355398b9484cSchristos      FIX2(FIX(h, 0), FIX(cst, 0)),
355498b9484cSchristos      OP1(OWREG1),
355598b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
355698b9484cSchristos INSN(zero, l, unary, 1cycle, C64X,
355798b9484cSchristos      TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
355898b9484cSchristos      FIX3(FIX(x, 0), FIX(op, 0x05), FIX(src2, 0)),
355998b9484cSchristos      OP1(OWREG1),
356098b9484cSchristos      ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
356198b9484cSchristos INSNE(zero, l_sub, l, 1_or_2_src, 1cycle, C62X,
356298b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
356398b9484cSchristos       FIX2(FIX(op, 0x07), FIX(x, 0)),
356498b9484cSchristos       OP1(OWREG1),
356598b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
356698b9484cSchristos 	   ENC(dst, reg, 0)))
356798b9484cSchristos INSNE(zero, l_sub_sl, l, 1_or_2_src, 1cycle, C62X,
356898b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
356998b9484cSchristos       FIX2(FIX(op, 0x27), FIX(x, 0)),
357098b9484cSchristos       OP1(OWREGL1),
357198b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
357298b9484cSchristos 	   ENC(dst, reg, 0)))
357398b9484cSchristos INSNE(zero, d_mvk, d, 1_or_2_src, 1cycle, C64X,
357498b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
357598b9484cSchristos       FIX3(FIX(op, 0x00), FIX(src1, 0), FIX(src2, 0)),
357698b9484cSchristos       OP1(OWREG1),
357798b9484cSchristos       ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
357898b9484cSchristos INSNE(zero, d_sub, d, 1_or_2_src, 1cycle, C62X,
357998b9484cSchristos       TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
358098b9484cSchristos       FIX1(FIX(op, 0x11)),
358198b9484cSchristos       OP1(OWREG1),
358298b9484cSchristos       ENC4(ENC(s, fu, 0), ENC(src2, reg_unused, 0), ENC(src1, reg_unused, 0),
358398b9484cSchristos 	   ENC(dst, reg, 0)))
358498b9484cSchristos 
358598b9484cSchristos #undef TIC6X_INSN_C64X_AND_C67X
358698b9484cSchristos #undef tic6x_insn_format_nfu_s_branch_nop_cst
358798b9484cSchristos #undef tic6x_insn_format_s_l_1_or_2_src
358898b9484cSchristos #undef RAN
358998b9484cSchristos #undef FIX
359098b9484cSchristos #undef FIX0
359198b9484cSchristos #undef FIX1
359298b9484cSchristos #undef FIX2
359398b9484cSchristos #undef FIX3
359498b9484cSchristos #undef FIX4
359598b9484cSchristos #undef OP0
359698b9484cSchristos #undef OP1
359798b9484cSchristos #undef OP2
359898b9484cSchristos #undef OP3
359998b9484cSchristos #undef OP4
360098b9484cSchristos #undef OACST
360198b9484cSchristos #undef OLCST
360203467a24Schristos #undef OHWCSTM1
360303467a24Schristos #undef OHWCST0
360403467a24Schristos #undef OHWCST1
360503467a24Schristos #undef OHWCST5
360603467a24Schristos #undef OHWCST16
360703467a24Schristos #undef OHWCST24
360803467a24Schristos #undef OHWCST31
360998b9484cSchristos #undef OFULIST
361098b9484cSchristos #undef ORIRP1
361198b9484cSchristos #undef ORNRP1
361298b9484cSchristos #undef OWREG1
361398b9484cSchristos #undef OWRETREG1
361498b9484cSchristos #undef ORREG1
361598b9484cSchristos #undef ORDREG1
361698b9484cSchristos #undef ORWREG1
361798b9484cSchristos #undef ORAREG1
361898b9484cSchristos #undef ORXREG1
361998b9484cSchristos #undef ORREG12
362098b9484cSchristos #undef ORREG14
362198b9484cSchristos #undef ORXREG14
362298b9484cSchristos #undef OWREG2
362398b9484cSchristos #undef OWREG4
362498b9484cSchristos #undef OWREG9
362598b9484cSchristos #undef OWDREG5
362698b9484cSchristos #undef OWREGL1
362798b9484cSchristos #undef ORREGL1
362898b9484cSchristos #undef OWREGD1
362903467a24Schristos #undef ORTREG1
363003467a24Schristos #undef ORTREGD1
363103467a24Schristos #undef OWTREG5
363203467a24Schristos #undef OWTREGD5
363398b9484cSchristos #undef OWREGD12
363498b9484cSchristos #undef OWREGD4
363598b9484cSchristos #undef ORREGD1
363698b9484cSchristos #undef OWREGD45
363798b9484cSchristos #undef OWREGD67
363898b9484cSchristos #undef ORDREGD1
363998b9484cSchristos #undef OWDREGD5
364098b9484cSchristos #undef ORREGD12
364198b9484cSchristos #undef ORXREGD12
364203467a24Schristos #undef ORXREGD1234
364398b9484cSchristos #undef ORREGD1324
364498b9484cSchristos #undef OWREGD910
364503467a24Schristos #undef OWILC1
364698b9484cSchristos #undef ORCREG1
364798b9484cSchristos #undef OWCREG1
364803467a24Schristos #undef OWREG1Z
364903467a24Schristos #undef ORB15REG1
365003467a24Schristos #undef OWB15REG1
365198b9484cSchristos #undef ORMEMDW
365298b9484cSchristos #undef OWMEMDW
365398b9484cSchristos #undef ORMEMSB
365498b9484cSchristos #undef OWMEMSB
365598b9484cSchristos #undef ORMEMLB
365698b9484cSchristos #undef OWMEMLB
365798b9484cSchristos #undef ORMEMSH
365898b9484cSchristos #undef OWMEMSH
365998b9484cSchristos #undef ORMEMLH
366098b9484cSchristos #undef OWMEMLH
366198b9484cSchristos #undef ORMEMSW
366298b9484cSchristos #undef OWMEMSW
366398b9484cSchristos #undef ORMEMLW
366498b9484cSchristos #undef OWMEMLW
366598b9484cSchristos #undef ORMEMSD
366698b9484cSchristos #undef OWMEMSD
366798b9484cSchristos #undef ORMEMND
366898b9484cSchristos #undef OWMEMND
366998b9484cSchristos #undef ENC
367098b9484cSchristos #undef ENC0
367198b9484cSchristos #undef ENC1
367298b9484cSchristos #undef ENC2
367398b9484cSchristos #undef ENC3
367498b9484cSchristos #undef ENC4
367598b9484cSchristos #undef ENC5
367698b9484cSchristos #undef ENC6
367798b9484cSchristos #undef ENC7
3678