1 /* ISA definitions header for compact.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2010 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifndef DEFS_SH64_COMPACT_H
26 #define DEFS_SH64_COMPACT_H
28 /* Instruction argument buffer. */
31 struct { /* no operands */
43 } sfmt_movw10_compact;
51 } sfmt_movl10_compact;
59 } sfmt_movi20_compact;
72 } sfmt_movl12_compact;
89 /* Writeback handler. */
91 /* Pointer to argbuf entry for insn whose results need writing back. */
92 const struct argbuf *abuf;
94 /* x-before handler */
96 /*const SCACHE *insns[MAX_PARALLEL_INSNS];*/
103 /* This entry is used to terminate each pbb. */
105 /* Number of insns in pbb. */
107 /* Next pbb to execute. */
109 SCACHE *branch_target;
114 /* The ARGBUF struct. */
116 /* These are the baseclass definitions. */
121 /* ??? Temporary hack for skip insns. */
124 /* cpu specific data follows */
127 union sem_fields fields;
132 ??? SCACHE used to contain more than just argbuf. We could delete the
133 type entirely and always just use ARGBUF, but for future concerns and as
134 a level of abstraction it is left in. */
137 struct argbuf argbuf;
140 /* Macros to simplify extraction, reading and semantic code.
141 These define and assign the local vars that contain the insn's fields. */
143 #define EXTRACT_IFMT_EMPTY_VARS \
145 #define EXTRACT_IFMT_EMPTY_CODE \
148 #define EXTRACT_IFMT_ADD_COMPACT_VARS \
154 #define EXTRACT_IFMT_ADD_COMPACT_CODE \
156 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
157 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
158 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
159 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
161 #define EXTRACT_IFMT_ADDI_COMPACT_VARS \
166 #define EXTRACT_IFMT_ADDI_COMPACT_CODE \
168 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
169 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
170 f_imm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
172 #define EXTRACT_IFMT_AND_COMPACT_VARS \
178 #define EXTRACT_IFMT_AND_COMPACT_CODE \
180 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
181 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
182 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
183 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
185 #define EXTRACT_IFMT_ANDI_COMPACT_VARS \
189 #define EXTRACT_IFMT_ANDI_COMPACT_CODE \
191 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
192 f_imm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
194 #define EXTRACT_IFMT_ANDB_COMPACT_VARS \
198 #define EXTRACT_IFMT_ANDB_COMPACT_CODE \
200 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
201 f_imm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
203 #define EXTRACT_IFMT_BF_COMPACT_VARS \
207 #define EXTRACT_IFMT_BF_COMPACT_CODE \
209 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
210 f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (1))) + (((pc) + (4)))); \
212 #define EXTRACT_IFMT_BRA_COMPACT_VARS \
216 #define EXTRACT_IFMT_BRA_COMPACT_CODE \
218 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
219 f_disp12 = ((((EXTRACT_MSB0_SINT (insn, 16, 4, 12)) << (1))) + (((pc) + (4)))); \
221 #define EXTRACT_IFMT_BRAF_COMPACT_VARS \
226 #define EXTRACT_IFMT_BRAF_COMPACT_CODE \
228 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
229 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
230 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
232 #define EXTRACT_IFMT_BRK_COMPACT_VARS \
235 #define EXTRACT_IFMT_BRK_COMPACT_CODE \
237 f_op16 = EXTRACT_MSB0_UINT (insn, 16, 0, 16); \
239 #define EXTRACT_IFMT_FABS_COMPACT_VARS \
244 #define EXTRACT_IFMT_FABS_COMPACT_CODE \
246 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
247 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
248 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
250 #define EXTRACT_IFMT_FADD_COMPACT_VARS \
256 #define EXTRACT_IFMT_FADD_COMPACT_CODE \
258 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
259 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
260 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
261 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
263 #define EXTRACT_IFMT_FCNVDS_COMPACT_VARS \
269 #define EXTRACT_IFMT_FCNVDS_COMPACT_CODE \
271 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
272 f_dn = ((EXTRACT_MSB0_UINT (insn, 16, 4, 3)) << (1)); \
273 f_7_1 = EXTRACT_MSB0_UINT (insn, 16, 7, 1); \
274 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
276 #define EXTRACT_IFMT_FIPR_COMPACT_VARS \
282 #define EXTRACT_IFMT_FIPR_COMPACT_CODE \
284 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
285 f_vn = ((EXTRACT_MSB0_UINT (insn, 16, 4, 2)) << (2)); \
286 f_vm = ((EXTRACT_MSB0_UINT (insn, 16, 6, 2)) << (2)); \
287 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
289 #define EXTRACT_IFMT_FLDS_COMPACT_VARS \
294 #define EXTRACT_IFMT_FLDS_COMPACT_CODE \
296 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
297 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
298 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
300 #define EXTRACT_IFMT_FMAC_COMPACT_VARS \
306 #define EXTRACT_IFMT_FMAC_COMPACT_CODE \
308 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
309 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
310 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
311 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
313 #define EXTRACT_IFMT_FMOV1_COMPACT_VARS \
319 #define EXTRACT_IFMT_FMOV1_COMPACT_CODE \
321 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
322 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
323 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
324 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
326 #define EXTRACT_IFMT_FMOV2_COMPACT_VARS \
332 #define EXTRACT_IFMT_FMOV2_COMPACT_CODE \
334 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
335 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
336 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
337 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
339 #define EXTRACT_IFMT_FMOV5_COMPACT_VARS \
345 #define EXTRACT_IFMT_FMOV5_COMPACT_CODE \
347 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
348 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
349 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
350 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
352 #define EXTRACT_IFMT_FMOV8_COMPACT_VARS \
361 #define EXTRACT_IFMT_FMOV8_COMPACT_CODE \
363 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
364 f_dn = ((EXTRACT_MSB0_UINT (insn, 32, 4, 3)) << (1)); \
365 f_7_1 = EXTRACT_MSB0_UINT (insn, 32, 7, 1); \
366 f_rm = EXTRACT_MSB0_UINT (insn, 32, 8, 4); \
367 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
368 f_16_4 = EXTRACT_MSB0_UINT (insn, 32, 16, 4); \
369 f_imm12x8 = ((EXTRACT_MSB0_SINT (insn, 32, 20, 12)) << (3)); \
371 #define EXTRACT_IFMT_FMOV9_COMPACT_VARS \
380 #define EXTRACT_IFMT_FMOV9_COMPACT_CODE \
382 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
383 f_rn = EXTRACT_MSB0_UINT (insn, 32, 4, 4); \
384 f_dm = ((EXTRACT_MSB0_UINT (insn, 32, 8, 3)) << (1)); \
385 f_11_1 = EXTRACT_MSB0_UINT (insn, 32, 11, 1); \
386 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
387 f_16_4 = EXTRACT_MSB0_UINT (insn, 32, 16, 4); \
388 f_imm12x8 = ((EXTRACT_MSB0_SINT (insn, 32, 20, 12)) << (3)); \
390 #define EXTRACT_IFMT_FTRV_COMPACT_VARS \
395 #define EXTRACT_IFMT_FTRV_COMPACT_CODE \
397 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
398 f_vn = ((EXTRACT_MSB0_UINT (insn, 16, 4, 2)) << (2)); \
399 f_sub10 = EXTRACT_MSB0_UINT (insn, 16, 6, 10); \
401 #define EXTRACT_IFMT_MOVI20_COMPACT_VARS \
409 #define EXTRACT_IFMT_MOVI20_COMPACT_CODE \
411 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
412 f_rn = EXTRACT_MSB0_UINT (insn, 32, 4, 4); \
413 f_imm20_hi = EXTRACT_MSB0_SINT (insn, 32, 8, 4); \
414 f_imm20_lo = EXTRACT_MSB0_UINT (insn, 32, 16, 16); \
415 f_imm20 = ((((f_imm20_hi) << (16))) | (f_imm20_lo));\
416 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
418 #define EXTRACT_IFMT_MOVB5_COMPACT_VARS \
423 #define EXTRACT_IFMT_MOVB5_COMPACT_CODE \
425 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
426 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
427 f_imm4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
429 #define EXTRACT_IFMT_MOVL4_COMPACT_VARS \
433 #define EXTRACT_IFMT_MOVL4_COMPACT_CODE \
435 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
436 f_imm8x4 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (2)); \
438 #define EXTRACT_IFMT_MOVL5_COMPACT_VARS \
444 #define EXTRACT_IFMT_MOVL5_COMPACT_CODE \
446 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
447 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
448 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
449 f_imm4x4 = ((EXTRACT_MSB0_UINT (insn, 16, 12, 4)) << (2)); \
451 #define EXTRACT_IFMT_MOVL10_COMPACT_VARS \
456 #define EXTRACT_IFMT_MOVL10_COMPACT_CODE \
458 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
459 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
460 f_imm8x4 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (2)); \
462 #define EXTRACT_IFMT_MOVL12_COMPACT_VARS \
470 #define EXTRACT_IFMT_MOVL12_COMPACT_CODE \
472 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
473 f_rn = EXTRACT_MSB0_UINT (insn, 32, 4, 4); \
474 f_rm = EXTRACT_MSB0_UINT (insn, 32, 8, 4); \
475 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
476 f_16_4 = EXTRACT_MSB0_UINT (insn, 32, 16, 4); \
477 f_imm12x4 = ((EXTRACT_MSB0_SINT (insn, 32, 20, 12)) << (2)); \
479 #define EXTRACT_IFMT_MOVW4_COMPACT_VARS \
483 #define EXTRACT_IFMT_MOVW4_COMPACT_CODE \
485 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
486 f_imm8x2 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (1)); \
488 #define EXTRACT_IFMT_MOVW5_COMPACT_VARS \
493 #define EXTRACT_IFMT_MOVW5_COMPACT_CODE \
495 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
496 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
497 f_imm4x2 = ((EXTRACT_MSB0_UINT (insn, 16, 12, 4)) << (1)); \
499 #define EXTRACT_IFMT_MOVW10_COMPACT_VARS \
504 #define EXTRACT_IFMT_MOVW10_COMPACT_CODE \
506 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
507 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
508 f_imm8x2 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (1)); \
510 #endif /* DEFS_SH64_COMPACT_H */