sparc-opcode.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. /* Table of opcodes for the sparc.
  2. Copyright (C) 1989 Free Software Foundation, Inc.
  3. This file is part of GAS, the GNU Assembler, and GDB, the GNU disassembler.
  4. GAS/GDB 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 1, or (at your option)
  7. any later version.
  8. GAS/GDB is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GAS or GDB; see the file COPYING. If not, write to
  14. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  15. #if !defined(__STDC__) && !defined(const)
  16. #define const
  17. #endif
  18. /*
  19. * Structure of an opcode table entry.
  20. */
  21. struct sparc_opcode
  22. {
  23. const char *name;
  24. unsigned long int match; /* Bits that must be set. */
  25. unsigned long int lose; /* Bits that must not be set. */
  26. const char *args;
  27. };
  28. /*
  29. All sparc opcodes are 32 bits, except for the `set' instruction (really
  30. a macro), which is 64 bits. It is handled as a special case.
  31. The match component is a mask saying which bits must match a
  32. particular opcode in order for an instruction to be an instance
  33. of that opcode.
  34. The args component is a string containing one character
  35. for each operand of the instruction.
  36. Kinds of operands:
  37. # Number used by optimizer. It is ignored.
  38. 1 rs1 register.
  39. 2 rs2 register.
  40. d rd register.
  41. e frs1 floating point register.
  42. f frs2 floating point register.
  43. g frsd floating point register.
  44. b crs1 coprocessor register
  45. c crs2 coprocessor register
  46. D crsd coprocessor register
  47. h 22 high bits.
  48. i 13 bit Immediate.
  49. l 22 bit PC relative immediate.
  50. L 30 bit PC relative immediate.
  51. a Annul. The annul bit is set.
  52. A Alternate address space. Stored as 8 bits.
  53. C Coprocessor state register.
  54. F floating point state register.
  55. p Processor state register.
  56. q Floating point queue.
  57. r Single register that is both rs1 and rsd.
  58. Q Coprocessor queue.
  59. S Special case.
  60. t Trap base register.
  61. w Window invalid mask register.
  62. y Y register.
  63. */
  64. /* The order of the opcodes in this table is significant:
  65. * The assembler requires that all instances of the same mnemonic must be
  66. consecutive. If they aren't, the assembler will bomb at runtime.
  67. * The disassembler should not care about the order of the opcodes. */
  68. static struct sparc_opcode sparc_opcodes[] =
  69. {
  70. { "ldd", 0xc1980000, 0x0060001f, "[1],D" }, /* ldd [rs1+%g0],d */
  71. { "ldd", 0xc1982000, 0x00601fff, "[1],D" }, /* ldd [rs1+0],d */
  72. { "ldd", 0xc1982000, 0x00600000, "[1+i],D" },
  73. { "ldd", 0xc1982000, 0x00600000, "[i+1],D" },
  74. { "ldd", 0xc1980000, 0x00600000, "[1+2],D" },
  75. { "ldd", 0xc1180000, 0x00e0001f, "[1],g" }, /* ldd [rs1+%g0],d */
  76. { "ldd", 0xc1182000, 0x00e01fff, "[1],g" }, /* ldd [rs1+0],d */
  77. { "ldd", 0xc1182000, 0x00e00000, "[1+i],g" },
  78. { "ldd", 0xc1182000, 0x00e00000, "[i+1],g" },
  79. { "ldd", 0xc1180000, 0x00e00000, "[1+2],g" },
  80. { "ldd", 0xc0180000, 0x01e0001f, "[1],d" }, /* ldd [rs1+%g0],d */
  81. { "ldd", 0xc0182000, 0x01e01fff, "[1],d" }, /* ldd [rs1+0],d */
  82. { "ldd", 0xc0182000, 0x01e00000, "[1+i],d" },
  83. { "ldd", 0xc0182000, 0x01e00000, "[i+1],d" },
  84. { "ldd", 0xc0180000, 0x01e00000, "[1+2],d" },
  85. { "ld", 0xc1880000, 0x0070001f, "[1],C" }, /* ld [rs1+%g0],d */
  86. { "ld", 0xc1882000, 0x00701fff, "[1],C" }, /* ld [rs1+0],d */
  87. { "ld", 0xc1882000, 0x00700000, "[1+i],C" },
  88. { "ld", 0xc1882000, 0x00700000, "[i+1],C" },
  89. { "ld", 0xc1880000, 0x00700000, "[1+2],C" },
  90. { "ld", 0xc1800000, 0x0078001f, "[1],D" }, /* ld [rs1+%g0],d */
  91. { "ld", 0xc1802000, 0x00781fff, "[1],D" }, /* ld [rs1+0],d */
  92. { "ld", 0xc1802000, 0x00780000, "[1+i],D" },
  93. { "ld", 0xc1802000, 0x00780000, "[i+1],D" },
  94. { "ld", 0xc1800000, 0x00780000, "[1+2],D" },
  95. { "ld", 0xc1080000, 0x00f0001f, "[1],F" }, /* ld [rs1+%g0],d */
  96. { "ld", 0xc1082000, 0x00f01fff, "[1],F" }, /* ld [rs1+0],d */
  97. { "ld", 0xc1082000, 0x00f00000, "[1+i],F" },
  98. { "ld", 0xc1082000, 0x00f00000, "[i+1],F" },
  99. { "ld", 0xc1080000, 0x00f00000, "[1+2],F" },
  100. { "ld", 0xc1000000, 0x00f8001f, "[1],g" }, /* ld [rs1+%g0],d */
  101. { "ld", 0xc1002000, 0x00f81fff, "[1],g" }, /* ld [rs1+0],d */
  102. { "ld", 0xc1002000, 0x00f80000, "[1+i],g" },
  103. { "ld", 0xc1002000, 0x00f80000, "[i+1],g" },
  104. { "ld", 0xc1000000, 0x00f80000, "[1+2],g" },
  105. { "ld", 0xc0000000, 0x01f8001f, "[1],d" }, /* ld [rs1+%g0],d */
  106. { "ld", 0xc0002000, 0x01f81fff, "[1],d" }, /* ld [rs1+0],d */
  107. { "ld", 0xc0002000, 0x01f80000, "[1+i],d" },
  108. { "ld", 0xc0002000, 0x01f80000, "[i+1],d" },
  109. { "ld", 0xc0000000, 0x01f80000, "[1+2],d" },
  110. { "ldstuba", 0xc0d80000, 0x0100001f, "[1]A,d" }, /* ldstuba [rs1+%g0],d */
  111. { "ldstuba", 0xc0d82000, 0x01001fff, "[1]A,d" }, /* ldstuba [rs1+0],d */
  112. { "ldstuba", 0xc0d80000, 0x01000000, "[1+2]A,d" },
  113. { "ldsha", 0xc0d00000, 0x0128001f, "[1]A,d" }, /* ldsha [rs1+%g0],d */
  114. { "ldsha", 0xc0d02000, 0x01281fff, "[1]A,d" }, /* ldsha [rs1+0],d */
  115. { "ldsha", 0xc0d00000, 0x01280000, "[1+2]A,d" },
  116. { "ldsba", 0xc0c80000, 0x0130001f, "[1]A,d" }, /* ldsba [rs1+%g0],d */
  117. { "ldsba", 0xc0c82000, 0x01301fff, "[1]A,d" }, /* ldsba [rs1+0],d */
  118. { "ldsba", 0xc0c80000, 0x01300000, "[1+2]A,d" },
  119. { "ldda", 0xc0980000, 0x0160001f, "[1]A,d" }, /* ldda [rs1+%g0],d */
  120. { "ldda", 0xc0982000, 0x01601fff, "[1]A,d" }, /* ldda [rs1+0],d */
  121. { "ldda", 0xc0980000, 0x01600000, "[1+2]A,d" },
  122. { "lduha", 0xc0900000, 0x0168001f, "[1]A,d" }, /* lduha [rs1+%g0],d */
  123. { "lduha", 0xc0902000, 0x01681fff, "[1]A,d" }, /* lduha [rs1+0],d */
  124. { "lduha", 0xc0900000, 0x01680000, "[1+2]A,d" },
  125. { "ldstub", 0xc0680000, 0x0190001f, "[1],d" }, /* ldstub [rs1+%g0],d */
  126. { "ldstub", 0xc0682000, 0x01901fff, "[1],d" }, /* ldstub [rs1+0],d */
  127. { "ldstub", 0xc0682000, 0x01900000, "[1+i],d" },
  128. { "ldstub", 0xc0682000, 0x01900000, "[i+1],d" },
  129. { "ldstub", 0xc0680000, 0x01900000, "[1+2],d" },
  130. { "lda", 0xc0800000, 0x0178001f, "[1]A,d" }, /* lda [rs1+%g0],d */
  131. { "lda", 0xc0802000, 0x01781fff, "[1]A,d" }, /* lda [rs1+0],d */
  132. { "lda", 0xc0800000, 0x01780000, "[1+2]A,d" },
  133. { "ldsh", 0xc0500000, 0x0000000d, "[1],d" }, /* ldsh [rs1+%g0],d */
  134. { "ldsh", 0xc0502000, 0x01a81fff, "[1],d" }, /* ldsh [rs1+0],d */
  135. { "ldsh", 0xc0502000, 0x01a80000, "[1+i],d" },
  136. { "ldsh", 0xc0502000, 0x01a80000, "[i+1],d" },
  137. { "ldsh", 0xc0500000, 0x01a80000, "[1+2],d" },
  138. { "ldsb", 0xc0480000, 0x01b0001f, "[1],d" }, /* ldsb [rs1+%g0],d */
  139. { "ldsb", 0xc0482000, 0x01b01fff, "[1],d" }, /* ldsb [rs1+0],d */
  140. { "ldsb", 0xc0482000, 0x01b00000, "[1+i],d" },
  141. { "ldsb", 0xc0482000, 0x01b00000, "[i+1],d" },
  142. { "ldsb", 0xc0480000, 0x01b00000, "[1+2],d" },
  143. { "ldub", 0xc0080000, 0x01f0001f, "[1],d" }, /* ldub [rs1+%g0],d */
  144. { "ldub", 0xc0082000, 0x01f01fff, "[1],d" }, /* ldub [rs1+0],d */
  145. { "ldub", 0xc0082000, 0x01f00000, "[1+i],d" },
  146. { "ldub", 0xc0082000, 0x01f00000, "[i+1],d" },
  147. { "ldub", 0xc0080000, 0x01f00000, "[1+2],d" },
  148. { "lduba", 0xc0880000, 0x0170001f, "[1]A,d" }, /* lduba [rs1+%g0],d */
  149. { "lduba", 0xc0882000, 0x01701fff, "[1]A,d" }, /* lduba [rs1+0],d */
  150. { "lduba", 0xc0880000, 0x01700000, "[1+2]A,d" },
  151. { "lduh", 0xc0102000, 0x01e80000, "[1+i],d" },
  152. { "lduh", 0xc0102000, 0x01e80000, "[i+1],d" },
  153. { "lduh", 0xc0100000, 0x01e8001f, "[1],d" }, /* lduh [rs1+%g0],d */
  154. { "lduh", 0xc0102000, 0x01e81fff, "[1],d" }, /* lduh [rs1+0],d */
  155. { "lduh", 0xc0100000, 0x01e80000, "[1+2],d" },
  156. { "st", 0xc0200000, 0x01d8001f, "d,[1]" }, /* st d,[rs1+%g0] */
  157. { "st", 0xc0202000, 0x01d81fff, "d,[1]" }, /* st d,[rs1+0] */
  158. { "st", 0xc0202000, 0x01d80000, "d,[1+i]" },
  159. { "st", 0xc0202000, 0x01d80000, "d,[i+1]" },
  160. { "st", 0xc0200000, 0x01d80000, "d,[1+2]" },
  161. { "st", 0xc1200000, 0x00d8001f, "g,[1]" }, /* st d[rs1+%g0] */
  162. { "st", 0xc1202000, 0x00d81fff, "g,[1]" }, /* st d,[rs1+0] */
  163. { "st", 0xc1202000, 0x00d80000, "g,[1+i]" },
  164. { "st", 0xc1202000, 0x00d80000, "g,[i+1]" },
  165. { "st", 0xc1200000, 0x00d80000, "g,[1+2]" },
  166. { "st", 0xc1100000, 0x00c0001f, "F,[1]" }, /* st d,[rs1+%g0] */
  167. { "st", 0xc1102000, 0x00c01fff, "F,[1]" }, /* st d,[rs1+0] */
  168. { "st", 0xc1102000, 0x00c00000, "F,[1+i]" },
  169. { "st", 0xc1102000, 0x00c00000, "F,[i+1]" },
  170. { "st", 0xc1100000, 0x00c00000, "F,[1+2]" },
  171. { "st", 0xc1a00000, 0x0058001f, "D,[1]" }, /* st d,[rs1+%g0] */
  172. { "st", 0xc1a02000, 0x00581fff, "D,[1]" }, /* st d,[rs1+0] */
  173. { "st", 0xc1a02000, 0x00580000, "D,[1+i]" },
  174. { "st", 0xc1a02000, 0x00580000, "D,[i+1]" },
  175. { "st", 0xc1a00000, 0x00580000, "D,[1+2]" },
  176. { "st", 0xc1a80000, 0x0050001f, "C,[1]" }, /* st d,[rs1+%g0] */
  177. { "st", 0xc1a82000, 0x00501fff, "C,[1]" }, /* st d,[rs1+0] */
  178. { "st", 0xc1a82000, 0x00500000, "C,[1+i]" },
  179. { "st", 0xc1a82000, 0x00500000, "C,[i+1]" },
  180. { "st", 0xc1a80000, 0x00500000, "C,[1+2]" },
  181. { "sta", 0xc0a00000, 0x0108001f, "d,[1]A" }, /* sta d,[rs1+%g0] */
  182. { "sta", 0xc0a02000, 0x01081fff, "d,[1]A" }, /* sta d,[rs1+0] */
  183. { "sta", 0xc0a00000, 0x01080000, "d,[1+2]A" },
  184. { "stb", 0xc0280000, 0x01d0001f, "d,[1]" }, /* stb d,[rs1+%g0] */
  185. { "stb", 0xc0282000, 0x01d01fff, "d,[1]" }, /* stb d,[rs1+0] */
  186. { "stb", 0xc0282000, 0x01d00000, "d,[1+i]" },
  187. { "stb", 0xc0282000, 0x01d00000, "d,[i+1]" },
  188. { "stb", 0xc0280000, 0x01d00000, "d,[1+2]" },
  189. { "stba", 0xc0a80000, 0x01000000, "d,[1+2]A" },
  190. { "stba", 0xc0a80000, 0x0100001f, "d,[1]A" }, /* stba d,[rs1+%g0] */
  191. { "stba", 0xc0a82000, 0x01001fff, "d,[1]A" }, /* stba d,[rs1+0] */
  192. { "std", 0xc0380000, 0x01c0001f, "d,[1]" }, /* std d,[rs1+%g0] */
  193. { "std", 0xc0382000, 0x01c01fff, "d,[1]" }, /* std d,[rs1+0] */
  194. { "std", 0xc0382000, 0x01c00000, "d,[1+i]" },
  195. { "std", 0xc0382000, 0x01c00000, "d,[i+1]" },
  196. { "std", 0xc0380000, 0x01c00000, "d,[1+2]" },
  197. { "std", 0xc1380000, 0x00c0001f, "g,[1]" }, /* std d,[rs1+%g0] */
  198. { "std", 0xc1382000, 0x00c01fff, "g,[1]" }, /* std d,[rs1+0] */
  199. { "std", 0xc1382000, 0x00c00000, "g,[1+i]" },
  200. { "std", 0xc1382000, 0x00c00000, "g,[i+1]" },
  201. { "std", 0xc1380000, 0x00c00000, "g,[1+2]" },
  202. { "std", 0xc1300000, 0x00c8001f, "q,[1]" }, /* std d,[rs1+%g0] */
  203. { "std", 0xc1302000, 0x00c81fff, "q,[1]" }, /* std d,[rs1+0] */
  204. { "std", 0xc1302000, 0x00c80000, "q,[1+i]" },
  205. { "std", 0xc1302000, 0x00c80000, "q,[i+1]" },
  206. { "std", 0xc1300000, 0x00c80000, "q,[1+2]" },
  207. { "std", 0xc1b80000, 0x0040001f, "D,[1]" }, /* std d,[rs1+%g0] */
  208. { "std", 0xc1b82000, 0x00401fff, "D,[1]" }, /* std d,[rs1+0] */
  209. { "std", 0xc1b82000, 0x00400000, "D,[1+i]" },
  210. { "std", 0xc1b82000, 0x00400000, "D,[i+1]" },
  211. { "std", 0xc1b80000, 0x00400000, "D,[1+2]" },
  212. { "std", 0xc1b00000, 0x0048001f, "Q,[1]" }, /* std d,[rs1+%g0] */
  213. { "std", 0xc1b02000, 0x00481fff, "Q,[1]" }, /* std d,[rs1+0] */
  214. { "std", 0xc1b02000, 0x00480000, "Q,[1+i]" },
  215. { "std", 0xc1b02000, 0x00480000, "Q,[i+1]" },
  216. { "std", 0xc1b00000, 0x00480000, "Q,[1+2]" },
  217. { "stda", 0xc0b80000, 0x01400000, "d,[1+2]A" },
  218. { "stda", 0xc0b80000, 0x0140001f, "d,[1]A" }, /* stda d,[rs1+%g0] */
  219. { "stda", 0xc0b82000, 0x01401fff, "d,[1]A" }, /* stda d,[rs1+0] */
  220. { "sth", 0xc0300000, 0x01c8001f, "d,[1]" }, /* sth d,[rs1+%g0] */
  221. { "sth", 0xc0302000, 0x01c81fff, "d,[1]" }, /* sth d,[rs1+0] */
  222. { "sth", 0xc0300000, 0x01c80000, "d,[1+2]" },
  223. { "sth", 0xc0302000, 0x01c80000, "d,[1+i]" },
  224. { "sth", 0xc0302000, 0x01c80000, "d,[i+1]" },
  225. { "stha", 0xc0b00000, 0x0148001f, "d,[1]A" }, /* stha d,[rs1+%g0] */
  226. { "stha", 0xc0b02000, 0x01481fff, "d,[1]A" }, /* stha d,[rs1+0] */
  227. { "stha", 0xc0b00000, 0x01480000, "d,[1+2]A" },
  228. { "swap", 0xc0780000, 0x0180001f, "[1],d" }, /* swap [rs1+%g0],d */
  229. { "swap", 0xc0782000, 0x01801fff, "[1],d" }, /* swap [rs1+0],d */
  230. { "swap", 0xc0782000, 0x01800000, "[1+i],d" },
  231. { "swap", 0xc0782000, 0x01800000, "[i+1],d" },
  232. { "swap", 0xc0780000, 0x01800000, "[1+2],d" },
  233. { "swapa", 0xc0f82000, 0x01000000, "[1+2]A,d" },
  234. { "swapa", 0xc0f80000, 0x0100001f, "[1]A,d" }, /* swapa [rs1+%g0],d */
  235. { "swapa", 0xc0f82000, 0x01001fff, "[1]A,d" }, /* swapa [rs1+0],d */
  236. { "restore", 0x81e80000, 0x7e17e01f, "" }, /* restore %g0,%g0,%g0 */
  237. { "restore", 0x81e82000, 0x7e14dfff, "" }, /* restore %g0,0,%g0 */
  238. { "restore", 0x81e82000, 0x00000000, "1,i,d" },
  239. { "restore", 0x81e80000, 0x00000000, "1,2,d" },
  240. { "rett", 0x81c82000, 0x40300000, "1,i,d" },
  241. { "rett", 0x81c80000, 0x40300000, "1,2,d" },
  242. { "save", 0x81e02000, 0x40180000, "1,i,d" },
  243. { "save", 0x81e00000, 0x40180000, "1,2,d" },
  244. { "ret", 0x81c7e008, 0x00001ff7, "" }, /* jmpl %i7+8,%g0 */
  245. { "retl", 0x81c3e008, 0x00001ff7, "" }, /* jmpl %o7+8,%g0 */
  246. { "jmpl", 0x81c00000, 0x4038001f, "1,d" }, /* jmpl rs1+%g0,d */
  247. { "jmpl", 0x81c02000, 0x4037c000, "i,d" }, /* jmpl %g0+i,d */
  248. { "jmpl", 0x81c02000, 0x40380000, "1+i,d" },
  249. { "jmpl", 0x81c02000, 0x40380000, "i+1,d" },
  250. { "jmpl", 0x81c00000, 0x40380000, "1+2,d" },
  251. { "wr", 0x81982000, 0x40600000, "1,i,t" },
  252. { "wr", 0x81980000, 0x40600000, "1,2,t" },
  253. { "wr", 0x81902000, 0x40680000, "1,i,w" },
  254. { "wr", 0x81900000, 0x40680000, "1,2,w" },
  255. { "wr", 0x81882000, 0x40700000, "1,i,p" },
  256. { "wr", 0x81880000, 0x40700000, "1,2,p" },
  257. { "wr", 0x81802000, 0x40780000, "1,i,y" },
  258. { "wr", 0x81800000, 0x40780000, "1,2,y" },
  259. { "rd", 0x81580000, 0x40a00000, "t,d" },
  260. { "rd", 0x81500000, 0x40a80000, "w,d" },
  261. { "rd", 0x81480000, 0x40b00000, "p,d" },
  262. { "rd", 0x81400000, 0x40b80000, "y,d" },
  263. { "sra", 0x81382000, 0x00000000, "1,i,d" },
  264. { "sra", 0x81380000, 0x00000000, "1,2,d" },
  265. { "srl", 0x81302000, 0x40c80000, "1,i,d" },
  266. { "srl", 0x81300000, 0x40c80000, "1,2,d" },
  267. { "sll", 0x81282000, 0x40d00000, "1,i,d" },
  268. { "sll", 0x81280000, 0x40d00000, "1,2,d" },
  269. { "mulscc", 0x81202000, 0x40d80000, "1,i,d" },
  270. { "mulscc", 0x81200000, 0x40d80000, "1,2,d" },
  271. { "clr", 0x80100000, 0x4e87e01f, "d" }, /* or %g0,%g0,d */
  272. { "clr", 0x80102000, 0x41efdfff, "d" }, /* or %g0,0,d */
  273. { "orncc", 0x80b02000, 0x04048000, "1,i,d" },
  274. { "orncc", 0x80b02000, 0x04048000, "i,1,d" },
  275. { "orncc", 0x80b00000, 0x04048000, "1,2,d" },
  276. { "tst", 0x80900000, 0x7f6fe000, "2" }, /* orcc %g0, rs2, %g0 */
  277. { "tst", 0x80900000, 0x7f68201f, "1" }, /* orcc rs1, %g0, %g0 */
  278. { "tst", 0x80902000, 0x7f681fff, "1" }, /* orcc rs1, 0, %g0 */
  279. { "orcc", 0x80902000, 0x41680000, "1,i,d" },
  280. { "orcc", 0x80902000, 0x41680000, "i,1,d" },
  281. { "orcc", 0x80900000, 0x41680000, "1,2,d" },
  282. { "orn", 0x80302000, 0x41c80000, "1,i,d" },
  283. { "orn", 0x80302000, 0x41c80000, "i,1,d" },
  284. { "orn", 0x80300000, 0x41c80000, "1,2,d" },
  285. { "mov", 0x81800000, 0x4078001f, "1,y" }, /* wr rs1,%g0,%y */
  286. { "mov", 0x81802000, 0x40781fff, "1,y" }, /* wr rs1,0,%y */
  287. { "mov", 0x80102000, 0x41efc000, "i,d" }, /* or %g0,i,d */
  288. { "mov", 0x80100000, 0x41efe000, "2,d" }, /* or %g0,rs2,d */
  289. { "or", 0x80102000, 0x40800000, "1,i,d" },
  290. { "or", 0x80102000, 0x40800000, "i,1,d" },
  291. { "or", 0x80100000, 0x40800000, "1,2,d" },
  292. { "andncc", 0x80a82000, 0x41500000, "1,i,d" },
  293. { "andncc", 0x80a82000, 0x41500000, "i,1,d" },
  294. { "andncc", 0x80a80000, 0x41500000, "1,2,d" },
  295. { "andn", 0x80282000, 0x41d00000, "1,i,d" },
  296. { "andn", 0x80282000, 0x41d00000, "i,1,d" },
  297. { "andn", 0x80280000, 0x41d00000, "1,2,d" },
  298. { "cmp", 0x80a02000, 0x7d580000, "1,i" }, /* subcc rs1,i,%g0 */
  299. { "cmp", 0x80a00000, 0x7d580000, "1,2" }, /* subcc rs1,rs2,%g0 */
  300. { "subcc", 0x80a02000, 0x41580000, "1,i,d" },
  301. { "subcc", 0x80a00000, 0x41580000, "1,2,d" },
  302. { "sub", 0x80202000, 0x41d80000, "1,i,d" },
  303. { "sub", 0x80200000, 0x41d80000, "1,2,d" },
  304. { "subx", 0x80602000, 0x41980000, "1,i,d" },
  305. { "subx", 0x80600000, 0x41980000, "1,2,d" },
  306. { "subxcc", 0x80e02000, 0x41180000, "1,i,d" },
  307. { "subxcc", 0x80e00000, 0x41180000, "1,2,d" },
  308. { "andcc", 0x80882000, 0x41700000, "1,i,d" },
  309. { "andcc", 0x80882000, 0x41700000, "i,1,d" },
  310. { "andcc", 0x80880000, 0x41700000, "1,2,d" },
  311. { "and", 0x80082000, 0x41f00000, "1,i,d" },
  312. { "and", 0x80082000, 0x41f00000, "i,1,d" },
  313. { "and", 0x80080000, 0x41f00000, "1,2,d" },
  314. { "inc", 0x80002001, 0x00001ffe, "r" }, /* add rs1,1,rsd */
  315. { "addxcc", 0x80c02000, 0x41380000, "1,i,d" },
  316. { "addxcc", 0x80c02000, 0x41380000, "i,1,d" },
  317. { "addxcc", 0x80c00000, 0x41380000, "1,2,d" },
  318. { "addcc", 0x80802000, 0x41780000, "1,i,d" },
  319. { "addcc", 0x80802000, 0x41780000, "i,1,d" },
  320. { "addcc", 0x80800000, 0x41780000, "1,2,d" },
  321. { "addx", 0x80402000, 0x41b80000, "1,i,d" },
  322. { "addx", 0x80402000, 0x41b80000, "i,1,d" },
  323. { "addx", 0x80400000, 0x41b80000, "1,2,d" },
  324. { "add", 0x80002000, 0x41f80000, "1,i,d" },
  325. { "add", 0x80002000, 0x41f80000, "i,1,d" },
  326. { "add", 0x80000000, 0x41f80000, "1,2,d" },
  327. { "call", 0x9fc00000, 0x4038001f, "1" }, /* jmpl rs1+%g0, %o7 */
  328. { "call", 0x9fc00000, 0x4038001f, "1,#" },
  329. { "call", 0x40000000, 0x80000000, "L" },
  330. { "call", 0x40000000, 0x80000000, "L,#" },
  331. { "bvc", 0x3e800000, 0xc1400000, ",al" },
  332. { "bvc", 0x1e800000, 0xc1400000, "l" },
  333. { "bvs", 0x2e800000, 0xc1400000, ",al" },
  334. { "bvs", 0x0e800000, 0xc1400000, "l" },
  335. { "bpos", 0x3c800000, 0xc1400000, ",al" },
  336. { "bpos", 0x1c800000, 0xc1400000, "l" },
  337. { "bneg", 0x2c800000, 0xc1400000, ",al" },
  338. { "bneg", 0x0c800000, 0xc1400000, "l" },
  339. { "bcc", 0x3a800000, 0xc1400000, ",al" },
  340. { "bcc", 0x1a800000, 0xc1400000, "l" },
  341. { "bcs", 0x2a800000, 0xc1400000, ",al" },
  342. { "bcs", 0x0a800000, 0xc1400000, "l" },
  343. { "blu", 0x2a800000, 0xc1400000, ",al" },
  344. { "blu", 0x0a800000, 0xc1400000, "l" }, /* same as bcs */
  345. { "bgeu", 0x3a800000, 0xc1400000, ",al" },
  346. { "bgeu", 0x1a800000, 0xc1400000, "l" }, /* same as bcc */
  347. { "bgu", 0x38800000, 0xc1400000, ",al" },
  348. { "bgu", 0x18800000, 0xc1400000, "l" },
  349. { "bleu", 0x28800000, 0xc1400000, ",al" },
  350. { "bleu", 0x08800000, 0xc1400000, "l" },
  351. { "bge", 0x36800000, 0xc1400000, ",al" },
  352. { "bge", 0x16800000, 0xc1400000, "l" },
  353. { "bl", 0x26800000, 0xc1400000, ",al" },
  354. { "bl", 0x06800000, 0xc1400000, "l" },
  355. { "bg", 0x34800000, 0xc1400000, ",al" },
  356. { "bg", 0x14800000, 0xc1400000, "l" },
  357. { "ble", 0x24800000, 0xc1400000, ",al" },
  358. { "ble", 0x04800000, 0xc1400000, "l" },
  359. { "be", 0x22800000, 0xc1400000, ",al" },
  360. { "be", 0x02800000, 0xc1400000, "l" },
  361. { "bne", 0x32800000, 0xc1400000, ",al" },
  362. { "bne", 0x12800000, 0xc1400000, "l" },
  363. { "b", 0x30800000, 0xc1400000, ",al" },
  364. { "b", 0x10800000, 0xc1400000, "l" },
  365. { "ba", 0x30800000, 0xc1400000, ",al" },
  366. { "ba", 0x10800000, 0xc1400000, "l" },
  367. { "bn", 0x20800000, 0xc1400000, ",al" },
  368. { "bn", 0x00800000, 0xc1400000, "l" },
  369. { "jmp", 0x81c00000, 0x7e38201f, "1" }, /* jmpl rs1+%g0,%g0 */
  370. { "jmp", 0x81c02000, 0x7e3fc000, "i" }, /* jmpl %g0+i,%g0 */
  371. { "nop", 0x01000000, 0xfe3fffff, "", }, /* sethi 0, %g0 */
  372. { "set", 0x01000000, 0xc0c00000, "Sh,d" },
  373. { "sethi", 0x01000000, 0xc0c00000, "h,d" },
  374. { "taddcctv", 0x81102000, 0x40e00000, "1,i,d" },
  375. { "taddcctv", 0x81100000, 0x40e00000, "1,2,d" },
  376. { "taddcc", 0x81002000, 0x40f80000, "1,i,d" },
  377. { "taddcc", 0x81000000, 0x40f80000, "1,2,d" },
  378. { "tvc", 0x9fd02000, 0x402fc000, "i" }, /* tvc %g0+i */
  379. { "tvc", 0x9fd02000, 0x40280000, "1+i" },
  380. { "tvc", 0x9fd00000, 0x40280000, "1+2" },
  381. { "tvc", 0x9fd00000, 0x4028001f, "1" }, /* tvc rs1+%g0 */
  382. { "tpos", 0x9dd02000, 0x402fc000, "i" }, /* tpos %g0+i */
  383. { "tpos", 0x9dd02000, 0x40280000, "1+i" },
  384. { "tpos", 0x9dd00000, 0x40280000, "1+2" },
  385. { "tpos", 0x9dd00000, 0x4028001f, "1" }, /* tpos rs1+%g0 */
  386. { "tcc", 0x9bd02000, 0x402fc000, "i" }, /* tcc %g0+i */
  387. { "tcc", 0x9bd02000, 0x40280000, "1+i" },
  388. { "tcc", 0x9bd00000, 0x40280000, "1+2" },
  389. { "tcc", 0x9bd00000, 0x4028001f, "1" }, /* tcc rs1+%g0 */
  390. { "tgu", 0x99d02000, 0x402fc000, "i" }, /* tgu %g0+i */
  391. { "tgu", 0x99d02000, 0x40280000, "1+i" },
  392. { "tgu", 0x99d00000, 0x40280000, "1+2" },
  393. { "tgu", 0x99d00000, 0x4028001f, "1" }, /* tgu rs1+%g0 */
  394. { "tge", 0x97d02000, 0x402fc000, "i" }, /* tge %g0+i */
  395. { "tge", 0x97d02000, 0x40280000, "1+i" },
  396. { "tge", 0x97d00000, 0x40280000, "1+2" },
  397. { "tge", 0x97d00000, 0x4028001f, "1" }, /* tge rs1+%g0 */
  398. { "tg", 0x95d02000, 0x402fc000, "i" }, /* tg %g0+i */
  399. { "tg", 0x95d02000, 0x40280000, "1+i" },
  400. { "tg", 0x95d00000, 0x40280000, "1+2" },
  401. { "tg", 0x95d00000, 0x4028001f, "1" }, /* tg rs1+%g0 */
  402. { "tne", 0x93d02000, 0x402fc000, "i" }, /* tne %g0+i */
  403. { "tne", 0x93d02000, 0x40280000, "1+i" },
  404. { "tne", 0x93d00000, 0x40280000, "1+2" },
  405. { "tne", 0x93d00000, 0x4028001f, "1" }, /* tne rs1+%g0 */
  406. { "tleu", 0x8bd02000, 0x502fc000, "i" }, /* tleu %g0+i */
  407. { "tleu", 0x8bd02000, 0x50280000, "1+i" },
  408. { "tleu", 0x8bd00000, 0x50280000, "1+2" },
  409. { "tleu", 0x8bd00000, 0x5028001f, "1" }, /* tleu rs1+%g0 */
  410. { "ta", 0x91d02000, 0x402d0000, "1+i" },
  411. { "ta", 0x91d00000, 0x40280000, "1+2" },
  412. { "ta", 0x91d00000, 0x4028001f, "1" }, /* ta rs1+%g0 */
  413. { "ta", 0x91d02000, 0x402fc000, "i" }, /* ta %g0+i */
  414. { "tvs", 0x8fd02000, 0x502fc000, "i" }, /* tvs %g0+i */
  415. { "tvs", 0x8fd02000, 0x50280000, "1+i" },
  416. { "tvs", 0x8fd00000, 0x50280000, "1+2" },
  417. { "tvs", 0x8fd00000, 0x5028001f, "1" }, /* tvs rs1+%g0 */
  418. { "tneg", 0x8dd02000, 0x502fc000, "i" }, /* tneg %g0+i */
  419. { "tneg", 0x8dd02000, 0x50280000, "1+i" },
  420. { "tneg", 0x8dd00000, 0x50280000, "1+2" },
  421. { "tneg", 0x8dd00000, 0x5028001f, "1" }, /* tneg rs1+%g0 */
  422. { "tcs", 0x8bd02000, 0x502fc000, "i" }, /* tcs %g0+i */
  423. { "tcs", 0x8bd02000, 0x50280000, "1+i" },
  424. { "tcs", 0x8bd00000, 0x50280000, "1+2" },
  425. { "tcs", 0x8bd00000, 0x5028001f, "1" }, /* tcs rs1+%g0 */
  426. { "tl", 0x87d02000, 0x502fc000, "i" }, /* tl %g0+i */
  427. { "tl", 0x87d02000, 0x50280000, "1+i" },
  428. { "tl", 0x87d00000, 0x50280000, "1+2" },
  429. { "tl", 0x87d00000, 0x5028001f, "1" }, /* tl rs1+%g0 */
  430. { "tle", 0x85d02000, 0x502fc000, "i" }, /* tle %g0+i */
  431. { "tle", 0x85d02000, 0x50280000, "1+i" },
  432. { "tle", 0x85d00000, 0x50280000, "1+2" },
  433. { "tle", 0x85d00000, 0x5028001f, "1" }, /* tle rs1+%g0 */
  434. { "te", 0x83d02000, 0x502fc000, "i" }, /* te %g0+i */
  435. { "te", 0x83d02000, 0x50280000, "1+i" },
  436. { "te", 0x83d00000, 0x50280000, "1+2" },
  437. { "te", 0x83d00000, 0x5028001f, "1" }, /* te rs1+%g0 */
  438. { "tn", 0x81d02000, 0x502fc000, "i" }, /* tn %g0+i */
  439. { "tn", 0x81d02000, 0x50280000, "1+i" },
  440. { "tn", 0x81d00000, 0x50280000, "1+2" },
  441. { "tn", 0x81d00000, 0x5028001f, "1" }, /* tn rs1+%g0 */
  442. { "tsubcc", 0x81080000, 0x40f00000, "1,2,d" },
  443. { "tsubcc", 0x81082000, 0x40f00000, "1,i,d" },
  444. { "tsubcctv", 0x80580000, 0x40a00000, "1,2,d" },
  445. { "tsubcctv", 0x80582000, 0x40a00000, "1,i,d" },
  446. { "unimp", 0x00000000, 0x00000000, "l" },
  447. { "iflush", 0x81d80000, 0x40200000, "1+2" },
  448. { "iflush", 0x81d82000, 0x40200000, "1+i" },
  449. { "xnorcc", 0x80b80000, 0x41400000, "1,2,d" },
  450. { "xnorcc", 0x80b82000, 0x41400000, "1,i,d" },
  451. { "xnorcc", 0x80b82000, 0x41400000, "i,1,d" },
  452. { "xorcc", 0x80980000, 0x41600000, "1,2,d" },
  453. { "xorcc", 0x80982000, 0x41600000, "1,i,d" },
  454. { "xorcc", 0x80982000, 0x41600000, "i,1,d" },
  455. { "xnor", 0x80380000, 0x41c00000, "1,2,d" },
  456. { "xnor", 0x80382000, 0x41c00000, "1,i,d" },
  457. { "xnor", 0x80382000, 0x41c00000, "i,1,d" },
  458. { "xor", 0x80180000, 0x41e00000, "1,2,d" },
  459. { "xor", 0x80182000, 0x41e00000, "1,i,d" },
  460. { "xor", 0x80182000, 0x41e00000, "i,1,d" },
  461. { "fpop1", 0x81a00000, 0x40580000, "[1+2],d" },
  462. { "fpop2", 0x81a80000, 0x40500000, "[1+2],d" },
  463. { "fb", 0x31800000, 0xc0400000, ",al" },
  464. { "fb", 0x11800000, 0xc0400000, "l" },
  465. { "fba", 0x31800000, 0xc0400000, ",al" },
  466. { "fba", 0x11800000, 0xc0400000, "l" },
  467. { "fbn", 0x21800000, 0xc0400000, ",al" },
  468. { "fbn", 0x01800000, 0xc0400000, "l" },
  469. { "fbu", 0x2f800000, 0xc0400000, ",al" },
  470. { "fbu", 0x0f800000, 0xc0400000, "l" },
  471. { "fbg", 0x2d800000, 0xc0400000, ",al" },
  472. { "fbg", 0x0d800000, 0xc0400000, "l" },
  473. { "fbug", 0x2b800000, 0xc0400000, ",al" },
  474. { "fbug", 0x0b800000, 0xc0400000, "l" },
  475. { "fbl", 0x29800000, 0xc0400000, ",al" },
  476. { "fbl", 0x09800000, 0xc0400000, "l" },
  477. { "fbul", 0x27800000, 0xc0400000, ",al" },
  478. { "fbul", 0x07800000, 0xc0400000, "l" },
  479. { "fblg", 0x25800000, 0xc0400000, ",al" },
  480. { "fblg", 0x05800000, 0xc0400000, "l" },
  481. { "fbne", 0x23800000, 0xc0400000, ",al" },
  482. { "fbne", 0x03800000, 0xc0400000, "l" },
  483. { "fbe", 0x33800000, 0xc0400000, ",al" },
  484. { "fbe", 0x13800000, 0xc0400000, "l" },
  485. { "fbue", 0x35800000, 0xc0400000, ",al" },
  486. { "fbue", 0x15800000, 0xc0400000, "l" },
  487. { "fbge", 0x37800000, 0xc0400000, ",al" },
  488. { "fbge", 0x17800000, 0xc0400000, "l" },
  489. { "fbuge", 0x39800000, 0xc0400000, ",al" },
  490. { "fbuge", 0x19800000, 0xc0400000, "l" },
  491. { "fble", 0x3b800000, 0xc0400000, ",al" },
  492. { "fble", 0x1b800000, 0xc0400000, "l" },
  493. { "fbule", 0x3d800000, 0xc0400000, ",al" },
  494. { "fbule", 0x1d800000, 0xc0400000, "l" },
  495. { "fbo", 0x3f800000, 0xc0400000, ",al" },
  496. { "fbo", 0x1f800000, 0xc0400000, "l" },
  497. { "cba", 0x31c00000, 0xce000000, ",al" },
  498. { "cba", 0x11c00000, 0xce000000, "l" },
  499. { "cbn", 0x21c00000, 0xde000000, ",al" },
  500. { "cbn", 0x01c00000, 0xde000000, "l" },
  501. { "cb3", 0x2fc00000, 0xc0000000, ",al" },
  502. { "cb3", 0x0fc00000, 0xc0000000, "l" },
  503. { "cb2", 0x2dc00000, 0xc0000000, ",al" },
  504. { "cb2", 0x0dc00000, 0xc0000000, "l" },
  505. { "cb23", 0x2bc00000, 0xc0000000, ",al" },
  506. { "cb23", 0x0bc00000, 0xc0000000, "l" },
  507. { "cb1", 0x29c00000, 0xc0000000, ",al" },
  508. { "cb1", 0x09c00000, 0xc0000000, "l" },
  509. { "cb13", 0x27c00000, 0xc0000000, ",al" },
  510. { "cb13", 0x07c00000, 0xc0000000, "l" },
  511. { "cb12", 0x25c00000, 0xc0000000, ",al" },
  512. { "cb12", 0x05c00000, 0xc0000000, "l" },
  513. { "cb123", 0x23c00000, 0xc0000000, ",al" },
  514. { "cb123", 0x03c00000, 0xc0000000, "l" },
  515. { "cb0", 0x33c00000, 0xc0000000, ",al" },
  516. { "cb0", 0x13c00000, 0xc0000000, "l" },
  517. { "cb03", 0x35c00000, 0xc0000000, ",al" },
  518. { "cb03", 0x15c00000, 0xc0000000, "l" },
  519. { "cb02", 0x37c00000, 0xc0000000, ",al" },
  520. { "cb02", 0x17c00000, 0xc0000000, "l" },
  521. { "cb023", 0x39c00000, 0xc0000000, ",al" },
  522. { "cb023", 0x19c00000, 0xc0000000, "l" },
  523. { "cb013", 0x3dc00000, 0xc0000000, ",al" },
  524. { "cb013", 0x1dc00000, 0xc0000000, "l" },
  525. { "cb012", 0x3fc00000, 0xc0000000, ",al" },
  526. { "cb012", 0x1fc00000, 0xc0000000, "l" },
  527. { "fstoi", 0x81a01a20, 0x400025c0, "f,g" },
  528. { "fdtoi", 0x81a01a40, 0x400025a0, "f,g" },
  529. { "fxtoi", 0x81a01a60, 0x40002580, "f,g" },
  530. { "fitox", 0x81a01980, 0x40002660, "f,g" },
  531. { "fitod", 0x81a01900, 0x400026e0, "f,g" },
  532. { "fitos", 0x81a01880, 0x40002660, "f,g" },
  533. { "fstod", 0x81a01920, 0x400026c0, "f,g" },
  534. { "fstox", 0x81a019a0, 0x40002640, "f,g" },
  535. { "fdtos", 0x81a018c0, 0x40002720, "f,g" },
  536. { "fdtox", 0x81a019c0, 0x40002620, "f,g" },
  537. { "fxtos", 0x81a018e0, 0x40002700, "f,g" },
  538. { "fxtod", 0x81a01960, 0x40002680, "f,g" },
  539. { "fdivx", 0x81a009e0, 0x40083600, "e,f,g" },
  540. { "fdivd", 0x81a009c0, 0x40003620, "e,f,g" },
  541. { "fdivs", 0x81a009a0, 0x40003640, "e,f,g" },
  542. { "fmuls", 0x81a00920, 0x400036c0, "e,f,g" },
  543. { "fmuld", 0x81a00940, 0x400036a0, "e,f,g" },
  544. { "fmulx", 0x81a00960, 0x40003680, "e,f,g" },
  545. { "fsqrts", 0x81a00520, 0x40003ac0, "f,g" },
  546. { "fsqrtd", 0x81a00540, 0x40003aa8, "f,g" },
  547. { "fsqrtx", 0x81a00560, 0x40003a80, "f,g" },
  548. { "fabss", 0x81a00120, 0x40003ec0, "f,g" },
  549. { "fnegs", 0x81a000a0, 0x40003f40, "f,g" },
  550. { "fmovs", 0x81a00020, 0x40003fc0, "f,g" },
  551. { "fsubx", 0x81a008e0, 0x40003700, "e,f,g" },
  552. { "fsubd", 0x81a008c0, 0x40003720, "e,f,g" },
  553. { "fsubs", 0x81a008a0, 0x40003740, "e,f,g" },
  554. { "faddx", 0x81a00860, 0x40003780, "e,f,g" },
  555. { "faddd", 0x81a00840, 0x400037a0, "e,f,g" },
  556. { "fadds", 0x81a00820, 0x400037c0, "e,f,g" },
  557. { "fcmpex", 0x81a80ae0, 0x40003500, "e,f" },
  558. { "fcmped", 0x81a80ac0, 0x40003520, "e,f" },
  559. { "fcmpes", 0x81a80aa0, 0x40003540, "e,f" },
  560. { "fcmpx", 0x81a80a60, 0x40003580, "e,f" },
  561. { "fcmpd", 0x81a80a40, 0x400035a0, "e,f" },
  562. { "fcmps", 0x81a80a20, 0x400035c0, "e,f" },
  563. { "cpop1", 0x81b00000, 0x40480000, "[1+2],d" },
  564. { "cpop2", 0x81b80000, 0x40400000, "[1+2],d" },
  565. };
  566. #define NUMOPCODES ((sizeof sparc_opcodes)/(sizeof *sparc_opcodes))