1 /* ISA definitions header for compact.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2016 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, see <http://www.gnu.org/licenses/>.
24 #ifndef DEFS_SH64_COMPACT_H
25 #define DEFS_SH64_COMPACT_H
27 /* Instruction argument buffer. */
30 struct { /* no operands */
42 } sfmt_movw10_compact
;
50 } sfmt_movl10_compact
;
58 } sfmt_movi20_compact
;
71 } sfmt_movl12_compact
;
88 /* Writeback handler. */
90 /* Pointer to argbuf entry for insn whose results need writing back. */
91 const struct argbuf
*abuf
;
93 /* x-before handler */
95 /*const SCACHE *insns[MAX_PARALLEL_INSNS];*/
102 /* This entry is used to terminate each pbb. */
104 /* Number of insns in pbb. */
106 /* Next pbb to execute. */
108 SCACHE
*branch_target
;
113 /* The ARGBUF struct. */
115 /* These are the baseclass definitions. */
120 /* ??? Temporary hack for skip insns. */
123 /* cpu specific data follows */
126 union sem_fields fields
;
131 ??? SCACHE used to contain more than just argbuf. We could delete the
132 type entirely and always just use ARGBUF, but for future concerns and as
133 a level of abstraction it is left in. */
136 struct argbuf argbuf
;
139 /* Macros to simplify extraction, reading and semantic code.
140 These define and assign the local vars that contain the insn's fields. */
142 #define EXTRACT_IFMT_EMPTY_VARS \
144 #define EXTRACT_IFMT_EMPTY_CODE \
147 #define EXTRACT_IFMT_ADD_COMPACT_VARS \
153 #define EXTRACT_IFMT_ADD_COMPACT_CODE \
155 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
156 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
157 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
158 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
160 #define EXTRACT_IFMT_ADDI_COMPACT_VARS \
165 #define EXTRACT_IFMT_ADDI_COMPACT_CODE \
167 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
168 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
169 f_imm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
171 #define EXTRACT_IFMT_AND_COMPACT_VARS \
177 #define EXTRACT_IFMT_AND_COMPACT_CODE \
179 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
180 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
181 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
182 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
184 #define EXTRACT_IFMT_ANDI_COMPACT_VARS \
188 #define EXTRACT_IFMT_ANDI_COMPACT_CODE \
190 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
191 f_imm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
193 #define EXTRACT_IFMT_ANDB_COMPACT_VARS \
197 #define EXTRACT_IFMT_ANDB_COMPACT_CODE \
199 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
200 f_imm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
202 #define EXTRACT_IFMT_BF_COMPACT_VARS \
206 #define EXTRACT_IFMT_BF_COMPACT_CODE \
208 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
209 f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (1))) + (((pc) + (4)))); \
211 #define EXTRACT_IFMT_BRA_COMPACT_VARS \
215 #define EXTRACT_IFMT_BRA_COMPACT_CODE \
217 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
218 f_disp12 = ((((EXTRACT_MSB0_SINT (insn, 16, 4, 12)) << (1))) + (((pc) + (4)))); \
220 #define EXTRACT_IFMT_BRAF_COMPACT_VARS \
225 #define EXTRACT_IFMT_BRAF_COMPACT_CODE \
227 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
228 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
229 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
231 #define EXTRACT_IFMT_BRK_COMPACT_VARS \
234 #define EXTRACT_IFMT_BRK_COMPACT_CODE \
236 f_op16 = EXTRACT_MSB0_UINT (insn, 16, 0, 16); \
238 #define EXTRACT_IFMT_FABS_COMPACT_VARS \
243 #define EXTRACT_IFMT_FABS_COMPACT_CODE \
245 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
246 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
247 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
249 #define EXTRACT_IFMT_FADD_COMPACT_VARS \
255 #define EXTRACT_IFMT_FADD_COMPACT_CODE \
257 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
258 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
259 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
260 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
262 #define EXTRACT_IFMT_FCNVDS_COMPACT_VARS \
268 #define EXTRACT_IFMT_FCNVDS_COMPACT_CODE \
270 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
271 f_dn = ((EXTRACT_MSB0_UINT (insn, 16, 4, 3)) << (1)); \
272 f_7_1 = EXTRACT_MSB0_UINT (insn, 16, 7, 1); \
273 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
275 #define EXTRACT_IFMT_FIPR_COMPACT_VARS \
281 #define EXTRACT_IFMT_FIPR_COMPACT_CODE \
283 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
284 f_vn = ((EXTRACT_MSB0_UINT (insn, 16, 4, 2)) << (2)); \
285 f_vm = ((EXTRACT_MSB0_UINT (insn, 16, 6, 2)) << (2)); \
286 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
288 #define EXTRACT_IFMT_FLDS_COMPACT_VARS \
293 #define EXTRACT_IFMT_FLDS_COMPACT_CODE \
295 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
296 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
297 f_sub8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
299 #define EXTRACT_IFMT_FMAC_COMPACT_VARS \
305 #define EXTRACT_IFMT_FMAC_COMPACT_CODE \
307 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
308 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
309 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
310 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
312 #define EXTRACT_IFMT_FMOV1_COMPACT_VARS \
318 #define EXTRACT_IFMT_FMOV1_COMPACT_CODE \
320 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
321 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
322 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
323 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
325 #define EXTRACT_IFMT_FMOV2_COMPACT_VARS \
331 #define EXTRACT_IFMT_FMOV2_COMPACT_CODE \
333 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
334 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
335 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
336 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
338 #define EXTRACT_IFMT_FMOV5_COMPACT_VARS \
344 #define EXTRACT_IFMT_FMOV5_COMPACT_CODE \
346 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
347 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
348 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
349 f_sub4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
351 #define EXTRACT_IFMT_FMOV8_COMPACT_VARS \
360 #define EXTRACT_IFMT_FMOV8_COMPACT_CODE \
362 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
363 f_dn = ((EXTRACT_MSB0_UINT (insn, 32, 4, 3)) << (1)); \
364 f_7_1 = EXTRACT_MSB0_UINT (insn, 32, 7, 1); \
365 f_rm = EXTRACT_MSB0_UINT (insn, 32, 8, 4); \
366 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
367 f_16_4 = EXTRACT_MSB0_UINT (insn, 32, 16, 4); \
368 f_imm12x8 = ((EXTRACT_MSB0_SINT (insn, 32, 20, 12)) << (3)); \
370 #define EXTRACT_IFMT_FMOV9_COMPACT_VARS \
379 #define EXTRACT_IFMT_FMOV9_COMPACT_CODE \
381 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
382 f_rn = EXTRACT_MSB0_UINT (insn, 32, 4, 4); \
383 f_dm = ((EXTRACT_MSB0_UINT (insn, 32, 8, 3)) << (1)); \
384 f_11_1 = EXTRACT_MSB0_UINT (insn, 32, 11, 1); \
385 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
386 f_16_4 = EXTRACT_MSB0_UINT (insn, 32, 16, 4); \
387 f_imm12x8 = ((EXTRACT_MSB0_SINT (insn, 32, 20, 12)) << (3)); \
389 #define EXTRACT_IFMT_FTRV_COMPACT_VARS \
394 #define EXTRACT_IFMT_FTRV_COMPACT_CODE \
396 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
397 f_vn = ((EXTRACT_MSB0_UINT (insn, 16, 4, 2)) << (2)); \
398 f_sub10 = EXTRACT_MSB0_UINT (insn, 16, 6, 10); \
400 #define EXTRACT_IFMT_MOVI20_COMPACT_VARS \
408 #define EXTRACT_IFMT_MOVI20_COMPACT_CODE \
410 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
411 f_rn = EXTRACT_MSB0_UINT (insn, 32, 4, 4); \
412 f_imm20_hi = EXTRACT_MSB0_SINT (insn, 32, 8, 4); \
413 f_imm20_lo = EXTRACT_MSB0_UINT (insn, 32, 16, 16); \
414 f_imm20 = ((((f_imm20_hi) << (16))) | (f_imm20_lo));\
415 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
417 #define EXTRACT_IFMT_MOVB5_COMPACT_VARS \
422 #define EXTRACT_IFMT_MOVB5_COMPACT_CODE \
424 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
425 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
426 f_imm4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
428 #define EXTRACT_IFMT_MOVL4_COMPACT_VARS \
432 #define EXTRACT_IFMT_MOVL4_COMPACT_CODE \
434 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
435 f_imm8x4 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (2)); \
437 #define EXTRACT_IFMT_MOVL5_COMPACT_VARS \
443 #define EXTRACT_IFMT_MOVL5_COMPACT_CODE \
445 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
446 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
447 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
448 f_imm4x4 = ((EXTRACT_MSB0_UINT (insn, 16, 12, 4)) << (2)); \
450 #define EXTRACT_IFMT_MOVL10_COMPACT_VARS \
455 #define EXTRACT_IFMT_MOVL10_COMPACT_CODE \
457 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
458 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
459 f_imm8x4 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (2)); \
461 #define EXTRACT_IFMT_MOVL12_COMPACT_VARS \
469 #define EXTRACT_IFMT_MOVL12_COMPACT_CODE \
471 f_op4 = EXTRACT_MSB0_UINT (insn, 32, 0, 4); \
472 f_rn = EXTRACT_MSB0_UINT (insn, 32, 4, 4); \
473 f_rm = EXTRACT_MSB0_UINT (insn, 32, 8, 4); \
474 f_sub4 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); \
475 f_16_4 = EXTRACT_MSB0_UINT (insn, 32, 16, 4); \
476 f_imm12x4 = ((EXTRACT_MSB0_SINT (insn, 32, 20, 12)) << (2)); \
478 #define EXTRACT_IFMT_MOVW4_COMPACT_VARS \
482 #define EXTRACT_IFMT_MOVW4_COMPACT_CODE \
484 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
485 f_imm8x2 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (1)); \
487 #define EXTRACT_IFMT_MOVW5_COMPACT_VARS \
492 #define EXTRACT_IFMT_MOVW5_COMPACT_CODE \
494 f_op8 = EXTRACT_MSB0_UINT (insn, 16, 0, 8); \
495 f_rm = EXTRACT_MSB0_UINT (insn, 16, 8, 4); \
496 f_imm4x2 = ((EXTRACT_MSB0_UINT (insn, 16, 12, 4)) << (1)); \
498 #define EXTRACT_IFMT_MOVW10_COMPACT_VARS \
503 #define EXTRACT_IFMT_MOVW10_COMPACT_CODE \
505 f_op4 = EXTRACT_MSB0_UINT (insn, 16, 0, 4); \
506 f_rn = EXTRACT_MSB0_UINT (insn, 16, 4, 4); \
507 f_imm8x2 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (1)); \
509 #endif /* DEFS_SH64_COMPACT_H */
This page took 0.041731 seconds and 4 git commands to generate.