xref: /netbsd-src/external/gpl3/gdb/dist/include/opcode/bfin.h (revision aab831cebf6361fb2b518a47c70732e608d9abd2)
198b9484cSchristos /* bfin.h -- Header file for ADI Blackfin opcode table
2*aab831ceSchristos    Copyright (C) 2005-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This file is part of GDB, GAS, and the GNU binutils.
598b9484cSchristos 
698b9484cSchristos    GDB, GAS, and the GNU binutils are free software; you can redistribute
798b9484cSchristos    them and/or modify them under the terms of the GNU General Public
898b9484cSchristos    License as published by the Free Software Foundation; either version 3,
998b9484cSchristos    or (at your option) any later version.
1098b9484cSchristos 
1198b9484cSchristos    GDB, GAS, and the GNU binutils are distributed in the hope that they
1298b9484cSchristos    will be useful, but WITHOUT ANY WARRANTY; without even the implied
1398b9484cSchristos    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1498b9484cSchristos    the GNU General Public License for more details.
1598b9484cSchristos 
1698b9484cSchristos    You should have received a copy of the GNU General Public License
1798b9484cSchristos    along with this file; see the file COPYING3.  If not, write to the Free
1898b9484cSchristos    Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
1998b9484cSchristos    MA 02110-1301, USA.  */
2098b9484cSchristos 
2198b9484cSchristos #ifndef OPCODE_BFIN_H
2298b9484cSchristos #define OPCODE_BFIN_H
2398b9484cSchristos 
2498b9484cSchristos /* Common to all DSP32 instructions.  */
2598b9484cSchristos #define BIT_MULTI_INS 0x0800
2698b9484cSchristos 
2798b9484cSchristos /* This just sets the multi instruction bit of a DSP32 instruction.  */
2898b9484cSchristos #define SET_MULTI_INSTRUCTION_BIT(x) x->value |=  BIT_MULTI_INS;
2998b9484cSchristos 
3098b9484cSchristos 
3198b9484cSchristos /* DSP instructions (32 bit) */
3298b9484cSchristos 
3398b9484cSchristos /* mmod field.  */
3498b9484cSchristos #define M_S2RND 1
3598b9484cSchristos #define M_T     2
3698b9484cSchristos #define M_W32   3
3798b9484cSchristos #define M_FU    4
3898b9484cSchristos #define M_TFU   6
3998b9484cSchristos #define M_IS    8
4098b9484cSchristos #define M_ISS2  9
4198b9484cSchristos #define M_IH    11
4298b9484cSchristos #define M_IU    12
4398b9484cSchristos 
4498b9484cSchristos static inline int is_macmod_pmove (int x)
4598b9484cSchristos {
4698b9484cSchristos   return (x == 0) || (x == M_IS) || (x == M_FU) || (x == M_S2RND)
4798b9484cSchristos          || (x == M_ISS2) || (x == M_IU);
4898b9484cSchristos }
4998b9484cSchristos 
5098b9484cSchristos static inline int is_macmod_hmove (int x)
5198b9484cSchristos {
5298b9484cSchristos   return (x == 0) || (x == M_IS) || (x == M_FU) || (x == M_IU) || (x == M_T)
5398b9484cSchristos          || (x == M_TFU) || (x == M_S2RND) || (x == M_ISS2) || (x == M_IH);
54a2e2270fSchristos }
55a2e2270fSchristos 
56a2e2270fSchristos static inline int is_macmod_signed (int x)
57a2e2270fSchristos {
58a2e2270fSchristos   return (x == 0) || (x == M_IS) || (x == M_T) || (x == M_S2RND)
59a2e2270fSchristos          || (x == M_ISS2) || (x == M_IH) || (x == M_W32);
6098b9484cSchristos }
6198b9484cSchristos 
6298b9484cSchristos /*   dsp32mac
6398b9484cSchristos +----+----+---+---|---+----+----+---|---+---+---+---|---+---+---+---+
6498b9484cSchristos | 1  | 1  | 0 | 0 |.M.| 0  | 0  |.mmod..........|.MM|.P.|.w1|.op1...|
6598b9484cSchristos |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1......|
6698b9484cSchristos +----+----+---+---|---+----+----+---|---+---+---+---|---+---+---+---+
6798b9484cSchristos */
6898b9484cSchristos 
6998b9484cSchristos typedef struct
7098b9484cSchristos {
7198b9484cSchristos   unsigned long opcode;
7298b9484cSchristos   int bits_src1;
7398b9484cSchristos   int mask_src1;
7498b9484cSchristos   int bits_src0;
7598b9484cSchristos   int mask_src0;
7698b9484cSchristos   int bits_dst;
7798b9484cSchristos   int mask_dst;
7898b9484cSchristos   int bits_h10;
7998b9484cSchristos   int mask_h10;
8098b9484cSchristos   int bits_h00;
8198b9484cSchristos   int mask_h00;
8298b9484cSchristos   int bits_op0;
8398b9484cSchristos   int mask_op0;
8498b9484cSchristos   int bits_w0;
8598b9484cSchristos   int mask_w0;
8698b9484cSchristos   int bits_h11;
8798b9484cSchristos   int mask_h11;
8898b9484cSchristos   int bits_h01;
8998b9484cSchristos   int mask_h01;
9098b9484cSchristos   int bits_op1;
9198b9484cSchristos   int mask_op1;
9298b9484cSchristos   int bits_w1;
9398b9484cSchristos   int mask_w1;
9498b9484cSchristos   int bits_P;
9598b9484cSchristos   int mask_P;
9698b9484cSchristos   int bits_MM;
9798b9484cSchristos   int mask_MM;
9898b9484cSchristos   int bits_mmod;
9998b9484cSchristos   int mask_mmod;
10098b9484cSchristos   int bits_code2;
10198b9484cSchristos   int mask_code2;
10298b9484cSchristos   int bits_M;
10398b9484cSchristos   int mask_M;
10498b9484cSchristos   int bits_code;
10598b9484cSchristos   int mask_code;
10698b9484cSchristos } DSP32Mac;
10798b9484cSchristos 
10898b9484cSchristos #define DSP32Mac_opcode			0xc0000000
10998b9484cSchristos #define DSP32Mac_src1_bits		0
11098b9484cSchristos #define DSP32Mac_src1_mask		0x7
11198b9484cSchristos #define DSP32Mac_src0_bits		3
11298b9484cSchristos #define DSP32Mac_src0_mask		0x7
11398b9484cSchristos #define DSP32Mac_dst_bits		6
11498b9484cSchristos #define DSP32Mac_dst_mask		0x7
11598b9484cSchristos #define DSP32Mac_h10_bits		9
11698b9484cSchristos #define DSP32Mac_h10_mask		0x1
11798b9484cSchristos #define DSP32Mac_h00_bits		10
11898b9484cSchristos #define DSP32Mac_h00_mask		0x1
11998b9484cSchristos #define DSP32Mac_op0_bits		11
12098b9484cSchristos #define DSP32Mac_op0_mask		0x3
12198b9484cSchristos #define DSP32Mac_w0_bits		13
12298b9484cSchristos #define DSP32Mac_w0_mask		0x1
12398b9484cSchristos #define DSP32Mac_h11_bits		14
12498b9484cSchristos #define DSP32Mac_h11_mask		0x1
12598b9484cSchristos #define DSP32Mac_h01_bits		15
12698b9484cSchristos #define DSP32Mac_h01_mask		0x1
12798b9484cSchristos #define DSP32Mac_op1_bits		16
12898b9484cSchristos #define DSP32Mac_op1_mask		0x3
12998b9484cSchristos #define DSP32Mac_w1_bits		18
13098b9484cSchristos #define DSP32Mac_w1_mask		0x1
13198b9484cSchristos #define DSP32Mac_p_bits			19
13298b9484cSchristos #define DSP32Mac_p_mask			0x1
13398b9484cSchristos #define DSP32Mac_MM_bits		20
13498b9484cSchristos #define DSP32Mac_MM_mask		0x1
13598b9484cSchristos #define DSP32Mac_mmod_bits		21
13698b9484cSchristos #define DSP32Mac_mmod_mask		0xf
13798b9484cSchristos #define DSP32Mac_code2_bits		25
13898b9484cSchristos #define DSP32Mac_code2_mask		0x3
13998b9484cSchristos #define DSP32Mac_M_bits			27
14098b9484cSchristos #define DSP32Mac_M_mask			0x1
14198b9484cSchristos #define DSP32Mac_code_bits		28
14298b9484cSchristos #define DSP32Mac_code_mask		0xf
14398b9484cSchristos 
14498b9484cSchristos #define init_DSP32Mac				\
14598b9484cSchristos {						\
14698b9484cSchristos   DSP32Mac_opcode,				\
14798b9484cSchristos   DSP32Mac_src1_bits,	DSP32Mac_src1_mask,	\
14898b9484cSchristos   DSP32Mac_src0_bits,	DSP32Mac_src0_mask,	\
14998b9484cSchristos   DSP32Mac_dst_bits,	DSP32Mac_dst_mask,	\
15098b9484cSchristos   DSP32Mac_h10_bits,	DSP32Mac_h10_mask,	\
15198b9484cSchristos   DSP32Mac_h00_bits,	DSP32Mac_h00_mask,	\
15298b9484cSchristos   DSP32Mac_op0_bits,	DSP32Mac_op0_mask,	\
15398b9484cSchristos   DSP32Mac_w0_bits,	DSP32Mac_w0_mask,	\
15498b9484cSchristos   DSP32Mac_h11_bits,	DSP32Mac_h11_mask,	\
15598b9484cSchristos   DSP32Mac_h01_bits,	DSP32Mac_h01_mask,	\
15698b9484cSchristos   DSP32Mac_op1_bits,	DSP32Mac_op1_mask,	\
15798b9484cSchristos   DSP32Mac_w1_bits,	DSP32Mac_w1_mask,	\
15898b9484cSchristos   DSP32Mac_p_bits,	DSP32Mac_p_mask,	\
15998b9484cSchristos   DSP32Mac_MM_bits,	DSP32Mac_MM_mask,	\
16098b9484cSchristos   DSP32Mac_mmod_bits,	DSP32Mac_mmod_mask,	\
16198b9484cSchristos   DSP32Mac_code2_bits,	DSP32Mac_code2_mask,	\
16298b9484cSchristos   DSP32Mac_M_bits,	DSP32Mac_M_mask,	\
16398b9484cSchristos   DSP32Mac_code_bits,	DSP32Mac_code_mask	\
16498b9484cSchristos };
16598b9484cSchristos 
16698b9484cSchristos /*  dsp32mult
16798b9484cSchristos +----+----+---+---|---+----+----+---|---+---+---+---|---+---+---+---+
16898b9484cSchristos | 1  | 1  | 0 | 0 |.M.| 0  | 1  |.mmod..........|.MM|.P.|.w1|.op1...|
16998b9484cSchristos |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1......|
17098b9484cSchristos +----+----+---+---|---+----+----+---|---+---+---+---|---+---+---+---+
17198b9484cSchristos */
17298b9484cSchristos 
17398b9484cSchristos typedef DSP32Mac DSP32Mult;
17498b9484cSchristos #define DSP32Mult_opcode 	0xc2000000
17598b9484cSchristos 
17698b9484cSchristos #define init_DSP32Mult				\
17798b9484cSchristos {						\
17898b9484cSchristos   DSP32Mult_opcode,				\
17998b9484cSchristos   DSP32Mac_src1_bits,	DSP32Mac_src1_mask,	\
18098b9484cSchristos   DSP32Mac_src0_bits,	DSP32Mac_src0_mask,	\
18198b9484cSchristos   DSP32Mac_dst_bits,	DSP32Mac_dst_mask,	\
18298b9484cSchristos   DSP32Mac_h10_bits,	DSP32Mac_h10_mask,	\
18398b9484cSchristos   DSP32Mac_h00_bits,	DSP32Mac_h00_mask,	\
18498b9484cSchristos   DSP32Mac_op0_bits,	DSP32Mac_op0_mask,	\
18598b9484cSchristos   DSP32Mac_w0_bits,	DSP32Mac_w0_mask,	\
18698b9484cSchristos   DSP32Mac_h11_bits,	DSP32Mac_h11_mask,	\
18798b9484cSchristos   DSP32Mac_h01_bits,	DSP32Mac_h01_mask,	\
18898b9484cSchristos   DSP32Mac_op1_bits,	DSP32Mac_op1_mask,	\
18998b9484cSchristos   DSP32Mac_w1_bits,	DSP32Mac_w1_mask,	\
19098b9484cSchristos   DSP32Mac_p_bits,	DSP32Mac_p_mask,	\
19198b9484cSchristos   DSP32Mac_MM_bits,	DSP32Mac_MM_mask,	\
19298b9484cSchristos   DSP32Mac_mmod_bits,	DSP32Mac_mmod_mask,	\
19398b9484cSchristos   DSP32Mac_code2_bits,	DSP32Mac_code2_mask,	\
19498b9484cSchristos   DSP32Mac_M_bits,	DSP32Mac_M_mask,	\
19598b9484cSchristos   DSP32Mac_code_bits,	DSP32Mac_code_mask	\
19698b9484cSchristos };
19798b9484cSchristos 
19898b9484cSchristos /*  dsp32alu
19998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
20098b9484cSchristos | 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
20198b9484cSchristos |.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
20298b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
20398b9484cSchristos */
20498b9484cSchristos 
20598b9484cSchristos typedef struct
20698b9484cSchristos {
20798b9484cSchristos   unsigned long opcode;
20898b9484cSchristos   int bits_src1;
20998b9484cSchristos   int mask_src1;
21098b9484cSchristos   int bits_src0;
21198b9484cSchristos   int mask_src0;
21298b9484cSchristos   int bits_dst1;
21398b9484cSchristos   int mask_dst1;
21498b9484cSchristos   int bits_dst0;
21598b9484cSchristos   int mask_dst0;
21698b9484cSchristos   int bits_x;
21798b9484cSchristos   int mask_x;
21898b9484cSchristos   int bits_s;
21998b9484cSchristos   int mask_s;
22098b9484cSchristos   int bits_aop;
22198b9484cSchristos   int mask_aop;
22298b9484cSchristos   int bits_aopcde;
22398b9484cSchristos   int mask_aopcde;
22498b9484cSchristos   int bits_HL;
22598b9484cSchristos   int mask_HL;
22698b9484cSchristos   int bits_dontcare;
22798b9484cSchristos   int mask_dontcare;
22898b9484cSchristos   int bits_code2;
22998b9484cSchristos   int mask_code2;
23098b9484cSchristos   int bits_M;
23198b9484cSchristos   int mask_M;
23298b9484cSchristos   int bits_code;
23398b9484cSchristos   int mask_code;
23498b9484cSchristos } DSP32Alu;
23598b9484cSchristos 
23698b9484cSchristos #define DSP32Alu_opcode		0xc4000000
23798b9484cSchristos #define DSP32Alu_src1_bits	0
23898b9484cSchristos #define DSP32Alu_src1_mask	0x7
23998b9484cSchristos #define DSP32Alu_src0_bits	3
24098b9484cSchristos #define DSP32Alu_src0_mask	0x7
24198b9484cSchristos #define DSP32Alu_dst1_bits	6
24298b9484cSchristos #define DSP32Alu_dst1_mask	0x7
24398b9484cSchristos #define DSP32Alu_dst0_bits	9
24498b9484cSchristos #define DSP32Alu_dst0_mask	0x7
24598b9484cSchristos #define DSP32Alu_x_bits		12
24698b9484cSchristos #define DSP32Alu_x_mask		0x1
24798b9484cSchristos #define DSP32Alu_s_bits		13
24898b9484cSchristos #define DSP32Alu_s_mask		0x1
24998b9484cSchristos #define DSP32Alu_aop_bits	14
25098b9484cSchristos #define DSP32Alu_aop_mask	0x3
25198b9484cSchristos #define DSP32Alu_aopcde_bits	16
25298b9484cSchristos #define DSP32Alu_aopcde_mask	0x1f
25398b9484cSchristos #define DSP32Alu_HL_bits	21
25498b9484cSchristos #define DSP32Alu_HL_mask	0x1
25598b9484cSchristos #define DSP32Alu_dontcare_bits	22
25698b9484cSchristos #define DSP32Alu_dontcare_mask	0x7
25798b9484cSchristos #define DSP32Alu_code2_bits	25
25898b9484cSchristos #define DSP32Alu_code2_mask	0x3
25998b9484cSchristos #define DSP32Alu_M_bits		27
26098b9484cSchristos #define DSP32Alu_M_mask		0x1
26198b9484cSchristos #define DSP32Alu_code_bits	28
26298b9484cSchristos #define DSP32Alu_code_mask	0xf
26398b9484cSchristos 
26498b9484cSchristos #define init_DSP32Alu 					\
26598b9484cSchristos {							\
26698b9484cSchristos   DSP32Alu_opcode,					\
26798b9484cSchristos   DSP32Alu_src1_bits,		DSP32Alu_src1_mask,	\
26898b9484cSchristos   DSP32Alu_src0_bits,		DSP32Alu_src0_mask,	\
26998b9484cSchristos   DSP32Alu_dst1_bits,		DSP32Alu_dst1_mask,	\
27098b9484cSchristos   DSP32Alu_dst0_bits,		DSP32Alu_dst0_mask,	\
27198b9484cSchristos   DSP32Alu_x_bits,		DSP32Alu_x_mask,	\
27298b9484cSchristos   DSP32Alu_s_bits,		DSP32Alu_s_mask,	\
27398b9484cSchristos   DSP32Alu_aop_bits,		DSP32Alu_aop_mask,	\
27498b9484cSchristos   DSP32Alu_aopcde_bits,		DSP32Alu_aopcde_mask,	\
27598b9484cSchristos   DSP32Alu_HL_bits,		DSP32Alu_HL_mask,	\
27698b9484cSchristos   DSP32Alu_dontcare_bits,	DSP32Alu_dontcare_mask,	\
27798b9484cSchristos   DSP32Alu_code2_bits,		DSP32Alu_code2_mask,	\
27898b9484cSchristos   DSP32Alu_M_bits,		DSP32Alu_M_mask,	\
27998b9484cSchristos   DSP32Alu_code_bits,		DSP32Alu_code_mask 	\
28098b9484cSchristos };
28198b9484cSchristos 
28298b9484cSchristos /*  dsp32shift
28398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
28498b9484cSchristos | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
28598b9484cSchristos |.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
28698b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
28798b9484cSchristos */
28898b9484cSchristos 
28998b9484cSchristos typedef struct
29098b9484cSchristos {
29198b9484cSchristos   unsigned long opcode;
29298b9484cSchristos   int bits_src1;
29398b9484cSchristos   int mask_src1;
29498b9484cSchristos   int bits_src0;
29598b9484cSchristos   int mask_src0;
29698b9484cSchristos   int bits_dst1;
29798b9484cSchristos   int mask_dst1;
29898b9484cSchristos   int bits_dst0;
29998b9484cSchristos   int mask_dst0;
30098b9484cSchristos   int bits_HLs;
30198b9484cSchristos   int mask_HLs;
30298b9484cSchristos   int bits_sop;
30398b9484cSchristos   int mask_sop;
30498b9484cSchristos   int bits_sopcde;
30598b9484cSchristos   int mask_sopcde;
30698b9484cSchristos   int bits_dontcare;
30798b9484cSchristos   int mask_dontcare;
30898b9484cSchristos   int bits_code2;
30998b9484cSchristos   int mask_code2;
31098b9484cSchristos   int bits_M;
31198b9484cSchristos   int mask_M;
31298b9484cSchristos   int bits_code;
31398b9484cSchristos   int mask_code;
31498b9484cSchristos } DSP32Shift;
31598b9484cSchristos 
31698b9484cSchristos #define DSP32Shift_opcode		0xc6000000
31798b9484cSchristos #define DSP32Shift_src1_bits		0
31898b9484cSchristos #define DSP32Shift_src1_mask		0x7
31998b9484cSchristos #define DSP32Shift_src0_bits		3
32098b9484cSchristos #define DSP32Shift_src0_mask		0x7
32198b9484cSchristos #define DSP32Shift_dst1_bits		6
32298b9484cSchristos #define DSP32Shift_dst1_mask		0x7
32398b9484cSchristos #define DSP32Shift_dst0_bits		9
32498b9484cSchristos #define DSP32Shift_dst0_mask		0x7
32598b9484cSchristos #define DSP32Shift_HLs_bits		12
32698b9484cSchristos #define DSP32Shift_HLs_mask		0x3
32798b9484cSchristos #define DSP32Shift_sop_bits		14
32898b9484cSchristos #define DSP32Shift_sop_mask		0x3
32998b9484cSchristos #define DSP32Shift_sopcde_bits		16
33098b9484cSchristos #define DSP32Shift_sopcde_mask		0x1f
33198b9484cSchristos #define DSP32Shift_dontcare_bits	21
33298b9484cSchristos #define DSP32Shift_dontcare_mask	0x3
33398b9484cSchristos #define DSP32Shift_code2_bits		23
33498b9484cSchristos #define DSP32Shift_code2_mask		0xf
33598b9484cSchristos #define DSP32Shift_M_bits		27
33698b9484cSchristos #define DSP32Shift_M_mask		0x1
33798b9484cSchristos #define DSP32Shift_code_bits		28
33898b9484cSchristos #define DSP32Shift_code_mask		0xf
33998b9484cSchristos 
34098b9484cSchristos #define init_DSP32Shift						\
34198b9484cSchristos {								\
34298b9484cSchristos   DSP32Shift_opcode,						\
34398b9484cSchristos   DSP32Shift_src1_bits,		DSP32Shift_src1_mask,		\
34498b9484cSchristos   DSP32Shift_src0_bits,		DSP32Shift_src0_mask,		\
34598b9484cSchristos   DSP32Shift_dst1_bits,		DSP32Shift_dst1_mask,		\
34698b9484cSchristos   DSP32Shift_dst0_bits,		DSP32Shift_dst0_mask,		\
34798b9484cSchristos   DSP32Shift_HLs_bits,		DSP32Shift_HLs_mask,		\
34898b9484cSchristos   DSP32Shift_sop_bits,		DSP32Shift_sop_mask,		\
34998b9484cSchristos   DSP32Shift_sopcde_bits,	DSP32Shift_sopcde_mask,		\
35098b9484cSchristos   DSP32Shift_dontcare_bits,	DSP32Shift_dontcare_mask,	\
35198b9484cSchristos   DSP32Shift_code2_bits,	DSP32Shift_code2_mask,		\
35298b9484cSchristos   DSP32Shift_M_bits,		DSP32Shift_M_mask,		\
35398b9484cSchristos   DSP32Shift_code_bits,		DSP32Shift_code_mask		\
35498b9484cSchristos };
35598b9484cSchristos 
35698b9484cSchristos /*  dsp32shiftimm
35798b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
35898b9484cSchristos | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
35998b9484cSchristos |.sop...|.HLs...|.dst0......|.immag.................|.src1......|
36098b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
36198b9484cSchristos */
36298b9484cSchristos 
36398b9484cSchristos typedef struct
36498b9484cSchristos {
36598b9484cSchristos   unsigned long opcode;
36698b9484cSchristos   int bits_src1;
36798b9484cSchristos   int mask_src1;
36898b9484cSchristos   int bits_immag;
36998b9484cSchristos   int mask_immag;
37098b9484cSchristos   int bits_dst0;
37198b9484cSchristos   int mask_dst0;
37298b9484cSchristos   int bits_HLs;
37398b9484cSchristos   int mask_HLs;
37498b9484cSchristos   int bits_sop;
37598b9484cSchristos   int mask_sop;
37698b9484cSchristos   int bits_sopcde;
37798b9484cSchristos   int mask_sopcde;
37898b9484cSchristos   int bits_dontcare;
37998b9484cSchristos   int mask_dontcare;
38098b9484cSchristos   int bits_code2;
38198b9484cSchristos   int mask_code2;
38298b9484cSchristos   int bits_M;
38398b9484cSchristos   int mask_M;
38498b9484cSchristos   int bits_code;
38598b9484cSchristos   int mask_code;
38698b9484cSchristos } DSP32ShiftImm;
38798b9484cSchristos 
38898b9484cSchristos #define DSP32ShiftImm_opcode		0xc6800000
38998b9484cSchristos #define DSP32ShiftImm_src1_bits		0
39098b9484cSchristos #define DSP32ShiftImm_src1_mask		0x7
39198b9484cSchristos #define DSP32ShiftImm_immag_bits	3
39298b9484cSchristos #define DSP32ShiftImm_immag_mask	0x3f
39398b9484cSchristos #define DSP32ShiftImm_dst0_bits		9
39498b9484cSchristos #define DSP32ShiftImm_dst0_mask		0x7
39598b9484cSchristos #define DSP32ShiftImm_HLs_bits		12
39698b9484cSchristos #define DSP32ShiftImm_HLs_mask		0x3
39798b9484cSchristos #define DSP32ShiftImm_sop_bits		14
39898b9484cSchristos #define DSP32ShiftImm_sop_mask		0x3
39998b9484cSchristos #define DSP32ShiftImm_sopcde_bits	16
40098b9484cSchristos #define DSP32ShiftImm_sopcde_mask	0x1f
40198b9484cSchristos #define DSP32ShiftImm_dontcare_bits	21
40298b9484cSchristos #define DSP32ShiftImm_dontcare_mask	0x3
40398b9484cSchristos #define DSP32ShiftImm_code2_bits	23
40498b9484cSchristos #define DSP32ShiftImm_code2_mask	0xf
40598b9484cSchristos #define DSP32ShiftImm_M_bits		27
40698b9484cSchristos #define DSP32ShiftImm_M_mask		0x1
40798b9484cSchristos #define DSP32ShiftImm_code_bits		28
40898b9484cSchristos #define DSP32ShiftImm_code_mask		0xf
40998b9484cSchristos 
41098b9484cSchristos #define init_DSP32ShiftImm					\
41198b9484cSchristos {								\
41298b9484cSchristos   DSP32ShiftImm_opcode,						\
41398b9484cSchristos   DSP32ShiftImm_src1_bits,	DSP32ShiftImm_src1_mask,	\
41498b9484cSchristos   DSP32ShiftImm_immag_bits,	DSP32ShiftImm_immag_mask,	\
41598b9484cSchristos   DSP32ShiftImm_dst0_bits,	DSP32ShiftImm_dst0_mask,	\
41698b9484cSchristos   DSP32ShiftImm_HLs_bits,	DSP32ShiftImm_HLs_mask,		\
41798b9484cSchristos   DSP32ShiftImm_sop_bits,	DSP32ShiftImm_sop_mask,		\
41898b9484cSchristos   DSP32ShiftImm_sopcde_bits,	DSP32ShiftImm_sopcde_mask,	\
41998b9484cSchristos   DSP32ShiftImm_dontcare_bits,	DSP32ShiftImm_dontcare_mask,	\
42098b9484cSchristos   DSP32ShiftImm_code2_bits,	DSP32ShiftImm_code2_mask,	\
42198b9484cSchristos   DSP32ShiftImm_M_bits,		DSP32ShiftImm_M_mask,		\
42298b9484cSchristos   DSP32ShiftImm_code_bits,	DSP32ShiftImm_code_mask		\
42398b9484cSchristos };
42498b9484cSchristos 
42598b9484cSchristos /* LOAD / STORE  */
42698b9484cSchristos 
42798b9484cSchristos /*  LDSTidxI
42898b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
42998b9484cSchristos | 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
43098b9484cSchristos |.offset........................................................|
43198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
43298b9484cSchristos */
43398b9484cSchristos 
43498b9484cSchristos typedef struct
43598b9484cSchristos {
43698b9484cSchristos   unsigned long opcode;
43798b9484cSchristos   int bits_offset;
43898b9484cSchristos   int mask_offset;
43998b9484cSchristos   int bits_reg;
44098b9484cSchristos   int mask_reg;
44198b9484cSchristos   int bits_ptr;
44298b9484cSchristos   int mask_ptr;
44398b9484cSchristos   int bits_sz;
44498b9484cSchristos   int mask_sz;
44598b9484cSchristos   int bits_Z;
44698b9484cSchristos   int mask_Z;
44798b9484cSchristos   int bits_W;
44898b9484cSchristos   int mask_W;
44998b9484cSchristos   int bits_code;
45098b9484cSchristos   int mask_code;
45198b9484cSchristos } LDSTidxI;
45298b9484cSchristos 
45398b9484cSchristos #define LDSTidxI_opcode		0xe4000000
45498b9484cSchristos #define LDSTidxI_offset_bits	0
45598b9484cSchristos #define LDSTidxI_offset_mask	0xffff
45698b9484cSchristos #define LDSTidxI_reg_bits	16
45798b9484cSchristos #define LDSTidxI_reg_mask	0x7
45898b9484cSchristos #define LDSTidxI_ptr_bits	19
45998b9484cSchristos #define LDSTidxI_ptr_mask	0x7
46098b9484cSchristos #define LDSTidxI_sz_bits	22
46198b9484cSchristos #define LDSTidxI_sz_mask	0x3
46298b9484cSchristos #define LDSTidxI_Z_bits		24
46398b9484cSchristos #define LDSTidxI_Z_mask		0x1
46498b9484cSchristos #define LDSTidxI_W_bits		25
46598b9484cSchristos #define LDSTidxI_W_mask		0x1
46698b9484cSchristos #define LDSTidxI_code_bits	26
46798b9484cSchristos #define LDSTidxI_code_mask	0x3f
46898b9484cSchristos 
46998b9484cSchristos #define init_LDSTidxI				\
47098b9484cSchristos {						\
47198b9484cSchristos   LDSTidxI_opcode,				\
47298b9484cSchristos   LDSTidxI_offset_bits, LDSTidxI_offset_mask,	\
47398b9484cSchristos   LDSTidxI_reg_bits, LDSTidxI_reg_mask,		\
47498b9484cSchristos   LDSTidxI_ptr_bits, LDSTidxI_ptr_mask,		\
47598b9484cSchristos   LDSTidxI_sz_bits, LDSTidxI_sz_mask,		\
47698b9484cSchristos   LDSTidxI_Z_bits, LDSTidxI_Z_mask,		\
47798b9484cSchristos   LDSTidxI_W_bits, LDSTidxI_W_mask,		\
47898b9484cSchristos   LDSTidxI_code_bits, LDSTidxI_code_mask	\
47998b9484cSchristos };
48098b9484cSchristos 
48198b9484cSchristos 
48298b9484cSchristos /*  LDST
48398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
48498b9484cSchristos | 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
48598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
48698b9484cSchristos */
48798b9484cSchristos 
48898b9484cSchristos typedef struct
48998b9484cSchristos {
49098b9484cSchristos   unsigned short opcode;
49198b9484cSchristos   int bits_reg;
49298b9484cSchristos   int mask_reg;
49398b9484cSchristos   int bits_ptr;
49498b9484cSchristos   int mask_ptr;
49598b9484cSchristos   int bits_Z;
49698b9484cSchristos   int mask_Z;
49798b9484cSchristos   int bits_aop;
49898b9484cSchristos   int mask_aop;
49998b9484cSchristos   int bits_W;
50098b9484cSchristos   int mask_W;
50198b9484cSchristos   int bits_sz;
50298b9484cSchristos   int mask_sz;
50398b9484cSchristos   int bits_code;
50498b9484cSchristos   int mask_code;
50598b9484cSchristos } LDST;
50698b9484cSchristos 
50798b9484cSchristos #define LDST_opcode		0x9000
50898b9484cSchristos #define LDST_reg_bits		0
50998b9484cSchristos #define LDST_reg_mask		0x7
51098b9484cSchristos #define LDST_ptr_bits		3
51198b9484cSchristos #define LDST_ptr_mask		0x7
51298b9484cSchristos #define LDST_Z_bits		6
51398b9484cSchristos #define LDST_Z_mask		0x1
51498b9484cSchristos #define LDST_aop_bits		7
51598b9484cSchristos #define LDST_aop_mask		0x3
51698b9484cSchristos #define LDST_W_bits		9
51798b9484cSchristos #define LDST_W_mask		0x1
51898b9484cSchristos #define LDST_sz_bits		10
51998b9484cSchristos #define LDST_sz_mask		0x3
52098b9484cSchristos #define LDST_code_bits		12
52198b9484cSchristos #define LDST_code_mask		0xf
52298b9484cSchristos 
52398b9484cSchristos #define init_LDST			\
52498b9484cSchristos {					\
52598b9484cSchristos   LDST_opcode,				\
52698b9484cSchristos   LDST_reg_bits,	LDST_reg_mask,	\
52798b9484cSchristos   LDST_ptr_bits,	LDST_ptr_mask,	\
52898b9484cSchristos   LDST_Z_bits,		LDST_Z_mask,	\
52998b9484cSchristos   LDST_aop_bits,	LDST_aop_mask,	\
53098b9484cSchristos   LDST_W_bits,		LDST_W_mask,	\
53198b9484cSchristos   LDST_sz_bits,		LDST_sz_mask,	\
53298b9484cSchristos   LDST_code_bits,	LDST_code_mask	\
53398b9484cSchristos };
53498b9484cSchristos 
53598b9484cSchristos /*  LDSTii
53698b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
53798b9484cSchristos | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
53898b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
53998b9484cSchristos */
54098b9484cSchristos 
54198b9484cSchristos typedef struct
54298b9484cSchristos {
54398b9484cSchristos   unsigned short opcode;
54498b9484cSchristos   int bits_reg;
54598b9484cSchristos   int mask_reg;
54698b9484cSchristos   int bits_ptr;
54798b9484cSchristos   int mask_ptr;
54898b9484cSchristos   int bits_offset;
54998b9484cSchristos   int mask_offset;
55098b9484cSchristos   int bits_op;
55198b9484cSchristos   int mask_op;
55298b9484cSchristos   int bits_W;
55398b9484cSchristos   int mask_W;
55498b9484cSchristos   int bits_code;
55598b9484cSchristos   int mask_code;
55698b9484cSchristos } LDSTii;
55798b9484cSchristos 
55898b9484cSchristos #define LDSTii_opcode		0xa000
55998b9484cSchristos #define LDSTii_reg_bit		0
56098b9484cSchristos #define LDSTii_reg_mask		0x7
56198b9484cSchristos #define LDSTii_ptr_bit		3
56298b9484cSchristos #define LDSTii_ptr_mask		0x7
56398b9484cSchristos #define LDSTii_offset_bit	6
56498b9484cSchristos #define LDSTii_offset_mask	0xf
56598b9484cSchristos #define LDSTii_op_bit		10
56698b9484cSchristos #define LDSTii_op_mask		0x3
56798b9484cSchristos #define LDSTii_W_bit		12
56898b9484cSchristos #define LDSTii_W_mask		0x1
56998b9484cSchristos #define LDSTii_code_bit		13
57098b9484cSchristos #define LDSTii_code_mask	0x7
57198b9484cSchristos 
57298b9484cSchristos #define init_LDSTii 				\
57398b9484cSchristos {						\
57498b9484cSchristos   LDSTii_opcode,				\
57598b9484cSchristos   LDSTii_reg_bit,	LDSTii_reg_mask,	\
57698b9484cSchristos   LDSTii_ptr_bit,	LDSTii_ptr_mask,	\
57798b9484cSchristos   LDSTii_offset_bit,    LDSTii_offset_mask, 	\
57898b9484cSchristos   LDSTii_op_bit,        LDSTii_op_mask,		\
57998b9484cSchristos   LDSTii_W_bit,		LDSTii_W_mask,		\
58098b9484cSchristos   LDSTii_code_bit,	LDSTii_code_mask	\
58198b9484cSchristos };
58298b9484cSchristos 
58398b9484cSchristos 
58498b9484cSchristos /*  LDSTiiFP
58598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
58698b9484cSchristos | 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
58798b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
58898b9484cSchristos */
58998b9484cSchristos 
59098b9484cSchristos typedef struct
59198b9484cSchristos {
59298b9484cSchristos   unsigned short opcode;
59398b9484cSchristos   int bits_reg;
59498b9484cSchristos   int mask_reg;
59598b9484cSchristos   int bits_offset;
59698b9484cSchristos   int mask_offset;
59798b9484cSchristos   int bits_W;
59898b9484cSchristos   int mask_W;
59998b9484cSchristos   int bits_code;
60098b9484cSchristos   int mask_code;
60198b9484cSchristos } LDSTiiFP;
60298b9484cSchristos 
60398b9484cSchristos #define LDSTiiFP_opcode		0xb800
60498b9484cSchristos #define LDSTiiFP_reg_bits	0
60598b9484cSchristos #define LDSTiiFP_reg_mask	0xf
60698b9484cSchristos #define LDSTiiFP_offset_bits	4
60798b9484cSchristos #define LDSTiiFP_offset_mask	0x1f
60898b9484cSchristos #define LDSTiiFP_W_bits		9
60998b9484cSchristos #define LDSTiiFP_W_mask		0x1
61098b9484cSchristos #define LDSTiiFP_code_bits	10
61198b9484cSchristos #define LDSTiiFP_code_mask	0x3f
61298b9484cSchristos 
61398b9484cSchristos #define init_LDSTiiFP				\
61498b9484cSchristos {						\
61598b9484cSchristos   LDSTiiFP_opcode,				\
61698b9484cSchristos   LDSTiiFP_reg_bits,	LDSTiiFP_reg_mask,	\
61798b9484cSchristos   LDSTiiFP_offset_bits, LDSTiiFP_offset_mask,	\
61898b9484cSchristos   LDSTiiFP_W_bits,	LDSTiiFP_W_mask,	\
61998b9484cSchristos   LDSTiiFP_code_bits,	LDSTiiFP_code_mask	\
62098b9484cSchristos };
62198b9484cSchristos 
62298b9484cSchristos /*  dspLDST
62398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
62498b9484cSchristos | 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
62598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
62698b9484cSchristos */
62798b9484cSchristos 
62898b9484cSchristos typedef struct
62998b9484cSchristos {
63098b9484cSchristos   unsigned short opcode;
63198b9484cSchristos   int bits_reg;
63298b9484cSchristos   int mask_reg;
63398b9484cSchristos   int bits_i;
63498b9484cSchristos   int mask_i;
63598b9484cSchristos   int bits_m;
63698b9484cSchristos   int mask_m;
63798b9484cSchristos   int bits_aop;
63898b9484cSchristos   int mask_aop;
63998b9484cSchristos   int bits_W;
64098b9484cSchristos   int mask_W;
64198b9484cSchristos   int bits_code;
64298b9484cSchristos   int mask_code;
64398b9484cSchristos } DspLDST;
64498b9484cSchristos 
64598b9484cSchristos #define DspLDST_opcode		0x9c00
64698b9484cSchristos #define DspLDST_reg_bits	0
64798b9484cSchristos #define DspLDST_reg_mask	0x7
64898b9484cSchristos #define DspLDST_i_bits		3
64998b9484cSchristos #define DspLDST_i_mask		0x3
65098b9484cSchristos #define DspLDST_m_bits		5
65198b9484cSchristos #define DspLDST_m_mask		0x3
65298b9484cSchristos #define DspLDST_aop_bits	7
65398b9484cSchristos #define DspLDST_aop_mask	0x3
65498b9484cSchristos #define DspLDST_W_bits		9
65598b9484cSchristos #define DspLDST_W_mask		0x1
65698b9484cSchristos #define DspLDST_code_bits	10
65798b9484cSchristos #define DspLDST_code_mask	0x3f
65898b9484cSchristos 
65998b9484cSchristos #define init_DspLDST				\
66098b9484cSchristos {						\
66198b9484cSchristos   DspLDST_opcode,				\
66298b9484cSchristos   DspLDST_reg_bits,	DspLDST_reg_mask,	\
66398b9484cSchristos   DspLDST_i_bits,	DspLDST_i_mask,		\
66498b9484cSchristos   DspLDST_m_bits,	DspLDST_m_mask,		\
66598b9484cSchristos   DspLDST_aop_bits,	DspLDST_aop_mask,	\
66698b9484cSchristos   DspLDST_W_bits,	DspLDST_W_mask,		\
66798b9484cSchristos   DspLDST_code_bits,	DspLDST_code_mask	\
66898b9484cSchristos };
66998b9484cSchristos 
67098b9484cSchristos 
67198b9484cSchristos /*  LDSTpmod
67298b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
67398b9484cSchristos | 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
67498b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
67598b9484cSchristos */
67698b9484cSchristos 
67798b9484cSchristos typedef struct
67898b9484cSchristos {
67998b9484cSchristos   unsigned short opcode;
68098b9484cSchristos   int bits_ptr;
68198b9484cSchristos   int mask_ptr;
68298b9484cSchristos   int bits_idx;
68398b9484cSchristos   int mask_idx;
68498b9484cSchristos   int bits_reg;
68598b9484cSchristos   int mask_reg;
68698b9484cSchristos   int bits_aop;
68798b9484cSchristos   int mask_aop;
68898b9484cSchristos   int bits_W;
68998b9484cSchristos   int mask_W;
69098b9484cSchristos   int bits_code;
69198b9484cSchristos   int mask_code;
69298b9484cSchristos } LDSTpmod;
69398b9484cSchristos 
69498b9484cSchristos #define LDSTpmod_opcode		0x8000
69598b9484cSchristos #define LDSTpmod_ptr_bits	0
69698b9484cSchristos #define LDSTpmod_ptr_mask	0x7
69798b9484cSchristos #define LDSTpmod_idx_bits	3
69898b9484cSchristos #define LDSTpmod_idx_mask	0x7
69998b9484cSchristos #define LDSTpmod_reg_bits	6
70098b9484cSchristos #define LDSTpmod_reg_mask	0x7
70198b9484cSchristos #define LDSTpmod_aop_bits	9
70298b9484cSchristos #define LDSTpmod_aop_mask	0x3
70398b9484cSchristos #define LDSTpmod_W_bits		11
70498b9484cSchristos #define LDSTpmod_W_mask		0x1
70598b9484cSchristos #define LDSTpmod_code_bits	12
70698b9484cSchristos #define LDSTpmod_code_mask	0xf
70798b9484cSchristos 
70898b9484cSchristos #define init_LDSTpmod				\
70998b9484cSchristos {						\
71098b9484cSchristos   LDSTpmod_opcode,				\
71198b9484cSchristos   LDSTpmod_ptr_bits, 	LDSTpmod_ptr_mask,	\
71298b9484cSchristos   LDSTpmod_idx_bits,	LDSTpmod_idx_mask,	\
71398b9484cSchristos   LDSTpmod_reg_bits,	LDSTpmod_reg_mask,	\
71498b9484cSchristos   LDSTpmod_aop_bits,	LDSTpmod_aop_mask,	\
71598b9484cSchristos   LDSTpmod_W_bits,	LDSTpmod_W_mask,	\
71698b9484cSchristos   LDSTpmod_code_bits,	LDSTpmod_code_mask	\
71798b9484cSchristos };
71898b9484cSchristos 
71998b9484cSchristos 
72098b9484cSchristos /*  LOGI2op
72198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
72298b9484cSchristos | 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
72398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
72498b9484cSchristos */
72598b9484cSchristos 
72698b9484cSchristos typedef struct
72798b9484cSchristos {
72898b9484cSchristos   unsigned short opcode;
72998b9484cSchristos   int bits_dst;
73098b9484cSchristos   int mask_dst;
73198b9484cSchristos   int bits_src;
73298b9484cSchristos   int mask_src;
73398b9484cSchristos   int bits_opc;
73498b9484cSchristos   int mask_opc;
73598b9484cSchristos   int bits_code;
73698b9484cSchristos   int mask_code;
73798b9484cSchristos } LOGI2op;
73898b9484cSchristos 
73998b9484cSchristos #define LOGI2op_opcode		0x4800
74098b9484cSchristos #define LOGI2op_dst_bits	0
74198b9484cSchristos #define LOGI2op_dst_mask	0x7
74298b9484cSchristos #define LOGI2op_src_bits	3
74398b9484cSchristos #define LOGI2op_src_mask	0x1f
74498b9484cSchristos #define LOGI2op_opc_bits	8
74598b9484cSchristos #define LOGI2op_opc_mask	0x7
74698b9484cSchristos #define LOGI2op_code_bits	11
74798b9484cSchristos #define LOGI2op_code_mask	0x1f
74898b9484cSchristos 
74998b9484cSchristos #define init_LOGI2op				\
75098b9484cSchristos {						\
75198b9484cSchristos   LOGI2op_opcode,				\
75298b9484cSchristos   LOGI2op_dst_bits, 	LOGI2op_dst_mask,	\
75398b9484cSchristos   LOGI2op_src_bits,	LOGI2op_src_mask,	\
75498b9484cSchristos   LOGI2op_opc_bits,	LOGI2op_opc_mask,	\
75598b9484cSchristos   LOGI2op_code_bits,	LOGI2op_code_mask	\
75698b9484cSchristos };
75798b9484cSchristos 
75898b9484cSchristos 
75998b9484cSchristos /*  ALU2op
76098b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
76198b9484cSchristos | 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
76298b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
76398b9484cSchristos */
76498b9484cSchristos 
76598b9484cSchristos typedef struct
76698b9484cSchristos {
76798b9484cSchristos   unsigned short opcode;
76898b9484cSchristos   int bits_dst;
76998b9484cSchristos   int mask_dst;
77098b9484cSchristos   int bits_src;
77198b9484cSchristos   int mask_src;
77298b9484cSchristos   int bits_opc;
77398b9484cSchristos   int mask_opc;
77498b9484cSchristos   int bits_code;
77598b9484cSchristos   int mask_code;
77698b9484cSchristos } ALU2op;
77798b9484cSchristos 
77898b9484cSchristos #define ALU2op_opcode 		0x4000
77998b9484cSchristos #define ALU2op_dst_bits		0
78098b9484cSchristos #define ALU2op_dst_mask		0x7
78198b9484cSchristos #define ALU2op_src_bits		3
78298b9484cSchristos #define ALU2op_src_mask		0x7
78398b9484cSchristos #define ALU2op_opc_bits		6
78498b9484cSchristos #define ALU2op_opc_mask		0xf
78598b9484cSchristos #define ALU2op_code_bits	10
78698b9484cSchristos #define ALU2op_code_mask	0x3f
78798b9484cSchristos 
78898b9484cSchristos #define init_ALU2op				\
78998b9484cSchristos {						\
79098b9484cSchristos   ALU2op_opcode,				\
79198b9484cSchristos   ALU2op_dst_bits,	ALU2op_dst_mask,	\
79298b9484cSchristos   ALU2op_src_bits,	ALU2op_src_mask,	\
79398b9484cSchristos   ALU2op_opc_bits,	ALU2op_opc_mask,	\
79498b9484cSchristos   ALU2op_code_bits,	ALU2op_code_mask	\
79598b9484cSchristos };
79698b9484cSchristos 
79798b9484cSchristos 
79898b9484cSchristos /*  BRCC
79998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
80098b9484cSchristos | 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
80198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
80298b9484cSchristos */
80398b9484cSchristos 
80498b9484cSchristos typedef struct
80598b9484cSchristos {
80698b9484cSchristos   unsigned short opcode;
80798b9484cSchristos   int bits_offset;
80898b9484cSchristos   int mask_offset;
80998b9484cSchristos   int bits_B;
81098b9484cSchristos   int mask_B;
81198b9484cSchristos   int bits_T;
81298b9484cSchristos   int mask_T;
81398b9484cSchristos   int bits_code;
81498b9484cSchristos   int mask_code;
81598b9484cSchristos } BRCC;
81698b9484cSchristos 
81798b9484cSchristos #define BRCC_opcode		0x1000
81898b9484cSchristos #define BRCC_offset_bits	0
81998b9484cSchristos #define BRCC_offset_mask	0x3ff
82098b9484cSchristos #define BRCC_B_bits		10
82198b9484cSchristos #define BRCC_B_mask		0x1
82298b9484cSchristos #define BRCC_T_bits		11
82398b9484cSchristos #define BRCC_T_mask		0x1
82498b9484cSchristos #define BRCC_code_bits		12
82598b9484cSchristos #define BRCC_code_mask		0xf
82698b9484cSchristos 
82798b9484cSchristos #define init_BRCC				\
82898b9484cSchristos {						\
82998b9484cSchristos   BRCC_opcode,					\
83098b9484cSchristos   BRCC_offset_bits,	BRCC_offset_mask,	\
83198b9484cSchristos   BRCC_B_bits,		BRCC_B_mask,		\
83298b9484cSchristos   BRCC_T_bits,		BRCC_T_mask,		\
83398b9484cSchristos   BRCC_code_bits,	BRCC_code_mask		\
83498b9484cSchristos };
83598b9484cSchristos 
83698b9484cSchristos 
83798b9484cSchristos /*  UJUMP
83898b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
83998b9484cSchristos | 0 | 0 | 1 | 0 |.offset........................................|
84098b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
84198b9484cSchristos */
84298b9484cSchristos 
84398b9484cSchristos typedef struct
84498b9484cSchristos {
84598b9484cSchristos   unsigned short opcode;
84698b9484cSchristos   int bits_offset;
84798b9484cSchristos   int mask_offset;
84898b9484cSchristos   int bits_code;
84998b9484cSchristos   int mask_code;
85098b9484cSchristos } UJump;
85198b9484cSchristos 
85298b9484cSchristos #define UJump_opcode		0x2000
85398b9484cSchristos #define UJump_offset_bits	0
85498b9484cSchristos #define UJump_offset_mask	0xfff
85598b9484cSchristos #define UJump_code_bits		12
85698b9484cSchristos #define UJump_code_mask		0xf
85798b9484cSchristos 
85898b9484cSchristos #define init_UJump				\
85998b9484cSchristos {						\
86098b9484cSchristos   UJump_opcode,					\
86198b9484cSchristos   UJump_offset_bits,	UJump_offset_mask,	\
86298b9484cSchristos   UJump_code_bits,	UJump_code_mask		\
86398b9484cSchristos };
86498b9484cSchristos 
86598b9484cSchristos 
86698b9484cSchristos /*  ProgCtrl
86798b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
86898b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
86998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
87098b9484cSchristos */
87198b9484cSchristos 
87298b9484cSchristos typedef struct
87398b9484cSchristos {
87498b9484cSchristos   unsigned short opcode;
87598b9484cSchristos   int bits_poprnd;
87698b9484cSchristos   int mask_poprnd;
87798b9484cSchristos   int bits_prgfunc;
87898b9484cSchristos   int mask_prgfunc;
87998b9484cSchristos   int bits_code;
88098b9484cSchristos   int mask_code;
88198b9484cSchristos } ProgCtrl;
88298b9484cSchristos 
88398b9484cSchristos #define ProgCtrl_opcode		0x0000
88498b9484cSchristos #define ProgCtrl_poprnd_bits	0
88598b9484cSchristos #define ProgCtrl_poprnd_mask	0xf
88698b9484cSchristos #define ProgCtrl_prgfunc_bits	4
88798b9484cSchristos #define ProgCtrl_prgfunc_mask	0xf
88898b9484cSchristos #define ProgCtrl_code_bits	8
88998b9484cSchristos #define ProgCtrl_code_mask	0xff
89098b9484cSchristos 
89198b9484cSchristos #define init_ProgCtrl					\
89298b9484cSchristos {							\
89398b9484cSchristos   ProgCtrl_opcode,					\
89498b9484cSchristos   ProgCtrl_poprnd_bits,		ProgCtrl_poprnd_mask,	\
89598b9484cSchristos   ProgCtrl_prgfunc_bits,	ProgCtrl_prgfunc_mask,	\
89698b9484cSchristos   ProgCtrl_code_bits,		ProgCtrl_code_mask	\
89798b9484cSchristos };
89898b9484cSchristos 
89998b9484cSchristos /*  CALLa
90098b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
90198b9484cSchristos | 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
90298b9484cSchristos |.lsw...........................................................|
90398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
90498b9484cSchristos */
90598b9484cSchristos 
90698b9484cSchristos 
90798b9484cSchristos typedef struct
90898b9484cSchristos {
90998b9484cSchristos   unsigned long opcode;
91098b9484cSchristos   int bits_addr;
91198b9484cSchristos   int mask_addr;
91298b9484cSchristos   int bits_S;
91398b9484cSchristos   int mask_S;
91498b9484cSchristos   int bits_code;
91598b9484cSchristos   int mask_code;
91698b9484cSchristos } CALLa;
91798b9484cSchristos 
91898b9484cSchristos #define CALLa_opcode	0xe2000000
91998b9484cSchristos #define CALLa_addr_bits	0
92098b9484cSchristos #define CALLa_addr_mask	0xffffff
92198b9484cSchristos #define CALLa_S_bits	24
92298b9484cSchristos #define CALLa_S_mask	0x1
92398b9484cSchristos #define CALLa_code_bits	25
92498b9484cSchristos #define CALLa_code_mask	0x7f
92598b9484cSchristos 
92698b9484cSchristos #define init_CALLa				\
92798b9484cSchristos {						\
92898b9484cSchristos   CALLa_opcode,					\
92998b9484cSchristos   CALLa_addr_bits,	CALLa_addr_mask,	\
93098b9484cSchristos   CALLa_S_bits,		CALLa_S_mask,		\
93198b9484cSchristos   CALLa_code_bits,	CALLa_code_mask		\
93298b9484cSchristos };
93398b9484cSchristos 
93498b9484cSchristos 
93598b9484cSchristos /*  pseudoDEBUG
93698b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
93798b9484cSchristos | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
93898b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
93998b9484cSchristos */
94098b9484cSchristos 
94198b9484cSchristos typedef struct
94298b9484cSchristos {
94398b9484cSchristos   unsigned short opcode;
94498b9484cSchristos   int bits_reg;
94598b9484cSchristos   int mask_reg;
94698b9484cSchristos   int bits_grp;
94798b9484cSchristos   int mask_grp;
94898b9484cSchristos   int bits_fn;
94998b9484cSchristos   int mask_fn;
95098b9484cSchristos   int bits_code;
95198b9484cSchristos   int mask_code;
95298b9484cSchristos } PseudoDbg;
95398b9484cSchristos 
95498b9484cSchristos #define PseudoDbg_opcode	0xf800
95598b9484cSchristos #define PseudoDbg_reg_bits	0
95698b9484cSchristos #define PseudoDbg_reg_mask	0x7
95798b9484cSchristos #define PseudoDbg_grp_bits	3
95898b9484cSchristos #define PseudoDbg_grp_mask	0x7
95998b9484cSchristos #define PseudoDbg_fn_bits	6
96098b9484cSchristos #define PseudoDbg_fn_mask	0x3
96198b9484cSchristos #define PseudoDbg_code_bits	8
96298b9484cSchristos #define PseudoDbg_code_mask	0xff
96398b9484cSchristos 
96498b9484cSchristos #define init_PseudoDbg				\
96598b9484cSchristos {						\
96698b9484cSchristos   PseudoDbg_opcode,				\
96798b9484cSchristos   PseudoDbg_reg_bits,	PseudoDbg_reg_mask,	\
96898b9484cSchristos   PseudoDbg_grp_bits,	PseudoDbg_grp_mask,	\
96998b9484cSchristos   PseudoDbg_fn_bits,	PseudoDbg_fn_mask,	\
97098b9484cSchristos   PseudoDbg_code_bits,	PseudoDbg_code_mask	\
97198b9484cSchristos };
97298b9484cSchristos 
97398b9484cSchristos /*  PseudoDbg_assert
97498b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
97598b9484cSchristos | 1 | 1 | 1 | 1 | 0 | - | - | - | dbgop |.grp.......|.regtest...|
97698b9484cSchristos |.expected......................................................|
97798b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
97898b9484cSchristos */
97998b9484cSchristos 
98098b9484cSchristos typedef struct
98198b9484cSchristos {
98298b9484cSchristos   unsigned long opcode;
98398b9484cSchristos   int bits_expected;
98498b9484cSchristos   int mask_expected;
98598b9484cSchristos   int bits_regtest;
98698b9484cSchristos   int mask_regtest;
98798b9484cSchristos   int bits_grp;
98898b9484cSchristos   int mask_grp;
98998b9484cSchristos   int bits_dbgop;
99098b9484cSchristos   int mask_dbgop;
99198b9484cSchristos   int bits_dontcare;
99298b9484cSchristos   int mask_dontcare;
99398b9484cSchristos   int bits_code;
99498b9484cSchristos   int mask_code;
99598b9484cSchristos } PseudoDbg_Assert;
99698b9484cSchristos 
99798b9484cSchristos #define PseudoDbg_Assert_opcode		0xf0000000
99898b9484cSchristos #define PseudoDbg_Assert_expected_bits	0
99998b9484cSchristos #define PseudoDbg_Assert_expected_mask	0xffff
100098b9484cSchristos #define PseudoDbg_Assert_regtest_bits	16
100198b9484cSchristos #define PseudoDbg_Assert_regtest_mask	0x7
100298b9484cSchristos #define PseudoDbg_Assert_grp_bits	19
100398b9484cSchristos #define PseudoDbg_Assert_grp_mask	0x7
100498b9484cSchristos #define PseudoDbg_Assert_dbgop_bits	22
100598b9484cSchristos #define PseudoDbg_Assert_dbgop_mask	0x3
100698b9484cSchristos #define PseudoDbg_Assert_dontcare_bits	24
100798b9484cSchristos #define PseudoDbg_Assert_dontcare_mask	0x7
100898b9484cSchristos #define PseudoDbg_Assert_code_bits	27
100998b9484cSchristos #define PseudoDbg_Assert_code_mask	0x1f
101098b9484cSchristos 
101198b9484cSchristos #define init_PseudoDbg_Assert						\
101298b9484cSchristos {									\
101398b9484cSchristos   PseudoDbg_Assert_opcode,						\
101498b9484cSchristos   PseudoDbg_Assert_expected_bits, 	PseudoDbg_Assert_expected_mask,	\
101598b9484cSchristos   PseudoDbg_Assert_regtest_bits, 	PseudoDbg_Assert_regtest_mask,	\
101698b9484cSchristos   PseudoDbg_Assert_grp_bits,		PseudoDbg_Assert_grp_mask,	\
101798b9484cSchristos   PseudoDbg_Assert_dbgop_bits, 		PseudoDbg_Assert_dbgop_mask,	\
101898b9484cSchristos   PseudoDbg_Assert_dontcare_bits, 	PseudoDbg_Assert_dontcare_mask,	\
101998b9484cSchristos   PseudoDbg_Assert_code_bits,	 	PseudoDbg_Assert_code_mask	\
102098b9484cSchristos };
102198b9484cSchristos 
102298b9484cSchristos /*  pseudoChr
102398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
102498b9484cSchristos | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |.ch............................|
102598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
102698b9484cSchristos */
102798b9484cSchristos 
102898b9484cSchristos typedef struct
102998b9484cSchristos {
103098b9484cSchristos   unsigned short opcode;
103198b9484cSchristos   int bits_ch;
103298b9484cSchristos   int mask_ch;
103398b9484cSchristos   int bits_code;
103498b9484cSchristos   int mask_code;
103598b9484cSchristos } PseudoChr;
103698b9484cSchristos 
103798b9484cSchristos #define PseudoChr_opcode	0xf900
103898b9484cSchristos #define PseudoChr_ch_bits	0
103998b9484cSchristos #define PseudoChr_ch_mask	0xff
104098b9484cSchristos #define PseudoChr_code_bits	8
104198b9484cSchristos #define PseudoChr_code_mask	0xff
104298b9484cSchristos 
104398b9484cSchristos #define init_PseudoChr				\
104498b9484cSchristos {						\
104598b9484cSchristos   PseudoChr_opcode,				\
104698b9484cSchristos   PseudoChr_ch_bits,	PseudoChr_ch_mask,	\
104798b9484cSchristos   PseudoChr_code_bits,	PseudoChr_code_mask	\
104898b9484cSchristos };
104998b9484cSchristos 
105098b9484cSchristos /*  CaCTRL
105198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
105298b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
105398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
105498b9484cSchristos */
105598b9484cSchristos 
105698b9484cSchristos typedef struct
105798b9484cSchristos {
105898b9484cSchristos   unsigned short opcode;
105998b9484cSchristos   int bits_reg;
106098b9484cSchristos   int mask_reg;
106198b9484cSchristos   int bits_op;
106298b9484cSchristos   int mask_op;
106398b9484cSchristos   int bits_a;
106498b9484cSchristos   int mask_a;
106598b9484cSchristos   int bits_code;
106698b9484cSchristos   int mask_code;
106798b9484cSchristos } CaCTRL;
106898b9484cSchristos 
106998b9484cSchristos #define CaCTRL_opcode		0x0240
107098b9484cSchristos #define CaCTRL_reg_bits		0
107198b9484cSchristos #define CaCTRL_reg_mask		0x7
107298b9484cSchristos #define CaCTRL_op_bits		3
107398b9484cSchristos #define CaCTRL_op_mask		0x3
107498b9484cSchristos #define CaCTRL_a_bits		5
107598b9484cSchristos #define CaCTRL_a_mask		0x1
107698b9484cSchristos #define CaCTRL_code_bits	6
107798b9484cSchristos #define CaCTRL_code_mask	0x3fff
107898b9484cSchristos 
107998b9484cSchristos #define init_CaCTRL				\
108098b9484cSchristos {						\
108198b9484cSchristos   CaCTRL_opcode,				\
108298b9484cSchristos   CaCTRL_reg_bits,	CaCTRL_reg_mask,	\
108398b9484cSchristos   CaCTRL_op_bits,	CaCTRL_op_mask,		\
108498b9484cSchristos   CaCTRL_a_bits,	CaCTRL_a_mask,		\
108598b9484cSchristos   CaCTRL_code_bits,	CaCTRL_code_mask	\
108698b9484cSchristos };
108798b9484cSchristos 
108898b9484cSchristos /*  PushPopMultiple
108998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
109098b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
109198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
109298b9484cSchristos */
109398b9484cSchristos 
109498b9484cSchristos typedef struct
109598b9484cSchristos {
109698b9484cSchristos   unsigned short opcode;
109798b9484cSchristos   int bits_pr;
109898b9484cSchristos   int mask_pr;
109998b9484cSchristos   int bits_dr;
110098b9484cSchristos   int mask_dr;
110198b9484cSchristos   int bits_W;
110298b9484cSchristos   int mask_W;
110398b9484cSchristos   int bits_p;
110498b9484cSchristos   int mask_p;
110598b9484cSchristos   int bits_d;
110698b9484cSchristos   int mask_d;
110798b9484cSchristos   int bits_code;
110898b9484cSchristos   int mask_code;
110998b9484cSchristos } PushPopMultiple;
111098b9484cSchristos 
111198b9484cSchristos #define PushPopMultiple_opcode		0x0400
111298b9484cSchristos #define PushPopMultiple_pr_bits		0
111398b9484cSchristos #define PushPopMultiple_pr_mask		0x7
111498b9484cSchristos #define PushPopMultiple_dr_bits		3
111598b9484cSchristos #define PushPopMultiple_dr_mask		0x7
111698b9484cSchristos #define PushPopMultiple_W_bits		6
111798b9484cSchristos #define PushPopMultiple_W_mask		0x1
111898b9484cSchristos #define PushPopMultiple_p_bits		7
111998b9484cSchristos #define PushPopMultiple_p_mask		0x1
112098b9484cSchristos #define PushPopMultiple_d_bits		8
112198b9484cSchristos #define PushPopMultiple_d_mask		0x1
112298b9484cSchristos #define PushPopMultiple_code_bits	8
112398b9484cSchristos #define PushPopMultiple_code_mask	0x1
112498b9484cSchristos 
112598b9484cSchristos #define init_PushPopMultiple					\
112698b9484cSchristos {								\
112798b9484cSchristos   PushPopMultiple_opcode,					\
112898b9484cSchristos   PushPopMultiple_pr_bits,	PushPopMultiple_pr_mask,	\
112998b9484cSchristos   PushPopMultiple_dr_bits,	PushPopMultiple_dr_mask,	\
113098b9484cSchristos   PushPopMultiple_W_bits,	PushPopMultiple_W_mask,		\
113198b9484cSchristos   PushPopMultiple_p_bits,	PushPopMultiple_p_mask,		\
113298b9484cSchristos   PushPopMultiple_d_bits,	PushPopMultiple_d_mask,		\
113398b9484cSchristos   PushPopMultiple_code_bits,	PushPopMultiple_code_mask	\
113498b9484cSchristos };
113598b9484cSchristos 
113698b9484cSchristos /*  PushPopReg
113798b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
113898b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
113998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
114098b9484cSchristos */
114198b9484cSchristos 
114298b9484cSchristos typedef struct
114398b9484cSchristos {
114498b9484cSchristos   unsigned short opcode;
114598b9484cSchristos   int bits_reg;
114698b9484cSchristos   int mask_reg;
114798b9484cSchristos   int bits_grp;
114898b9484cSchristos   int mask_grp;
114998b9484cSchristos   int bits_W;
115098b9484cSchristos   int mask_W;
115198b9484cSchristos   int bits_code;
115298b9484cSchristos   int mask_code;
115398b9484cSchristos } PushPopReg;
115498b9484cSchristos 
115598b9484cSchristos #define PushPopReg_opcode	0x0100
115698b9484cSchristos #define PushPopReg_reg_bits	0
115798b9484cSchristos #define PushPopReg_reg_mask	0x7
115898b9484cSchristos #define PushPopReg_grp_bits	3
115998b9484cSchristos #define PushPopReg_grp_mask	0x7
116098b9484cSchristos #define PushPopReg_W_bits	6
116198b9484cSchristos #define PushPopReg_W_mask	0x1
116298b9484cSchristos #define PushPopReg_code_bits	7
116398b9484cSchristos #define PushPopReg_code_mask	0x1ff
116498b9484cSchristos 
116598b9484cSchristos #define init_PushPopReg				\
116698b9484cSchristos {						\
116798b9484cSchristos   PushPopReg_opcode,				\
116898b9484cSchristos   PushPopReg_reg_bits,	PushPopReg_reg_mask,	\
116998b9484cSchristos   PushPopReg_grp_bits,	PushPopReg_grp_mask,	\
117098b9484cSchristos   PushPopReg_W_bits,	PushPopReg_W_mask,	\
117198b9484cSchristos   PushPopReg_code_bits,	PushPopReg_code_mask,	\
117298b9484cSchristos };
117398b9484cSchristos 
117498b9484cSchristos /*  linkage
117598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
117698b9484cSchristos | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
117798b9484cSchristos |.framesize.....................................................|
117898b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
117998b9484cSchristos */
118098b9484cSchristos 
118198b9484cSchristos typedef struct
118298b9484cSchristos {
118398b9484cSchristos   unsigned long opcode;
118498b9484cSchristos   int bits_framesize;
118598b9484cSchristos   int mask_framesize;
118698b9484cSchristos   int bits_R;
118798b9484cSchristos   int mask_R;
118898b9484cSchristos   int bits_code;
118998b9484cSchristos   int mask_code;
119098b9484cSchristos } Linkage;
119198b9484cSchristos 
119298b9484cSchristos #define Linkage_opcode		0xe8000000
119398b9484cSchristos #define Linkage_framesize_bits	0
119498b9484cSchristos #define Linkage_framesize_mask	0xffff
119598b9484cSchristos #define Linkage_R_bits		16
119698b9484cSchristos #define Linkage_R_mask		0x1
119798b9484cSchristos #define Linkage_code_bits	17
119898b9484cSchristos #define Linkage_code_mask	0x7fff
119998b9484cSchristos 
120098b9484cSchristos #define init_Linkage					\
120198b9484cSchristos {							\
120298b9484cSchristos   Linkage_opcode,					\
120398b9484cSchristos   Linkage_framesize_bits,	Linkage_framesize_mask,	\
120498b9484cSchristos   Linkage_R_bits,		Linkage_R_mask,		\
120598b9484cSchristos   Linkage_code_bits,		Linkage_code_mask	\
120698b9484cSchristos };
120798b9484cSchristos 
120898b9484cSchristos /*  LoopSetup
120998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
121098b9484cSchristos | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
121198b9484cSchristos |.reg...........| - | - |.eoffset...............................|
121298b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
121398b9484cSchristos */
121498b9484cSchristos 
121598b9484cSchristos typedef struct
121698b9484cSchristos {
121798b9484cSchristos   unsigned long opcode;
121898b9484cSchristos   int bits_eoffset;
121998b9484cSchristos   int mask_eoffset;
122098b9484cSchristos   int bits_dontcare;
122198b9484cSchristos   int mask_dontcare;
122298b9484cSchristos   int bits_reg;
122398b9484cSchristos   int mask_reg;
122498b9484cSchristos   int bits_soffset;
122598b9484cSchristos   int mask_soffset;
122698b9484cSchristos   int bits_c;
122798b9484cSchristos   int mask_c;
122898b9484cSchristos   int bits_rop;
122998b9484cSchristos   int mask_rop;
123098b9484cSchristos   int bits_code;
123198b9484cSchristos   int mask_code;
123298b9484cSchristos } LoopSetup;
123398b9484cSchristos 
123498b9484cSchristos #define LoopSetup_opcode		0xe0800000
123598b9484cSchristos #define LoopSetup_eoffset_bits		0
123698b9484cSchristos #define LoopSetup_eoffset_mask		0x3ff
123798b9484cSchristos #define LoopSetup_dontcare_bits		10
123898b9484cSchristos #define LoopSetup_dontcare_mask		0x3
123998b9484cSchristos #define LoopSetup_reg_bits		12
124098b9484cSchristos #define LoopSetup_reg_mask		0xf
124198b9484cSchristos #define LoopSetup_soffset_bits		16
124298b9484cSchristos #define LoopSetup_soffset_mask		0xf
124398b9484cSchristos #define LoopSetup_c_bits		20
124498b9484cSchristos #define LoopSetup_c_mask		0x1
124598b9484cSchristos #define LoopSetup_rop_bits		21
124698b9484cSchristos #define LoopSetup_rop_mask		0x3
124798b9484cSchristos #define LoopSetup_code_bits		23
124898b9484cSchristos #define LoopSetup_code_mask		0x1ff
124998b9484cSchristos 
125098b9484cSchristos #define init_LoopSetup						\
125198b9484cSchristos {								\
125298b9484cSchristos   LoopSetup_opcode,						\
125398b9484cSchristos   LoopSetup_eoffset_bits,	LoopSetup_eoffset_mask,		\
125498b9484cSchristos   LoopSetup_dontcare_bits,	LoopSetup_dontcare_mask,	\
125598b9484cSchristos   LoopSetup_reg_bits,		LoopSetup_reg_mask,		\
125698b9484cSchristos   LoopSetup_soffset_bits,	LoopSetup_soffset_mask,		\
125798b9484cSchristos   LoopSetup_c_bits,		LoopSetup_c_mask,		\
125898b9484cSchristos   LoopSetup_rop_bits,		LoopSetup_rop_mask,		\
125998b9484cSchristos   LoopSetup_code_bits,		LoopSetup_code_mask		\
126098b9484cSchristos };
126198b9484cSchristos 
126298b9484cSchristos /*  LDIMMhalf
126398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
126498b9484cSchristos | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
126598b9484cSchristos |.hword.........................................................|
126698b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
126798b9484cSchristos */
126898b9484cSchristos 
126998b9484cSchristos typedef struct
127098b9484cSchristos {
127198b9484cSchristos   unsigned long opcode;
127298b9484cSchristos   int bits_hword;
127398b9484cSchristos   int mask_hword;
127498b9484cSchristos   int bits_reg;
127598b9484cSchristos   int mask_reg;
127698b9484cSchristos   int bits_grp;
127798b9484cSchristos   int mask_grp;
127898b9484cSchristos   int bits_S;
127998b9484cSchristos   int mask_S;
128098b9484cSchristos   int bits_H;
128198b9484cSchristos   int mask_H;
128298b9484cSchristos   int bits_Z;
128398b9484cSchristos   int mask_Z;
128498b9484cSchristos   int bits_code;
128598b9484cSchristos   int mask_code;
128698b9484cSchristos } LDIMMhalf;
128798b9484cSchristos 
128898b9484cSchristos #define LDIMMhalf_opcode	0xe1000000
128998b9484cSchristos #define LDIMMhalf_hword_bits	0
129098b9484cSchristos #define LDIMMhalf_hword_mask	0xffff
129198b9484cSchristos #define LDIMMhalf_reg_bits	16
129298b9484cSchristos #define LDIMMhalf_reg_mask	0x7
129398b9484cSchristos #define LDIMMhalf_grp_bits	19
129498b9484cSchristos #define LDIMMhalf_grp_mask	0x3
129598b9484cSchristos #define LDIMMhalf_S_bits	21
129698b9484cSchristos #define LDIMMhalf_S_mask	0x1
129798b9484cSchristos #define LDIMMhalf_H_bits	22
129898b9484cSchristos #define LDIMMhalf_H_mask	0x1
129998b9484cSchristos #define LDIMMhalf_Z_bits	23
130098b9484cSchristos #define LDIMMhalf_Z_mask	0x1
130198b9484cSchristos #define LDIMMhalf_code_bits	24
130298b9484cSchristos #define LDIMMhalf_code_mask	0xff
130398b9484cSchristos 
130498b9484cSchristos #define init_LDIMMhalf				\
130598b9484cSchristos {						\
130698b9484cSchristos   LDIMMhalf_opcode,				\
130798b9484cSchristos   LDIMMhalf_hword_bits,	LDIMMhalf_hword_mask,	\
130898b9484cSchristos   LDIMMhalf_reg_bits,	LDIMMhalf_reg_mask,	\
130998b9484cSchristos   LDIMMhalf_grp_bits,	LDIMMhalf_grp_mask,	\
131098b9484cSchristos   LDIMMhalf_S_bits,	LDIMMhalf_S_mask,	\
131198b9484cSchristos   LDIMMhalf_H_bits,	LDIMMhalf_H_mask,	\
131298b9484cSchristos   LDIMMhalf_Z_bits,	LDIMMhalf_Z_mask,	\
131398b9484cSchristos   LDIMMhalf_code_bits,	LDIMMhalf_code_mask	\
131498b9484cSchristos };
131598b9484cSchristos 
131698b9484cSchristos 
131798b9484cSchristos /*  CC2dreg
131898b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
131998b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
132098b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
132198b9484cSchristos */
132298b9484cSchristos 
132398b9484cSchristos typedef struct
132498b9484cSchristos {
132598b9484cSchristos   unsigned short opcode;
132698b9484cSchristos   int bits_reg;
132798b9484cSchristos   int mask_reg;
132898b9484cSchristos   int bits_op;
132998b9484cSchristos   int mask_op;
133098b9484cSchristos   int bits_code;
133198b9484cSchristos   int mask_code;
133298b9484cSchristos } CC2dreg;
133398b9484cSchristos 
133498b9484cSchristos #define CC2dreg_opcode		0x0200
133598b9484cSchristos #define CC2dreg_reg_bits	0
133698b9484cSchristos #define CC2dreg_reg_mask	0x7
133798b9484cSchristos #define CC2dreg_op_bits		3
133898b9484cSchristos #define CC2dreg_op_mask		0x3
133998b9484cSchristos #define CC2dreg_code_bits	5
134098b9484cSchristos #define CC2dreg_code_mask	0x7fff
134198b9484cSchristos 
134298b9484cSchristos #define init_CC2dreg				\
134398b9484cSchristos {						\
134498b9484cSchristos   CC2dreg_opcode,				\
134598b9484cSchristos   CC2dreg_reg_bits,	CC2dreg_reg_mask,	\
134698b9484cSchristos   CC2dreg_op_bits,	CC2dreg_op_mask,	\
134798b9484cSchristos   CC2dreg_code_bits,	CC2dreg_code_mask	\
134898b9484cSchristos };
134998b9484cSchristos 
135098b9484cSchristos 
135198b9484cSchristos /*  PTR2op
135298b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
135398b9484cSchristos | 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
135498b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
135598b9484cSchristos */
135698b9484cSchristos 
135798b9484cSchristos typedef struct
135898b9484cSchristos {
135998b9484cSchristos   unsigned short opcode;
136098b9484cSchristos   int bits_dst;
136198b9484cSchristos   int mask_dst;
136298b9484cSchristos   int bits_src;
136398b9484cSchristos   int mask_src;
136498b9484cSchristos   int bits_opc;
136598b9484cSchristos   int mask_opc;
136698b9484cSchristos   int bits_code;
136798b9484cSchristos   int mask_code;
136898b9484cSchristos } PTR2op;
136998b9484cSchristos 
137098b9484cSchristos #define PTR2op_opcode		0x4400
137198b9484cSchristos #define PTR2op_dst_bits		0
137298b9484cSchristos #define PTR2op_dst_mask		0x7
137398b9484cSchristos #define PTR2op_src_bits		3
137498b9484cSchristos #define PTR2op_src_mask		0x7
137598b9484cSchristos #define PTR2op_opc_bits		6
137698b9484cSchristos #define PTR2op_opc_mask		0x7
137798b9484cSchristos #define PTR2op_code_bits	9
137898b9484cSchristos #define PTR2op_code_mask	0x7f
137998b9484cSchristos 
138098b9484cSchristos #define init_PTR2op				\
138198b9484cSchristos {						\
138298b9484cSchristos   PTR2op_opcode,				\
138398b9484cSchristos   PTR2op_dst_bits,	PTR2op_dst_mask,	\
138498b9484cSchristos   PTR2op_src_bits,	PTR2op_src_mask,	\
138598b9484cSchristos   PTR2op_opc_bits,	PTR2op_opc_mask,	\
138698b9484cSchristos   PTR2op_code_bits,	PTR2op_code_mask	\
138798b9484cSchristos };
138898b9484cSchristos 
138998b9484cSchristos 
139098b9484cSchristos /*  COMP3op
139198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
139298b9484cSchristos | 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
139398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
139498b9484cSchristos */
139598b9484cSchristos 
139698b9484cSchristos typedef struct
139798b9484cSchristos {
139898b9484cSchristos   unsigned short opcode;
139998b9484cSchristos   int bits_src0;
140098b9484cSchristos   int mask_src0;
140198b9484cSchristos   int bits_src1;
140298b9484cSchristos   int mask_src1;
140398b9484cSchristos   int bits_dst;
140498b9484cSchristos   int mask_dst;
140598b9484cSchristos   int bits_opc;
140698b9484cSchristos   int mask_opc;
140798b9484cSchristos   int bits_code;
140898b9484cSchristos   int mask_code;
140998b9484cSchristos } COMP3op;
141098b9484cSchristos 
141198b9484cSchristos #define COMP3op_opcode		0x5000
141298b9484cSchristos #define COMP3op_src0_bits	0
141398b9484cSchristos #define COMP3op_src0_mask	0x7
141498b9484cSchristos #define COMP3op_src1_bits	3
141598b9484cSchristos #define COMP3op_src1_mask	0x7
141698b9484cSchristos #define COMP3op_dst_bits	6
141798b9484cSchristos #define COMP3op_dst_mask	0x7
141898b9484cSchristos #define COMP3op_opc_bits	9
141998b9484cSchristos #define COMP3op_opc_mask	0x7
142098b9484cSchristos #define COMP3op_code_bits	12
142198b9484cSchristos #define COMP3op_code_mask	0xf
142298b9484cSchristos 
142398b9484cSchristos #define init_COMP3op				\
142498b9484cSchristos {						\
142598b9484cSchristos   COMP3op_opcode,				\
142698b9484cSchristos   COMP3op_src0_bits,	COMP3op_src0_mask,	\
142798b9484cSchristos   COMP3op_src1_bits,	COMP3op_src1_mask,	\
142898b9484cSchristos   COMP3op_dst_bits,	COMP3op_dst_mask,	\
142998b9484cSchristos   COMP3op_opc_bits,	COMP3op_opc_mask,	\
143098b9484cSchristos   COMP3op_code_bits,	COMP3op_code_mask	\
143198b9484cSchristos };
143298b9484cSchristos 
143398b9484cSchristos /*  ccMV
143498b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
143598b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
143698b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
143798b9484cSchristos */
143898b9484cSchristos 
143998b9484cSchristos typedef struct
144098b9484cSchristos {
144198b9484cSchristos   unsigned short opcode;
144298b9484cSchristos   int bits_src;
144398b9484cSchristos   int mask_src;
144498b9484cSchristos   int bits_dst;
144598b9484cSchristos   int mask_dst;
144698b9484cSchristos   int bits_s;
144798b9484cSchristos   int mask_s;
144898b9484cSchristos   int bits_d;
144998b9484cSchristos   int mask_d;
145098b9484cSchristos   int bits_T;
145198b9484cSchristos   int mask_T;
145298b9484cSchristos   int bits_code;
145398b9484cSchristos   int mask_code;
145498b9484cSchristos } CCmv;
145598b9484cSchristos 
145698b9484cSchristos #define CCmv_opcode	0x0600
145798b9484cSchristos #define CCmv_src_bits	0
145898b9484cSchristos #define CCmv_src_mask	0x7
145998b9484cSchristos #define CCmv_dst_bits	3
146098b9484cSchristos #define CCmv_dst_mask	0x7
146198b9484cSchristos #define CCmv_s_bits	6
146298b9484cSchristos #define CCmv_s_mask	0x1
146398b9484cSchristos #define CCmv_d_bits	7
146498b9484cSchristos #define CCmv_d_mask	0x1
146598b9484cSchristos #define CCmv_T_bits	8
146698b9484cSchristos #define CCmv_T_mask	0x1
146798b9484cSchristos #define CCmv_code_bits	9
146898b9484cSchristos #define CCmv_code_mask	0x7f
146998b9484cSchristos 
147098b9484cSchristos #define init_CCmv			\
147198b9484cSchristos {					\
147298b9484cSchristos   CCmv_opcode,				\
147398b9484cSchristos   CCmv_src_bits,	CCmv_src_mask,	\
147498b9484cSchristos   CCmv_dst_bits,	CCmv_dst_mask,	\
147598b9484cSchristos   CCmv_s_bits,		CCmv_s_mask,	\
147698b9484cSchristos   CCmv_d_bits,		CCmv_d_mask,	\
147798b9484cSchristos   CCmv_T_bits,		CCmv_T_mask,	\
147898b9484cSchristos   CCmv_code_bits,	CCmv_code_mask	\
147998b9484cSchristos };
148098b9484cSchristos 
148198b9484cSchristos 
148298b9484cSchristos /*  CCflag
148398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
148498b9484cSchristos | 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
148598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
148698b9484cSchristos */
148798b9484cSchristos 
148898b9484cSchristos typedef struct
148998b9484cSchristos {
149098b9484cSchristos   unsigned short opcode;
149198b9484cSchristos   int bits_x;
149298b9484cSchristos   int mask_x;
149398b9484cSchristos   int bits_y;
149498b9484cSchristos   int mask_y;
149598b9484cSchristos   int bits_G;
149698b9484cSchristos   int mask_G;
149798b9484cSchristos   int bits_opc;
149898b9484cSchristos   int mask_opc;
149998b9484cSchristos   int bits_I;
150098b9484cSchristos   int mask_I;
150198b9484cSchristos   int bits_code;
150298b9484cSchristos   int mask_code;
150398b9484cSchristos } CCflag;
150498b9484cSchristos 
150598b9484cSchristos #define CCflag_opcode		0x0800
150698b9484cSchristos #define CCflag_x_bits		0
150798b9484cSchristos #define CCflag_x_mask		0x7
150898b9484cSchristos #define CCflag_y_bits		3
150998b9484cSchristos #define CCflag_y_mask		0x7
151098b9484cSchristos #define CCflag_G_bits		6
151198b9484cSchristos #define CCflag_G_mask		0x1
151298b9484cSchristos #define CCflag_opc_bits		7
151398b9484cSchristos #define CCflag_opc_mask		0x7
151498b9484cSchristos #define CCflag_I_bits		10
151598b9484cSchristos #define CCflag_I_mask		0x1
151698b9484cSchristos #define CCflag_code_bits	11
151798b9484cSchristos #define CCflag_code_mask	0x1f
151898b9484cSchristos 
151998b9484cSchristos #define init_CCflag				\
152098b9484cSchristos {						\
152198b9484cSchristos   CCflag_opcode,				\
152298b9484cSchristos   CCflag_x_bits,	CCflag_x_mask,		\
152398b9484cSchristos   CCflag_y_bits,	CCflag_y_mask,		\
152498b9484cSchristos   CCflag_G_bits,	CCflag_G_mask,		\
152598b9484cSchristos   CCflag_opc_bits,	CCflag_opc_mask,	\
152698b9484cSchristos   CCflag_I_bits,	CCflag_I_mask,		\
152798b9484cSchristos   CCflag_code_bits,	CCflag_code_mask,	\
152898b9484cSchristos };
152998b9484cSchristos 
153098b9484cSchristos 
153198b9484cSchristos /*  CC2stat
153298b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
153398b9484cSchristos | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
153498b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
153598b9484cSchristos */
153698b9484cSchristos 
153798b9484cSchristos typedef struct
153898b9484cSchristos {
153998b9484cSchristos   unsigned short opcode;
154098b9484cSchristos   int bits_cbit;
154198b9484cSchristos   int mask_cbit;
154298b9484cSchristos   int bits_op;
154398b9484cSchristos   int mask_op;
154498b9484cSchristos   int bits_D;
154598b9484cSchristos   int mask_D;
154698b9484cSchristos   int bits_code;
154798b9484cSchristos   int mask_code;
154898b9484cSchristos } CC2stat;
154998b9484cSchristos 
155098b9484cSchristos #define CC2stat_opcode		0x0300
155198b9484cSchristos #define CC2stat_cbit_bits	0
155298b9484cSchristos #define CC2stat_cbit_mask	0x1f
155398b9484cSchristos #define CC2stat_op_bits		5
155498b9484cSchristos #define CC2stat_op_mask		0x3
155598b9484cSchristos #define CC2stat_D_bits		7
155698b9484cSchristos #define CC2stat_D_mask		0x1
155798b9484cSchristos #define CC2stat_code_bits	8
155898b9484cSchristos #define CC2stat_code_mask	0xff
155998b9484cSchristos 
156098b9484cSchristos #define init_CC2stat				\
156198b9484cSchristos {						\
156298b9484cSchristos   CC2stat_opcode,				\
156398b9484cSchristos   CC2stat_cbit_bits,	CC2stat_cbit_mask,	\
156498b9484cSchristos   CC2stat_op_bits,	CC2stat_op_mask,	\
156598b9484cSchristos   CC2stat_D_bits,	CC2stat_D_mask,		\
156698b9484cSchristos   CC2stat_code_bits,	CC2stat_code_mask	\
156798b9484cSchristos };
156898b9484cSchristos 
156998b9484cSchristos 
157098b9484cSchristos /*  REGMV
157198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
157298b9484cSchristos | 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
157398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
157498b9484cSchristos */
157598b9484cSchristos 
157698b9484cSchristos typedef struct
157798b9484cSchristos {
157898b9484cSchristos   unsigned short opcode;
157998b9484cSchristos   int bits_src;
158098b9484cSchristos   int mask_src;
158198b9484cSchristos   int bits_dst;
158298b9484cSchristos   int mask_dst;
158398b9484cSchristos   int bits_gs;
158498b9484cSchristos   int mask_gs;
158598b9484cSchristos   int bits_gd;
158698b9484cSchristos   int mask_gd;
158798b9484cSchristos   int bits_code;
158898b9484cSchristos   int mask_code;
158998b9484cSchristos } RegMv;
159098b9484cSchristos 
159198b9484cSchristos #define RegMv_opcode		0x3000
159298b9484cSchristos #define RegMv_src_bits		0
159398b9484cSchristos #define RegMv_src_mask		0x7
159498b9484cSchristos #define RegMv_dst_bits		3
159598b9484cSchristos #define RegMv_dst_mask		0x7
159698b9484cSchristos #define RegMv_gs_bits		6
159798b9484cSchristos #define RegMv_gs_mask		0x7
159898b9484cSchristos #define RegMv_gd_bits		9
159998b9484cSchristos #define RegMv_gd_mask		0x7
160098b9484cSchristos #define RegMv_code_bits		12
160198b9484cSchristos #define RegMv_code_mask		0xf
160298b9484cSchristos 
160398b9484cSchristos #define init_RegMv			\
160498b9484cSchristos {					\
160598b9484cSchristos   RegMv_opcode,				\
160698b9484cSchristos   RegMv_src_bits,	RegMv_src_mask,	\
160798b9484cSchristos   RegMv_dst_bits,	RegMv_dst_mask,	\
160898b9484cSchristos   RegMv_gs_bits,	RegMv_gs_mask,	\
160998b9484cSchristos   RegMv_gd_bits,	RegMv_gd_mask,	\
161098b9484cSchristos   RegMv_code_bits,	RegMv_code_mask	\
161198b9484cSchristos };
161298b9484cSchristos 
161398b9484cSchristos 
161498b9484cSchristos /*  COMPI2opD
161598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
161698b9484cSchristos | 0 | 1 | 1 | 0 | 0 |.op|.isrc......................|.dst.......|
161798b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
161898b9484cSchristos */
161998b9484cSchristos 
162098b9484cSchristos typedef struct
162198b9484cSchristos {
162298b9484cSchristos   unsigned short opcode;
162398b9484cSchristos   int bits_dst;
162498b9484cSchristos   int mask_dst;
162598b9484cSchristos   int bits_src;
162698b9484cSchristos   int mask_src;
162798b9484cSchristos   int bits_op;
162898b9484cSchristos   int mask_op;
162998b9484cSchristos   int bits_code;
163098b9484cSchristos   int mask_code;
163198b9484cSchristos } COMPI2opD;
163298b9484cSchristos 
163398b9484cSchristos #define COMPI2opD_opcode	0x6000
163498b9484cSchristos #define COMPI2opD_dst_bits	0
163598b9484cSchristos #define COMPI2opD_dst_mask	0x7
163698b9484cSchristos #define COMPI2opD_src_bits	3
163798b9484cSchristos #define COMPI2opD_src_mask	0x7f
163898b9484cSchristos #define COMPI2opD_op_bits	10
163998b9484cSchristos #define COMPI2opD_op_mask	0x1
164098b9484cSchristos #define COMPI2opD_code_bits	11
164198b9484cSchristos #define COMPI2opD_code_mask	0x1f
164298b9484cSchristos 
164398b9484cSchristos #define init_COMPI2opD				\
164498b9484cSchristos {						\
164598b9484cSchristos   COMPI2opD_opcode,				\
164698b9484cSchristos   COMPI2opD_dst_bits,	COMPI2opD_dst_mask,	\
164798b9484cSchristos   COMPI2opD_src_bits,	COMPI2opD_src_mask,	\
164898b9484cSchristos   COMPI2opD_op_bits,	COMPI2opD_op_mask,	\
164998b9484cSchristos   COMPI2opD_code_bits,	COMPI2opD_code_mask	\
165098b9484cSchristos };
165198b9484cSchristos 
165298b9484cSchristos /*  COMPI2opP
165398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
165498b9484cSchristos | 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
165598b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
165698b9484cSchristos */
165798b9484cSchristos 
165898b9484cSchristos typedef COMPI2opD COMPI2opP;
165998b9484cSchristos 
166098b9484cSchristos #define COMPI2opP_opcode 	0x6800
166198b9484cSchristos #define COMPI2opP_dst_bits	0
166298b9484cSchristos #define COMPI2opP_dst_mask	0x7
166398b9484cSchristos #define COMPI2opP_src_bits	3
166498b9484cSchristos #define COMPI2opP_src_mask	0x7f
166598b9484cSchristos #define COMPI2opP_op_bits	10
166698b9484cSchristos #define COMPI2opP_op_mask	0x1
166798b9484cSchristos #define COMPI2opP_code_bits	11
166898b9484cSchristos #define COMPI2opP_code_mask	0x1f
166998b9484cSchristos 
167098b9484cSchristos #define init_COMPI2opP				\
167198b9484cSchristos {						\
167298b9484cSchristos   COMPI2opP_opcode,				\
167398b9484cSchristos   COMPI2opP_dst_bits,	COMPI2opP_dst_mask,	\
167498b9484cSchristos   COMPI2opP_src_bits,	COMPI2opP_src_mask,	\
167598b9484cSchristos   COMPI2opP_op_bits,	COMPI2opP_op_mask,	\
167698b9484cSchristos   COMPI2opP_code_bits,	COMPI2opP_code_mask	\
167798b9484cSchristos };
167898b9484cSchristos 
167998b9484cSchristos 
168098b9484cSchristos /*  dagMODim
168198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
168298b9484cSchristos | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
168398b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
168498b9484cSchristos */
168598b9484cSchristos 
168698b9484cSchristos typedef struct
168798b9484cSchristos {
168898b9484cSchristos   unsigned short opcode;
168998b9484cSchristos   int bits_i;
169098b9484cSchristos   int mask_i;
169198b9484cSchristos   int bits_m;
169298b9484cSchristos   int mask_m;
169398b9484cSchristos   int bits_op;
169498b9484cSchristos   int mask_op;
169598b9484cSchristos   int bits_code2;
169698b9484cSchristos   int mask_code2;
169798b9484cSchristos   int bits_br;
169898b9484cSchristos   int mask_br;
169998b9484cSchristos   int bits_code;
170098b9484cSchristos   int mask_code;
170198b9484cSchristos } DagMODim;
170298b9484cSchristos 
170398b9484cSchristos #define DagMODim_opcode		0x9e60
170498b9484cSchristos #define DagMODim_i_bits		0
170598b9484cSchristos #define DagMODim_i_mask		0x3
170698b9484cSchristos #define DagMODim_m_bits		2
170798b9484cSchristos #define DagMODim_m_mask		0x3
170898b9484cSchristos #define DagMODim_op_bits	4
170998b9484cSchristos #define DagMODim_op_mask	0x1
171098b9484cSchristos #define DagMODim_code2_bits	5
171198b9484cSchristos #define DagMODim_code2_mask	0x3
171298b9484cSchristos #define DagMODim_br_bits	7
171398b9484cSchristos #define DagMODim_br_mask	0x1
171498b9484cSchristos #define DagMODim_code_bits	8
171598b9484cSchristos #define DagMODim_code_mask	0xff
171698b9484cSchristos 
171798b9484cSchristos #define init_DagMODim				\
171898b9484cSchristos {						\
171998b9484cSchristos   DagMODim_opcode,				\
172098b9484cSchristos   DagMODim_i_bits,	DagMODim_i_mask,	\
172198b9484cSchristos   DagMODim_m_bits,	DagMODim_m_mask,	\
172298b9484cSchristos   DagMODim_op_bits,	DagMODim_op_mask,	\
172398b9484cSchristos   DagMODim_code2_bits,	DagMODim_code2_mask,	\
172498b9484cSchristos   DagMODim_br_bits,	DagMODim_br_mask,	\
172598b9484cSchristos   DagMODim_code_bits,	DagMODim_code_mask	\
172698b9484cSchristos };
172798b9484cSchristos 
172898b9484cSchristos /*  dagMODik
172998b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
173098b9484cSchristos | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
173198b9484cSchristos +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
173298b9484cSchristos */
173398b9484cSchristos 
173498b9484cSchristos typedef struct
173598b9484cSchristos {
173698b9484cSchristos   unsigned short opcode;
173798b9484cSchristos   int bits_i;
173898b9484cSchristos   int mask_i;
173998b9484cSchristos   int bits_op;
174098b9484cSchristos   int mask_op;
174198b9484cSchristos   int bits_code;
174298b9484cSchristos   int mask_code;
174398b9484cSchristos } DagMODik;
174498b9484cSchristos 
174598b9484cSchristos #define DagMODik_opcode		0x9f60
174698b9484cSchristos #define DagMODik_i_bits		0
174798b9484cSchristos #define DagMODik_i_mask		0x3
174898b9484cSchristos #define DagMODik_op_bits	2
174998b9484cSchristos #define DagMODik_op_mask	0x3
175098b9484cSchristos #define DagMODik_code_bits	3
175198b9484cSchristos #define DagMODik_code_mask	0xfff
175298b9484cSchristos 
175398b9484cSchristos #define init_DagMODik				\
175498b9484cSchristos {						\
175598b9484cSchristos   DagMODik_opcode,				\
175698b9484cSchristos   DagMODik_i_bits,	DagMODik_i_mask,	\
175798b9484cSchristos   DagMODik_op_bits,	DagMODik_op_mask,	\
175898b9484cSchristos   DagMODik_code_bits,	DagMODik_code_mask	\
175998b9484cSchristos };
176098b9484cSchristos 
176198b9484cSchristos #endif
1762