2 * Format of an instruction in memory.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 1996, 2000 by Ralf Baechle
9 * Copyright (C) 2006 by Thiemo Seufer
15 * Major opcodes; before MIPS IV cop1x was called cop3.
18 spec_op
, bcond_op
, j_op
, jal_op
,
19 beq_op
, bne_op
, blez_op
, bgtz_op
,
20 addi_op
, addiu_op
, slti_op
, sltiu_op
,
21 andi_op
, ori_op
, xori_op
, lui_op
,
22 cop0_op
, cop1_op
, cop2_op
, cop1x_op
,
23 beql_op
, bnel_op
, blezl_op
, bgtzl_op
,
24 daddi_op
, daddiu_op
, ldl_op
, ldr_op
,
25 spec2_op
, jalx_op
, mdmx_op
, spec3_op
,
26 lb_op
, lh_op
, lwl_op
, lw_op
,
27 lbu_op
, lhu_op
, lwr_op
, lwu_op
,
28 sb_op
, sh_op
, swl_op
, sw_op
,
29 sdl_op
, sdr_op
, swr_op
, cache_op
,
30 ll_op
, lwc1_op
, lwc2_op
, pref_op
,
31 lld_op
, ldc1_op
, ldc2_op
, ld_op
,
32 sc_op
, swc1_op
, swc2_op
, major_3b_op
,
33 scd_op
, sdc1_op
, sdc2_op
, sd_op
37 * func field of spec opcode.
40 sll_op
, movc_op
, srl_op
, sra_op
,
41 sllv_op
, pmon_op
, srlv_op
, srav_op
,
42 jr_op
, jalr_op
, movz_op
, movn_op
,
43 syscall_op
, break_op
, spim_op
, sync_op
,
44 mfhi_op
, mthi_op
, mflo_op
, mtlo_op
,
45 dsllv_op
, spec2_unused_op
, dsrlv_op
, dsrav_op
,
46 mult_op
, multu_op
, div_op
, divu_op
,
47 dmult_op
, dmultu_op
, ddiv_op
, ddivu_op
,
48 add_op
, addu_op
, sub_op
, subu_op
,
49 and_op
, or_op
, xor_op
, nor_op
,
50 spec3_unused_op
, spec4_unused_op
, slt_op
, sltu_op
,
51 dadd_op
, daddu_op
, dsub_op
, dsubu_op
,
52 tge_op
, tgeu_op
, tlt_op
, tltu_op
,
53 teq_op
, spec5_unused_op
, tne_op
, spec6_unused_op
,
54 dsll_op
, spec7_unused_op
, dsrl_op
, dsra_op
,
55 dsll32_op
, spec8_unused_op
, dsrl32_op
, dsra32_op
59 * func field of spec2 opcode.
62 madd_op
, maddu_op
, mul_op
, spec2_3_unused_op
,
63 msub_op
, msubu_op
, /* more unused ops */
64 clz_op
= 0x20, clo_op
,
65 dclz_op
= 0x24, dclo_op
,
70 * func field of spec3 opcode.
73 ext_op
, dextm_op
, dextu_op
, dext_op
,
74 ins_op
, dinsm_op
, dinsu_op
, dins_op
,
82 * rt field of bcond opcodes.
85 bltz_op
, bgez_op
, bltzl_op
, bgezl_op
,
86 spimi_op
, unused_rt_op_0x05
, unused_rt_op_0x06
, unused_rt_op_0x07
,
87 tgei_op
, tgeiu_op
, tlti_op
, tltiu_op
,
88 teqi_op
, unused_0x0d_rt_op
, tnei_op
, unused_0x0f_rt_op
,
89 bltzal_op
, bgezal_op
, bltzall_op
, bgezall_op
,
90 rt_op_0x14
, rt_op_0x15
, rt_op_0x16
, rt_op_0x17
,
91 rt_op_0x18
, rt_op_0x19
, rt_op_0x1a
, rt_op_0x1b
,
92 bposge32_op
, rt_op_0x1d
, rt_op_0x1e
, rt_op_0x1f
96 * rs field of cop opcodes.
99 mfc_op
= 0x00, dmfc_op
= 0x01,
100 cfc_op
= 0x02, mtc_op
= 0x04,
101 dmtc_op
= 0x05, ctc_op
= 0x06,
102 bc_op
= 0x08, cop_op
= 0x10,
107 * rt field of cop.bc_op opcodes
110 bcf_op
, bct_op
, bcfl_op
, bctl_op
114 * func field of cop0 coi opcodes.
117 tlbr_op
= 0x01, tlbwi_op
= 0x02,
118 tlbwr_op
= 0x06, tlbp_op
= 0x08,
119 rfe_op
= 0x10, eret_op
= 0x18,
124 * func field of cop0 com opcodes.
127 tlbr1_op
= 0x01, tlbw_op
= 0x02,
128 tlbp1_op
= 0x08, dctr_op
= 0x09,
133 * fmt field of cop1 opcodes.
136 s_fmt
, d_fmt
, e_fmt
, q_fmt
,
141 * func field of cop1 instructions using d, s or w format.
144 fadd_op
= 0x00, fsub_op
= 0x01,
145 fmul_op
= 0x02, fdiv_op
= 0x03,
146 fsqrt_op
= 0x04, fabs_op
= 0x05,
147 fmov_op
= 0x06, fneg_op
= 0x07,
148 froundl_op
= 0x08, ftruncl_op
= 0x09,
149 fceill_op
= 0x0a, ffloorl_op
= 0x0b,
150 fround_op
= 0x0c, ftrunc_op
= 0x0d,
151 fceil_op
= 0x0e, ffloor_op
= 0x0f,
152 fmovc_op
= 0x11, fmovz_op
= 0x12,
153 fmovn_op
= 0x13, frecip_op
= 0x15,
154 frsqrt_op
= 0x16, fcvts_op
= 0x20,
155 fcvtd_op
= 0x21, fcvte_op
= 0x22,
156 fcvtw_op
= 0x24, fcvtl_op
= 0x25,
161 * func field of cop1x opcodes (MIPS IV).
164 lwxc1_op
= 0x00, ldxc1_op
= 0x01,
165 pfetch_op
= 0x07, swxc1_op
= 0x08,
166 sdxc1_op
= 0x09, madd_s_op
= 0x20,
167 madd_d_op
= 0x21, madd_e_op
= 0x22,
168 msub_s_op
= 0x28, msub_d_op
= 0x29,
169 msub_e_op
= 0x2a, nmadd_s_op
= 0x30,
170 nmadd_d_op
= 0x31, nmadd_e_op
= 0x32,
171 nmsub_s_op
= 0x38, nmsub_d_op
= 0x39,
176 * func field for mad opcodes (MIPS IV).
179 madd_fp_op
= 0x08, msub_fp_op
= 0x0a,
180 nmadd_fp_op
= 0x0c, nmsub_fp_op
= 0x0e
184 * func field for special3 lx opcodes (Cavium Octeon).
197 * Damn ... bitfields depend from byteorder :-(
200 struct j_format
{ /* Jump format */
201 unsigned int opcode
: 6;
202 unsigned int target
: 26;
205 struct i_format
{ /* Immediate format (addi, lw, ...) */
206 unsigned int opcode
: 6;
209 signed int simmediate
: 16;
212 struct u_format
{ /* Unsigned immediate format (ori, xori, ...) */
213 unsigned int opcode
: 6;
216 unsigned int uimmediate
: 16;
219 struct c_format
{ /* Cache (>= R6000) format */
220 unsigned int opcode
: 6;
222 unsigned int c_op
: 3;
223 unsigned int cache
: 2;
224 unsigned int simmediate
: 16;
227 struct r_format
{ /* Register format */
228 unsigned int opcode
: 6;
233 unsigned int func
: 6;
236 struct p_format
{ /* Performance counter format (R10000) */
237 unsigned int opcode
: 6;
242 unsigned int func
: 6;
245 struct f_format
{ /* FPU register format */
246 unsigned int opcode
: 6;
248 unsigned int fmt
: 4;
252 unsigned int func
: 6;
255 struct ma_format
{ /* FPU multipy and add format (MIPS IV) */
256 unsigned int opcode
: 6;
261 unsigned int func
: 4;
262 unsigned int fmt
: 2;
265 struct b_format
{ /* BREAK and SYSCALL */
266 unsigned int opcode
:6;
267 unsigned int code
:20;
271 struct fb_format
{ /* FPU branch format */
272 unsigned int opcode
:6;
276 unsigned int simmediate
:16;
279 struct fp0_format
{ /* FPU multipy and add format (MIPS32) */
280 unsigned int opcode
:6;
288 struct mm_fp0_format
{ /* FPU multipy and add format (micro_mips) */
289 unsigned int opcode
:6;
298 struct fp1_format
{ /* FPU mfc1 and cfc1 format (MIPS32) */
299 unsigned int opcode
:6;
307 struct mm_fp1_format
{ /* FPU mfc1 and cfc1 format (micro_mips) */
308 unsigned int opcode
:6;
316 struct mm_fp2_format
{ /* FPU movt and movf format (micro_mips) */
317 unsigned int opcode
:6;
327 struct mm_fp3_format
{ /* FPU abs and neg format (micro_mips) */
328 unsigned int opcode
:6;
336 struct mm_fp4_format
{ /* FPU c.cond format (micro_mips) */
337 unsigned int opcode
:6;
346 struct mm_fp5_format
{ /* FPU lwxc1 and swxc1 format (micro_mips) */
347 unsigned int opcode
:6;
348 unsigned int index
:5;
355 struct fp6_format
{ /* FPU madd and msub format (MIPS IV) */
356 unsigned int opcode
:6;
364 struct mm_fp6_format
{ /* FPU madd and msub format (micro_mips) */
365 unsigned int opcode
:6;
373 struct mm16b1_format
{ /* micro_mips 16-bit branch format */
374 unsigned int opcode
:6;
376 signed int simmediate
:7;
377 unsigned int duplicate
:16; /* a copy of the instn */
380 struct mm16b0_format
{ /* micro_mips 16-bit branch format */
381 unsigned int opcode
:6;
382 signed int simmediate
:10;
383 unsigned int duplicate
:16; /* a copy of the instn */
386 struct mm_i_format
{ /* Immediate format (addi, lw, ...) */
387 unsigned int opcode
:6;
390 signed int simmediate
:16;
396 unsigned int opcode
:5;
405 unsigned int opcode
:5;
407 unsigned int imm20_16
:5;
408 signed int imm25_21
:5;
409 /* unsigned int imm20_15:0; here is only first 16bits in first HW */
413 unsigned int opcode
:5;
419 unsigned int opcode
:5;
426 unsigned int opcode
:5;
432 unsigned int opcode
:5;
439 unsigned int opcode
:5;
445 unsigned int opcode
:6;
449 signed int simmediate
:12;
453 unsigned int opcode
:6;
454 unsigned int index
:5;
457 unsigned int func
:11;
460 struct mm16_m_format
{
461 unsigned int opcode
:6;
463 unsigned int rlist
:2;
465 unsigned int duplicate
:16; /* a copy of the instn */
468 struct mm16_rb_format
{
469 unsigned int opcode
:6;
472 signed int simmediate
:4;
473 unsigned int duplicate
:16; /* a copy of the instn */
476 struct mm16_r5_format
{
477 unsigned int opcode
:6;
479 signed int simmediate
:5;
480 unsigned int duplicate
:16; /* a copy of the instn */
483 struct mm16_r3_format
{
484 unsigned int opcode
:6;
486 signed int simmediate
:7;
487 unsigned int duplicate
:16; /* a copy of the instn */
490 #elif defined(__MIPSEL__)
492 struct j_format
{ /* Jump format */
493 unsigned int target
:26;
494 unsigned int opcode
:6;
497 struct i_format
{ /* Immediate format */
498 signed int simmediate
:16;
501 unsigned int opcode
:6;
504 struct u_format
{ /* Unsigned immediate format */
505 unsigned int uimmediate
:16;
508 unsigned int opcode
:6;
511 struct c_format
{ /* Cache (>= R6000) format */
512 unsigned int simmediate
:16;
513 unsigned int cache
:2;
516 unsigned int opcode
:6;
519 struct r_format
{ /* Register format */
525 unsigned int opcode
:6;
528 struct p_format
{ /* Performance counter format (R10000) */
534 unsigned int opcode
:6;
537 struct f_format
{ /* FPU register format */
544 unsigned int opcode
:6;
547 struct ma_format
{ /* FPU multipy and add format (MIPS IV) */
554 unsigned int opcode
:6;
557 struct b_format
{ /* BREAK and SYSCALL */
559 unsigned int code
:20;
560 unsigned int opcode
:6;
563 struct fb_format
{ /* FPU branch format */
564 unsigned int simmediate
:16;
568 unsigned int opcode
:6;
571 struct fp0_format
{ /* FPU multipy and add format (MIPS32) */
577 unsigned int opcode
:6;
580 struct mm_fp0_format
{ /* FPU multipy and add format (micro_mips) */
587 unsigned int opcode
:6;
590 struct fp1_format
{ /* FPU mfc1 and cfc1 format (MIPS32) */
596 unsigned int opcode
:6;
599 struct mm_fp1_format
{ /* FPU mfc1 and cfc1 format (micro_mips) */
605 unsigned int opcode
:6;
608 struct mm_fp2_format
{ /* FPU movt and movf format (micro_mips) */
616 unsigned int opcode
:6;
619 struct mm_fp3_format
{ /* FPU abs and neg format (micro_mips) */
625 unsigned int opcode
:6;
628 struct mm_fp4_format
{ /* FPU c.cond format (micro_mips) */
635 unsigned int opcode
:6;
638 struct mm_fp5_format
{ /* FPU lwxc1 and swxc1 format (micro_mips) */
643 unsigned int index
:5;
644 unsigned int opcode
:6;
647 struct fp6_format
{ /* FPU madd and msub format (MIPS IV) */
653 unsigned int opcode
:6;
656 struct mm_fp6_format
{ /* FPU madd and msub format (micro_mips) */
662 unsigned int opcode
:6;
665 struct mm16b1_format
{ /* micro_mips 16-bit branch format */
666 unsigned int duplicate
:16; /* a copy of the instn */
667 signed int simmediate
:7;
669 unsigned int opcode
:6;
672 struct mm16b0_format
{ /* micro_mips 16-bit branch format */
673 unsigned int duplicate
:16; /* a copy of the instn */
674 signed int simmediate
:10;
675 unsigned int opcode
:6;
678 struct mm_i_format
{ /* Immediate format */
679 signed int simmediate
:16;
682 unsigned int opcode
:6;
693 unsigned int opcode
:5;
697 /* unsigned int imm20_15:0; here is only first 16bits in first HW */
698 signed int imm25_21
:5;
699 unsigned int imm20_16
:5;
701 unsigned int opcode
:5;
707 unsigned int opcode
:5;
714 unsigned int opcode
:5;
720 unsigned int opcode
:5;
727 unsigned int opcode
:5;
733 unsigned int opcode
:5;
737 signed int simmediate
:12;
741 unsigned int opcode
:6;
745 unsigned int func
:11;
748 unsigned int index
:5;
749 unsigned int opcode
:6;
752 struct mm16_m_format
{
753 unsigned int duplicate
:16; /* a copy of the instn */
755 unsigned int rlist
:2;
757 unsigned int opcode
:6;
760 struct mm16_rb_format
{
761 unsigned int duplicate
:16; /* a copy of the instn */
762 signed int simmediate
:4;
765 unsigned int opcode
:6;
768 struct mm16_r5_format
{
769 unsigned int duplicate
:16; /* a copy of the instn */
770 signed int simmediate
:5;
772 unsigned int opcode
:6;
775 struct mm16_r3_format
{
776 unsigned int duplicate
:16; /* a copy of the instn */
777 signed int simmediate
:7;
779 unsigned int opcode
:6;
782 #else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */
783 #error "MIPS but neither __MIPSEL__ nor __MIPSEB__?"
786 union mips_instruction
{
788 unsigned short halfword
[2];
789 unsigned char byte
[4];
790 struct j_format j_format
;
791 struct i_format i_format
;
792 struct u_format u_format
;
793 struct c_format c_format
;
794 struct r_format r_format
;
795 struct f_format f_format
;
796 struct ma_format ma_format
;
797 struct b_format b_format
;
798 struct mm16b0_format mm16b0_format
;
799 struct mm16b1_format mm16b1_format
;
800 struct mm_i_format mm_i_format
;
801 struct fb_format fb_format
;
802 struct fp0_format fp0_format
;
803 struct fp1_format fp1_format
;
804 struct fp6_format fp6_format
;
805 struct mm_fp0_format mm_fp0_format
;
806 struct mm_fp1_format mm_fp1_format
;
807 struct mm_fp2_format mm_fp2_format
;
808 struct mm_fp3_format mm_fp3_format
;
809 struct mm_fp4_format mm_fp4_format
;
810 struct mm_fp5_format mm_fp5_format
;
811 struct mm_fp6_format mm_fp6_format
;
812 struct mm_m_format mm_m_format
;
813 struct mm_x_format mm_x_format
;
814 struct mm16_m_format mm16_m_format
;
815 struct mm16_rb_format mm16_rb_format
;
816 struct mm16_r3_format mm16_r3_format
;
817 struct mm16_r5_format mm16_r5_format
;
820 /* HACHACHAHCAHC ... */
822 /* In case some other massaging is needed, keep MIPSInst as wrapper */
824 #define MIPSInst(x) x
826 #define I_OPCODE_SFT 26
827 #define MIPSInst_OPCODE(x) (MIPSInst(x) >> I_OPCODE_SFT)
829 #define I_JTARGET_SFT 0
830 #define MIPSInst_JTARGET(x) (MIPSInst(x) & 0x03ffffff)
833 #define MIPSInst_RS(x) ((MIPSInst(x) & 0x03e00000) >> I_RS_SFT)
836 #define MIPSInst_RT(x) ((MIPSInst(x) & 0x001f0000) >> I_RT_SFT)
839 #define MIPSInst_SIMM(x) ((int)((short)(MIPSInst(x) & 0xffff)))
840 #define MIPSInst_UIMM(x) (MIPSInst(x) & 0xffff)
842 #define I_CACHEOP_SFT 18
843 #define MIPSInst_CACHEOP(x) ((MIPSInst(x) & 0x001c0000) >> I_CACHEOP_SFT)
845 #define I_CACHESEL_SFT 16
846 #define MIPSInst_CACHESEL(x) ((MIPSInst(x) & 0x00030000) >> I_CACHESEL_SFT)
849 #define MIPSInst_RD(x) ((MIPSInst(x) & 0x0000f800) >> I_RD_SFT)
852 #define MIPSInst_RE(x) ((MIPSInst(x) & 0x000007c0) >> I_RE_SFT)
855 #define MIPSInst_FUNC(x) (MIPSInst(x) & 0x0000003f)
857 #define I_FFMT_SFT 21
858 #define MIPSInst_FFMT(x) ((MIPSInst(x) & 0x01e00000) >> I_FFMT_SFT)
861 #define MIPSInst_FT(x) ((MIPSInst(x) & 0x001f0000) >> I_FT_SFT)
864 #define MIPSInst_FS(x) ((MIPSInst(x) & 0x0000f800) >> I_FS_SFT)
867 #define MIPSInst_FD(x) ((MIPSInst(x) & 0x000007c0) >> I_FD_SFT)
870 #define MIPSInst_FR(x) ((MIPSInst(x) & 0x03e00000) >> I_FR_SFT)
872 #define I_FMA_FUNC_SFT 2
873 #define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x0000003c) >> I_FMA_FUNC_SFT)
875 #define I_FMA_FFMT_SFT 0
876 #define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000003)
878 typedef unsigned int mips_instruction
;
880 /* The following are for micro_mips mode */
881 #define MM_16_OPCODE_SFT 10
882 #define MM_NOP16 0x0c00
883 #define MM_POOL32A_MINOR_MSK 0x3f
884 #define MM_POOL32A_MINOR_SFT 0x6
885 #define MIPS32_COND_FC 0x30
888 * Major opcodes; micro_mips mode.
891 mm_pool32a_op
, mm_pool16a_op
, mm_lbu16_op
, mm_move16_op
,
892 mm_addi32_op
, mm_lbu32_op
, mm_sb32_op
, mm_lb32_op
,
893 mm_pool32b_op
, mm_pool16b_op
, mm_lhu16_op
, mm_andi16_op
,
894 mm_andiu32_op
, mm_lhu32_op
, mm_sh32_op
, mm_lh32_op
,
895 mm_pool32i_op
, mm_pool16c_op
, mm_lwsp16_op
, mm_pool16d_op
,
896 mm_ori32_op
, mm_pool32f_op
, mm_reserve1_op
, mm_reserve2_op
,
897 mm_pool32c_op
, mm_lwgp16_op
, mm_lw16_op
, mm_pool16e_op
,
898 mm_xori32_op
, mm_jals32_op
, mm_addiupc_op
, mm_reserve3_op
,
899 mm_reserve4_op
, mm_pool16f_op
, mm_sb16_op
, mm_beqz16_op
,
900 mm_slti32_op
, mm_beq32_op
, mm_swc132_op
, mm_lwc132_op
,
901 mm_reserve5_op
, mm_reserve6_op
, mm_sh16_op
, mm_bnez16_op
,
902 mm_sltiu32_op
, mm_bne32_op
, mm_sdc132_op
, mm_ldc132_op
,
903 mm_reserve7_op
, mm_reserve8_op
, mm_swsp16_op
, mm_b16_op
,
904 mm_and32_op
, mm_j32_op
, mm_sd32_op
, mm_ld32_op
,
905 mm_reserve11_op
, mm_reserve12_op
, mm_sw16_op
, mm_li16_op
,
906 mm_jalx32_op
, mm_jal32_op
, mm_sw32_op
, mm_lw32_op
910 * POOL32I minor opcodes.
912 enum mm_32i_minor_op
{
913 mm_bltz_op
, mm_bltzal_op
, mm_bgez_op
, mm_bgezal_op
,
914 mm_blez_op
, mm_bnezc_op
, mm_bgtz_op
, mm_beqzc_op
,
915 mm_tlti_op
, mm_tgei_op
, mm_tltiu_op
, mm_tgeiu_op
,
916 mm_tnei_op
, mm_lui_op
, mm_teqi_op
, mm_resv1_op
,
917 mm_synci_op
, mm_bltzals_op
, mm_resv2_op
, mm_bgezals_op
,
918 mm_bc2f_op
, mm_bc2t_op
, mm_resv3_op
, mm_resv4_op
,
919 mm_resv5_op
, mm_resv6_op
, mm_bposge64_op
, mm_bposge32_op
,
920 mm_bc1f_op
, mm_bc1t_op
, mm_resv7_op
, mm_resv8_op
,
921 mm_bc1any2f_op
, mm_bc1any2t_op
, mm_bc1any4f_op
, mm_bc1any4t_op
925 * POOL32A minor opcodes.
927 enum mm_32a_minor_op
{
928 mm_pool32axf_op
= 0x3c
932 mm_lwxs32_func
= 0x118
936 * POOL32B minor opcodes.
954 * POOL32C minor opcodes.
961 * POOL32AXF minor opcodes.
963 enum mm_32axf_minor_op
{
965 mm_jalrhb_op
= 0x07c,
967 mm_jalrshb_op
= 0x17c,
971 * POOL32F minor opcodes.
973 enum mm_32f_minor_op
{
995 * POOL32F secondary minor opcodes.
997 enum mm_32f_10_minor_op
{
1007 mm_lwxc1_func
= 0x48,
1008 mm_swxc1_func
= 0x88,
1009 mm_ldxc1_func
= 0xc8,
1010 mm_sdxc1_func
= 0x108,
1014 * POOL32F secondary minor opcodes.
1016 enum mm_32f_40_minor_op
{
1022 * POOL32F secondary minor opcodes.
1024 enum mm_32f_60_minor_op
{
1032 * POOL32F secondary minor opcodes.
1034 enum mm_32f_70_minor_op
{
1040 * POOL32F secondary minor opcodes (POOL32FXF).
1042 enum mm_32f_73_minor_op
{
1046 mm_frsqrt_op
= 0x08,
1047 mm_ffloorl_op
= 0x0c,
1052 mm_ffloorw_op
= 0x2c,
1055 mm_frecip_op
= 0x48,
1056 mm_fceill_op
= 0x4c,
1057 mm_fcvtd0_op
= 0x4d,
1059 mm_fceilw_op
= 0x6c,
1060 mm_fcvts0_op
= 0x6d,
1064 mm_ftruncl_op
= 0x8c,
1068 mm_ftruncw_op
= 0xac,
1070 mm_froundl_op
= 0xcc,
1071 mm_fcvtd1_op
= 0xcd,
1072 mm_froundw_op
= 0xec,
1073 mm_fcvts1_op
= 0xed,
1077 * POOL16C minor opcodes.
1079 enum mm_16c_minor_op
{
1088 struct decoded_instn
{
1089 mips_instruction insn
;
1090 mips_instruction next_insn
;
1093 int micro_mips_mode
;
1096 /* recode table from MIPS16e register notation to GPR */
1097 extern int mips16e_reg2gpr
[];
1099 union mips16e_instruction
{
1100 unsigned int full
:16;
1111 MIPS16e_jal_op
= 003,
1112 MIPS16e_ld_op
= 007,
1113 MIPS16e_i8_op
= 014,
1114 MIPS16e_sd_op
= 017,
1115 MIPS16e_lb_op
= 020,
1116 MIPS16e_lh_op
= 021,
1117 MIPS16e_lwsp_op
= 022,
1118 MIPS16e_lw_op
= 023,
1119 MIPS16e_lbu_op
= 024,
1120 MIPS16e_lhu_op
= 025,
1121 MIPS16e_lwpc_op
= 026,
1122 MIPS16e_lwu_op
= 027,
1123 MIPS16e_sb_op
= 030,
1124 MIPS16e_sh_op
= 031,
1125 MIPS16e_swsp_op
= 032,
1126 MIPS16e_sw_op
= 033,
1127 MIPS16e_rr_op
= 035,
1128 MIPS16e_extend_op
= 036,
1129 MIPS16e_i64_op
= 037,
1132 enum MIPS16e_i64_func
{
1135 MIPS16e_sdrasp_func
,
1136 MIPS16e_dadjsp_func
,
1140 enum MIPS16e_rr_func
{
1144 enum MIPS6e_i8_func
{
1145 MIPS16e_swrasp_func
= 02,
1149 * This functions returns 1 if the micro_mips instr is a 16 bit instr.
1150 * Otherwise return 0.
1152 #define MIPS_ISA_MODE 01
1153 #define is16mode(regs) (regs->cp0_epc & MIPS_ISA_MODE)
1155 static inline int mm_is16bit(u16 instr
)
1157 /* take LS 3 bits */
1158 u16 opcode_low
= (instr
>> MM_16_OPCODE_SFT
) & 0x7;
1160 if (opcode_low
>= 1 && opcode_low
<= 3)
1166 #endif /* _ASM_INST_H */