1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _ASM_INST_H 20 #define _ASM_INST_H 21 #include <asm/bitfield.h> 22 enum major_op { 23 spec_op, 24 bcond_op, 25 j_op, 26 jal_op, 27 beq_op, 28 bne_op, 29 blez_op, 30 bgtz_op, 31 addi_op, 32 pop10_op = addi_op, 33 addiu_op, 34 slti_op, 35 sltiu_op, 36 andi_op, 37 ori_op, 38 xori_op, 39 lui_op, 40 cop0_op, 41 cop1_op, 42 cop2_op, 43 cop1x_op, 44 beql_op, 45 bnel_op, 46 blezl_op, 47 bgtzl_op, 48 daddi_op, 49 pop30_op = daddi_op, 50 daddiu_op, 51 ldl_op, 52 ldr_op, 53 spec2_op, 54 jalx_op, 55 mdmx_op, 56 msa_op = mdmx_op, 57 spec3_op, 58 lb_op, 59 lh_op, 60 lwl_op, 61 lw_op, 62 lbu_op, 63 lhu_op, 64 lwr_op, 65 lwu_op, 66 sb_op, 67 sh_op, 68 swl_op, 69 sw_op, 70 sdl_op, 71 sdr_op, 72 swr_op, 73 cache_op, 74 ll_op, 75 lwc1_op, 76 lwc2_op, 77 bc6_op = lwc2_op, 78 pref_op, 79 lld_op, 80 ldc1_op, 81 ldc2_op, 82 pop66_op = ldc2_op, 83 ld_op, 84 sc_op, 85 swc1_op, 86 swc2_op, 87 balc6_op = swc2_op, 88 major_3b_op, 89 scd_op, 90 sdc1_op, 91 sdc2_op, 92 pop76_op = sdc2_op, 93 sd_op 94 }; 95 enum spec_op { 96 sll_op, 97 movc_op, 98 srl_op, 99 sra_op, 100 sllv_op, 101 pmon_op, 102 srlv_op, 103 srav_op, 104 jr_op, 105 jalr_op, 106 movz_op, 107 movn_op, 108 syscall_op, 109 break_op, 110 spim_op, 111 sync_op, 112 mfhi_op, 113 mthi_op, 114 mflo_op, 115 mtlo_op, 116 dsllv_op, 117 spec2_unused_op, 118 dsrlv_op, 119 dsrav_op, 120 mult_op, 121 multu_op, 122 div_op, 123 divu_op, 124 dmult_op, 125 dmultu_op, 126 ddiv_op, 127 ddivu_op, 128 add_op, 129 addu_op, 130 sub_op, 131 subu_op, 132 and_op, 133 or_op, 134 xor_op, 135 nor_op, 136 spec3_unused_op, 137 spec4_unused_op, 138 slt_op, 139 sltu_op, 140 dadd_op, 141 daddu_op, 142 dsub_op, 143 dsubu_op, 144 tge_op, 145 tgeu_op, 146 tlt_op, 147 tltu_op, 148 teq_op, 149 seleqz_op, 150 tne_op, 151 selnez_op, 152 dsll_op, 153 spec5_unused_op, 154 dsrl_op, 155 dsra_op, 156 dsll32_op, 157 spec6_unused_op, 158 dsrl32_op, 159 dsra32_op 160 }; 161 enum spec2_op { 162 madd_op, 163 maddu_op, 164 mul_op, 165 spec2_3_unused_op, 166 msub_op, 167 msubu_op, 168 clz_op = 0x20, 169 clo_op, 170 dclz_op = 0x24, 171 dclo_op, 172 sdbpp_op = 0x3f 173 }; 174 enum spec3_op { 175 ext_op, 176 dextm_op, 177 dextu_op, 178 dext_op, 179 ins_op, 180 dinsm_op, 181 dinsu_op, 182 dins_op, 183 yield_op = 0x09, 184 lx_op = 0x0a, 185 lwle_op = 0x19, 186 lwre_op = 0x1a, 187 cachee_op = 0x1b, 188 sbe_op = 0x1c, 189 she_op = 0x1d, 190 sce_op = 0x1e, 191 swe_op = 0x1f, 192 bshfl_op = 0x20, 193 swle_op = 0x21, 194 swre_op = 0x22, 195 prefe_op = 0x23, 196 dbshfl_op = 0x24, 197 cache6_op = 0x25, 198 sc6_op = 0x26, 199 scd6_op = 0x27, 200 lbue_op = 0x28, 201 lhue_op = 0x29, 202 lbe_op = 0x2c, 203 lhe_op = 0x2d, 204 lle_op = 0x2e, 205 lwe_op = 0x2f, 206 pref6_op = 0x35, 207 ll6_op = 0x36, 208 lld6_op = 0x37, 209 rdhwr_op = 0x3b 210 }; 211 enum mult_op { 212 mult_mult_op = 0x0, 213 mult_mul_op = 0x2, 214 mult_muh_op = 0x3, 215 }; 216 enum multu_op { 217 multu_multu_op = 0x0, 218 multu_mulu_op = 0x2, 219 multu_muhu_op = 0x3, 220 }; 221 enum div_op { 222 div_div_op = 0x0, 223 div_div6_op = 0x2, 224 div_mod_op = 0x3, 225 }; 226 enum divu_op { 227 divu_divu_op = 0x0, 228 divu_divu6_op = 0x2, 229 divu_modu_op = 0x3, 230 }; 231 enum dmult_op { 232 dmult_dmult_op = 0x0, 233 dmult_dmul_op = 0x2, 234 dmult_dmuh_op = 0x3, 235 }; 236 enum dmultu_op { 237 dmultu_dmultu_op = 0x0, 238 dmultu_dmulu_op = 0x2, 239 dmultu_dmuhu_op = 0x3, 240 }; 241 enum ddiv_op { 242 ddiv_ddiv_op = 0x0, 243 ddiv_ddiv6_op = 0x2, 244 ddiv_dmod_op = 0x3, 245 }; 246 enum ddivu_op { 247 ddivu_ddivu_op = 0x0, 248 ddivu_ddivu6_op = 0x2, 249 ddivu_dmodu_op = 0x3, 250 }; 251 enum rt_op { 252 bltz_op, 253 bgez_op, 254 bltzl_op, 255 bgezl_op, 256 spimi_op, 257 unused_rt_op_0x05, 258 unused_rt_op_0x06, 259 unused_rt_op_0x07, 260 tgei_op, 261 tgeiu_op, 262 tlti_op, 263 tltiu_op, 264 teqi_op, 265 unused_0x0d_rt_op, 266 tnei_op, 267 unused_0x0f_rt_op, 268 bltzal_op, 269 bgezal_op, 270 bltzall_op, 271 bgezall_op, 272 rt_op_0x14, 273 rt_op_0x15, 274 rt_op_0x16, 275 rt_op_0x17, 276 rt_op_0x18, 277 rt_op_0x19, 278 rt_op_0x1a, 279 rt_op_0x1b, 280 bposge32_op, 281 rt_op_0x1d, 282 rt_op_0x1e, 283 synci_op 284 }; 285 enum cop_op { 286 mfc_op = 0x00, 287 dmfc_op = 0x01, 288 cfc_op = 0x02, 289 mfhc0_op = 0x02, 290 mfhc_op = 0x03, 291 mtc_op = 0x04, 292 dmtc_op = 0x05, 293 ctc_op = 0x06, 294 mthc0_op = 0x06, 295 mthc_op = 0x07, 296 bc_op = 0x08, 297 bc1eqz_op = 0x09, 298 mfmc0_op = 0x0b, 299 bc1nez_op = 0x0d, 300 wrpgpr_op = 0x0e, 301 cop_op = 0x10, 302 copm_op = 0x18 303 }; 304 enum bcop_op { 305 bcf_op, 306 bct_op, 307 bcfl_op, 308 bctl_op 309 }; 310 enum cop0_coi_func { 311 tlbr_op = 0x01, 312 tlbwi_op = 0x02, 313 tlbwr_op = 0x06, 314 tlbp_op = 0x08, 315 rfe_op = 0x10, 316 eret_op = 0x18, 317 wait_op = 0x20, 318 hypcall_op = 0x28 319 }; 320 enum cop0_com_func { 321 tlbr1_op = 0x01, 322 tlbw_op = 0x02, 323 tlbp1_op = 0x08, 324 dctr_op = 0x09, 325 dctw_op = 0x0a 326 }; 327 enum cop1_fmt { 328 s_fmt, 329 d_fmt, 330 e_fmt, 331 q_fmt, 332 w_fmt, 333 l_fmt 334 }; 335 enum cop1_sdw_func { 336 fadd_op = 0x00, 337 fsub_op = 0x01, 338 fmul_op = 0x02, 339 fdiv_op = 0x03, 340 fsqrt_op = 0x04, 341 fabs_op = 0x05, 342 fmov_op = 0x06, 343 fneg_op = 0x07, 344 froundl_op = 0x08, 345 ftruncl_op = 0x09, 346 fceill_op = 0x0a, 347 ffloorl_op = 0x0b, 348 fround_op = 0x0c, 349 ftrunc_op = 0x0d, 350 fceil_op = 0x0e, 351 ffloor_op = 0x0f, 352 fsel_op = 0x10, 353 fmovc_op = 0x11, 354 fmovz_op = 0x12, 355 fmovn_op = 0x13, 356 fseleqz_op = 0x14, 357 frecip_op = 0x15, 358 frsqrt_op = 0x16, 359 fselnez_op = 0x17, 360 fmaddf_op = 0x18, 361 fmsubf_op = 0x19, 362 frint_op = 0x1a, 363 fclass_op = 0x1b, 364 fmin_op = 0x1c, 365 fmina_op = 0x1d, 366 fmax_op = 0x1e, 367 fmaxa_op = 0x1f, 368 fcvts_op = 0x20, 369 fcvtd_op = 0x21, 370 fcvte_op = 0x22, 371 fcvtw_op = 0x24, 372 fcvtl_op = 0x25, 373 fcmp_op = 0x30 374 }; 375 enum cop1x_func { 376 lwxc1_op = 0x00, 377 ldxc1_op = 0x01, 378 swxc1_op = 0x08, 379 sdxc1_op = 0x09, 380 pfetch_op = 0x0f, 381 madd_s_op = 0x20, 382 madd_d_op = 0x21, 383 madd_e_op = 0x22, 384 msub_s_op = 0x28, 385 msub_d_op = 0x29, 386 msub_e_op = 0x2a, 387 nmadd_s_op = 0x30, 388 nmadd_d_op = 0x31, 389 nmadd_e_op = 0x32, 390 nmsub_s_op = 0x38, 391 nmsub_d_op = 0x39, 392 nmsub_e_op = 0x3a 393 }; 394 enum mad_func { 395 madd_fp_op = 0x08, 396 msub_fp_op = 0x0a, 397 nmadd_fp_op = 0x0c, 398 nmsub_fp_op = 0x0e 399 }; 400 enum ptw_func { 401 lwdir_op = 0x00, 402 lwpte_op = 0x01, 403 lddir_op = 0x02, 404 ldpte_op = 0x03, 405 }; 406 enum lx_func { 407 lwx_op = 0x00, 408 lhx_op = 0x04, 409 lbux_op = 0x06, 410 ldx_op = 0x08, 411 lwux_op = 0x10, 412 lhux_op = 0x14, 413 lbx_op = 0x16, 414 }; 415 enum bshfl_func { 416 wsbh_op = 0x2, 417 seb_op = 0x10, 418 seh_op = 0x18, 419 }; 420 enum dbshfl_func { 421 dsbh_op = 0x2, 422 dshd_op = 0x5, 423 }; 424 enum msa_func { 425 msa_elm_op = 0x19, 426 }; 427 enum msa_elm { 428 msa_ctc_op = 0x3e, 429 msa_cfc_op = 0x7e, 430 }; 431 enum msa_mi10_func { 432 msa_ld_op = 8, 433 msa_st_op = 9, 434 }; 435 enum msa_2b_fmt { 436 msa_fmt_b = 0, 437 msa_fmt_h = 1, 438 msa_fmt_w = 2, 439 msa_fmt_d = 3, 440 }; 441 enum mm_major_op { 442 mm_pool32a_op, 443 mm_pool16a_op, 444 mm_lbu16_op, 445 mm_move16_op, 446 mm_addi32_op, 447 mm_lbu32_op, 448 mm_sb32_op, 449 mm_lb32_op, 450 mm_pool32b_op, 451 mm_pool16b_op, 452 mm_lhu16_op, 453 mm_andi16_op, 454 mm_addiu32_op, 455 mm_lhu32_op, 456 mm_sh32_op, 457 mm_lh32_op, 458 mm_pool32i_op, 459 mm_pool16c_op, 460 mm_lwsp16_op, 461 mm_pool16d_op, 462 mm_ori32_op, 463 mm_pool32f_op, 464 mm_pool32s_op, 465 mm_reserved2_op, 466 mm_pool32c_op, 467 mm_lwgp16_op, 468 mm_lw16_op, 469 mm_pool16e_op, 470 mm_xori32_op, 471 mm_jals32_op, 472 mm_addiupc_op, 473 mm_reserved3_op, 474 mm_reserved4_op, 475 mm_pool16f_op, 476 mm_sb16_op, 477 mm_beqz16_op, 478 mm_slti32_op, 479 mm_beq32_op, 480 mm_swc132_op, 481 mm_lwc132_op, 482 mm_reserved5_op, 483 mm_reserved6_op, 484 mm_sh16_op, 485 mm_bnez16_op, 486 mm_sltiu32_op, 487 mm_bne32_op, 488 mm_sdc132_op, 489 mm_ldc132_op, 490 mm_reserved7_op, 491 mm_reserved8_op, 492 mm_swsp16_op, 493 mm_b16_op, 494 mm_andi32_op, 495 mm_j32_op, 496 mm_sd32_op, 497 mm_ld32_op, 498 mm_reserved11_op, 499 mm_reserved12_op, 500 mm_sw16_op, 501 mm_li16_op, 502 mm_jalx32_op, 503 mm_jal32_op, 504 mm_sw32_op, 505 mm_lw32_op, 506 }; 507 enum mm_32i_minor_op { 508 mm_bltz_op, 509 mm_bltzal_op, 510 mm_bgez_op, 511 mm_bgezal_op, 512 mm_blez_op, 513 mm_bnezc_op, 514 mm_bgtz_op, 515 mm_beqzc_op, 516 mm_tlti_op, 517 mm_tgei_op, 518 mm_tltiu_op, 519 mm_tgeiu_op, 520 mm_tnei_op, 521 mm_lui_op, 522 mm_teqi_op, 523 mm_reserved13_op, 524 mm_synci_op, 525 mm_bltzals_op, 526 mm_reserved14_op, 527 mm_bgezals_op, 528 mm_bc2f_op, 529 mm_bc2t_op, 530 mm_reserved15_op, 531 mm_reserved16_op, 532 mm_reserved17_op, 533 mm_reserved18_op, 534 mm_bposge64_op, 535 mm_bposge32_op, 536 mm_bc1f_op, 537 mm_bc1t_op, 538 mm_reserved19_op, 539 mm_reserved20_op, 540 mm_bc1any2f_op, 541 mm_bc1any2t_op, 542 mm_bc1any4f_op, 543 mm_bc1any4t_op, 544 }; 545 enum mm_32a_minor_op { 546 mm_sll32_op = 0x000, 547 mm_ins_op = 0x00c, 548 mm_sllv32_op = 0x010, 549 mm_ext_op = 0x02c, 550 mm_pool32axf_op = 0x03c, 551 mm_srl32_op = 0x040, 552 mm_srlv32_op = 0x050, 553 mm_sra_op = 0x080, 554 mm_srav_op = 0x090, 555 mm_rotr_op = 0x0c0, 556 mm_lwxs_op = 0x118, 557 mm_addu32_op = 0x150, 558 mm_subu32_op = 0x1d0, 559 mm_wsbh_op = 0x1ec, 560 mm_mul_op = 0x210, 561 mm_and_op = 0x250, 562 mm_or32_op = 0x290, 563 mm_xor32_op = 0x310, 564 mm_slt_op = 0x350, 565 mm_sltu_op = 0x390, 566 }; 567 enum mm_32b_func { 568 mm_lwc2_func = 0x0, 569 mm_lwp_func = 0x1, 570 mm_ldc2_func = 0x2, 571 mm_ldp_func = 0x4, 572 mm_lwm32_func = 0x5, 573 mm_cache_func = 0x6, 574 mm_ldm_func = 0x7, 575 mm_swc2_func = 0x8, 576 mm_swp_func = 0x9, 577 mm_sdc2_func = 0xa, 578 mm_sdp_func = 0xc, 579 mm_swm32_func = 0xd, 580 mm_sdm_func = 0xf, 581 }; 582 enum mm_32c_func { 583 mm_pref_func = 0x2, 584 mm_ll_func = 0x3, 585 mm_swr_func = 0x9, 586 mm_sc_func = 0xb, 587 mm_lwu_func = 0xe, 588 }; 589 enum mm_32axf_minor_op { 590 mm_mfc0_op = 0x003, 591 mm_mtc0_op = 0x00b, 592 mm_tlbp_op = 0x00d, 593 mm_mfhi32_op = 0x035, 594 mm_jalr_op = 0x03c, 595 mm_tlbr_op = 0x04d, 596 mm_mflo32_op = 0x075, 597 mm_jalrhb_op = 0x07c, 598 mm_tlbwi_op = 0x08d, 599 mm_mthi32_op = 0x0b5, 600 mm_tlbwr_op = 0x0cd, 601 mm_mtlo32_op = 0x0f5, 602 mm_di_op = 0x11d, 603 mm_jalrs_op = 0x13c, 604 mm_jalrshb_op = 0x17c, 605 mm_sync_op = 0x1ad, 606 mm_syscall_op = 0x22d, 607 mm_wait_op = 0x24d, 608 mm_eret_op = 0x3cd, 609 mm_divu_op = 0x5dc, 610 }; 611 enum mm_32f_minor_op { 612 mm_32f_00_op = 0x00, 613 mm_32f_01_op = 0x01, 614 mm_32f_02_op = 0x02, 615 mm_32f_10_op = 0x08, 616 mm_32f_11_op = 0x09, 617 mm_32f_12_op = 0x0a, 618 mm_32f_20_op = 0x10, 619 mm_32f_30_op = 0x18, 620 mm_32f_40_op = 0x20, 621 mm_32f_41_op = 0x21, 622 mm_32f_42_op = 0x22, 623 mm_32f_50_op = 0x28, 624 mm_32f_51_op = 0x29, 625 mm_32f_52_op = 0x2a, 626 mm_32f_60_op = 0x30, 627 mm_32f_70_op = 0x38, 628 mm_32f_73_op = 0x3b, 629 mm_32f_74_op = 0x3c, 630 }; 631 enum mm_32f_10_minor_op { 632 mm_lwxc1_op = 0x1, 633 mm_swxc1_op, 634 mm_ldxc1_op, 635 mm_sdxc1_op, 636 mm_luxc1_op, 637 mm_suxc1_op, 638 }; 639 enum mm_32f_func { 640 mm_lwxc1_func = 0x048, 641 mm_swxc1_func = 0x088, 642 mm_ldxc1_func = 0x0c8, 643 mm_sdxc1_func = 0x108, 644 }; 645 enum mm_32f_40_minor_op { 646 mm_fmovf_op, 647 mm_fmovt_op, 648 }; 649 enum mm_32f_60_minor_op { 650 mm_fadd_op, 651 mm_fsub_op, 652 mm_fmul_op, 653 mm_fdiv_op, 654 }; 655 enum mm_32f_70_minor_op { 656 mm_fmovn_op, 657 mm_fmovz_op, 658 }; 659 enum mm_32f_73_minor_op { 660 mm_fmov0_op = 0x01, 661 mm_fcvtl_op = 0x04, 662 mm_movf0_op = 0x05, 663 mm_frsqrt_op = 0x08, 664 mm_ffloorl_op = 0x0c, 665 mm_fabs0_op = 0x0d, 666 mm_fcvtw_op = 0x24, 667 mm_movt0_op = 0x25, 668 mm_fsqrt_op = 0x28, 669 mm_ffloorw_op = 0x2c, 670 mm_fneg0_op = 0x2d, 671 mm_cfc1_op = 0x40, 672 mm_frecip_op = 0x48, 673 mm_fceill_op = 0x4c, 674 mm_fcvtd0_op = 0x4d, 675 mm_ctc1_op = 0x60, 676 mm_fceilw_op = 0x6c, 677 mm_fcvts0_op = 0x6d, 678 mm_mfc1_op = 0x80, 679 mm_fmov1_op = 0x81, 680 mm_movf1_op = 0x85, 681 mm_ftruncl_op = 0x8c, 682 mm_fabs1_op = 0x8d, 683 mm_mtc1_op = 0xa0, 684 mm_movt1_op = 0xa5, 685 mm_ftruncw_op = 0xac, 686 mm_fneg1_op = 0xad, 687 mm_mfhc1_op = 0xc0, 688 mm_froundl_op = 0xcc, 689 mm_fcvtd1_op = 0xcd, 690 mm_mthc1_op = 0xe0, 691 mm_froundw_op = 0xec, 692 mm_fcvts1_op = 0xed, 693 }; 694 enum mm_32s_minor_op { 695 mm_32s_elm_op = 0x16, 696 }; 697 enum mm_16c_minor_op { 698 mm_lwm16_op = 0x04, 699 mm_swm16_op = 0x05, 700 mm_jr16_op = 0x0c, 701 mm_jrc_op = 0x0d, 702 mm_jalr16_op = 0x0e, 703 mm_jalrs16_op = 0x0f, 704 mm_jraddiusp_op = 0x18, 705 }; 706 enum mm_16d_minor_op { 707 mm_addius5_func, 708 mm_addiusp_func, 709 }; 710 enum MIPS16e_ops { 711 MIPS16e_jal_op = 003, 712 MIPS16e_ld_op = 007, 713 MIPS16e_i8_op = 014, 714 MIPS16e_sd_op = 017, 715 MIPS16e_lb_op = 020, 716 MIPS16e_lh_op = 021, 717 MIPS16e_lwsp_op = 022, 718 MIPS16e_lw_op = 023, 719 MIPS16e_lbu_op = 024, 720 MIPS16e_lhu_op = 025, 721 MIPS16e_lwpc_op = 026, 722 MIPS16e_lwu_op = 027, 723 MIPS16e_sb_op = 030, 724 MIPS16e_sh_op = 031, 725 MIPS16e_swsp_op = 032, 726 MIPS16e_sw_op = 033, 727 MIPS16e_rr_op = 035, 728 MIPS16e_extend_op = 036, 729 MIPS16e_i64_op = 037, 730 }; 731 enum MIPS16e_i64_func { 732 MIPS16e_ldsp_func, 733 MIPS16e_sdsp_func, 734 MIPS16e_sdrasp_func, 735 MIPS16e_dadjsp_func, 736 MIPS16e_ldpc_func, 737 }; 738 enum MIPS16e_rr_func { 739 MIPS16e_jr_func, 740 }; 741 enum MIPS6e_i8_func { 742 MIPS16e_swrasp_func = 02, 743 }; 744 #define MM_NOP16 0x0c00 745 struct j_format { 746 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int target : 26,; 747 )) 748 }; 749 struct i_format { 750 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(signed int simmediate : 16,; 751 )))) 752 }; 753 struct u_format { 754 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int uimmediate : 16,; 755 )))) 756 }; 757 struct c_format { 758 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int c_op : 3, __BITFIELD_FIELD(unsigned int cache : 2, __BITFIELD_FIELD(unsigned int simmediate : 16,; 759 ))))) 760 }; 761 struct r_format { 762 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int re : 5, __BITFIELD_FIELD(unsigned int func : 6,; 763 )))))) 764 }; 765 struct c0r_format { 766 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int z : 8, __BITFIELD_FIELD(unsigned int sel : 3,; 767 )))))) 768 }; 769 struct mfmc0_format { 770 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int re : 5, __BITFIELD_FIELD(unsigned int sc : 1, __BITFIELD_FIELD(unsigned int : 2, __BITFIELD_FIELD(unsigned int sel : 3,; 771 )))))))) 772 }; 773 struct co_format { 774 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int co : 1, __BITFIELD_FIELD(unsigned int code : 19, __BITFIELD_FIELD(unsigned int func : 6,; 775 )))) 776 }; 777 struct p_format { 778 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int re : 5, __BITFIELD_FIELD(unsigned int func : 6,; 779 )))))) 780 }; 781 struct f_format { 782 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int : 1, __BITFIELD_FIELD(unsigned int fmt : 4, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int re : 5, __BITFIELD_FIELD(unsigned int func : 6,; 783 ))))))) 784 }; 785 struct ma_format { 786 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int fr : 5, __BITFIELD_FIELD(unsigned int ft : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int func : 4, __BITFIELD_FIELD(unsigned int fmt : 2,; 787 ))))))) 788 }; 789 struct b_format { 790 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int code : 20, __BITFIELD_FIELD(unsigned int func : 6,; 791 ))) 792 }; 793 struct ps_format { 794 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int ft : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int func : 6,; 795 )))))) 796 }; 797 struct v_format { 798 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int sel : 4, __BITFIELD_FIELD(unsigned int fmt : 1, __BITFIELD_FIELD(unsigned int vt : 5, __BITFIELD_FIELD(unsigned int vs : 5, __BITFIELD_FIELD(unsigned int vd : 5, __BITFIELD_FIELD(unsigned int func : 6,; 799 ))))))) 800 }; 801 struct msa_mi10_format { 802 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(signed int s10 : 10, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int wd : 5, __BITFIELD_FIELD(unsigned int func : 4, __BITFIELD_FIELD(unsigned int df : 2,; 803 )))))) 804 }; 805 struct dsp_format { 806 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int base : 5, __BITFIELD_FIELD(unsigned int index : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int op : 5, __BITFIELD_FIELD(unsigned int func : 6,; 807 )))))) 808 }; 809 struct spec3_format { 810 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(signed int simmediate : 9, __BITFIELD_FIELD(unsigned int func : 7,; 811 ))))) 812 }; 813 struct fb_format { 814 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int bc : 5, __BITFIELD_FIELD(unsigned int cc : 3, __BITFIELD_FIELD(unsigned int flag : 2, __BITFIELD_FIELD(signed int simmediate : 16,; 815 ))))) 816 }; 817 struct fp0_format { 818 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int fmt : 5, __BITFIELD_FIELD(unsigned int ft : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int func : 6,; 819 )))))) 820 }; 821 struct mm_fp0_format { 822 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int ft : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int fmt : 3, __BITFIELD_FIELD(unsigned int op : 2, __BITFIELD_FIELD(unsigned int func : 6,; 823 ))))))) 824 }; 825 struct fp1_format { 826 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int op : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int func : 6,; 827 )))))) 828 }; 829 struct mm_fp1_format { 830 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fmt : 2, __BITFIELD_FIELD(unsigned int op : 8, __BITFIELD_FIELD(unsigned int func : 6,; 831 )))))) 832 }; 833 struct mm_fp2_format { 834 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int cc : 3, __BITFIELD_FIELD(unsigned int zero : 2, __BITFIELD_FIELD(unsigned int fmt : 2, __BITFIELD_FIELD(unsigned int op : 3, __BITFIELD_FIELD(unsigned int func : 6,; 835 )))))))) 836 }; 837 struct mm_fp3_format { 838 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fmt : 3, __BITFIELD_FIELD(unsigned int op : 7, __BITFIELD_FIELD(unsigned int func : 6,; 839 )))))) 840 }; 841 struct mm_fp4_format { 842 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int cc : 3, __BITFIELD_FIELD(unsigned int fmt : 3, __BITFIELD_FIELD(unsigned int cond : 4, __BITFIELD_FIELD(unsigned int func : 6,; 843 ))))))) 844 }; 845 struct mm_fp5_format { 846 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int index : 5, __BITFIELD_FIELD(unsigned int base : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int op : 5, __BITFIELD_FIELD(unsigned int func : 6,; 847 )))))) 848 }; 849 struct fp6_format { 850 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int fr : 5, __BITFIELD_FIELD(unsigned int ft : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int func : 6,; 851 )))))) 852 }; 853 struct mm_fp6_format { 854 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int ft : 5, __BITFIELD_FIELD(unsigned int fs : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int fr : 5, __BITFIELD_FIELD(unsigned int func : 6,; 855 )))))) 856 }; 857 struct mm_i_format { 858 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(signed int simmediate : 16,; 859 )))) 860 }; 861 struct mm_m_format { 862 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int base : 5, __BITFIELD_FIELD(unsigned int func : 4, __BITFIELD_FIELD(signed int simmediate : 12,; 863 ))))) 864 }; 865 struct mm_x_format { 866 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int index : 5, __BITFIELD_FIELD(unsigned int base : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int func : 11,; 867 ))))) 868 }; 869 struct mm_a_format { 870 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 3, __BITFIELD_FIELD(signed int simmediate : 23,; 871 ))) 872 }; 873 struct mm_b0_format { 874 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(signed int simmediate : 10, __BITFIELD_FIELD(unsigned int : 16,; 875 ))) 876 }; 877 struct mm_b1_format { 878 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 3, __BITFIELD_FIELD(signed int simmediate : 7, __BITFIELD_FIELD(unsigned int : 16,; 879 )))) 880 }; 881 struct mm16_m_format { 882 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int func : 4, __BITFIELD_FIELD(unsigned int rlist : 2, __BITFIELD_FIELD(unsigned int imm : 4, __BITFIELD_FIELD(unsigned int : 16,; 883 ))))) 884 }; 885 struct mm16_rb_format { 886 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 3, __BITFIELD_FIELD(unsigned int base : 3, __BITFIELD_FIELD(signed int simmediate : 4, __BITFIELD_FIELD(unsigned int : 16,; 887 ))))) 888 }; 889 struct mm16_r3_format { 890 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 3, __BITFIELD_FIELD(signed int simmediate : 7, __BITFIELD_FIELD(unsigned int : 16,; 891 )))) 892 }; 893 struct mm16_r5_format { 894 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int imm : 5, __BITFIELD_FIELD(unsigned int : 16,; 895 )))) 896 }; 897 struct loongson3_lswc2_format { 898 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int base : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int fr : 1, __BITFIELD_FIELD(unsigned int offset : 9, __BITFIELD_FIELD(unsigned int ls : 1, __BITFIELD_FIELD(unsigned int rq : 5,; 899 ))))))) 900 }; 901 struct loongson3_lsdc2_format { 902 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int base : 5, __BITFIELD_FIELD(unsigned int rt : 5, __BITFIELD_FIELD(unsigned int index : 5, __BITFIELD_FIELD(unsigned int offset : 8, __BITFIELD_FIELD(unsigned int opcode1 : 3,; 903 )))))) 904 }; 905 struct loongson3_lscsr_format { 906 __BITFIELD_FIELD(unsigned int opcode : 6, __BITFIELD_FIELD(unsigned int rs : 5, __BITFIELD_FIELD(unsigned int fr : 5, __BITFIELD_FIELD(unsigned int rd : 5, __BITFIELD_FIELD(unsigned int fd : 5, __BITFIELD_FIELD(unsigned int func : 6,; 907 )))))) 908 }; 909 struct m16e_rr { 910 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int rx : 3, __BITFIELD_FIELD(unsigned int nd : 1, __BITFIELD_FIELD(unsigned int l : 1, __BITFIELD_FIELD(unsigned int ra : 1, __BITFIELD_FIELD(unsigned int func : 5,; 911 )))))) 912 }; 913 struct m16e_jal { 914 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int x : 1, __BITFIELD_FIELD(unsigned int imm20_16 : 5, __BITFIELD_FIELD(signed int imm25_21 : 5,; 915 )))) 916 }; 917 struct m16e_i64 { 918 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int func : 3, __BITFIELD_FIELD(unsigned int imm : 8,; 919 ))) 920 }; 921 struct m16e_ri64 { 922 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int func : 3, __BITFIELD_FIELD(unsigned int ry : 3, __BITFIELD_FIELD(unsigned int imm : 5,; 923 )))) 924 }; 925 struct m16e_ri { 926 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int rx : 3, __BITFIELD_FIELD(unsigned int imm : 8,; 927 ))) 928 }; 929 struct m16e_rri { 930 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int rx : 3, __BITFIELD_FIELD(unsigned int ry : 3, __BITFIELD_FIELD(unsigned int imm : 5,; 931 )))) 932 }; 933 struct m16e_i8 { 934 __BITFIELD_FIELD(unsigned int opcode : 5, __BITFIELD_FIELD(unsigned int func : 3, __BITFIELD_FIELD(unsigned int imm : 8,; 935 ))) 936 }; 937 union mips_instruction { 938 unsigned int word; 939 unsigned short halfword[2]; 940 unsigned char byte[4]; 941 struct j_format j_format; 942 struct i_format i_format; 943 struct u_format u_format; 944 struct c_format c_format; 945 struct r_format r_format; 946 struct c0r_format c0r_format; 947 struct mfmc0_format mfmc0_format; 948 struct co_format co_format; 949 struct p_format p_format; 950 struct f_format f_format; 951 struct ma_format ma_format; 952 struct msa_mi10_format msa_mi10_format; 953 struct b_format b_format; 954 struct ps_format ps_format; 955 struct v_format v_format; 956 struct dsp_format dsp_format; 957 struct spec3_format spec3_format; 958 struct fb_format fb_format; 959 struct fp0_format fp0_format; 960 struct mm_fp0_format mm_fp0_format; 961 struct fp1_format fp1_format; 962 struct mm_fp1_format mm_fp1_format; 963 struct mm_fp2_format mm_fp2_format; 964 struct mm_fp3_format mm_fp3_format; 965 struct mm_fp4_format mm_fp4_format; 966 struct mm_fp5_format mm_fp5_format; 967 struct fp6_format fp6_format; 968 struct mm_fp6_format mm_fp6_format; 969 struct mm_i_format mm_i_format; 970 struct mm_m_format mm_m_format; 971 struct mm_x_format mm_x_format; 972 struct mm_a_format mm_a_format; 973 struct mm_b0_format mm_b0_format; 974 struct mm_b1_format mm_b1_format; 975 struct mm16_m_format mm16_m_format; 976 struct mm16_rb_format mm16_rb_format; 977 struct mm16_r3_format mm16_r3_format; 978 struct mm16_r5_format mm16_r5_format; 979 struct loongson3_lswc2_format loongson3_lswc2_format; 980 struct loongson3_lsdc2_format loongson3_lsdc2_format; 981 struct loongson3_lscsr_format loongson3_lscsr_format; 982 }; 983 union mips16e_instruction { 984 unsigned int full : 16; 985 struct m16e_rr rr; 986 struct m16e_jal jal; 987 struct m16e_i64 i64; 988 struct m16e_ri64 ri64; 989 struct m16e_ri ri; 990 struct m16e_rri rri; 991 struct m16e_i8 i8; 992 }; 993 #endif 994