microblaze-opcm.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* microblaze-opcm.h -- Header used in microblaze-opc.h
  2. Copyright (C) 2009-2022 Free Software Foundation, Inc.
  3. This file is part of the GNU opcodes library.
  4. This library is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. It is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  11. License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this file; see the file COPYING. If not, write to the
  14. Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #ifndef MICROBLAZE_OPCM
  17. #define MICROBLAZE_OPCM
  18. enum microblaze_instr
  19. {
  20. add, rsub, addc, rsubc, addk, rsubk, addkc, rsubkc, clz, cmp, cmpu,
  21. addi, rsubi, addic, rsubic, addik, rsubik, addikc, rsubikc, mul,
  22. mulh, mulhu, mulhsu,swapb,swaph,
  23. idiv, idivu, bsll, bsra, bsrl, get, put, nget, nput, cget, cput,
  24. ncget, ncput, muli, bslli, bsrai, bsrli, mului,
  25. /* 'or/and/xor' are C++ keywords. */
  26. microblaze_or, microblaze_and, microblaze_xor,
  27. andn, pcmpbf, pcmpbc, pcmpeq, pcmpne, sra, src, srl, sext8, sext16,
  28. wic, wdc, wdcclear, wdcflush, mts, mfs, mbar, br, brd,
  29. brld, bra, brad, brald, microblaze_brk, beq, beqd, bne, bned, blt,
  30. bltd, ble, bled, bgt, bgtd, bge, bged, ori, andi, xori, andni,
  31. imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid,
  32. brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti,
  33. bgtid, bgei, bgeid, lbu, lbur, lhu, lhur, lw, lwr, lwx, sb, sbr, sh,
  34. shr, sw, swr, swx, lbui, lhui, lwi,
  35. sbi, shi, swi, msrset, msrclr, tuqula, mbi_fadd, frsub, mbi_fmul, mbi_fdiv,
  36. fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt,
  37. /* 'fsqrt' is a glibc:math.h symbol. */
  38. fint, microblaze_fsqrt,
  39. tget, tcget, tnget, tncget, tput, tcput, tnput, tncput,
  40. eget, ecget, neget, necget, eput, ecput, neput, necput,
  41. teget, tecget, tneget, tnecget, teput, tecput, tneput, tnecput,
  42. aget, caget, naget, ncaget, aput, caput, naput, ncaput,
  43. taget, tcaget, tnaget, tncaget, taput, tcaput, tnaput, tncaput,
  44. eaget, ecaget, neaget, necaget, eaput, ecaput, neaput, necaput,
  45. teaget, tecaget, tneaget, tnecaget, teaput, tecaput, tneaput, tnecaput,
  46. getd, tgetd, cgetd, tcgetd, ngetd, tngetd, ncgetd, tncgetd,
  47. putd, tputd, cputd, tcputd, nputd, tnputd, ncputd, tncputd,
  48. egetd, tegetd, ecgetd, tecgetd, negetd, tnegetd, necgetd, tnecgetd,
  49. eputd, teputd, ecputd, tecputd, neputd, tneputd, necputd, tnecputd,
  50. agetd, tagetd, cagetd, tcagetd, nagetd, tnagetd, ncagetd, tncagetd,
  51. aputd, taputd, caputd, tcaputd, naputd, tnaputd, ncaputd, tncaputd,
  52. eagetd, teagetd, ecagetd, tecagetd, neagetd, tneagetd, necagetd, tnecagetd,
  53. eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd,
  54. invalid_inst
  55. };
  56. enum microblaze_instr_type
  57. {
  58. arithmetic_inst, logical_inst, mult_inst, div_inst, branch_inst,
  59. return_inst, immediate_inst, special_inst, memory_load_inst,
  60. memory_store_inst, barrel_shift_inst, anyware_inst
  61. };
  62. #define INST_WORD_SIZE 4
  63. /* Gen purpose regs go from 0 to 31. */
  64. /* Mask is reg num - max_reg_num, ie reg_num - 32 in this case. */
  65. #define REG_PC_MASK 0x8000
  66. #define REG_MSR_MASK 0x8001
  67. #define REG_EAR_MASK 0x8003
  68. #define REG_ESR_MASK 0x8005
  69. #define REG_FSR_MASK 0x8007
  70. #define REG_BTR_MASK 0x800b
  71. #define REG_EDR_MASK 0x800d
  72. #define REG_PVR_MASK 0xa000
  73. #define REG_SLR_MASK 0x8800
  74. #define REG_SHR_MASK 0x8802
  75. #define REG_PID_MASK 0x9000
  76. #define REG_ZPR_MASK 0x9001
  77. #define REG_TLBX_MASK 0x9002
  78. #define REG_TLBLO_MASK 0x9003
  79. #define REG_TLBHI_MASK 0x9004
  80. #define REG_TLBSX_MASK 0x9005
  81. #define MIN_REGNUM 0
  82. #define MAX_REGNUM 31
  83. #define MIN_PVR_REGNUM 0
  84. #define MAX_PVR_REGNUM 15
  85. #define REG_PC 32 /* PC. */
  86. #define REG_MSR 33 /* Machine status reg. */
  87. #define REG_EAR 35 /* Exception reg. */
  88. #define REG_ESR 37 /* Exception reg. */
  89. #define REG_FSR 39 /* FPU Status reg. */
  90. #define REG_BTR 43 /* Branch Target reg. */
  91. #define REG_EDR 45 /* Exception reg. */
  92. #define REG_SHR 50 /* Stack High reg. */
  93. #define REG_SLR 51 /* Stack Low reg. */
  94. #define REG_PVR 40960 /* Program Verification reg. */
  95. #define REG_PID 36864 /* MMU: Process ID reg. */
  96. #define REG_ZPR 36865 /* MMU: Zone Protect reg. */
  97. #define REG_TLBX 36866 /* MMU: TLB Index reg. */
  98. #define REG_TLBLO 36867 /* MMU: TLB Low reg. */
  99. #define REG_TLBHI 36868 /* MMU: TLB High reg. */
  100. #define REG_TLBSX 36869 /* MMU: TLB Search Index reg. */
  101. /* Alternate names for gen purpose regs. */
  102. #define REG_SP 1 /* stack pointer. */
  103. #define REG_ROSDP 2 /* read-only small data pointer. */
  104. #define REG_RWSDP 13 /* read-write small data pointer. */
  105. /* Assembler Register - Used in Delay Slot Optimization. */
  106. #define REG_AS 18
  107. #define REG_ZERO 0
  108. #define RD_LOW 21 /* Low bit for RD. */
  109. #define RA_LOW 16 /* Low bit for RA. */
  110. #define RB_LOW 11 /* Low bit for RB. */
  111. #define IMM_LOW 0 /* Low bit for immediate. */
  112. #define IMM_MBAR 21 /* low bit for mbar instruction. */
  113. #define RD_MASK 0x03E00000
  114. #define RA_MASK 0x001F0000
  115. #define RB_MASK 0x0000F800
  116. #define IMM_MASK 0x0000FFFF
  117. /* Imm mask for barrel shifts. */
  118. #define IMM5_MASK 0x0000001F
  119. /* Imm mask for mbar. */
  120. #define IMM5_MBAR_MASK 0x03E00000
  121. /* FSL imm mask for get, put instructions. */
  122. #define RFSL_MASK 0x000000F
  123. /* Imm mask for msrset, msrclr instructions. */
  124. #define IMM15_MASK 0x00007FFF
  125. #endif /* MICROBLAZE-OPCM */