hppa-dis.c 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831
  1. /* Disassembler for the PA-RISC. Somewhat derived from sparc-pinsn.c.
  2. Copyright 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2003,
  3. 2005 Free Software Foundation, Inc.
  4. Contributed by the Center for Software Science at the
  5. University of Utah (pa-gdb-bugs@cs.utah.edu).
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  16. #include "dis-asm.h"
  17. /* HP PA-RISC SOM object file format: definitions internal to BFD.
  18. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
  19. 2003 Free Software Foundation, Inc.
  20. Contributed by the Center for Software Science at the
  21. University of Utah (pa-gdb-bugs@cs.utah.edu).
  22. This file is part of BFD, the Binary File Descriptor library.
  23. This program is free software; you can redistribute it and/or modify
  24. it under the terms of the GNU General Public License as published by
  25. the Free Software Foundation; either version 2 of the License, or
  26. (at your option) any later version.
  27. This program is distributed in the hope that it will be useful,
  28. but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  30. GNU General Public License for more details.
  31. You should have received a copy of the GNU General Public License
  32. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  33. #ifndef _LIBHPPA_H
  34. #define _LIBHPPA_H
  35. #define BYTES_IN_WORD 4
  36. #define PA_PAGESIZE 0x1000
  37. /* The PA instruction set variants. */
  38. enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25};
  39. /* HP PA-RISC relocation types */
  40. enum hppa_reloc_field_selector_type
  41. {
  42. R_HPPA_FSEL = 0x0,
  43. R_HPPA_LSSEL = 0x1,
  44. R_HPPA_RSSEL = 0x2,
  45. R_HPPA_LSEL = 0x3,
  46. R_HPPA_RSEL = 0x4,
  47. R_HPPA_LDSEL = 0x5,
  48. R_HPPA_RDSEL = 0x6,
  49. R_HPPA_LRSEL = 0x7,
  50. R_HPPA_RRSEL = 0x8,
  51. R_HPPA_NSEL = 0x9,
  52. R_HPPA_NLSEL = 0xa,
  53. R_HPPA_NLRSEL = 0xb,
  54. R_HPPA_PSEL = 0xc,
  55. R_HPPA_LPSEL = 0xd,
  56. R_HPPA_RPSEL = 0xe,
  57. R_HPPA_TSEL = 0xf,
  58. R_HPPA_LTSEL = 0x10,
  59. R_HPPA_RTSEL = 0x11,
  60. R_HPPA_LTPSEL = 0x12,
  61. R_HPPA_RTPSEL = 0x13
  62. };
  63. /* /usr/include/reloc.h defines these to constants. We want to use
  64. them in enums, so #undef them before we start using them. We might
  65. be able to fix this another way by simply managing not to include
  66. /usr/include/reloc.h, but currently GDB picks up these defines
  67. somewhere. */
  68. #undef e_fsel
  69. #undef e_lssel
  70. #undef e_rssel
  71. #undef e_lsel
  72. #undef e_rsel
  73. #undef e_ldsel
  74. #undef e_rdsel
  75. #undef e_lrsel
  76. #undef e_rrsel
  77. #undef e_nsel
  78. #undef e_nlsel
  79. #undef e_nlrsel
  80. #undef e_psel
  81. #undef e_lpsel
  82. #undef e_rpsel
  83. #undef e_tsel
  84. #undef e_ltsel
  85. #undef e_rtsel
  86. #undef e_one
  87. #undef e_two
  88. #undef e_pcrel
  89. #undef e_con
  90. #undef e_plabel
  91. #undef e_abs
  92. /* for compatibility */
  93. enum hppa_reloc_field_selector_type_alt
  94. {
  95. e_fsel = R_HPPA_FSEL,
  96. e_lssel = R_HPPA_LSSEL,
  97. e_rssel = R_HPPA_RSSEL,
  98. e_lsel = R_HPPA_LSEL,
  99. e_rsel = R_HPPA_RSEL,
  100. e_ldsel = R_HPPA_LDSEL,
  101. e_rdsel = R_HPPA_RDSEL,
  102. e_lrsel = R_HPPA_LRSEL,
  103. e_rrsel = R_HPPA_RRSEL,
  104. e_nsel = R_HPPA_NSEL,
  105. e_nlsel = R_HPPA_NLSEL,
  106. e_nlrsel = R_HPPA_NLRSEL,
  107. e_psel = R_HPPA_PSEL,
  108. e_lpsel = R_HPPA_LPSEL,
  109. e_rpsel = R_HPPA_RPSEL,
  110. e_tsel = R_HPPA_TSEL,
  111. e_ltsel = R_HPPA_LTSEL,
  112. e_rtsel = R_HPPA_RTSEL,
  113. e_ltpsel = R_HPPA_LTPSEL,
  114. e_rtpsel = R_HPPA_RTPSEL
  115. };
  116. enum hppa_reloc_expr_type
  117. {
  118. R_HPPA_E_ONE = 0,
  119. R_HPPA_E_TWO = 1,
  120. R_HPPA_E_PCREL = 2,
  121. R_HPPA_E_CON = 3,
  122. R_HPPA_E_PLABEL = 7,
  123. R_HPPA_E_ABS = 18
  124. };
  125. /* for compatibility */
  126. enum hppa_reloc_expr_type_alt
  127. {
  128. e_one = R_HPPA_E_ONE,
  129. e_two = R_HPPA_E_TWO,
  130. e_pcrel = R_HPPA_E_PCREL,
  131. e_con = R_HPPA_E_CON,
  132. e_plabel = R_HPPA_E_PLABEL,
  133. e_abs = R_HPPA_E_ABS
  134. };
  135. /* Relocations for function calls must be accompanied by parameter
  136. relocation bits. These bits describe exactly where the caller has
  137. placed the function's arguments and where it expects to find a return
  138. value.
  139. Both ELF and SOM encode this information within the addend field
  140. of the call relocation. (Note this could break very badly if one
  141. was to make a call like bl foo + 0x12345678).
  142. The high order 10 bits contain parameter relocation information,
  143. the low order 22 bits contain the constant offset. */
  144. #define HPPA_R_ARG_RELOC(a) \
  145. (((a) >> 22) & 0x3ff)
  146. #define HPPA_R_CONSTANT(a) \
  147. ((((bfd_signed_vma)(a)) << (BFD_ARCH_SIZE-22)) >> (BFD_ARCH_SIZE-22))
  148. #define HPPA_R_ADDEND(r, c) \
  149. (((r) << 22) + ((c) & 0x3fffff))
  150. /* Some functions to manipulate PA instructions. */
  151. /* Declare the functions with the unused attribute to avoid warnings. */
  152. static inline int sign_extend (int, int) ATTRIBUTE_UNUSED;
  153. static inline int low_sign_extend (int, int) ATTRIBUTE_UNUSED;
  154. static inline int sign_unext (int, int) ATTRIBUTE_UNUSED;
  155. static inline int low_sign_unext (int, int) ATTRIBUTE_UNUSED;
  156. static inline int re_assemble_3 (int) ATTRIBUTE_UNUSED;
  157. static inline int re_assemble_12 (int) ATTRIBUTE_UNUSED;
  158. static inline int re_assemble_14 (int) ATTRIBUTE_UNUSED;
  159. static inline int re_assemble_16 (int) ATTRIBUTE_UNUSED;
  160. static inline int re_assemble_17 (int) ATTRIBUTE_UNUSED;
  161. static inline int re_assemble_21 (int) ATTRIBUTE_UNUSED;
  162. static inline int re_assemble_22 (int) ATTRIBUTE_UNUSED;
  163. static inline bfd_signed_vma hppa_field_adjust
  164. (bfd_vma, bfd_signed_vma, enum hppa_reloc_field_selector_type_alt)
  165. ATTRIBUTE_UNUSED;
  166. static inline int hppa_rebuild_insn (int, int, int) ATTRIBUTE_UNUSED;
  167. /* The *sign_extend functions are used to assemble various bitfields
  168. taken from an instruction and return the resulting immediate
  169. value. */
  170. static inline int
  171. sign_extend (int x, int len)
  172. {
  173. int signbit = (1 << (len - 1));
  174. int mask = (signbit << 1) - 1;
  175. return ((x & mask) ^ signbit) - signbit;
  176. }
  177. static inline int
  178. low_sign_extend (int x, int len)
  179. {
  180. return (x >> 1) - ((x & 1) << (len - 1));
  181. }
  182. /* The re_assemble_* functions prepare an immediate value for
  183. insertion into an opcode. pa-risc uses all sorts of weird bitfields
  184. in the instruction to hold the value. */
  185. static inline int
  186. sign_unext (int x, int len)
  187. {
  188. int len_ones;
  189. len_ones = (1 << len) - 1;
  190. return x & len_ones;
  191. }
  192. static inline int
  193. low_sign_unext (int x, int len)
  194. {
  195. int temp;
  196. int sign;
  197. sign = (x >> (len-1)) & 1;
  198. temp = sign_unext (x, len-1);
  199. return (temp << 1) | sign;
  200. }
  201. static inline int
  202. re_assemble_3 (int as3)
  203. {
  204. return (( (as3 & 4) << (13-2))
  205. | ((as3 & 3) << (13+1)));
  206. }
  207. static inline int
  208. re_assemble_12 (int as12)
  209. {
  210. return (( (as12 & 0x800) >> 11)
  211. | ((as12 & 0x400) >> (10 - 2))
  212. | ((as12 & 0x3ff) << (1 + 2)));
  213. }
  214. static inline int
  215. re_assemble_14 (int as14)
  216. {
  217. return (( (as14 & 0x1fff) << 1)
  218. | ((as14 & 0x2000) >> 13));
  219. }
  220. static inline int
  221. re_assemble_16 (int as16)
  222. {
  223. int s, t;
  224. /* Unusual 16-bit encoding, for wide mode only. */
  225. t = (as16 << 1) & 0xffff;
  226. s = (as16 & 0x8000);
  227. return (t ^ s ^ (s >> 1)) | (s >> 15);
  228. }
  229. static inline int
  230. re_assemble_17 (int as17)
  231. {
  232. return (( (as17 & 0x10000) >> 16)
  233. | ((as17 & 0x0f800) << (16 - 11))
  234. | ((as17 & 0x00400) >> (10 - 2))
  235. | ((as17 & 0x003ff) << (1 + 2)));
  236. }
  237. static inline int
  238. re_assemble_21 (int as21)
  239. {
  240. return (( (as21 & 0x100000) >> 20)
  241. | ((as21 & 0x0ffe00) >> 8)
  242. | ((as21 & 0x000180) << 7)
  243. | ((as21 & 0x00007c) << 14)
  244. | ((as21 & 0x000003) << 12));
  245. }
  246. static inline int
  247. re_assemble_22 (int as22)
  248. {
  249. return (( (as22 & 0x200000) >> 21)
  250. | ((as22 & 0x1f0000) << (21 - 16))
  251. | ((as22 & 0x00f800) << (16 - 11))
  252. | ((as22 & 0x000400) >> (10 - 2))
  253. | ((as22 & 0x0003ff) << (1 + 2)));
  254. }
  255. /* Handle field selectors for PA instructions.
  256. The L and R (and LS, RS etc.) selectors are used in pairs to form a
  257. full 32 bit address. eg.
  258. LDIL L'start,%r1 ; put left part into r1
  259. LDW R'start(%r1),%r2 ; add r1 and right part to form address
  260. This function returns sign extended values in all cases.
  261. */
  262. static inline bfd_signed_vma
  263. hppa_field_adjust (bfd_vma sym_val,
  264. bfd_signed_vma addend,
  265. enum hppa_reloc_field_selector_type_alt r_field)
  266. {
  267. bfd_signed_vma value;
  268. value = sym_val + addend;
  269. switch (r_field)
  270. {
  271. case e_fsel:
  272. /* F: No change. */
  273. break;
  274. case e_nsel:
  275. /* N: null selector. I don't really understand what this is all
  276. about, but HP's documentation says "this indicates that zero
  277. bits are to be used for the displacement on the instruction.
  278. This fixup is used to identify three-instruction sequences to
  279. access data (for importing shared library data)." */
  280. value = 0;
  281. break;
  282. case e_lsel:
  283. case e_nlsel:
  284. /* L: Select top 21 bits. */
  285. value = value >> 11;
  286. break;
  287. case e_rsel:
  288. /* R: Select bottom 11 bits. */
  289. value = value & 0x7ff;
  290. break;
  291. case e_lssel:
  292. /* LS: Round to nearest multiple of 2048 then select top 21 bits. */
  293. value = value + 0x400;
  294. value = value >> 11;
  295. break;
  296. case e_rssel:
  297. /* RS: Select bottom 11 bits for LS.
  298. We need to return a value such that 2048 * LS'x + RS'x == x.
  299. ie. RS'x = x - ((x + 0x400) & -0x800)
  300. this is just a sign extension from bit 21. */
  301. value = ((value & 0x7ff) ^ 0x400) - 0x400;
  302. break;
  303. case e_ldsel:
  304. /* LD: Round to next multiple of 2048 then select top 21 bits.
  305. Yes, if we are already on a multiple of 2048, we go up to the
  306. next one. RD in this case will be -2048. */
  307. value = value + 0x800;
  308. value = value >> 11;
  309. break;
  310. case e_rdsel:
  311. /* RD: Set bits 0-20 to one. */
  312. value = value | -0x800;
  313. break;
  314. case e_lrsel:
  315. case e_nlrsel:
  316. /* LR: L with rounding of the addend to nearest 8k. */
  317. value = sym_val + ((addend + 0x1000) & -0x2000);
  318. value = value >> 11;
  319. break;
  320. case e_rrsel:
  321. /* RR: R with rounding of the addend to nearest 8k.
  322. We need to return a value such that 2048 * LR'x + RR'x == x
  323. ie. RR'x = s+a - (s + (((a + 0x1000) & -0x2000) & -0x800))
  324. . = s+a - ((s & -0x800) + ((a + 0x1000) & -0x2000))
  325. . = (s & 0x7ff) + a - ((a + 0x1000) & -0x2000) */
  326. value = (sym_val & 0x7ff) + (((addend & 0x1fff) ^ 0x1000) - 0x1000);
  327. break;
  328. default:
  329. abort ();
  330. }
  331. return value;
  332. }
  333. /* PA-RISC OPCODES */
  334. #define get_opcode(insn) (((insn) >> 26) & 0x3f)
  335. enum hppa_opcode_type
  336. {
  337. /* None of the opcodes in the first group generate relocs, so we
  338. aren't too concerned about them. */
  339. OP_SYSOP = 0x00,
  340. OP_MEMMNG = 0x01,
  341. OP_ALU = 0x02,
  342. OP_NDXMEM = 0x03,
  343. OP_SPOP = 0x04,
  344. OP_DIAG = 0x05,
  345. OP_FMPYADD = 0x06,
  346. OP_UNDEF07 = 0x07,
  347. OP_COPRW = 0x09,
  348. OP_COPRDW = 0x0b,
  349. OP_COPR = 0x0c,
  350. OP_FLOAT = 0x0e,
  351. OP_PRDSPEC = 0x0f,
  352. OP_UNDEF15 = 0x15,
  353. OP_UNDEF1d = 0x1d,
  354. OP_FMPYSUB = 0x26,
  355. OP_FPFUSED = 0x2e,
  356. OP_SHEXDP0 = 0x34,
  357. OP_SHEXDP1 = 0x35,
  358. OP_SHEXDP2 = 0x36,
  359. OP_UNDEF37 = 0x37,
  360. OP_SHEXDP3 = 0x3c,
  361. OP_SHEXDP4 = 0x3d,
  362. OP_MULTMED = 0x3e,
  363. OP_UNDEF3f = 0x3f,
  364. OP_LDIL = 0x08,
  365. OP_ADDIL = 0x0a,
  366. OP_LDO = 0x0d,
  367. OP_LDB = 0x10,
  368. OP_LDH = 0x11,
  369. OP_LDW = 0x12,
  370. OP_LDWM = 0x13,
  371. OP_STB = 0x18,
  372. OP_STH = 0x19,
  373. OP_STW = 0x1a,
  374. OP_STWM = 0x1b,
  375. OP_LDD = 0x14,
  376. OP_STD = 0x1c,
  377. OP_FLDW = 0x16,
  378. OP_LDWL = 0x17,
  379. OP_FSTW = 0x1e,
  380. OP_STWL = 0x1f,
  381. OP_COMBT = 0x20,
  382. OP_COMIBT = 0x21,
  383. OP_COMBF = 0x22,
  384. OP_COMIBF = 0x23,
  385. OP_CMPBDT = 0x27,
  386. OP_ADDBT = 0x28,
  387. OP_ADDIBT = 0x29,
  388. OP_ADDBF = 0x2a,
  389. OP_ADDIBF = 0x2b,
  390. OP_CMPBDF = 0x2f,
  391. OP_BVB = 0x30,
  392. OP_BB = 0x31,
  393. OP_MOVB = 0x32,
  394. OP_MOVIB = 0x33,
  395. OP_CMPIBD = 0x3b,
  396. OP_COMICLR = 0x24,
  397. OP_SUBI = 0x25,
  398. OP_ADDIT = 0x2c,
  399. OP_ADDI = 0x2d,
  400. OP_BE = 0x38,
  401. OP_BLE = 0x39,
  402. OP_BL = 0x3a
  403. };
  404. /* Insert VALUE into INSN using R_FORMAT to determine exactly what
  405. bits to change. */
  406. static inline int
  407. hppa_rebuild_insn (int insn, int value, int r_format)
  408. {
  409. switch (r_format)
  410. {
  411. case 11:
  412. return (insn & ~ 0x7ff) | low_sign_unext (value, 11);
  413. case 12:
  414. return (insn & ~ 0x1ffd) | re_assemble_12 (value);
  415. case 10:
  416. return (insn & ~ 0x3ff1) | re_assemble_14 (value & -8);
  417. case -11:
  418. return (insn & ~ 0x3ff9) | re_assemble_14 (value & -4);
  419. case 14:
  420. return (insn & ~ 0x3fff) | re_assemble_14 (value);
  421. case -10:
  422. return (insn & ~ 0xfff1) | re_assemble_16 (value & -8);
  423. case -16:
  424. return (insn & ~ 0xfff9) | re_assemble_16 (value & -4);
  425. case 16:
  426. return (insn & ~ 0xffff) | re_assemble_16 (value);
  427. case 17:
  428. return (insn & ~ 0x1f1ffd) | re_assemble_17 (value);
  429. case 21:
  430. return (insn & ~ 0x1fffff) | re_assemble_21 (value);
  431. case 22:
  432. return (insn & ~ 0x3ff1ffd) | re_assemble_22 (value);
  433. case 32:
  434. return value;
  435. default:
  436. abort ();
  437. }
  438. return insn;
  439. }
  440. #endif /* _LIBHPPA_H */
  441. /* Table of opcodes for the PA-RISC.
  442. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
  443. 2001, 2002, 2003, 2004, 2005
  444. Free Software Foundation, Inc.
  445. Contributed by the Center for Software Science at the
  446. University of Utah (pa-gdb-bugs@cs.utah.edu).
  447. This file is part of GAS, the GNU Assembler, and GDB, the GNU disassembler.
  448. GAS/GDB is free software; you can redistribute it and/or modify
  449. it under the terms of the GNU General Public License as published by
  450. the Free Software Foundation; either version 1, or (at your option)
  451. any later version.
  452. GAS/GDB is distributed in the hope that it will be useful,
  453. but WITHOUT ANY WARRANTY; without even the implied warranty of
  454. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  455. GNU General Public License for more details.
  456. You should have received a copy of the GNU General Public License
  457. along with GAS or GDB; see the file COPYING.
  458. If not, see <http://www.gnu.org/licenses/>. */
  459. #if !defined(__STDC__) && !defined(const)
  460. #define const
  461. #endif
  462. /*
  463. * Structure of an opcode table entry.
  464. */
  465. /* There are two kinds of delay slot nullification: normal which is
  466. * controled by the nullification bit, and conditional, which depends
  467. * on the direction of the branch and its success or failure.
  468. *
  469. * NONE is unfortunately #defined in the hiux system include files.
  470. * #undef it away.
  471. */
  472. #undef NONE
  473. struct pa_opcode
  474. {
  475. const char *name;
  476. unsigned long int match; /* Bits that must be set... */
  477. unsigned long int mask; /* ... in these bits. */
  478. const char *args;
  479. enum pa_arch arch;
  480. char flags;
  481. };
  482. /* Enables strict matching. Opcodes with match errors are skipped
  483. when this bit is set. */
  484. #define FLAG_STRICT 0x1
  485. /*
  486. All hppa opcodes are 32 bits.
  487. The match component is a mask saying which bits must match a
  488. particular opcode in order for an instruction to be an instance
  489. of that opcode.
  490. The args component is a string containing one character for each operand of
  491. the instruction. Characters used as a prefix allow any second character to
  492. be used without conflicting with the main operand characters.
  493. Bit positions in this description follow HP usage of lsb = 31,
  494. "at" is lsb of field.
  495. In the args field, the following characters must match exactly:
  496. '+,() '
  497. In the args field, the following characters are unused:
  498. ' " - / 34 6789:; '
  499. '@ C M [\] '
  500. '` e g } '
  501. Here are all the characters:
  502. ' !"#$%&'()*+-,./0123456789:;<=>?'
  503. '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_'
  504. '`abcdefghijklmnopqrstuvwxyz{|}~ '
  505. Kinds of operands:
  506. x integer register field at 15.
  507. b integer register field at 10.
  508. t integer register field at 31.
  509. a integer register field at 10 and 15 (for PERMH)
  510. 5 5 bit immediate at 15.
  511. s 2 bit space specifier at 17.
  512. S 3 bit space specifier at 18.
  513. V 5 bit immediate value at 31
  514. i 11 bit immediate value at 31
  515. j 14 bit immediate value at 31
  516. k 21 bit immediate value at 31
  517. l 16 bit immediate value at 31 (wide mode only, unusual encoding).
  518. n nullification for branch instructions
  519. N nullification for spop and copr instructions
  520. w 12 bit branch displacement
  521. W 17 bit branch displacement (PC relative)
  522. X 22 bit branch displacement (PC relative)
  523. z 17 bit branch displacement (just a number, not an address)
  524. Also these:
  525. . 2 bit shift amount at 25
  526. * 4 bit shift amount at 25
  527. p 5 bit shift count at 26 (to support the SHD instruction) encoded as
  528. 31-p
  529. ~ 6 bit shift count at 20,22:26 encoded as 63-~.
  530. P 5 bit bit position at 26
  531. q 6 bit bit position at 20,22:26
  532. T 5 bit field length at 31 (encoded as 32-T)
  533. % 6 bit field length at 23,27:31 (variable extract/deposit)
  534. | 6 bit field length at 19,27:31 (fixed extract/deposit)
  535. A 13 bit immediate at 18 (to support the BREAK instruction)
  536. ^ like b, but describes a control register
  537. ! sar (cr11) register
  538. D 26 bit immediate at 31 (to support the DIAG instruction)
  539. $ 9 bit immediate at 28 (to support POPBTS)
  540. v 3 bit Special Function Unit identifier at 25
  541. O 20 bit Special Function Unit operation split between 15 bits at 20
  542. and 5 bits at 31
  543. o 15 bit Special Function Unit operation at 20
  544. 2 22 bit Special Function Unit operation split between 17 bits at 20
  545. and 5 bits at 31
  546. 1 15 bit Special Function Unit operation split between 10 bits at 20
  547. and 5 bits at 31
  548. 0 10 bit Special Function Unit operation split between 5 bits at 20
  549. and 5 bits at 31
  550. u 3 bit coprocessor unit identifier at 25
  551. F Source Floating Point Operand Format Completer encoded 2 bits at 20
  552. I Source Floating Point Operand Format Completer encoded 1 bits at 20
  553. (for 0xe format FP instructions)
  554. G Destination Floating Point Operand Format Completer encoded 2 bits at 18
  555. H Floating Point Operand Format at 26 for 'fmpyadd' and 'fmpysub'
  556. (very similar to 'F')
  557. r 5 bit immediate value at 31 (for the break instruction)
  558. (very similar to V above, except the value is unsigned instead of
  559. low_sign_ext)
  560. R 5 bit immediate value at 15 (for the ssm, rsm, probei instructions)
  561. (same as r above, except the value is in a different location)
  562. U 10 bit immediate value at 15 (for SSM, RSM on pa2.0)
  563. Q 5 bit immediate value at 10 (a bit position specified in
  564. the bb instruction. It's the same as r above, except the
  565. value is in a different location)
  566. B 5 bit immediate value at 10 (a bit position specified in
  567. the bb instruction. Similar to Q, but 64 bit handling is
  568. different.
  569. Z %r1 -- implicit target of addil instruction.
  570. L ,%r2 completer for new syntax branch
  571. { Source format completer for fcnv
  572. _ Destination format completer for fcnv
  573. h cbit for fcmp
  574. = gfx tests for ftest
  575. d 14 bit offset for single precision FP long load/store.
  576. # 14 bit offset for double precision FP load long/store.
  577. J Yet another 14 bit offset for load/store with ma,mb completers.
  578. K Yet another 14 bit offset for load/store with ma,mb completers.
  579. y 16 bit offset for word aligned load/store (PA2.0 wide).
  580. & 16 bit offset for dword aligned load/store (PA2.0 wide).
  581. < 16 bit offset for load/store with ma,mb completers (PA2.0 wide).
  582. > 16 bit offset for load/store with ma,mb completers (PA2.0 wide).
  583. Y %sr0,%r31 -- implicit target of be,l instruction.
  584. @ implicit immediate value of 0
  585. Completer operands all have 'c' as the prefix:
  586. cx indexed load and store completer.
  587. cX indexed load and store completer. Like cx, but emits a space
  588. after in disassembler.
  589. cm short load and store completer.
  590. cM short load and store completer. Like cm, but emits a space
  591. after in disassembler.
  592. cq long load and store completer (like cm, but inserted into a
  593. different location in the target instruction).
  594. cs store bytes short completer.
  595. cA store bytes short completer. Like cs, but emits a space
  596. after in disassembler.
  597. ce long load/store completer for LDW/STW with a different encoding
  598. than the others
  599. cc load cache control hint
  600. cd load and clear cache control hint
  601. cC store cache control hint
  602. co ordered access
  603. cp branch link and push completer
  604. cP branch pop completer
  605. cl branch link completer
  606. cg branch gate completer
  607. cw read/write completer for PROBE
  608. cW wide completer for MFCTL
  609. cL local processor completer for cache control
  610. cZ System Control Completer (to support LPA, LHA, etc.)
  611. ci correction completer for DCOR
  612. ca add completer
  613. cy 32 bit add carry completer
  614. cY 64 bit add carry completer
  615. cv signed overflow trap completer
  616. ct trap on condition completer for ADDI, SUB
  617. cT trap on condition completer for UADDCM
  618. cb 32 bit borrow completer for SUB
  619. cB 64 bit borrow completer for SUB
  620. ch left/right half completer
  621. cH signed/unsigned saturation completer
  622. cS signed/unsigned completer at 21
  623. cz zero/sign extension completer.
  624. c* permutation completer
  625. Condition operands all have '?' as the prefix:
  626. ?f Floating point compare conditions (encoded as 5 bits at 31)
  627. ?a add conditions
  628. ?A 64 bit add conditions
  629. ?@ add branch conditions followed by nullify
  630. ?d non-negated add branch conditions
  631. ?D negated add branch conditions
  632. ?w wide mode non-negated add branch conditions
  633. ?W wide mode negated add branch conditions
  634. ?s compare/subtract conditions
  635. ?S 64 bit compare/subtract conditions
  636. ?t non-negated compare and branch conditions
  637. ?n 32 bit compare and branch conditions followed by nullify
  638. ?N 64 bit compare and branch conditions followed by nullify
  639. ?Q 64 bit compare and branch conditions for CMPIB instruction
  640. ?l logical conditions
  641. ?L 64 bit logical conditions
  642. ?b branch on bit conditions
  643. ?B 64 bit branch on bit conditions
  644. ?x shift/extract/deposit conditions
  645. ?X 64 bit shift/extract/deposit conditions
  646. ?y shift/extract/deposit conditions followed by nullify for conditional
  647. branches
  648. ?u unit conditions
  649. ?U 64 bit unit conditions
  650. Floating point registers all have 'f' as a prefix:
  651. ft target register at 31
  652. fT target register with L/R halves at 31
  653. fa operand 1 register at 10
  654. fA operand 1 register with L/R halves at 10
  655. fX Same as fA, except prints a space before register during disasm
  656. fb operand 2 register at 15
  657. fB operand 2 register with L/R halves at 15
  658. fC operand 3 register with L/R halves at 16:18,21:23
  659. fe Like fT, but encoding is different.
  660. fE Same as fe, except prints a space before register during disasm.
  661. fx target register at 15 (only for PA 2.0 long format FLDD/FSTD).
  662. Float registers for fmpyadd and fmpysub:
  663. fi mult operand 1 register at 10
  664. fj mult operand 2 register at 15
  665. fk mult target register at 20
  666. fl add/sub operand register at 25
  667. fm add/sub target register at 31
  668. */
  669. #if 0
  670. /* List of characters not to put a space after. Note that
  671. "," is included, as the "spopN" operations use literal
  672. commas in their completer sections. */
  673. static const char *const completer_chars = ",CcY<>?!@+&U~FfGHINnOoZMadu|/=0123%e$m}";
  674. #endif
  675. /* The order of the opcodes in this table is significant:
  676. * The assembler requires that all instances of the same mnemonic be
  677. consecutive. If they aren't, the assembler will bomb at runtime.
  678. * Immediate fields use pa_get_absolute_expression to parse the
  679. string. It will generate a "bad expression" error if passed
  680. a register name. Thus, register index variants of an opcode
  681. need to precede immediate variants.
  682. * The disassembler does not care about the order of the opcodes
  683. except in cases where implicit addressing is used.
  684. Here are the rules for ordering the opcodes of a mnemonic:
  685. 1) Opcodes with FLAG_STRICT should precede opcodes without
  686. FLAG_STRICT.
  687. 2) Opcodes with FLAG_STRICT should be ordered as follows:
  688. register index opcodes, short immediate opcodes, and finally
  689. long immediate opcodes. When both pa10 and pa11 variants
  690. of the same opcode are available, the pa10 opcode should
  691. come first for correct architectural promotion.
  692. 3) When implicit addressing is available for an opcode, the
  693. implicit opcode should precede the explicit opcode.
  694. 4) Opcodes without FLAG_STRICT should be ordered as follows:
  695. register index opcodes, long immediate opcodes, and finally
  696. short immediate opcodes. */
  697. static const struct pa_opcode pa_opcodes[] =
  698. {
  699. /* Pseudo-instructions. */
  700. { "ldi", 0x34000000, 0xffe00000, "l,x", pa20w, 0},/* ldo val(r0),r */
  701. { "ldi", 0x34000000, 0xffe0c000, "j,x", pa10, 0},/* ldo val(r0),r */
  702. { "cmpib", 0xec000000, 0xfc000000, "?Qn5,b,w", pa20, FLAG_STRICT},
  703. { "cmpib", 0x84000000, 0xf4000000, "?nn5,b,w", pa10, FLAG_STRICT},
  704. { "comib", 0x84000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
  705. /* This entry is for the disassembler only. It will never be used by
  706. assembler. */
  707. { "comib", 0x8c000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
  708. { "cmpb", 0x9c000000, 0xdc000000, "?Nnx,b,w", pa20, FLAG_STRICT},
  709. { "cmpb", 0x80000000, 0xf4000000, "?nnx,b,w", pa10, FLAG_STRICT},
  710. { "comb", 0x80000000, 0xfc000000, "?nnx,b,w", pa10, 0}, /* comb{tf} */
  711. /* This entry is for the disassembler only. It will never be used by
  712. assembler. */
  713. { "comb", 0x88000000, 0xfc000000, "?nnx,b,w", pa10, 0}, /* comb{tf} */
  714. { "addb", 0xa0000000, 0xf4000000, "?Wnx,b,w", pa20w, FLAG_STRICT},
  715. { "addb", 0xa0000000, 0xfc000000, "?@nx,b,w", pa10, 0}, /* addb{tf} */
  716. /* This entry is for the disassembler only. It will never be used by
  717. assembler. */
  718. { "addb", 0xa8000000, 0xfc000000, "?@nx,b,w", pa10, 0},
  719. { "addib", 0xa4000000, 0xf4000000, "?Wn5,b,w", pa20w, FLAG_STRICT},
  720. { "addib", 0xa4000000, 0xfc000000, "?@n5,b,w", pa10, 0}, /* addib{tf}*/
  721. /* This entry is for the disassembler only. It will never be used by
  722. assembler. */
  723. { "addib", 0xac000000, 0xfc000000, "?@n5,b,w", pa10, 0}, /* addib{tf}*/
  724. { "nop", 0x08000240, 0xffffffff, "", pa10, 0}, /* or 0,0,0 */
  725. { "copy", 0x08000240, 0xffe0ffe0, "x,t", pa10, 0}, /* or r,0,t */
  726. { "mtsar", 0x01601840, 0xffe0ffff, "x", pa10, 0}, /* mtctl r,cr11 */
  727. /* Loads and Stores for integer registers. */
  728. { "ldd", 0x0c0000c0, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
  729. { "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(s,b),t", pa20, FLAG_STRICT},
  730. { "ldd", 0x0c0010e0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
  731. { "ldd", 0x0c0010e0, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
  732. { "ldd", 0x0c0010c0, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
  733. { "ldd", 0x0c0010c0, 0xfc0013c0, "cmcc5(s,b),t", pa20, FLAG_STRICT},
  734. { "ldd", 0x50000000, 0xfc000002, "cq&(b),x", pa20w, FLAG_STRICT},
  735. { "ldd", 0x50000000, 0xfc00c002, "cq#(b),x", pa20, FLAG_STRICT},
  736. { "ldd", 0x50000000, 0xfc000002, "cq#(s,b),x", pa20, FLAG_STRICT},
  737. { "ldw", 0x0c000080, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  738. { "ldw", 0x0c000080, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  739. { "ldw", 0x0c000080, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  740. { "ldw", 0x0c000080, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT},
  741. { "ldw", 0x0c0010a0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
  742. { "ldw", 0x0c0010a0, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
  743. { "ldw", 0x0c001080, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  744. { "ldw", 0x0c001080, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  745. { "ldw", 0x0c001080, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  746. { "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT},
  747. { "ldw", 0x4c000000, 0xfc000000, "ce<(b),x", pa20w, FLAG_STRICT},
  748. { "ldw", 0x5c000004, 0xfc000006, "ce>(b),x", pa20w, FLAG_STRICT},
  749. { "ldw", 0x48000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT},
  750. { "ldw", 0x5c000004, 0xfc00c006, "ceK(b),x", pa20, FLAG_STRICT},
  751. { "ldw", 0x5c000004, 0xfc000006, "ceK(s,b),x", pa20, FLAG_STRICT},
  752. { "ldw", 0x4c000000, 0xfc00c000, "ceJ(b),x", pa10, FLAG_STRICT},
  753. { "ldw", 0x4c000000, 0xfc000000, "ceJ(s,b),x", pa10, FLAG_STRICT},
  754. { "ldw", 0x48000000, 0xfc00c000, "j(b),x", pa10, 0},
  755. { "ldw", 0x48000000, 0xfc000000, "j(s,b),x", pa10, 0},
  756. { "ldh", 0x0c000040, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  757. { "ldh", 0x0c000040, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  758. { "ldh", 0x0c000040, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  759. { "ldh", 0x0c000040, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT},
  760. { "ldh", 0x0c001060, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
  761. { "ldh", 0x0c001060, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
  762. { "ldh", 0x0c001040, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  763. { "ldh", 0x0c001040, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  764. { "ldh", 0x0c001040, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  765. { "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT},
  766. { "ldh", 0x44000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT},
  767. { "ldh", 0x44000000, 0xfc00c000, "j(b),x", pa10, 0},
  768. { "ldh", 0x44000000, 0xfc000000, "j(s,b),x", pa10, 0},
  769. { "ldb", 0x0c000000, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  770. { "ldb", 0x0c000000, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  771. { "ldb", 0x0c000000, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  772. { "ldb", 0x0c000000, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT},
  773. { "ldb", 0x0c001020, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
  774. { "ldb", 0x0c001020, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
  775. { "ldb", 0x0c001000, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  776. { "ldb", 0x0c001000, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  777. { "ldb", 0x0c001000, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  778. { "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT},
  779. { "ldb", 0x40000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT},
  780. { "ldb", 0x40000000, 0xfc00c000, "j(b),x", pa10, 0},
  781. { "ldb", 0x40000000, 0xfc000000, "j(s,b),x", pa10, 0},
  782. { "std", 0x0c0012e0, 0xfc00f3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
  783. { "std", 0x0c0012e0, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
  784. { "std", 0x0c0012c0, 0xfc00d3c0, "cmcCx,V(b)", pa20, FLAG_STRICT},
  785. { "std", 0x0c0012c0, 0xfc0013c0, "cmcCx,V(s,b)", pa20, FLAG_STRICT},
  786. { "std", 0x70000000, 0xfc000002, "cqx,&(b)", pa20w, FLAG_STRICT},
  787. { "std", 0x70000000, 0xfc00c002, "cqx,#(b)", pa20, FLAG_STRICT},
  788. { "std", 0x70000000, 0xfc000002, "cqx,#(s,b)", pa20, FLAG_STRICT},
  789. { "stw", 0x0c0012a0, 0xfc00f3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
  790. { "stw", 0x0c0012a0, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
  791. { "stw", 0x0c001280, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  792. { "stw", 0x0c001280, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT},
  793. { "stw", 0x0c001280, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  794. { "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT},
  795. { "stw", 0x6c000000, 0xfc000000, "cex,<(b)", pa20w, FLAG_STRICT},
  796. { "stw", 0x7c000004, 0xfc000006, "cex,>(b)", pa20w, FLAG_STRICT},
  797. { "stw", 0x68000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT},
  798. { "stw", 0x7c000004, 0xfc00c006, "cex,K(b)", pa20, FLAG_STRICT},
  799. { "stw", 0x7c000004, 0xfc000006, "cex,K(s,b)", pa20, FLAG_STRICT},
  800. { "stw", 0x6c000000, 0xfc00c000, "cex,J(b)", pa10, FLAG_STRICT},
  801. { "stw", 0x6c000000, 0xfc000000, "cex,J(s,b)", pa10, FLAG_STRICT},
  802. { "stw", 0x68000000, 0xfc00c000, "x,j(b)", pa10, 0},
  803. { "stw", 0x68000000, 0xfc000000, "x,j(s,b)", pa10, 0},
  804. { "sth", 0x0c001260, 0xfc00f3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
  805. { "sth", 0x0c001260, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
  806. { "sth", 0x0c001240, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  807. { "sth", 0x0c001240, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT},
  808. { "sth", 0x0c001240, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  809. { "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT},
  810. { "sth", 0x64000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT},
  811. { "sth", 0x64000000, 0xfc00c000, "x,j(b)", pa10, 0},
  812. { "sth", 0x64000000, 0xfc000000, "x,j(s,b)", pa10, 0},
  813. { "stb", 0x0c001220, 0xfc00f3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
  814. { "stb", 0x0c001220, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
  815. { "stb", 0x0c001200, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  816. { "stb", 0x0c001200, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT},
  817. { "stb", 0x0c001200, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  818. { "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT},
  819. { "stb", 0x60000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT},
  820. { "stb", 0x60000000, 0xfc00c000, "x,j(b)", pa10, 0},
  821. { "stb", 0x60000000, 0xfc000000, "x,j(s,b)", pa10, 0},
  822. { "ldwm", 0x4c000000, 0xfc00c000, "j(b),x", pa10, 0},
  823. { "ldwm", 0x4c000000, 0xfc000000, "j(s,b),x", pa10, 0},
  824. { "stwm", 0x6c000000, 0xfc00c000, "x,j(b)", pa10, 0},
  825. { "stwm", 0x6c000000, 0xfc000000, "x,j(s,b)", pa10, 0},
  826. { "ldwx", 0x0c000080, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  827. { "ldwx", 0x0c000080, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  828. { "ldwx", 0x0c000080, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  829. { "ldwx", 0x0c000080, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT},
  830. { "ldwx", 0x0c000080, 0xfc00dfc0, "cXx(b),t", pa10, 0},
  831. { "ldwx", 0x0c000080, 0xfc001fc0, "cXx(s,b),t", pa10, 0},
  832. { "ldhx", 0x0c000040, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  833. { "ldhx", 0x0c000040, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  834. { "ldhx", 0x0c000040, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  835. { "ldhx", 0x0c000040, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT},
  836. { "ldhx", 0x0c000040, 0xfc00dfc0, "cXx(b),t", pa10, 0},
  837. { "ldhx", 0x0c000040, 0xfc001fc0, "cXx(s,b),t", pa10, 0},
  838. { "ldbx", 0x0c000000, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  839. { "ldbx", 0x0c000000, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  840. { "ldbx", 0x0c000000, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  841. { "ldbx", 0x0c000000, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT},
  842. { "ldbx", 0x0c000000, 0xfc00dfc0, "cXx(b),t", pa10, 0},
  843. { "ldbx", 0x0c000000, 0xfc001fc0, "cXx(s,b),t", pa10, 0},
  844. { "ldwa", 0x0c000180, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  845. { "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  846. { "ldwa", 0x0c0011a0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
  847. { "ldwa", 0x0c001180, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  848. { "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  849. { "ldcw", 0x0c0001c0, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  850. { "ldcw", 0x0c0001c0, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  851. { "ldcw", 0x0c0001c0, 0xfc00d3c0, "cxcdx(b),t", pa11, FLAG_STRICT},
  852. { "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa11, FLAG_STRICT},
  853. { "ldcw", 0x0c0011c0, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  854. { "ldcw", 0x0c0011c0, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  855. { "ldcw", 0x0c0011c0, 0xfc00d3c0, "cmcd5(b),t", pa11, FLAG_STRICT},
  856. { "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa11, FLAG_STRICT},
  857. { "stwa", 0x0c0013a0, 0xfc00d3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
  858. { "stwa", 0x0c001380, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  859. { "stwa", 0x0c001380, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  860. { "stby", 0x0c001300, 0xfc00dfc0, "cAx,V(b)", pa10, FLAG_STRICT},
  861. { "stby", 0x0c001300, 0xfc001fc0, "cAx,V(s,b)", pa10, FLAG_STRICT},
  862. { "stby", 0x0c001300, 0xfc00d3c0, "cscCx,V(b)", pa11, FLAG_STRICT},
  863. { "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(s,b)", pa11, FLAG_STRICT},
  864. { "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
  865. { "ldda", 0x0c001120, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
  866. { "ldda", 0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
  867. { "ldcd", 0x0c000140, 0xfc00d3c0, "cxcdx(b),t", pa20, FLAG_STRICT},
  868. { "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT},
  869. { "ldcd", 0x0c001140, 0xfc00d3c0, "cmcd5(b),t", pa20, FLAG_STRICT},
  870. { "ldcd", 0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT},
  871. { "stda", 0x0c0013e0, 0xfc00f3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
  872. { "stda", 0x0c0013c0, 0xfc00d3c0, "cmcCx,V(b)", pa20, FLAG_STRICT},
  873. { "ldwax", 0x0c000180, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  874. { "ldwax", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT},
  875. { "ldwax", 0x0c000180, 0xfc00dfc0, "cXx(b),t", pa10, 0},
  876. { "ldcwx", 0x0c0001c0, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT},
  877. { "ldcwx", 0x0c0001c0, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT},
  878. { "ldcwx", 0x0c0001c0, 0xfc00d3c0, "cxcdx(b),t", pa11, FLAG_STRICT},
  879. { "ldcwx", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa11, FLAG_STRICT},
  880. { "ldcwx", 0x0c0001c0, 0xfc00dfc0, "cXx(b),t", pa10, 0},
  881. { "ldcwx", 0x0c0001c0, 0xfc001fc0, "cXx(s,b),t", pa10, 0},
  882. { "ldws", 0x0c001080, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  883. { "ldws", 0x0c001080, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  884. { "ldws", 0x0c001080, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  885. { "ldws", 0x0c001080, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT},
  886. { "ldws", 0x0c001080, 0xfc00dfc0, "cM5(b),t", pa10, 0},
  887. { "ldws", 0x0c001080, 0xfc001fc0, "cM5(s,b),t", pa10, 0},
  888. { "ldhs", 0x0c001040, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  889. { "ldhs", 0x0c001040, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  890. { "ldhs", 0x0c001040, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  891. { "ldhs", 0x0c001040, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT},
  892. { "ldhs", 0x0c001040, 0xfc00dfc0, "cM5(b),t", pa10, 0},
  893. { "ldhs", 0x0c001040, 0xfc001fc0, "cM5(s,b),t", pa10, 0},
  894. { "ldbs", 0x0c001000, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  895. { "ldbs", 0x0c001000, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  896. { "ldbs", 0x0c001000, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  897. { "ldbs", 0x0c001000, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT},
  898. { "ldbs", 0x0c001000, 0xfc00dfc0, "cM5(b),t", pa10, 0},
  899. { "ldbs", 0x0c001000, 0xfc001fc0, "cM5(s,b),t", pa10, 0},
  900. { "ldwas", 0x0c001180, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  901. { "ldwas", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT},
  902. { "ldwas", 0x0c001180, 0xfc00dfc0, "cM5(b),t", pa10, 0},
  903. { "ldcws", 0x0c0011c0, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT},
  904. { "ldcws", 0x0c0011c0, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT},
  905. { "ldcws", 0x0c0011c0, 0xfc00d3c0, "cmcd5(b),t", pa11, FLAG_STRICT},
  906. { "ldcws", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa11, FLAG_STRICT},
  907. { "ldcws", 0x0c0011c0, 0xfc00dfc0, "cM5(b),t", pa10, 0},
  908. { "ldcws", 0x0c0011c0, 0xfc001fc0, "cM5(s,b),t", pa10, 0},
  909. { "stws", 0x0c001280, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  910. { "stws", 0x0c001280, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT},
  911. { "stws", 0x0c001280, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  912. { "stws", 0x0c001280, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT},
  913. { "stws", 0x0c001280, 0xfc00dfc0, "cMx,V(b)", pa10, 0},
  914. { "stws", 0x0c001280, 0xfc001fc0, "cMx,V(s,b)", pa10, 0},
  915. { "sths", 0x0c001240, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  916. { "sths", 0x0c001240, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT},
  917. { "sths", 0x0c001240, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  918. { "sths", 0x0c001240, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT},
  919. { "sths", 0x0c001240, 0xfc00dfc0, "cMx,V(b)", pa10, 0},
  920. { "sths", 0x0c001240, 0xfc001fc0, "cMx,V(s,b)", pa10, 0},
  921. { "stbs", 0x0c001200, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  922. { "stbs", 0x0c001200, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT},
  923. { "stbs", 0x0c001200, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  924. { "stbs", 0x0c001200, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT},
  925. { "stbs", 0x0c001200, 0xfc00dfc0, "cMx,V(b)", pa10, 0},
  926. { "stbs", 0x0c001200, 0xfc001fc0, "cMx,V(s,b)", pa10, 0},
  927. { "stwas", 0x0c001380, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT},
  928. { "stwas", 0x0c001380, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT},
  929. { "stwas", 0x0c001380, 0xfc00dfc0, "cMx,V(b)", pa10, 0},
  930. { "stdby", 0x0c001340, 0xfc00d3c0, "cscCx,V(b)", pa20, FLAG_STRICT},
  931. { "stdby", 0x0c001340, 0xfc0013c0, "cscCx,V(s,b)", pa20, FLAG_STRICT},
  932. { "stbys", 0x0c001300, 0xfc00dfc0, "cAx,V(b)", pa10, FLAG_STRICT},
  933. { "stbys", 0x0c001300, 0xfc001fc0, "cAx,V(s,b)", pa10, FLAG_STRICT},
  934. { "stbys", 0x0c001300, 0xfc00d3c0, "cscCx,V(b)", pa11, FLAG_STRICT},
  935. { "stbys", 0x0c001300, 0xfc0013c0, "cscCx,V(s,b)", pa11, FLAG_STRICT},
  936. { "stbys", 0x0c001300, 0xfc00dfc0, "cAx,V(b)", pa10, 0},
  937. { "stbys", 0x0c001300, 0xfc001fc0, "cAx,V(s,b)", pa10, 0},
  938. /* Immediate instructions. */
  939. { "ldo", 0x34000000, 0xfc000000, "l(b),x", pa20w, 0},
  940. { "ldo", 0x34000000, 0xfc00c000, "j(b),x", pa10, 0},
  941. { "ldil", 0x20000000, 0xfc000000, "k,b", pa10, 0},
  942. { "addil", 0x28000000, 0xfc000000, "k,b,Z", pa10, 0},
  943. { "addil", 0x28000000, 0xfc000000, "k,b", pa10, 0},
  944. /* Branching instructions. */
  945. { "b", 0xe8008000, 0xfc00e000, "cpnXL", pa20, FLAG_STRICT},
  946. { "b", 0xe800a000, 0xfc00e000, "clnXL", pa20, FLAG_STRICT},
  947. { "b", 0xe8000000, 0xfc00e000, "clnW,b", pa10, FLAG_STRICT},
  948. { "b", 0xe8002000, 0xfc00e000, "cgnW,b", pa10, FLAG_STRICT},
  949. { "b", 0xe8000000, 0xffe0e000, "nW", pa10, 0}, /* b,l foo,r0 */
  950. { "bl", 0xe8000000, 0xfc00e000, "nW,b", pa10, 0},
  951. { "gate", 0xe8002000, 0xfc00e000, "nW,b", pa10, 0},
  952. { "blr", 0xe8004000, 0xfc00e001, "nx,b", pa10, 0},
  953. { "bv", 0xe800c000, 0xfc00fffd, "nx(b)", pa10, 0},
  954. { "bv", 0xe800c000, 0xfc00fffd, "n(b)", pa10, 0},
  955. { "bve", 0xe800f001, 0xfc1ffffd, "cpn(b)L", pa20, FLAG_STRICT},
  956. { "bve", 0xe800f000, 0xfc1ffffd, "cln(b)L", pa20, FLAG_STRICT},
  957. { "bve", 0xe800d001, 0xfc1ffffd, "cPn(b)", pa20, FLAG_STRICT},
  958. { "bve", 0xe800d000, 0xfc1ffffd, "n(b)", pa20, FLAG_STRICT},
  959. { "be", 0xe4000000, 0xfc000000, "clnz(S,b),Y", pa10, FLAG_STRICT},
  960. { "be", 0xe4000000, 0xfc000000, "clnz(b),Y", pa10, FLAG_STRICT},
  961. { "be", 0xe0000000, 0xfc000000, "nz(S,b)", pa10, 0},
  962. { "be", 0xe0000000, 0xfc000000, "nz(b)", pa10, 0},
  963. { "ble", 0xe4000000, 0xfc000000, "nz(S,b)", pa10, 0},
  964. { "movb", 0xc8000000, 0xfc000000, "?ynx,b,w", pa10, 0},
  965. { "movib", 0xcc000000, 0xfc000000, "?yn5,b,w", pa10, 0},
  966. { "combt", 0x80000000, 0xfc000000, "?tnx,b,w", pa10, 0},
  967. { "combf", 0x88000000, 0xfc000000, "?tnx,b,w", pa10, 0},
  968. { "comibt", 0x84000000, 0xfc000000, "?tn5,b,w", pa10, 0},
  969. { "comibf", 0x8c000000, 0xfc000000, "?tn5,b,w", pa10, 0},
  970. { "addbt", 0xa0000000, 0xfc000000, "?dnx,b,w", pa10, 0},
  971. { "addbf", 0xa8000000, 0xfc000000, "?dnx,b,w", pa10, 0},
  972. { "addibt", 0xa4000000, 0xfc000000, "?dn5,b,w", pa10, 0},
  973. { "addibf", 0xac000000, 0xfc000000, "?dn5,b,w", pa10, 0},
  974. { "bb", 0xc0004000, 0xffe06000, "?bnx,!,w", pa10, FLAG_STRICT},
  975. { "bb", 0xc0006000, 0xffe06000, "?Bnx,!,w", pa20, FLAG_STRICT},
  976. { "bb", 0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, FLAG_STRICT},
  977. { "bb", 0xc4004000, 0xfc004000, "?Bnx,B,w", pa20, FLAG_STRICT},
  978. { "bvb", 0xc0004000, 0xffe04000, "?bnx,w", pa10, 0},
  979. { "clrbts", 0xe8004005, 0xffffffff, "", pa20, FLAG_STRICT},
  980. { "popbts", 0xe8004005, 0xfffff007, "$", pa20, FLAG_STRICT},
  981. { "pushnom", 0xe8004001, 0xffffffff, "", pa20, FLAG_STRICT},
  982. { "pushbts", 0xe8004001, 0xffe0ffff, "x", pa20, FLAG_STRICT},
  983. /* Computation Instructions. */
  984. { "cmpclr", 0x080008a0, 0xfc000fe0, "?Sx,b,t", pa20, FLAG_STRICT},
  985. { "cmpclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, FLAG_STRICT},
  986. { "comclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, 0},
  987. { "or", 0x08000260, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
  988. { "or", 0x08000240, 0xfc000fe0, "?lx,b,t", pa10, 0},
  989. { "xor", 0x080002a0, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
  990. { "xor", 0x08000280, 0xfc000fe0, "?lx,b,t", pa10, 0},
  991. { "and", 0x08000220, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
  992. { "and", 0x08000200, 0xfc000fe0, "?lx,b,t", pa10, 0},
  993. { "andcm", 0x08000020, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
  994. { "andcm", 0x08000000, 0xfc000fe0, "?lx,b,t", pa10, 0},
  995. { "uxor", 0x080003a0, 0xfc000fe0, "?Ux,b,t", pa20, FLAG_STRICT},
  996. { "uxor", 0x08000380, 0xfc000fe0, "?ux,b,t", pa10, 0},
  997. { "uaddcm", 0x080009a0, 0xfc000fa0, "cT?Ux,b,t", pa20, FLAG_STRICT},
  998. { "uaddcm", 0x08000980, 0xfc000fa0, "cT?ux,b,t", pa10, FLAG_STRICT},
  999. { "uaddcm", 0x08000980, 0xfc000fe0, "?ux,b,t", pa10, 0},
  1000. { "uaddcmt", 0x080009c0, 0xfc000fe0, "?ux,b,t", pa10, 0},
  1001. { "dcor", 0x08000ba0, 0xfc1f0fa0, "ci?Ub,t", pa20, FLAG_STRICT},
  1002. { "dcor", 0x08000b80, 0xfc1f0fa0, "ci?ub,t", pa10, FLAG_STRICT},
  1003. { "dcor", 0x08000b80, 0xfc1f0fe0, "?ub,t", pa10, 0},
  1004. { "idcor", 0x08000bc0, 0xfc1f0fe0, "?ub,t", pa10, 0},
  1005. { "addi", 0xb0000000, 0xfc000000, "ct?ai,b,x", pa10, FLAG_STRICT},
  1006. { "addi", 0xb4000000, 0xfc000000, "cv?ai,b,x", pa10, FLAG_STRICT},
  1007. { "addi", 0xb4000000, 0xfc000800, "?ai,b,x", pa10, 0},
  1008. { "addio", 0xb4000800, 0xfc000800, "?ai,b,x", pa10, 0},
  1009. { "addit", 0xb0000000, 0xfc000800, "?ai,b,x", pa10, 0},
  1010. { "addito", 0xb0000800, 0xfc000800, "?ai,b,x", pa10, 0},
  1011. { "add", 0x08000720, 0xfc0007e0, "cY?Ax,b,t", pa20, FLAG_STRICT},
  1012. { "add", 0x08000700, 0xfc0007e0, "cy?ax,b,t", pa10, FLAG_STRICT},
  1013. { "add", 0x08000220, 0xfc0003e0, "ca?Ax,b,t", pa20, FLAG_STRICT},
  1014. { "add", 0x08000200, 0xfc0003e0, "ca?ax,b,t", pa10, FLAG_STRICT},
  1015. { "add", 0x08000600, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1016. { "addl", 0x08000a00, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1017. { "addo", 0x08000e00, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1018. { "addc", 0x08000700, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1019. { "addco", 0x08000f00, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1020. { "sub", 0x080004e0, 0xfc0007e0, "ct?Sx,b,t", pa20, FLAG_STRICT},
  1021. { "sub", 0x080004c0, 0xfc0007e0, "ct?sx,b,t", pa10, FLAG_STRICT},
  1022. { "sub", 0x08000520, 0xfc0007e0, "cB?Sx,b,t", pa20, FLAG_STRICT},
  1023. { "sub", 0x08000500, 0xfc0007e0, "cb?sx,b,t", pa10, FLAG_STRICT},
  1024. { "sub", 0x08000420, 0xfc0007e0, "cv?Sx,b,t", pa20, FLAG_STRICT},
  1025. { "sub", 0x08000400, 0xfc0007e0, "cv?sx,b,t", pa10, FLAG_STRICT},
  1026. { "sub", 0x08000400, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1027. { "subo", 0x08000c00, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1028. { "subb", 0x08000500, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1029. { "subbo", 0x08000d00, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1030. { "subt", 0x080004c0, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1031. { "subto", 0x08000cc0, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1032. { "ds", 0x08000440, 0xfc000fe0, "?sx,b,t", pa10, 0},
  1033. { "subi", 0x94000000, 0xfc000000, "cv?si,b,x", pa10, FLAG_STRICT},
  1034. { "subi", 0x94000000, 0xfc000800, "?si,b,x", pa10, 0},
  1035. { "subio", 0x94000800, 0xfc000800, "?si,b,x", pa10, 0},
  1036. { "cmpiclr", 0x90000800, 0xfc000800, "?Si,b,x", pa20, FLAG_STRICT},
  1037. { "cmpiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, FLAG_STRICT},
  1038. { "comiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, 0},
  1039. { "shladd", 0x08000220, 0xfc000320, "ca?Ax,.,b,t", pa20, FLAG_STRICT},
  1040. { "shladd", 0x08000200, 0xfc000320, "ca?ax,.,b,t", pa10, FLAG_STRICT},
  1041. { "sh1add", 0x08000640, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1042. { "sh1addl", 0x08000a40, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1043. { "sh1addo", 0x08000e40, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1044. { "sh2add", 0x08000680, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1045. { "sh2addl", 0x08000a80, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1046. { "sh2addo", 0x08000e80, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1047. { "sh3add", 0x080006c0, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1048. { "sh3addl", 0x08000ac0, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1049. { "sh3addo", 0x08000ec0, 0xfc000fe0, "?ax,b,t", pa10, 0},
  1050. /* Subword Operation Instructions. */
  1051. { "hadd", 0x08000300, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT},
  1052. { "havg", 0x080002c0, 0xfc00ffe0, "x,b,t", pa20, FLAG_STRICT},
  1053. { "hshl", 0xf8008800, 0xffe0fc20, "x,*,t", pa20, FLAG_STRICT},
  1054. { "hshladd", 0x08000700, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT},
  1055. { "hshr", 0xf800c800, 0xfc1ff820, "cSb,*,t", pa20, FLAG_STRICT},
  1056. { "hshradd", 0x08000500, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT},
  1057. { "hsub", 0x08000100, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT},
  1058. { "mixh", 0xf8008400, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT},
  1059. { "mixw", 0xf8008000, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT},
  1060. { "permh", 0xf8000000, 0xfc009020, "c*a,t", pa20, FLAG_STRICT},
  1061. /* Extract and Deposit Instructions. */
  1062. { "shrpd", 0xd0000200, 0xfc001fe0, "?Xx,b,!,t", pa20, FLAG_STRICT},
  1063. { "shrpd", 0xd0000400, 0xfc001400, "?Xx,b,~,t", pa20, FLAG_STRICT},
  1064. { "shrpw", 0xd0000000, 0xfc001fe0, "?xx,b,!,t", pa10, FLAG_STRICT},
  1065. { "shrpw", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, FLAG_STRICT},
  1066. { "vshd", 0xd0000000, 0xfc001fe0, "?xx,b,t", pa10, 0},
  1067. { "shd", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, 0},
  1068. { "extrd", 0xd0001200, 0xfc001ae0, "cS?Xb,!,%,x", pa20, FLAG_STRICT},
  1069. { "extrd", 0xd8000000, 0xfc000000, "cS?Xb,q,|,x", pa20, FLAG_STRICT},
  1070. { "extrw", 0xd0001000, 0xfc001be0, "cS?xb,!,T,x", pa10, FLAG_STRICT},
  1071. { "extrw", 0xd0001800, 0xfc001800, "cS?xb,P,T,x", pa10, FLAG_STRICT},
  1072. { "vextru", 0xd0001000, 0xfc001fe0, "?xb,T,x", pa10, 0},
  1073. { "vextrs", 0xd0001400, 0xfc001fe0, "?xb,T,x", pa10, 0},
  1074. { "extru", 0xd0001800, 0xfc001c00, "?xb,P,T,x", pa10, 0},
  1075. { "extrs", 0xd0001c00, 0xfc001c00, "?xb,P,T,x", pa10, 0},
  1076. { "depd", 0xd4000200, 0xfc001ae0, "cz?Xx,!,%,b", pa20, FLAG_STRICT},
  1077. { "depd", 0xf0000000, 0xfc000000, "cz?Xx,~,|,b", pa20, FLAG_STRICT},
  1078. { "depdi", 0xd4001200, 0xfc001ae0, "cz?X5,!,%,b", pa20, FLAG_STRICT},
  1079. { "depdi", 0xf4000000, 0xfc000000, "cz?X5,~,|,b", pa20, FLAG_STRICT},
  1080. { "depw", 0xd4000000, 0xfc001be0, "cz?xx,!,T,b", pa10, FLAG_STRICT},
  1081. { "depw", 0xd4000800, 0xfc001800, "cz?xx,p,T,b", pa10, FLAG_STRICT},
  1082. { "depwi", 0xd4001000, 0xfc001be0, "cz?x5,!,T,b", pa10, FLAG_STRICT},
  1083. { "depwi", 0xd4001800, 0xfc001800, "cz?x5,p,T,b", pa10, FLAG_STRICT},
  1084. { "zvdep", 0xd4000000, 0xfc001fe0, "?xx,T,b", pa10, 0},
  1085. { "vdep", 0xd4000400, 0xfc001fe0, "?xx,T,b", pa10, 0},
  1086. { "zdep", 0xd4000800, 0xfc001c00, "?xx,p,T,b", pa10, 0},
  1087. { "dep", 0xd4000c00, 0xfc001c00, "?xx,p,T,b", pa10, 0},
  1088. { "zvdepi", 0xd4001000, 0xfc001fe0, "?x5,T,b", pa10, 0},
  1089. { "vdepi", 0xd4001400, 0xfc001fe0, "?x5,T,b", pa10, 0},
  1090. { "zdepi", 0xd4001800, 0xfc001c00, "?x5,p,T,b", pa10, 0},
  1091. { "depi", 0xd4001c00, 0xfc001c00, "?x5,p,T,b", pa10, 0},
  1092. /* System Control Instructions. */
  1093. { "break", 0x00000000, 0xfc001fe0, "r,A", pa10, 0},
  1094. { "rfi", 0x00000c00, 0xffffff1f, "cr", pa10, FLAG_STRICT},
  1095. { "rfi", 0x00000c00, 0xffffffff, "", pa10, 0},
  1096. { "rfir", 0x00000ca0, 0xffffffff, "", pa11, 0},
  1097. { "ssm", 0x00000d60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT},
  1098. { "ssm", 0x00000d60, 0xffe0ffe0, "R,t", pa10, 0},
  1099. { "rsm", 0x00000e60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT},
  1100. { "rsm", 0x00000e60, 0xffe0ffe0, "R,t", pa10, 0},
  1101. { "mtsm", 0x00001860, 0xffe0ffff, "x", pa10, 0},
  1102. { "ldsid", 0x000010a0, 0xfc1fffe0, "(b),t", pa10, 0},
  1103. { "ldsid", 0x000010a0, 0xfc1f3fe0, "(s,b),t", pa10, 0},
  1104. { "mtsp", 0x00001820, 0xffe01fff, "x,S", pa10, 0},
  1105. { "mtctl", 0x00001840, 0xfc00ffff, "x,^", pa10, 0},
  1106. { "mtsarcm", 0x016018C0, 0xffe0ffff, "x", pa20, FLAG_STRICT},
  1107. { "mfia", 0x000014A0, 0xffffffe0, "t", pa20, FLAG_STRICT},
  1108. { "mfsp", 0x000004a0, 0xffff1fe0, "S,t", pa10, 0},
  1109. { "mfctl", 0x016048a0, 0xffffffe0, "cW!,t", pa20, FLAG_STRICT},
  1110. { "mfctl", 0x000008a0, 0xfc1fffe0, "^,t", pa10, 0},
  1111. { "sync", 0x00000400, 0xffffffff, "", pa10, 0},
  1112. { "syncdma", 0x00100400, 0xffffffff, "", pa10, 0},
  1113. { "probe", 0x04001180, 0xfc00ffa0, "cw(b),x,t", pa10, FLAG_STRICT},
  1114. { "probe", 0x04001180, 0xfc003fa0, "cw(s,b),x,t", pa10, FLAG_STRICT},
  1115. { "probei", 0x04003180, 0xfc00ffa0, "cw(b),R,t", pa10, FLAG_STRICT},
  1116. { "probei", 0x04003180, 0xfc003fa0, "cw(s,b),R,t", pa10, FLAG_STRICT},
  1117. { "prober", 0x04001180, 0xfc00ffe0, "(b),x,t", pa10, 0},
  1118. { "prober", 0x04001180, 0xfc003fe0, "(s,b),x,t", pa10, 0},
  1119. { "proberi", 0x04003180, 0xfc00ffe0, "(b),R,t", pa10, 0},
  1120. { "proberi", 0x04003180, 0xfc003fe0, "(s,b),R,t", pa10, 0},
  1121. { "probew", 0x040011c0, 0xfc00ffe0, "(b),x,t", pa10, 0},
  1122. { "probew", 0x040011c0, 0xfc003fe0, "(s,b),x,t", pa10, 0},
  1123. { "probewi", 0x040031c0, 0xfc00ffe0, "(b),R,t", pa10, 0},
  1124. { "probewi", 0x040031c0, 0xfc003fe0, "(s,b),R,t", pa10, 0},
  1125. { "lpa", 0x04001340, 0xfc00ffc0, "cZx(b),t", pa10, 0},
  1126. { "lpa", 0x04001340, 0xfc003fc0, "cZx(s,b),t", pa10, 0},
  1127. { "lci", 0x04001300, 0xfc00ffe0, "x(b),t", pa11, 0},
  1128. { "lci", 0x04001300, 0xfc003fe0, "x(s,b),t", pa11, 0},
  1129. { "pdtlb", 0x04001600, 0xfc00ffdf, "cLcZx(b)", pa20, FLAG_STRICT},
  1130. { "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(s,b)", pa20, FLAG_STRICT},
  1131. { "pdtlb", 0x04001600, 0xfc1fffdf, "cLcZ@(b)", pa20, FLAG_STRICT},
  1132. { "pdtlb", 0x04001600, 0xfc1f3fdf, "cLcZ@(s,b)", pa20, FLAG_STRICT},
  1133. { "pdtlb", 0x04001200, 0xfc00ffdf, "cZx(b)", pa10, 0},
  1134. { "pdtlb", 0x04001200, 0xfc003fdf, "cZx(s,b)", pa10, 0},
  1135. { "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(S,b)", pa20, FLAG_STRICT},
  1136. { "pitlb", 0x04000600, 0xfc1f1fdf, "cLcZ@(S,b)", pa20, FLAG_STRICT},
  1137. { "pitlb", 0x04000200, 0xfc001fdf, "cZx(S,b)", pa10, 0},
  1138. { "pdtlbe", 0x04001240, 0xfc00ffdf, "cZx(b)", pa10, 0},
  1139. { "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(s,b)", pa10, 0},
  1140. { "pitlbe", 0x04000240, 0xfc001fdf, "cZx(S,b)", pa10, 0},
  1141. { "idtlba", 0x04001040, 0xfc00ffff, "x,(b)", pa10, 0},
  1142. { "idtlba", 0x04001040, 0xfc003fff, "x,(s,b)", pa10, 0},
  1143. { "iitlba", 0x04000040, 0xfc001fff, "x,(S,b)", pa10, 0},
  1144. { "idtlbp", 0x04001000, 0xfc00ffff, "x,(b)", pa10, 0},
  1145. { "idtlbp", 0x04001000, 0xfc003fff, "x,(s,b)", pa10, 0},
  1146. { "iitlbp", 0x04000000, 0xfc001fff, "x,(S,b)", pa10, 0},
  1147. { "pdc", 0x04001380, 0xfc00ffdf, "cZx(b)", pa10, 0},
  1148. { "pdc", 0x04001380, 0xfc003fdf, "cZx(s,b)", pa10, 0},
  1149. { "fdc", 0x04001280, 0xfc00ffdf, "cZx(b)", pa10, FLAG_STRICT},
  1150. { "fdc", 0x04001280, 0xfc003fdf, "cZx(s,b)", pa10, FLAG_STRICT},
  1151. { "fdc", 0x04003280, 0xfc00ffff, "5(b)", pa20, FLAG_STRICT},
  1152. { "fdc", 0x04003280, 0xfc003fff, "5(s,b)", pa20, FLAG_STRICT},
  1153. { "fdc", 0x04001280, 0xfc00ffdf, "cZx(b)", pa10, 0},
  1154. { "fdc", 0x04001280, 0xfc003fdf, "cZx(s,b)", pa10, 0},
  1155. { "fic", 0x040013c0, 0xfc00dfdf, "cZx(b)", pa20, FLAG_STRICT},
  1156. { "fic", 0x04000280, 0xfc001fdf, "cZx(S,b)", pa10, 0},
  1157. { "fdce", 0x040012c0, 0xfc00ffdf, "cZx(b)", pa10, 0},
  1158. { "fdce", 0x040012c0, 0xfc003fdf, "cZx(s,b)", pa10, 0},
  1159. { "fice", 0x040002c0, 0xfc001fdf, "cZx(S,b)", pa10, 0},
  1160. { "diag", 0x14000000, 0xfc000000, "D", pa10, 0},
  1161. { "idtlbt", 0x04001800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT},
  1162. { "iitlbt", 0x04000800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT},
  1163. /* These may be specific to certain versions of the PA. Joel claimed
  1164. they were 72000 (7200?) specific. However, I'm almost certain the
  1165. mtcpu/mfcpu were undocumented, but available in the older 700 machines. */
  1166. { "mtcpu", 0x14001600, 0xfc00ffff, "x,^", pa10, 0},
  1167. { "mfcpu", 0x14001A00, 0xfc00ffff, "^,x", pa10, 0},
  1168. { "tocen", 0x14403600, 0xffffffff, "", pa10, 0},
  1169. { "tocdis", 0x14401620, 0xffffffff, "", pa10, 0},
  1170. { "shdwgr", 0x14402600, 0xffffffff, "", pa10, 0},
  1171. { "grshdw", 0x14400620, 0xffffffff, "", pa10, 0},
  1172. /* gfw and gfr are not in the HP PA 1.1 manual, but they are in either
  1173. the Timex FPU or the Mustang ERS (not sure which) manual. */
  1174. { "gfw", 0x04001680, 0xfc00ffdf, "cZx(b)", pa11, 0},
  1175. { "gfw", 0x04001680, 0xfc003fdf, "cZx(s,b)", pa11, 0},
  1176. { "gfr", 0x04001a80, 0xfc00ffdf, "cZx(b)", pa11, 0},
  1177. { "gfr", 0x04001a80, 0xfc003fdf, "cZx(s,b)", pa11, 0},
  1178. /* Floating Point Coprocessor Instructions. */
  1179. { "fldw", 0x24000000, 0xfc00df80, "cXx(b),fT", pa10, FLAG_STRICT},
  1180. { "fldw", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, FLAG_STRICT},
  1181. { "fldw", 0x24000000, 0xfc00d380, "cxccx(b),fT", pa11, FLAG_STRICT},
  1182. { "fldw", 0x24000000, 0xfc001380, "cxccx(s,b),fT", pa11, FLAG_STRICT},
  1183. { "fldw", 0x24001020, 0xfc1ff3a0, "cocc@(b),fT", pa20, FLAG_STRICT},
  1184. { "fldw", 0x24001020, 0xfc1f33a0, "cocc@(s,b),fT", pa20, FLAG_STRICT},
  1185. { "fldw", 0x24001000, 0xfc00df80, "cM5(b),fT", pa10, FLAG_STRICT},
  1186. { "fldw", 0x24001000, 0xfc001f80, "cM5(s,b),fT", pa10, FLAG_STRICT},
  1187. { "fldw", 0x24001000, 0xfc00d380, "cmcc5(b),fT", pa11, FLAG_STRICT},
  1188. { "fldw", 0x24001000, 0xfc001380, "cmcc5(s,b),fT", pa11, FLAG_STRICT},
  1189. { "fldw", 0x5c000000, 0xfc000004, "y(b),fe", pa20w, FLAG_STRICT},
  1190. { "fldw", 0x58000000, 0xfc000000, "cJy(b),fe", pa20w, FLAG_STRICT},
  1191. { "fldw", 0x5c000000, 0xfc00c004, "d(b),fe", pa20, FLAG_STRICT},
  1192. { "fldw", 0x5c000000, 0xfc000004, "d(s,b),fe", pa20, FLAG_STRICT},
  1193. { "fldw", 0x58000000, 0xfc00c000, "cJd(b),fe", pa20, FLAG_STRICT},
  1194. { "fldw", 0x58000000, 0xfc000000, "cJd(s,b),fe", pa20, FLAG_STRICT},
  1195. { "fldd", 0x2c000000, 0xfc00dfc0, "cXx(b),ft", pa10, FLAG_STRICT},
  1196. { "fldd", 0x2c000000, 0xfc001fc0, "cXx(s,b),ft", pa10, FLAG_STRICT},
  1197. { "fldd", 0x2c000000, 0xfc00d3c0, "cxccx(b),ft", pa11, FLAG_STRICT},
  1198. { "fldd", 0x2c000000, 0xfc0013c0, "cxccx(s,b),ft", pa11, FLAG_STRICT},
  1199. { "fldd", 0x2c001020, 0xfc1ff3e0, "cocc@(b),ft", pa20, FLAG_STRICT},
  1200. { "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(s,b),ft", pa20, FLAG_STRICT},
  1201. { "fldd", 0x2c001000, 0xfc00dfc0, "cM5(b),ft", pa10, FLAG_STRICT},
  1202. { "fldd", 0x2c001000, 0xfc001fc0, "cM5(s,b),ft", pa10, FLAG_STRICT},
  1203. { "fldd", 0x2c001000, 0xfc00d3c0, "cmcc5(b),ft", pa11, FLAG_STRICT},
  1204. { "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(s,b),ft", pa11, FLAG_STRICT},
  1205. { "fldd", 0x50000002, 0xfc000002, "cq&(b),fx", pa20w, FLAG_STRICT},
  1206. { "fldd", 0x50000002, 0xfc00c002, "cq#(b),fx", pa20, FLAG_STRICT},
  1207. { "fldd", 0x50000002, 0xfc000002, "cq#(s,b),fx", pa20, FLAG_STRICT},
  1208. { "fstw", 0x24000200, 0xfc00df80, "cXfT,x(b)", pa10, FLAG_STRICT},
  1209. { "fstw", 0x24000200, 0xfc001f80, "cXfT,x(s,b)", pa10, FLAG_STRICT},
  1210. { "fstw", 0x24000200, 0xfc00d380, "cxcCfT,x(b)", pa11, FLAG_STRICT},
  1211. { "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(s,b)", pa11, FLAG_STRICT},
  1212. { "fstw", 0x24001220, 0xfc1ff3a0, "cocCfT,@(b)", pa20, FLAG_STRICT},
  1213. { "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(s,b)", pa20, FLAG_STRICT},
  1214. { "fstw", 0x24001200, 0xfc00df80, "cMfT,5(b)", pa10, FLAG_STRICT},
  1215. { "fstw", 0x24001200, 0xfc001f80, "cMfT,5(s,b)", pa10, FLAG_STRICT},
  1216. { "fstw", 0x24001200, 0xfc00df80, "cMfT,5(b)", pa10, FLAG_STRICT},
  1217. { "fstw", 0x24001200, 0xfc001f80, "cMfT,5(s,b)", pa10, FLAG_STRICT},
  1218. { "fstw", 0x7c000000, 0xfc000004, "fE,y(b)", pa20w, FLAG_STRICT},
  1219. { "fstw", 0x78000000, 0xfc000000, "cJfE,y(b)", pa20w, FLAG_STRICT},
  1220. { "fstw", 0x7c000000, 0xfc00c004, "fE,d(b)", pa20, FLAG_STRICT},
  1221. { "fstw", 0x7c000000, 0xfc000004, "fE,d(s,b)", pa20, FLAG_STRICT},
  1222. { "fstw", 0x78000000, 0xfc00c000, "cJfE,d(b)", pa20, FLAG_STRICT},
  1223. { "fstw", 0x78000000, 0xfc000000, "cJfE,d(s,b)", pa20, FLAG_STRICT},
  1224. { "fstd", 0x2c000200, 0xfc00dfc0, "cXft,x(b)", pa10, FLAG_STRICT},
  1225. { "fstd", 0x2c000200, 0xfc001fc0, "cXft,x(s,b)", pa10, FLAG_STRICT},
  1226. { "fstd", 0x2c000200, 0xfc00d3c0, "cxcCft,x(b)", pa11, FLAG_STRICT},
  1227. { "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(s,b)", pa11, FLAG_STRICT},
  1228. { "fstd", 0x2c001220, 0xfc1ff3e0, "cocCft,@(b)", pa20, FLAG_STRICT},
  1229. { "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(s,b)", pa20, FLAG_STRICT},
  1230. { "fstd", 0x2c001200, 0xfc00dfc0, "cMft,5(b)", pa10, FLAG_STRICT},
  1231. { "fstd", 0x2c001200, 0xfc001fc0, "cMft,5(s,b)", pa10, FLAG_STRICT},
  1232. { "fstd", 0x2c001200, 0xfc00d3c0, "cmcCft,5(b)", pa11, FLAG_STRICT},
  1233. { "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(s,b)", pa11, FLAG_STRICT},
  1234. { "fstd", 0x70000002, 0xfc000002, "cqfx,&(b)", pa20w, FLAG_STRICT},
  1235. { "fstd", 0x70000002, 0xfc00c002, "cqfx,#(b)", pa20, FLAG_STRICT},
  1236. { "fstd", 0x70000002, 0xfc000002, "cqfx,#(s,b)", pa20, FLAG_STRICT},
  1237. { "fldwx", 0x24000000, 0xfc00df80, "cXx(b),fT", pa10, FLAG_STRICT},
  1238. { "fldwx", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, FLAG_STRICT},
  1239. { "fldwx", 0x24000000, 0xfc00d380, "cxccx(b),fT", pa11, FLAG_STRICT},
  1240. { "fldwx", 0x24000000, 0xfc001380, "cxccx(s,b),fT", pa11, FLAG_STRICT},
  1241. { "fldwx", 0x24000000, 0xfc00df80, "cXx(b),fT", pa10, 0},
  1242. { "fldwx", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, 0},
  1243. { "flddx", 0x2c000000, 0xfc00dfc0, "cXx(b),ft", pa10, FLAG_STRICT},
  1244. { "flddx", 0x2c000000, 0xfc001fc0, "cXx(s,b),ft", pa10, FLAG_STRICT},
  1245. { "flddx", 0x2c000000, 0xfc00d3c0, "cxccx(b),ft", pa11, FLAG_STRICT},
  1246. { "flddx", 0x2c000000, 0xfc0013c0, "cxccx(s,b),ft", pa11, FLAG_STRICT},
  1247. { "flddx", 0x2c000000, 0xfc00dfc0, "cXx(b),ft", pa10, 0},
  1248. { "flddx", 0x2c000000, 0xfc001fc0, "cXx(s,b),ft", pa10, 0},
  1249. { "fstwx", 0x24000200, 0xfc00df80, "cxfT,x(b)", pa10, FLAG_STRICT},
  1250. { "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(s,b)", pa10, FLAG_STRICT},
  1251. { "fstwx", 0x24000200, 0xfc00d380, "cxcCfT,x(b)", pa11, FLAG_STRICT},
  1252. { "fstwx", 0x24000200, 0xfc001380, "cxcCfT,x(s,b)", pa11, FLAG_STRICT},
  1253. { "fstwx", 0x24000200, 0xfc00df80, "cxfT,x(b)", pa10, 0},
  1254. { "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(s,b)", pa10, 0},
  1255. { "fstdx", 0x2c000200, 0xfc00dfc0, "cxft,x(b)", pa10, FLAG_STRICT},
  1256. { "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, FLAG_STRICT},
  1257. { "fstdx", 0x2c000200, 0xfc00d3c0, "cxcCft,x(b)", pa11, FLAG_STRICT},
  1258. { "fstdx", 0x2c000200, 0xfc0013c0, "cxcCft,x(s,b)", pa11, FLAG_STRICT},
  1259. { "fstdx", 0x2c000200, 0xfc00dfc0, "cxft,x(b)", pa10, 0},
  1260. { "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0},
  1261. { "fstqx", 0x3c000200, 0xfc00dfc0, "cxft,x(b)", pa10, 0},
  1262. { "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0},
  1263. { "fldws", 0x24001000, 0xfc00df80, "cm5(b),fT", pa10, FLAG_STRICT},
  1264. { "fldws", 0x24001000, 0xfc001f80, "cm5(s,b),fT", pa10, FLAG_STRICT},
  1265. { "fldws", 0x24001000, 0xfc00d380, "cmcc5(b),fT", pa11, FLAG_STRICT},
  1266. { "fldws", 0x24001000, 0xfc001380, "cmcc5(s,b),fT", pa11, FLAG_STRICT},
  1267. { "fldws", 0x24001000, 0xfc00df80, "cm5(b),fT", pa10, 0},
  1268. { "fldws", 0x24001000, 0xfc001f80, "cm5(s,b),fT", pa10, 0},
  1269. { "fldds", 0x2c001000, 0xfc00dfc0, "cm5(b),ft", pa10, FLAG_STRICT},
  1270. { "fldds", 0x2c001000, 0xfc001fc0, "cm5(s,b),ft", pa10, FLAG_STRICT},
  1271. { "fldds", 0x2c001000, 0xfc00d3c0, "cmcc5(b),ft", pa11, FLAG_STRICT},
  1272. { "fldds", 0x2c001000, 0xfc0013c0, "cmcc5(s,b),ft", pa11, FLAG_STRICT},
  1273. { "fldds", 0x2c001000, 0xfc00dfc0, "cm5(b),ft", pa10, 0},
  1274. { "fldds", 0x2c001000, 0xfc001fc0, "cm5(s,b),ft", pa10, 0},
  1275. { "fstws", 0x24001200, 0xfc00df80, "cmfT,5(b)", pa10, FLAG_STRICT},
  1276. { "fstws", 0x24001200, 0xfc001f80, "cmfT,5(s,b)", pa10, FLAG_STRICT},
  1277. { "fstws", 0x24001200, 0xfc00d380, "cmcCfT,5(b)", pa11, FLAG_STRICT},
  1278. { "fstws", 0x24001200, 0xfc001380, "cmcCfT,5(s,b)", pa11, FLAG_STRICT},
  1279. { "fstws", 0x24001200, 0xfc00df80, "cmfT,5(b)", pa10, 0},
  1280. { "fstws", 0x24001200, 0xfc001f80, "cmfT,5(s,b)", pa10, 0},
  1281. { "fstds", 0x2c001200, 0xfc00dfc0, "cmft,5(b)", pa10, FLAG_STRICT},
  1282. { "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, FLAG_STRICT},
  1283. { "fstds", 0x2c001200, 0xfc00d3c0, "cmcCft,5(b)", pa11, FLAG_STRICT},
  1284. { "fstds", 0x2c001200, 0xfc0013c0, "cmcCft,5(s,b)", pa11, FLAG_STRICT},
  1285. { "fstds", 0x2c001200, 0xfc00dfc0, "cmft,5(b)", pa10, 0},
  1286. { "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0},
  1287. { "fstqs", 0x3c001200, 0xfc00dfc0, "cmft,5(b)", pa10, 0},
  1288. { "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0},
  1289. { "fadd", 0x30000600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
  1290. { "fadd", 0x38000600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
  1291. { "fsub", 0x30002600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
  1292. { "fsub", 0x38002600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
  1293. { "fmpy", 0x30004600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
  1294. { "fmpy", 0x38004600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
  1295. { "fdiv", 0x30006600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
  1296. { "fdiv", 0x38006600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
  1297. { "fsqrt", 0x30008000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
  1298. { "fsqrt", 0x38008000, 0xfc1fe720, "FfA,fT", pa10, 0},
  1299. { "fabs", 0x30006000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
  1300. { "fabs", 0x38006000, 0xfc1fe720, "FfA,fT", pa10, 0},
  1301. { "frem", 0x30008600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
  1302. { "frem", 0x38008600, 0xfc00e720, "FfA,fB,fT", pa10, 0},
  1303. { "frnd", 0x3000a000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
  1304. { "frnd", 0x3800a000, 0xfc1fe720, "FfA,fT", pa10, 0},
  1305. { "fcpy", 0x30004000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
  1306. { "fcpy", 0x38004000, 0xfc1fe720, "FfA,fT", pa10, 0},
  1307. { "fcnvff", 0x30000200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
  1308. { "fcnvff", 0x38000200, 0xfc1f8720, "FGfA,fT", pa10, 0},
  1309. { "fcnvxf", 0x30008200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
  1310. { "fcnvxf", 0x38008200, 0xfc1f8720, "FGfA,fT", pa10, 0},
  1311. { "fcnvfx", 0x30010200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
  1312. { "fcnvfx", 0x38010200, 0xfc1f8720, "FGfA,fT", pa10, 0},
  1313. { "fcnvfxt", 0x30018200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
  1314. { "fcnvfxt", 0x38018200, 0xfc1f8720, "FGfA,fT", pa10, 0},
  1315. { "fmpyfadd", 0xb8000000, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT},
  1316. { "fmpynfadd", 0xb8000020, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT},
  1317. { "fneg", 0x3000c000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT},
  1318. { "fneg", 0x3800c000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT},
  1319. { "fnegabs", 0x3000e000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT},
  1320. { "fnegabs", 0x3800e000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT},
  1321. { "fcnv", 0x30000200, 0xfc1c0720, "{_fa,fT", pa20, FLAG_STRICT},
  1322. { "fcnv", 0x38000200, 0xfc1c0720, "FGfA,fT", pa20, FLAG_STRICT},
  1323. { "fcmp", 0x30000400, 0xfc00e7e0, "F?ffa,fb", pa10, FLAG_STRICT},
  1324. { "fcmp", 0x38000400, 0xfc00e720, "I?ffA,fB", pa10, FLAG_STRICT},
  1325. { "fcmp", 0x30000400, 0xfc0007e0, "F?ffa,fb,h", pa20, FLAG_STRICT},
  1326. { "fcmp", 0x38000400, 0xfc000720, "I?ffA,fB,h", pa20, FLAG_STRICT},
  1327. { "fcmp", 0x30000400, 0xfc00e7e0, "F?ffa,fb", pa10, 0},
  1328. { "fcmp", 0x38000400, 0xfc00e720, "I?ffA,fB", pa10, 0},
  1329. { "xmpyu", 0x38004700, 0xfc00e720, "fX,fB,fT", pa11, 0},
  1330. { "fmpyadd", 0x18000000, 0xfc000000, "Hfi,fj,fk,fl,fm", pa11, 0},
  1331. { "fmpysub", 0x98000000, 0xfc000000, "Hfi,fj,fk,fl,fm", pa11, 0},
  1332. { "ftest", 0x30002420, 0xffffffff, "", pa10, FLAG_STRICT},
  1333. { "ftest", 0x30002420, 0xffffffe0, ",=", pa20, FLAG_STRICT},
  1334. { "ftest", 0x30000420, 0xffff1fff, "m", pa20, FLAG_STRICT},
  1335. { "fid", 0x30000000, 0xffffffff, "", pa11, 0},
  1336. /* Performance Monitor Instructions. */
  1337. { "pmdis", 0x30000280, 0xffffffdf, "N", pa20, FLAG_STRICT},
  1338. { "pmenb", 0x30000680, 0xffffffff, "", pa20, FLAG_STRICT},
  1339. /* Assist Instructions. */
  1340. { "spop0", 0x10000000, 0xfc000600, "v,ON", pa10, 0},
  1341. { "spop1", 0x10000200, 0xfc000600, "v,oNt", pa10, 0},
  1342. { "spop2", 0x10000400, 0xfc000600, "v,1Nb", pa10, 0},
  1343. { "spop3", 0x10000600, 0xfc000600, "v,0Nx,b", pa10, 0},
  1344. { "copr", 0x30000000, 0xfc000000, "u,2N", pa10, 0},
  1345. { "cldw", 0x24000000, 0xfc00de00, "ucXx(b),t", pa10, FLAG_STRICT},
  1346. { "cldw", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT},
  1347. { "cldw", 0x24000000, 0xfc00d200, "ucxccx(b),t", pa11, FLAG_STRICT},
  1348. { "cldw", 0x24000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT},
  1349. { "cldw", 0x24001000, 0xfc00d200, "ucocc@(b),t", pa20, FLAG_STRICT},
  1350. { "cldw", 0x24001000, 0xfc001200, "ucocc@(s,b),t", pa20, FLAG_STRICT},
  1351. { "cldw", 0x24001000, 0xfc00de00, "ucM5(b),t", pa10, FLAG_STRICT},
  1352. { "cldw", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT},
  1353. { "cldw", 0x24001000, 0xfc00d200, "ucmcc5(b),t", pa11, FLAG_STRICT},
  1354. { "cldw", 0x24001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT},
  1355. { "cldd", 0x2c000000, 0xfc00de00, "ucXx(b),t", pa10, FLAG_STRICT},
  1356. { "cldd", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT},
  1357. { "cldd", 0x2c000000, 0xfc00d200, "ucxccx(b),t", pa11, FLAG_STRICT},
  1358. { "cldd", 0x2c000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT},
  1359. { "cldd", 0x2c001000, 0xfc00d200, "ucocc@(b),t", pa20, FLAG_STRICT},
  1360. { "cldd", 0x2c001000, 0xfc001200, "ucocc@(s,b),t", pa20, FLAG_STRICT},
  1361. { "cldd", 0x2c001000, 0xfc00de00, "ucM5(b),t", pa10, FLAG_STRICT},
  1362. { "cldd", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT},
  1363. { "cldd", 0x2c001000, 0xfc00d200, "ucmcc5(b),t", pa11, FLAG_STRICT},
  1364. { "cldd", 0x2c001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT},
  1365. { "cstw", 0x24000200, 0xfc00de00, "ucXt,x(b)", pa10, FLAG_STRICT},
  1366. { "cstw", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT},
  1367. { "cstw", 0x24000200, 0xfc00d200, "ucxcCt,x(b)", pa11, FLAG_STRICT},
  1368. { "cstw", 0x24000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT},
  1369. { "cstw", 0x24001200, 0xfc00d200, "ucocCt,@(b)", pa20, FLAG_STRICT},
  1370. { "cstw", 0x24001200, 0xfc001200, "ucocCt,@(s,b)", pa20, FLAG_STRICT},
  1371. { "cstw", 0x24001200, 0xfc00de00, "ucMt,5(b)", pa10, FLAG_STRICT},
  1372. { "cstw", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT},
  1373. { "cstw", 0x24001200, 0xfc00d200, "ucmcCt,5(b)", pa11, FLAG_STRICT},
  1374. { "cstw", 0x24001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT},
  1375. { "cstd", 0x2c000200, 0xfc00de00, "ucXt,x(b)", pa10, FLAG_STRICT},
  1376. { "cstd", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT},
  1377. { "cstd", 0x2c000200, 0xfc00d200, "ucxcCt,x(b)", pa11, FLAG_STRICT},
  1378. { "cstd", 0x2c000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT},
  1379. { "cstd", 0x2c001200, 0xfc00d200, "ucocCt,@(b)", pa20, FLAG_STRICT},
  1380. { "cstd", 0x2c001200, 0xfc001200, "ucocCt,@(s,b)", pa20, FLAG_STRICT},
  1381. { "cstd", 0x2c001200, 0xfc00de00, "ucMt,5(b)", pa10, FLAG_STRICT},
  1382. { "cstd", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT},
  1383. { "cstd", 0x2c001200, 0xfc00d200, "ucmcCt,5(b)", pa11, FLAG_STRICT},
  1384. { "cstd", 0x2c001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT},
  1385. { "cldwx", 0x24000000, 0xfc00de00, "ucXx(b),t", pa10, FLAG_STRICT},
  1386. { "cldwx", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT},
  1387. { "cldwx", 0x24000000, 0xfc00d200, "ucxccx(b),t", pa11, FLAG_STRICT},
  1388. { "cldwx", 0x24000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT},
  1389. { "cldwx", 0x24000000, 0xfc00de00, "ucXx(b),t", pa10, 0},
  1390. { "cldwx", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, 0},
  1391. { "clddx", 0x2c000000, 0xfc00de00, "ucXx(b),t", pa10, FLAG_STRICT},
  1392. { "clddx", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT},
  1393. { "clddx", 0x2c000000, 0xfc00d200, "ucxccx(b),t", pa11, FLAG_STRICT},
  1394. { "clddx", 0x2c000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT},
  1395. { "clddx", 0x2c000000, 0xfc00de00, "ucXx(b),t", pa10, 0},
  1396. { "clddx", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, 0},
  1397. { "cstwx", 0x24000200, 0xfc00de00, "ucXt,x(b)", pa10, FLAG_STRICT},
  1398. { "cstwx", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT},
  1399. { "cstwx", 0x24000200, 0xfc00d200, "ucxcCt,x(b)", pa11, FLAG_STRICT},
  1400. { "cstwx", 0x24000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT},
  1401. { "cstwx", 0x24000200, 0xfc00de00, "ucXt,x(b)", pa10, 0},
  1402. { "cstwx", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, 0},
  1403. { "cstdx", 0x2c000200, 0xfc00de00, "ucXt,x(b)", pa10, FLAG_STRICT},
  1404. { "cstdx", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT},
  1405. { "cstdx", 0x2c000200, 0xfc00d200, "ucxcCt,x(b)", pa11, FLAG_STRICT},
  1406. { "cstdx", 0x2c000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT},
  1407. { "cstdx", 0x2c000200, 0xfc00de00, "ucXt,x(b)", pa10, 0},
  1408. { "cstdx", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, 0},
  1409. { "cldws", 0x24001000, 0xfc00de00, "ucM5(b),t", pa10, FLAG_STRICT},
  1410. { "cldws", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT},
  1411. { "cldws", 0x24001000, 0xfc00d200, "ucmcc5(b),t", pa11, FLAG_STRICT},
  1412. { "cldws", 0x24001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT},
  1413. { "cldws", 0x24001000, 0xfc00de00, "ucM5(b),t", pa10, 0},
  1414. { "cldws", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, 0},
  1415. { "cldds", 0x2c001000, 0xfc00de00, "ucM5(b),t", pa10, FLAG_STRICT},
  1416. { "cldds", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT},
  1417. { "cldds", 0x2c001000, 0xfc00d200, "ucmcc5(b),t", pa11, FLAG_STRICT},
  1418. { "cldds", 0x2c001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT},
  1419. { "cldds", 0x2c001000, 0xfc00de00, "ucM5(b),t", pa10, 0},
  1420. { "cldds", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, 0},
  1421. { "cstws", 0x24001200, 0xfc00de00, "ucMt,5(b)", pa10, FLAG_STRICT},
  1422. { "cstws", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT},
  1423. { "cstws", 0x24001200, 0xfc00d200, "ucmcCt,5(b)", pa11, FLAG_STRICT},
  1424. { "cstws", 0x24001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT},
  1425. { "cstws", 0x24001200, 0xfc00de00, "ucMt,5(b)", pa10, 0},
  1426. { "cstws", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, 0},
  1427. { "cstds", 0x2c001200, 0xfc00de00, "ucMt,5(b)", pa10, FLAG_STRICT},
  1428. { "cstds", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT},
  1429. { "cstds", 0x2c001200, 0xfc00d200, "ucmcCt,5(b)", pa11, FLAG_STRICT},
  1430. { "cstds", 0x2c001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT},
  1431. { "cstds", 0x2c001200, 0xfc00de00, "ucMt,5(b)", pa10, 0},
  1432. { "cstds", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, 0},
  1433. /* More pseudo instructions which must follow the main table. */
  1434. { "call", 0xe800f000, 0xfc1ffffd, "n(b)", pa20, FLAG_STRICT},
  1435. { "call", 0xe800a000, 0xffe0e000, "nW", pa10, FLAG_STRICT},
  1436. { "ret", 0xe840d000, 0xfffffffd, "n", pa20, FLAG_STRICT},
  1437. };
  1438. #define NUMOPCODES ((sizeof pa_opcodes)/(sizeof pa_opcodes[0]))
  1439. /* SKV 12/18/92. Added some denotations for various operands. */
  1440. #define PA_IMM11_AT_31 'i'
  1441. #define PA_IMM14_AT_31 'j'
  1442. #define PA_IMM21_AT_31 'k'
  1443. #define PA_DISP12 'w'
  1444. #define PA_DISP17 'W'
  1445. #define N_HPPA_OPERAND_FORMATS 5
  1446. /* Integer register names, indexed by the numbers which appear in the
  1447. opcodes. */
  1448. static const char *const reg_names[] =
  1449. {
  1450. "flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
  1451. "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
  1452. "r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1",
  1453. "sp", "r31"
  1454. };
  1455. /* Floating point register names, indexed by the numbers which appear in the
  1456. opcodes. */
  1457. static const char *const fp_reg_names[] =
  1458. {
  1459. "fpsr", "fpe2", "fpe4", "fpe6",
  1460. "fr4", "fr5", "fr6", "fr7", "fr8",
  1461. "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
  1462. "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
  1463. "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"
  1464. };
  1465. typedef unsigned int CORE_ADDR;
  1466. /* Get at various relevant fields of an instruction word. */
  1467. #define MASK_5 0x1f
  1468. #define MASK_10 0x3ff
  1469. #define MASK_11 0x7ff
  1470. #define MASK_14 0x3fff
  1471. #define MASK_16 0xffff
  1472. #define MASK_21 0x1fffff
  1473. /* These macros get bit fields using HP's numbering (MSB = 0). */
  1474. #define GET_FIELD(X, FROM, TO) \
  1475. ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
  1476. #define GET_BIT(X, WHICH) \
  1477. GET_FIELD (X, WHICH, WHICH)
  1478. /* Some of these have been converted to 2-d arrays because they
  1479. consume less storage this way. If the maintenance becomes a
  1480. problem, convert them back to const 1-d pointer arrays. */
  1481. static const char *const control_reg[] =
  1482. {
  1483. "rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
  1484. "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
  1485. "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
  1486. "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
  1487. "tr4", "tr5", "tr6", "tr7"
  1488. };
  1489. static const char *const compare_cond_names[] =
  1490. {
  1491. "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", ",od",
  1492. ",tr", ",<>", ",>=", ",>", ",>>=", ",>>", ",nsv", ",ev"
  1493. };
  1494. static const char *const compare_cond_64_names[] =
  1495. {
  1496. "", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od",
  1497. ",*tr", ",*<>", ",*>=", ",*>", ",*>>=", ",*>>", ",*nsv", ",*ev"
  1498. };
  1499. static const char *const cmpib_cond_64_names[] =
  1500. {
  1501. ",*<<", ",*=", ",*<", ",*<=", ",*>>=", ",*<>", ",*>=", ",*>"
  1502. };
  1503. static const char *const add_cond_names[] =
  1504. {
  1505. "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv", ",od",
  1506. ",tr", ",<>", ",>=", ",>", ",uv", ",vnz", ",nsv", ",ev"
  1507. };
  1508. static const char *const add_cond_64_names[] =
  1509. {
  1510. "", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od",
  1511. ",*tr", ",*<>", ",*>=", ",*>", ",*uv", ",*vnz", ",*nsv", ",*ev"
  1512. };
  1513. static const char *const wide_add_cond_names[] =
  1514. {
  1515. "", ",=", ",<", ",<=", ",nuv", ",*=", ",*<", ",*<=",
  1516. ",tr", ",<>", ",>=", ",>", ",uv", ",*<>", ",*>=", ",*>"
  1517. };
  1518. static const char *const logical_cond_names[] =
  1519. {
  1520. "", ",=", ",<", ",<=", 0, 0, 0, ",od",
  1521. ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"};
  1522. static const char *const logical_cond_64_names[] =
  1523. {
  1524. "", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od",
  1525. ",*tr", ",*<>", ",*>=", ",*>", 0, 0, 0, ",*ev"};
  1526. static const char *const unit_cond_names[] =
  1527. {
  1528. "", ",swz", ",sbz", ",shz", ",sdc", ",swc", ",sbc", ",shc",
  1529. ",tr", ",nwz", ",nbz", ",nhz", ",ndc", ",nwc", ",nbc", ",nhc"
  1530. };
  1531. static const char *const unit_cond_64_names[] =
  1532. {
  1533. "", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc",
  1534. ",*tr", ",*nwz", ",*nbz", ",*nhz", ",*ndc", ",*nwc", ",*nbc", ",*nhc"
  1535. };
  1536. static const char *const shift_cond_names[] =
  1537. {
  1538. "", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev"
  1539. };
  1540. static const char *const shift_cond_64_names[] =
  1541. {
  1542. "", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev"
  1543. };
  1544. static const char *const bb_cond_64_names[] =
  1545. {
  1546. ",*<", ",*>="
  1547. };
  1548. static const char *const index_compl_names[] = {"", ",m", ",s", ",sm"};
  1549. static const char *const short_ldst_compl_names[] = {"", ",ma", "", ",mb"};
  1550. static const char *const short_bytes_compl_names[] =
  1551. {
  1552. "", ",b,m", ",e", ",e,m"
  1553. };
  1554. static const char *const float_format_names[] = {",sgl", ",dbl", "", ",quad"};
  1555. static const char *const fcnv_fixed_names[] = {",w", ",dw", "", ",qw"};
  1556. static const char *const fcnv_ufixed_names[] = {",uw", ",udw", "", ",uqw"};
  1557. static const char *const float_comp_names[] =
  1558. {
  1559. ",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
  1560. ",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>",
  1561. ",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<",
  1562. ",!?=", ",<>", ",!=", ",!=t", ",!?", ",<=>", ",true?", ",true"
  1563. };
  1564. static const char *const signed_unsigned_names[] = {",u", ",s"};
  1565. static const char *const mix_half_names[] = {",l", ",r"};
  1566. static const char *const saturation_names[] = {",us", ",ss", 0, ""};
  1567. static const char *const read_write_names[] = {",r", ",w"};
  1568. static const char *const add_compl_names[] = { 0, "", ",l", ",tsv" };
  1569. /* For a bunch of different instructions form an index into a
  1570. completer name table. */
  1571. #define GET_COMPL(insn) (GET_FIELD (insn, 26, 26) | \
  1572. GET_FIELD (insn, 18, 18) << 1)
  1573. #define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \
  1574. (GET_FIELD ((insn), 19, 19) ? 8 : 0))
  1575. /* Utility function to print registers. Put these first, so gcc's function
  1576. inlining can do its stuff. */
  1577. #define fputs_filtered(STR,F) (*info->fprintf_func) (info->stream, "%s", STR)
  1578. static void
  1579. fput_reg (unsigned reg, disassemble_info *info)
  1580. {
  1581. (*info->fprintf_func) (info->stream, "%s", reg ? reg_names[reg] : "r0");
  1582. }
  1583. static void
  1584. fput_fp_reg (unsigned reg, disassemble_info *info)
  1585. {
  1586. (*info->fprintf_func) (info->stream, "%s", reg ? fp_reg_names[reg] : "fr0");
  1587. }
  1588. static void
  1589. fput_fp_reg_r (unsigned reg, disassemble_info *info)
  1590. {
  1591. /* Special case floating point exception registers. */
  1592. if (reg < 4)
  1593. (*info->fprintf_func) (info->stream, "fpe%d", reg * 2 + 1);
  1594. else
  1595. (*info->fprintf_func) (info->stream, "%sR",
  1596. reg ? fp_reg_names[reg] : "fr0");
  1597. }
  1598. static void
  1599. fput_creg (unsigned reg, disassemble_info *info)
  1600. {
  1601. (*info->fprintf_func) (info->stream, "%s", control_reg[reg]);
  1602. }
  1603. /* Print constants with sign. */
  1604. static void
  1605. fput_const (unsigned num, disassemble_info *info)
  1606. {
  1607. if ((int) num < 0)
  1608. (*info->fprintf_func) (info->stream, "-%x", - (int) num);
  1609. else
  1610. (*info->fprintf_func) (info->stream, "%x", num);
  1611. }
  1612. /* Routines to extract various sized constants out of hppa
  1613. instructions. */
  1614. /* Extract a 3-bit space register number from a be, ble, mtsp or mfsp. */
  1615. static int
  1616. extract_3 (unsigned word)
  1617. {
  1618. return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17);
  1619. }
  1620. static int
  1621. extract_5_load (unsigned word)
  1622. {
  1623. return low_sign_extend (word >> 16 & MASK_5, 5);
  1624. }
  1625. /* Extract the immediate field from a st{bhw}s instruction. */
  1626. static int
  1627. extract_5_store (unsigned word)
  1628. {
  1629. return low_sign_extend (word & MASK_5, 5);
  1630. }
  1631. /* Extract the immediate field from a break instruction. */
  1632. static unsigned
  1633. extract_5r_store (unsigned word)
  1634. {
  1635. return (word & MASK_5);
  1636. }
  1637. /* Extract the immediate field from a {sr}sm instruction. */
  1638. static unsigned
  1639. extract_5R_store (unsigned word)
  1640. {
  1641. return (word >> 16 & MASK_5);
  1642. }
  1643. /* Extract the 10 bit immediate field from a {sr}sm instruction. */
  1644. static unsigned
  1645. extract_10U_store (unsigned word)
  1646. {
  1647. return (word >> 16 & MASK_10);
  1648. }
  1649. /* Extract the immediate field from a bb instruction. */
  1650. static unsigned
  1651. extract_5Q_store (unsigned word)
  1652. {
  1653. return (word >> 21 & MASK_5);
  1654. }
  1655. /* Extract an 11 bit immediate field. */
  1656. static int
  1657. extract_11 (unsigned word)
  1658. {
  1659. return low_sign_extend (word & MASK_11, 11);
  1660. }
  1661. /* Extract a 14 bit immediate field. */
  1662. static int
  1663. extract_14 (unsigned word)
  1664. {
  1665. return low_sign_extend (word & MASK_14, 14);
  1666. }
  1667. /* Extract a 16 bit immediate field (PA2.0 wide only). */
  1668. static int
  1669. extract_16 (unsigned word)
  1670. {
  1671. int m15, m0, m1;
  1672. m0 = GET_BIT (word, 16);
  1673. m1 = GET_BIT (word, 17);
  1674. m15 = GET_BIT (word, 31);
  1675. word = (word >> 1) & 0x1fff;
  1676. word = word | (m15 << 15) | ((m15 ^ m0) << 14) | ((m15 ^ m1) << 13);
  1677. return sign_extend (word, 16);
  1678. }
  1679. /* Extract a 21 bit constant. */
  1680. static int
  1681. extract_21 (unsigned word)
  1682. {
  1683. int val;
  1684. word &= MASK_21;
  1685. word <<= 11;
  1686. val = GET_FIELD (word, 20, 20);
  1687. val <<= 11;
  1688. val |= GET_FIELD (word, 9, 19);
  1689. val <<= 2;
  1690. val |= GET_FIELD (word, 5, 6);
  1691. val <<= 5;
  1692. val |= GET_FIELD (word, 0, 4);
  1693. val <<= 2;
  1694. val |= GET_FIELD (word, 7, 8);
  1695. return sign_extend (val, 21) << 11;
  1696. }
  1697. /* Extract a 12 bit constant from branch instructions. */
  1698. static int
  1699. extract_12 (unsigned word)
  1700. {
  1701. return sign_extend (GET_FIELD (word, 19, 28)
  1702. | GET_FIELD (word, 29, 29) << 10
  1703. | (word & 0x1) << 11, 12) << 2;
  1704. }
  1705. /* Extract a 17 bit constant from branch instructions, returning the
  1706. 19 bit signed value. */
  1707. static int
  1708. extract_17 (unsigned word)
  1709. {
  1710. return sign_extend (GET_FIELD (word, 19, 28)
  1711. | GET_FIELD (word, 29, 29) << 10
  1712. | GET_FIELD (word, 11, 15) << 11
  1713. | (word & 0x1) << 16, 17) << 2;
  1714. }
  1715. static int
  1716. extract_22 (unsigned word)
  1717. {
  1718. return sign_extend (GET_FIELD (word, 19, 28)
  1719. | GET_FIELD (word, 29, 29) << 10
  1720. | GET_FIELD (word, 11, 15) << 11
  1721. | GET_FIELD (word, 6, 10) << 16
  1722. | (word & 0x1) << 21, 22) << 2;
  1723. }
  1724. /* Print one instruction. */
  1725. int
  1726. print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
  1727. {
  1728. bfd_byte buffer[4];
  1729. unsigned int insn, i;
  1730. {
  1731. int status =
  1732. (*info->read_memory_func) (memaddr, buffer, sizeof (buffer), info);
  1733. if (status != 0)
  1734. {
  1735. (*info->memory_error_func) (status, memaddr, info);
  1736. return -1;
  1737. }
  1738. }
  1739. insn = bfd_getb32 (buffer);
  1740. for (i = 0; i < NUMOPCODES; ++i)
  1741. {
  1742. const struct pa_opcode *opcode = &pa_opcodes[i];
  1743. if ((insn & opcode->mask) == opcode->match)
  1744. {
  1745. const char *s;
  1746. #ifndef BFD64
  1747. if (opcode->arch == pa20w)
  1748. continue;
  1749. #endif
  1750. (*info->fprintf_func) (info->stream, "%s", opcode->name);
  1751. if (!strchr ("cfCY?-+nHNZFIuv{", opcode->args[0]))
  1752. (*info->fprintf_func) (info->stream, " ");
  1753. for (s = opcode->args; *s != '\0'; ++s)
  1754. {
  1755. switch (*s)
  1756. {
  1757. case 'x':
  1758. fput_reg (GET_FIELD (insn, 11, 15), info);
  1759. break;
  1760. case 'a':
  1761. case 'b':
  1762. fput_reg (GET_FIELD (insn, 6, 10), info);
  1763. break;
  1764. case '^':
  1765. fput_creg (GET_FIELD (insn, 6, 10), info);
  1766. break;
  1767. case 't':
  1768. fput_reg (GET_FIELD (insn, 27, 31), info);
  1769. break;
  1770. /* Handle floating point registers. */
  1771. case 'f':
  1772. switch (*++s)
  1773. {
  1774. case 't':
  1775. fput_fp_reg (GET_FIELD (insn, 27, 31), info);
  1776. break;
  1777. case 'T':
  1778. if (GET_FIELD (insn, 25, 25))
  1779. fput_fp_reg_r (GET_FIELD (insn, 27, 31), info);
  1780. else
  1781. fput_fp_reg (GET_FIELD (insn, 27, 31), info);
  1782. break;
  1783. case 'a':
  1784. if (GET_FIELD (insn, 25, 25))
  1785. fput_fp_reg_r (GET_FIELD (insn, 6, 10), info);
  1786. else
  1787. fput_fp_reg (GET_FIELD (insn, 6, 10), info);
  1788. break;
  1789. /* 'fA' will not generate a space before the regsiter
  1790. name. Normally that is fine. Except that it
  1791. causes problems with xmpyu which has no FP format
  1792. completer. */
  1793. case 'X':
  1794. fputs_filtered (" ", info);
  1795. /* FALLTHRU */
  1796. case 'A':
  1797. if (GET_FIELD (insn, 24, 24))
  1798. fput_fp_reg_r (GET_FIELD (insn, 6, 10), info);
  1799. else
  1800. fput_fp_reg (GET_FIELD (insn, 6, 10), info);
  1801. break;
  1802. case 'b':
  1803. if (GET_FIELD (insn, 25, 25))
  1804. fput_fp_reg_r (GET_FIELD (insn, 11, 15), info);
  1805. else
  1806. fput_fp_reg (GET_FIELD (insn, 11, 15), info);
  1807. break;
  1808. case 'B':
  1809. if (GET_FIELD (insn, 19, 19))
  1810. fput_fp_reg_r (GET_FIELD (insn, 11, 15), info);
  1811. else
  1812. fput_fp_reg (GET_FIELD (insn, 11, 15), info);
  1813. break;
  1814. case 'C':
  1815. {
  1816. int reg = GET_FIELD (insn, 21, 22);
  1817. reg |= GET_FIELD (insn, 16, 18) << 2;
  1818. if (GET_FIELD (insn, 23, 23) != 0)
  1819. fput_fp_reg_r (reg, info);
  1820. else
  1821. fput_fp_reg (reg, info);
  1822. break;
  1823. }
  1824. case 'i':
  1825. {
  1826. int reg = GET_FIELD (insn, 6, 10);
  1827. reg |= (GET_FIELD (insn, 26, 26) << 4);
  1828. fput_fp_reg (reg, info);
  1829. break;
  1830. }
  1831. case 'j':
  1832. {
  1833. int reg = GET_FIELD (insn, 11, 15);
  1834. reg |= (GET_FIELD (insn, 26, 26) << 4);
  1835. fput_fp_reg (reg, info);
  1836. break;
  1837. }
  1838. case 'k':
  1839. {
  1840. int reg = GET_FIELD (insn, 27, 31);
  1841. reg |= (GET_FIELD (insn, 26, 26) << 4);
  1842. fput_fp_reg (reg, info);
  1843. break;
  1844. }
  1845. case 'l':
  1846. {
  1847. int reg = GET_FIELD (insn, 21, 25);
  1848. reg |= (GET_FIELD (insn, 26, 26) << 4);
  1849. fput_fp_reg (reg, info);
  1850. break;
  1851. }
  1852. case 'm':
  1853. {
  1854. int reg = GET_FIELD (insn, 16, 20);
  1855. reg |= (GET_FIELD (insn, 26, 26) << 4);
  1856. fput_fp_reg (reg, info);
  1857. break;
  1858. }
  1859. /* 'fe' will not generate a space before the register
  1860. name. Normally that is fine. Except that it
  1861. causes problems with fstw fe,y(b) which has no FP
  1862. format completer. */
  1863. case 'E':
  1864. fputs_filtered (" ", info);
  1865. /* FALLTHRU */
  1866. case 'e':
  1867. if (GET_FIELD (insn, 30, 30))
  1868. fput_fp_reg_r (GET_FIELD (insn, 11, 15), info);
  1869. else
  1870. fput_fp_reg (GET_FIELD (insn, 11, 15), info);
  1871. break;
  1872. case 'x':
  1873. fput_fp_reg (GET_FIELD (insn, 11, 15), info);
  1874. break;
  1875. }
  1876. break;
  1877. case '5':
  1878. fput_const (extract_5_load (insn), info);
  1879. break;
  1880. case 's':
  1881. {
  1882. int space = GET_FIELD (insn, 16, 17);
  1883. /* Zero means implicit addressing, not use of sr0. */
  1884. if (space != 0)
  1885. (*info->fprintf_func) (info->stream, "sr%d", space);
  1886. }
  1887. break;
  1888. case 'S':
  1889. (*info->fprintf_func) (info->stream, "sr%d",
  1890. extract_3 (insn));
  1891. break;
  1892. /* Handle completers. */
  1893. case 'c':
  1894. switch (*++s)
  1895. {
  1896. case 'x':
  1897. (*info->fprintf_func)
  1898. (info->stream, "%s",
  1899. index_compl_names[GET_COMPL (insn)]);
  1900. break;
  1901. case 'X':
  1902. (*info->fprintf_func)
  1903. (info->stream, "%s ",
  1904. index_compl_names[GET_COMPL (insn)]);
  1905. break;
  1906. case 'm':
  1907. (*info->fprintf_func)
  1908. (info->stream, "%s",
  1909. short_ldst_compl_names[GET_COMPL (insn)]);
  1910. break;
  1911. case 'M':
  1912. (*info->fprintf_func)
  1913. (info->stream, "%s ",
  1914. short_ldst_compl_names[GET_COMPL (insn)]);
  1915. break;
  1916. case 'A':
  1917. (*info->fprintf_func)
  1918. (info->stream, "%s ",
  1919. short_bytes_compl_names[GET_COMPL (insn)]);
  1920. break;
  1921. case 's':
  1922. (*info->fprintf_func)
  1923. (info->stream, "%s",
  1924. short_bytes_compl_names[GET_COMPL (insn)]);
  1925. break;
  1926. case 'c':
  1927. case 'C':
  1928. switch (GET_FIELD (insn, 20, 21))
  1929. {
  1930. case 1:
  1931. (*info->fprintf_func) (info->stream, ",bc ");
  1932. break;
  1933. case 2:
  1934. (*info->fprintf_func) (info->stream, ",sl ");
  1935. break;
  1936. default:
  1937. (*info->fprintf_func) (info->stream, " ");
  1938. }
  1939. break;
  1940. case 'd':
  1941. switch (GET_FIELD (insn, 20, 21))
  1942. {
  1943. case 1:
  1944. (*info->fprintf_func) (info->stream, ",co ");
  1945. break;
  1946. default:
  1947. (*info->fprintf_func) (info->stream, " ");
  1948. }
  1949. break;
  1950. case 'o':
  1951. (*info->fprintf_func) (info->stream, ",o");
  1952. break;
  1953. case 'g':
  1954. (*info->fprintf_func) (info->stream, ",gate");
  1955. break;
  1956. case 'p':
  1957. (*info->fprintf_func) (info->stream, ",l,push");
  1958. break;
  1959. case 'P':
  1960. (*info->fprintf_func) (info->stream, ",pop");
  1961. break;
  1962. case 'l':
  1963. case 'L':
  1964. (*info->fprintf_func) (info->stream, ",l");
  1965. break;
  1966. case 'w':
  1967. (*info->fprintf_func)
  1968. (info->stream, "%s ",
  1969. read_write_names[GET_FIELD (insn, 25, 25)]);
  1970. break;
  1971. case 'W':
  1972. (*info->fprintf_func) (info->stream, ",w ");
  1973. break;
  1974. case 'r':
  1975. if (GET_FIELD (insn, 23, 26) == 5)
  1976. (*info->fprintf_func) (info->stream, ",r");
  1977. break;
  1978. case 'Z':
  1979. if (GET_FIELD (insn, 26, 26))
  1980. (*info->fprintf_func) (info->stream, ",m ");
  1981. else
  1982. (*info->fprintf_func) (info->stream, " ");
  1983. break;
  1984. case 'i':
  1985. if (GET_FIELD (insn, 25, 25))
  1986. (*info->fprintf_func) (info->stream, ",i");
  1987. break;
  1988. case 'z':
  1989. if (!GET_FIELD (insn, 21, 21))
  1990. (*info->fprintf_func) (info->stream, ",z");
  1991. break;
  1992. case 'a':
  1993. (*info->fprintf_func)
  1994. (info->stream, "%s",
  1995. add_compl_names[GET_FIELD (insn, 20, 21)]);
  1996. break;
  1997. case 'Y':
  1998. (*info->fprintf_func)
  1999. (info->stream, ",dc%s",
  2000. add_compl_names[GET_FIELD (insn, 20, 21)]);
  2001. break;
  2002. case 'y':
  2003. (*info->fprintf_func)
  2004. (info->stream, ",c%s",
  2005. add_compl_names[GET_FIELD (insn, 20, 21)]);
  2006. break;
  2007. case 'v':
  2008. if (GET_FIELD (insn, 20, 20))
  2009. (*info->fprintf_func) (info->stream, ",tsv");
  2010. break;
  2011. case 't':
  2012. (*info->fprintf_func) (info->stream, ",tc");
  2013. if (GET_FIELD (insn, 20, 20))
  2014. (*info->fprintf_func) (info->stream, ",tsv");
  2015. break;
  2016. case 'B':
  2017. (*info->fprintf_func) (info->stream, ",db");
  2018. if (GET_FIELD (insn, 20, 20))
  2019. (*info->fprintf_func) (info->stream, ",tsv");
  2020. break;
  2021. case 'b':
  2022. (*info->fprintf_func) (info->stream, ",b");
  2023. if (GET_FIELD (insn, 20, 20))
  2024. (*info->fprintf_func) (info->stream, ",tsv");
  2025. break;
  2026. case 'T':
  2027. if (GET_FIELD (insn, 25, 25))
  2028. (*info->fprintf_func) (info->stream, ",tc");
  2029. break;
  2030. case 'S':
  2031. /* EXTRD/W has a following condition. */
  2032. if (*(s + 1) == '?')
  2033. (*info->fprintf_func)
  2034. (info->stream, "%s",
  2035. signed_unsigned_names[GET_FIELD (insn, 21, 21)]);
  2036. else
  2037. (*info->fprintf_func)
  2038. (info->stream, "%s ",
  2039. signed_unsigned_names[GET_FIELD (insn, 21, 21)]);
  2040. break;
  2041. case 'h':
  2042. (*info->fprintf_func)
  2043. (info->stream, "%s",
  2044. mix_half_names[GET_FIELD (insn, 17, 17)]);
  2045. break;
  2046. case 'H':
  2047. (*info->fprintf_func)
  2048. (info->stream, "%s ",
  2049. saturation_names[GET_FIELD (insn, 24, 25)]);
  2050. break;
  2051. case '*':
  2052. (*info->fprintf_func)
  2053. (info->stream, ",%d%d%d%d ",
  2054. GET_FIELD (insn, 17, 18), GET_FIELD (insn, 20, 21),
  2055. GET_FIELD (insn, 22, 23), GET_FIELD (insn, 24, 25));
  2056. break;
  2057. case 'q':
  2058. {
  2059. int m, a;
  2060. m = GET_FIELD (insn, 28, 28);
  2061. a = GET_FIELD (insn, 29, 29);
  2062. if (m && !a)
  2063. fputs_filtered (",ma ", info);
  2064. else if (m && a)
  2065. fputs_filtered (",mb ", info);
  2066. else
  2067. fputs_filtered (" ", info);
  2068. break;
  2069. }
  2070. case 'J':
  2071. {
  2072. int opc = GET_FIELD (insn, 0, 5);
  2073. if (opc == 0x16 || opc == 0x1e)
  2074. {
  2075. if (GET_FIELD (insn, 29, 29) == 0)
  2076. fputs_filtered (",ma ", info);
  2077. else
  2078. fputs_filtered (",mb ", info);
  2079. }
  2080. else
  2081. fputs_filtered (" ", info);
  2082. break;
  2083. }
  2084. case 'e':
  2085. {
  2086. int opc = GET_FIELD (insn, 0, 5);
  2087. if (opc == 0x13 || opc == 0x1b)
  2088. {
  2089. if (GET_FIELD (insn, 18, 18) == 1)
  2090. fputs_filtered (",mb ", info);
  2091. else
  2092. fputs_filtered (",ma ", info);
  2093. }
  2094. else if (opc == 0x17 || opc == 0x1f)
  2095. {
  2096. if (GET_FIELD (insn, 31, 31) == 1)
  2097. fputs_filtered (",ma ", info);
  2098. else
  2099. fputs_filtered (",mb ", info);
  2100. }
  2101. else
  2102. fputs_filtered (" ", info);
  2103. break;
  2104. }
  2105. }
  2106. break;
  2107. /* Handle conditions. */
  2108. case '?':
  2109. {
  2110. s++;
  2111. switch (*s)
  2112. {
  2113. case 'f':
  2114. (*info->fprintf_func)
  2115. (info->stream, "%s ",
  2116. float_comp_names[GET_FIELD (insn, 27, 31)]);
  2117. break;
  2118. /* These four conditions are for the set of instructions
  2119. which distinguish true/false conditions by opcode
  2120. rather than by the 'f' bit (sigh): comb, comib,
  2121. addb, addib. */
  2122. case 't':
  2123. fputs_filtered
  2124. (compare_cond_names[GET_FIELD (insn, 16, 18)], info);
  2125. break;
  2126. case 'n':
  2127. fputs_filtered
  2128. (compare_cond_names[GET_FIELD (insn, 16, 18)
  2129. + GET_FIELD (insn, 4, 4) * 8],
  2130. info);
  2131. break;
  2132. case 'N':
  2133. fputs_filtered
  2134. (compare_cond_64_names[GET_FIELD (insn, 16, 18)
  2135. + GET_FIELD (insn, 2, 2) * 8],
  2136. info);
  2137. break;
  2138. case 'Q':
  2139. fputs_filtered
  2140. (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)],
  2141. info);
  2142. break;
  2143. case '@':
  2144. fputs_filtered
  2145. (add_cond_names[GET_FIELD (insn, 16, 18)
  2146. + GET_FIELD (insn, 4, 4) * 8],
  2147. info);
  2148. break;
  2149. case 's':
  2150. (*info->fprintf_func)
  2151. (info->stream, "%s ",
  2152. compare_cond_names[GET_COND (insn)]);
  2153. break;
  2154. case 'S':
  2155. (*info->fprintf_func)
  2156. (info->stream, "%s ",
  2157. compare_cond_64_names[GET_COND (insn)]);
  2158. break;
  2159. case 'a':
  2160. (*info->fprintf_func)
  2161. (info->stream, "%s ",
  2162. add_cond_names[GET_COND (insn)]);
  2163. break;
  2164. case 'A':
  2165. (*info->fprintf_func)
  2166. (info->stream, "%s ",
  2167. add_cond_64_names[GET_COND (insn)]);
  2168. break;
  2169. case 'd':
  2170. (*info->fprintf_func)
  2171. (info->stream, "%s",
  2172. add_cond_names[GET_FIELD (insn, 16, 18)]);
  2173. break;
  2174. case 'W':
  2175. (*info->fprintf_func)
  2176. (info->stream, "%s",
  2177. wide_add_cond_names[GET_FIELD (insn, 16, 18) +
  2178. GET_FIELD (insn, 4, 4) * 8]);
  2179. break;
  2180. case 'l':
  2181. (*info->fprintf_func)
  2182. (info->stream, "%s ",
  2183. logical_cond_names[GET_COND (insn)]);
  2184. break;
  2185. case 'L':
  2186. (*info->fprintf_func)
  2187. (info->stream, "%s ",
  2188. logical_cond_64_names[GET_COND (insn)]);
  2189. break;
  2190. case 'u':
  2191. (*info->fprintf_func)
  2192. (info->stream, "%s ",
  2193. unit_cond_names[GET_COND (insn)]);
  2194. break;
  2195. case 'U':
  2196. (*info->fprintf_func)
  2197. (info->stream, "%s ",
  2198. unit_cond_64_names[GET_COND (insn)]);
  2199. break;
  2200. case 'y':
  2201. case 'x':
  2202. case 'b':
  2203. (*info->fprintf_func)
  2204. (info->stream, "%s",
  2205. shift_cond_names[GET_FIELD (insn, 16, 18)]);
  2206. /* If the next character in args is 'n', it will handle
  2207. putting out the space. */
  2208. if (s[1] != 'n')
  2209. (*info->fprintf_func) (info->stream, " ");
  2210. break;
  2211. case 'X':
  2212. (*info->fprintf_func)
  2213. (info->stream, "%s ",
  2214. shift_cond_64_names[GET_FIELD (insn, 16, 18)]);
  2215. break;
  2216. case 'B':
  2217. (*info->fprintf_func)
  2218. (info->stream, "%s",
  2219. bb_cond_64_names[GET_FIELD (insn, 16, 16)]);
  2220. /* If the next character in args is 'n', it will handle
  2221. putting out the space. */
  2222. if (s[1] != 'n')
  2223. (*info->fprintf_func) (info->stream, " ");
  2224. break;
  2225. }
  2226. break;
  2227. }
  2228. case 'V':
  2229. fput_const (extract_5_store (insn), info);
  2230. break;
  2231. case 'r':
  2232. fput_const (extract_5r_store (insn), info);
  2233. break;
  2234. case 'R':
  2235. fput_const (extract_5R_store (insn), info);
  2236. break;
  2237. case 'U':
  2238. fput_const (extract_10U_store (insn), info);
  2239. break;
  2240. case 'B':
  2241. case 'Q':
  2242. fput_const (extract_5Q_store (insn), info);
  2243. break;
  2244. case 'i':
  2245. fput_const (extract_11 (insn), info);
  2246. break;
  2247. case 'j':
  2248. fput_const (extract_14 (insn), info);
  2249. break;
  2250. case 'k':
  2251. fputs_filtered ("L%", info);
  2252. fput_const (extract_21 (insn), info);
  2253. break;
  2254. case '<':
  2255. case 'l':
  2256. /* 16-bit long disp., PA2.0 wide only. */
  2257. fput_const (extract_16 (insn), info);
  2258. break;
  2259. case 'n':
  2260. if (insn & 0x2)
  2261. (*info->fprintf_func) (info->stream, ",n ");
  2262. else
  2263. (*info->fprintf_func) (info->stream, " ");
  2264. break;
  2265. case 'N':
  2266. if ((insn & 0x20) && s[1])
  2267. (*info->fprintf_func) (info->stream, ",n ");
  2268. else if (insn & 0x20)
  2269. (*info->fprintf_func) (info->stream, ",n");
  2270. else if (s[1])
  2271. (*info->fprintf_func) (info->stream, " ");
  2272. break;
  2273. case 'w':
  2274. (*info->print_address_func)
  2275. (memaddr + 8 + extract_12 (insn), info);
  2276. break;
  2277. case 'W':
  2278. /* 17 bit PC-relative branch. */
  2279. (*info->print_address_func)
  2280. ((memaddr + 8 + extract_17 (insn)), info);
  2281. break;
  2282. case 'z':
  2283. /* 17 bit displacement. This is an offset from a register
  2284. so it gets disasssembled as just a number, not any sort
  2285. of address. */
  2286. fput_const (extract_17 (insn), info);
  2287. break;
  2288. case 'Z':
  2289. /* addil %r1 implicit output. */
  2290. fputs_filtered ("r1", info);
  2291. break;
  2292. case 'Y':
  2293. /* be,l %sr0,%r31 implicit output. */
  2294. fputs_filtered ("sr0,r31", info);
  2295. break;
  2296. case '@':
  2297. (*info->fprintf_func) (info->stream, "0");
  2298. break;
  2299. case '.':
  2300. (*info->fprintf_func) (info->stream, "%d",
  2301. GET_FIELD (insn, 24, 25));
  2302. break;
  2303. case '*':
  2304. (*info->fprintf_func) (info->stream, "%d",
  2305. GET_FIELD (insn, 22, 25));
  2306. break;
  2307. case '!':
  2308. fputs_filtered ("sar", info);
  2309. break;
  2310. case 'p':
  2311. (*info->fprintf_func) (info->stream, "%d",
  2312. 31 - GET_FIELD (insn, 22, 26));
  2313. break;
  2314. case '~':
  2315. {
  2316. int num;
  2317. num = GET_FIELD (insn, 20, 20) << 5;
  2318. num |= GET_FIELD (insn, 22, 26);
  2319. (*info->fprintf_func) (info->stream, "%d", 63 - num);
  2320. break;
  2321. }
  2322. case 'P':
  2323. (*info->fprintf_func) (info->stream, "%d",
  2324. GET_FIELD (insn, 22, 26));
  2325. break;
  2326. case 'q':
  2327. {
  2328. int num;
  2329. num = GET_FIELD (insn, 20, 20) << 5;
  2330. num |= GET_FIELD (insn, 22, 26);
  2331. (*info->fprintf_func) (info->stream, "%d", num);
  2332. break;
  2333. }
  2334. case 'T':
  2335. (*info->fprintf_func) (info->stream, "%d",
  2336. 32 - GET_FIELD (insn, 27, 31));
  2337. break;
  2338. case '%':
  2339. {
  2340. int num;
  2341. num = (GET_FIELD (insn, 23, 23) + 1) * 32;
  2342. num -= GET_FIELD (insn, 27, 31);
  2343. (*info->fprintf_func) (info->stream, "%d", num);
  2344. break;
  2345. }
  2346. case '|':
  2347. {
  2348. int num;
  2349. num = (GET_FIELD (insn, 19, 19) + 1) * 32;
  2350. num -= GET_FIELD (insn, 27, 31);
  2351. (*info->fprintf_func) (info->stream, "%d", num);
  2352. break;
  2353. }
  2354. case '$':
  2355. fput_const (GET_FIELD (insn, 20, 28), info);
  2356. break;
  2357. case 'A':
  2358. fput_const (GET_FIELD (insn, 6, 18), info);
  2359. break;
  2360. case 'D':
  2361. fput_const (GET_FIELD (insn, 6, 31), info);
  2362. break;
  2363. case 'v':
  2364. (*info->fprintf_func) (info->stream, ",%d",
  2365. GET_FIELD (insn, 23, 25));
  2366. break;
  2367. case 'O':
  2368. fput_const ((GET_FIELD (insn, 6,20) << 5 |
  2369. GET_FIELD (insn, 27, 31)), info);
  2370. break;
  2371. case 'o':
  2372. fput_const (GET_FIELD (insn, 6, 20), info);
  2373. break;
  2374. case '2':
  2375. fput_const ((GET_FIELD (insn, 6, 22) << 5 |
  2376. GET_FIELD (insn, 27, 31)), info);
  2377. break;
  2378. case '1':
  2379. fput_const ((GET_FIELD (insn, 11, 20) << 5 |
  2380. GET_FIELD (insn, 27, 31)), info);
  2381. break;
  2382. case '0':
  2383. fput_const ((GET_FIELD (insn, 16, 20) << 5 |
  2384. GET_FIELD (insn, 27, 31)), info);
  2385. break;
  2386. case 'u':
  2387. (*info->fprintf_func) (info->stream, ",%d",
  2388. GET_FIELD (insn, 23, 25));
  2389. break;
  2390. case 'F':
  2391. /* If no destination completer and not before a completer
  2392. for fcmp, need a space here. */
  2393. if (s[1] == 'G' || s[1] == '?')
  2394. fputs_filtered
  2395. (float_format_names[GET_FIELD (insn, 19, 20)], info);
  2396. else
  2397. (*info->fprintf_func)
  2398. (info->stream, "%s ",
  2399. float_format_names[GET_FIELD (insn, 19, 20)]);
  2400. break;
  2401. case 'G':
  2402. (*info->fprintf_func)
  2403. (info->stream, "%s ",
  2404. float_format_names[GET_FIELD (insn, 17, 18)]);
  2405. break;
  2406. case 'H':
  2407. if (GET_FIELD (insn, 26, 26) == 1)
  2408. (*info->fprintf_func) (info->stream, "%s ",
  2409. float_format_names[0]);
  2410. else
  2411. (*info->fprintf_func) (info->stream, "%s ",
  2412. float_format_names[1]);
  2413. break;
  2414. case 'I':
  2415. /* If no destination completer and not before a completer
  2416. for fcmp, need a space here. */
  2417. if (s[1] == '?')
  2418. fputs_filtered
  2419. (float_format_names[GET_FIELD (insn, 20, 20)], info);
  2420. else
  2421. (*info->fprintf_func)
  2422. (info->stream, "%s ",
  2423. float_format_names[GET_FIELD (insn, 20, 20)]);
  2424. break;
  2425. case 'J':
  2426. fput_const (extract_14 (insn), info);
  2427. break;
  2428. case '#':
  2429. {
  2430. int sign = GET_FIELD (insn, 31, 31);
  2431. int imm10 = GET_FIELD (insn, 18, 27);
  2432. int disp;
  2433. if (sign)
  2434. disp = (-1 << 10) | imm10;
  2435. else
  2436. disp = imm10;
  2437. disp <<= 3;
  2438. fput_const (disp, info);
  2439. break;
  2440. }
  2441. case 'K':
  2442. case 'd':
  2443. {
  2444. int sign = GET_FIELD (insn, 31, 31);
  2445. int imm11 = GET_FIELD (insn, 18, 28);
  2446. int disp;
  2447. if (sign)
  2448. disp = (-1 << 11) | imm11;
  2449. else
  2450. disp = imm11;
  2451. disp <<= 2;
  2452. fput_const (disp, info);
  2453. break;
  2454. }
  2455. case '>':
  2456. case 'y':
  2457. {
  2458. /* 16-bit long disp., PA2.0 wide only. */
  2459. int disp = extract_16 (insn);
  2460. disp &= ~3;
  2461. fput_const (disp, info);
  2462. break;
  2463. }
  2464. case '&':
  2465. {
  2466. /* 16-bit long disp., PA2.0 wide only. */
  2467. int disp = extract_16 (insn);
  2468. disp &= ~7;
  2469. fput_const (disp, info);
  2470. break;
  2471. }
  2472. case '_':
  2473. break; /* Dealt with by '{' */
  2474. case '{':
  2475. {
  2476. int sub = GET_FIELD (insn, 14, 16);
  2477. int df = GET_FIELD (insn, 17, 18);
  2478. int sf = GET_FIELD (insn, 19, 20);
  2479. const char * const * source = float_format_names;
  2480. const char * const * dest = float_format_names;
  2481. const char *t = "";
  2482. if (sub == 4)
  2483. {
  2484. fputs_filtered (",UND ", info);
  2485. break;
  2486. }
  2487. if ((sub & 3) == 3)
  2488. t = ",t";
  2489. if ((sub & 3) == 1)
  2490. source = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names;
  2491. if (sub & 2)
  2492. dest = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names;
  2493. (*info->fprintf_func) (info->stream, "%s%s%s ",
  2494. t, source[sf], dest[df]);
  2495. break;
  2496. }
  2497. case 'm':
  2498. {
  2499. int y = GET_FIELD (insn, 16, 18);
  2500. if (y != 1)
  2501. fput_const ((y ^ 1) - 1, info);
  2502. }
  2503. break;
  2504. case 'h':
  2505. {
  2506. int cbit;
  2507. cbit = GET_FIELD (insn, 16, 18);
  2508. if (cbit > 0)
  2509. (*info->fprintf_func) (info->stream, ",%d", cbit - 1);
  2510. break;
  2511. }
  2512. case '=':
  2513. {
  2514. int cond = GET_FIELD (insn, 27, 31);
  2515. switch (cond)
  2516. {
  2517. case 0: fputs_filtered (" ", info); break;
  2518. case 1: fputs_filtered ("acc ", info); break;
  2519. case 2: fputs_filtered ("rej ", info); break;
  2520. case 5: fputs_filtered ("acc8 ", info); break;
  2521. case 6: fputs_filtered ("rej8 ", info); break;
  2522. case 9: fputs_filtered ("acc6 ", info); break;
  2523. case 13: fputs_filtered ("acc4 ", info); break;
  2524. case 17: fputs_filtered ("acc2 ", info); break;
  2525. default: break;
  2526. }
  2527. break;
  2528. }
  2529. case 'X':
  2530. (*info->print_address_func)
  2531. (memaddr + 8 + extract_22 (insn), info);
  2532. break;
  2533. case 'L':
  2534. fputs_filtered (",rp", info);
  2535. break;
  2536. default:
  2537. (*info->fprintf_func) (info->stream, "%c", *s);
  2538. break;
  2539. }
  2540. }
  2541. return sizeof (insn);
  2542. }
  2543. }
  2544. (*info->fprintf_func) (info->stream, "#%8x", insn);
  2545. return sizeof (insn);
  2546. }