home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / trash / part04 / optab.c next >
Encoding:
C/C++ Source or Header  |  1992-03-22  |  16.2 KB  |  531 lines

  1. #include    "diblock.h"
  2. #include    "instrn.h"
  3.  
  4. extern dinstrn    *i_absfmt();
  5. extern dinstrn    *i_add();
  6. extern dinstrn    *i_addfmt();
  7. extern dinstrn    *i_addi();
  8. extern dinstrn    *i_addiu();
  9. extern dinstrn    *i_addu();
  10. extern dinstrn    *i_and();
  11. extern dinstrn    *i_andi();
  12. extern dinstrn    *i_bc1f();
  13. extern dinstrn    *i_bc1t();
  14. extern dinstrn    *i_beq();
  15. extern dinstrn    *i_bgez();
  16. extern dinstrn    *i_bgtz();
  17. extern dinstrn    *i_blez();
  18. extern dinstrn    *i_bltz();
  19. extern dinstrn    *i_bne();
  20. extern dinstrn    *i_ceq();
  21. extern dinstrn    *i_cfc1();
  22. extern dinstrn    *i_cle();
  23. extern dinstrn    *i_clt();
  24. extern dinstrn    *i_cole();
  25. extern dinstrn    *i_colt();
  26. extern dinstrn    *i_ctc1();
  27. extern dinstrn    *i_cule();
  28. extern dinstrn    *i_cult();
  29. extern dinstrn    *i_cvtd();
  30. extern dinstrn    *i_cvts();
  31. extern dinstrn    *i_cvtw();
  32. extern dinstrn    *i_div();
  33. extern dinstrn    *i_divfmt();
  34. extern dinstrn    *i_divu();
  35. extern dinstrn    *i_j();
  36. extern dinstrn    *i_jal();
  37. extern dinstrn    *i_jalr();
  38. extern dinstrn    *i_jr();
  39. extern dinstrn    *i_lb();
  40. extern dinstrn    *i_lbu();
  41. extern dinstrn    *i_lh();
  42. extern dinstrn    *i_lhu();
  43. extern dinstrn    *i_lui();
  44. extern dinstrn    *i_lw();
  45. extern dinstrn    *i_lwc1();
  46. extern dinstrn    *i_lwl();
  47. extern dinstrn    *i_lwr();
  48. extern dinstrn    *i_mfc1();
  49. extern dinstrn    *i_mfhi();
  50. extern dinstrn    *i_mflo();
  51. extern dinstrn    *i_mtc1();
  52. extern dinstrn    *i_mthi();
  53. extern dinstrn    *i_mtlo();
  54. extern dinstrn    *i_mulfmt();
  55. extern dinstrn    *i_mult();
  56. extern dinstrn    *i_multu();
  57. extern dinstrn    *i_movfmt();
  58. extern dinstrn    *i_negfmt();
  59. extern dinstrn    *i_nor();
  60. extern dinstrn    *i_or();
  61. extern dinstrn    *i_ori();
  62. extern dinstrn    *i_sb();
  63. extern dinstrn    *i_sh();
  64. extern dinstrn    *i_sll();
  65. extern dinstrn    *i_sllv();
  66. extern dinstrn    *i_slt();
  67. extern dinstrn    *i_slti();
  68. extern dinstrn    *i_sltiu();
  69. extern dinstrn    *i_sltu();
  70. extern dinstrn    *i_sra();
  71. extern dinstrn    *i_srav();
  72. extern dinstrn    *i_srl();
  73. extern dinstrn    *i_srlv();
  74. extern dinstrn    *i_sub();
  75. extern dinstrn    *i_subfmt();
  76. extern dinstrn    *i_subu();
  77. extern dinstrn    *i_sw();
  78. extern dinstrn    *i_swc1();
  79. extern dinstrn    *i_swl();
  80. extern dinstrn    *i_swr();
  81. extern dinstrn    *i_syscall();
  82. extern dinstrn    *i_undef();
  83. extern dinstrn    *i_xor();
  84. extern dinstrn    *i_xori();
  85.  
  86. /*
  87.  * The primary opcode instruction table.
  88.  */
  89. instrn    optab[]    =
  90. {
  91.     OP("special",    IF_R,    i_undef,    "????"),
  92.     OP("bcond",        IF_I,    i_undef,    "????"),
  93.     OP("j",        IF_J,    i_j,        "a-31"),
  94.     OP("jal",        IF_J,    i_jal,        "a-32"),
  95.     OP("beq",        IF_I,    i_beq,        "a-17"),
  96.     OP("bne",        IF_I,    i_bne,        "a-24"),
  97.     OP("blez",        IF_I,    i_blez,        "a-21"),
  98.     OP("bgtz",        IF_I,    i_bgtz,        "a-20"),
  99.  
  100.     OP("addi",        IF_I,    i_addi,        "a-10"),
  101.     OP("addiu",        IF_I,    i_addiu,    "a-11"),
  102.     OP("slti",        IF_I,    i_slti,        "a-65"),
  103.     OP("sltiu",        IF_I,    i_sltiu,    "a-66"),
  104.     OP("andi",        IF_I,    i_andi,        "a-14"),
  105.     OP("ori",        IF_I,    i_ori,        "a-58"),
  106.     OP("xori",        IF_I,    i_xori,        "a-86"),
  107.     OP("lui",        IF_I,    i_lui,        "a-39"),
  108.  
  109.     OP("cop0",        IF_R,    i_undef,    "a-27"),
  110.     OP("cop1",        IF_U,    i_undef,    "a-27"),
  111.     OP("cop2",        IF_U,    i_undef,    "a-27"),
  112.     OP("cop3",        IF_U,    i_undef,    "a-27"),
  113.     OP("",        IF_U,    i_undef,    "????"),
  114.     OP("",        IF_U,    i_undef,    "????"),
  115.     OP("",        IF_U,    i_undef,    "????"),
  116.     OP("",        IF_U,    i_undef,    "????"),
  117.  
  118.     OP("",        IF_U,    i_undef,    "????"),
  119.     OP("",        IF_U,    i_undef,    "????"),
  120.     OP("",        IF_U,    i_undef,    "????"),
  121.     OP("",        IF_U,    i_undef,    "????"),
  122.     OP("",        IF_U,    i_undef,    "????"),
  123.     OP("",        IF_U,    i_undef,    "????"),
  124.     OP("",        IF_U,    i_undef,    "????"),
  125.     OP("",        IF_U,    i_undef,    "????"),
  126.  
  127.     OP("lb",        IF_I,    i_lb,        "a-35"),
  128.     OP("lh",        IF_I,    i_lh,        "a-37"),
  129.     OP("lwl",        IF_I,    i_lwl,        "a-42"),
  130.     OP("lw",        IF_I,    i_lw,        "a-40"),
  131.     OP("lbu",        IF_I,    i_lbu,        "a-36"),
  132.     OP("lhu",        IF_I,    i_lhu,        "a-38"),
  133.     OP("lwr",        IF_I,    i_lwr,        "a-44"),
  134.     OP("",        IF_U,    i_undef,    "????"),
  135.  
  136.     OP("sb",        IF_I,    i_sb,        "a-60"),
  137.     OP("sh",        IF_I,    i_sh,        "a-61"),
  138.     OP("swl",        IF_I,    i_swl,        "a-76"),
  139.     OP("sw",        IF_I,    i_sw,        "a-74"),
  140.     OP("",        IF_U,    i_undef,    "????"),
  141.     OP("",        IF_U,    i_undef,    "????"),
  142.     OP("swr",        IF_I,    i_swr,        "a-78"),
  143.     OP("",        IF_U,    i_undef,    "????"),
  144.  
  145.     OP("lwc0",        IF_U,    i_undef,    "a-41"),
  146.     OP("lwc1",        IF_I,    i_lwc1,        "b-20"),
  147.     OP("lwc2",        IF_U,    i_undef,    "a-41"),
  148.     OP("lwc3",        IF_U,    i_undef,    "a-41"),
  149.     OP("",        IF_U,    i_undef,    "????"),
  150.     OP("",        IF_U,    i_undef,    "????"),
  151.     OP("",        IF_U,    i_undef,    "????"),
  152.     OP("",        IF_U,    i_undef,    "????"),
  153.  
  154.     OP("swc0",        IF_U,    i_undef,    "a-75"),
  155.     OP("swc1",        IF_I,    i_swc1,        "b-27"),
  156.     OP("swc2",        IF_U,    i_undef,    "a-75"),
  157.     OP("swc3",        IF_U,    i_undef,    "a-75"),
  158.     OP("",        IF_U,    i_undef,    "????"),
  159.     OP("",        IF_U,    i_undef,    "????"),
  160.     OP("",        IF_U,    i_undef,    "????"),
  161.     OP("",        IF_U,    i_undef,    "????"),
  162.  
  163.     OP("",        IF_U,    i_undef,    "????"),
  164. };
  165.  
  166. /*
  167.  * The special opcode instruction table.
  168.  */
  169. instrn    optab_special[]    =
  170. {
  171.     OP("sll",        IF_R,    i_sll,        "a-62"),
  172.     OP("<special>",    IF_U,    i_undef,    "????"),
  173.     OP("srl",        IF_R,    i_srl,        "a-70"),
  174.     OP("sra",        IF_R,    i_sra,        "a-68"),
  175.     OP("sllv",        IF_R,    i_sllv,        "a-63"),
  176.     OP("<special>",    IF_U,    i_undef,    "????"),
  177.     OP("srlv",        IF_R,    i_srlv,        "a-71"),
  178.     OP("srav",        IF_R,    i_srav,        "a-69"),
  179.  
  180.     OP("jr",        IF_R,    i_jr,        "a-34"),
  181.     OP("jalr",        IF_R,    i_jalr,        "a-33"),
  182.     OP("<special>",    IF_U,    i_undef,    "????"),
  183.     OP("<special>",    IF_U,    i_undef,    "????"),
  184.     OP("syscall",    IF_R,    i_syscall,    "a-80"),
  185.     OP("break",        IF_U,    i_undef,    "a-25"),
  186.     OP("<special>",    IF_U,    i_undef,    "????"),
  187.     OP("<special>",    IF_U,    i_undef,    "????"),
  188.  
  189.     OP("mfhi",        IF_R,    i_mfhi,        "a-48"),
  190.     OP("mthi",        IF_R,    i_mthi,        "a-52"),
  191.     OP("mflo",        IF_R,    i_mflo,        "a-49"),
  192.     OP("mtlo",        IF_R,    i_mtlo,        "a-53"),
  193.     OP("<special>",    IF_U,    i_undef,    "????"),
  194.     OP("<special>",    IF_U,    i_undef,    "????"),
  195.     OP("<special>",    IF_U,    i_undef,    "????"),
  196.     OP("<special>",    IF_U,    i_undef,    "????"),
  197.  
  198.     OP("mult",        IF_R,    i_mult,        "a-54"),
  199.     OP("multu",        IF_R,    i_multu,    "a-55"),
  200.     OP("div",        IF_R,    i_div,        "a-29"),
  201.     OP("divu",        IF_R,    i_divu,        "a-30"),
  202.     OP("<special>",    IF_U,    i_undef,    "????"),
  203.     OP("<special>",    IF_U,    i_undef,    "????"),
  204.     OP("<special>",    IF_U,    i_undef,    "????"),
  205.     OP("<special>",    IF_U,    i_undef,    "????"),
  206.  
  207.     OP("add",        IF_R,    i_add,        "a-09"),
  208.     OP("addu",        IF_R,    i_addu,        "a-12"),
  209.     OP("sub",        IF_R,    i_sub,        "a-72"),
  210.     OP("subu",        IF_R,    i_subu,        "a-73"),
  211.     OP("and",        IF_R,    i_and,        "a-13"),
  212.     OP("or",        IF_R,    i_or,        "a-57"),
  213.     OP("xor",        IF_R,    i_xor,        "a-85"),
  214.     OP("nor",        IF_R,    i_nor,        "a-56"),
  215.  
  216.     OP("<special>",    IF_U,    i_undef,    "????"),
  217.     OP("<special>",    IF_U,    i_undef,    "????"),
  218.     OP("slt",        IF_R,    i_slt,        "a-64"),
  219.     OP("sltu",        IF_R,    i_sltu,        "a-67"),
  220.     OP("<special>",    IF_U,    i_undef,    "????"),
  221.     OP("<special>",    IF_U,    i_undef,    "????"),
  222.     OP("<special>",    IF_U,    i_undef,    "????"),
  223.     OP("<special>",    IF_U,    i_undef,    "????"),
  224.  
  225.     OP("<special>",    IF_U,    i_undef,    "????"),
  226.     OP("<special>",    IF_U,    i_undef,    "????"),
  227.     OP("<special>",    IF_U,    i_undef,    "????"),
  228.     OP("<special>",    IF_U,    i_undef,    "????"),
  229.     OP("<special>",    IF_U,    i_undef,    "????"),
  230.     OP("<special>",    IF_U,    i_undef,    "????"),
  231.     OP("<special>",    IF_U,    i_undef,    "????"),
  232.     OP("<special>",    IF_U,    i_undef,    "????"),
  233.  
  234.     OP("<special>",    IF_U,    i_undef,    "????"),
  235.     OP("<special>",    IF_U,    i_undef,    "????"),
  236.     OP("<special>",    IF_U,    i_undef,    "????"),
  237.     OP("<special>",    IF_U,    i_undef,    "????"),
  238.     OP("<special>",    IF_U,    i_undef,    "????"),
  239.     OP("<special>",    IF_U,    i_undef,    "????"),
  240.     OP("<special>",    IF_U,    i_undef,    "????"),
  241.     OP("<special>",    IF_U,    i_undef,    "????"),
  242.  
  243.     OP("",        IF_U,    i_undef,    "????"),
  244. };
  245.  
  246. /*
  247.  * The bcond opcode instruction table.
  248.  */
  249. instrn    optab_bcond[]    =
  250. {
  251.     OP("bltz",        IF_I,    i_bltz,        "a-22"),
  252.     OP("bgez",        IF_I,    i_bgez,        "a-18"),
  253.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  254.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  255.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  256.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  257.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  258.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  259.  
  260.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  261.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  262.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  263.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  264.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  265.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  266.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  267.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  268.  
  269.     OP("bltzal",    IF_I,    i_undef,    "a-23"),
  270.     OP("bgezal",    IF_I,    i_undef,    "a-19"),
  271.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  272.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  273.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  274.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  275.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  276.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  277.  
  278.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  279.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  280.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  281.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  282.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  283.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  284.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  285.     OP("<bcond>",    IF_U,    i_undef,    "????"),
  286.  
  287.     OP("",        IF_U,    i_undef,    "????"),
  288. };
  289.  
  290. /*
  291.  * The cop0 opcode instruction table.
  292.  */
  293. instrn    optab_cop0[]    =
  294. {
  295.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  296.     OP("tlbr",        IF_U,    i_undef,    "a-82"),
  297.     OP("tlbwi",        IF_U,    i_undef,    "a-83"),
  298.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  299.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  300.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  301.     OP("tlbwr",        IF_U,    i_undef,    "a-84"),
  302.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  303.  
  304.     OP("tlbp",        IF_U,    i_undef,    "a-81"),
  305.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  306.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  307.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  308.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  309.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  310.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  311.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  312.  
  313.     OP("rfe",        IF_U,    i_undef,    "a-59"),
  314.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  315.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  316.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  317.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  318.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  319.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  320.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  321.  
  322.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  323.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  324.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  325.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  326.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  327.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  328.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  329.     OP("<cop0>",    IF_U,    i_undef,    "????"),
  330.  
  331.     OP("",        IF_U,    i_undef,    "????"),
  332. };
  333.  
  334. /*
  335.  * The cop1 group1 opcode instruction table.
  336.  */
  337. instrn    optab_cop1_group1[]    =
  338. {
  339.     OP("mfc1",        IF_M1,    i_mfc1,        "b-21"),
  340.     OP("mfc1",        IF_M1,    i_mfc1,        "b-21"),
  341.     OP("cfc1",        IF_C1,    i_cfc1,        "b-14"),
  342.     OP("cfc1",        IF_C1,    i_cfc1,        "b-14"),
  343.     OP("mtc1",        IF_M1,    i_mtc1,        "b-23"),
  344.     OP("mtc1",        IF_M1,    i_mtc1,        "b-23"),
  345.     OP("ctc1",        IF_C1,    i_ctc1,        "b-15"),
  346.     OP("ctc1",        IF_C1,    i_ctc1,        "b-15"),
  347.  
  348.     OP("bc1f",        IF_I1,    i_bc1f,        "b-10"),
  349.     OP("bc1t",        IF_I1,    i_bc1t,        "b-11"),
  350.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  351.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  352.     OP("bc1f",        IF_I1,    i_bc1f,        "b-10"),
  353.     OP("bc1t",        IF_I1,    i_bc1t,        "b-11"),
  354.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  355.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  356.  
  357.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  358.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  359.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  360.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  361.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  362.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  363.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  364.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  365.  
  366.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  367.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  368.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  369.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  370.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  371.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  372.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  373.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  374.  
  375.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  376.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  377.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  378.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  379.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  380.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  381.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  382.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  383.  
  384.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  385.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  386.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  387.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  388.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  389.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  390.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  391.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  392.  
  393.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  394.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  395.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  396.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  397.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  398.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  399.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  400.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  401.  
  402.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  403.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  404.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  405.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  406.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  407.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  408.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  409.     OP("<cop1.1>",    IF_U,    i_undef,    "????"),
  410.  
  411.     OP("",        IF_U,    i_undef,    "????"),
  412. };
  413.  
  414. /*
  415.  * The cop1 group2 opcode instruction table.
  416.  */
  417. instrn    optab_cop1_group2[]    =
  418. {
  419.     OP("add.fmt",    IF_R1,    i_addfmt,    "b-09"),
  420.     OP("sub.fmt",    IF_R1,    i_subfmt,    "b-26"),
  421.     OP("mul.fmt",    IF_R1,    i_mulfmt,    "b-24"),
  422.     OP("div.fmt",    IF_R1,    i_divfmt,    "b-19"),
  423.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  424.     OP("abs.fmt",    IF_R1,    i_absfmt,    "b-08"),
  425.     OP("mov.fmt",    IF_R1,    i_movfmt,    "b-22"),
  426.     OP("neg.fmt",    IF_R1,    i_negfmt,    "b-25"),
  427.  
  428.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  429.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  430.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  431.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  432.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  433.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  434.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  435.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  436.  
  437.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  438.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  439.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  440.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  441.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  442.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  443.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  444.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  445.  
  446.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  447.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  448.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  449.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  450.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  451.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  452.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  453.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  454.  
  455.     OP("cvt.s",        IF_R1,    i_cvts,        "b-17"),
  456.     OP("cvt.d",        IF_R1,    i_cvtd,        "b-16"),
  457.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  458.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  459.     OP("cvt.w",        IF_R1,    i_cvtw,        "b-18"),
  460.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  461.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  462.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  463.  
  464.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  465.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  466.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  467.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  468.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  469.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  470.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  471.     OP("<cop1.2>",    IF_U,    i_undef,    "????"),
  472.  
  473.     OP("c.f",        IF_R1,    i_undef,    "b-12"),
  474.     OP("c.un",        IF_R1,    i_undef,    "b-12"),
  475.     OP("c.eq",        IF_R1,    i_ceq,        "b-12"),
  476.     OP("c.ueq",        IF_R1,    i_undef,    "b-12"),
  477.     OP("c.olt",        IF_R1,    i_colt,        "b-12"),
  478.     OP("c.ult",        IF_R1,    i_cult,        "b-12"),
  479.     OP("c.ole",        IF_R1,    i_cole,        "b-12"),
  480.     OP("c.ule",        IF_R1,    i_cule,        "b-12"),
  481.  
  482.     OP("c.sf",        IF_R1,    i_undef,    "b-12"),
  483.     OP("c.ngle",    IF_R1,    i_undef,    "b-12"),
  484.     OP("c.seq",        IF_R1,    i_undef,    "b-12"),
  485.     OP("c.ngl",        IF_R1,    i_undef,    "b-12"),
  486.     OP("c.lt",        IF_R1,    i_clt,        "b-12"),
  487.     OP("c.nge",        IF_R1,    i_undef,    "b-12"),
  488.     OP("c.le",        IF_R1,    i_cle,        "b-12"),
  489.     OP("c.ngt",        IF_R1,    i_undef,    "b-12"),
  490.  
  491.     OP("",        IF_U,    i_undef,    "????"),
  492. };
  493.  
  494. instrn    *
  495. getip(i)
  496. unsigned long    i;
  497. {
  498.     unsigned long    opindex;
  499.     instrn        *ip;
  500.  
  501.     opindex = i_to_op(i);
  502.  
  503.     switch (opindex)
  504.     {
  505.     case 0:        /* special */
  506.         ip = &optab_special[i_to_funct(i)];
  507.         break;
  508.  
  509.     case 1:        /* bcond */
  510.         ip = &optab_bcond[i_to_rt(i)];
  511.         break;
  512.  
  513.     case 16:    /* coprocessor 0 */
  514.         ip = &optab_cop0[i_to_funct(i) & 0x1F];
  515.         break;
  516.  
  517.     case 17:    /* coprocessor 1 */
  518.         if (is_cop1_group1(i))
  519.             ip = &optab_cop1_group1[i_to_cop1_group1(i)];
  520.         else
  521.             ip = &optab_cop1_group2[i_to_cop1_group2(i)];
  522.         break;
  523.  
  524.     default:
  525.         ip = &optab[opindex];
  526.         break;
  527.     }
  528.  
  529.     return ip;
  530. }
  531.