1/*
2 *  Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
3 *
4 *  This program is free software; you can redistribute it and/or modify
5 *  it under the terms of the GNU General Public License as published by
6 *  the Free Software Foundation; either version 2 of the License, or
7 *  (at your option) any later version.
8 *
9 *  This program is distributed in the hope that it will be useful,
10 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *  GNU General Public License for more details.
13 *
14 *  You should have received a copy of the GNU General Public License
15 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Encodings for 32 bit instructions
20 *
21 */
22
23
24
25
26DEF_CLASS32("---- ---- -------- PP------ --------",ALL_PP)
27DEF_FIELD32("---- ---- -------- !!------ --------",Parse,"Packet/Loop parse bits")
28DEF_FIELD32("!!!! ---- -------- PP------ --------",ICLASS,"Instruction Class")
29
30#define ICLASS_EXTENDER   "0000"
31#define ICLASS_CJ         "0001"
32#define ICLASS_NCJ        "0010"
33#define ICLASS_V4LDST     "0011"
34#define ICLASS_V2LDST     "0100"
35#define ICLASS_J          "0101"
36#define ICLASS_CR         "0110"
37#define ICLASS_ALU2op     "0111"
38#define ICLASS_S2op       "1000"
39#define ICLASS_LD         "1001"
40#define ICLASS_ST         "1010"
41#define ICLASS_ADDI       "1011"
42#define ICLASS_S3op       "1100"
43#define ICLASS_ALU64      "1101"
44#define ICLASS_M          "1110"
45#define ICLASS_ALU3op     "1111"
46
47
48
49/*******************************/
50/*                             */
51/*                             */
52/*     V4 Immediate Payload    */
53/*                             */
54/*                             */
55/*******************************/
56
57DEF_CLASS32(ICLASS_EXTENDER" ---- -------- PP------ --------",EXTENDER)
58DEF_ENC32(A4_ext, ICLASS_EXTENDER "iiii iiiiiiii PPiiiiii iiiiiiii")
59
60
61
62/*******************************/
63/*                             */
64/*                             */
65/*     V2 PREDICATED LD/ST     */
66/*                             */
67/*                             */
68/*******************************/
69
70DEF_CLASS32(ICLASS_V2LDST" ---- -------- PP------ --------",V2LDST)
71DEF_CLASS32(ICLASS_V2LDST" ---1 -------- PP------ --------",V2LD)
72DEF_CLASS32(ICLASS_V2LDST" ---0 -------- PP------ --------",V2ST)
73DEF_CLASS32(ICLASS_V2LDST" 0--1 -------- PP------ --------",PLD)
74DEF_CLASS32(ICLASS_V2LDST" 0--0 -------- PP------ --------",PST)
75DEF_CLASS32(ICLASS_V2LDST" 1--1 -------- PP------ --------",GPLD)
76DEF_CLASS32(ICLASS_V2LDST" 1--0 -------- PP------ --------",GPST)
77
78DEF_FIELD32(ICLASS_V2LDST" 0!-- -------- PP------ --------",PMEM_Sense,"Sense")
79DEF_FIELD32(ICLASS_V2LDST" 0-!- -------- PP------ --------",PMEM_PredNew,"PredNew")
80DEF_FIELD32(ICLASS_V2LDST" ---1 !!------ PP------ --------",PMEML_Type,"Type")
81DEF_FIELD32(ICLASS_V2LDST" ---1 --!----- PP------ --------",PMEML_UN,"Unsigned")
82DEF_FIELD32(ICLASS_V2LDST" ---0 !!!----- PP------ --------",PMEMS_Type,"Type")
83
84#define STD_PLD_IOENC(TAG,OPC) \
85DEF_ENC32(L2_pload##TAG##t_io,   ICLASS_V2LDST" 0001 "OPC"  sssss  PP0ttiii  iiiddddd")\
86DEF_ENC32(L2_pload##TAG##f_io,   ICLASS_V2LDST" 0101 "OPC"  sssss  PP0ttiii  iiiddddd")\
87DEF_ENC32(L2_pload##TAG##tnew_io,ICLASS_V2LDST" 0011 "OPC"  sssss  PP0ttiii  iiiddddd")\
88DEF_ENC32(L2_pload##TAG##fnew_io,ICLASS_V2LDST" 0111 "OPC"  sssss  PP0ttiii  iiiddddd")
89
90STD_PLD_IOENC(rb,  "000")
91STD_PLD_IOENC(rub, "001")
92STD_PLD_IOENC(rh,  "010")
93STD_PLD_IOENC(ruh, "011")
94STD_PLD_IOENC(ri,  "100")
95STD_PLD_IOENC(rd,  "110") /* note dest reg field LSB=0, 1 is reserved */
96
97
98
99#define STD_PST_IOENC(TAG,OPC,SRC) \
100DEF_ENC32(S2_pstore##TAG##t_io,   ICLASS_V2LDST" 0000 "OPC"  sssss  PPi"SRC"  iiiii0vv")\
101DEF_ENC32(S2_pstore##TAG##f_io,   ICLASS_V2LDST" 0100 "OPC"  sssss  PPi"SRC"  iiiii0vv")\
102DEF_ENC32(S4_pstore##TAG##tnew_io,ICLASS_V2LDST" 0010 "OPC"  sssss  PPi"SRC"  iiiii0vv")\
103DEF_ENC32(S4_pstore##TAG##fnew_io,ICLASS_V2LDST" 0110 "OPC"  sssss  PPi"SRC"  iiiii0vv")
104
105STD_PST_IOENC(rb,    "000","ttttt")
106STD_PST_IOENC(rh,    "010","ttttt")
107STD_PST_IOENC(rf,    "011","ttttt")
108STD_PST_IOENC(ri,    "100","ttttt")
109STD_PST_IOENC(rd,    "110","ttttt")
110STD_PST_IOENC(rbnew, "101","00ttt")
111STD_PST_IOENC(rhnew, "101","01ttt")
112STD_PST_IOENC(rinew, "101","10ttt")
113
114
115
116
117
118/*******************************/
119/*                             */
120/*                             */
121/*     V2 GP-RELATIVE LD/ST    */
122/*                             */
123/*                             */
124/*******************************/
125#define STD_LD_GP(TAG,OPC) \
126DEF_ENC32(L2_load##TAG##gp,   ICLASS_V2LDST" 1ii1 "OPC"  iiiii  PPiiiiii  iiiddddd")
127
128STD_LD_GP(rb,  "000")
129STD_LD_GP(rub, "001")
130STD_LD_GP(rh,  "010")
131STD_LD_GP(ruh, "011")
132STD_LD_GP(ri,  "100")
133STD_LD_GP(rd,  "110") /* note dest reg field LSB=0, 1 is reserved */
134
135#define STD_ST_GP(TAG,OPC,SRC) \
136DEF_ENC32(S2_store##TAG##gp,  ICLASS_V2LDST" 1ii0 "OPC"  iiiii  PPi"SRC"  iiiiiiii")
137
138STD_ST_GP(rb,   "000","ttttt")
139STD_ST_GP(rh,   "010","ttttt")
140STD_ST_GP(rf,   "011","ttttt")
141STD_ST_GP(ri,   "100","ttttt")
142STD_ST_GP(rd,   "110","ttttt")
143STD_ST_GP(rbnew,"101","00ttt")
144STD_ST_GP(rhnew,"101","01ttt")
145STD_ST_GP(rinew,"101","10ttt")
146
147
148
149
150
151/*******************************/
152/*                             */
153/*                             */
154/*     V4LDST                  */
155/*                             */
156/*                             */
157/*******************************/
158
159
160DEF_CLASS32(ICLASS_V4LDST" ---- -------- PP------ --------",V4LDST)
161DEF_CLASS32(ICLASS_V4LDST" 0--- -------- PP------ --------",Pred_RplusR)
162DEF_CLASS32(ICLASS_V4LDST" 100- -------- PP------ --------",Pred_StoreImmed)
163DEF_CLASS32(ICLASS_V4LDST" 101- -------- PP------ --------",RplusR)
164DEF_CLASS32(ICLASS_V4LDST" 110- -------- PP------ --------",StoreImmed)
165DEF_CLASS32(ICLASS_V4LDST" 111- -------- PP------ --------",MemOp)
166
167
168
169
170/*******************************/
171/*    Pred (R+R)               */
172/*******************************/
173
174#define STD_PLD_RRENC(TAG,OPC) \
175DEF_ENC32(L4_pload##TAG##t_rr,   ICLASS_V4LDST" 00 00 "OPC"  sssss  PPittttt  ivvddddd")\
176DEF_ENC32(L4_pload##TAG##f_rr,   ICLASS_V4LDST" 00 01 "OPC"  sssss  PPittttt  ivvddddd")\
177DEF_ENC32(L4_pload##TAG##tnew_rr,ICLASS_V4LDST" 00 10 "OPC"  sssss  PPittttt  ivvddddd")\
178DEF_ENC32(L4_pload##TAG##fnew_rr,ICLASS_V4LDST" 00 11 "OPC"  sssss  PPittttt  ivvddddd")
179
180STD_PLD_RRENC(rb,  "000")
181STD_PLD_RRENC(rub, "001")
182STD_PLD_RRENC(rh,  "010")
183STD_PLD_RRENC(ruh, "011")
184STD_PLD_RRENC(ri,  "100")
185STD_PLD_RRENC(rd,  "110")
186
187#define STD_PST_RRENC(TAG,OPC,SRC) \
188DEF_ENC32(S4_pstore##TAG##t_rr,   ICLASS_V4LDST" 01 00 "OPC"  sssss  PPiuuuuu  ivv"SRC)\
189DEF_ENC32(S4_pstore##TAG##f_rr,   ICLASS_V4LDST" 01 01 "OPC"  sssss  PPiuuuuu  ivv"SRC)\
190DEF_ENC32(S4_pstore##TAG##tnew_rr,ICLASS_V4LDST" 01 10 "OPC"  sssss  PPiuuuuu  ivv"SRC)\
191DEF_ENC32(S4_pstore##TAG##fnew_rr,ICLASS_V4LDST" 01 11 "OPC"  sssss  PPiuuuuu  ivv"SRC)
192
193STD_PST_RRENC(rb,    "000","ttttt")
194STD_PST_RRENC(rh,    "010","ttttt")
195STD_PST_RRENC(rf,    "011","ttttt")
196STD_PST_RRENC(ri,    "100","ttttt")
197STD_PST_RRENC(rd,    "110","ttttt")
198STD_PST_RRENC(rbnew, "101","00ttt")
199STD_PST_RRENC(rhnew, "101","01ttt")
200STD_PST_RRENC(rinew, "101","10ttt")
201
202
203
204/*******************************/
205/*     Pred Store immediates   */
206/*******************************/
207
208#define V4_PSTI(TAG,OPC) \
209DEF_ENC32(S4_storei##TAG##t_io,    ICLASS_V4LDST" 100 00  "OPC"  sssss  PPIiiiii  ivvIIIII")\
210DEF_ENC32(S4_storei##TAG##f_io,    ICLASS_V4LDST" 100 01  "OPC"  sssss  PPIiiiii  ivvIIIII")\
211DEF_ENC32(S4_storei##TAG##tnew_io, ICLASS_V4LDST" 100 10  "OPC"  sssss  PPIiiiii  ivvIIIII")\
212DEF_ENC32(S4_storei##TAG##fnew_io, ICLASS_V4LDST" 100 11  "OPC"  sssss  PPIiiiii  ivvIIIII")
213
214V4_PSTI(rb, "00")
215V4_PSTI(rh, "01")
216V4_PSTI(ri, "10")
217
218
219
220/*******************************/
221/*    (R+R)                    */
222/*******************************/
223
224#define STD_LD_RRENC(TAG,OPC) \
225DEF_ENC32(L4_load##TAG##_rr,     ICLASS_V4LDST" 1010 "OPC"  sssss  PPittttt  i--ddddd")
226
227STD_LD_RRENC(rb,  "000")
228STD_LD_RRENC(rub, "001")
229STD_LD_RRENC(rh,  "010")
230STD_LD_RRENC(ruh, "011")
231STD_LD_RRENC(ri,  "100")
232STD_LD_RRENC(rd,  "110")
233
234#define STD_ST_RRENC(TAG,OPC,SRC) \
235DEF_ENC32(S4_store##TAG##_rr,     ICLASS_V4LDST" 1011 "OPC"  sssss  PPiuuuuu  i--"SRC)
236
237STD_ST_RRENC(rb,    "000","ttttt")
238STD_ST_RRENC(rh,    "010","ttttt")
239STD_ST_RRENC(rf,    "011","ttttt")
240STD_ST_RRENC(ri,    "100","ttttt")
241STD_ST_RRENC(rd,    "110","ttttt")
242STD_ST_RRENC(rbnew, "101","00ttt")
243STD_ST_RRENC(rhnew, "101","01ttt")
244STD_ST_RRENC(rinew, "101","10ttt")
245
246
247
248
249/*******************************/
250/*     Store immediates        */
251/*******************************/
252
253#define V4_STI(TAG,OPC) \
254DEF_ENC32(S4_storei##TAG##_io,     ICLASS_V4LDST" 110 -- "OPC"  sssss  PPIiiiii  iIIIIIII")
255
256
257V4_STI(rb, "00")
258V4_STI(rh, "01")
259V4_STI(ri, "10")
260
261
262/*******************************/
263/*     Memops                 */
264/*******************************/
265
266#define MEMOPENC(TAG,OPC) \
267DEF_ENC32(L4_add_##TAG##_io,         ICLASS_V4LDST" 111 0- " OPC "sssss  PP0iiiii  i00ttttt")\
268DEF_ENC32(L4_sub_##TAG##_io,         ICLASS_V4LDST" 111 0- " OPC "sssss  PP0iiiii  i01ttttt")\
269DEF_ENC32(L4_and_##TAG##_io,         ICLASS_V4LDST" 111 0- " OPC "sssss  PP0iiiii  i10ttttt")\
270DEF_ENC32(L4_or_##TAG##_io,          ICLASS_V4LDST" 111 0- " OPC "sssss  PP0iiiii  i11ttttt")\
271\
272DEF_ENC32(L4_iadd_##TAG##_io,        ICLASS_V4LDST" 111 1- " OPC "sssss  PP0iiiii  i00IIIII")\
273DEF_ENC32(L4_isub_##TAG##_io,        ICLASS_V4LDST" 111 1- " OPC "sssss  PP0iiiii  i01IIIII")\
274DEF_ENC32(L4_iand_##TAG##_io,        ICLASS_V4LDST" 111 1- " OPC "sssss  PP0iiiii  i10IIIII")\
275DEF_ENC32(L4_ior_##TAG##_io,         ICLASS_V4LDST" 111 1- " OPC "sssss  PP0iiiii  i11IIIII")
276
277
278
279MEMOPENC(memopw,"10")
280MEMOPENC(memoph,"01")
281MEMOPENC(memopb,"00")
282
283
284
285
286/*******************************/
287/*                             */
288/*                             */
289/*           LOAD              */
290/*                             */
291/*                             */
292/*******************************/
293DEF_CLASS32(ICLASS_LD" ---- -------- PP------ --------",LD)
294
295
296DEF_CLASS32(ICLASS_LD" 0--- -------- PP------ --------",LD_ADDR_ROFFSET)
297DEF_CLASS32(ICLASS_LD" 100- -------- PP----0- --------",LD_ADDR_POST_CIRC_IMMED)
298DEF_CLASS32(ICLASS_LD" 101- -------- PP00---- --------",LD_ADDR_POST_IMMED)
299DEF_CLASS32(ICLASS_LD" 101- -------- PP01---- --------",LD_ADDR_ABS_UPDATE_V4)
300DEF_CLASS32(ICLASS_LD" 101- -------- PP1----- --------",LD_ADDR_POST_IMMED_PRED_V2)
301DEF_CLASS32(ICLASS_LD" 110- -------- PP-0---- 0-------",LD_ADDR_POST_REG)
302DEF_CLASS32(ICLASS_LD" 110- -------- PP-1---- --------",LD_ADDR_ABS_PLUS_REG_V4)
303DEF_CLASS32(ICLASS_LD" 100- -------- PP----1- --------",LD_ADDR_POST_CREG_V2)
304DEF_CLASS32(ICLASS_LD" 111- -------- PP------ 0-------",LD_ADDR_POST_BREV_REG)
305DEF_CLASS32(ICLASS_LD" 111- -------- PP------ 1-------",LD_ADDR_PRED_ABS_V4)
306
307DEF_FIELD32(ICLASS_LD" !!!- -------- PP------ --------",LD_Amode,"Amode")
308DEF_FIELD32(ICLASS_LD" ---! !!------ PP------ --------",LD_Type,"Type")
309DEF_FIELD32(ICLASS_LD" ---- --!----- PP------ --------",LD_UN,"Unsigned")
310
311#define STD_LD_ENC(TAG,OPC) \
312DEF_ENC32(L2_load##TAG##_io,   ICLASS_LD" 0 ii "OPC"  sssss  PPiiiiii  iiiddddd")\
313DEF_ENC32(L2_load##TAG##_pci,  ICLASS_LD" 1 00 "OPC"  xxxxx  PPu0--0i  iiiddddd")\
314DEF_ENC32(L2_load##TAG##_pi,   ICLASS_LD" 1 01 "OPC"  xxxxx  PP00---i  iiiddddd")\
315DEF_ENC32(L4_load##TAG##_ap,   ICLASS_LD" 1 01 "OPC"  eeeee  PP01IIII  -IIddddd")\
316DEF_ENC32(L2_load##TAG##_pr,   ICLASS_LD" 1 10 "OPC"  xxxxx  PPu0----  0--ddddd")\
317DEF_ENC32(L4_load##TAG##_ur,   ICLASS_LD" 1 10 "OPC"  ttttt  PPi1IIII  iIIddddd")\
318DEF_ENC32(L2_load##TAG##_pcr,  ICLASS_LD" 1 00 "OPC"  xxxxx  PPu0--1-  0--ddddd")\
319DEF_ENC32(L2_load##TAG##_pbr,  ICLASS_LD" 1 11 "OPC"  xxxxx  PPu0----  0--ddddd")
320
321
322#define STD_LDX_ENC(TAG,OPC) \
323DEF_ENC32(L2_load##TAG##_io,   ICLASS_LD" 0 ii "OPC"  sssss  PPiiiiii  iiiyyyyy")\
324DEF_ENC32(L2_load##TAG##_pci,  ICLASS_LD" 1 00 "OPC"  xxxxx  PPu0--0i  iiiyyyyy")\
325DEF_ENC32(L2_load##TAG##_pi,   ICLASS_LD" 1 01 "OPC"  xxxxx  PP00---i  iiiyyyyy")\
326DEF_ENC32(L4_load##TAG##_ap,   ICLASS_LD" 1 01 "OPC"  eeeee  PP01IIII  -IIyyyyy")\
327DEF_ENC32(L2_load##TAG##_pr,   ICLASS_LD" 1 10 "OPC"  xxxxx  PPu0----  0--yyyyy")\
328DEF_ENC32(L4_load##TAG##_ur,   ICLASS_LD" 1 10 "OPC"  ttttt  PPi1IIII  iIIyyyyy")\
329DEF_ENC32(L2_load##TAG##_pcr,  ICLASS_LD" 1 00 "OPC"  xxxxx  PPu0--1-  0--yyyyy")\
330DEF_ENC32(L2_load##TAG##_pbr,  ICLASS_LD" 1 11 "OPC"  xxxxx  PPu0----  0--yyyyy")
331
332
333#define STD_PLD_ENC(TAG,OPC) \
334DEF_ENC32(L2_pload##TAG##t_pi,    ICLASS_LD" 1 01 "OPC"  xxxxx  PP100tti  iiiddddd")\
335DEF_ENC32(L2_pload##TAG##f_pi,    ICLASS_LD" 1 01 "OPC"  xxxxx  PP101tti  iiiddddd")\
336DEF_ENC32(L2_pload##TAG##tnew_pi, ICLASS_LD" 1 01 "OPC"  xxxxx  PP110tti  iiiddddd")\
337DEF_ENC32(L2_pload##TAG##fnew_pi, ICLASS_LD" 1 01 "OPC"  xxxxx  PP111tti  iiiddddd")\
338DEF_ENC32(L4_pload##TAG##t_abs,   ICLASS_LD" 1 11 "OPC"  iiiii  PP100tti  1--ddddd")\
339DEF_ENC32(L4_pload##TAG##f_abs,   ICLASS_LD" 1 11 "OPC"  iiiii  PP101tti  1--ddddd")\
340DEF_ENC32(L4_pload##TAG##tnew_abs,ICLASS_LD" 1 11 "OPC"  iiiii  PP110tti  1--ddddd")\
341DEF_ENC32(L4_pload##TAG##fnew_abs,ICLASS_LD" 1 11 "OPC"  iiiii  PP111tti  1--ddddd")
342
343
344/*               0 000  misc: dealloc,loadw_locked,dcfetch      */
345STD_LD_ENC(bzw4,"0 101")
346STD_LD_ENC(bzw2,"0 011")
347
348STD_LD_ENC(bsw4,"0 111")
349STD_LD_ENC(bsw2,"0 001")
350
351STD_LDX_ENC(alignh,"0 010")
352STD_LDX_ENC(alignb,"0 100")
353
354STD_LD_ENC(rb,  "1 000")
355STD_LD_ENC(rub, "1 001")
356STD_LD_ENC(rh,  "1 010")
357STD_LD_ENC(ruh, "1 011")
358STD_LD_ENC(ri,  "1 100")
359STD_LD_ENC(rd,  "1 110") /* note dest reg field LSB=0, 1 is reserved */
360
361STD_PLD_ENC(rb,  "1 000")
362STD_PLD_ENC(rub, "1 001")
363STD_PLD_ENC(rh,  "1 010")
364STD_PLD_ENC(ruh, "1 011")
365STD_PLD_ENC(ri,  "1 100")
366STD_PLD_ENC(rd,  "1 110") /* note dest reg field LSB=0, 1 is reserved */
367
368
369DEF_CLASS32(    ICLASS_LD" 0--0 000----- PP------ --------",LD_MISC)
370DEF_ANTICLASS32(ICLASS_LD" 0--0 000----- PP------ --------",LD_ADDR_ROFFSET)
371DEF_ANTICLASS32(ICLASS_LD" 1000 000----- PP------ --------",LD_ADDR_POST_CIRC_IMMED)
372DEF_ANTICLASS32(ICLASS_LD" 1010 000----- PP------ --------",LD_ADDR_POST_IMMED)
373DEF_ANTICLASS32(ICLASS_LD" 1100 000----- PP------ --------",LD_ADDR_POST_REG)
374DEF_ANTICLASS32(ICLASS_LD" 1110 000----- PP------ --------",LD_ADDR_POST_REG)
375
376DEF_ENC32(L2_deallocframe,    ICLASS_LD" 000 0 000 sssss PP0----- ---ddddd")
377DEF_ENC32(L4_return,          ICLASS_LD" 011 0 000 sssss PP0000-- ---ddddd")
378DEF_ENC32(L4_return_t,        ICLASS_LD" 011 0 000 sssss PP0100vv ---ddddd")
379DEF_ENC32(L4_return_f,        ICLASS_LD" 011 0 000 sssss PP1100vv ---ddddd")
380DEF_ENC32(L4_return_tnew_pt,  ICLASS_LD" 011 0 000 sssss PP0110vv ---ddddd")
381DEF_ENC32(L4_return_fnew_pt,  ICLASS_LD" 011 0 000 sssss PP1110vv ---ddddd")
382DEF_ENC32(L4_return_tnew_pnt, ICLASS_LD" 011 0 000 sssss PP0010vv ---ddddd")
383DEF_ENC32(L4_return_fnew_pnt, ICLASS_LD" 011 0 000 sssss PP1010vv ---ddddd")
384
385DEF_ENC32(L2_loadw_locked,ICLASS_LD" 001 0 000 sssss PP000--- 000ddddd")
386
387
388
389DEF_ENC32(L2_loadw_aq,        ICLASS_LD" 001 0 000 sssss PP001--- 000ddddd")
390DEF_ENC32(L4_loadd_aq,        ICLASS_LD" 001 0 000 sssss PP011--- 000ddddd")
391
392DEF_ENC32(R6_release_at_vi,    ICLASS_ST" 000 01 11sssss PP0ttttt --0011dd")
393DEF_ENC32(R6_release_st_vi,   ICLASS_ST" 000 01 11sssss PP0ttttt --1011dd")
394
395DEF_ENC32(S2_storew_rl_at_vi,  ICLASS_ST" 000 01 01sssss PP-ttttt --0010dd")
396DEF_ENC32(S2_storew_rl_st_vi, ICLASS_ST" 000 01 01sssss PP-ttttt --1010dd")
397
398DEF_ENC32(S4_stored_rl_at_vi,  ICLASS_ST" 000 01 11sssss PP0ttttt --0010dd")
399DEF_ENC32(S4_stored_rl_st_vi, ICLASS_ST" 000 01 11sssss PP0ttttt --1010dd")
400
401DEF_ENC32(L4_loadd_locked,ICLASS_LD" 001 0 000 sssss PP010--- 000ddddd")
402DEF_EXT_SPACE(EXTRACTW,   ICLASS_LD" 001 0 000 iiiii PP0iiiii -01iiiii")
403DEF_ENC32(Y2_dcfetchbo,   ICLASS_LD" 010 0 000 sssss PP0--iii iiiiiiii")
404
405
406
407
408
409
410
411
412/*******************************/
413/*                             */
414/*                             */
415/*           STORE             */
416/*                             */
417/*                             */
418/*******************************/
419
420DEF_CLASS32(ICLASS_ST" ---- -------- PP------ --------",ST)
421
422DEF_FIELD32(ICLASS_ST" !!!- -------- PP------ --------",ST_Amode,"Amode")
423DEF_FIELD32(ICLASS_ST" ---! !!------ PP------ --------",ST_Type,"Type")
424DEF_FIELD32(ICLASS_ST" ---- --!----- PP------ --------",ST_UN,"Unsigned")
425
426DEF_CLASS32(ICLASS_ST" 0--1 -------- PP------ --------",ST_ADDR_ROFFSET)
427DEF_CLASS32(ICLASS_ST" 1001 -------- PP------ ------0-",ST_ADDR_POST_CIRC_IMMED)
428DEF_CLASS32(ICLASS_ST" 1011 -------- PP0----- 0-----0-",ST_ADDR_POST_IMMED)
429DEF_CLASS32(ICLASS_ST" 1011 -------- PP0----- 1-------",ST_ADDR_ABS_UPDATE_V4)
430DEF_CLASS32(ICLASS_ST" 1011 -------- PP1----- --------",ST_ADDR_POST_IMMED_PRED_V2)
431DEF_CLASS32(ICLASS_ST" 1111 -------- PP------ 1-------",ST_ADDR_PRED_ABS_V4)
432DEF_CLASS32(ICLASS_ST" 1101 -------- PP------ 0-------",ST_ADDR_POST_REG)
433DEF_CLASS32(ICLASS_ST" 1101 -------- PP------ 1-------",ST_ADDR_ABS_PLUS_REG_V4)
434DEF_CLASS32(ICLASS_ST" 1001 -------- PP------ ------1-",ST_ADDR_POST_CREG_V2)
435DEF_CLASS32(ICLASS_ST" 1111 -------- PP------ 0-------",ST_ADDR_POST_BREV_REG)
436DEF_CLASS32(ICLASS_ST" 0--0 1------- PP------ --------",ST_MISC_STORELIKE)
437DEF_CLASS32(ICLASS_ST" 1--0 0------- PP------ --------",ST_MISC_BUSOP)
438DEF_CLASS32(ICLASS_ST" 0--0 0------- PP------ --------",ST_MISC_CACHEOP)
439
440
441#define STD_ST_ENC(TAG,OPC,SRC) \
442DEF_ENC32(S2_store##TAG##_io,   ICLASS_ST" 0 ii "OPC"  sssss  PPi"SRC"  iiiiiiii")\
443DEF_ENC32(S2_store##TAG##_pci,  ICLASS_ST" 1 00 "OPC"  xxxxx  PPu"SRC"  0iiii-0-")\
444DEF_ENC32(S2_store##TAG##_pi,   ICLASS_ST" 1 01 "OPC"  xxxxx  PP0"SRC"  0iiii-0-")\
445DEF_ENC32(S4_store##TAG##_ap,   ICLASS_ST" 1 01 "OPC"  eeeee  PP0"SRC"  1-IIIIII")\
446DEF_ENC32(S2_store##TAG##_pr,   ICLASS_ST" 1 10 "OPC"  xxxxx  PPu"SRC"  0-------")\
447DEF_ENC32(S4_store##TAG##_ur,   ICLASS_ST" 1 10 "OPC"  uuuuu  PPi"SRC"  1iIIIIII")\
448DEF_ENC32(S2_store##TAG##_pcr,  ICLASS_ST" 1 00 "OPC"  xxxxx  PPu"SRC"  0-----1-")\
449DEF_ENC32(S2_store##TAG##_pbr,  ICLASS_ST" 1 11 "OPC"  xxxxx  PPu"SRC"  0-------")
450
451
452#define STD_PST_ENC(TAG,OPC,SRC) \
453DEF_ENC32(S2_pstore##TAG##t_pi,    ICLASS_ST" 1 01 "OPC"  xxxxx  PP1"SRC"  0iiii0vv")\
454DEF_ENC32(S2_pstore##TAG##f_pi,    ICLASS_ST" 1 01 "OPC"  xxxxx  PP1"SRC"  0iiii1vv")\
455DEF_ENC32(S2_pstore##TAG##tnew_pi, ICLASS_ST" 1 01 "OPC"  xxxxx  PP1"SRC"  1iiii0vv")\
456DEF_ENC32(S2_pstore##TAG##fnew_pi, ICLASS_ST" 1 01 "OPC"  xxxxx  PP1"SRC"  1iiii1vv")\
457DEF_ENC32(S4_pstore##TAG##t_abs,   ICLASS_ST" 1 11 "OPC"  ---ii  PP0"SRC"  1iiii0vv")\
458DEF_ENC32(S4_pstore##TAG##f_abs,   ICLASS_ST" 1 11 "OPC"  ---ii  PP0"SRC"  1iiii1vv")\
459DEF_ENC32(S4_pstore##TAG##tnew_abs,ICLASS_ST" 1 11 "OPC"  ---ii  PP1"SRC"  1iiii0vv")\
460DEF_ENC32(S4_pstore##TAG##fnew_abs,ICLASS_ST" 1 11 "OPC"  ---ii  PP1"SRC"  1iiii1vv")
461
462
463/*                 0 0--  Store Misc */
464/*                 0 1xx  Available */
465STD_ST_ENC(rb,    "1 000","ttttt")
466STD_ST_ENC(rh,    "1 010","ttttt")
467STD_ST_ENC(rf,    "1 011","ttttt")
468STD_ST_ENC(ri,    "1 100","ttttt")
469STD_ST_ENC(rd,    "1 110","ttttt")
470STD_ST_ENC(rbnew, "1 101","00ttt")
471STD_ST_ENC(rhnew, "1 101","01ttt")
472STD_ST_ENC(rinew, "1 101","10ttt")
473
474STD_PST_ENC(rb,    "1 000","ttttt")
475STD_PST_ENC(rh,    "1 010","ttttt")
476STD_PST_ENC(rf,    "1 011","ttttt")
477STD_PST_ENC(ri,    "1 100","ttttt")
478STD_PST_ENC(rd,    "1 110","ttttt")
479STD_PST_ENC(rbnew, "1 101","00ttt")
480STD_PST_ENC(rhnew, "1 101","01ttt")
481STD_PST_ENC(rinew, "1 101","10ttt")
482
483
484
485/* User */
486/*                                   xx - st_misc */
487/*                                                */
488/*                               x bus/cache     */
489/*                                    x store/cache     */
490DEF_ENC32(S2_allocframe,   ICLASS_ST" 000 01 00xxxxx PP000iii iiiiiiii")
491DEF_ENC32(S2_storew_locked,ICLASS_ST" 000 01 01sssss PP-ttttt ----00dd")
492DEF_ENC32(S4_stored_locked,ICLASS_ST" 000 01 11sssss PP0ttttt ----00dd")
493DEF_ENC32(Y2_dczeroa,      ICLASS_ST" 000 01 10sssss PP0----- --------")
494
495
496DEF_ENC32(Y2_barrier,      ICLASS_ST" 100 00 00----- PP------ 000-----")
497DEF_ENC32(Y2_syncht,       ICLASS_ST" 100 00 10----- PP------ --------")
498
499
500
501DEF_ENC32(Y2_dccleana,     ICLASS_ST" 000 00 00sssss PP------ --------")
502DEF_ENC32(Y2_dcinva,       ICLASS_ST" 000 00 01sssss PP------ --------")
503DEF_ENC32(Y2_dccleaninva,  ICLASS_ST" 000 00 10sssss PP------ --------")
504
505DEF_ENC32(Y4_l2fetch,      ICLASS_ST" 011 00 00sssss PP-ttttt 000-----")
506DEF_ENC32(Y5_l2fetch,      ICLASS_ST" 011 01 00sssss PP-ttttt --------")
507
508/*******************************/
509/*                             */
510/*                             */
511/*           JUMP              */
512/*                             */
513/*                             */
514/*******************************/
515
516DEF_CLASS32(ICLASS_J" ---- -------- PP------ --------",J)
517DEF_CLASS32(ICLASS_J" 0--- -------- PP------ --------",JUMPR_MISC)
518DEF_CLASS32(ICLASS_J" 10-- -------- PP------ --------",UCJUMP)
519DEF_CLASS32(ICLASS_J" 110- -------- PP------ --------",CJUMP)
520DEF_FIELD32(ICLASS_J" 110- -------- PP--!--- --------",J_DN,"Dot-new")
521DEF_FIELD32(ICLASS_J" 110- -------- PP-!---- --------",J_PT,"Predict-taken")
522
523
524
525DEF_FIELDROW_DESC32(ICLASS_J" 0000 -------- PP------ --------","[#0] PC=(Rs), R31=return")
526DEF_ENC32(J2_callr,     ICLASS_J" 0000  101sssss  PP------  --------")
527DEF_ENC32(J2_callrh,    ICLASS_J" 0000  110sssss  PP------  --------")
528
529DEF_FIELDROW_DESC32(ICLASS_J" 0001 -------- PP------ --------","[#1] if (Pu) PC=(Rs), R31=return")
530DEF_ENC32(J2_callrt,    ICLASS_J" 0001  000sssss  PP----uu  --------")
531DEF_ENC32(J2_callrf,    ICLASS_J" 0001  001sssss  PP----uu  --------")
532
533DEF_FIELDROW_DESC32(ICLASS_J" 0010 -------- PP------ --------","[#2] PC=(Rs); ")
534DEF_ENC32(J2_jumpr,      ICLASS_J" 0010  100sssss  PP------  --------")
535DEF_ENC32(J2_jumprh,     ICLASS_J" 0010  110sssss  PP------  --------")
536DEF_ENC32(J4_hintjumpr,  ICLASS_J" 0010  101sssss  PP------  --------")
537
538DEF_FIELDROW_DESC32(ICLASS_J" 0011 -------- PP------ --------","[#3] if (Pu) PC=(Rs) ")
539DEF_ENC32(J2_jumprt,   ICLASS_J" 0011  010sssss  PP-00-uu  --------")
540DEF_ENC32(J2_jumprf,   ICLASS_J" 0011  011sssss  PP-00-uu  --------")
541DEF_ENC32(J2_jumprtpt,    ICLASS_J" 0011  010sssss  PP-10-uu  --------")
542DEF_ENC32(J2_jumprfpt,    ICLASS_J" 0011  011sssss  PP-10-uu  --------")
543DEF_ENC32(J2_jumprtnew,   ICLASS_J" 0011  010sssss  PP-01-uu  --------")
544DEF_ENC32(J2_jumprfnew,   ICLASS_J" 0011  011sssss  PP-01-uu  --------")
545DEF_ENC32(J2_jumprtnewpt, ICLASS_J" 0011  010sssss  PP-11-uu  --------")
546DEF_ENC32(J2_jumprfnewpt, ICLASS_J" 0011  011sssss  PP-11-uu  --------")
547
548DEF_FIELDROW_DESC32(ICLASS_J" 0100 -------- PP------ --------","[#4] (#u8) ")
549DEF_ENC32(J2_trap0,     ICLASS_J" 0100  00------  PP-iiiii  ---iii--")
550DEF_ENC32(J2_pause,     ICLASS_J" 0100  01------  PP-iiiii  ---iii--")
551
552DEF_FIELDROW_DESC32(ICLASS_J" 0110 -------- PP------ --------","[#6] icop(Rs) ")
553DEF_ENC32(Y2_icinva,    ICLASS_J" 0110  110sssss  PP000---  --------")
554
555DEF_FIELDROW_DESC32(ICLASS_J" 0111 -------- PP------ --------","[#7] () ")
556DEF_ENC32(Y2_isync,     ICLASS_J" 0111  11000000  PP0---00  00000010")
557
558/* JUMP */
559DEF_FIELDROW_DESC32(ICLASS_J" 100- -------- PP------ --------","[#8,9] PC=(#r22)")
560DEF_ENC32(J2_jump,      ICLASS_J" 100i  iiiiiiii  PPiiiiii  iiiiiii-")
561
562DEF_FIELDROW_DESC32(ICLASS_J" 101- -------- PP------ --------","[#10,11] PC=(#r22), R31=return")
563DEF_ENC32(J2_call,      ICLASS_J" 101i  iiiiiiii  PPiiiiii  iiiiiii0")
564
565DEF_FIELDROW_DESC32(ICLASS_J" 1100 -------- PP------ --------","[#12] if (Pu) PC=(#r15)")
566DEF_ENC32(J2_jumpt,  ICLASS_J" 1100  ii0iiiii  PPi00-uu  iiiiiii-")
567DEF_ENC32(J2_jumpf,  ICLASS_J" 1100  ii1iiiii  PPi00-uu  iiiiiii-")
568DEF_ENC32(J2_jumptpt,   ICLASS_J" 1100  ii0iiiii  PPi10-uu  iiiiiii-")
569DEF_ENC32(J2_jumpfpt,   ICLASS_J" 1100  ii1iiiii  PPi10-uu  iiiiiii-")
570DEF_ENC32(J2_jumptnew,  ICLASS_J" 1100  ii0iiiii  PPi01-uu  iiiiiii-")
571DEF_ENC32(J2_jumpfnew,  ICLASS_J" 1100  ii1iiiii  PPi01-uu  iiiiiii-")
572DEF_ENC32(J2_jumptnewpt,ICLASS_J" 1100  ii0iiiii  PPi11-uu  iiiiiii-")
573DEF_ENC32(J2_jumpfnewpt,ICLASS_J" 1100  ii1iiiii  PPi11-uu  iiiiiii-")
574
575DEF_FIELDROW_DESC32(ICLASS_J" 1101 -------- PP------ --------","[#13] if (Pu) PC=(#r15), R31=return")
576DEF_ENC32(J2_callt,     ICLASS_J" 1101  ii0iiiii  PPi-0-uu  iiiiiii-")
577DEF_ENC32(J2_callf,     ICLASS_J" 1101  ii1iiiii  PPi-0-uu  iiiiiii-")
578
579
580
581
582
583
584
585/*******************************/
586/*                             */
587/*        V4                   */
588/*   COMPOUND COMPARE-JUMPS    */
589/*                             */
590/*                             */
591/*******************************/
592
593
594/* EJP: this has to match what we have in htmldocs.py... so I will call it CJ, we can change it */
595DEF_CLASS32(ICLASS_CJ" 0--- -------- PP------ --------",CJ)
596
597DEF_FIELDROW_DESC32(ICLASS_CJ" 00-- -------- -------- --------","[#0-3]  pd=cmp.xx(R,#u5) ; if ([!]p0.new) jump:[h] #s9:2 ")
598DEF_FIELDROW_DESC32(ICLASS_CJ" 010- -------- -------- --------","[#4,5]  pd=cmp.eq(R,R) ; if ([!]p0.new) jump:[h] #s9:2 ")
599DEF_FIELDROW_DESC32(ICLASS_CJ" 0110 -------- -------- --------","[#6]    Rd=#u6 ; jump #s9:2 ")
600DEF_FIELDROW_DESC32(ICLASS_CJ" 0111 -------- -------- --------","[#7]    Rd=Rs ; jump #s9:2 ")
601
602
603#define CMPJMPI_ENC(TAG,OPC) \
604DEF_ENC32(TAG##i_tp0_jump_t,      ICLASS_CJ" 00 0 "OPC"  0iissss  PP1IIIII  iiiiiii-") \
605DEF_ENC32(TAG##i_fp0_jump_t,      ICLASS_CJ" 00 0 "OPC"  1iissss  PP1IIIII  iiiiiii-") \
606DEF_ENC32(TAG##i_tp0_jump_nt,     ICLASS_CJ" 00 0 "OPC"  0iissss  PP0IIIII  iiiiiii-") \
607DEF_ENC32(TAG##i_fp0_jump_nt,     ICLASS_CJ" 00 0 "OPC"  1iissss  PP0IIIII  iiiiiii-") \
608\
609DEF_ENC32(TAG##i_tp1_jump_t,      ICLASS_CJ" 00 1 "OPC"  0iissss  PP1IIIII  iiiiiii-") \
610DEF_ENC32(TAG##i_fp1_jump_t,      ICLASS_CJ" 00 1 "OPC"  1iissss  PP1IIIII  iiiiiii-") \
611DEF_ENC32(TAG##i_tp1_jump_nt,     ICLASS_CJ" 00 1 "OPC"  0iissss  PP0IIIII  iiiiiii-") \
612DEF_ENC32(TAG##i_fp1_jump_nt,     ICLASS_CJ" 00 1 "OPC"  1iissss  PP0IIIII  iiiiiii-")
613
614CMPJMPI_ENC(J4_cmpeq,"00")
615CMPJMPI_ENC(J4_cmpgt,"01")
616CMPJMPI_ENC(J4_cmpgtu,"10")
617
618
619#define CMPJMP1I_ENC(TAG,OPC) \
620DEF_ENC32(TAG##_tp0_jump_t,      ICLASS_CJ" 00 0  11  0iissss  PP1---"OPC"  iiiiiii-") \
621DEF_ENC32(TAG##_fp0_jump_t,      ICLASS_CJ" 00 0  11  1iissss  PP1---"OPC"  iiiiiii-") \
622DEF_ENC32(TAG##_tp0_jump_nt,     ICLASS_CJ" 00 0  11  0iissss  PP0---"OPC"  iiiiiii-") \
623DEF_ENC32(TAG##_fp0_jump_nt,     ICLASS_CJ" 00 0  11  1iissss  PP0---"OPC"  iiiiiii-") \
624\
625DEF_ENC32(TAG##_tp1_jump_t,      ICLASS_CJ" 00 1  11  0iissss  PP1---"OPC"  iiiiiii-") \
626DEF_ENC32(TAG##_fp1_jump_t,      ICLASS_CJ" 00 1  11  1iissss  PP1---"OPC"  iiiiiii-") \
627DEF_ENC32(TAG##_tp1_jump_nt,     ICLASS_CJ" 00 1  11  0iissss  PP0---"OPC"  iiiiiii-") \
628DEF_ENC32(TAG##_fp1_jump_nt,     ICLASS_CJ" 00 1  11  1iissss  PP0---"OPC"  iiiiiii-")
629
630CMPJMP1I_ENC(J4_cmpeqn1,"00")
631CMPJMP1I_ENC(J4_cmpgtn1,"01")
632CMPJMP1I_ENC(J4_tstbit0,"11")
633
634
635
636#define CMPJMPR_ENC(TAG,OPC) \
637DEF_ENC32(TAG##_tp0_jump_t,       ICLASS_CJ" 01 0 "OPC"  0iissss  PP10tttt  iiiiiii-") \
638DEF_ENC32(TAG##_fp0_jump_t,       ICLASS_CJ" 01 0 "OPC"  1iissss  PP10tttt  iiiiiii-") \
639DEF_ENC32(TAG##_tp0_jump_nt,      ICLASS_CJ" 01 0 "OPC"  0iissss  PP00tttt  iiiiiii-") \
640DEF_ENC32(TAG##_fp0_jump_nt,      ICLASS_CJ" 01 0 "OPC"  1iissss  PP00tttt  iiiiiii-") \
641\
642DEF_ENC32(TAG##_tp1_jump_t,       ICLASS_CJ" 01 0 "OPC"  0iissss  PP11tttt  iiiiiii-") \
643DEF_ENC32(TAG##_fp1_jump_t,       ICLASS_CJ" 01 0 "OPC"  1iissss  PP11tttt  iiiiiii-") \
644DEF_ENC32(TAG##_tp1_jump_nt,      ICLASS_CJ" 01 0 "OPC"  0iissss  PP01tttt  iiiiiii-") \
645DEF_ENC32(TAG##_fp1_jump_nt,      ICLASS_CJ" 01 0 "OPC"  1iissss  PP01tttt  iiiiiii-")
646
647CMPJMPR_ENC(J4_cmpeq,"00")
648CMPJMPR_ENC(J4_cmpgt,"01")
649CMPJMPR_ENC(J4_cmpgtu,"10")
650
651
652DEF_ENC32(J4_jumpseti,            ICLASS_CJ" 0110  --iidddd  PPIIIIII  iiiiiii-")
653DEF_ENC32(J4_jumpsetr,            ICLASS_CJ" 0111  --iissss  PP--dddd  iiiiiii-")
654
655
656DEF_EXT_SPACE(EXT_CJ,             ICLASS_CJ"1 iii  iiiiiiii  PPiiiiii  iiiiiiii")
657
658
659
660DEF_CLASS32(ICLASS_NCJ" 0--- -------- PP------ --------",NCJ)
661DEF_FIELDROW_DESC32(ICLASS_NCJ" 00-- -------- -------- --------","[#0-3] if (cmp.xx(R.new,R)) jump:[h] #s9:2 ")
662DEF_FIELDROW_DESC32(ICLASS_NCJ" 01-- -------- -------- --------","[#4-7] if (cmp.xx(R.new,#U5)) jump:[h] #s9:2 ")
663
664#define OPRJMP_ENC(TAG,OPC) \
665DEF_ENC32(TAG##_t_jumpnv_t,       ICLASS_NCJ" 00 "OPC"  0ii-sss  PP1ttttt  iiiiiii-") \
666DEF_ENC32(TAG##_f_jumpnv_t,       ICLASS_NCJ" 00 "OPC"  1ii-sss  PP1ttttt  iiiiiii-") \
667DEF_ENC32(TAG##_t_jumpnv_nt,      ICLASS_NCJ" 00 "OPC"  0ii-sss  PP0ttttt  iiiiiii-") \
668DEF_ENC32(TAG##_f_jumpnv_nt,      ICLASS_NCJ" 00 "OPC"  1ii-sss  PP0ttttt  iiiiiii-")
669
670OPRJMP_ENC(J4_cmpeq,   "000")
671OPRJMP_ENC(J4_cmpgt,   "001")
672OPRJMP_ENC(J4_cmpgtu,  "010")
673OPRJMP_ENC(J4_cmplt,   "011")
674OPRJMP_ENC(J4_cmpltu,  "100")
675
676
677#define OPIJMP_ENC(TAG,OPC) \
678DEF_ENC32(TAG##_t_jumpnv_t,       ICLASS_NCJ" 01 "OPC"  0ii-sss  PP1IIIII  iiiiiii-") \
679DEF_ENC32(TAG##_f_jumpnv_t,       ICLASS_NCJ" 01 "OPC"  1ii-sss  PP1IIIII  iiiiiii-") \
680DEF_ENC32(TAG##_t_jumpnv_nt,      ICLASS_NCJ" 01 "OPC"  0ii-sss  PP0IIIII  iiiiiii-") \
681DEF_ENC32(TAG##_f_jumpnv_nt,      ICLASS_NCJ" 01 "OPC"  1ii-sss  PP0IIIII  iiiiiii-")
682
683OPIJMP_ENC(J4_cmpeqi,  "000")
684OPIJMP_ENC(J4_cmpgti,  "001")
685OPIJMP_ENC(J4_cmpgtui, "010")
686
687
688#define OPI1JMP_ENC(TAG,OPC) \
689DEF_ENC32(TAG##_t_jumpnv_t,       ICLASS_NCJ" 01 "OPC"  0ii-sss  PP1-----  iiiiiii-") \
690DEF_ENC32(TAG##_f_jumpnv_t,       ICLASS_NCJ" 01 "OPC"  1ii-sss  PP1-----  iiiiiii-") \
691DEF_ENC32(TAG##_t_jumpnv_nt,      ICLASS_NCJ" 01 "OPC"  0ii-sss  PP0-----  iiiiiii-") \
692DEF_ENC32(TAG##_f_jumpnv_nt,      ICLASS_NCJ" 01 "OPC"  1ii-sss  PP0-----  iiiiiii-")
693
694OPI1JMP_ENC(J4_cmpeqn1,  "100")
695OPI1JMP_ENC(J4_cmpgtn1,  "101")
696OPI1JMP_ENC(J4_tstbit0,  "011")
697
698
699DEF_EXT_SPACE(EXT_NCJ,             ICLASS_NCJ"1 iii  iiiiiiii  PPiiiiii  iiiiiiii")
700
701
702
703/*******************************/
704/*                             */
705/*                             */
706/*           CR                */
707/*                             */
708/*                             */
709/*******************************/
710
711
712
713DEF_CLASS32(ICLASS_CR" ---- -------- PP------ --------",CR)
714DEF_CLASS32(ICLASS_CR" -0-- -------- PP------ --------",CRUSER)
715DEF_CLASS32(ICLASS_CR" -1-- -------- PP------ --------",CRSUPER)
716
717DEF_FIELD32(ICLASS_CR" -!-- -------- PP------ --------",CR_sm,"Supervisor mode only")
718
719/* User CR ops */
720
721DEF_FIELDROW_DESC32(    ICLASS_CR" 0000  --------  PP------  --------","[#0] (Rs,#r8)")
722DEF_ENC32(J2_loop0r,    ICLASS_CR" 0000  000sssss  PP-iiiii  ---ii---")
723DEF_ENC32(J2_loop1r,    ICLASS_CR" 0000  001sssss  PP-iiiii  ---ii---")
724DEF_ENC32(J2_ploop1sr,  ICLASS_CR" 0000  101sssss  PP-iiiii  ---ii---")
725DEF_ENC32(J2_ploop2sr,  ICLASS_CR" 0000  110sssss  PP-iiiii  ---ii---")
726DEF_ENC32(J2_ploop3sr,  ICLASS_CR" 0000  111sssss  PP-iiiii  ---ii---")
727
728DEF_FIELDROW_DESC32(     ICLASS_CR" 0001  --------  PP------  --------","[#1] (Rs,#r13)")
729DEF_ENC32(J2_jumprz,     ICLASS_CR" 0001  00isssss  PPi0iiii  iiiiiii-")
730DEF_ENC32(J2_jumprzpt,   ICLASS_CR" 0001  00isssss  PPi1iiii  iiiiiii-")
731DEF_ENC32(J2_jumprnz,    ICLASS_CR" 0001  10isssss  PPi0iiii  iiiiiii-")
732DEF_ENC32(J2_jumprnzpt,  ICLASS_CR" 0001  10isssss  PPi1iiii  iiiiiii-")
733
734DEF_ENC32(J2_jumprgtez,  ICLASS_CR" 0001  01isssss  PPi0iiii  iiiiiii-")
735DEF_ENC32(J2_jumprgtezpt,ICLASS_CR" 0001  01isssss  PPi1iiii  iiiiiii-")
736DEF_ENC32(J2_jumprltez,  ICLASS_CR" 0001  11isssss  PPi0iiii  iiiiiii-")
737DEF_ENC32(J2_jumprltezpt,ICLASS_CR" 0001  11isssss  PPi1iiii  iiiiiii-")
738
739DEF_FIELDROW_DESC32(    ICLASS_CR" 0010  --------  PP------  --------","[#2] Cd=Rs ")
740DEF_ENC32(A2_tfrrcr,    ICLASS_CR" 0010  001sssss  PP------  ---ddddd")
741
742DEF_FIELDROW_DESC32(    ICLASS_CR" 0011  --------  PP------  --------","[#3] Cdd=Rss ")
743DEF_ENC32(A4_tfrpcp,    ICLASS_CR" 0011  001sssss  PP------  ---ddddd")
744
745DEF_FIELDROW_DESC32(    ICLASS_CR" 1000  --------  PP------  --------","[#8] Rdd=Css ")
746DEF_ENC32(A4_tfrcpp,    ICLASS_CR" 1000  000sssss  PP------  ---ddddd")
747
748DEF_FIELDROW_DESC32(    ICLASS_CR" 1001  --------  PP------  --------","[#9] (#r8,#U10)")
749DEF_ENC32(J2_ploop1si,  ICLASS_CR" 1001  101IIIII  PP-iiiii  IIIii-II")
750DEF_ENC32(J2_ploop2si,  ICLASS_CR" 1001  110IIIII  PP-iiiii  IIIii-II")
751DEF_ENC32(J2_ploop3si,  ICLASS_CR" 1001  111IIIII  PP-iiiii  IIIii-II")
752DEF_ENC32(J2_loop0i,    ICLASS_CR" 1001  000IIIII  PP-iiiii  IIIii-II")
753DEF_ENC32(J2_loop1i,    ICLASS_CR" 1001  001IIIII  PP-iiiii  IIIii-II")
754
755DEF_FIELDROW_DESC32(    ICLASS_CR" 1010  --------  PP------  --------","[#10] Rd=Cs ")
756DEF_ENC32(A2_tfrcrr,    ICLASS_CR" 1010  000sssss  PP------  ---ddddd")
757DEF_ENC32(C4_addipc,    ICLASS_CR" 1010  01001001  PP-iiiii  i--ddddd")
758
759
760DEF_FIELDROW_DESC32(    ICLASS_CR" 1011  --------  PP0-----  --------","[#11] Pd=(Ps,Pt,Pu)")
761DEF_ENC32(C2_and,       ICLASS_CR" 1011  0000--ss  PP0---tt  ------dd")
762DEF_ENC32(C2_or,        ICLASS_CR" 1011  0010--ss  PP0---tt  ------dd")
763DEF_ENC32(C2_xor,       ICLASS_CR" 1011  0100--ss  PP0---tt  ------dd")
764DEF_ENC32(C2_andn,      ICLASS_CR" 1011  0110--ss  PP0---tt  ------dd")
765DEF_ENC32(C2_any8,      ICLASS_CR" 1011  1000--ss  PP0-----  ------dd")
766DEF_ENC32(C2_all8,      ICLASS_CR" 1011  1010--ss  PP0-----  ------dd")
767DEF_ENC32(C2_not,       ICLASS_CR" 1011  1100--ss  PP0-----  ------dd")
768DEF_ENC32(C2_orn,       ICLASS_CR" 1011  1110--ss  PP0---tt  ------dd")
769
770DEF_ENC32(C4_and_and,   ICLASS_CR" 1011  0001--ss  PP0---tt  uu----dd")
771DEF_ENC32(C4_and_or,    ICLASS_CR" 1011  0011--ss  PP0---tt  uu----dd")
772DEF_ENC32(C4_or_and,    ICLASS_CR" 1011  0101--ss  PP0---tt  uu----dd")
773DEF_ENC32(C4_or_or,     ICLASS_CR" 1011  0111--ss  PP0---tt  uu----dd")
774DEF_ENC32(C4_and_andn,  ICLASS_CR" 1011  1001--ss  PP0---tt  uu----dd")
775DEF_ENC32(C4_and_orn,   ICLASS_CR" 1011  1011--ss  PP0---tt  uu----dd")
776DEF_ENC32(C4_or_andn,   ICLASS_CR" 1011  1101--ss  PP0---tt  uu----dd")
777DEF_ENC32(C4_or_orn,    ICLASS_CR" 1011  1111--ss  PP0---tt  uu----dd")
778
779DEF_ENC32(C4_fastcorner9,       ICLASS_CR"1011 0000--ss  PP1---tt 1--1--dd")
780DEF_ENC32(C4_fastcorner9_not,   ICLASS_CR"1011 0001--ss  PP1---tt 1--1--dd")
781
782
783
784/*******************************/
785/*                             */
786/*                             */
787/*           M                 */
788/*                             */
789/*                             */
790/*******************************/
791
792
793DEF_CLASS32(ICLASS_M" ---- -------- PP------ --------",M)
794DEF_FIELD32(ICLASS_M" !!!! -------- PP------ --------",M_RegType,"Register Type")
795DEF_FIELD32(ICLASS_M" ---- !!!----- PP------ --------",M_MajOp,"Major Opcode")
796DEF_FIELD32(ICLASS_M" ---- -------- PP------ !!!-----",M_MinOp,"Minor Opcode")
797
798
799
800#define SP_MPY(TAG,REGTYPE,DSTCHARS,SAT,RND,UNS)\
801DEF_ENC32(TAG##_ll_s0, ICLASS_M  REGTYPE "0"  UNS RND"sssss  PP-ttttt "SAT"00"   DSTCHARS)\
802DEF_ENC32(TAG##_lh_s0, ICLASS_M  REGTYPE "0"  UNS RND"sssss  PP-ttttt "SAT"01"   DSTCHARS)\
803DEF_ENC32(TAG##_hl_s0, ICLASS_M  REGTYPE "0"  UNS RND"sssss  PP-ttttt "SAT"10"   DSTCHARS)\
804DEF_ENC32(TAG##_hh_s0, ICLASS_M  REGTYPE "0"  UNS RND"sssss  PP-ttttt "SAT"11"   DSTCHARS)\
805DEF_ENC32(TAG##_ll_s1, ICLASS_M  REGTYPE "1"  UNS RND"sssss  PP-ttttt "SAT"00"   DSTCHARS)\
806DEF_ENC32(TAG##_lh_s1, ICLASS_M  REGTYPE "1"  UNS RND"sssss  PP-ttttt "SAT"01"   DSTCHARS)\
807DEF_ENC32(TAG##_hl_s1, ICLASS_M  REGTYPE "1"  UNS RND"sssss  PP-ttttt "SAT"10"   DSTCHARS)\
808DEF_ENC32(TAG##_hh_s1, ICLASS_M  REGTYPE "1"  UNS RND"sssss  PP-ttttt "SAT"11"   DSTCHARS)
809
810/* Double precision                   */
811#define MPY_ENC(TAG,REGTYPE,DSTCHARS,SAT,RNDNAC,UNS,SHFT,VMIN2)\
812DEF_ENC32(TAG, ICLASS_M REGTYPE SHFT UNS RNDNAC"sssss  PP0ttttt "SAT VMIN2 DSTCHARS)
813
814#define MPYI_ENC(TAG,REGTYPE,DSTCHARS,RNDNAC,UNS,SHFT)\
815DEF_ENC32(TAG, ICLASS_M REGTYPE SHFT UNS RNDNAC"sssss  PP0iiiii iii" DSTCHARS)
816
817
818DEF_FIELDROW_DESC32(ICLASS_M" 0000 -------- PP------ --------","[#0] Rd=(Rs,#u8)")
819MPYI_ENC(M2_mpysip,          "0000","ddddd","-","-","0"     )
820MPYI_ENC(M2_mpysin,          "0000","ddddd","-","-","1"     )
821
822
823DEF_FIELDROW_DESC32(ICLASS_M" 0001 -------- PP------ --------","[#1] Rx=(Rs,#u8)")
824MPYI_ENC(M2_macsip,          "0001","xxxxx","-","-","0"     )
825MPYI_ENC(M2_macsin,          "0001","xxxxx","-","-","1"     )
826
827
828DEF_FIELDROW_DESC32(ICLASS_M" 0010 -------- PP------ --------","[#2] Rx=(Rs,#s8)")
829MPYI_ENC(M2_accii,           "0010","xxxxx","-","-","0"     )
830MPYI_ENC(M2_naccii,          "0010","xxxxx","-","-","1"     )
831
832
833DEF_FIELDROW_DESC32(ICLASS_M" 0011 -------- PP------ --------","[#3] Ry=(Ru,(Rs,Ry)) ")
834DEF_ENC32(M4_mpyrr_addr,ICLASS_M" 0011 000sssss PP-yyyyy ---uuuuu")
835
836
837DEF_FIELDROW_DESC32(ICLASS_M" 0100 -------- PP------ --------","[#4] Rdd=(Rs,Rt)")
838DEF_FIELD32(ICLASS_M"         0100 -------- PP------ --!-----",Ma_tH,"Rt is High") /*Rt high */
839DEF_FIELD32(ICLASS_M"         0100 -------- PP------ -!------",Ma_sH,"Rs is High") /* Rs high */
840SP_MPY(M2_mpyd,              "0100","ddddd","-","0","0")
841SP_MPY(M2_mpyd_rnd,          "0100","ddddd","-","1","0")
842SP_MPY(M2_mpyud,             "0100","ddddd","-","0","1")
843
844
845DEF_FIELDROW_DESC32(ICLASS_M" 0101 -------- PP------ --------","[#5] Rdd=(Rs,Rt)")
846MPY_ENC(M2_dpmpyss_s0,       "0101","ddddd","0","0","0","0","00")
847MPY_ENC(M2_dpmpyuu_s0,       "0101","ddddd","0","0","1","0","00")
848MPY_ENC(M2_vmpy2s_s0,        "0101","ddddd","1","0","0","0","01")
849MPY_ENC(M2_vmpy2s_s1,        "0101","ddddd","1","0","0","1","01")
850MPY_ENC(M2_cmpyi_s0,         "0101","ddddd","0","0","0","0","01")
851MPY_ENC(M2_cmpyr_s0,         "0101","ddddd","0","0","0","0","10")
852MPY_ENC(M2_cmpys_s0,         "0101","ddddd","1","0","0","0","10")
853MPY_ENC(M2_cmpys_s1,         "0101","ddddd","1","0","0","1","10")
854MPY_ENC(M2_cmpysc_s0,        "0101","ddddd","1","0","1","0","10")
855MPY_ENC(M2_cmpysc_s1,        "0101","ddddd","1","0","1","1","10")
856MPY_ENC(M2_vmpy2su_s0,       "0101","ddddd","1","0","0","0","11")
857MPY_ENC(M2_vmpy2su_s1,       "0101","ddddd","1","0","0","1","11")
858MPY_ENC(M4_pmpyw,            "0101","ddddd","1","0","1","0","11")
859MPY_ENC(M4_vpmpyh,           "0101","ddddd","1","0","1","1","11")
860MPY_ENC(M5_vmpybuu,          "0101","ddddd","0","0","0","1","01")
861MPY_ENC(M5_vmpybsu,          "0101","ddddd","0","0","1","0","01")
862
863
864
865
866DEF_FIELDROW_DESC32(ICLASS_M" 0110 -------- PP------ --------","[#6] Rxx=(Rs,Rt)")
867DEF_FIELD32(ICLASS_M"         0110 -------- PP------ --!-----",Mb_tH,"Rt is High") /*Rt high */
868DEF_FIELD32(ICLASS_M"         0110 -------- PP------ -!------",Mb_sH,"Rs is High") /* Rs high */
869SP_MPY(M2_mpyd_acc,          "0110","xxxxx","0","0","0")
870SP_MPY(M2_mpyud_acc,         "0110","xxxxx","0","0","1")
871SP_MPY(M2_mpyd_nac,          "0110","xxxxx","0","1","0")
872SP_MPY(M2_mpyud_nac,         "0110","xxxxx","0","1","1")
873
874
875DEF_FIELDROW_DESC32(ICLASS_M" 0111 -------- PP------ --------","[#7] Rxx=(Rs,Rt)")
876MPY_ENC(M2_dpmpyss_acc_s0,   "0111","xxxxx","0","0","0","0","00")
877MPY_ENC(M2_dpmpyss_nac_s0,   "0111","xxxxx","0","1","0","0","00")
878MPY_ENC(M2_dpmpyuu_acc_s0,   "0111","xxxxx","0","0","1","0","00")
879MPY_ENC(M2_dpmpyuu_nac_s0,   "0111","xxxxx","0","1","1","0","00")
880MPY_ENC(M2_vmac2s_s0,        "0111","xxxxx","1","0","0","0","01")
881MPY_ENC(M2_vmac2s_s1,        "0111","xxxxx","1","0","0","1","01")
882MPY_ENC(M2_cmaci_s0,         "0111","xxxxx","0","0","0","0","01")
883MPY_ENC(M2_cmacr_s0,         "0111","xxxxx","0","0","0","0","10")
884MPY_ENC(M2_cmacs_s0,         "0111","xxxxx","1","0","0","0","10")
885MPY_ENC(M2_cmacs_s1,         "0111","xxxxx","1","0","0","1","10")
886MPY_ENC(M2_cmacsc_s0,        "0111","xxxxx","1","0","1","0","10")
887MPY_ENC(M2_cmacsc_s1,        "0111","xxxxx","1","0","1","1","10")
888MPY_ENC(M2_vmac2,            "0111","xxxxx","0","1","0","0","01")
889MPY_ENC(M2_cnacs_s0,         "0111","xxxxx","1","0","0","0","11")
890MPY_ENC(M2_cnacs_s1,         "0111","xxxxx","1","0","0","1","11")
891MPY_ENC(M2_cnacsc_s0,        "0111","xxxxx","1","0","1","0","11")
892MPY_ENC(M2_cnacsc_s1,        "0111","xxxxx","1","0","1","1","11")
893MPY_ENC(M2_vmac2su_s0,       "0111","xxxxx","1","1","1","0","01")
894MPY_ENC(M2_vmac2su_s1,       "0111","xxxxx","1","1","1","1","01")
895MPY_ENC(M4_pmpyw_acc,        "0111","xxxxx","1","1","0","0","11")
896MPY_ENC(M4_vpmpyh_acc,       "0111","xxxxx","1","1","0","1","11")
897MPY_ENC(M5_vmacbuu,          "0111","xxxxx","0","0","0","1","01")
898MPY_ENC(M5_vmacbsu,          "0111","xxxxx","0","0","1","1","01")
899
900
901
902
903
904DEF_FIELDROW_DESC32(ICLASS_M" 1000 -------- PP------ --------","[#8] Rdd=(Rss,Rtt)")
905MPY_ENC(M2_vrcmpyi_s0,       "1000","ddddd","0","0","0","0","00")
906MPY_ENC(M2_vdmpys_s0,        "1000","ddddd","1","0","0","0","00")
907MPY_ENC(M2_vdmpys_s1,        "1000","ddddd","1","0","0","1","00")
908MPY_ENC(M2_vrcmpyi_s0c,      "1000","ddddd","0","0","1","0","00")
909MPY_ENC(M2_vabsdiffw,        "1000","ddddd","0","1","0","0","00")
910MPY_ENC(M6_vabsdiffub,       "1000","ddddd","0","1","0","1","00")
911MPY_ENC(M2_vabsdiffh,        "1000","ddddd","0","1","1","0","00")
912MPY_ENC(M6_vabsdiffb,        "1000","ddddd","0","1","1","1","00")
913MPY_ENC(M2_vrcmpys_s1_h,     "1000","ddddd","1","1","0","1","00")
914MPY_ENC(M2_vrcmpys_s1_l,     "1000","ddddd","1","1","1","1","00")
915MPY_ENC(M2_vrcmpyr_s0c,      "1000","ddddd","0","1","1","0","01")
916MPY_ENC(M2_vrcmpyr_s0,       "1000","ddddd","0","0","0","0","01")
917MPY_ENC(A2_vraddub,          "1000","ddddd","0","0","1","0","01")
918MPY_ENC(M2_mmpyl_s0,         "1000","ddddd","1","0","0","0","01")
919MPY_ENC(M2_mmpyl_s1,         "1000","ddddd","1","0","0","1","01")
920MPY_ENC(M2_mmpyl_rs0,        "1000","ddddd","1","1","0","0","01")
921MPY_ENC(M2_mmpyl_rs1,        "1000","ddddd","1","1","0","1","01")
922MPY_ENC(M2_mmpyul_s0,        "1000","ddddd","1","0","1","0","01")
923MPY_ENC(M2_mmpyul_s1,        "1000","ddddd","1","0","1","1","01")
924MPY_ENC(M2_mmpyul_rs0,       "1000","ddddd","1","1","1","0","01")
925MPY_ENC(M2_mmpyul_rs1,       "1000","ddddd","1","1","1","1","01")
926MPY_ENC(M2_vrmpy_s0,         "1000","ddddd","0","0","0","0","10")
927MPY_ENC(A2_vrsadub,          "1000","ddddd","0","0","1","0","10")
928MPY_ENC(M2_vmpy2es_s0,       "1000","ddddd","1","0","0","0","10")
929MPY_ENC(M2_vmpy2es_s1,       "1000","ddddd","1","0","0","1","10")
930MPY_ENC(M2_vcmpy_s0_sat_i,   "1000","ddddd","1","0","1","0","10")
931MPY_ENC(M2_vcmpy_s0_sat_r,   "1000","ddddd","1","1","0","0","10")
932MPY_ENC(M2_vcmpy_s1_sat_i,   "1000","ddddd","1","0","1","1","10")
933MPY_ENC(M2_vcmpy_s1_sat_r,   "1000","ddddd","1","1","0","1","10")
934
935MPY_ENC(M2_mmpyh_s0,         "1000","ddddd","1","0","0","0","11")
936MPY_ENC(M2_mmpyh_s1,         "1000","ddddd","1","0","0","1","11")
937MPY_ENC(M2_mmpyh_rs0,        "1000","ddddd","1","1","0","0","11")
938MPY_ENC(M2_mmpyh_rs1,        "1000","ddddd","1","1","0","1","11")
939MPY_ENC(M2_mmpyuh_s0,        "1000","ddddd","1","0","1","0","11")
940MPY_ENC(M2_mmpyuh_s1,        "1000","ddddd","1","0","1","1","11")
941MPY_ENC(M2_mmpyuh_rs0,       "1000","ddddd","1","1","1","0","11")
942MPY_ENC(M2_mmpyuh_rs1,       "1000","ddddd","1","1","1","1","11")
943
944MPY_ENC(M4_vrmpyeh_s0,       "1000","ddddd","1","0","1","0","00")
945MPY_ENC(M4_vrmpyeh_s1,       "1000","ddddd","1","0","1","1","00")
946MPY_ENC(M4_vrmpyoh_s0,       "1000","ddddd","0","1","0","0","10")
947MPY_ENC(M4_vrmpyoh_s1,       "1000","ddddd","0","1","0","1","10")
948MPY_ENC(M5_vrmpybuu,         "1000","ddddd","0","0","0","1","01")
949MPY_ENC(M5_vrmpybsu,         "1000","ddddd","0","0","1","1","01")
950MPY_ENC(M5_vdmpybsu,         "1000","ddddd","0","1","0","1","01")
951
952MPY_ENC(F2_dfadd,            "1000","ddddd","0","0","0","0","11")
953MPY_ENC(F2_dfsub,            "1000","ddddd","0","0","0","1","11")
954MPY_ENC(F2_dfmpyfix,         "1000","ddddd","0","0","1","0","11")
955MPY_ENC(F2_dfmin,            "1000","ddddd","0","0","1","1","11")
956MPY_ENC(F2_dfmax,            "1000","ddddd","0","1","0","0","11")
957MPY_ENC(F2_dfmpyll,          "1000","ddddd","0","1","0","1","11")
958
959MPY_ENC(M7_dcmpyrw,          "1000","ddddd","0","0","0","1","10")
960MPY_ENC(M7_dcmpyrwc,         "1000","ddddd","0","0","1","1","10")
961MPY_ENC(M7_dcmpyiw,          "1000","ddddd","0","1","1","0","10")
962MPY_ENC(M7_dcmpyiwc,         "1000","ddddd","0","1","1","1","10")
963
964
965
966DEF_FIELDROW_DESC32(ICLASS_M" 1001 -------- PP------ --------","[#9] Rd=(Rss,Rtt)")
967MPY_ENC(M2_vdmpyrs_s0,       "1001","ddddd","0","0","0","0","00")
968MPY_ENC(M2_vdmpyrs_s1,       "1001","ddddd","0","0","0","1","00")
969
970MPY_ENC(M7_wcmpyrw,          "1001","ddddd","0","0","1","0","00")
971MPY_ENC(M7_wcmpyrw_rnd,      "1001","ddddd","0","0","1","1","00")
972MPY_ENC(M7_wcmpyiw,          "1001","ddddd","0","1","0","0","00")
973MPY_ENC(M7_wcmpyiw_rnd,      "1001","ddddd","0","1","0","1","00")
974
975MPY_ENC(M7_wcmpyrwc,         "1001","ddddd","0","1","1","0","00")
976MPY_ENC(M7_wcmpyrwc_rnd,     "1001","ddddd","0","1","1","1","00")
977MPY_ENC(M7_wcmpyiwc,         "1001","ddddd","1","0","0","0","00")
978MPY_ENC(M7_wcmpyiwc_rnd,     "1001","ddddd","1","0","0","1","00")
979
980
981
982MPY_ENC(M2_vradduh,          "1001","ddddd","-","-","-","0","01")
983MPY_ENC(M2_vrcmpys_s1rp_h,   "1001","ddddd","1","1","-","1","10")
984MPY_ENC(M2_vrcmpys_s1rp_l,   "1001","ddddd","1","1","-","1","11")
985MPY_ENC(M2_vraddh,           "1001","ddddd","1","1","-","0","11")
986
987
988DEF_FIELDROW_DESC32(ICLASS_M" 1010 -------- PP------ --------","[#10] Rxx=(Rss,Rtt)")
989MPY_ENC(M2_vrcmaci_s0,       "1010","xxxxx","0","0","0","0","00")
990MPY_ENC(M2_vdmacs_s0,        "1010","xxxxx","1","0","0","0","00")
991MPY_ENC(M2_vdmacs_s1,        "1010","xxxxx","1","0","0","1","00")
992MPY_ENC(M2_vrcmaci_s0c,      "1010","xxxxx","0","0","1","0","00")
993MPY_ENC(M2_vcmac_s0_sat_i,   "1010","xxxxx","1","0","1","0","00")
994MPY_ENC(M2_vcmac_s0_sat_r,   "1010","xxxxx","1","1","0","0","00")
995MPY_ENC(M2_vrcmpys_acc_s1_h, "1010","xxxxx","1","1","0","1","00")
996MPY_ENC(M2_vrcmpys_acc_s1_l, "1010","xxxxx","1","1","1","1","00")
997MPY_ENC(M2_vrcmacr_s0,       "1010","xxxxx","0","0","0","0","01")
998MPY_ENC(A2_vraddub_acc,      "1010","xxxxx","0","0","1","0","01")
999MPY_ENC(M2_mmacls_s0,        "1010","xxxxx","1","0","0","0","01")
1000MPY_ENC(M2_mmacls_s1,        "1010","xxxxx","1","0","0","1","01")
1001MPY_ENC(M2_mmacls_rs0,       "1010","xxxxx","1","1","0","0","01")
1002MPY_ENC(M2_mmacls_rs1,       "1010","xxxxx","1","1","0","1","01")
1003MPY_ENC(M2_mmaculs_s0,       "1010","xxxxx","1","0","1","0","01")
1004MPY_ENC(M2_mmaculs_s1,       "1010","xxxxx","1","0","1","1","01")
1005MPY_ENC(M2_mmaculs_rs0,      "1010","xxxxx","1","1","1","0","01")
1006MPY_ENC(M2_mmaculs_rs1,      "1010","xxxxx","1","1","1","1","01")
1007MPY_ENC(M2_vrcmacr_s0c,      "1010","xxxxx","0","1","1","0","01")
1008MPY_ENC(M2_vrmac_s0,         "1010","xxxxx","0","0","0","0","10")
1009MPY_ENC(A2_vrsadub_acc,      "1010","xxxxx","0","0","1","0","10")
1010MPY_ENC(M2_vmac2es_s0,       "1010","xxxxx","1","0","0","0","10")
1011MPY_ENC(M2_vmac2es_s1,       "1010","xxxxx","1","0","0","1","10")
1012MPY_ENC(M2_vmac2es,          "1010","xxxxx","0","1","0","0","10")
1013MPY_ENC(M2_mmachs_s0,        "1010","xxxxx","1","0","0","0","11")
1014MPY_ENC(M2_mmachs_s1,        "1010","xxxxx","1","0","0","1","11")
1015MPY_ENC(M2_mmachs_rs0,       "1010","xxxxx","1","1","0","0","11")
1016MPY_ENC(M2_mmachs_rs1,       "1010","xxxxx","1","1","0","1","11")
1017MPY_ENC(M2_mmacuhs_s0,       "1010","xxxxx","1","0","1","0","11")
1018MPY_ENC(M2_mmacuhs_s1,       "1010","xxxxx","1","0","1","1","11")
1019MPY_ENC(M2_mmacuhs_rs0,      "1010","xxxxx","1","1","1","0","11")
1020MPY_ENC(M2_mmacuhs_rs1,      "1010","xxxxx","1","1","1","1","11")
1021MPY_ENC(M4_vrmpyeh_acc_s0,   "1010","xxxxx","1","1","0","0","10")
1022MPY_ENC(M4_vrmpyeh_acc_s1,   "1010","xxxxx","1","1","0","1","10")
1023MPY_ENC(M4_vrmpyoh_acc_s0,   "1010","xxxxx","1","1","1","0","10")
1024MPY_ENC(M4_vrmpyoh_acc_s1,   "1010","xxxxx","1","1","1","1","10")
1025MPY_ENC(M5_vrmacbuu,         "1010","xxxxx","0","0","0","1","01")
1026MPY_ENC(M5_vrmacbsu,         "1010","xxxxx","0","0","1","1","01")
1027MPY_ENC(M5_vdmacbsu,         "1010","xxxxx","0","1","0","0","01")
1028
1029MPY_ENC(F2_dfmpylh,          "1010","xxxxx","0","0","0","0","11")
1030MPY_ENC(F2_dfmpyhh,          "1010","xxxxx","0","0","0","1","11")
1031
1032
1033MPY_ENC(M7_dcmpyrw_acc,      "1010","xxxxx","0","0","0","1","10")
1034MPY_ENC(M7_dcmpyrwc_acc,     "1010","xxxxx","0","0","1","1","10")
1035MPY_ENC(M7_dcmpyiw_acc,      "1010","xxxxx","0","1","1","0","10")
1036MPY_ENC(M7_dcmpyiwc_acc,     "1010","xxxxx","1","0","1","0","10")
1037
1038
1039
1040
1041MPY_ENC(A5_ACS,              "1010","xxxxx","0","1","0","1","ee")
1042MPY_ENC(A6_vminub_RdP,       "1010","ddddd","0","1","1","1","ee")
1043/*
1044*/
1045
1046DEF_FIELDROW_DESC32(ICLASS_M" 1011 -------- PP------ --------","[#11] Reserved")
1047MPY_ENC(F2_sfadd,            "1011","ddddd","0","0","0","0","00")
1048MPY_ENC(F2_sfsub,            "1011","ddddd","0","0","0","0","01")
1049MPY_ENC(F2_sfmax,            "1011","ddddd","0","0","0","1","00")
1050MPY_ENC(F2_sfmin,            "1011","ddddd","0","0","0","1","01")
1051MPY_ENC(F2_sfmpy,            "1011","ddddd","0","0","1","0","00")
1052MPY_ENC(F2_sffixupn,         "1011","ddddd","0","0","1","1","00")
1053MPY_ENC(F2_sffixupd,         "1011","ddddd","0","0","1","1","01")
1054MPY_ENC(F2_sfrecipa,         "1011","ddddd","1","1","1","1","ee")
1055
1056DEF_FIELDROW_DESC32(ICLASS_M" 1100 -------- PP------ --------","[#12] Rd=(Rs,Rt)")
1057DEF_FIELD32(ICLASS_M"         1100 -------- PP------ --!-----",Mc_tH,"Rt is High") /*Rt high */
1058DEF_FIELD32(ICLASS_M"         1100 -------- PP------ -!------",Mc_sH,"Rs is High") /* Rs high */
1059SP_MPY(M2_mpy,               "1100","ddddd","0","0","0")
1060SP_MPY(M2_mpy_sat,           "1100","ddddd","1","0","0")
1061SP_MPY(M2_mpy_rnd,           "1100","ddddd","0","1","0")
1062SP_MPY(M2_mpy_sat_rnd,       "1100","ddddd","1","1","0")
1063SP_MPY(M2_mpyu,              "1100","ddddd","0","0","1")
1064
1065DEF_FIELDROW_DESC32(ICLASS_M" 1101 -------- PP------ --------","[#13] Rd=(Rs,Rt)")
1066/* EJP: same as mpyi MPY_ENC(M2_mpyui,            "1101","ddddd","0","0","1","0","00") */
1067MPY_ENC(M2_mpyi,             "1101","ddddd","0","0","0","0","00")
1068MPY_ENC(M2_mpy_up,           "1101","ddddd","0","0","0","0","01")
1069MPY_ENC(M2_mpyu_up,          "1101","ddddd","0","0","1","0","01")
1070MPY_ENC(M2_dpmpyss_rnd_s0,   "1101","ddddd","0","1","0","0","01")
1071MPY_ENC(M2_cmpyrs_s0,        "1101","ddddd","1","1","0","0","10")
1072MPY_ENC(M2_cmpyrs_s1,        "1101","ddddd","1","1","0","1","10")
1073MPY_ENC(M2_cmpyrsc_s0,       "1101","ddddd","1","1","1","0","10")
1074MPY_ENC(M2_cmpyrsc_s1,       "1101","ddddd","1","1","1","1","10")
1075MPY_ENC(M2_vmpy2s_s0pack,    "1101","ddddd","1","1","0","0","11")
1076MPY_ENC(M2_vmpy2s_s1pack,    "1101","ddddd","1","1","0","1","11")
1077MPY_ENC(M2_hmmpyh_rs1,       "1101","ddddd","1","1","0","1","00")
1078MPY_ENC(M2_hmmpyl_rs1,       "1101","ddddd","1","1","1","1","00")
1079
1080MPY_ENC(M2_hmmpyh_s1,        "1101","ddddd","0","1","0","1","00")
1081MPY_ENC(M2_hmmpyl_s1,        "1101","ddddd","0","1","0","1","01")
1082MPY_ENC(M2_mpy_up_s1,        "1101","ddddd","0","1","0","1","10")
1083MPY_ENC(M2_mpy_up_s1_sat,    "1101","ddddd","0","1","1","1","00")
1084MPY_ENC(M2_mpysu_up,         "1101","ddddd","0","1","1","0","01")
1085
1086
1087DEF_FIELDROW_DESC32(ICLASS_M" 1110 -------- PP------ --------","[#14] Rx=(Rs,Rt)")
1088DEF_FIELD32(ICLASS_M"         1110 -------- PP------ --!-----",Md_tH,"Rt is High") /*Rt high */
1089DEF_FIELD32(ICLASS_M"         1110 -------- PP------ -!------",Md_sH,"Rs is High") /* Rs high */
1090SP_MPY(M2_mpyu_acc,          "1110","xxxxx","0","0","1")
1091SP_MPY(M2_mpy_acc,           "1110","xxxxx","0","0","0")
1092SP_MPY(M2_mpy_acc_sat,       "1110","xxxxx","1","0","0")
1093SP_MPY(M2_mpyu_nac,          "1110","xxxxx","0","1","1")
1094SP_MPY(M2_mpy_nac,           "1110","xxxxx","0","1","0")
1095SP_MPY(M2_mpy_nac_sat,       "1110","xxxxx","1","1","0")
1096
1097
1098DEF_FIELDROW_DESC32(ICLASS_M" 1111 -------- PP------ --------","[#15] Rx=(Rs,Rt)")
1099MPY_ENC(M2_maci,             "1111","xxxxx","0","0","0","0","00")
1100MPY_ENC(M2_mnaci,            "1111","xxxxx","0","0","0","1","00")
1101MPY_ENC(M2_acci,             "1111","xxxxx","0","0","0","0","01")
1102MPY_ENC(M2_nacci,            "1111","xxxxx","0","0","0","1","01")
1103MPY_ENC(M2_xor_xacc,         "1111","xxxxx","0","0","0","1","11")
1104MPY_ENC(M2_subacc,           "1111","xxxxx","0","0","0","0","11")
1105
1106MPY_ENC(M4_mac_up_s1_sat,    "1111","xxxxx","0","1","1","0","00")
1107MPY_ENC(M4_nac_up_s1_sat,    "1111","xxxxx","0","1","1","0","01")
1108
1109MPY_ENC(M4_and_and,          "1111","xxxxx","0","0","1","0","00")
1110MPY_ENC(M4_and_or,           "1111","xxxxx","0","0","1","0","01")
1111MPY_ENC(M4_and_xor,          "1111","xxxxx","0","0","1","0","10")
1112MPY_ENC(M4_or_and,           "1111","xxxxx","0","0","1","0","11")
1113MPY_ENC(M4_or_or,            "1111","xxxxx","0","0","1","1","00")
1114MPY_ENC(M4_or_xor,           "1111","xxxxx","0","0","1","1","01")
1115MPY_ENC(M4_xor_and,          "1111","xxxxx","0","0","1","1","10")
1116MPY_ENC(M4_xor_or,           "1111","xxxxx","0","0","1","1","11")
1117
1118MPY_ENC(M4_or_andn,          "1111","xxxxx","0","1","0","0","00")
1119MPY_ENC(M4_and_andn,         "1111","xxxxx","0","1","0","0","01")
1120MPY_ENC(M4_xor_andn,         "1111","xxxxx","0","1","0","0","10")
1121
1122MPY_ENC(F2_sffma,            "1111","xxxxx","1","0","0","0","00")
1123MPY_ENC(F2_sffms,            "1111","xxxxx","1","0","0","0","01")
1124
1125MPY_ENC(F2_sffma_lib,        "1111","xxxxx","1","0","0","0","10")
1126MPY_ENC(F2_sffms_lib,        "1111","xxxxx","1","0","0","0","11")
1127
1128MPY_ENC(F2_sffma_sc,         "1111","xxxxx","1","1","1","0","uu")
1129
1130
1131/*******************************/
1132/*                             */
1133/*                             */
1134/*           ALU32_2op         */
1135/*                             */
1136/*                             */
1137/*******************************/
1138DEF_CLASS32(ICLASS_ADDI" ---- -------- PP------ --------",ALU32_ADDI)
1139
1140DEF_CLASS32(ICLASS_ALU2op" ---- -------- PP------ --------",ALU32_2op)
1141DEF_FIELD32(ICLASS_ALU2op" !--- -------- PP------ --------",A2_Rs,"No Rs read")
1142DEF_FIELD32(ICLASS_ALU2op" -!!! -------- PP------ --------",A2_MajOp,"Major Opcode")
1143DEF_FIELD32(ICLASS_ALU2op" ---- !!!----- PP------ --------",A2_MinOp,"Minor Opcode")
1144
1145DEF_FIELD32(ICLASS_ALU3op" -!!! -------- PP------ --------",A3_MajOp,"Major Opcode")
1146DEF_FIELD32(ICLASS_ALU3op" ---- !!!----- PP------ --------",A3_MinOp,"Minor Opcode")
1147DEF_CLASS32(ICLASS_ALU3op" ---- -------- PP------ --------",ALU32_3op)
1148DEF_FIELD32(ICLASS_ALU3op" !--- -------- PP------ --------",A3_P,"Predicated")
1149DEF_FIELD32(ICLASS_ALU3op" ---- -------- PP!----- --------",A3_DN,"Dot-new")
1150DEF_FIELD32(ICLASS_ALU3op" ---- -------- PP------ !-------",A3_PS,"Predicate sense")
1151
1152
1153/*************************/
1154/* Our good friend addi  */
1155/*************************/
1156DEF_ENC32(A2_addi,    ICLASS_ADDI"  iiii iiisssss PPiiiiii iiiddddd")
1157
1158
1159/*******************************/
1160/* Standard ALU32 insns        */
1161/*******************************/
1162
1163#define ALU32_IRR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1164DEF_ENC32(TAG, ICLASS_ALU2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"iiiii "VMIN3 DSTCHARS)
1165
1166#define ALU32_RR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1167DEF_ENC32(TAG, ICLASS_ALU2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"----- "VMIN3 DSTCHARS)
1168
1169#define CONDA32_RR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1170DEF_ENC32(TAG##t,   ICLASS_ALU2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"-00uu "VMIN3 DSTCHARS)\
1171DEF_ENC32(TAG##f,   ICLASS_ALU2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"-10uu "VMIN3 DSTCHARS)\
1172DEF_ENC32(TAG##tnew,ICLASS_ALU2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"-01uu "VMIN3 DSTCHARS)\
1173DEF_ENC32(TAG##fnew,ICLASS_ALU2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"-11uu "VMIN3 DSTCHARS)
1174
1175
1176DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0000 -------- PP------ --------","[#0] (Pu) Rd=(Rs)")
1177DEF_FIELD32(            ICLASS_ALU2op" 0000 -------- PP!----- --------",A32a_C,"Conditional")
1178DEF_FIELD32(            ICLASS_ALU2op" 0000 -------- PP--!--- --------",A32a_S,"Predicate sense")
1179DEF_FIELD32(            ICLASS_ALU2op" 0000 -------- PP---!-- --------",A32a_dn,"Dot-new")
1180
1181ALU32_RR_ENC(A2_aslh,                 "0000","000","0","---","ddddd")
1182ALU32_RR_ENC(A2_asrh,                 "0000","001","0","---","ddddd")
1183ALU32_RR_ENC(A2_tfr,                  "0000","011","0","---","ddddd")
1184ALU32_RR_ENC(A2_sxtb,                 "0000","101","0","---","ddddd")
1185ALU32_RR_ENC(A2_zxth,                 "0000","110","0","---","ddddd")
1186ALU32_RR_ENC(A2_sxth,                 "0000","111","0","---","ddddd")
1187
1188CONDA32_RR_ENC(A4_paslh,               "0000","000","1","---","ddddd")
1189CONDA32_RR_ENC(A4_pasrh,               "0000","001","1","---","ddddd")
1190CONDA32_RR_ENC(A4_pzxtb,               "0000","100","1","---","ddddd")
1191CONDA32_RR_ENC(A4_psxtb,               "0000","101","1","---","ddddd")
1192CONDA32_RR_ENC(A4_pzxth,               "0000","110","1","---","ddddd")
1193CONDA32_RR_ENC(A4_psxth,               "0000","111","1","---","ddddd")
1194
1195
1196DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0001 -------- PP------ --------","[#1] Rx=(#u16)")
1197DEF_ENC32(A2_tfril,     ICLASS_ALU2op" 0001 ii1xxxxx PPiiiiii iiiiiiii")
1198
1199
1200DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0010 -------- PP------ --------","[#2] Rx=(#u16)")
1201DEF_ENC32(A2_tfrih,     ICLASS_ALU2op" 0010 ii1xxxxx PPiiiiii iiiiiiii")
1202
1203
1204DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0011 -------- PP------ --------","[#3] Rd=(Pu,Rs,#s8)")
1205DEF_ENC32(C2_muxir,     ICLASS_ALU2op" 0011 0uusssss PP0iiiii iiiddddd")
1206DEF_ENC32(C2_muxri,     ICLASS_ALU2op" 0011 1uusssss PP0iiiii iiiddddd")
1207
1208DEF_ENC32(A4_combineri, ICLASS_ALU2op" 0011 -00sssss PP1iiiii iiiddddd") /* Rdd = (Rs,#s8) */
1209DEF_ENC32(A4_combineir, ICLASS_ALU2op" 0011 -01sssss PP1iiiii iiiddddd") /* Rdd = (Rs,#s8) */
1210DEF_ENC32(A4_rcmpeqi,   ICLASS_ALU2op" 0011 -10sssss PP1iiiii iiiddddd") /* Rd = (Rs,#s8) */
1211DEF_ENC32(A4_rcmpneqi,  ICLASS_ALU2op" 0011 -11sssss PP1iiiii iiiddddd") /* Rd = (Rs,#s8) */
1212
1213
1214DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0100 -------- PP------ --------","[#4] (Pu) Rd=(Rs,#s8)")
1215DEF_FIELD32(            ICLASS_ALU2op" 0100 -------- PP!----- --------",A32a_DN,"Dot-new")
1216DEF_FIELD32(            ICLASS_ALU2op" 0100 !------- PP------ --------",A32a_PS,"Predicate sense")
1217DEF_ENC32(A2_paddit,    ICLASS_ALU2op" 0100 0uusssss PP0iiiii iiiddddd")
1218DEF_ENC32(A2_padditnew, ICLASS_ALU2op" 0100 0uusssss PP1iiiii iiiddddd")
1219DEF_ENC32(A2_paddif,    ICLASS_ALU2op" 0100 1uusssss PP0iiiii iiiddddd")
1220DEF_ENC32(A2_paddifnew, ICLASS_ALU2op" 0100 1uusssss PP1iiiii iiiddddd")
1221
1222
1223DEF_FIELDROW_DESC32(     ICLASS_ALU2op" 0101 -------- PP------ --------","[#5] Pd=(Rs,#s10)")
1224DEF_ENC32(C2_cmpeqi,     ICLASS_ALU2op" 0101 00isssss PPiiiiii iii000dd")
1225DEF_ENC32(C2_cmpgti,     ICLASS_ALU2op" 0101 01isssss PPiiiiii iii000dd")
1226DEF_ENC32(C2_cmpgtui,    ICLASS_ALU2op" 0101 100sssss PPiiiiii iii000dd")
1227
1228DEF_ENC32(C4_cmpneqi,    ICLASS_ALU2op" 0101 00isssss PPiiiiii iii100dd")
1229DEF_ENC32(C4_cmpltei,    ICLASS_ALU2op" 0101 01isssss PPiiiiii iii100dd")
1230DEF_ENC32(C4_cmplteui,   ICLASS_ALU2op" 0101 100sssss PPiiiiii iii100dd")
1231
1232
1233DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0110 -------- PP------ --------","[#6] Rd=(Rs,#s10)")
1234ALU32_IRR_ENC(A2_andir,               "0110","00i","i","iii","ddddd")
1235ALU32_IRR_ENC(A2_subri,               "0110","01i","i","iii","ddddd")
1236ALU32_IRR_ENC(A2_orir,                "0110","10i","i","iii","ddddd")
1237
1238
1239DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 0111 -------- PP------ --------","[#7] Reserved")
1240
1241
1242DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 1000 -------- PP------ --------","[#8] Rd=#s16")
1243DEF_ENC32(A2_tfrsi,     ICLASS_ALU2op" 1000 ii-iiiii PPiiiiii iiiddddd")
1244
1245
1246DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 1001 -------- PP------ --------","[#9] Reserved")
1247
1248
1249DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 101- -------- PP------ --------","[#10,#11] Rd=(Pu,#s8,#S8)")
1250DEF_ENC32(C2_muxii,     ICLASS_ALU2op" 101u uIIIIIII PPIiiiii iiiddddd")
1251
1252
1253DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 1100 -------- PP------ --------","[#12] Rdd=(#s8,#S8)")
1254DEF_ENC32(A2_combineii, ICLASS_ALU2op" 1100 0IIIIIII PPIiiiii iiiddddd")
1255DEF_ENC32(A4_combineii, ICLASS_ALU2op" 1100 1--IIIII PPIiiiii iiiddddd")
1256
1257
1258DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 1101 -------- PP------ --------","[#13] Reserved")
1259
1260
1261DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 1110 -------- PP------ --------","[#14] (Pu) Rd=#s12")
1262DEF_FIELD32(            ICLASS_ALU2op" 1110 ---0---- PP!----- --------",A32c_DN,"Dot-new")
1263DEF_FIELD32(            ICLASS_ALU2op" 1110 !--0---- PP------ --------",A32c_PS,"Predicate sense")
1264DEF_ENC32(C2_cmovenewit,ICLASS_ALU2op" 1110 0uu0iiii PP1iiiii iiiddddd")
1265DEF_ENC32(C2_cmovenewif,ICLASS_ALU2op" 1110 1uu0iiii PP1iiiii iiiddddd")
1266DEF_ENC32(C2_cmoveit,   ICLASS_ALU2op" 1110 0uu0iiii PP0iiiii iiiddddd")
1267DEF_ENC32(C2_cmoveif,   ICLASS_ALU2op" 1110 1uu0iiii PP0iiiii iiiddddd")
1268
1269
1270DEF_FIELDROW_DESC32(    ICLASS_ALU2op" 1111 -------- PP------ --------","[#15] nop")
1271DEF_ENC32(A2_nop,       ICLASS_ALU2op" 1111 -------- PP------ --------")
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284/*******************************/
1285/*                             */
1286/*                             */
1287/*    ALU32_3op                */
1288/*                             */
1289/*                             */
1290/*******************************/
1291
1292
1293#define V2A32_RRR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1294DEF_ENC32(TAG, ICLASS_ALU3op" "MAJ4"  "MIN3"sssss  PP"SMOD1"ttttt "VMIN3 DSTCHARS)
1295
1296#define V2A32_RR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1297DEF_ENC32(TAG, ICLASS_ALU3op" "MAJ4"  "MIN3"sssss  PP"SMOD1"----- "VMIN3 DSTCHARS)
1298
1299
1300DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0000 -------- PP------ --------","[#0] Reserved")
1301
1302
1303DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0001 -------- PP------ --------","[#1] Rd=(Rs,Rt)")
1304V2A32_RRR_ENC(A2_and,              "0001","000","-","---","ddddd")
1305V2A32_RRR_ENC(A2_or,               "0001","001","-","---","ddddd")
1306V2A32_RRR_ENC(A2_xor,              "0001","011","-","---","ddddd")
1307V2A32_RRR_ENC(A4_andn,             "0001","100","-","---","ddddd")
1308V2A32_RRR_ENC(A4_orn,              "0001","101","-","---","ddddd")
1309
1310DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0010 -------- PP------ --------","[#2] Pd=(Rs,Rt)")
1311V2A32_RRR_ENC(C2_cmpeq,            "0010","-00","-","---","000dd")
1312V2A32_RRR_ENC(C2_cmpgt,            "0010","-10","-","---","000dd")
1313V2A32_RRR_ENC(C2_cmpgtu,           "0010","-11","-","---","000dd")
1314
1315V2A32_RRR_ENC(C4_cmpneq,           "0010","-00","-","---","100dd")
1316V2A32_RRR_ENC(C4_cmplte,           "0010","-10","-","---","100dd")
1317V2A32_RRR_ENC(C4_cmplteu,          "0010","-11","-","---","100dd")
1318
1319
1320DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0011 -------- PP------ --------","[#3] Rd=(Rs,Rt)")
1321V2A32_RRR_ENC(A2_add,              "0011","000","-","---","ddddd")
1322V2A32_RRR_ENC(A2_sub,              "0011","001","-","---","ddddd")
1323V2A32_RRR_ENC(A2_combine_hh,       "0011","100","-","---","ddddd")
1324V2A32_RRR_ENC(A2_combine_hl,       "0011","101","-","---","ddddd")
1325V2A32_RRR_ENC(A2_combine_lh,       "0011","110","-","---","ddddd")
1326V2A32_RRR_ENC(A2_combine_ll,       "0011","111","-","---","ddddd")
1327V2A32_RRR_ENC(A4_rcmpeq,           "0011","010","-","---","ddddd")
1328V2A32_RRR_ENC(A4_rcmpneq,          "0011","011","-","---","ddddd")
1329
1330
1331DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0100 -------- PP------ --------","[#4] Rd=(Pu,Rs,Rt)")
1332V2A32_RRR_ENC(C2_mux,              "0100","---","-","-uu","ddddd")
1333
1334
1335DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0101 -------- PP------ --------","[#5] Rdd=(Rs,Rt)")
1336V2A32_RRR_ENC(A2_combinew,         "0101","0--","-","---","ddddd")
1337V2A32_RRR_ENC(S2_packhl,           "0101","1--","-","---","ddddd")
1338
1339
1340DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0110 -------- PP------ --------","[#6] Rd=(Rs,Rt)")
1341V2A32_RRR_ENC(A2_svaddh,           "0110","000","-","---","ddddd")
1342V2A32_RRR_ENC(A2_svaddhs,          "0110","001","-","---","ddddd")
1343V2A32_RRR_ENC(A2_svadduhs,         "0110","011","-","---","ddddd")
1344V2A32_RRR_ENC(A2_svsubh,           "0110","100","-","---","ddddd")
1345V2A32_RRR_ENC(A2_svsubhs,          "0110","101","-","---","ddddd")
1346V2A32_RRR_ENC(A2_svsubuhs,         "0110","111","-","---","ddddd")
1347V2A32_RRR_ENC(A2_addsat,           "0110","010","-","---","ddddd")
1348V2A32_RRR_ENC(A2_subsat,           "0110","110","-","---","ddddd")
1349
1350
1351DEF_FIELDROW_DESC32(ICLASS_ALU3op"  0111 -------- PP------ --------","[#7] Rd=(Rs,Rt)")
1352V2A32_RRR_ENC(A2_svavgh,           "0111","-00","-","---","ddddd")
1353V2A32_RRR_ENC(A2_svavghs,          "0111","-01","-","---","ddddd")
1354V2A32_RRR_ENC(A2_svnavgh,          "0111","-11","-","---","ddddd")
1355
1356
1357DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1000 -------- PP------ --------","[#8] Reserved")
1358
1359
1360DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1001 -------- PP------ --------","[#9] (Pu) Rd=(Rs,Rt)")
1361V2A32_RRR_ENC(A2_pandt,            "1001","-00","0","0uu","ddddd")
1362V2A32_RRR_ENC(A2_pandtnew,         "1001","-00","1","0uu","ddddd")
1363V2A32_RRR_ENC(A2_pandf,            "1001","-00","0","1uu","ddddd")
1364V2A32_RRR_ENC(A2_pandfnew,         "1001","-00","1","1uu","ddddd")
1365V2A32_RRR_ENC(A2_port,             "1001","-01","0","0uu","ddddd")
1366V2A32_RRR_ENC(A2_portnew,          "1001","-01","1","0uu","ddddd")
1367V2A32_RRR_ENC(A2_porf,             "1001","-01","0","1uu","ddddd")
1368V2A32_RRR_ENC(A2_porfnew,          "1001","-01","1","1uu","ddddd")
1369V2A32_RRR_ENC(A2_pxort,            "1001","-11","0","0uu","ddddd")
1370V2A32_RRR_ENC(A2_pxortnew,         "1001","-11","1","0uu","ddddd")
1371V2A32_RRR_ENC(A2_pxorf,            "1001","-11","0","1uu","ddddd")
1372V2A32_RRR_ENC(A2_pxorfnew,         "1001","-11","1","1uu","ddddd")
1373
1374
1375DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1010 -------- PP------ --------","[#10] Reserved")
1376
1377
1378
1379DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1011 -------- PP------ --------","[#11] (Pu) Rd=(Rs,Rt)")
1380V2A32_RRR_ENC(A2_paddt,            "1011","0-0","0","0uu","ddddd")
1381V2A32_RRR_ENC(A2_paddtnew,         "1011","0-0","1","0uu","ddddd")
1382V2A32_RRR_ENC(A2_paddf,            "1011","0-0","0","1uu","ddddd")
1383V2A32_RRR_ENC(A2_paddfnew,         "1011","0-0","1","1uu","ddddd")
1384V2A32_RRR_ENC(A2_psubt,            "1011","0-1","0","0uu","ddddd")
1385V2A32_RRR_ENC(A2_psubtnew,         "1011","0-1","1","0uu","ddddd")
1386V2A32_RRR_ENC(A2_psubf,            "1011","0-1","0","1uu","ddddd")
1387V2A32_RRR_ENC(A2_psubfnew,         "1011","0-1","1","1uu","ddddd")
1388
1389
1390DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1100 -------- PP------ --------","[#12] Reserved")
1391
1392
1393DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1101 -------- PP------ --------","[#13] (Pu) Rdd=(Rs,Rt)")
1394V2A32_RRR_ENC(C2_ccombinewnewt,    "1101","000","1","0uu","ddddd")
1395V2A32_RRR_ENC(C2_ccombinewnewf,    "1101","000","1","1uu","ddddd")
1396V2A32_RRR_ENC(C2_ccombinewt,       "1101","000","0","0uu","ddddd")
1397V2A32_RRR_ENC(C2_ccombinewf,       "1101","000","0","1uu","ddddd")
1398
1399
1400
1401
1402
1403
1404DEF_FIELDROW_DESC32(ICLASS_ALU3op"  1110 -------- PP------ --------","[#14] Reserved")
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414/*******************************/
1415/*                             */
1416/*                             */
1417/*    S                        */
1418/*                             */
1419/*                             */
1420/*******************************/
1421
1422DEF_CLASS32(ICLASS_S2op" ---- -------- PP------ --------",S_2op)
1423DEF_FIELD32(ICLASS_S2op" !!!! -------- PP------ --------",STYPEB_RegType,"Register Type")
1424DEF_FIELD32(ICLASS_S2op" ---- !!------ PP------ --------",S2_MajOp,"Major Opcode")
1425DEF_FIELD32(ICLASS_S2op" ---- -------- PP------ !!!-----",S2_MinOp,"Minor Opcode")
1426
1427DEF_CLASS32(ICLASS_S3op" ---- -------- PP------ --------",S_3op)
1428DEF_FIELD32(ICLASS_S3op" !!!! -------- PP------ --------",STYPEA_RegType,"Register Type")
1429DEF_FIELD32(ICLASS_S3op" ---- !!------ PP------ --------",S3_Maj,"Major Opcode")
1430DEF_FIELD32(ICLASS_S3op" ---- -------- PP------ !!------",S3_Min,"Minor Opcode")
1431
1432
1433#define SH_RRR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1434DEF_ENC32(TAG,ICLASS_S3op" "MAJ4"  "MIN3"sssss  PP"SMOD1"ttttt "VMIN3 DSTCHARS)
1435
1436#define SH_RRRiENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1437DEF_ENC32(TAG,ICLASS_S3op" "MAJ4"  "MIN3"iiiii  PP"SMOD1"ttttt "VMIN3 DSTCHARS)
1438
1439#define SH_RRR_ENCX(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1440DEF_ENC32(TAG,ICLASS_S3op" "MAJ4"  "MIN3"sssss  PP"SMOD1"xxxxx "VMIN3 DSTCHARS)
1441
1442#define SH3_RR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1443DEF_ENC32(TAG,ICLASS_S3op" "MAJ4"  "MIN3"sssss  PP"SMOD1"----- "VMIN3 DSTCHARS)
1444
1445#define SH_PPP_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1446DEF_ENC32(TAG,ICLASS_S3op" "MAJ4"  "MIN3"---ss  PP"SMOD1"---tt "VMIN3 DSTCHARS)
1447
1448#define SH2_RR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1449DEF_ENC32(TAG,ICLASS_S2op" "MAJ4"  "MIN3"sssss  PP"SMOD1"----- "VMIN3 DSTCHARS)
1450
1451#define SH2_PPP_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS) \
1452DEF_ENC32(TAG,ICLASS_S2op" "MAJ4"  "MIN3"---ss  PP"SMOD1"---tt "VMIN3 DSTCHARS)
1453
1454#define SH_RRI4_ENC(TAG,MAJ4,MIN3,VMIN3,DSTCHARS) \
1455DEF_ENC32(TAG,ICLASS_S2op" "MAJ4" "MIN3 "sssss PP00iiii " VMIN3 DSTCHARS)
1456
1457#define SH_RRI5_ENC(TAG,MAJ4,MIN3,VMIN3,DSTCHARS) \
1458DEF_ENC32(TAG,ICLASS_S2op" "MAJ4" "MIN3 "sssss PP0iiiii " VMIN3 DSTCHARS)
1459
1460#define SH_RRI6_ENC(TAG,MAJ4,MIN3,VMIN3,DSTCHARS) \
1461DEF_ENC32(TAG,ICLASS_S2op" "MAJ4" "MIN3 "sssss PPiiiiii " VMIN3 DSTCHARS)
1462
1463#define RSHIFTTYPES(TAGEND,MAJ4,MIN3,SMOD1,DMOD1,DSTCHARS) \
1464SH_RRR_ENC(S2_asr_r_##TAGEND,MAJ4,MIN3,SMOD1,"00"DMOD1,DSTCHARS) \
1465SH_RRR_ENC(S2_lsr_r_##TAGEND,MAJ4,MIN3,SMOD1,"01"DMOD1,DSTCHARS) \
1466SH_RRR_ENC(S2_asl_r_##TAGEND,MAJ4,MIN3,SMOD1,"10"DMOD1,DSTCHARS) \
1467SH_RRR_ENC(S2_lsl_r_##TAGEND,MAJ4,MIN3,SMOD1,"11"DMOD1,DSTCHARS)
1468
1469
1470#define I5SHIFTTYPES(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1471SH_RRI5_ENC(S2_asr_i_##TAGEND,MAJ4,MIN3,SMOD1 "00",DSTCHARS) \
1472SH_RRI5_ENC(S2_lsr_i_##TAGEND,MAJ4,MIN3,SMOD1 "01",DSTCHARS) \
1473SH_RRI5_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS) \
1474SH_RRI5_ENC(S6_rol_i_##TAGEND,MAJ4,MIN3,SMOD1 "11",DSTCHARS)
1475
1476#define I5SHIFTTYPES_NOROL(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1477SH_RRI5_ENC(S2_asr_i_##TAGEND,MAJ4,MIN3,SMOD1 "00",DSTCHARS) \
1478SH_RRI5_ENC(S2_lsr_i_##TAGEND,MAJ4,MIN3,SMOD1 "01",DSTCHARS) \
1479SH_RRI5_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS)
1480
1481#define I5SHIFTTYPES_NOASR(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1482SH_RRI5_ENC(S2_lsr_i_##TAGEND,MAJ4,MIN3,SMOD1 "01",DSTCHARS) \
1483SH_RRI5_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS) \
1484SH_RRI5_ENC(S6_rol_i_##TAGEND,MAJ4,MIN3,SMOD1 "11",DSTCHARS)
1485
1486#define I4SHIFTTYPES(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1487SH_RRI4_ENC(S2_asr_i_##TAGEND,MAJ4,MIN3,SMOD1 "00",DSTCHARS) \
1488SH_RRI4_ENC(S2_lsr_i_##TAGEND,MAJ4,MIN3,SMOD1 "01",DSTCHARS) \
1489SH_RRI4_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS)
1490
1491#define I5ASHIFTTYPES(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1492SH_RRI5_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS)
1493
1494#define I4ASHIFTTYPES(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1495SH_RRI4_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS)
1496
1497#define I6SHIFTTYPES(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1498SH_RRI6_ENC(S2_asr_i_##TAGEND,MAJ4,MIN3,SMOD1 "00",DSTCHARS) \
1499SH_RRI6_ENC(S2_lsr_i_##TAGEND,MAJ4,MIN3,SMOD1 "01",DSTCHARS) \
1500SH_RRI6_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS) \
1501SH_RRI6_ENC(S6_rol_i_##TAGEND,MAJ4,MIN3,SMOD1 "11",DSTCHARS) \
1502
1503#define I6SHIFTTYPES_NOASR(TAGEND,MAJ4,MIN3,SMOD1,DSTCHARS) \
1504SH_RRI6_ENC(S2_lsr_i_##TAGEND,MAJ4,MIN3,SMOD1 "01",DSTCHARS) \
1505SH_RRI6_ENC(S2_asl_i_##TAGEND,MAJ4,MIN3,SMOD1 "10",DSTCHARS) \
1506SH_RRI6_ENC(S6_rol_i_##TAGEND,MAJ4,MIN3,SMOD1 "11",DSTCHARS)
1507
1508
1509
1510DEF_FIELDROW_DESC32(ICLASS_S2op" 0000 -------- PP------ --------","[#0] Rdd=(Rss,#u6)")
1511/* EJP: there is actually quite a bit of space here, look at the reserved bits */
1512I6SHIFTTYPES(p,                 "0000","000","0","ddddd")
1513I5SHIFTTYPES_NOROL(vw,          "0000","010","0","ddddd")
1514I4SHIFTTYPES(vh,                "0000","100","0","ddddd")
1515
1516
1517
1518/* False assume an immediate */
1519SH2_RR_ENC(S2_vsathub_nopack, "0000","000","-","1 00","ddddd")
1520SH2_RR_ENC(S2_vsatwuh_nopack, "0000","000","-","1 01","ddddd")
1521SH2_RR_ENC(S2_vsatwh_nopack,  "0000","000","-","1 10","ddddd")
1522SH2_RR_ENC(S2_vsathb_nopack,  "0000","000","-","1 11","ddddd")
1523
1524SH_RRI4_ENC(S5_vasrhrnd,      "0000","001",    "0 00","ddddd")
1525
1526SH2_RR_ENC(A2_vabsh,          "0000","010","-","1 00","ddddd")
1527SH2_RR_ENC(A2_vabshsat,       "0000","010","-","1 01","ddddd")
1528SH2_RR_ENC(A2_vabsw,          "0000","010","-","1 10","ddddd")
1529SH2_RR_ENC(A2_vabswsat,       "0000","010","-","1 11","ddddd")
1530
1531SH2_RR_ENC(A2_notp,           "0000","100","-","1 00","ddddd")
1532SH2_RR_ENC(A2_negp,           "0000","100","-","1 01","ddddd")
1533SH2_RR_ENC(A2_absp,           "0000","100","-","1 10","ddddd")
1534SH2_RR_ENC(A2_vconj,          "0000","100","-","1 11","ddddd")
1535
1536SH2_RR_ENC(S2_deinterleave,   "0000","110","-","1 00","ddddd")
1537SH2_RR_ENC(S2_interleave,     "0000","110","-","1 01","ddddd")
1538SH2_RR_ENC(S2_brevp,          "0000","110","-","1 10","ddddd")
1539SH_RRI6_ENC(S2_asr_i_p_rnd,   "0000","110",    "1 11","ddddd")
1540
1541SH2_RR_ENC(F2_conv_df2d,      "0000","111","0","0 00","ddddd")
1542SH2_RR_ENC(F2_conv_df2ud,     "0000","111","0","0 01","ddddd")
1543SH2_RR_ENC(F2_conv_ud2df,     "0000","111","0","0 10","ddddd")
1544SH2_RR_ENC(F2_conv_d2df,      "0000","111","0","0 11","ddddd")
1545SH2_RR_ENC(F2_conv_df2d_chop, "0000","111","0","1 10","ddddd")
1546SH2_RR_ENC(F2_conv_df2ud_chop,"0000","111","0","1 11","ddddd")
1547
1548
1549
1550DEF_FIELDROW_DESC32(ICLASS_S2op"    0001 -------- PP------ --------","[#1] Rdd=(Rss,#u6,#U6)")
1551DEF_ENC32(S2_extractup,ICLASS_S2op" 0001 IIIsssss PPiiiiii IIIddddd")
1552
1553
1554DEF_FIELDROW_DESC32(ICLASS_S2op" 0010 -------- PP------ --------","[#2] Rxx=(Rss,#u6)")
1555I6SHIFTTYPES(p_nac,             "0010","00-","0","xxxxx")
1556I6SHIFTTYPES(p_acc,             "0010","00-","1","xxxxx")
1557I6SHIFTTYPES(p_and,             "0010","01-","0","xxxxx")
1558I6SHIFTTYPES(p_or,              "0010","01-","1","xxxxx")
1559I6SHIFTTYPES_NOASR(p_xacc,      "0010","10-","0","xxxxx")
1560
1561
1562DEF_FIELDROW_DESC32(ICLASS_S2op"  0011 -------- PP------ --------","[#3] Rxx=(Rss,#u6,#U6)")
1563DEF_ENC32(S2_insertp,ICLASS_S2op" 0011 IIIsssss PPiiiiii IIIxxxxx")
1564
1565
1566DEF_FIELDROW_DESC32(ICLASS_S2op"  0100 -------- PP------ --------","[#4] Rdd=(Rs)")
1567SH2_RR_ENC(S2_vsxtbh,            "0100","00-","-","00-","ddddd")
1568SH2_RR_ENC(S2_vzxtbh,            "0100","00-","-","01-","ddddd")
1569SH2_RR_ENC(S2_vsxthw,            "0100","00-","-","10-","ddddd")
1570SH2_RR_ENC(S2_vzxthw,            "0100","00-","-","11-","ddddd")
1571SH2_RR_ENC(A2_sxtw,              "0100","01-","-","00-","ddddd")
1572SH2_RR_ENC(S2_vsplatrh,          "0100","01-","-","01-","ddddd")
1573SH2_RR_ENC(S6_vsplatrbp,         "0100","01-","-","10-","ddddd")
1574
1575SH2_RR_ENC(F2_conv_sf2df,        "0100","1--","-","000","ddddd")
1576SH2_RR_ENC(F2_conv_uw2df,        "0100","1--","-","001","ddddd")
1577SH2_RR_ENC(F2_conv_w2df,         "0100","1--","-","010","ddddd")
1578SH2_RR_ENC(F2_conv_sf2ud,        "0100","1--","-","011","ddddd")
1579SH2_RR_ENC(F2_conv_sf2d,         "0100","1--","-","100","ddddd")
1580SH2_RR_ENC(F2_conv_sf2ud_chop,   "0100","1--","-","101","ddddd")
1581SH2_RR_ENC(F2_conv_sf2d_chop,    "0100","1--","-","110","ddddd")
1582
1583
1584DEF_FIELDROW_DESC32(ICLASS_S2op"   0101 -------- PP------ --------","[#5] Pd=(Rs,#u6)")
1585DEF_ENC32(S2_tstbit_i,ICLASS_S2op" 0101 000sssss PP0iiiii ------dd")
1586DEF_ENC32(C2_tfrrp,   ICLASS_S2op" 0101 010sssss PP------ ------dd")
1587DEF_ENC32(C2_bitsclri,ICLASS_S2op" 0101 100sssss PPiiiiii ------dd")
1588DEF_ENC32(S4_ntstbit_i,ICLASS_S2op"0101 001sssss PP0iiiii ------dd")
1589DEF_ENC32(C4_nbitsclri,ICLASS_S2op"0101 101sssss PPiiiiii ------dd")
1590DEF_ENC32(F2_sfclass,  ICLASS_S2op"0101 111sssss PP0iiiii ------dd")
1591
1592
1593DEF_FIELDROW_DESC32(ICLASS_S2op"   0110 -------- PP------ --------","[#6] Rdd=(Pt)")
1594DEF_ENC32(C2_mask, ICLASS_S2op"    0110   --- -----  PP----tt --- ddddd")
1595
1596
1597DEF_FIELDROW_DESC32(ICLASS_S2op"    0111 -------- PP------ --------","[#7] Rx=(Rs,#u4,#S6)")
1598DEF_ENC32(S2_tableidxb,ICLASS_S2op" 0111 00isssss PPIIIIII iiixxxxx")
1599DEF_ENC32(S2_tableidxh,ICLASS_S2op" 0111 01isssss PPIIIIII iiixxxxx")
1600DEF_ENC32(S2_tableidxw,ICLASS_S2op" 0111 10isssss PPIIIIII iiixxxxx")
1601DEF_ENC32(S2_tableidxd,ICLASS_S2op" 0111 11isssss PPIIIIII iiixxxxx")
1602
1603
1604DEF_FIELDROW_DESC32(ICLASS_S2op"   1000 -------- PP------ --------","[#8] Rd=(Rss,#u6)")
1605SH2_RR_ENC(S2_vsathub,            "1000","000","-","000","ddddd")
1606SH2_RR_ENC(S2_vsatwh,             "1000","000","-","010","ddddd")
1607SH2_RR_ENC(S2_vsatwuh,            "1000","000","-","100","ddddd")
1608SH2_RR_ENC(S2_vsathb,             "1000","000","-","110","ddddd")
1609SH2_RR_ENC(S2_clbp,               "1000","010","-","000","ddddd")
1610SH2_RR_ENC(S2_cl0p,               "1000","010","-","010","ddddd")
1611SH2_RR_ENC(S2_cl1p,               "1000","010","-","100","ddddd")
1612SH2_RR_ENC(S2_ct0p,               "1000","111","-","010","ddddd")
1613SH2_RR_ENC(S2_ct1p,               "1000","111","-","100","ddddd")
1614SH2_RR_ENC(S2_vtrunohb,           "1000","100","-","000","ddddd")
1615SH2_RR_ENC(S2_vtrunehb,           "1000","100","-","010","ddddd")
1616SH2_RR_ENC(S2_vrndpackwh,         "1000","100","-","100","ddddd")
1617SH2_RR_ENC(S2_vrndpackwhs,        "1000","100","-","110","ddddd")
1618SH2_RR_ENC(A2_sat,                "1000","110","-","000","ddddd")
1619SH2_RR_ENC(A2_roundsat,           "1000","110","-","001","ddddd")
1620SH_RRI5_ENC(S2_asr_i_svw_trun,    "1000","110",    "010","ddddd")
1621SH_RRI5_ENC(A4_bitspliti,         "1000","110",    "100","ddddd")
1622
1623SH_RRI5_ENC(A7_clip,              "1000","110",    "101","ddddd")
1624SH_RRI5_ENC(A7_vclip,             "1000","110",    "110","ddddd")
1625
1626
1627SH2_RR_ENC(S4_clbpnorm,           "1000","011","-","000","ddddd")
1628SH_RRI6_ENC(S4_clbpaddi,          "1000","011",    "010","ddddd")
1629SH2_RR_ENC(S5_popcountp,          "1000","011","-","011","ddddd")
1630
1631SH_RRI4_ENC(S5_asrhub_rnd_sat,    "1000","011",    "100","ddddd")
1632SH_RRI4_ENC(S5_asrhub_sat,        "1000","011",    "101","ddddd")
1633
1634SH2_RR_ENC(F2_conv_df2sf,         "1000","000","-","001","ddddd")
1635SH2_RR_ENC(F2_conv_ud2sf,         "1000","001","-","001","ddddd")
1636SH2_RR_ENC(F2_conv_d2sf,          "1000","010","-","001","ddddd")
1637SH2_RR_ENC(F2_conv_df2uw,         "1000","011","-","001","ddddd")
1638SH2_RR_ENC(F2_conv_df2w,          "1000","100","-","001","ddddd")
1639SH2_RR_ENC(F2_conv_df2uw_chop,    "1000","101","-","001","ddddd")
1640SH2_RR_ENC(F2_conv_df2w_chop,     "1000","111","-","001","ddddd")
1641
1642
1643
1644DEF_FIELDROW_DESC32(ICLASS_S2op"   1001 -------- PP------ --------","[#9] Rd=(Ps,Pt)")
1645DEF_ENC32(C2_vitpack, ICLASS_S2op" 1001   -00 ---ss  PP----tt --- ddddd")
1646DEF_ENC32(C2_tfrpr,   ICLASS_S2op" 1001   -1- ---ss  PP------ --- ddddd")
1647
1648
1649DEF_FIELDROW_DESC32(ICLASS_S2op"   1010 -------- PP------ --------","[#10] Rdd=(Rss,#u6,#U6)")
1650DEF_ENC32(S4_extractp,ICLASS_S2op" 1010 IIIsssss PPiiiiii IIIddddd")
1651
1652
1653DEF_FIELDROW_DESC32(ICLASS_S2op"   1011 -------- PP------ --------","[#11] Rd=(Rs)")
1654SH2_RR_ENC(F2_conv_uw2sf,         "1011","001","-","000","ddddd")
1655SH2_RR_ENC(F2_conv_w2sf,          "1011","010","-","000","ddddd")
1656SH2_RR_ENC(F2_conv_sf2uw,         "1011","011","-","000","ddddd")
1657SH2_RR_ENC(F2_conv_sf2w,          "1011","100","-","000","ddddd")
1658SH2_RR_ENC(F2_conv_sf2uw_chop,    "1011","011","-","001","ddddd")
1659SH2_RR_ENC(F2_conv_sf2w_chop,     "1011","100","-","001","ddddd")
1660SH2_RR_ENC(F2_sffixupr,           "1011","101","-","000","ddddd")
1661SH2_RR_ENC(F2_sfinvsqrta,         "1011","111","-","0ee","ddddd")
1662
1663
1664DEF_FIELDROW_DESC32(ICLASS_S2op"      1100 -------- PP------ --------","[#12] Rd=(Rs,#u6)")
1665I5SHIFTTYPES(r,                      "1100","000",            "0  ","ddddd")
1666SH_RRI5_ENC(S2_asl_i_r_sat,          "1100","010",            "010","ddddd")
1667SH_RRI5_ENC(S2_asr_i_r_rnd,          "1100","010",            "000","ddddd")
1668
1669SH2_RR_ENC(S2_svsathb,               "1100","10-","-",        "00-","ddddd")
1670SH2_RR_ENC(S2_svsathub,              "1100","10-","-",        "01-","ddddd")
1671
1672SH_RRI5_ENC(A4_cround_ri,            "1100","111",            "00-","ddddd")
1673SH_RRI6_ENC(A7_croundd_ri,           "1100","111",            "01-","ddddd")
1674SH_RRI5_ENC(A4_round_ri,             "1100","111",            "10-","ddddd")
1675SH_RRI5_ENC(A4_round_ri_sat,         "1100","111",            "11-","ddddd")
1676
1677DEF_ENC32(S2_setbit_i,   ICLASS_S2op" 1100   110sssss PP0iiiii 000ddddd")
1678DEF_ENC32(S2_clrbit_i,   ICLASS_S2op" 1100   110sssss PP0iiiii 001ddddd")
1679DEF_ENC32(S2_togglebit_i,ICLASS_S2op" 1100   110sssss PP0iiiii 010ddddd")
1680
1681DEF_ENC32(S4_clbaddi    ,ICLASS_S2op" 1100   001sssss PPiiiiii 000ddddd")
1682
1683
1684
1685/* False read #u6 */
1686SH2_RR_ENC(S2_clb,                   "1100","000","-","1 00","ddddd")
1687SH2_RR_ENC(S2_cl0,                   "1100","000","-","1 01","ddddd")
1688SH2_RR_ENC(S2_cl1,                   "1100","000","-","1 10","ddddd")
1689SH2_RR_ENC(S2_clbnorm,               "1100","000","-","1 11","ddddd")
1690SH2_RR_ENC(S2_ct0,                   "1100","010","-","1 00","ddddd")
1691SH2_RR_ENC(S2_ct1,                   "1100","010","-","1 01","ddddd")
1692SH2_RR_ENC(S2_brev,                  "1100","010","-","1 10","ddddd")
1693SH2_RR_ENC(S2_vsplatrb,              "1100","010","-","1 11","ddddd")
1694SH2_RR_ENC(A2_abs,                   "1100","100","-","1 00","ddddd")
1695SH2_RR_ENC(A2_abssat,                "1100","100","-","1 01","ddddd")
1696SH2_RR_ENC(A2_negsat,                "1100","100","-","1 10","ddddd")
1697SH2_RR_ENC(A2_swiz,                  "1100","100","-","1 11","ddddd")
1698SH2_RR_ENC(A2_sath,                  "1100","110","-","1 00","ddddd")
1699SH2_RR_ENC(A2_satuh,                 "1100","110","-","1 01","ddddd")
1700SH2_RR_ENC(A2_satub,                 "1100","110","-","1 10","ddddd")
1701SH2_RR_ENC(A2_satb,                  "1100","110","-","1 11","ddddd")
1702
1703
1704DEF_FIELDROW_DESC32(ICLASS_S2op"     1101 -------- PP------ --------","[#13] Rd=(Rs,#u6,#U6)")
1705DEF_ENC32(S2_extractu,  ICLASS_S2op" 1101 0IIsssss PP0iiiii IIIddddd")
1706DEF_ENC32(S4_extract,   ICLASS_S2op" 1101 1IIsssss PP0iiiii IIIddddd")
1707DEF_ENC32(S2_mask,    ICLASS_S2op"   1101 0II----- PP1iiiii IIIddddd")
1708
1709
1710
1711
1712
1713
1714DEF_FIELDROW_DESC32(ICLASS_S2op"     1110 -------- PP------ --------","[#14] Rx=(Rs,#u6)")
1715I5SHIFTTYPES(r_nac,       "1110","00-","0","xxxxx")
1716I5SHIFTTYPES(r_acc,       "1110","00-","1","xxxxx")
1717I5SHIFTTYPES(r_and,       "1110","01-","0","xxxxx")
1718I5SHIFTTYPES(r_or,        "1110","01-","1","xxxxx")
1719I5SHIFTTYPES_NOASR(r_xacc,"1110","10-","0","xxxxx")
1720
1721
1722DEF_FIELDROW_DESC32(ICLASS_S2op"     1111 -------- PP------ --------","[#15] Rs=(Rs,#u6,#U6)")
1723DEF_ENC32(S2_insert,    ICLASS_S2op" 1111 0IIsssss PP0iiiii IIIxxxxx")
1724
1725
1726
1727
1728
1729/*************************/
1730/* S_3_operand           */
1731/*************************/
1732
1733
1734DEF_FIELDROW_DESC32(ICLASS_S3op" 0000 -------- PP------ --------","[#0] Rdd=(Rss,Rtt,#u3)")
1735SH_RRR_ENC(S2_valignib,         "0000","0--","-","iii","ddddd")
1736SH_RRR_ENC(S2_vspliceib,        "0000","1--","-","iii","ddddd")
1737
1738
1739DEF_FIELDROW_DESC32(ICLASS_S3op" 0001 -------- PP------ --------","[#1] Rdd=(Rss,Rtt)")
1740SH_RRR_ENC(S2_extractup_rp,     "0001","00-","-","00-","ddddd")
1741SH_RRR_ENC(S2_shuffeb,          "0001","00-","-","01-","ddddd")
1742SH_RRR_ENC(S2_shuffob,          "0001","00-","-","10-","ddddd")
1743SH_RRR_ENC(S2_shuffeh,          "0001","00-","-","11-","ddddd")
1744
1745SH_RRR_ENC(S2_shuffoh,          "0001","10-","-","000","ddddd")
1746SH_RRR_ENC(S2_vtrunewh,         "0001","10-","-","010","ddddd")
1747SH_RRR_ENC(S6_vtrunehb_ppp,     "0001","10-","-","011","ddddd")
1748SH_RRR_ENC(S2_vtrunowh,         "0001","10-","-","100","ddddd")
1749SH_RRR_ENC(S6_vtrunohb_ppp,     "0001","10-","-","101","ddddd")
1750SH_RRR_ENC(S2_lfsp,             "0001","10-","-","110","ddddd")
1751
1752SH_RRR_ENC(S4_vxaddsubw,        "0001","01-","-","000","ddddd")
1753SH_RRR_ENC(A5_vaddhubs,         "0001","01-","-","001","ddddd")
1754SH_RRR_ENC(S4_vxsubaddw,        "0001","01-","-","010","ddddd")
1755SH_RRR_ENC(S4_vxaddsubh,        "0001","01-","-","100","ddddd")
1756SH_RRR_ENC(S4_vxsubaddh,        "0001","01-","-","110","ddddd")
1757
1758SH_RRR_ENC(S4_vxaddsubhr,       "0001","11-","-","00-","ddddd")
1759SH_RRR_ENC(S4_vxsubaddhr,       "0001","11-","-","01-","ddddd")
1760SH_RRR_ENC(S4_extractp_rp,      "0001","11-","-","10-","ddddd")
1761SH_RRR_ENC(S2_cabacdecbin,      "0001","11-","-","11-","ddddd") /* implicit P0 write */
1762
1763
1764DEF_FIELDROW_DESC32(ICLASS_S3op" 0010 -------- PP------ --------","[#2] Rdd=(Rss,Rtt,Pu)")
1765SH_RRR_ENC(S2_valignrb,         "0010","0--","-","-uu","ddddd")
1766SH_RRR_ENC(S2_vsplicerb,        "0010","100","-","-uu","ddddd")
1767SH_RRR_ENC(A4_addp_c,           "0010","110","-","-xx","ddddd")
1768SH_RRR_ENC(A4_subp_c,           "0010","111","-","-xx","ddddd")
1769
1770
1771DEF_FIELDROW_DESC32(ICLASS_S3op" 0011 -------- PP------ --------","[#3] Rdd=(Rss,Rt)")
1772RSHIFTTYPES(vw,                 "0011","00-","-","-","ddddd")
1773RSHIFTTYPES(vh,                 "0011","01-","-","-","ddddd")
1774RSHIFTTYPES(p,                  "0011","10-","-","-","ddddd")
1775SH_RRR_ENC(S2_vcrotate,         "0011","11-","-","00-","ddddd")
1776SH_RRR_ENC(S2_vcnegh,           "0011","11-","-","01-","ddddd")
1777SH_RRR_ENC(S4_vrcrotate,        "0011","11-","i","11i","ddddd")
1778
1779
1780DEF_FIELDROW_DESC32(ICLASS_S3op" 0100 -------- PP------ --------","[#4] Rd=(Rs,Rt,#u3)")
1781DEF_ENC32(S2_addasl_rrri, ICLASS_S3op" 0100   000 sssss PP0ttttt iiiddddd")
1782
1783
1784
1785DEF_FIELDROW_DESC32(ICLASS_S3op" 0101 -------- PP------ --------","[#5] Rd=(Rss,Rt)")
1786SH_RRR_ENC(S2_asr_r_svw_trun,   "0101","---","-","010","ddddd")
1787SH_RRR_ENC(M4_cmpyi_wh,         "0101","---","-","100","ddddd")
1788SH_RRR_ENC(M4_cmpyr_wh,         "0101","---","-","110","ddddd")
1789SH_RRR_ENC(M4_cmpyi_whc,        "0101","---","-","101","ddddd")
1790SH_RRR_ENC(M4_cmpyr_whc,        "0101","---","-","111","ddddd")
1791
1792DEF_FIELDROW_DESC32(ICLASS_S3op" 0110 -------- PP------ --------","[#6] Rd=(Rs,Rt)")
1793SH_RRR_ENC(S2_asr_r_r_sat,      "0110","00-","-","00-","ddddd") \
1794SH_RRR_ENC(S2_asl_r_r_sat,      "0110","00-","-","10-","ddddd")
1795
1796RSHIFTTYPES(r,                  "0110","01-","-","-","ddddd")
1797
1798SH_RRR_ENC(S2_setbit_r,         "0110","10-","-","00-","ddddd")
1799SH_RRR_ENC(S2_clrbit_r,         "0110","10-","-","01-","ddddd")
1800SH_RRR_ENC(S2_togglebit_r,      "0110","10-","-","10-","ddddd")
1801SH_RRRiENC(S4_lsli,             "0110","10-","-","11i","ddddd")
1802
1803SH_RRR_ENC(A4_cround_rr,        "0110","11-","-","00-","ddddd")
1804SH_RRR_ENC(A7_croundd_rr,       "0110","11-","-","01-","ddddd")
1805SH_RRR_ENC(A4_round_rr,         "0110","11-","-","10-","ddddd")
1806SH_RRR_ENC(A4_round_rr_sat,     "0110","11-","-","11-","ddddd")
1807
1808
1809
1810
1811DEF_FIELDROW_DESC32(ICLASS_S3op" 0111 -------- PP------ --------","[#7] Pd=(Rs,Rt)")
1812SH_RRR_ENC(S2_tstbit_r,         "0111","000","-","---","---dd")
1813SH_RRR_ENC(C2_bitsset,          "0111","010","-","---","---dd")
1814SH_RRR_ENC(C2_bitsclr,          "0111","100","-","---","---dd")
1815SH_RRR_ENC(A4_cmpheq,           "0111","110","-","011","---dd")
1816SH_RRR_ENC(A4_cmphgt,           "0111","110","-","100","---dd")
1817SH_RRR_ENC(A4_cmphgtu,          "0111","110","-","101","---dd")
1818SH_RRR_ENC(A4_cmpbeq,           "0111","110","-","110","---dd")
1819SH_RRR_ENC(A4_cmpbgtu,          "0111","110","-","111","---dd")
1820SH_RRR_ENC(A4_cmpbgt,           "0111","110","-","010","---dd")
1821SH_RRR_ENC(S4_ntstbit_r,        "0111","001","-","---","---dd")
1822SH_RRR_ENC(C4_nbitsset,         "0111","011","-","---","---dd")
1823SH_RRR_ENC(C4_nbitsclr,         "0111","101","-","---","---dd")
1824
1825SH_RRR_ENC(F2_sfcmpge,          "0111","111","-","000","---dd")
1826SH_RRR_ENC(F2_sfcmpuo,          "0111","111","-","001","---dd")
1827SH_RRR_ENC(F2_sfcmpeq,          "0111","111","-","011","---dd")
1828SH_RRR_ENC(F2_sfcmpgt,          "0111","111","-","100","---dd")
1829
1830
1831DEF_FIELDROW_DESC32(ICLASS_S3op" 1000 -------- PP------ --------","[#8] Rx=(Rs,Rtt)")
1832SH_RRR_ENC(S2_insert_rp,        "1000","---","-","---","xxxxx")
1833
1834
1835DEF_FIELDROW_DESC32(ICLASS_S3op" 1001 -------- PP------ --------","[#9] Rd=(Rs,Rtt)")
1836SH_RRR_ENC(S2_extractu_rp,      "1001","00-","-","00-","ddddd")
1837SH_RRR_ENC(S4_extract_rp,       "1001","00-","-","01-","ddddd")
1838
1839
1840DEF_FIELDROW_DESC32(ICLASS_S3op" 1010 -------- PP------ --------","[#10] Rxx=(Rss,Rtt)")
1841SH_RRR_ENC(S2_insertp_rp,       "1010","0--","0","---","xxxxx")
1842SH_RRR_ENC(M4_xor_xacc,         "1010","10-","0","000","xxxxx")
1843
1844DEF_FIELDROW_DESC32(ICLASS_S3op" 1011 -------- PP------ --------","[#11] Rxx=(Rss,Rt)")
1845RSHIFTTYPES(p_or,               "1011","000","-","-","xxxxx")
1846RSHIFTTYPES(p_and,              "1011","010","-","-","xxxxx")
1847RSHIFTTYPES(p_nac,              "1011","100","-","-","xxxxx")
1848RSHIFTTYPES(p_acc,              "1011","110","-","-","xxxxx")
1849RSHIFTTYPES(p_xor,              "1011","011","-","-","xxxxx")
1850
1851SH_RRR_ENCX(A4_vrmaxh,          "1011","001","0","001","uuuuu")
1852SH_RRR_ENCX(A4_vrmaxuh,         "1011","001","1","001","uuuuu")
1853SH_RRR_ENCX(A4_vrmaxw,          "1011","001","0","010","uuuuu")
1854SH_RRR_ENCX(A4_vrmaxuw,         "1011","001","1","010","uuuuu")
1855
1856SH_RRR_ENCX(A4_vrminh,          "1011","001","0","101","uuuuu")
1857SH_RRR_ENCX(A4_vrminuh,         "1011","001","1","101","uuuuu")
1858SH_RRR_ENCX(A4_vrminw,          "1011","001","0","110","uuuuu")
1859SH_RRR_ENCX(A4_vrminuw,         "1011","001","1","110","uuuuu")
1860
1861SH_RRR_ENC(S2_vrcnegh,          "1011","001","1","111","xxxxx")
1862
1863SH_RRR_ENC(S4_vrcrotate_acc,    "1011","101","i","--i","xxxxx")
1864
1865
1866DEF_FIELDROW_DESC32(ICLASS_S3op" 1100 -------- PP------ --------","[#12] Rx=(Rs,Rt)")
1867RSHIFTTYPES(r_or,               "1100","00-","-","-","xxxxx")
1868RSHIFTTYPES(r_and,              "1100","01-","-","-","xxxxx")
1869RSHIFTTYPES(r_nac,              "1100","10-","-","-","xxxxx")
1870RSHIFTTYPES(r_acc,              "1100","11-","-","-","xxxxx")
1871
1872
1873DEF_FIELDROW_DESC32(ICLASS_S3op" 1101 -------- PP------ --------","[#13] Reserved")
1874DEF_FIELDROW_DESC32(ICLASS_S3op" 1110 -------- PP------ --------","[#14] Reserved")
1875
1876
1877DEF_FIELDROW_DESC32(ICLASS_S3op" 1111 -------- PP------ --------","[#14] User Instruction")
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891/*******************************/
1892/*                             */
1893/*                             */
1894/*           ALU64             */
1895/*                             */
1896/*                             */
1897/*******************************/
1898DEF_CLASS32(ICLASS_ALU64" ---- -------- PP------ --------",ALU64)
1899DEF_FIELD32(ICLASS_ALU64" !!!! -------- PP------ --------",ALU64_RegType,"Register Type")
1900DEF_FIELD32(ICLASS_ALU64" 0--- !!!----- PP------ --------",A_MajOp,"Major Opcode")
1901DEF_FIELD32(ICLASS_ALU64" 0--- -------- PP------ !!!-----",A_MinOp,"Minor Opcode")
1902DEF_FIELD32(ICLASS_ALU64" 11-- -------- PP------ ---!!!!!",A_MajOp,"Major Opcode")
1903
1904
1905
1906#define ALU64_RRR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1907DEF_ENC32(TAG, ICLASS_ALU64" "MAJ4"  "MIN3"sssss  PP"SMOD1"ttttt "VMIN3 DSTCHARS)
1908
1909#define LEGACY_ALU64_RRR_ENC(TAG,MAJ4,MIN3,SMOD1,VMIN3,DSTCHARS)\
1910LEGACY_DEF_ENC32(TAG, ICLASS_ALU64" "MAJ4"  "MIN3"sssss  PP"SMOD1"ttttt "VMIN3 DSTCHARS)
1911
1912
1913DEF_FIELDROW_DESC32(ICLASS_ALU64" 0000 -------- PP------ --------","[#0] Rd=(Rss,Rtt)")
1914ALU64_RRR_ENC(S2_parityp,        "0000","---","-","---","ddddd")
1915
1916
1917DEF_FIELDROW_DESC32(ICLASS_ALU64" 0001 -------- PP------ --------","[#1] Rdd=(Pu,Rss,Rtt)")
1918ALU64_RRR_ENC(C2_vmux,           "0001","---","-","-uu","ddddd")
1919
1920
1921DEF_FIELDROW_DESC32(ICLASS_ALU64" 0010 -------- PP------ --------","[#2] Pd=(Rss,Rtt)")
1922ALU64_RRR_ENC(A2_vcmpweq,        "0010","0--","0","000","---dd")
1923ALU64_RRR_ENC(A2_vcmpwgt,        "0010","0--","0","001","---dd")
1924ALU64_RRR_ENC(A2_vcmpwgtu,       "0010","0--","0","010","---dd")
1925ALU64_RRR_ENC(A2_vcmpheq,        "0010","0--","0","011","---dd")
1926ALU64_RRR_ENC(A2_vcmphgt,        "0010","0--","0","100","---dd")
1927ALU64_RRR_ENC(A2_vcmphgtu,       "0010","0--","0","101","---dd")
1928ALU64_RRR_ENC(A2_vcmpbeq,        "0010","0--","0","110","---dd")
1929ALU64_RRR_ENC(A2_vcmpbgtu,       "0010","0--","0","111","---dd")
1930
1931ALU64_RRR_ENC(A4_vcmpbeq_any,    "0010","0--","1","000","---dd")
1932ALU64_RRR_ENC(A6_vcmpbeq_notany, "0010","0--","1","001","---dd")
1933ALU64_RRR_ENC(A4_vcmpbgt,        "0010","0--","1","010","---dd")
1934ALU64_RRR_ENC(A4_tlbmatch,       "0010","0--","1","011","---dd")
1935ALU64_RRR_ENC(A4_boundscheck_lo, "0010","0--","1","100","---dd")
1936ALU64_RRR_ENC(A4_boundscheck_hi, "0010","0--","1","101","---dd")
1937
1938ALU64_RRR_ENC(C2_cmpeqp,         "0010","100","-","000","---dd")
1939ALU64_RRR_ENC(C2_cmpgtp,         "0010","100","-","010","---dd")
1940ALU64_RRR_ENC(C2_cmpgtup,        "0010","100","-","100","---dd")
1941
1942ALU64_RRR_ENC(F2_dfcmpeq,        "0010","111","-","000","---dd")
1943ALU64_RRR_ENC(F2_dfcmpgt,        "0010","111","-","001","---dd")
1944ALU64_RRR_ENC(F2_dfcmpge,        "0010","111","-","010","---dd")
1945ALU64_RRR_ENC(F2_dfcmpuo,        "0010","111","-","011","---dd")
1946
1947
1948DEF_FIELDROW_DESC32(ICLASS_ALU64" 0011 -------- PP------ --------","[#3] Rdd=(Rss,Rtt)")
1949ALU64_RRR_ENC(A2_vaddub,         "0011","000","-","000","ddddd")
1950ALU64_RRR_ENC(A2_vaddubs,        "0011","000","-","001","ddddd")
1951ALU64_RRR_ENC(A2_vaddh,          "0011","000","-","010","ddddd")
1952ALU64_RRR_ENC(A2_vaddhs,         "0011","000","-","011","ddddd")
1953ALU64_RRR_ENC(A2_vadduhs,        "0011","000","-","100","ddddd")
1954ALU64_RRR_ENC(A2_vaddw,          "0011","000","-","101","ddddd")
1955ALU64_RRR_ENC(A2_vaddws,         "0011","000","-","110","ddddd")
1956ALU64_RRR_ENC(A2_addp,           "0011","000","-","111","ddddd")
1957
1958ALU64_RRR_ENC(A2_vsubub,         "0011","001","-","000","ddddd")
1959ALU64_RRR_ENC(A2_vsububs,        "0011","001","-","001","ddddd")
1960ALU64_RRR_ENC(A2_vsubh,          "0011","001","-","010","ddddd")
1961ALU64_RRR_ENC(A2_vsubhs,         "0011","001","-","011","ddddd")
1962ALU64_RRR_ENC(A2_vsubuhs,        "0011","001","-","100","ddddd")
1963ALU64_RRR_ENC(A2_vsubw,          "0011","001","-","101","ddddd")
1964ALU64_RRR_ENC(A2_vsubws,         "0011","001","-","110","ddddd")
1965ALU64_RRR_ENC(A2_subp,           "0011","001","-","111","ddddd")
1966
1967ALU64_RRR_ENC(A2_vavgub,         "0011","010","-","000","ddddd")
1968ALU64_RRR_ENC(A2_vavgubr,        "0011","010","-","001","ddddd")
1969ALU64_RRR_ENC(A2_vavgh,          "0011","010","-","010","ddddd")
1970ALU64_RRR_ENC(A2_vavghr,         "0011","010","-","011","ddddd")
1971ALU64_RRR_ENC(A2_vavghcr,        "0011","010","-","100","ddddd")
1972ALU64_RRR_ENC(A2_vavguh,         "0011","010","-","101","ddddd")
1973ALU64_RRR_ENC(A2_vavguhr,        "0011","010","-","11-","ddddd")
1974
1975ALU64_RRR_ENC(A2_vavgw,          "0011","011","-","000","ddddd")
1976ALU64_RRR_ENC(A2_vavgwr,         "0011","011","-","001","ddddd")
1977ALU64_RRR_ENC(A2_vavgwcr,        "0011","011","-","010","ddddd")
1978ALU64_RRR_ENC(A2_vavguw,         "0011","011","-","011","ddddd")
1979ALU64_RRR_ENC(A2_vavguwr,        "0011","011","-","100","ddddd")
1980ALU64_RRR_ENC(A2_addpsat,        "0011","011","-","101","ddddd")
1981ALU64_RRR_ENC(A2_addspl,         "0011","011","-","110","ddddd")
1982ALU64_RRR_ENC(A2_addsph,         "0011","011","-","111","ddddd")
1983
1984ALU64_RRR_ENC(A2_vnavgh,         "0011","100","-","000","ddddd")
1985ALU64_RRR_ENC(A2_vnavghr,        "0011","100","-","001","ddddd")
1986ALU64_RRR_ENC(A2_vnavghcr,       "0011","100","-","010","ddddd")
1987ALU64_RRR_ENC(A2_vnavgw,         "0011","100","-","011","ddddd")
1988ALU64_RRR_ENC(A2_vnavgwr,        "0011","100","-","10-","ddddd")
1989ALU64_RRR_ENC(A2_vnavgwcr,       "0011","100","-","11-","ddddd")
1990
1991ALU64_RRR_ENC(A2_vminub,         "0011","101","-","000","ddddd")
1992ALU64_RRR_ENC(A2_vminh,          "0011","101","-","001","ddddd")
1993ALU64_RRR_ENC(A2_vminuh,         "0011","101","-","010","ddddd")
1994ALU64_RRR_ENC(A2_vminw,          "0011","101","-","011","ddddd")
1995ALU64_RRR_ENC(A2_vminuw,         "0011","101","-","100","ddddd")
1996ALU64_RRR_ENC(A2_vmaxuw,         "0011","101","-","101","ddddd")
1997ALU64_RRR_ENC(A2_minp,           "0011","101","-","110","ddddd")
1998ALU64_RRR_ENC(A2_minup,          "0011","101","-","111","ddddd")
1999
2000ALU64_RRR_ENC(A2_vmaxub,         "0011","110","-","000","ddddd")
2001ALU64_RRR_ENC(A2_vmaxh,          "0011","110","-","001","ddddd")
2002ALU64_RRR_ENC(A2_vmaxuh,         "0011","110","-","010","ddddd")
2003ALU64_RRR_ENC(A2_vmaxw,          "0011","110","-","011","ddddd")
2004ALU64_RRR_ENC(A2_maxp,           "0011","110","-","100","ddddd")
2005ALU64_RRR_ENC(A2_maxup,          "0011","110","-","101","ddddd")
2006ALU64_RRR_ENC(A2_vmaxb,          "0011","110","-","110","ddddd")
2007ALU64_RRR_ENC(A2_vminb,          "0011","110","-","111","ddddd")
2008
2009ALU64_RRR_ENC(A2_andp,           "0011","111","-","000","ddddd")
2010ALU64_RRR_ENC(A2_orp,            "0011","111","-","010","ddddd")
2011ALU64_RRR_ENC(A2_xorp,           "0011","111","-","100","ddddd")
2012ALU64_RRR_ENC(A4_andnp,          "0011","111","-","001","ddddd")
2013ALU64_RRR_ENC(A4_ornp,           "0011","111","-","011","ddddd")
2014
2015ALU64_RRR_ENC(A4_modwrapu,       "0011","111","-","111","ddddd")
2016
2017
2018
2019DEF_FIELDROW_DESC32(ICLASS_ALU64" 0100 -------- PP------ --------","[#4] Rdd=(Rs,Rt)")
2020LEGACY_ALU64_RRR_ENC(S2_packhl,  "0100","--0","-","---","ddddd")
2021ALU64_RRR_ENC(A4_bitsplit,       "0100","--1","-","---","ddddd")
2022
2023
2024DEF_FIELDROW_DESC32(ICLASS_ALU64" 0101 -------- PP------ --------","[#5] Rd=(Rs,Rt)")
2025ALU64_RRR_ENC(A2_addh_l16_ll,    "0101","000","-","00-","ddddd")
2026ALU64_RRR_ENC(A2_addh_l16_hl,    "0101","000","-","01-","ddddd")
2027ALU64_RRR_ENC(A2_addh_l16_sat_ll,"0101","000","-","10-","ddddd")
2028ALU64_RRR_ENC(A2_addh_l16_sat_hl,"0101","000","-","11-","ddddd")
2029
2030ALU64_RRR_ENC(A2_subh_l16_ll,    "0101","001","-","00-","ddddd")
2031ALU64_RRR_ENC(A2_subh_l16_hl,    "0101","001","-","01-","ddddd")
2032ALU64_RRR_ENC(A2_subh_l16_sat_ll,"0101","001","-","10-","ddddd")
2033ALU64_RRR_ENC(A2_subh_l16_sat_hl,"0101","001","-","11-","ddddd")
2034
2035ALU64_RRR_ENC(A2_addh_h16_ll,    "0101","010","-","000","ddddd")
2036ALU64_RRR_ENC(A2_addh_h16_lh,    "0101","010","-","001","ddddd")
2037ALU64_RRR_ENC(A2_addh_h16_hl,    "0101","010","-","010","ddddd")
2038ALU64_RRR_ENC(A2_addh_h16_hh,    "0101","010","-","011","ddddd")
2039ALU64_RRR_ENC(A2_addh_h16_sat_ll,"0101","010","-","100","ddddd")
2040ALU64_RRR_ENC(A2_addh_h16_sat_lh,"0101","010","-","101","ddddd")
2041ALU64_RRR_ENC(A2_addh_h16_sat_hl,"0101","010","-","110","ddddd")
2042ALU64_RRR_ENC(A2_addh_h16_sat_hh,"0101","010","-","111","ddddd")
2043
2044ALU64_RRR_ENC(A2_subh_h16_ll,    "0101","011","-","000","ddddd")
2045ALU64_RRR_ENC(A2_subh_h16_lh,    "0101","011","-","001","ddddd")
2046ALU64_RRR_ENC(A2_subh_h16_hl,    "0101","011","-","010","ddddd")
2047ALU64_RRR_ENC(A2_subh_h16_hh,    "0101","011","-","011","ddddd")
2048ALU64_RRR_ENC(A2_subh_h16_sat_ll,"0101","011","-","100","ddddd")
2049ALU64_RRR_ENC(A2_subh_h16_sat_lh,"0101","011","-","101","ddddd")
2050ALU64_RRR_ENC(A2_subh_h16_sat_hl,"0101","011","-","110","ddddd")
2051ALU64_RRR_ENC(A2_subh_h16_sat_hh,"0101","011","-","111","ddddd")
2052
2053LEGACY_ALU64_RRR_ENC(A2_addsat,  "0101","100","-","0--","ddddd")
2054LEGACY_ALU64_RRR_ENC(A2_subsat,  "0101","100","-","1--","ddddd")
2055
2056ALU64_RRR_ENC(A2_min,            "0101","101","-","0--","ddddd")
2057ALU64_RRR_ENC(A2_minu,           "0101","101","-","1--","ddddd")
2058
2059ALU64_RRR_ENC(A2_max,            "0101","110","-","0--","ddddd")
2060ALU64_RRR_ENC(A2_maxu,           "0101","110","-","1--","ddddd")
2061
2062ALU64_RRR_ENC(S4_parity,         "0101","111","-","---","ddddd")
2063
2064
2065DEF_FIELDROW_DESC32(ICLASS_ALU64" 0110 -------- PP------ --------","[#6] Rd=#u10 ")
2066DEF_ENC32(F2_sfimm_p,     ICLASS_ALU64" 0110   00i ----- PPiiiiii iiiddddd")
2067DEF_ENC32(F2_sfimm_n,     ICLASS_ALU64" 0110   01i ----- PPiiiiii iiiddddd")
2068
2069
2070DEF_FIELDROW_DESC32(ICLASS_ALU64" 0111 -------- PP------ --------","[#7] Rd=(Rs,Rt,#u6)")
2071DEF_ENC32(M4_mpyrr_addi,  ICLASS_ALU64" 0111   0ii sssss PPittttt iiiddddd")
2072
2073
2074DEF_FIELDROW_DESC32(ICLASS_ALU64" 1000 -------- PP------ --------","[#8] Rd=(Rs,#u6,#U6)")
2075DEF_ENC32(M4_mpyri_addi,  ICLASS_ALU64" 1000   Iii sssss PPiddddd iiiIIIII")
2076
2077
2078DEF_FIELDROW_DESC32(ICLASS_ALU64" 1001 -------- PP------ --------","[#9] Rdd=#u10 ")
2079DEF_ENC32(F2_dfimm_p,     ICLASS_ALU64" 1001   00i ----- PPiiiiii iiiddddd")
2080DEF_ENC32(F2_dfimm_n,     ICLASS_ALU64" 1001   01i ----- PPiiiiii iiiddddd")
2081
2082
2083DEF_FIELDROW_DESC32(ICLASS_ALU64" 1010 -------- PP------ --------","[#10] Rx=(Rs,Rx,#s10)")
2084DEF_ENC32(S4_or_andix,    ICLASS_ALU64" 1010   01i xxxxx PPiiiiii iiiuuuuu")
2085DEF_ENC32(S4_or_andi,     ICLASS_ALU64" 1010   00i sssss PPiiiiii iiixxxxx")
2086DEF_ENC32(S4_or_ori,      ICLASS_ALU64" 1010   10i sssss PPiiiiii iiixxxxx")
2087
2088
2089DEF_FIELDROW_DESC32(ICLASS_ALU64" 1011 -------- PP------ --------","[#11] Rd=(Rs,Rd,#s6)")
2090DEF_ENC32(S4_addaddi,     ICLASS_ALU64" 1011   0ii sssss PPiddddd iiiuuuuu")
2091DEF_ENC32(S4_subaddi,     ICLASS_ALU64" 1011   1ii sssss PPiddddd iiiuuuuu")
2092
2093
2094DEF_FIELDROW_DESC32(ICLASS_ALU64"     1100 -------- PP------ --------","[#12] Pd=(Rss,#s8)")
2095DEF_ENC32(A4_vcmpbeqi,   ICLASS_ALU64"1100 000sssss PP-iiiii iii00-dd")
2096DEF_ENC32(A4_vcmpbgti,   ICLASS_ALU64"1100 001sssss PP-iiiii iii00-dd")
2097DEF_ENC32(A4_vcmpbgtui,  ICLASS_ALU64"1100 010sssss PP-0iiii iii00-dd")
2098DEF_ENC32(A4_vcmpheqi,   ICLASS_ALU64"1100 000sssss PP-iiiii iii01-dd")
2099DEF_ENC32(A4_vcmphgti,   ICLASS_ALU64"1100 001sssss PP-iiiii iii01-dd")
2100DEF_ENC32(A4_vcmphgtui,  ICLASS_ALU64"1100 010sssss PP-0iiii iii01-dd")
2101DEF_ENC32(A4_vcmpweqi,   ICLASS_ALU64"1100 000sssss PP-iiiii iii10-dd")
2102DEF_ENC32(A4_vcmpwgti,   ICLASS_ALU64"1100 001sssss PP-iiiii iii10-dd")
2103DEF_ENC32(A4_vcmpwgtui,  ICLASS_ALU64"1100 010sssss PP-0iiii iii10-dd")
2104
2105DEF_ENC32(F2_dfclass,    ICLASS_ALU64"1100 100sssss PP-000ii iii10-dd")
2106
2107
2108DEF_FIELDROW_DESC32(ICLASS_ALU64" 1101 -------- PP------ --------","[#13] Pd=(Rs,#s8)")
2109DEF_ENC32(A4_cmpbeqi,    ICLASS_ALU64"1101 -00sssss PP-iiiii iii00-dd")
2110DEF_ENC32(A4_cmpbgti,    ICLASS_ALU64"1101 -01sssss PP-iiiii iii00-dd")
2111DEF_ENC32(A4_cmpbgtui,   ICLASS_ALU64"1101 -10sssss PP-0iiii iii00-dd")
2112DEF_ENC32(A4_cmpheqi,    ICLASS_ALU64"1101 -00sssss PP-iiiii iii01-dd")
2113DEF_ENC32(A4_cmphgti,    ICLASS_ALU64"1101 -01sssss PP-iiiii iii01-dd")
2114DEF_ENC32(A4_cmphgtui,   ICLASS_ALU64"1101 -10sssss PP-0iiii iii01-dd")
2115
2116
2117DEF_FIELDROW_DESC32(ICLASS_ALU64" 1110 -------- PP------ --------","[#14] Rx=(#u9,op(Rx,#u5))")
2118
2119#define OP_OPI_RI(TAG,OPB)\
2120DEF_ENC32(S4_andi_##TAG##_ri,ICLASS_ALU64" 1110 iiixxxxx PPiIIIII iii"OPB"i00-")\
2121DEF_ENC32(S4_ori_##TAG##_ri, ICLASS_ALU64" 1110 iiixxxxx PPiIIIII iii"OPB"i01-")\
2122DEF_ENC32(S4_addi_##TAG##_ri,ICLASS_ALU64" 1110 iiixxxxx PPiIIIII iii"OPB"i10-")\
2123DEF_ENC32(S4_subi_##TAG##_ri,ICLASS_ALU64" 1110 iiixxxxx PPiIIIII iii"OPB"i11-")
2124
2125OP_OPI_RI(asl,"0")
2126OP_OPI_RI(lsr,"1")
2127
2128
2129DEF_FIELDROW_DESC32(ICLASS_ALU64" 1111 -------- PP------ --------","[#15] Rd=(Rs,Ru,#u6:2)")
2130DEF_ENC32(M4_mpyri_addr_u2, ICLASS_ALU64" 1111   0ii sssss PPiddddd iiiuuuuu")
2131DEF_ENC32(M4_mpyri_addr,    ICLASS_ALU64" 1111   1ii sssss PPiddddd iiiuuuuu")
2132