4 * Copyright (c) 2000-2003 Marcel Moolenaar
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include <sys/cdefs.h>
30 /* __FBSDID("$FreeBSD: src/sys/ia64/disasm/disasm_decode.c,v 1.3 2005/01/06 22:18:22 imp Exp $"); */
32 #include <sys/param.h>
33 #include <sys/systm.h>
35 #include <ia64/disasm/disasm_int.h>
36 #include <ia64/disasm/disasm.h>
41 static const char *asm_templname
[] = {
42 "MII", "MII;", "MI;I", "MI;I;", "MLX", "MLX;", 0, 0,
43 "MMI", "MMI;", "M;MI", "M;MI;", "MFI", "MFI;", "MMF", "MMF;",
44 "MIB", "MIB;", "MBB", "MBB;", 0, 0, "BBB", "BBB;",
45 "MMB", "MMB;", 0, 0, "MFB", "MFB;", 0, 0
49 * Decode A-unit instructions.
52 asm_decodeA(uint64_t bits
, struct asm_bundle
*b
, int slot
)
57 fmt
= ASM_FMT_NONE
, op
= ASM_OP_NONE
;
58 switch((int)OPCODE(bits
)) {
60 switch (FIELD(bits
, 34, 2)) { /* x2a */
62 if (FIELD(bits
, 33, 1) == 0) { /* ve */
63 switch (FIELD(bits
, 29, 4)) { /* x4 */
65 if (FIELD(bits
, 27, 2) <= 1) /* x2b */
70 if (FIELD(bits
, 27, 2) <= 1) /* x2b */
75 if (FIELD(bits
, 27, 2) == 0) /* x2b */
80 switch (FIELD(bits
, 27, 2)) { /* x2b */
100 switch (FIELD(bits
, 27, 2)) { /* x2b */
120 op
= ASM_OP_SHLADD
, fmt
= ASM_FMT_A2
;
123 op
= ASM_OP_SHLADDP4
, fmt
= ASM_FMT_A2
;
126 if (FIELD(bits
, 27, 2) == 1) /* x2b */
134 switch (FIELD(bits
, 29, 8)) { /* za + x2a + zb + x4 */
136 switch (FIELD(bits
, 27, 2)) { /* x2b */
138 op
= ASM_OP_PADD1_
, fmt
= ASM_FMT_A9
;
141 op
= ASM_OP_PADD1_SSS
,
145 op
= ASM_OP_PADD1_UUU
,
149 op
= ASM_OP_PADD1_UUS
,
155 switch (FIELD(bits
, 27, 2)) { /* x2b */
157 op
= ASM_OP_PSUB1_
, fmt
= ASM_FMT_A9
;
160 op
= ASM_OP_PSUB1_SSS
,
164 op
= ASM_OP_PSUB1_UUU
,
168 op
= ASM_OP_PSUB1_UUS
,
174 switch (FIELD(bits
, 27, 2)) { /* x2b */
176 op
= ASM_OP_PAVG1_
, fmt
= ASM_FMT_A9
;
179 op
= ASM_OP_PAVG1_RAZ
,
185 if (FIELD(bits
, 27, 2) == 2) /* x2b */
186 op
= ASM_OP_PAVGSUB1
, fmt
= ASM_FMT_A9
;
189 switch (FIELD(bits
, 27, 2)) { /* x2b */
191 op
= ASM_OP_PCMP1_EQ
, fmt
= ASM_FMT_A9
;
194 op
= ASM_OP_PCMP1_GT
, fmt
= ASM_FMT_A9
;
199 switch (FIELD(bits
, 27, 2)) { /* x2b */
201 op
= ASM_OP_PADD2_
, fmt
= ASM_FMT_A9
;
204 op
= ASM_OP_PADD2_SSS
,
208 op
= ASM_OP_PADD2_UUU
,
212 op
= ASM_OP_PADD2_UUS
,
218 switch (FIELD(bits
, 27, 2)) { /* x2b */
220 op
= ASM_OP_PSUB2_
, fmt
= ASM_FMT_A9
;
223 op
= ASM_OP_PSUB2_SSS
,
227 op
= ASM_OP_PSUB2_UUU
,
231 op
= ASM_OP_PSUB2_UUS
,
237 switch (FIELD(bits
, 27, 2)) { /* x2b */
239 op
= ASM_OP_PAVG2_
, fmt
= ASM_FMT_A9
;
242 op
= ASM_OP_PAVG2_RAZ
,
248 if (FIELD(bits
, 27, 2) == 2) /* x2b */
249 op
= ASM_OP_PAVGSUB2
, fmt
= ASM_FMT_A9
;
252 op
= ASM_OP_PSHLADD2
, fmt
= ASM_FMT_A10
;
255 op
= ASM_OP_PSHRADD2
, fmt
= ASM_FMT_A10
;
258 switch (FIELD(bits
, 27, 2)) { /* x2b */
260 op
= ASM_OP_PCMP2_EQ
, fmt
= ASM_FMT_A9
;
263 op
= ASM_OP_PCMP2_GT
, fmt
= ASM_FMT_A9
;
268 if (FIELD(bits
, 27, 2) == 0) /* x2b */
269 op
= ASM_OP_PADD4
, fmt
= ASM_FMT_A9
;
272 if (FIELD(bits
, 27, 2) == 0) /* x2b */
273 op
= ASM_OP_PSUB4
, fmt
= ASM_FMT_A9
;
276 switch (FIELD(bits
, 27, 2)) { /* x2b */
278 op
= ASM_OP_PCMP4_EQ
, fmt
= ASM_FMT_A9
;
281 op
= ASM_OP_PCMP4_GT
, fmt
= ASM_FMT_A9
;
288 if (FIELD(bits
, 33, 1) == 0) /* ve */
289 op
= ASM_OP_ADDS
, fmt
= ASM_FMT_A4
;
292 if (FIELD(bits
, 33, 1) == 0) /* ve */
293 op
= ASM_OP_ADDP4
, fmt
= ASM_FMT_A4
;
298 op
= ASM_OP_ADDL
, fmt
= ASM_FMT_A5
;
300 case 0xC: case 0xD: case 0xE:
301 if (FIELD(bits
, 12, 1) == 0) { /* c */
302 switch (FIELD(bits
, 33, 8)) { /* maj + tb + x2 + ta */
304 op
= ASM_OP_CMP_LT
, fmt
= ASM_FMT_A6
;
307 op
= ASM_OP_CMP_EQ_AND
, fmt
= ASM_FMT_A6
;
310 op
= ASM_OP_CMP4_LT
, fmt
= ASM_FMT_A6
;
313 op
= ASM_OP_CMP4_EQ_AND
, fmt
= ASM_FMT_A6
;
315 case 0xC4: case 0xCC:
316 op
= ASM_OP_CMP_LT
, fmt
= ASM_FMT_A8
;
318 case 0xC5: case 0xCD:
319 op
= ASM_OP_CMP_EQ_AND
, fmt
= ASM_FMT_A8
;
321 case 0xC6: case 0xCE:
322 op
= ASM_OP_CMP4_LT
, fmt
= ASM_FMT_A8
;
324 case 0xC7: case 0xCF:
325 op
= ASM_OP_CMP4_EQ_AND
, fmt
= ASM_FMT_A8
;
328 op
= ASM_OP_CMP_GT_AND
, fmt
= ASM_FMT_A7
;
331 op
= ASM_OP_CMP_GE_AND
, fmt
= ASM_FMT_A7
;
334 op
= ASM_OP_CMP4_GT_AND
, fmt
= ASM_FMT_A7
;
337 op
= ASM_OP_CMP4_GE_AND
, fmt
= ASM_FMT_A7
;
340 op
= ASM_OP_CMP_LTU
, fmt
= ASM_FMT_A6
;
343 op
= ASM_OP_CMP_EQ_OR
, fmt
= ASM_FMT_A6
;
346 op
= ASM_OP_CMP4_LTU
, fmt
= ASM_FMT_A6
;
349 op
= ASM_OP_CMP4_EQ_OR
, fmt
= ASM_FMT_A6
;
351 case 0xD4: case 0xDC:
352 op
= ASM_OP_CMP_LTU
, fmt
= ASM_FMT_A8
;
354 case 0xD5: case 0xDD:
355 op
= ASM_OP_CMP_EQ_OR
, fmt
= ASM_FMT_A8
;
357 case 0xD6: case 0xDE:
358 op
= ASM_OP_CMP4_LTU
, fmt
= ASM_FMT_A8
;
360 case 0xD7: case 0xDF:
361 op
= ASM_OP_CMP4_EQ_OR
, fmt
= ASM_FMT_A8
;
364 op
= ASM_OP_CMP_GT_OR
, fmt
= ASM_FMT_A7
;
367 op
= ASM_OP_CMP_GE_OR
, fmt
= ASM_FMT_A7
;
370 op
= ASM_OP_CMP4_GT_OR
, fmt
= ASM_FMT_A7
;
373 op
= ASM_OP_CMP4_GE_OR
, fmt
= ASM_FMT_A7
;
376 op
= ASM_OP_CMP_EQ
, fmt
= ASM_FMT_A6
;
379 op
= ASM_OP_CMP_EQ_OR_ANDCM
, fmt
= ASM_FMT_A6
;
382 op
= ASM_OP_CMP4_EQ
, fmt
= ASM_FMT_A6
;
385 op
= ASM_OP_CMP4_EQ_OR_ANDCM
, fmt
= ASM_FMT_A6
;
387 case 0xE4: case 0xEC:
388 op
= ASM_OP_CMP_EQ
, fmt
= ASM_FMT_A8
;
390 case 0xE5: case 0xED:
391 op
= ASM_OP_CMP_EQ_OR_ANDCM
, fmt
= ASM_FMT_A8
;
393 case 0xE6: case 0xEE:
394 op
= ASM_OP_CMP4_EQ
, fmt
= ASM_FMT_A8
;
396 case 0xE7: case 0xEF:
397 op
= ASM_OP_CMP4_EQ_OR_ANDCM
, fmt
= ASM_FMT_A8
;
400 op
= ASM_OP_CMP_GT_OR_ANDCM
, fmt
= ASM_FMT_A7
;
403 op
= ASM_OP_CMP_GE_OR_ANDCM
, fmt
= ASM_FMT_A7
;
406 op
= ASM_OP_CMP4_GT_OR_ANDCM
, fmt
= ASM_FMT_A7
;
409 op
= ASM_OP_CMP4_GE_OR_ANDCM
, fmt
= ASM_FMT_A7
;
413 switch (FIELD(bits
, 33, 8)) { /* maj + tb + x2 + ta */
415 op
= ASM_OP_CMP_LT_UNC
, fmt
= ASM_FMT_A6
;
418 op
= ASM_OP_CMP_NE_AND
, fmt
= ASM_FMT_A6
;
421 op
= ASM_OP_CMP4_LT_UNC
, fmt
= ASM_FMT_A6
;
424 op
= ASM_OP_CMP4_NE_AND
, fmt
= ASM_FMT_A6
;
426 case 0xC4: case 0xCC:
427 op
= ASM_OP_CMP_LT_UNC
, fmt
= ASM_FMT_A8
;
429 case 0xC5: case 0xCD:
430 op
= ASM_OP_CMP_NE_AND
, fmt
= ASM_FMT_A8
;
432 case 0xC6: case 0xCE:
433 op
= ASM_OP_CMP4_LT_UNC
, fmt
= ASM_FMT_A8
;
435 case 0xC7: case 0xCF:
436 op
= ASM_OP_CMP4_NE_AND
, fmt
= ASM_FMT_A8
;
439 op
= ASM_OP_CMP_LE_AND
, fmt
= ASM_FMT_A7
;
442 op
= ASM_OP_CMP_LT_AND
, fmt
= ASM_FMT_A7
;
445 op
= ASM_OP_CMP4_LE_AND
, fmt
= ASM_FMT_A7
;
448 op
= ASM_OP_CMP4_LT_AND
, fmt
= ASM_FMT_A7
;
451 op
= ASM_OP_CMP_LTU_UNC
, fmt
= ASM_FMT_A6
;
454 op
= ASM_OP_CMP_NE_OR
, fmt
= ASM_FMT_A6
;
457 op
= ASM_OP_CMP4_LTU_UNC
, fmt
= ASM_FMT_A6
;
460 op
= ASM_OP_CMP4_NE_OR
, fmt
= ASM_FMT_A6
;
462 case 0xD4: case 0xDC:
463 op
= ASM_OP_CMP_LTU_UNC
, fmt
= ASM_FMT_A8
;
465 case 0xD5: case 0xDD:
466 op
= ASM_OP_CMP_NE_OR
, fmt
= ASM_FMT_A8
;
468 case 0xD6: case 0xDE:
469 op
= ASM_OP_CMP4_LTU_UNC
, fmt
= ASM_FMT_A8
;
471 case 0xD7: case 0xDF:
472 op
= ASM_OP_CMP4_NE_OR
, fmt
= ASM_FMT_A8
;
475 op
= ASM_OP_CMP_LE_OR
, fmt
= ASM_FMT_A7
;
478 op
= ASM_OP_CMP_LT_OR
, fmt
= ASM_FMT_A7
;
481 op
= ASM_OP_CMP4_LE_OR
, fmt
= ASM_FMT_A7
;
484 op
= ASM_OP_CMP4_LT_OR
, fmt
= ASM_FMT_A7
;
487 op
= ASM_OP_CMP_EQ_UNC
, fmt
= ASM_FMT_A6
;
490 op
= ASM_OP_CMP_NE_OR_ANDCM
, fmt
= ASM_FMT_A6
;
493 op
= ASM_OP_CMP4_EQ_UNC
, fmt
= ASM_FMT_A6
;
496 op
= ASM_OP_CMP4_NE_OR_ANDCM
, fmt
= ASM_FMT_A6
;
498 case 0xE4: case 0xEC:
499 op
= ASM_OP_CMP_EQ_UNC
, fmt
= ASM_FMT_A8
;
501 case 0xE5: case 0xED:
502 op
= ASM_OP_CMP_NE_OR_ANDCM
, fmt
= ASM_FMT_A8
;
504 case 0xE6: case 0xEE:
505 op
= ASM_OP_CMP4_EQ_UNC
, fmt
= ASM_FMT_A8
;
507 case 0xE7: case 0xEF:
508 op
= ASM_OP_CMP4_NE_OR_ANDCM
, fmt
= ASM_FMT_A8
;
511 op
= ASM_OP_CMP_LE_OR_ANDCM
, fmt
= ASM_FMT_A7
;
514 op
= ASM_OP_CMP_LT_OR_ANDCM
, fmt
= ASM_FMT_A7
;
517 op
= ASM_OP_CMP4_LE_OR_ANDCM
, fmt
= ASM_FMT_A7
;
520 op
= ASM_OP_CMP4_LT_OR_ANDCM
, fmt
= ASM_FMT_A7
;
527 if (op
!= ASM_OP_NONE
)
528 return (asm_extract(op
, fmt
, bits
, b
, slot
));
533 * Decode B-unit instructions.
536 asm_decodeB(uint64_t ip
, struct asm_bundle
*b
, int slot
)
542 bits
= SLOT(ip
, slot
);
543 fmt
= ASM_FMT_NONE
, op
= ASM_OP_NONE
;
545 switch((int)OPCODE(bits
)) {
547 switch (FIELD(bits
, 27, 6)) { /* x6 */
549 op
= ASM_OP_BREAK_B
, fmt
= ASM_FMT_B9
;
552 op
= ASM_OP_COVER
, fmt
= ASM_FMT_B8
;
555 op
= ASM_OP_CLRRRB_
, fmt
= ASM_FMT_B8
;
558 op
= ASM_OP_CLRRRB_PR
, fmt
= ASM_FMT_B8
;
561 op
= ASM_OP_RFI
, fmt
= ASM_FMT_B8
;
564 op
= ASM_OP_BSW_0
, fmt
= ASM_FMT_B8
;
567 op
= ASM_OP_BSW_1
, fmt
= ASM_FMT_B8
;
570 op
= ASM_OP_EPC
, fmt
= ASM_FMT_B8
;
573 switch (FIELD(bits
, 6, 3)) { /* btype */
575 op
= ASM_OP_BR_COND
, fmt
= ASM_FMT_B4
;
578 op
= ASM_OP_BR_IA
, fmt
= ASM_FMT_B4
;
583 if (FIELD(bits
, 6, 3) == 4) /* btype */
584 op
= ASM_OP_BR_RET
, fmt
= ASM_FMT_B4
;
589 op
= ASM_OP_BR_CALL
, fmt
= ASM_FMT_B5
;
592 switch (FIELD(bits
, 27, 6)) { /* x6 */
594 op
= ASM_OP_NOP_B
, fmt
= ASM_FMT_B9
;
597 op
= ASM_OP_BRP_
, fmt
= ASM_FMT_B7
;
600 op
= ASM_OP_BRP_RET
, fmt
= ASM_FMT_B7
;
605 switch (FIELD(bits
, 6, 3)) { /* btype */
607 op
= ASM_OP_BR_COND
, fmt
= ASM_FMT_B1
;
610 op
= ASM_OP_BR_WEXIT
, fmt
= ASM_FMT_B1
;
613 op
= ASM_OP_BR_WTOP
, fmt
= ASM_FMT_B1
;
616 op
= ASM_OP_BR_CLOOP
, fmt
= ASM_FMT_B2
;
619 op
= ASM_OP_BR_CEXIT
, fmt
= ASM_FMT_B2
;
622 op
= ASM_OP_BR_CTOP
, fmt
= ASM_FMT_B2
;
627 op
= ASM_OP_BR_CALL
, fmt
= ASM_FMT_B3
;
630 op
= ASM_OP_BRP_
, fmt
= ASM_FMT_B6
;
634 if (op
!= ASM_OP_NONE
)
635 return (asm_extract(op
, fmt
, bits
, b
, slot
));
640 * Decode F-unit instructions.
643 asm_decodeF(uint64_t ip
, struct asm_bundle
*b
, int slot
)
649 bits
= SLOT(ip
, slot
);
650 fmt
= ASM_FMT_NONE
, op
= ASM_OP_NONE
;
652 switch((int)OPCODE(bits
)) {
654 if (FIELD(bits
, 33, 1) == 0) { /* x */
655 switch (FIELD(bits
, 27, 6)) { /* x6 */
657 op
= ASM_OP_BREAK_F
, fmt
= ASM_FMT_F15
;
660 op
= ASM_OP_NOP_F
, fmt
= ASM_FMT_F15
;
663 op
= ASM_OP_FSETC
, fmt
= ASM_FMT_F12
;
666 op
= ASM_OP_FCLRF
, fmt
= ASM_FMT_F13
;
669 op
= ASM_OP_FCHKF
, fmt
= ASM_FMT_F14
;
672 op
= ASM_OP_FMERGE_S
, fmt
= ASM_FMT_F9
;
675 op
= ASM_OP_FMERGE_NS
, fmt
= ASM_FMT_F9
;
678 op
= ASM_OP_FMERGE_SE
, fmt
= ASM_FMT_F9
;
681 op
= ASM_OP_FMIN
, fmt
= ASM_FMT_F8
;
684 op
= ASM_OP_FMAX
, fmt
= ASM_FMT_F8
;
687 op
= ASM_OP_FAMIN
, fmt
= ASM_FMT_F8
;
690 op
= ASM_OP_FAMAX
, fmt
= ASM_FMT_F8
;
693 op
= ASM_OP_FCVT_FX
, fmt
= ASM_FMT_F10
;
696 op
= ASM_OP_FCVT_FXU
, fmt
= ASM_FMT_F10
;
699 op
= ASM_OP_FCVT_FX_TRUNC
, fmt
= ASM_FMT_F10
;
702 op
= ASM_OP_FCVT_FXU_TRUNC
, fmt
= ASM_FMT_F10
;
705 op
= ASM_OP_FCVT_XF
, fmt
= ASM_FMT_F11
;
708 op
= ASM_OP_FPACK
, fmt
= ASM_FMT_F9
;
711 op
= ASM_OP_FAND
, fmt
= ASM_FMT_F9
;
714 op
= ASM_OP_FANDCM
, fmt
= ASM_FMT_F9
;
717 op
= ASM_OP_FOR
, fmt
= ASM_FMT_F9
;
720 op
= ASM_OP_FXOR
, fmt
= ASM_FMT_F9
;
723 op
= ASM_OP_FSWAP_
, fmt
= ASM_FMT_F9
;
726 op
= ASM_OP_FSWAP_NL
, fmt
= ASM_FMT_F9
;
729 op
= ASM_OP_FSWAP_NR
, fmt
= ASM_FMT_F9
;
732 op
= ASM_OP_FMIX_LR
, fmt
= ASM_FMT_F9
;
735 op
= ASM_OP_FMIX_R
, fmt
= ASM_FMT_F9
;
738 op
= ASM_OP_FMIX_L
, fmt
= ASM_FMT_F9
;
741 op
= ASM_OP_FSXT_R
, fmt
= ASM_FMT_F9
;
744 op
= ASM_OP_FSXT_L
, fmt
= ASM_FMT_F9
;
748 if (FIELD(bits
, 36, 1) == 0) /* q */
749 op
= ASM_OP_FRCPA
, fmt
= ASM_FMT_F6
;
751 op
= ASM_OP_FRSQRTA
, fmt
= ASM_FMT_F7
;
755 if (FIELD(bits
, 33, 1) == 0) { /* x */
756 switch (FIELD(bits
, 27, 6)) { /* x6 */
758 op
= ASM_OP_FPMERGE_S
, fmt
= ASM_FMT_F9
;
761 op
= ASM_OP_FPMERGE_NS
, fmt
= ASM_FMT_F9
;
764 op
= ASM_OP_FPMERGE_SE
, fmt
= ASM_FMT_F9
;
767 op
= ASM_OP_FPMIN
, fmt
= ASM_FMT_F8
;
770 op
= ASM_OP_FPMAX
, fmt
= ASM_FMT_F8
;
773 op
= ASM_OP_FPAMIN
, fmt
= ASM_FMT_F8
;
776 op
= ASM_OP_FPAMAX
, fmt
= ASM_FMT_F8
;
779 op
= ASM_OP_FPCVT_FX
, fmt
= ASM_FMT_F10
;
782 op
= ASM_OP_FPCVT_FXU
, fmt
= ASM_FMT_F10
;
785 op
= ASM_OP_FPCVT_FX_TRUNC
, fmt
= ASM_FMT_F10
;
788 op
= ASM_OP_FPCVT_FXU_TRUNC
, fmt
= ASM_FMT_F10
;
791 op
= ASM_OP_FPCMP_EQ
, fmt
= ASM_FMT_F8
;
794 op
= ASM_OP_FPCMP_LT
, fmt
= ASM_FMT_F8
;
797 op
= ASM_OP_FPCMP_LE
, fmt
= ASM_FMT_F8
;
800 op
= ASM_OP_FPCMP_UNORD
, fmt
= ASM_FMT_F8
;
803 op
= ASM_OP_FPCMP_NEQ
, fmt
= ASM_FMT_F8
;
806 op
= ASM_OP_FPCMP_NLT
, fmt
= ASM_FMT_F8
;
809 op
= ASM_OP_FPCMP_NLE
, fmt
= ASM_FMT_F8
;
812 op
= ASM_OP_FPCMP_ORD
, fmt
= ASM_FMT_F8
;
816 if (FIELD(bits
, 36, 1) == 0) /* q */
817 op
= ASM_OP_FPRCPA
, fmt
= ASM_FMT_F6
;
819 op
= ASM_OP_FPRSQRTA
, fmt
= ASM_FMT_F7
;
823 op
= ASM_OP_FCMP
, fmt
= ASM_FMT_F4
;
826 op
= ASM_OP_FCLASS_M
, fmt
= ASM_FMT_F5
;
829 if (FIELD(bits
, 36, 1) == 0) /* x */
830 op
= ASM_OP_FMA_
, fmt
= ASM_FMT_F1
;
832 op
= ASM_OP_FMA_S
, fmt
= ASM_FMT_F1
;
835 if (FIELD(bits
, 36, 1) == 0) /* x */
836 op
= ASM_OP_FMA_D
, fmt
= ASM_FMT_F1
;
838 op
= ASM_OP_FPMA
, fmt
= ASM_FMT_F1
;
841 if (FIELD(bits
, 36, 1) == 0) /* x */
842 op
= ASM_OP_FMS_
, fmt
= ASM_FMT_F1
;
844 op
= ASM_OP_FMS_S
, fmt
= ASM_FMT_F1
;
847 if (FIELD(bits
, 36, 1) == 0) /* x */
848 op
= ASM_OP_FMS_D
, fmt
= ASM_FMT_F1
;
850 op
= ASM_OP_FPMS
, fmt
= ASM_FMT_F1
;
853 if (FIELD(bits
, 36, 1) == 0) /* x */
854 op
= ASM_OP_FNMA_
, fmt
= ASM_FMT_F1
;
856 op
= ASM_OP_FNMA_S
, fmt
= ASM_FMT_F1
;
859 if (FIELD(bits
, 36, 1) == 0) /* x */
860 op
= ASM_OP_FNMA_D
, fmt
= ASM_FMT_F1
;
862 op
= ASM_OP_FPNMA
, fmt
= ASM_FMT_F1
;
865 if (FIELD(bits
, 36, 1) == 1) { /* x */
866 switch (FIELD(bits
, 34, 2)) { /* x2 */
868 op
= ASM_OP_XMA_L
, fmt
= ASM_FMT_F2
;
871 op
= ASM_OP_XMA_HU
, fmt
= ASM_FMT_F2
;
874 op
= ASM_OP_XMA_H
, fmt
= ASM_FMT_F2
;
878 op
= ASM_OP_FSELECT
, fmt
= ASM_FMT_F3
;
882 if (op
!= ASM_OP_NONE
)
883 return (asm_extract(op
, fmt
, bits
, b
, slot
));
888 * Decode I-unit instructions.
891 asm_decodeI(uint64_t ip
, struct asm_bundle
*b
, int slot
)
897 bits
= SLOT(ip
, slot
);
898 if ((int)OPCODE(bits
) >= 8)
899 return (asm_decodeA(bits
, b
, slot
));
900 fmt
= ASM_FMT_NONE
, op
= ASM_OP_NONE
;
902 switch((int)OPCODE(bits
)) {
904 switch (FIELD(bits
, 33, 3)) { /* x3 */
906 switch (FIELD(bits
, 27, 6)) { /* x6 */
908 op
= ASM_OP_BREAK_I
, fmt
= ASM_FMT_I19
;
911 op
= ASM_OP_NOP_I
, fmt
= ASM_FMT_I19
;
914 op
= ASM_OP_MOV_I
, fmt
= ASM_FMT_I27
;
917 op
= ASM_OP_ZXT1
, fmt
= ASM_FMT_I29
;
920 op
= ASM_OP_ZXT2
, fmt
= ASM_FMT_I29
;
923 op
= ASM_OP_ZXT4
, fmt
= ASM_FMT_I29
;
926 op
= ASM_OP_SXT1
, fmt
= ASM_FMT_I29
;
929 op
= ASM_OP_SXT2
, fmt
= ASM_FMT_I29
;
932 op
= ASM_OP_SXT4
, fmt
= ASM_FMT_I29
;
935 op
= ASM_OP_CZX1_L
, fmt
= ASM_FMT_I29
;
938 op
= ASM_OP_CZX2_L
, fmt
= ASM_FMT_I29
;
941 op
= ASM_OP_CZX1_R
, fmt
= ASM_FMT_I29
;
944 op
= ASM_OP_CZX2_R
, fmt
= ASM_FMT_I29
;
947 op
= ASM_OP_MOV_I
, fmt
= ASM_FMT_I26
;
950 op
= ASM_OP_MOV_IP
, fmt
= ASM_FMT_I25
;
953 op
= ASM_OP_MOV_
, fmt
= ASM_FMT_I22
;
956 op
= ASM_OP_MOV_I
, fmt
= ASM_FMT_I28
;
959 op
= ASM_OP_MOV_PR
, fmt
= ASM_FMT_I25
;
964 op
= ASM_OP_CHK_S_I
, fmt
= ASM_FMT_I20
;
967 op
= ASM_OP_MOV_
, fmt
= ASM_FMT_I24
;
970 op
= ASM_OP_MOV_
, fmt
= ASM_FMT_I23
;
973 if (FIELD(bits
, 22, 1) == 0) /* x */
974 op
= ASM_OP_MOV_
, fmt
= ASM_FMT_I21
;
976 op
= ASM_OP_MOV_RET
, fmt
= ASM_FMT_I21
;
981 op
= ASM_OP_DEP_
, fmt
= ASM_FMT_I15
;
984 switch (FIELD(bits
, 33, 3)) { /* x + x2 */
986 if (FIELD(bits
, 36, 1) == 0) { /* tb */
987 switch (FIELD(bits
, 12, 2)) { /* c + y */
989 op
= ASM_OP_TBIT_Z
, fmt
= ASM_FMT_I16
;
992 op
= ASM_OP_TBIT_Z_UNC
,
996 op
= ASM_OP_TNAT_Z
, fmt
= ASM_FMT_I17
;
999 op
= ASM_OP_TNAT_Z_UNC
,
1004 switch (FIELD(bits
, 12, 2)) { /* c + y */
1006 op
= ASM_OP_TBIT_Z_AND
,
1010 op
= ASM_OP_TBIT_NZ_AND
,
1014 op
= ASM_OP_TNAT_Z_AND
,
1018 op
= ASM_OP_TNAT_NZ_AND
,
1025 if (FIELD(bits
, 36, 1) == 0) { /* tb */
1026 switch (FIELD(bits
, 12, 2)) { /* c + y */
1028 op
= ASM_OP_TBIT_Z_OR
,
1032 op
= ASM_OP_TBIT_NZ_OR
,
1036 op
= ASM_OP_TNAT_Z_OR
,
1040 op
= ASM_OP_TNAT_NZ_OR
,
1045 switch (FIELD(bits
, 12, 2)) { /* c + y */
1047 op
= ASM_OP_TBIT_Z_OR_ANDCM
,
1051 op
= ASM_OP_TBIT_NZ_OR_ANDCM
,
1055 op
= ASM_OP_TNAT_Z_OR_ANDCM
,
1059 op
= ASM_OP_TNAT_NZ_OR_ANDCM
,
1066 op
= ASM_OP_EXTR
, fmt
= ASM_FMT_I11
;
1069 if (FIELD(bits
, 26, 1) == 0) /* y */
1070 op
= ASM_OP_DEP_Z
, fmt
= ASM_FMT_I12
;
1072 op
= ASM_OP_DEP_Z
, fmt
= ASM_FMT_I13
;
1075 op
= ASM_OP_SHRP
, fmt
= ASM_FMT_I10
;
1078 op
= ASM_OP_DEP_
, fmt
= ASM_FMT_I14
;
1083 switch (FIELD(bits
, 32, 5)) { /* ve + zb + x2a + za */
1085 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1087 op
= ASM_OP_PSHR2_U
, fmt
= ASM_FMT_I5
;
1089 case 0x1: case 0x5: case 0x9: case 0xD:
1090 op
= ASM_OP_PMPYSHR2_U
, fmt
= ASM_FMT_I1
;
1093 op
= ASM_OP_PSHR2_
, fmt
= ASM_FMT_I5
;
1095 case 0x3: case 0x7: case 0xB: case 0xF:
1096 op
= ASM_OP_PMPYSHR2_
, fmt
= ASM_FMT_I1
;
1099 op
= ASM_OP_PSHL2
, fmt
= ASM_FMT_I7
;
1104 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1106 op
= ASM_OP_PSHR2_U
, fmt
= ASM_FMT_I6
;
1109 op
= ASM_OP_PSHR2_
, fmt
= ASM_FMT_I6
;
1112 op
= ASM_OP_POPCNT
, fmt
= ASM_FMT_I9
;
1117 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1119 op
= ASM_OP_PMIN1_U
, fmt
= ASM_FMT_I2
;
1122 op
= ASM_OP_UNPACK1_H
, fmt
= ASM_FMT_I2
;
1125 op
= ASM_OP_PMAX1_U
, fmt
= ASM_FMT_I2
;
1128 op
= ASM_OP_UNPACK1_L
, fmt
= ASM_FMT_I2
;
1131 op
= ASM_OP_MIX1_R
, fmt
= ASM_FMT_I2
;
1134 op
= ASM_OP_MIX1_L
, fmt
= ASM_FMT_I2
;
1137 op
= ASM_OP_PSAD1
, fmt
= ASM_FMT_I2
;
1142 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1144 op
= ASM_OP_PACK2_USS
, fmt
= ASM_FMT_I2
;
1147 op
= ASM_OP_PACK2_SSS
, fmt
= ASM_FMT_I2
;
1150 op
= ASM_OP_PMIN2
, fmt
= ASM_FMT_I2
;
1153 op
= ASM_OP_UNPACK2_H
, fmt
= ASM_FMT_I2
;
1156 op
= ASM_OP_UNPACK2_L
, fmt
= ASM_FMT_I2
;
1159 op
= ASM_OP_PMAX2
, fmt
= ASM_FMT_I2
;
1162 op
= ASM_OP_MIX2_R
, fmt
= ASM_FMT_I2
;
1165 op
= ASM_OP_MIX2_L
, fmt
= ASM_FMT_I2
;
1168 op
= ASM_OP_PMPY2_R
, fmt
= ASM_FMT_I2
;
1171 op
= ASM_OP_PMPY2_L
, fmt
= ASM_FMT_I2
;
1176 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1178 op
= ASM_OP_MUX1
, fmt
= ASM_FMT_I3
;
1183 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1185 op
= ASM_OP_PSHL2
, fmt
= ASM_FMT_I8
;
1188 op
= ASM_OP_MUX2
, fmt
= ASM_FMT_I4
;
1193 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1195 op
= ASM_OP_PSHR4_U
, fmt
= ASM_FMT_I5
;
1198 op
= ASM_OP_PSHR4_
, fmt
= ASM_FMT_I5
;
1201 op
= ASM_OP_PSHL4
, fmt
= ASM_FMT_I7
;
1206 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1208 op
= ASM_OP_SHR_U
, fmt
= ASM_FMT_I5
;
1211 op
= ASM_OP_SHR_
, fmt
= ASM_FMT_I5
;
1214 op
= ASM_OP_SHL
, fmt
= ASM_FMT_I7
;
1219 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1221 op
= ASM_OP_PSHR4_U
, fmt
= ASM_FMT_I6
;
1224 op
= ASM_OP_PSHR4_
, fmt
= ASM_FMT_I6
;
1229 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1231 op
= ASM_OP_PACK4_SSS
, fmt
= ASM_FMT_I2
;
1234 op
= ASM_OP_UNPACK4_H
, fmt
= ASM_FMT_I2
;
1237 op
= ASM_OP_UNPACK4_L
, fmt
= ASM_FMT_I2
;
1240 op
= ASM_OP_MIX4_R
, fmt
= ASM_FMT_I2
;
1243 op
= ASM_OP_MIX4_L
, fmt
= ASM_FMT_I2
;
1248 switch (FIELD(bits
, 28, 4)) { /* x2b + x2c */
1250 op
= ASM_OP_PSHL4
, fmt
= ASM_FMT_I8
;
1258 if (op
!= ASM_OP_NONE
)
1259 return (asm_extract(op
, fmt
, bits
, b
, slot
));
1264 * Decode M-unit instructions.
1267 asm_decodeM(uint64_t ip
, struct asm_bundle
*b
, int slot
)
1273 bits
= SLOT(ip
, slot
);
1274 if ((int)OPCODE(bits
) >= 8)
1275 return (asm_decodeA(bits
, b
, slot
));
1276 fmt
= ASM_FMT_NONE
, op
= ASM_OP_NONE
;
1278 switch((int)OPCODE(bits
)) {
1280 switch (FIELD(bits
, 33, 3)) { /* x3 */
1282 switch (FIELD(bits
, 27, 6)) { /* x6 (x4 + x2) */
1284 op
= ASM_OP_BREAK_M
, fmt
= ASM_FMT_M37
;
1287 op
= ASM_OP_NOP_M
, fmt
= ASM_FMT_M37
;
1289 case 0x4: case 0x14: case 0x24: case 0x34:
1290 op
= ASM_OP_SUM
, fmt
= ASM_FMT_M44
;
1292 case 0x5: case 0x15: case 0x25: case 0x35:
1293 op
= ASM_OP_RUM
, fmt
= ASM_FMT_M44
;
1295 case 0x6: case 0x16: case 0x26: case 0x36:
1296 op
= ASM_OP_SSM
, fmt
= ASM_FMT_M44
;
1298 case 0x7: case 0x17: case 0x27: case 0x37:
1299 op
= ASM_OP_RSM
, fmt
= ASM_FMT_M44
;
1302 op
= ASM_OP_LOADRS
, fmt
= ASM_FMT_M25
;
1305 op
= ASM_OP_FLUSHRS
, fmt
= ASM_FMT_M25
;
1308 op
= ASM_OP_INVALA_
, fmt
= ASM_FMT_M24
;
1311 op
= ASM_OP_INVALA_E
, fmt
= ASM_FMT_M26
;
1314 op
= ASM_OP_INVALA_E
, fmt
= ASM_FMT_M27
;
1317 op
= ASM_OP_FWB
, fmt
= ASM_FMT_M24
;
1320 op
= ASM_OP_MF_
, fmt
= ASM_FMT_M24
;
1323 op
= ASM_OP_MF_A
, fmt
= ASM_FMT_M24
;
1326 op
= ASM_OP_MOV_M
, fmt
= ASM_FMT_M30
;
1329 op
= ASM_OP_SRLZ_D
, fmt
= ASM_FMT_M24
;
1332 op
= ASM_OP_SRLZ_I
, fmt
= ASM_FMT_M24
;
1335 op
= ASM_OP_SYNC_I
, fmt
= ASM_FMT_M24
;
1340 op
= ASM_OP_CHK_A_NC
, fmt
= ASM_FMT_M22
;
1343 op
= ASM_OP_CHK_A_CLR
, fmt
= ASM_FMT_M22
;
1346 op
= ASM_OP_CHK_A_NC
, fmt
= ASM_FMT_M23
;
1349 op
= ASM_OP_CHK_A_CLR
, fmt
= ASM_FMT_M23
;
1354 switch (FIELD(bits
, 33, 3)) { /* x3 */
1356 switch (FIELD(bits
, 27, 6)) { /* x6 (x4 + x2) */
1358 op
= ASM_OP_MOV_RR
, fmt
= ASM_FMT_M42
;
1361 op
= ASM_OP_MOV_DBR
, fmt
= ASM_FMT_M42
;
1364 op
= ASM_OP_MOV_IBR
, fmt
= ASM_FMT_M42
;
1367 op
= ASM_OP_MOV_PKR
, fmt
= ASM_FMT_M42
;
1370 op
= ASM_OP_MOV_PMC
, fmt
= ASM_FMT_M42
;
1373 op
= ASM_OP_MOV_PMD
, fmt
= ASM_FMT_M42
;
1376 op
= ASM_OP_MOV_MSR
, fmt
= ASM_FMT_M42
;
1379 op
= ASM_OP_PTC_L
, fmt
= ASM_FMT_M45
;
1382 op
= ASM_OP_PTC_G
, fmt
= ASM_FMT_M45
;
1385 op
= ASM_OP_PTC_GA
, fmt
= ASM_FMT_M45
;
1388 op
= ASM_OP_PTR_D
, fmt
= ASM_FMT_M45
;
1391 op
= ASM_OP_PTR_I
, fmt
= ASM_FMT_M45
;
1394 op
= ASM_OP_ITR_D
, fmt
= ASM_FMT_M42
;
1397 op
= ASM_OP_ITR_I
, fmt
= ASM_FMT_M42
;
1400 op
= ASM_OP_MOV_RR
, fmt
= ASM_FMT_M43
;
1403 op
= ASM_OP_MOV_DBR
, fmt
= ASM_FMT_M43
;
1406 op
= ASM_OP_MOV_IBR
, fmt
= ASM_FMT_M43
;
1409 op
= ASM_OP_MOV_PKR
, fmt
= ASM_FMT_M43
;
1412 op
= ASM_OP_MOV_PMC
, fmt
= ASM_FMT_M43
;
1415 op
= ASM_OP_MOV_PMD
, fmt
= ASM_FMT_M43
;
1418 op
= ASM_OP_MOV_MSR
, fmt
= ASM_FMT_M43
;
1421 op
= ASM_OP_MOV_CPUID
, fmt
= ASM_FMT_M43
;
1424 op
= ASM_OP_PROBE_R
, fmt
= ASM_FMT_M39
;
1427 op
= ASM_OP_PROBE_W
, fmt
= ASM_FMT_M39
;
1430 op
= ASM_OP_THASH
, fmt
= ASM_FMT_M46
;
1433 op
= ASM_OP_TTAG
, fmt
= ASM_FMT_M46
;
1436 op
= ASM_OP_TPA
, fmt
= ASM_FMT_M46
;
1439 op
= ASM_OP_TAK
, fmt
= ASM_FMT_M46
;
1442 op
= ASM_OP_MOV_PSR_UM
, fmt
= ASM_FMT_M36
;
1445 op
= ASM_OP_MOV_M
, fmt
= ASM_FMT_M31
;
1448 op
= ASM_OP_MOV_
, fmt
= ASM_FMT_M33
;
1451 op
= ASM_OP_MOV_PSR
, fmt
= ASM_FMT_M36
;
1454 op
= ASM_OP_MOV_PSR_UM
, fmt
= ASM_FMT_M35
;
1457 op
= ASM_OP_MOV_M
, fmt
= ASM_FMT_M29
;
1460 op
= ASM_OP_MOV_
, fmt
= ASM_FMT_M32
;
1463 op
= ASM_OP_MOV_PSR_L
, fmt
= ASM_FMT_M35
;
1466 op
= ASM_OP_ITC_D
, fmt
= ASM_FMT_M41
;
1469 op
= ASM_OP_ITC_I
, fmt
= ASM_FMT_M41
;
1472 if (FIELD(bits
, 36, 1) == 0) /* x */
1473 op
= ASM_OP_FC_
, fmt
= ASM_FMT_M28
;
1475 op
= ASM_OP_FC_I
, fmt
= ASM_FMT_M28
;
1478 op
= ASM_OP_PROBE_RW_FAULT
, fmt
= ASM_FMT_M40
;
1481 op
= ASM_OP_PROBE_R_FAULT
, fmt
= ASM_FMT_M40
;
1484 op
= ASM_OP_PROBE_W_FAULT
, fmt
= ASM_FMT_M40
;
1487 op
= ASM_OP_PTC_E
, fmt
= ASM_FMT_M28
;
1490 op
= ASM_OP_PROBE_R
, fmt
= ASM_FMT_M38
;
1493 op
= ASM_OP_PROBE_W
, fmt
= ASM_FMT_M38
;
1498 op
= ASM_OP_CHK_S_M
, fmt
= ASM_FMT_M20
;
1501 op
= ASM_OP_CHK_S
, fmt
= ASM_FMT_M21
;
1504 op
= ASM_OP_ALLOC
, fmt
= ASM_FMT_M34
;
1509 if (FIELD(bits
, 27, 1) == 0) { /* x */
1510 switch (FIELD(bits
, 30, 7)) { /* x6 + m */
1512 op
= ASM_OP_LD1_
, fmt
= ASM_FMT_M1
;
1515 op
= ASM_OP_LD2_
, fmt
= ASM_FMT_M1
;
1518 op
= ASM_OP_LD4_
, fmt
= ASM_FMT_M1
;
1521 op
= ASM_OP_LD8_
, fmt
= ASM_FMT_M1
;
1524 op
= ASM_OP_LD1_S
, fmt
= ASM_FMT_M1
;
1527 op
= ASM_OP_LD2_S
, fmt
= ASM_FMT_M1
;
1530 op
= ASM_OP_LD4_S
, fmt
= ASM_FMT_M1
;
1533 op
= ASM_OP_LD8_S
, fmt
= ASM_FMT_M1
;
1536 op
= ASM_OP_LD1_A
, fmt
= ASM_FMT_M1
;
1539 op
= ASM_OP_LD2_A
, fmt
= ASM_FMT_M1
;
1542 op
= ASM_OP_LD4_A
, fmt
= ASM_FMT_M1
;
1545 op
= ASM_OP_LD8_A
, fmt
= ASM_FMT_M1
;
1548 op
= ASM_OP_LD1_SA
, fmt
= ASM_FMT_M1
;
1551 op
= ASM_OP_LD2_SA
, fmt
= ASM_FMT_M1
;
1554 op
= ASM_OP_LD4_SA
, fmt
= ASM_FMT_M1
;
1557 op
= ASM_OP_LD8_SA
, fmt
= ASM_FMT_M1
;
1560 op
= ASM_OP_LD1_BIAS
, fmt
= ASM_FMT_M1
;
1563 op
= ASM_OP_LD2_BIAS
, fmt
= ASM_FMT_M1
;
1566 op
= ASM_OP_LD4_BIAS
, fmt
= ASM_FMT_M1
;
1569 op
= ASM_OP_LD8_BIAS
, fmt
= ASM_FMT_M1
;
1572 op
= ASM_OP_LD1_ACQ
, fmt
= ASM_FMT_M1
;
1575 op
= ASM_OP_LD2_ACQ
, fmt
= ASM_FMT_M1
;
1578 op
= ASM_OP_LD4_ACQ
, fmt
= ASM_FMT_M1
;
1581 op
= ASM_OP_LD8_ACQ
, fmt
= ASM_FMT_M1
;
1584 op
= ASM_OP_LD8_FILL
, fmt
= ASM_FMT_M1
;
1587 op
= ASM_OP_LD1_C_CLR
, fmt
= ASM_FMT_M1
;
1590 op
= ASM_OP_LD2_C_CLR
, fmt
= ASM_FMT_M1
;
1593 op
= ASM_OP_LD4_C_CLR
, fmt
= ASM_FMT_M1
;
1596 op
= ASM_OP_LD8_C_CLR
, fmt
= ASM_FMT_M1
;
1599 op
= ASM_OP_LD1_C_NC
, fmt
= ASM_FMT_M1
;
1602 op
= ASM_OP_LD2_C_NC
, fmt
= ASM_FMT_M1
;
1605 op
= ASM_OP_LD4_C_NC
, fmt
= ASM_FMT_M1
;
1608 op
= ASM_OP_LD8_C_NC
, fmt
= ASM_FMT_M1
;
1611 op
= ASM_OP_LD1_C_CLR_ACQ
, fmt
= ASM_FMT_M1
;
1614 op
= ASM_OP_LD2_C_CLR_ACQ
, fmt
= ASM_FMT_M1
;
1617 op
= ASM_OP_LD4_C_CLR_ACQ
, fmt
= ASM_FMT_M1
;
1620 op
= ASM_OP_LD8_C_CLR_ACQ
, fmt
= ASM_FMT_M1
;
1623 op
= ASM_OP_ST1_
, fmt
= ASM_FMT_M4
;
1626 op
= ASM_OP_ST2_
, fmt
= ASM_FMT_M4
;
1629 op
= ASM_OP_ST4_
, fmt
= ASM_FMT_M4
;
1632 op
= ASM_OP_ST8_
, fmt
= ASM_FMT_M4
;
1635 op
= ASM_OP_ST1_REL
, fmt
= ASM_FMT_M4
;
1638 op
= ASM_OP_ST2_REL
, fmt
= ASM_FMT_M4
;
1641 op
= ASM_OP_ST4_REL
, fmt
= ASM_FMT_M4
;
1644 op
= ASM_OP_ST8_REL
, fmt
= ASM_FMT_M4
;
1647 op
= ASM_OP_ST8_SPILL
, fmt
= ASM_FMT_M4
;
1650 op
= ASM_OP_LD1_
, fmt
= ASM_FMT_M2
;
1653 op
= ASM_OP_LD2_
, fmt
= ASM_FMT_M2
;
1656 op
= ASM_OP_LD4_
, fmt
= ASM_FMT_M2
;
1659 op
= ASM_OP_LD8_
, fmt
= ASM_FMT_M2
;
1662 op
= ASM_OP_LD1_S
, fmt
= ASM_FMT_M2
;
1665 op
= ASM_OP_LD2_S
, fmt
= ASM_FMT_M2
;
1668 op
= ASM_OP_LD4_S
, fmt
= ASM_FMT_M2
;
1671 op
= ASM_OP_LD8_S
, fmt
= ASM_FMT_M2
;
1674 op
= ASM_OP_LD1_A
, fmt
= ASM_FMT_M2
;
1677 op
= ASM_OP_LD2_A
, fmt
= ASM_FMT_M2
;
1680 op
= ASM_OP_LD4_A
, fmt
= ASM_FMT_M2
;
1683 op
= ASM_OP_LD8_A
, fmt
= ASM_FMT_M2
;
1686 op
= ASM_OP_LD1_SA
, fmt
= ASM_FMT_M2
;
1689 op
= ASM_OP_LD2_SA
, fmt
= ASM_FMT_M2
;
1692 op
= ASM_OP_LD4_SA
, fmt
= ASM_FMT_M2
;
1695 op
= ASM_OP_LD8_SA
, fmt
= ASM_FMT_M2
;
1698 op
= ASM_OP_LD1_BIAS
, fmt
= ASM_FMT_M2
;
1701 op
= ASM_OP_LD2_BIAS
, fmt
= ASM_FMT_M2
;
1704 op
= ASM_OP_LD4_BIAS
, fmt
= ASM_FMT_M2
;
1707 op
= ASM_OP_LD8_BIAS
, fmt
= ASM_FMT_M2
;
1710 op
= ASM_OP_LD1_ACQ
, fmt
= ASM_FMT_M2
;
1713 op
= ASM_OP_LD2_ACQ
, fmt
= ASM_FMT_M2
;
1716 op
= ASM_OP_LD4_ACQ
, fmt
= ASM_FMT_M2
;
1719 op
= ASM_OP_LD8_ACQ
, fmt
= ASM_FMT_M2
;
1722 op
= ASM_OP_LD8_FILL
, fmt
= ASM_FMT_M2
;
1725 op
= ASM_OP_LD1_C_CLR
, fmt
= ASM_FMT_M2
;
1728 op
= ASM_OP_LD2_C_CLR
, fmt
= ASM_FMT_M2
;
1731 op
= ASM_OP_LD4_C_CLR
, fmt
= ASM_FMT_M2
;
1734 op
= ASM_OP_LD8_C_CLR
, fmt
= ASM_FMT_M2
;
1737 op
= ASM_OP_LD1_C_NC
, fmt
= ASM_FMT_M2
;
1740 op
= ASM_OP_LD2_C_NC
, fmt
= ASM_FMT_M2
;
1743 op
= ASM_OP_LD4_C_NC
, fmt
= ASM_FMT_M2
;
1746 op
= ASM_OP_LD8_C_NC
, fmt
= ASM_FMT_M2
;
1749 op
= ASM_OP_LD1_C_CLR_ACQ
, fmt
= ASM_FMT_M2
;
1752 op
= ASM_OP_LD2_C_CLR_ACQ
, fmt
= ASM_FMT_M2
;
1755 op
= ASM_OP_LD4_C_CLR_ACQ
, fmt
= ASM_FMT_M2
;
1758 op
= ASM_OP_LD8_C_CLR_ACQ
, fmt
= ASM_FMT_M2
;
1762 switch (FIELD(bits
, 30, 7)) { /* x6 + m */
1764 op
= ASM_OP_CMPXCHG1_ACQ
, fmt
= ASM_FMT_M16
;
1767 op
= ASM_OP_CMPXCHG2_ACQ
, fmt
= ASM_FMT_M16
;
1770 op
= ASM_OP_CMPXCHG4_ACQ
, fmt
= ASM_FMT_M16
;
1773 op
= ASM_OP_CMPXCHG8_ACQ
, fmt
= ASM_FMT_M16
;
1776 op
= ASM_OP_CMPXCHG1_REL
, fmt
= ASM_FMT_M16
;
1779 op
= ASM_OP_CMPXCHG2_REL
, fmt
= ASM_FMT_M16
;
1782 op
= ASM_OP_CMPXCHG4_REL
, fmt
= ASM_FMT_M16
;
1785 op
= ASM_OP_CMPXCHG8_REL
, fmt
= ASM_FMT_M16
;
1788 op
= ASM_OP_XCHG1
, fmt
= ASM_FMT_M16
;
1791 op
= ASM_OP_XCHG2
, fmt
= ASM_FMT_M16
;
1794 op
= ASM_OP_XCHG4
, fmt
= ASM_FMT_M16
;
1797 op
= ASM_OP_XCHG8
, fmt
= ASM_FMT_M16
;
1800 op
= ASM_OP_FETCHADD4_ACQ
, fmt
= ASM_FMT_M17
;
1803 op
= ASM_OP_FETCHADD8_ACQ
, fmt
= ASM_FMT_M17
;
1806 op
= ASM_OP_FETCHADD4_REL
, fmt
= ASM_FMT_M17
;
1809 op
= ASM_OP_FETCHADD8_REL
, fmt
= ASM_FMT_M17
;
1812 op
= ASM_OP_GETF_SIG
, fmt
= ASM_FMT_M19
;
1815 op
= ASM_OP_GETF_EXP
, fmt
= ASM_FMT_M19
;
1818 op
= ASM_OP_GETF_S
, fmt
= ASM_FMT_M19
;
1821 op
= ASM_OP_GETF_D
, fmt
= ASM_FMT_M19
;
1824 op
= ASM_OP_CMP8XCHG16_ACQ
, fmt
= ASM_FMT_M16
;
1827 op
= ASM_OP_CMP8XCHG16_REL
, fmt
= ASM_FMT_M16
;
1830 op
= ASM_OP_LD16_
, fmt
= ASM_FMT_M1
;
1833 op
= ASM_OP_LD16_ACQ
, fmt
= ASM_FMT_M1
;
1836 op
= ASM_OP_ST16_
, fmt
= ASM_FMT_M4
;
1839 op
= ASM_OP_ST16_REL
, fmt
= ASM_FMT_M4
;
1845 switch (FIELD(bits
, 30, 6)) { /* x6 */
1847 op
= ASM_OP_LD1_
, fmt
= ASM_FMT_M3
;
1850 op
= ASM_OP_LD2_
, fmt
= ASM_FMT_M3
;
1853 op
= ASM_OP_LD4_
, fmt
= ASM_FMT_M3
;
1856 op
= ASM_OP_LD8_
, fmt
= ASM_FMT_M3
;
1859 op
= ASM_OP_LD1_S
, fmt
= ASM_FMT_M3
;
1862 op
= ASM_OP_LD2_S
, fmt
= ASM_FMT_M3
;
1865 op
= ASM_OP_LD4_S
, fmt
= ASM_FMT_M3
;
1868 op
= ASM_OP_LD8_S
, fmt
= ASM_FMT_M3
;
1871 op
= ASM_OP_LD1_A
, fmt
= ASM_FMT_M3
;
1874 op
= ASM_OP_LD2_A
, fmt
= ASM_FMT_M3
;
1877 op
= ASM_OP_LD4_A
, fmt
= ASM_FMT_M3
;
1880 op
= ASM_OP_LD8_A
, fmt
= ASM_FMT_M3
;
1883 op
= ASM_OP_LD1_SA
, fmt
= ASM_FMT_M3
;
1886 op
= ASM_OP_LD2_SA
, fmt
= ASM_FMT_M3
;
1889 op
= ASM_OP_LD4_SA
, fmt
= ASM_FMT_M3
;
1892 op
= ASM_OP_LD8_SA
, fmt
= ASM_FMT_M3
;
1895 op
= ASM_OP_LD1_BIAS
, fmt
= ASM_FMT_M3
;
1898 op
= ASM_OP_LD2_BIAS
, fmt
= ASM_FMT_M3
;
1901 op
= ASM_OP_LD4_BIAS
, fmt
= ASM_FMT_M3
;
1904 op
= ASM_OP_LD8_BIAS
, fmt
= ASM_FMT_M3
;
1907 op
= ASM_OP_LD1_ACQ
, fmt
= ASM_FMT_M3
;
1910 op
= ASM_OP_LD2_ACQ
, fmt
= ASM_FMT_M3
;
1913 op
= ASM_OP_LD4_ACQ
, fmt
= ASM_FMT_M3
;
1916 op
= ASM_OP_LD8_ACQ
, fmt
= ASM_FMT_M3
;
1919 op
= ASM_OP_LD8_FILL
, fmt
= ASM_FMT_M3
;
1922 op
= ASM_OP_LD1_C_CLR
, fmt
= ASM_FMT_M3
;
1925 op
= ASM_OP_LD2_C_CLR
, fmt
= ASM_FMT_M3
;
1928 op
= ASM_OP_LD4_C_CLR
, fmt
= ASM_FMT_M3
;
1931 op
= ASM_OP_LD8_C_CLR
, fmt
= ASM_FMT_M3
;
1934 op
= ASM_OP_LD1_C_NC
, fmt
= ASM_FMT_M3
;
1937 op
= ASM_OP_LD2_C_NC
, fmt
= ASM_FMT_M3
;
1940 op
= ASM_OP_LD4_C_NC
, fmt
= ASM_FMT_M3
;
1943 op
= ASM_OP_LD8_C_NC
, fmt
= ASM_FMT_M3
;
1946 op
= ASM_OP_LD1_C_CLR_ACQ
, fmt
= ASM_FMT_M3
;
1949 op
= ASM_OP_LD2_C_CLR_ACQ
, fmt
= ASM_FMT_M3
;
1952 op
= ASM_OP_LD4_C_CLR_ACQ
, fmt
= ASM_FMT_M3
;
1955 op
= ASM_OP_LD8_C_CLR_ACQ
, fmt
= ASM_FMT_M3
;
1958 op
= ASM_OP_ST1_
, fmt
= ASM_FMT_M5
;
1961 op
= ASM_OP_ST2_
, fmt
= ASM_FMT_M5
;
1964 op
= ASM_OP_ST4_
, fmt
= ASM_FMT_M5
;
1967 op
= ASM_OP_ST8_
, fmt
= ASM_FMT_M5
;
1970 op
= ASM_OP_ST1_REL
, fmt
= ASM_FMT_M5
;
1973 op
= ASM_OP_ST2_REL
, fmt
= ASM_FMT_M5
;
1976 op
= ASM_OP_ST4_REL
, fmt
= ASM_FMT_M5
;
1979 op
= ASM_OP_ST8_REL
, fmt
= ASM_FMT_M5
;
1982 op
= ASM_OP_ST8_SPILL
, fmt
= ASM_FMT_M5
;
1987 if (FIELD(bits
, 27, 1) == 0) { /* x */
1988 switch (FIELD(bits
, 30, 7)) { /* x6 + m */
1990 op
= ASM_OP_LDFE_
, fmt
= ASM_FMT_M6
;
1993 op
= ASM_OP_LDF8_
, fmt
= ASM_FMT_M6
;
1996 op
= ASM_OP_LDFS_
, fmt
= ASM_FMT_M6
;
1999 op
= ASM_OP_LDFD_
, fmt
= ASM_FMT_M6
;
2002 op
= ASM_OP_LDFE_S
, fmt
= ASM_FMT_M6
;
2005 op
= ASM_OP_LDF8_S
, fmt
= ASM_FMT_M6
;
2008 op
= ASM_OP_LDFS_S
, fmt
= ASM_FMT_M6
;
2011 op
= ASM_OP_LDFD_S
, fmt
= ASM_FMT_M6
;
2014 op
= ASM_OP_LDFE_A
, fmt
= ASM_FMT_M6
;
2017 op
= ASM_OP_LDF8_A
, fmt
= ASM_FMT_M6
;
2020 op
= ASM_OP_LDFS_A
, fmt
= ASM_FMT_M6
;
2023 op
= ASM_OP_LDFD_A
, fmt
= ASM_FMT_M6
;
2026 op
= ASM_OP_LDFE_SA
, fmt
= ASM_FMT_M6
;
2029 op
= ASM_OP_LDF8_SA
, fmt
= ASM_FMT_M6
;
2032 op
= ASM_OP_LDFS_SA
, fmt
= ASM_FMT_M6
;
2035 op
= ASM_OP_LDFD_SA
, fmt
= ASM_FMT_M6
;
2038 op
= ASM_OP_LDF_FILL
, fmt
= ASM_FMT_M6
;
2041 op
= ASM_OP_LDFE_C_CLR
, fmt
= ASM_FMT_M6
;
2044 op
= ASM_OP_LDF8_C_CLR
, fmt
= ASM_FMT_M6
;
2047 op
= ASM_OP_LDFS_C_CLR
, fmt
= ASM_FMT_M6
;
2050 op
= ASM_OP_LDFD_C_CLR
, fmt
= ASM_FMT_M6
;
2053 op
= ASM_OP_LDFE_C_NC
, fmt
= ASM_FMT_M6
;
2056 op
= ASM_OP_LDF8_C_NC
, fmt
= ASM_FMT_M6
;
2059 op
= ASM_OP_LDFS_C_NC
, fmt
= ASM_FMT_M6
;
2062 op
= ASM_OP_LDFD_C_NC
, fmt
= ASM_FMT_M6
;
2065 op
= ASM_OP_LFETCH_
, fmt
= ASM_FMT_M13
;
2068 op
= ASM_OP_LFETCH_EXCL
, fmt
= ASM_FMT_M13
;
2071 op
= ASM_OP_LFETCH_FAULT
, fmt
= ASM_FMT_M13
;
2074 op
= ASM_OP_LFETCH_FAULT_EXCL
,
2078 op
= ASM_OP_STFE
, fmt
= ASM_FMT_M9
;
2081 op
= ASM_OP_STF8
, fmt
= ASM_FMT_M9
;
2084 op
= ASM_OP_STFS
, fmt
= ASM_FMT_M9
;
2087 op
= ASM_OP_STFD
, fmt
= ASM_FMT_M9
;
2090 op
= ASM_OP_STF_SPILL
, fmt
= ASM_FMT_M9
;
2093 op
= ASM_OP_LDFE_
, fmt
= ASM_FMT_M7
;
2096 op
= ASM_OP_LDF8_
, fmt
= ASM_FMT_M7
;
2099 op
= ASM_OP_LDFS_
, fmt
= ASM_FMT_M7
;
2102 op
= ASM_OP_LDFD_
, fmt
= ASM_FMT_M7
;
2105 op
= ASM_OP_LDFE_S
, fmt
= ASM_FMT_M7
;
2108 op
= ASM_OP_LDF8_S
, fmt
= ASM_FMT_M7
;
2111 op
= ASM_OP_LDFS_S
, fmt
= ASM_FMT_M7
;
2114 op
= ASM_OP_LDFD_S
, fmt
= ASM_FMT_M7
;
2117 op
= ASM_OP_LDFE_A
, fmt
= ASM_FMT_M7
;
2120 op
= ASM_OP_LDF8_A
, fmt
= ASM_FMT_M7
;
2123 op
= ASM_OP_LDFS_A
, fmt
= ASM_FMT_M7
;
2126 op
= ASM_OP_LDFD_A
, fmt
= ASM_FMT_M7
;
2129 op
= ASM_OP_LDFE_SA
, fmt
= ASM_FMT_M7
;
2132 op
= ASM_OP_LDF8_SA
, fmt
= ASM_FMT_M7
;
2135 op
= ASM_OP_LDFS_SA
, fmt
= ASM_FMT_M7
;
2138 op
= ASM_OP_LDFD_SA
, fmt
= ASM_FMT_M7
;
2141 op
= ASM_OP_LDF_FILL
, fmt
= ASM_FMT_M7
;
2144 op
= ASM_OP_LDFE_C_CLR
, fmt
= ASM_FMT_M7
;
2147 op
= ASM_OP_LDF8_C_CLR
, fmt
= ASM_FMT_M7
;
2150 op
= ASM_OP_LDFS_C_CLR
, fmt
= ASM_FMT_M7
;
2153 op
= ASM_OP_LDFD_C_CLR
, fmt
= ASM_FMT_M7
;
2156 op
= ASM_OP_LDFE_C_NC
, fmt
= ASM_FMT_M7
;
2159 op
= ASM_OP_LDF8_C_NC
, fmt
= ASM_FMT_M7
;
2162 op
= ASM_OP_LDFS_C_NC
, fmt
= ASM_FMT_M7
;
2165 op
= ASM_OP_LDFD_C_NC
, fmt
= ASM_FMT_M7
;
2168 op
= ASM_OP_LFETCH_
, fmt
= ASM_FMT_M14
;
2171 op
= ASM_OP_LFETCH_EXCL
, fmt
= ASM_FMT_M14
;
2174 op
= ASM_OP_LFETCH_FAULT
, fmt
= ASM_FMT_M14
;
2177 op
= ASM_OP_LFETCH_FAULT_EXCL
,
2182 switch (FIELD(bits
, 30, 7)) { /* x6 + m */
2184 op
= ASM_OP_LDFP8_
, fmt
= ASM_FMT_M11
;
2187 op
= ASM_OP_LDFPS_
, fmt
= ASM_FMT_M11
;
2190 op
= ASM_OP_LDFPD_
, fmt
= ASM_FMT_M11
;
2193 op
= ASM_OP_LDFP8_S
, fmt
= ASM_FMT_M11
;
2196 op
= ASM_OP_LDFPS_S
, fmt
= ASM_FMT_M11
;
2199 op
= ASM_OP_LDFPD_S
, fmt
= ASM_FMT_M11
;
2202 op
= ASM_OP_LDFP8_A
, fmt
= ASM_FMT_M11
;
2205 op
= ASM_OP_LDFPS_A
, fmt
= ASM_FMT_M11
;
2208 op
= ASM_OP_LDFPD_A
, fmt
= ASM_FMT_M11
;
2211 op
= ASM_OP_LDFP8_SA
, fmt
= ASM_FMT_M11
;
2214 op
= ASM_OP_LDFPS_SA
, fmt
= ASM_FMT_M11
;
2217 op
= ASM_OP_LDFPD_SA
, fmt
= ASM_FMT_M11
;
2220 op
= ASM_OP_SETF_SIG
, fmt
= ASM_FMT_M18
;
2223 op
= ASM_OP_SETF_EXP
, fmt
= ASM_FMT_M18
;
2226 op
= ASM_OP_SETF_S
, fmt
= ASM_FMT_M18
;
2229 op
= ASM_OP_SETF_D
, fmt
= ASM_FMT_M18
;
2232 op
= ASM_OP_LDFP8_C_CLR
, fmt
= ASM_FMT_M11
;
2235 op
= ASM_OP_LDFPS_C_CLR
, fmt
= ASM_FMT_M11
;
2238 op
= ASM_OP_LDFPD_C_CLR
, fmt
= ASM_FMT_M11
;
2241 op
= ASM_OP_LDFP8_C_NC
, fmt
= ASM_FMT_M11
;
2244 op
= ASM_OP_LDFPS_C_NC
, fmt
= ASM_FMT_M11
;
2247 op
= ASM_OP_LDFPD_C_NC
, fmt
= ASM_FMT_M11
;
2250 op
= ASM_OP_LDFP8_
, fmt
= ASM_FMT_M12
;
2253 op
= ASM_OP_LDFPS_
, fmt
= ASM_FMT_M12
;
2256 op
= ASM_OP_LDFPD_
, fmt
= ASM_FMT_M12
;
2259 op
= ASM_OP_LDFP8_S
, fmt
= ASM_FMT_M12
;
2262 op
= ASM_OP_LDFPS_S
, fmt
= ASM_FMT_M12
;
2265 op
= ASM_OP_LDFPD_S
, fmt
= ASM_FMT_M12
;
2268 op
= ASM_OP_LDFP8_A
, fmt
= ASM_FMT_M12
;
2271 op
= ASM_OP_LDFPS_A
, fmt
= ASM_FMT_M12
;
2274 op
= ASM_OP_LDFPD_A
, fmt
= ASM_FMT_M12
;
2277 op
= ASM_OP_LDFP8_SA
, fmt
= ASM_FMT_M12
;
2280 op
= ASM_OP_LDFPS_SA
, fmt
= ASM_FMT_M12
;
2283 op
= ASM_OP_LDFPD_SA
, fmt
= ASM_FMT_M12
;
2286 op
= ASM_OP_LDFP8_C_CLR
, fmt
= ASM_FMT_M12
;
2289 op
= ASM_OP_LDFPS_C_CLR
, fmt
= ASM_FMT_M12
;
2292 op
= ASM_OP_LDFPD_C_CLR
, fmt
= ASM_FMT_M12
;
2295 op
= ASM_OP_LDFP8_C_NC
, fmt
= ASM_FMT_M12
;
2298 op
= ASM_OP_LDFPS_C_NC
, fmt
= ASM_FMT_M12
;
2301 op
= ASM_OP_LDFPD_C_NC
, fmt
= ASM_FMT_M12
;
2307 switch (FIELD(bits
, 30, 6)) { /* x6 */
2309 op
= ASM_OP_LDFE_
, fmt
= ASM_FMT_M8
;
2312 op
= ASM_OP_LDF8_
, fmt
= ASM_FMT_M8
;
2315 op
= ASM_OP_LDFS_
, fmt
= ASM_FMT_M8
;
2318 op
= ASM_OP_LDFD_
, fmt
= ASM_FMT_M8
;
2321 op
= ASM_OP_LDFE_S
, fmt
= ASM_FMT_M8
;
2324 op
= ASM_OP_LDF8_S
, fmt
= ASM_FMT_M8
;
2327 op
= ASM_OP_LDFS_S
, fmt
= ASM_FMT_M8
;
2330 op
= ASM_OP_LDFD_S
, fmt
= ASM_FMT_M8
;
2333 op
= ASM_OP_LDFE_A
, fmt
= ASM_FMT_M8
;
2336 op
= ASM_OP_LDF8_A
, fmt
= ASM_FMT_M8
;
2339 op
= ASM_OP_LDFS_A
, fmt
= ASM_FMT_M8
;
2342 op
= ASM_OP_LDFD_A
, fmt
= ASM_FMT_M8
;
2345 op
= ASM_OP_LDFE_SA
, fmt
= ASM_FMT_M8
;
2348 op
= ASM_OP_LDF8_SA
, fmt
= ASM_FMT_M8
;
2351 op
= ASM_OP_LDFS_SA
, fmt
= ASM_FMT_M8
;
2354 op
= ASM_OP_LDFD_SA
, fmt
= ASM_FMT_M8
;
2357 op
= ASM_OP_LDF_FILL
, fmt
= ASM_FMT_M8
;
2360 op
= ASM_OP_LDFE_C_CLR
, fmt
= ASM_FMT_M8
;
2363 op
= ASM_OP_LDF8_C_CLR
, fmt
= ASM_FMT_M8
;
2366 op
= ASM_OP_LDFS_C_CLR
, fmt
= ASM_FMT_M8
;
2369 op
= ASM_OP_LDFD_C_CLR
, fmt
= ASM_FMT_M8
;
2372 op
= ASM_OP_LDFE_C_NC
, fmt
= ASM_FMT_M8
;
2375 op
= ASM_OP_LDF8_C_NC
, fmt
= ASM_FMT_M8
;
2378 op
= ASM_OP_LDFS_C_NC
, fmt
= ASM_FMT_M8
;
2381 op
= ASM_OP_LDFD_C_NC
, fmt
= ASM_FMT_M8
;
2384 op
= ASM_OP_LFETCH_
, fmt
= ASM_FMT_M15
;
2387 op
= ASM_OP_LFETCH_EXCL
, fmt
= ASM_FMT_M15
;
2390 op
= ASM_OP_LFETCH_FAULT
, fmt
= ASM_FMT_M15
;
2393 op
= ASM_OP_LFETCH_FAULT_EXCL
, fmt
= ASM_FMT_M15
;
2396 op
= ASM_OP_STFE
, fmt
= ASM_FMT_M10
;
2399 op
= ASM_OP_STF8
, fmt
= ASM_FMT_M10
;
2402 op
= ASM_OP_STFS
, fmt
= ASM_FMT_M10
;
2405 op
= ASM_OP_STFD
, fmt
= ASM_FMT_M10
;
2408 op
= ASM_OP_STF_SPILL
, fmt
= ASM_FMT_M10
;
2414 if (op
!= ASM_OP_NONE
)
2415 return (asm_extract(op
, fmt
, bits
, b
, slot
));
2420 * Decode X-unit instructions.
2423 asm_decodeX(uint64_t ip
, struct asm_bundle
*b
, int slot
)
2430 bits
= SLOT(ip
, slot
);
2431 fmt
= ASM_FMT_NONE
, op
= ASM_OP_NONE
;
2432 /* Initialize slot 1 (slot - 1) */
2433 b
->b_inst
[slot
- 1].i_format
= ASM_FMT_NONE
;
2434 b
->b_inst
[slot
- 1].i_bits
= SLOT(ip
, slot
- 1);
2436 switch((int)OPCODE(bits
)) {
2438 if (FIELD(bits
, 33, 3) == 0) { /* x3 */
2439 switch (FIELD(bits
, 27, 6)) { /* x6 */
2441 op
= ASM_OP_BREAK_X
, fmt
= ASM_FMT_X1
;
2444 op
= ASM_OP_NOP_X
, fmt
= ASM_FMT_X1
;
2450 if (FIELD(bits
, 20, 1) == 0)
2451 op
= ASM_OP_MOVL
, fmt
= ASM_FMT_X2
;
2454 if (FIELD(bits
, 6, 3) == 0) /* btype */
2455 op
= ASM_OP_BRL_COND
, fmt
= ASM_FMT_X3
;
2458 op
= ASM_OP_BRL_CALL
, fmt
= ASM_FMT_X4
;
2462 if (op
!= ASM_OP_NONE
)
2463 return (asm_extract(op
, fmt
, bits
, b
, slot
));
2468 asm_decode(uint64_t ip
, struct asm_bundle
*b
)
2474 memset(b
, 0, sizeof(*b
));
2476 b
->b_templ
= asm_templname
[TMPL(ip
)];
2477 if (b
->b_templ
== 0)
2484 while (ok
&& *tp
!= 0) {
2487 ok
= asm_decodeB(ip
, b
, slot
++);
2490 ok
= asm_decodeF(ip
, b
, slot
++);
2493 ok
= asm_decodeI(ip
, b
, slot
++);
2496 ok
= (slot
++ == 1) ? 1 : 0;
2499 ok
= asm_decodeM(ip
, b
, slot
++);
2502 ok
= asm_decodeX(ip
, b
, slot
++);