hppa-dis.c 100 KB

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