dis.c 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057
  1. /*
  2. * Disassemble s390 instructions.
  3. *
  4. * Copyright IBM Corp. 2007
  5. * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
  6. */
  7. #include <linux/sched.h>
  8. #include <linux/kernel.h>
  9. #include <linux/string.h>
  10. #include <linux/errno.h>
  11. #include <linux/ptrace.h>
  12. #include <linux/timer.h>
  13. #include <linux/mm.h>
  14. #include <linux/smp.h>
  15. #include <linux/init.h>
  16. #include <linux/interrupt.h>
  17. #include <linux/delay.h>
  18. #include <linux/module.h>
  19. #include <linux/kallsyms.h>
  20. #include <linux/reboot.h>
  21. #include <linux/kprobes.h>
  22. #include <linux/kdebug.h>
  23. #include <asm/uaccess.h>
  24. #include <asm/dis.h>
  25. #include <asm/io.h>
  26. #include <linux/atomic.h>
  27. #include <asm/mathemu.h>
  28. #include <asm/cpcmd.h>
  29. #include <asm/lowcore.h>
  30. #include <asm/debug.h>
  31. #include <asm/irq.h>
  32. enum {
  33. UNUSED, /* Indicates the end of the operand list */
  34. R_8, /* GPR starting at position 8 */
  35. R_12, /* GPR starting at position 12 */
  36. R_16, /* GPR starting at position 16 */
  37. R_20, /* GPR starting at position 20 */
  38. R_24, /* GPR starting at position 24 */
  39. R_28, /* GPR starting at position 28 */
  40. R_32, /* GPR starting at position 32 */
  41. F_8, /* FPR starting at position 8 */
  42. F_12, /* FPR starting at position 12 */
  43. F_16, /* FPR starting at position 16 */
  44. F_20, /* FPR starting at position 16 */
  45. F_24, /* FPR starting at position 24 */
  46. F_28, /* FPR starting at position 28 */
  47. F_32, /* FPR starting at position 32 */
  48. A_8, /* Access reg. starting at position 8 */
  49. A_12, /* Access reg. starting at position 12 */
  50. A_24, /* Access reg. starting at position 24 */
  51. A_28, /* Access reg. starting at position 28 */
  52. C_8, /* Control reg. starting at position 8 */
  53. C_12, /* Control reg. starting at position 12 */
  54. V_8, /* Vector reg. starting at position 8, extension bit at 36 */
  55. V_12, /* Vector reg. starting at position 12, extension bit at 37 */
  56. V_16, /* Vector reg. starting at position 16, extension bit at 38 */
  57. V_32, /* Vector reg. starting at position 32, extension bit at 39 */
  58. W_12, /* Vector reg. at bit 12, extension at bit 37, used as index */
  59. B_16, /* Base register starting at position 16 */
  60. B_32, /* Base register starting at position 32 */
  61. X_12, /* Index register starting at position 12 */
  62. D_20, /* Displacement starting at position 20 */
  63. D_36, /* Displacement starting at position 36 */
  64. D20_20, /* 20 bit displacement starting at 20 */
  65. L4_8, /* 4 bit length starting at position 8 */
  66. L4_12, /* 4 bit length starting at position 12 */
  67. L8_8, /* 8 bit length starting at position 8 */
  68. U4_8, /* 4 bit unsigned value starting at 8 */
  69. U4_12, /* 4 bit unsigned value starting at 12 */
  70. U4_16, /* 4 bit unsigned value starting at 16 */
  71. U4_20, /* 4 bit unsigned value starting at 20 */
  72. U4_24, /* 4 bit unsigned value starting at 24 */
  73. U4_28, /* 4 bit unsigned value starting at 28 */
  74. U4_32, /* 4 bit unsigned value starting at 32 */
  75. U4_36, /* 4 bit unsigned value starting at 36 */
  76. U8_8, /* 8 bit unsigned value starting at 8 */
  77. U8_16, /* 8 bit unsigned value starting at 16 */
  78. U8_24, /* 8 bit unsigned value starting at 24 */
  79. U8_32, /* 8 bit unsigned value starting at 32 */
  80. I8_8, /* 8 bit signed value starting at 8 */
  81. I8_16, /* 8 bit signed value starting at 16 */
  82. I8_24, /* 8 bit signed value starting at 24 */
  83. I8_32, /* 8 bit signed value starting at 32 */
  84. J12_12, /* PC relative offset at 12 */
  85. I16_16, /* 16 bit signed value starting at 16 */
  86. I16_32, /* 32 bit signed value starting at 16 */
  87. U16_16, /* 16 bit unsigned value starting at 16 */
  88. U16_32, /* 32 bit unsigned value starting at 16 */
  89. J16_16, /* PC relative jump offset at 16 */
  90. J16_32, /* PC relative offset at 16 */
  91. I24_24, /* 24 bit signed value starting at 24 */
  92. J32_16, /* PC relative long offset at 16 */
  93. I32_16, /* 32 bit signed value starting at 16 */
  94. U32_16, /* 32 bit unsigned value starting at 16 */
  95. M_16, /* 4 bit optional mask starting at 16 */
  96. M_20, /* 4 bit optional mask starting at 20 */
  97. M_24, /* 4 bit optional mask starting at 24 */
  98. M_28, /* 4 bit optional mask starting at 28 */
  99. M_32, /* 4 bit optional mask starting at 32 */
  100. RO_28, /* optional GPR starting at position 28 */
  101. };
  102. /*
  103. * Enumeration of the different instruction formats.
  104. * For details consult the principles of operation.
  105. */
  106. enum {
  107. INSTR_INVALID,
  108. INSTR_E,
  109. INSTR_IE_UU,
  110. INSTR_MII_UPI,
  111. INSTR_RIE_R0IU, INSTR_RIE_R0UU, INSTR_RIE_RRP, INSTR_RIE_RRPU,
  112. INSTR_RIE_RRUUU, INSTR_RIE_RUPI, INSTR_RIE_RUPU, INSTR_RIE_RRI0,
  113. INSTR_RIL_RI, INSTR_RIL_RP, INSTR_RIL_RU, INSTR_RIL_UP,
  114. INSTR_RIS_R0RDU, INSTR_RIS_R0UU, INSTR_RIS_RURDI, INSTR_RIS_RURDU,
  115. INSTR_RI_RI, INSTR_RI_RP, INSTR_RI_RU, INSTR_RI_UP,
  116. INSTR_RRE_00, INSTR_RRE_0R, INSTR_RRE_AA, INSTR_RRE_AR, INSTR_RRE_F0,
  117. INSTR_RRE_FF, INSTR_RRE_FR, INSTR_RRE_R0, INSTR_RRE_RA, INSTR_RRE_RF,
  118. INSTR_RRE_RR, INSTR_RRE_RR_OPT,
  119. INSTR_RRF_0UFF, INSTR_RRF_F0FF, INSTR_RRF_F0FF2, INSTR_RRF_F0FR,
  120. INSTR_RRF_FFRU, INSTR_RRF_FUFF, INSTR_RRF_FUFF2, INSTR_RRF_M0RR,
  121. INSTR_RRF_R0RR, INSTR_RRF_R0RR2, INSTR_RRF_RMRR, INSTR_RRF_RURR,
  122. INSTR_RRF_U0FF, INSTR_RRF_U0RF, INSTR_RRF_U0RR, INSTR_RRF_UUFF,
  123. INSTR_RRF_UUFR, INSTR_RRF_UURF,
  124. INSTR_RRR_F0FF, INSTR_RRS_RRRDU,
  125. INSTR_RR_FF, INSTR_RR_R0, INSTR_RR_RR, INSTR_RR_U0, INSTR_RR_UR,
  126. INSTR_RSE_CCRD, INSTR_RSE_RRRD, INSTR_RSE_RURD,
  127. INSTR_RSI_RRP,
  128. INSTR_RSL_LRDFU, INSTR_RSL_R0RD,
  129. INSTR_RSY_AARD, INSTR_RSY_CCRD, INSTR_RSY_RRRD, INSTR_RSY_RURD,
  130. INSTR_RSY_RDRM, INSTR_RSY_RMRD,
  131. INSTR_RS_AARD, INSTR_RS_CCRD, INSTR_RS_R0RD, INSTR_RS_RRRD,
  132. INSTR_RS_RURD,
  133. INSTR_RXE_FRRD, INSTR_RXE_RRRD, INSTR_RXE_RRRDM,
  134. INSTR_RXF_FRRDF,
  135. INSTR_RXY_FRRD, INSTR_RXY_RRRD, INSTR_RXY_URRD,
  136. INSTR_RX_FRRD, INSTR_RX_RRRD, INSTR_RX_URRD,
  137. INSTR_SIL_RDI, INSTR_SIL_RDU,
  138. INSTR_SIY_IRD, INSTR_SIY_URD,
  139. INSTR_SI_URD,
  140. INSTR_SMI_U0RDP,
  141. INSTR_SSE_RDRD,
  142. INSTR_SSF_RRDRD, INSTR_SSF_RRDRD2,
  143. INSTR_SS_L0RDRD, INSTR_SS_LIRDRD, INSTR_SS_LLRDRD, INSTR_SS_RRRDRD,
  144. INSTR_SS_RRRDRD2, INSTR_SS_RRRDRD3,
  145. INSTR_S_00, INSTR_S_RD,
  146. INSTR_VRI_V0IM, INSTR_VRI_V0I0, INSTR_VRI_V0IIM, INSTR_VRI_VVIM,
  147. INSTR_VRI_VVV0IM, INSTR_VRI_VVV0I0, INSTR_VRI_VVIMM,
  148. INSTR_VRR_VV00MMM, INSTR_VRR_VV000MM, INSTR_VRR_VV0000M,
  149. INSTR_VRR_VV00000, INSTR_VRR_VVV0M0M, INSTR_VRR_VV00M0M,
  150. INSTR_VRR_VVV000M, INSTR_VRR_VVV000V, INSTR_VRR_VVV0000,
  151. INSTR_VRR_VVV0MMM, INSTR_VRR_VVV00MM, INSTR_VRR_VVVMM0V,
  152. INSTR_VRR_VVVM0MV, INSTR_VRR_VVVM00V, INSTR_VRR_VRR0000,
  153. INSTR_VRS_VVRDM, INSTR_VRS_VVRD0, INSTR_VRS_VRRDM, INSTR_VRS_VRRD0,
  154. INSTR_VRS_RVRDM,
  155. INSTR_VRV_VVRDM, INSTR_VRV_VWRDM,
  156. INSTR_VRX_VRRDM, INSTR_VRX_VRRD0,
  157. };
  158. static const struct s390_operand operands[] =
  159. {
  160. [UNUSED] = { 0, 0, 0 },
  161. [R_8] = { 4, 8, OPERAND_GPR },
  162. [R_12] = { 4, 12, OPERAND_GPR },
  163. [R_16] = { 4, 16, OPERAND_GPR },
  164. [R_20] = { 4, 20, OPERAND_GPR },
  165. [R_24] = { 4, 24, OPERAND_GPR },
  166. [R_28] = { 4, 28, OPERAND_GPR },
  167. [R_32] = { 4, 32, OPERAND_GPR },
  168. [F_8] = { 4, 8, OPERAND_FPR },
  169. [F_12] = { 4, 12, OPERAND_FPR },
  170. [F_16] = { 4, 16, OPERAND_FPR },
  171. [F_20] = { 4, 16, OPERAND_FPR },
  172. [F_24] = { 4, 24, OPERAND_FPR },
  173. [F_28] = { 4, 28, OPERAND_FPR },
  174. [F_32] = { 4, 32, OPERAND_FPR },
  175. [A_8] = { 4, 8, OPERAND_AR },
  176. [A_12] = { 4, 12, OPERAND_AR },
  177. [A_24] = { 4, 24, OPERAND_AR },
  178. [A_28] = { 4, 28, OPERAND_AR },
  179. [C_8] = { 4, 8, OPERAND_CR },
  180. [C_12] = { 4, 12, OPERAND_CR },
  181. [V_8] = { 4, 8, OPERAND_VR },
  182. [V_12] = { 4, 12, OPERAND_VR },
  183. [V_16] = { 4, 16, OPERAND_VR },
  184. [V_32] = { 4, 32, OPERAND_VR },
  185. [W_12] = { 4, 12, OPERAND_INDEX | OPERAND_VR },
  186. [B_16] = { 4, 16, OPERAND_BASE | OPERAND_GPR },
  187. [B_32] = { 4, 32, OPERAND_BASE | OPERAND_GPR },
  188. [X_12] = { 4, 12, OPERAND_INDEX | OPERAND_GPR },
  189. [D_20] = { 12, 20, OPERAND_DISP },
  190. [D_36] = { 12, 36, OPERAND_DISP },
  191. [D20_20] = { 20, 20, OPERAND_DISP | OPERAND_SIGNED },
  192. [L4_8] = { 4, 8, OPERAND_LENGTH },
  193. [L4_12] = { 4, 12, OPERAND_LENGTH },
  194. [L8_8] = { 8, 8, OPERAND_LENGTH },
  195. [U4_8] = { 4, 8, 0 },
  196. [U4_12] = { 4, 12, 0 },
  197. [U4_16] = { 4, 16, 0 },
  198. [U4_20] = { 4, 20, 0 },
  199. [U4_24] = { 4, 24, 0 },
  200. [U4_28] = { 4, 28, 0 },
  201. [U4_32] = { 4, 32, 0 },
  202. [U4_36] = { 4, 36, 0 },
  203. [U8_8] = { 8, 8, 0 },
  204. [U8_16] = { 8, 16, 0 },
  205. [U8_24] = { 8, 24, 0 },
  206. [U8_32] = { 8, 32, 0 },
  207. [J12_12] = { 12, 12, OPERAND_PCREL },
  208. [I8_8] = { 8, 8, OPERAND_SIGNED },
  209. [I8_16] = { 8, 16, OPERAND_SIGNED },
  210. [I8_24] = { 8, 24, OPERAND_SIGNED },
  211. [I8_32] = { 8, 32, OPERAND_SIGNED },
  212. [I16_32] = { 16, 32, OPERAND_SIGNED },
  213. [I16_16] = { 16, 16, OPERAND_SIGNED },
  214. [U16_16] = { 16, 16, 0 },
  215. [U16_32] = { 16, 32, 0 },
  216. [J16_16] = { 16, 16, OPERAND_PCREL },
  217. [J16_32] = { 16, 32, OPERAND_PCREL },
  218. [I24_24] = { 24, 24, OPERAND_SIGNED },
  219. [J32_16] = { 32, 16, OPERAND_PCREL },
  220. [I32_16] = { 32, 16, OPERAND_SIGNED },
  221. [U32_16] = { 32, 16, 0 },
  222. [M_16] = { 4, 16, 0 },
  223. [M_20] = { 4, 20, 0 },
  224. [M_24] = { 4, 24, 0 },
  225. [M_28] = { 4, 28, 0 },
  226. [M_32] = { 4, 32, 0 },
  227. [RO_28] = { 4, 28, OPERAND_GPR }
  228. };
  229. static const unsigned char formats[][7] = {
  230. [INSTR_E] = { 0xff, 0,0,0,0,0,0 },
  231. [INSTR_IE_UU] = { 0xff, U4_24,U4_28,0,0,0,0 },
  232. [INSTR_MII_UPI] = { 0xff, U4_8,J12_12,I24_24 },
  233. [INSTR_RIE_R0IU] = { 0xff, R_8,I16_16,U4_32,0,0,0 },
  234. [INSTR_RIE_R0UU] = { 0xff, R_8,U16_16,U4_32,0,0,0 },
  235. [INSTR_RIE_RRI0] = { 0xff, R_8,R_12,I16_16,0,0,0 },
  236. [INSTR_RIE_RRPU] = { 0xff, R_8,R_12,U4_32,J16_16,0,0 },
  237. [INSTR_RIE_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 },
  238. [INSTR_RIE_RRUUU] = { 0xff, R_8,R_12,U8_16,U8_24,U8_32,0 },
  239. [INSTR_RIE_RUPI] = { 0xff, R_8,I8_32,U4_12,J16_16,0,0 },
  240. [INSTR_RIE_RUPU] = { 0xff, R_8,U8_32,U4_12,J16_16,0,0 },
  241. [INSTR_RIL_RI] = { 0x0f, R_8,I32_16,0,0,0,0 },
  242. [INSTR_RIL_RP] = { 0x0f, R_8,J32_16,0,0,0,0 },
  243. [INSTR_RIL_RU] = { 0x0f, R_8,U32_16,0,0,0,0 },
  244. [INSTR_RIL_UP] = { 0x0f, U4_8,J32_16,0,0,0,0 },
  245. [INSTR_RIS_R0RDU] = { 0xff, R_8,U8_32,D_20,B_16,0,0 },
  246. [INSTR_RIS_RURDI] = { 0xff, R_8,I8_32,U4_12,D_20,B_16,0 },
  247. [INSTR_RIS_RURDU] = { 0xff, R_8,U8_32,U4_12,D_20,B_16,0 },
  248. [INSTR_RI_RI] = { 0x0f, R_8,I16_16,0,0,0,0 },
  249. [INSTR_RI_RP] = { 0x0f, R_8,J16_16,0,0,0,0 },
  250. [INSTR_RI_RU] = { 0x0f, R_8,U16_16,0,0,0,0 },
  251. [INSTR_RI_UP] = { 0x0f, U4_8,J16_16,0,0,0,0 },
  252. [INSTR_RRE_00] = { 0xff, 0,0,0,0,0,0 },
  253. [INSTR_RRE_0R] = { 0xff, R_28,0,0,0,0,0 },
  254. [INSTR_RRE_AA] = { 0xff, A_24,A_28,0,0,0,0 },
  255. [INSTR_RRE_AR] = { 0xff, A_24,R_28,0,0,0,0 },
  256. [INSTR_RRE_F0] = { 0xff, F_24,0,0,0,0,0 },
  257. [INSTR_RRE_FF] = { 0xff, F_24,F_28,0,0,0,0 },
  258. [INSTR_RRE_FR] = { 0xff, F_24,R_28,0,0,0,0 },
  259. [INSTR_RRE_R0] = { 0xff, R_24,0,0,0,0,0 },
  260. [INSTR_RRE_RA] = { 0xff, R_24,A_28,0,0,0,0 },
  261. [INSTR_RRE_RF] = { 0xff, R_24,F_28,0,0,0,0 },
  262. [INSTR_RRE_RR] = { 0xff, R_24,R_28,0,0,0,0 },
  263. [INSTR_RRE_RR_OPT]= { 0xff, R_24,RO_28,0,0,0,0 },
  264. [INSTR_RRF_0UFF] = { 0xff, F_24,F_28,U4_20,0,0,0 },
  265. [INSTR_RRF_F0FF2] = { 0xff, F_24,F_16,F_28,0,0,0 },
  266. [INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 },
  267. [INSTR_RRF_F0FR] = { 0xff, F_24,F_16,R_28,0,0,0 },
  268. [INSTR_RRF_FFRU] = { 0xff, F_24,F_16,R_28,U4_20,0,0 },
  269. [INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 },
  270. [INSTR_RRF_FUFF2] = { 0xff, F_24,F_28,F_16,U4_20,0,0 },
  271. [INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 },
  272. [INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 },
  273. [INSTR_RRF_R0RR2] = { 0xff, R_24,R_28,R_16,0,0,0 },
  274. [INSTR_RRF_RMRR] = { 0xff, R_24,R_16,R_28,M_20,0,0 },
  275. [INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 },
  276. [INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 },
  277. [INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 },
  278. [INSTR_RRF_U0RR] = { 0xff, R_24,R_28,U4_16,0,0,0 },
  279. [INSTR_RRF_UUFF] = { 0xff, F_24,U4_16,F_28,U4_20,0,0 },
  280. [INSTR_RRF_UUFR] = { 0xff, F_24,U4_16,R_28,U4_20,0,0 },
  281. [INSTR_RRF_UURF] = { 0xff, R_24,U4_16,F_28,U4_20,0,0 },
  282. [INSTR_RRR_F0FF] = { 0xff, F_24,F_28,F_16,0,0,0 },
  283. [INSTR_RRS_RRRDU] = { 0xff, R_8,R_12,U4_32,D_20,B_16,0 },
  284. [INSTR_RR_FF] = { 0xff, F_8,F_12,0,0,0,0 },
  285. [INSTR_RR_R0] = { 0xff, R_8, 0,0,0,0,0 },
  286. [INSTR_RR_RR] = { 0xff, R_8,R_12,0,0,0,0 },
  287. [INSTR_RR_U0] = { 0xff, U8_8, 0,0,0,0,0 },
  288. [INSTR_RR_UR] = { 0xff, U4_8,R_12,0,0,0,0 },
  289. [INSTR_RSE_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 },
  290. [INSTR_RSE_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 },
  291. [INSTR_RSE_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 },
  292. [INSTR_RSI_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 },
  293. [INSTR_RSL_LRDFU] = { 0xff, F_32,D_20,L4_8,B_16,U4_36,0 },
  294. [INSTR_RSL_R0RD] = { 0xff, D_20,L4_8,B_16,0,0,0 },
  295. [INSTR_RSY_AARD] = { 0xff, A_8,A_12,D20_20,B_16,0,0 },
  296. [INSTR_RSY_CCRD] = { 0xff, C_8,C_12,D20_20,B_16,0,0 },
  297. [INSTR_RSY_RDRM] = { 0xff, R_8,D20_20,B_16,U4_12,0,0 },
  298. [INSTR_RSY_RMRD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 },
  299. [INSTR_RSY_RRRD] = { 0xff, R_8,R_12,D20_20,B_16,0,0 },
  300. [INSTR_RSY_RURD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 },
  301. [INSTR_RS_AARD] = { 0xff, A_8,A_12,D_20,B_16,0,0 },
  302. [INSTR_RS_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 },
  303. [INSTR_RS_R0RD] = { 0xff, R_8,D_20,B_16,0,0,0 },
  304. [INSTR_RS_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 },
  305. [INSTR_RS_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 },
  306. [INSTR_RXE_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 },
  307. [INSTR_RXE_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 },
  308. [INSTR_RXE_RRRDM] = { 0xff, R_8,D_20,X_12,B_16,M_32,0 },
  309. [INSTR_RXF_FRRDF] = { 0xff, F_32,F_8,D_20,X_12,B_16,0 },
  310. [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },
  311. [INSTR_RXY_RRRD] = { 0xff, R_8,D20_20,X_12,B_16,0,0 },
  312. [INSTR_RXY_URRD] = { 0xff, U4_8,D20_20,X_12,B_16,0,0 },
  313. [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 },
  314. [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 },
  315. [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 },
  316. [INSTR_SIL_RDI] = { 0xff, D_20,B_16,I16_32,0,0,0 },
  317. [INSTR_SIL_RDU] = { 0xff, D_20,B_16,U16_32,0,0,0 },
  318. [INSTR_SIY_IRD] = { 0xff, D20_20,B_16,I8_8,0,0,0 },
  319. [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 },
  320. [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 },
  321. [INSTR_SMI_U0RDP] = { 0xff, U4_8,J16_32,D_20,B_16,0,0 },
  322. [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 },
  323. [INSTR_SSF_RRDRD] = { 0x0f, D_20,B_16,D_36,B_32,R_8,0 },
  324. [INSTR_SSF_RRDRD2]= { 0x0f, R_8,D_20,B_16,D_36,B_32,0 },
  325. [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 },
  326. [INSTR_SS_LIRDRD] = { 0xff, D_20,L4_8,B_16,D_36,B_32,U4_12 },
  327. [INSTR_SS_LLRDRD] = { 0xff, D_20,L4_8,B_16,D_36,L4_12,B_32 },
  328. [INSTR_SS_RRRDRD2]= { 0xff, R_8,D_20,B_16,R_12,D_36,B_32 },
  329. [INSTR_SS_RRRDRD3]= { 0xff, R_8,R_12,D_20,B_16,D_36,B_32 },
  330. [INSTR_SS_RRRDRD] = { 0xff, D_20,R_8,B_16,D_36,B_32,R_12 },
  331. [INSTR_S_00] = { 0xff, 0,0,0,0,0,0 },
  332. [INSTR_S_RD] = { 0xff, D_20,B_16,0,0,0,0 },
  333. [INSTR_VRI_V0IM] = { 0xff, V_8,I16_16,M_32,0,0,0 },
  334. [INSTR_VRI_V0I0] = { 0xff, V_8,I16_16,0,0,0,0 },
  335. [INSTR_VRI_V0IIM] = { 0xff, V_8,I8_16,I8_24,M_32,0,0 },
  336. [INSTR_VRI_VVIM] = { 0xff, V_8,I16_16,V_12,M_32,0,0 },
  337. [INSTR_VRI_VVV0IM]= { 0xff, V_8,V_12,V_16,I8_24,M_32,0 },
  338. [INSTR_VRI_VVV0I0]= { 0xff, V_8,V_12,V_16,I8_24,0,0 },
  339. [INSTR_VRI_VVIMM] = { 0xff, V_8,V_12,I16_16,M_32,M_28,0 },
  340. [INSTR_VRR_VV00MMM]={ 0xff, V_8,V_12,M_32,M_28,M_24,0 },
  341. [INSTR_VRR_VV000MM]={ 0xff, V_8,V_12,M_32,M_28,0,0 },
  342. [INSTR_VRR_VV0000M]={ 0xff, V_8,V_12,M_32,0,0,0 },
  343. [INSTR_VRR_VV00000]={ 0xff, V_8,V_12,0,0,0,0 },
  344. [INSTR_VRR_VVV0M0M]={ 0xff, V_8,V_12,V_16,M_32,M_24,0 },
  345. [INSTR_VRR_VV00M0M]={ 0xff, V_8,V_12,M_32,M_24,0,0 },
  346. [INSTR_VRR_VVV000M]={ 0xff, V_8,V_12,V_16,M_32,0,0 },
  347. [INSTR_VRR_VVV000V]={ 0xff, V_8,V_12,V_16,V_32,0,0 },
  348. [INSTR_VRR_VVV0000]={ 0xff, V_8,V_12,V_16,0,0,0 },
  349. [INSTR_VRR_VVV0MMM]={ 0xff, V_8,V_12,V_16,M_32,M_28,M_24 },
  350. [INSTR_VRR_VVV00MM]={ 0xff, V_8,V_12,V_16,M_32,M_28,0 },
  351. [INSTR_VRR_VVVMM0V]={ 0xff, V_8,V_12,V_16,V_32,M_20,M_24 },
  352. [INSTR_VRR_VVVM0MV]={ 0xff, V_8,V_12,V_16,V_32,M_28,M_20 },
  353. [INSTR_VRR_VVVM00V]={ 0xff, V_8,V_12,V_16,V_32,M_20,0 },
  354. [INSTR_VRR_VRR0000]={ 0xff, V_8,R_12,R_16,0,0,0 },
  355. [INSTR_VRS_VVRDM] = { 0xff, V_8,V_12,D_20,B_16,M_32,0 },
  356. [INSTR_VRS_VVRD0] = { 0xff, V_8,V_12,D_20,B_16,0,0 },
  357. [INSTR_VRS_VRRDM] = { 0xff, V_8,R_12,D_20,B_16,M_32,0 },
  358. [INSTR_VRS_VRRD0] = { 0xff, V_8,R_12,D_20,B_16,0,0 },
  359. [INSTR_VRS_RVRDM] = { 0xff, R_8,V_12,D_20,B_16,M_32,0 },
  360. [INSTR_VRV_VVRDM] = { 0xff, V_8,V_12,D_20,B_16,M_32,0 },
  361. [INSTR_VRV_VWRDM] = { 0xff, V_8,D_20,W_12,B_16,M_32,0 },
  362. [INSTR_VRX_VRRDM] = { 0xff, V_8,D_20,X_12,B_16,M_32,0 },
  363. [INSTR_VRX_VRRD0] = { 0xff, V_8,D_20,X_12,B_16,0,0 },
  364. };
  365. enum {
  366. LONG_INSN_ALGHSIK,
  367. LONG_INSN_ALHHHR,
  368. LONG_INSN_ALHHLR,
  369. LONG_INSN_ALHSIK,
  370. LONG_INSN_ALSIHN,
  371. LONG_INSN_CDFBRA,
  372. LONG_INSN_CDGBRA,
  373. LONG_INSN_CDGTRA,
  374. LONG_INSN_CDLFBR,
  375. LONG_INSN_CDLFTR,
  376. LONG_INSN_CDLGBR,
  377. LONG_INSN_CDLGTR,
  378. LONG_INSN_CEFBRA,
  379. LONG_INSN_CEGBRA,
  380. LONG_INSN_CELFBR,
  381. LONG_INSN_CELGBR,
  382. LONG_INSN_CFDBRA,
  383. LONG_INSN_CFEBRA,
  384. LONG_INSN_CFXBRA,
  385. LONG_INSN_CGDBRA,
  386. LONG_INSN_CGDTRA,
  387. LONG_INSN_CGEBRA,
  388. LONG_INSN_CGXBRA,
  389. LONG_INSN_CGXTRA,
  390. LONG_INSN_CLFDBR,
  391. LONG_INSN_CLFDTR,
  392. LONG_INSN_CLFEBR,
  393. LONG_INSN_CLFHSI,
  394. LONG_INSN_CLFXBR,
  395. LONG_INSN_CLFXTR,
  396. LONG_INSN_CLGDBR,
  397. LONG_INSN_CLGDTR,
  398. LONG_INSN_CLGEBR,
  399. LONG_INSN_CLGFRL,
  400. LONG_INSN_CLGHRL,
  401. LONG_INSN_CLGHSI,
  402. LONG_INSN_CLGXBR,
  403. LONG_INSN_CLGXTR,
  404. LONG_INSN_CLHHSI,
  405. LONG_INSN_CXFBRA,
  406. LONG_INSN_CXGBRA,
  407. LONG_INSN_CXGTRA,
  408. LONG_INSN_CXLFBR,
  409. LONG_INSN_CXLFTR,
  410. LONG_INSN_CXLGBR,
  411. LONG_INSN_CXLGTR,
  412. LONG_INSN_FIDBRA,
  413. LONG_INSN_FIEBRA,
  414. LONG_INSN_FIXBRA,
  415. LONG_INSN_LDXBRA,
  416. LONG_INSN_LEDBRA,
  417. LONG_INSN_LEXBRA,
  418. LONG_INSN_LLGFAT,
  419. LONG_INSN_LLGFRL,
  420. LONG_INSN_LLGHRL,
  421. LONG_INSN_LLGTAT,
  422. LONG_INSN_POPCNT,
  423. LONG_INSN_RIEMIT,
  424. LONG_INSN_RINEXT,
  425. LONG_INSN_RISBGN,
  426. LONG_INSN_RISBHG,
  427. LONG_INSN_RISBLG,
  428. LONG_INSN_SLHHHR,
  429. LONG_INSN_SLHHLR,
  430. LONG_INSN_TABORT,
  431. LONG_INSN_TBEGIN,
  432. LONG_INSN_TBEGINC,
  433. LONG_INSN_PCISTG,
  434. LONG_INSN_MPCIFC,
  435. LONG_INSN_STPCIFC,
  436. LONG_INSN_PCISTB,
  437. LONG_INSN_VPOPCT,
  438. LONG_INSN_VERLLV,
  439. LONG_INSN_VESRAV,
  440. LONG_INSN_VESRLV,
  441. LONG_INSN_VSBCBI,
  442. LONG_INSN_STCCTM
  443. };
  444. static char *long_insn_name[] = {
  445. [LONG_INSN_ALGHSIK] = "alghsik",
  446. [LONG_INSN_ALHHHR] = "alhhhr",
  447. [LONG_INSN_ALHHLR] = "alhhlr",
  448. [LONG_INSN_ALHSIK] = "alhsik",
  449. [LONG_INSN_ALSIHN] = "alsihn",
  450. [LONG_INSN_CDFBRA] = "cdfbra",
  451. [LONG_INSN_CDGBRA] = "cdgbra",
  452. [LONG_INSN_CDGTRA] = "cdgtra",
  453. [LONG_INSN_CDLFBR] = "cdlfbr",
  454. [LONG_INSN_CDLFTR] = "cdlftr",
  455. [LONG_INSN_CDLGBR] = "cdlgbr",
  456. [LONG_INSN_CDLGTR] = "cdlgtr",
  457. [LONG_INSN_CEFBRA] = "cefbra",
  458. [LONG_INSN_CEGBRA] = "cegbra",
  459. [LONG_INSN_CELFBR] = "celfbr",
  460. [LONG_INSN_CELGBR] = "celgbr",
  461. [LONG_INSN_CFDBRA] = "cfdbra",
  462. [LONG_INSN_CFEBRA] = "cfebra",
  463. [LONG_INSN_CFXBRA] = "cfxbra",
  464. [LONG_INSN_CGDBRA] = "cgdbra",
  465. [LONG_INSN_CGDTRA] = "cgdtra",
  466. [LONG_INSN_CGEBRA] = "cgebra",
  467. [LONG_INSN_CGXBRA] = "cgxbra",
  468. [LONG_INSN_CGXTRA] = "cgxtra",
  469. [LONG_INSN_CLFDBR] = "clfdbr",
  470. [LONG_INSN_CLFDTR] = "clfdtr",
  471. [LONG_INSN_CLFEBR] = "clfebr",
  472. [LONG_INSN_CLFHSI] = "clfhsi",
  473. [LONG_INSN_CLFXBR] = "clfxbr",
  474. [LONG_INSN_CLFXTR] = "clfxtr",
  475. [LONG_INSN_CLGDBR] = "clgdbr",
  476. [LONG_INSN_CLGDTR] = "clgdtr",
  477. [LONG_INSN_CLGEBR] = "clgebr",
  478. [LONG_INSN_CLGFRL] = "clgfrl",
  479. [LONG_INSN_CLGHRL] = "clghrl",
  480. [LONG_INSN_CLGHSI] = "clghsi",
  481. [LONG_INSN_CLGXBR] = "clgxbr",
  482. [LONG_INSN_CLGXTR] = "clgxtr",
  483. [LONG_INSN_CLHHSI] = "clhhsi",
  484. [LONG_INSN_CXFBRA] = "cxfbra",
  485. [LONG_INSN_CXGBRA] = "cxgbra",
  486. [LONG_INSN_CXGTRA] = "cxgtra",
  487. [LONG_INSN_CXLFBR] = "cxlfbr",
  488. [LONG_INSN_CXLFTR] = "cxlftr",
  489. [LONG_INSN_CXLGBR] = "cxlgbr",
  490. [LONG_INSN_CXLGTR] = "cxlgtr",
  491. [LONG_INSN_FIDBRA] = "fidbra",
  492. [LONG_INSN_FIEBRA] = "fiebra",
  493. [LONG_INSN_FIXBRA] = "fixbra",
  494. [LONG_INSN_LDXBRA] = "ldxbra",
  495. [LONG_INSN_LEDBRA] = "ledbra",
  496. [LONG_INSN_LEXBRA] = "lexbra",
  497. [LONG_INSN_LLGFAT] = "llgfat",
  498. [LONG_INSN_LLGFRL] = "llgfrl",
  499. [LONG_INSN_LLGHRL] = "llghrl",
  500. [LONG_INSN_LLGTAT] = "llgtat",
  501. [LONG_INSN_POPCNT] = "popcnt",
  502. [LONG_INSN_RIEMIT] = "riemit",
  503. [LONG_INSN_RINEXT] = "rinext",
  504. [LONG_INSN_RISBGN] = "risbgn",
  505. [LONG_INSN_RISBHG] = "risbhg",
  506. [LONG_INSN_RISBLG] = "risblg",
  507. [LONG_INSN_SLHHHR] = "slhhhr",
  508. [LONG_INSN_SLHHLR] = "slhhlr",
  509. [LONG_INSN_TABORT] = "tabort",
  510. [LONG_INSN_TBEGIN] = "tbegin",
  511. [LONG_INSN_TBEGINC] = "tbeginc",
  512. [LONG_INSN_PCISTG] = "pcistg",
  513. [LONG_INSN_MPCIFC] = "mpcifc",
  514. [LONG_INSN_STPCIFC] = "stpcifc",
  515. [LONG_INSN_PCISTB] = "pcistb",
  516. [LONG_INSN_VPOPCT] = "vpopct",
  517. [LONG_INSN_VERLLV] = "verllv",
  518. [LONG_INSN_VESRAV] = "vesrav",
  519. [LONG_INSN_VESRLV] = "vesrlv",
  520. [LONG_INSN_VSBCBI] = "vsbcbi",
  521. [LONG_INSN_STCCTM] = "stcctm",
  522. };
  523. static struct s390_insn opcode[] = {
  524. { "bprp", 0xc5, INSTR_MII_UPI },
  525. { "bpp", 0xc7, INSTR_SMI_U0RDP },
  526. { "trtr", 0xd0, INSTR_SS_L0RDRD },
  527. { "lmd", 0xef, INSTR_SS_RRRDRD3 },
  528. { "spm", 0x04, INSTR_RR_R0 },
  529. { "balr", 0x05, INSTR_RR_RR },
  530. { "bctr", 0x06, INSTR_RR_RR },
  531. { "bcr", 0x07, INSTR_RR_UR },
  532. { "svc", 0x0a, INSTR_RR_U0 },
  533. { "bsm", 0x0b, INSTR_RR_RR },
  534. { "bassm", 0x0c, INSTR_RR_RR },
  535. { "basr", 0x0d, INSTR_RR_RR },
  536. { "mvcl", 0x0e, INSTR_RR_RR },
  537. { "clcl", 0x0f, INSTR_RR_RR },
  538. { "lpr", 0x10, INSTR_RR_RR },
  539. { "lnr", 0x11, INSTR_RR_RR },
  540. { "ltr", 0x12, INSTR_RR_RR },
  541. { "lcr", 0x13, INSTR_RR_RR },
  542. { "nr", 0x14, INSTR_RR_RR },
  543. { "clr", 0x15, INSTR_RR_RR },
  544. { "or", 0x16, INSTR_RR_RR },
  545. { "xr", 0x17, INSTR_RR_RR },
  546. { "lr", 0x18, INSTR_RR_RR },
  547. { "cr", 0x19, INSTR_RR_RR },
  548. { "ar", 0x1a, INSTR_RR_RR },
  549. { "sr", 0x1b, INSTR_RR_RR },
  550. { "mr", 0x1c, INSTR_RR_RR },
  551. { "dr", 0x1d, INSTR_RR_RR },
  552. { "alr", 0x1e, INSTR_RR_RR },
  553. { "slr", 0x1f, INSTR_RR_RR },
  554. { "lpdr", 0x20, INSTR_RR_FF },
  555. { "lndr", 0x21, INSTR_RR_FF },
  556. { "ltdr", 0x22, INSTR_RR_FF },
  557. { "lcdr", 0x23, INSTR_RR_FF },
  558. { "hdr", 0x24, INSTR_RR_FF },
  559. { "ldxr", 0x25, INSTR_RR_FF },
  560. { "mxr", 0x26, INSTR_RR_FF },
  561. { "mxdr", 0x27, INSTR_RR_FF },
  562. { "ldr", 0x28, INSTR_RR_FF },
  563. { "cdr", 0x29, INSTR_RR_FF },
  564. { "adr", 0x2a, INSTR_RR_FF },
  565. { "sdr", 0x2b, INSTR_RR_FF },
  566. { "mdr", 0x2c, INSTR_RR_FF },
  567. { "ddr", 0x2d, INSTR_RR_FF },
  568. { "awr", 0x2e, INSTR_RR_FF },
  569. { "swr", 0x2f, INSTR_RR_FF },
  570. { "lper", 0x30, INSTR_RR_FF },
  571. { "lner", 0x31, INSTR_RR_FF },
  572. { "lter", 0x32, INSTR_RR_FF },
  573. { "lcer", 0x33, INSTR_RR_FF },
  574. { "her", 0x34, INSTR_RR_FF },
  575. { "ledr", 0x35, INSTR_RR_FF },
  576. { "axr", 0x36, INSTR_RR_FF },
  577. { "sxr", 0x37, INSTR_RR_FF },
  578. { "ler", 0x38, INSTR_RR_FF },
  579. { "cer", 0x39, INSTR_RR_FF },
  580. { "aer", 0x3a, INSTR_RR_FF },
  581. { "ser", 0x3b, INSTR_RR_FF },
  582. { "mder", 0x3c, INSTR_RR_FF },
  583. { "der", 0x3d, INSTR_RR_FF },
  584. { "aur", 0x3e, INSTR_RR_FF },
  585. { "sur", 0x3f, INSTR_RR_FF },
  586. { "sth", 0x40, INSTR_RX_RRRD },
  587. { "la", 0x41, INSTR_RX_RRRD },
  588. { "stc", 0x42, INSTR_RX_RRRD },
  589. { "ic", 0x43, INSTR_RX_RRRD },
  590. { "ex", 0x44, INSTR_RX_RRRD },
  591. { "bal", 0x45, INSTR_RX_RRRD },
  592. { "bct", 0x46, INSTR_RX_RRRD },
  593. { "bc", 0x47, INSTR_RX_URRD },
  594. { "lh", 0x48, INSTR_RX_RRRD },
  595. { "ch", 0x49, INSTR_RX_RRRD },
  596. { "ah", 0x4a, INSTR_RX_RRRD },
  597. { "sh", 0x4b, INSTR_RX_RRRD },
  598. { "mh", 0x4c, INSTR_RX_RRRD },
  599. { "bas", 0x4d, INSTR_RX_RRRD },
  600. { "cvd", 0x4e, INSTR_RX_RRRD },
  601. { "cvb", 0x4f, INSTR_RX_RRRD },
  602. { "st", 0x50, INSTR_RX_RRRD },
  603. { "lae", 0x51, INSTR_RX_RRRD },
  604. { "n", 0x54, INSTR_RX_RRRD },
  605. { "cl", 0x55, INSTR_RX_RRRD },
  606. { "o", 0x56, INSTR_RX_RRRD },
  607. { "x", 0x57, INSTR_RX_RRRD },
  608. { "l", 0x58, INSTR_RX_RRRD },
  609. { "c", 0x59, INSTR_RX_RRRD },
  610. { "a", 0x5a, INSTR_RX_RRRD },
  611. { "s", 0x5b, INSTR_RX_RRRD },
  612. { "m", 0x5c, INSTR_RX_RRRD },
  613. { "d", 0x5d, INSTR_RX_RRRD },
  614. { "al", 0x5e, INSTR_RX_RRRD },
  615. { "sl", 0x5f, INSTR_RX_RRRD },
  616. { "std", 0x60, INSTR_RX_FRRD },
  617. { "mxd", 0x67, INSTR_RX_FRRD },
  618. { "ld", 0x68, INSTR_RX_FRRD },
  619. { "cd", 0x69, INSTR_RX_FRRD },
  620. { "ad", 0x6a, INSTR_RX_FRRD },
  621. { "sd", 0x6b, INSTR_RX_FRRD },
  622. { "md", 0x6c, INSTR_RX_FRRD },
  623. { "dd", 0x6d, INSTR_RX_FRRD },
  624. { "aw", 0x6e, INSTR_RX_FRRD },
  625. { "sw", 0x6f, INSTR_RX_FRRD },
  626. { "ste", 0x70, INSTR_RX_FRRD },
  627. { "ms", 0x71, INSTR_RX_RRRD },
  628. { "le", 0x78, INSTR_RX_FRRD },
  629. { "ce", 0x79, INSTR_RX_FRRD },
  630. { "ae", 0x7a, INSTR_RX_FRRD },
  631. { "se", 0x7b, INSTR_RX_FRRD },
  632. { "mde", 0x7c, INSTR_RX_FRRD },
  633. { "de", 0x7d, INSTR_RX_FRRD },
  634. { "au", 0x7e, INSTR_RX_FRRD },
  635. { "su", 0x7f, INSTR_RX_FRRD },
  636. { "ssm", 0x80, INSTR_S_RD },
  637. { "lpsw", 0x82, INSTR_S_RD },
  638. { "diag", 0x83, INSTR_RS_RRRD },
  639. { "brxh", 0x84, INSTR_RSI_RRP },
  640. { "brxle", 0x85, INSTR_RSI_RRP },
  641. { "bxh", 0x86, INSTR_RS_RRRD },
  642. { "bxle", 0x87, INSTR_RS_RRRD },
  643. { "srl", 0x88, INSTR_RS_R0RD },
  644. { "sll", 0x89, INSTR_RS_R0RD },
  645. { "sra", 0x8a, INSTR_RS_R0RD },
  646. { "sla", 0x8b, INSTR_RS_R0RD },
  647. { "srdl", 0x8c, INSTR_RS_R0RD },
  648. { "sldl", 0x8d, INSTR_RS_R0RD },
  649. { "srda", 0x8e, INSTR_RS_R0RD },
  650. { "slda", 0x8f, INSTR_RS_R0RD },
  651. { "stm", 0x90, INSTR_RS_RRRD },
  652. { "tm", 0x91, INSTR_SI_URD },
  653. { "mvi", 0x92, INSTR_SI_URD },
  654. { "ts", 0x93, INSTR_S_RD },
  655. { "ni", 0x94, INSTR_SI_URD },
  656. { "cli", 0x95, INSTR_SI_URD },
  657. { "oi", 0x96, INSTR_SI_URD },
  658. { "xi", 0x97, INSTR_SI_URD },
  659. { "lm", 0x98, INSTR_RS_RRRD },
  660. { "trace", 0x99, INSTR_RS_RRRD },
  661. { "lam", 0x9a, INSTR_RS_AARD },
  662. { "stam", 0x9b, INSTR_RS_AARD },
  663. { "mvcle", 0xa8, INSTR_RS_RRRD },
  664. { "clcle", 0xa9, INSTR_RS_RRRD },
  665. { "stnsm", 0xac, INSTR_SI_URD },
  666. { "stosm", 0xad, INSTR_SI_URD },
  667. { "sigp", 0xae, INSTR_RS_RRRD },
  668. { "mc", 0xaf, INSTR_SI_URD },
  669. { "lra", 0xb1, INSTR_RX_RRRD },
  670. { "stctl", 0xb6, INSTR_RS_CCRD },
  671. { "lctl", 0xb7, INSTR_RS_CCRD },
  672. { "cs", 0xba, INSTR_RS_RRRD },
  673. { "cds", 0xbb, INSTR_RS_RRRD },
  674. { "clm", 0xbd, INSTR_RS_RURD },
  675. { "stcm", 0xbe, INSTR_RS_RURD },
  676. { "icm", 0xbf, INSTR_RS_RURD },
  677. { "mvn", 0xd1, INSTR_SS_L0RDRD },
  678. { "mvc", 0xd2, INSTR_SS_L0RDRD },
  679. { "mvz", 0xd3, INSTR_SS_L0RDRD },
  680. { "nc", 0xd4, INSTR_SS_L0RDRD },
  681. { "clc", 0xd5, INSTR_SS_L0RDRD },
  682. { "oc", 0xd6, INSTR_SS_L0RDRD },
  683. { "xc", 0xd7, INSTR_SS_L0RDRD },
  684. { "mvck", 0xd9, INSTR_SS_RRRDRD },
  685. { "mvcp", 0xda, INSTR_SS_RRRDRD },
  686. { "mvcs", 0xdb, INSTR_SS_RRRDRD },
  687. { "tr", 0xdc, INSTR_SS_L0RDRD },
  688. { "trt", 0xdd, INSTR_SS_L0RDRD },
  689. { "ed", 0xde, INSTR_SS_L0RDRD },
  690. { "edmk", 0xdf, INSTR_SS_L0RDRD },
  691. { "pku", 0xe1, INSTR_SS_L0RDRD },
  692. { "unpku", 0xe2, INSTR_SS_L0RDRD },
  693. { "mvcin", 0xe8, INSTR_SS_L0RDRD },
  694. { "pka", 0xe9, INSTR_SS_L0RDRD },
  695. { "unpka", 0xea, INSTR_SS_L0RDRD },
  696. { "plo", 0xee, INSTR_SS_RRRDRD2 },
  697. { "srp", 0xf0, INSTR_SS_LIRDRD },
  698. { "mvo", 0xf1, INSTR_SS_LLRDRD },
  699. { "pack", 0xf2, INSTR_SS_LLRDRD },
  700. { "unpk", 0xf3, INSTR_SS_LLRDRD },
  701. { "zap", 0xf8, INSTR_SS_LLRDRD },
  702. { "cp", 0xf9, INSTR_SS_LLRDRD },
  703. { "ap", 0xfa, INSTR_SS_LLRDRD },
  704. { "sp", 0xfb, INSTR_SS_LLRDRD },
  705. { "mp", 0xfc, INSTR_SS_LLRDRD },
  706. { "dp", 0xfd, INSTR_SS_LLRDRD },
  707. { "", 0, INSTR_INVALID }
  708. };
  709. static struct s390_insn opcode_01[] = {
  710. { "ptff", 0x04, INSTR_E },
  711. { "pfpo", 0x0a, INSTR_E },
  712. { "sam64", 0x0e, INSTR_E },
  713. { "pr", 0x01, INSTR_E },
  714. { "upt", 0x02, INSTR_E },
  715. { "sckpf", 0x07, INSTR_E },
  716. { "tam", 0x0b, INSTR_E },
  717. { "sam24", 0x0c, INSTR_E },
  718. { "sam31", 0x0d, INSTR_E },
  719. { "trap2", 0xff, INSTR_E },
  720. { "", 0, INSTR_INVALID }
  721. };
  722. static struct s390_insn opcode_a5[] = {
  723. { "iihh", 0x00, INSTR_RI_RU },
  724. { "iihl", 0x01, INSTR_RI_RU },
  725. { "iilh", 0x02, INSTR_RI_RU },
  726. { "iill", 0x03, INSTR_RI_RU },
  727. { "nihh", 0x04, INSTR_RI_RU },
  728. { "nihl", 0x05, INSTR_RI_RU },
  729. { "nilh", 0x06, INSTR_RI_RU },
  730. { "nill", 0x07, INSTR_RI_RU },
  731. { "oihh", 0x08, INSTR_RI_RU },
  732. { "oihl", 0x09, INSTR_RI_RU },
  733. { "oilh", 0x0a, INSTR_RI_RU },
  734. { "oill", 0x0b, INSTR_RI_RU },
  735. { "llihh", 0x0c, INSTR_RI_RU },
  736. { "llihl", 0x0d, INSTR_RI_RU },
  737. { "llilh", 0x0e, INSTR_RI_RU },
  738. { "llill", 0x0f, INSTR_RI_RU },
  739. { "", 0, INSTR_INVALID }
  740. };
  741. static struct s390_insn opcode_a7[] = {
  742. { "tmhh", 0x02, INSTR_RI_RU },
  743. { "tmhl", 0x03, INSTR_RI_RU },
  744. { "brctg", 0x07, INSTR_RI_RP },
  745. { "lghi", 0x09, INSTR_RI_RI },
  746. { "aghi", 0x0b, INSTR_RI_RI },
  747. { "mghi", 0x0d, INSTR_RI_RI },
  748. { "cghi", 0x0f, INSTR_RI_RI },
  749. { "tmlh", 0x00, INSTR_RI_RU },
  750. { "tmll", 0x01, INSTR_RI_RU },
  751. { "brc", 0x04, INSTR_RI_UP },
  752. { "bras", 0x05, INSTR_RI_RP },
  753. { "brct", 0x06, INSTR_RI_RP },
  754. { "lhi", 0x08, INSTR_RI_RI },
  755. { "ahi", 0x0a, INSTR_RI_RI },
  756. { "mhi", 0x0c, INSTR_RI_RI },
  757. { "chi", 0x0e, INSTR_RI_RI },
  758. { "", 0, INSTR_INVALID }
  759. };
  760. static struct s390_insn opcode_aa[] = {
  761. { { 0, LONG_INSN_RINEXT }, 0x00, INSTR_RI_RI },
  762. { "rion", 0x01, INSTR_RI_RI },
  763. { "tric", 0x02, INSTR_RI_RI },
  764. { "rioff", 0x03, INSTR_RI_RI },
  765. { { 0, LONG_INSN_RIEMIT }, 0x04, INSTR_RI_RI },
  766. { "", 0, INSTR_INVALID }
  767. };
  768. static struct s390_insn opcode_b2[] = {
  769. { "stckf", 0x7c, INSTR_S_RD },
  770. { "lpp", 0x80, INSTR_S_RD },
  771. { "lcctl", 0x84, INSTR_S_RD },
  772. { "lpctl", 0x85, INSTR_S_RD },
  773. { "qsi", 0x86, INSTR_S_RD },
  774. { "lsctl", 0x87, INSTR_S_RD },
  775. { "qctri", 0x8e, INSTR_S_RD },
  776. { "stfle", 0xb0, INSTR_S_RD },
  777. { "lpswe", 0xb2, INSTR_S_RD },
  778. { "srnmb", 0xb8, INSTR_S_RD },
  779. { "srnmt", 0xb9, INSTR_S_RD },
  780. { "lfas", 0xbd, INSTR_S_RD },
  781. { "scctr", 0xe0, INSTR_RRE_RR },
  782. { "spctr", 0xe1, INSTR_RRE_RR },
  783. { "ecctr", 0xe4, INSTR_RRE_RR },
  784. { "epctr", 0xe5, INSTR_RRE_RR },
  785. { "ppa", 0xe8, INSTR_RRF_U0RR },
  786. { "etnd", 0xec, INSTR_RRE_R0 },
  787. { "ecpga", 0xed, INSTR_RRE_RR },
  788. { "tend", 0xf8, INSTR_S_00 },
  789. { "niai", 0xfa, INSTR_IE_UU },
  790. { { 0, LONG_INSN_TABORT }, 0xfc, INSTR_S_RD },
  791. { "stidp", 0x02, INSTR_S_RD },
  792. { "sck", 0x04, INSTR_S_RD },
  793. { "stck", 0x05, INSTR_S_RD },
  794. { "sckc", 0x06, INSTR_S_RD },
  795. { "stckc", 0x07, INSTR_S_RD },
  796. { "spt", 0x08, INSTR_S_RD },
  797. { "stpt", 0x09, INSTR_S_RD },
  798. { "spka", 0x0a, INSTR_S_RD },
  799. { "ipk", 0x0b, INSTR_S_00 },
  800. { "ptlb", 0x0d, INSTR_S_00 },
  801. { "spx", 0x10, INSTR_S_RD },
  802. { "stpx", 0x11, INSTR_S_RD },
  803. { "stap", 0x12, INSTR_S_RD },
  804. { "sie", 0x14, INSTR_S_RD },
  805. { "pc", 0x18, INSTR_S_RD },
  806. { "sac", 0x19, INSTR_S_RD },
  807. { "cfc", 0x1a, INSTR_S_RD },
  808. { "servc", 0x20, INSTR_RRE_RR },
  809. { "ipte", 0x21, INSTR_RRE_RR },
  810. { "ipm", 0x22, INSTR_RRE_R0 },
  811. { "ivsk", 0x23, INSTR_RRE_RR },
  812. { "iac", 0x24, INSTR_RRE_R0 },
  813. { "ssar", 0x25, INSTR_RRE_R0 },
  814. { "epar", 0x26, INSTR_RRE_R0 },
  815. { "esar", 0x27, INSTR_RRE_R0 },
  816. { "pt", 0x28, INSTR_RRE_RR },
  817. { "iske", 0x29, INSTR_RRE_RR },
  818. { "rrbe", 0x2a, INSTR_RRE_RR },
  819. { "sske", 0x2b, INSTR_RRF_M0RR },
  820. { "tb", 0x2c, INSTR_RRE_0R },
  821. { "dxr", 0x2d, INSTR_RRE_FF },
  822. { "pgin", 0x2e, INSTR_RRE_RR },
  823. { "pgout", 0x2f, INSTR_RRE_RR },
  824. { "csch", 0x30, INSTR_S_00 },
  825. { "hsch", 0x31, INSTR_S_00 },
  826. { "msch", 0x32, INSTR_S_RD },
  827. { "ssch", 0x33, INSTR_S_RD },
  828. { "stsch", 0x34, INSTR_S_RD },
  829. { "tsch", 0x35, INSTR_S_RD },
  830. { "tpi", 0x36, INSTR_S_RD },
  831. { "sal", 0x37, INSTR_S_00 },
  832. { "rsch", 0x38, INSTR_S_00 },
  833. { "stcrw", 0x39, INSTR_S_RD },
  834. { "stcps", 0x3a, INSTR_S_RD },
  835. { "rchp", 0x3b, INSTR_S_00 },
  836. { "schm", 0x3c, INSTR_S_00 },
  837. { "bakr", 0x40, INSTR_RRE_RR },
  838. { "cksm", 0x41, INSTR_RRE_RR },
  839. { "sqdr", 0x44, INSTR_RRE_FF },
  840. { "sqer", 0x45, INSTR_RRE_FF },
  841. { "stura", 0x46, INSTR_RRE_RR },
  842. { "msta", 0x47, INSTR_RRE_R0 },
  843. { "palb", 0x48, INSTR_RRE_00 },
  844. { "ereg", 0x49, INSTR_RRE_RR },
  845. { "esta", 0x4a, INSTR_RRE_RR },
  846. { "lura", 0x4b, INSTR_RRE_RR },
  847. { "tar", 0x4c, INSTR_RRE_AR },
  848. { "cpya", 0x4d, INSTR_RRE_AA },
  849. { "sar", 0x4e, INSTR_RRE_AR },
  850. { "ear", 0x4f, INSTR_RRE_RA },
  851. { "csp", 0x50, INSTR_RRE_RR },
  852. { "msr", 0x52, INSTR_RRE_RR },
  853. { "mvpg", 0x54, INSTR_RRE_RR },
  854. { "mvst", 0x55, INSTR_RRE_RR },
  855. { "cuse", 0x57, INSTR_RRE_RR },
  856. { "bsg", 0x58, INSTR_RRE_RR },
  857. { "bsa", 0x5a, INSTR_RRE_RR },
  858. { "clst", 0x5d, INSTR_RRE_RR },
  859. { "srst", 0x5e, INSTR_RRE_RR },
  860. { "cmpsc", 0x63, INSTR_RRE_RR },
  861. { "siga", 0x74, INSTR_S_RD },
  862. { "xsch", 0x76, INSTR_S_00 },
  863. { "rp", 0x77, INSTR_S_RD },
  864. { "stcke", 0x78, INSTR_S_RD },
  865. { "sacf", 0x79, INSTR_S_RD },
  866. { "stsi", 0x7d, INSTR_S_RD },
  867. { "srnm", 0x99, INSTR_S_RD },
  868. { "stfpc", 0x9c, INSTR_S_RD },
  869. { "lfpc", 0x9d, INSTR_S_RD },
  870. { "tre", 0xa5, INSTR_RRE_RR },
  871. { "cuutf", 0xa6, INSTR_RRF_M0RR },
  872. { "cutfu", 0xa7, INSTR_RRF_M0RR },
  873. { "stfl", 0xb1, INSTR_S_RD },
  874. { "trap4", 0xff, INSTR_S_RD },
  875. { "", 0, INSTR_INVALID }
  876. };
  877. static struct s390_insn opcode_b3[] = {
  878. { "maylr", 0x38, INSTR_RRF_F0FF },
  879. { "mylr", 0x39, INSTR_RRF_F0FF },
  880. { "mayr", 0x3a, INSTR_RRF_F0FF },
  881. { "myr", 0x3b, INSTR_RRF_F0FF },
  882. { "mayhr", 0x3c, INSTR_RRF_F0FF },
  883. { "myhr", 0x3d, INSTR_RRF_F0FF },
  884. { "lpdfr", 0x70, INSTR_RRE_FF },
  885. { "lndfr", 0x71, INSTR_RRE_FF },
  886. { "cpsdr", 0x72, INSTR_RRF_F0FF2 },
  887. { "lcdfr", 0x73, INSTR_RRE_FF },
  888. { "sfasr", 0x85, INSTR_RRE_R0 },
  889. { { 0, LONG_INSN_CELFBR }, 0x90, INSTR_RRF_UUFR },
  890. { { 0, LONG_INSN_CDLFBR }, 0x91, INSTR_RRF_UUFR },
  891. { { 0, LONG_INSN_CXLFBR }, 0x92, INSTR_RRF_UURF },
  892. { { 0, LONG_INSN_CEFBRA }, 0x94, INSTR_RRF_UUFR },
  893. { { 0, LONG_INSN_CDFBRA }, 0x95, INSTR_RRF_UUFR },
  894. { { 0, LONG_INSN_CXFBRA }, 0x96, INSTR_RRF_UURF },
  895. { { 0, LONG_INSN_CFEBRA }, 0x98, INSTR_RRF_UURF },
  896. { { 0, LONG_INSN_CFDBRA }, 0x99, INSTR_RRF_UURF },
  897. { { 0, LONG_INSN_CFXBRA }, 0x9a, INSTR_RRF_UUFR },
  898. { { 0, LONG_INSN_CLFEBR }, 0x9c, INSTR_RRF_UURF },
  899. { { 0, LONG_INSN_CLFDBR }, 0x9d, INSTR_RRF_UURF },
  900. { { 0, LONG_INSN_CLFXBR }, 0x9e, INSTR_RRF_UUFR },
  901. { { 0, LONG_INSN_CELGBR }, 0xa0, INSTR_RRF_UUFR },
  902. { { 0, LONG_INSN_CDLGBR }, 0xa1, INSTR_RRF_UUFR },
  903. { { 0, LONG_INSN_CXLGBR }, 0xa2, INSTR_RRF_UURF },
  904. { { 0, LONG_INSN_CEGBRA }, 0xa4, INSTR_RRF_UUFR },
  905. { { 0, LONG_INSN_CDGBRA }, 0xa5, INSTR_RRF_UUFR },
  906. { { 0, LONG_INSN_CXGBRA }, 0xa6, INSTR_RRF_UURF },
  907. { { 0, LONG_INSN_CGEBRA }, 0xa8, INSTR_RRF_UURF },
  908. { { 0, LONG_INSN_CGDBRA }, 0xa9, INSTR_RRF_UURF },
  909. { { 0, LONG_INSN_CGXBRA }, 0xaa, INSTR_RRF_UUFR },
  910. { { 0, LONG_INSN_CLGEBR }, 0xac, INSTR_RRF_UURF },
  911. { { 0, LONG_INSN_CLGDBR }, 0xad, INSTR_RRF_UURF },
  912. { { 0, LONG_INSN_CLGXBR }, 0xae, INSTR_RRF_UUFR },
  913. { "ldgr", 0xc1, INSTR_RRE_FR },
  914. { "cegr", 0xc4, INSTR_RRE_FR },
  915. { "cdgr", 0xc5, INSTR_RRE_FR },
  916. { "cxgr", 0xc6, INSTR_RRE_FR },
  917. { "cger", 0xc8, INSTR_RRF_U0RF },
  918. { "cgdr", 0xc9, INSTR_RRF_U0RF },
  919. { "cgxr", 0xca, INSTR_RRF_U0RF },
  920. { "lgdr", 0xcd, INSTR_RRE_RF },
  921. { "mdtra", 0xd0, INSTR_RRF_FUFF2 },
  922. { "ddtra", 0xd1, INSTR_RRF_FUFF2 },
  923. { "adtra", 0xd2, INSTR_RRF_FUFF2 },
  924. { "sdtra", 0xd3, INSTR_RRF_FUFF2 },
  925. { "ldetr", 0xd4, INSTR_RRF_0UFF },
  926. { "ledtr", 0xd5, INSTR_RRF_UUFF },
  927. { "ltdtr", 0xd6, INSTR_RRE_FF },
  928. { "fidtr", 0xd7, INSTR_RRF_UUFF },
  929. { "mxtra", 0xd8, INSTR_RRF_FUFF2 },
  930. { "dxtra", 0xd9, INSTR_RRF_FUFF2 },
  931. { "axtra", 0xda, INSTR_RRF_FUFF2 },
  932. { "sxtra", 0xdb, INSTR_RRF_FUFF2 },
  933. { "lxdtr", 0xdc, INSTR_RRF_0UFF },
  934. { "ldxtr", 0xdd, INSTR_RRF_UUFF },
  935. { "ltxtr", 0xde, INSTR_RRE_FF },
  936. { "fixtr", 0xdf, INSTR_RRF_UUFF },
  937. { "kdtr", 0xe0, INSTR_RRE_FF },
  938. { { 0, LONG_INSN_CGDTRA }, 0xe1, INSTR_RRF_UURF },
  939. { "cudtr", 0xe2, INSTR_RRE_RF },
  940. { "csdtr", 0xe3, INSTR_RRE_RF },
  941. { "cdtr", 0xe4, INSTR_RRE_FF },
  942. { "eedtr", 0xe5, INSTR_RRE_RF },
  943. { "esdtr", 0xe7, INSTR_RRE_RF },
  944. { "kxtr", 0xe8, INSTR_RRE_FF },
  945. { { 0, LONG_INSN_CGXTRA }, 0xe9, INSTR_RRF_UUFR },
  946. { "cuxtr", 0xea, INSTR_RRE_RF },
  947. { "csxtr", 0xeb, INSTR_RRE_RF },
  948. { "cxtr", 0xec, INSTR_RRE_FF },
  949. { "eextr", 0xed, INSTR_RRE_RF },
  950. { "esxtr", 0xef, INSTR_RRE_RF },
  951. { { 0, LONG_INSN_CDGTRA }, 0xf1, INSTR_RRF_UUFR },
  952. { "cdutr", 0xf2, INSTR_RRE_FR },
  953. { "cdstr", 0xf3, INSTR_RRE_FR },
  954. { "cedtr", 0xf4, INSTR_RRE_FF },
  955. { "qadtr", 0xf5, INSTR_RRF_FUFF },
  956. { "iedtr", 0xf6, INSTR_RRF_F0FR },
  957. { "rrdtr", 0xf7, INSTR_RRF_FFRU },
  958. { { 0, LONG_INSN_CXGTRA }, 0xf9, INSTR_RRF_UURF },
  959. { "cxutr", 0xfa, INSTR_RRE_FR },
  960. { "cxstr", 0xfb, INSTR_RRE_FR },
  961. { "cextr", 0xfc, INSTR_RRE_FF },
  962. { "qaxtr", 0xfd, INSTR_RRF_FUFF },
  963. { "iextr", 0xfe, INSTR_RRF_F0FR },
  964. { "rrxtr", 0xff, INSTR_RRF_FFRU },
  965. { "lpebr", 0x00, INSTR_RRE_FF },
  966. { "lnebr", 0x01, INSTR_RRE_FF },
  967. { "ltebr", 0x02, INSTR_RRE_FF },
  968. { "lcebr", 0x03, INSTR_RRE_FF },
  969. { "ldebr", 0x04, INSTR_RRE_FF },
  970. { "lxdbr", 0x05, INSTR_RRE_FF },
  971. { "lxebr", 0x06, INSTR_RRE_FF },
  972. { "mxdbr", 0x07, INSTR_RRE_FF },
  973. { "kebr", 0x08, INSTR_RRE_FF },
  974. { "cebr", 0x09, INSTR_RRE_FF },
  975. { "aebr", 0x0a, INSTR_RRE_FF },
  976. { "sebr", 0x0b, INSTR_RRE_FF },
  977. { "mdebr", 0x0c, INSTR_RRE_FF },
  978. { "debr", 0x0d, INSTR_RRE_FF },
  979. { "maebr", 0x0e, INSTR_RRF_F0FF },
  980. { "msebr", 0x0f, INSTR_RRF_F0FF },
  981. { "lpdbr", 0x10, INSTR_RRE_FF },
  982. { "lndbr", 0x11, INSTR_RRE_FF },
  983. { "ltdbr", 0x12, INSTR_RRE_FF },
  984. { "lcdbr", 0x13, INSTR_RRE_FF },
  985. { "sqebr", 0x14, INSTR_RRE_FF },
  986. { "sqdbr", 0x15, INSTR_RRE_FF },
  987. { "sqxbr", 0x16, INSTR_RRE_FF },
  988. { "meebr", 0x17, INSTR_RRE_FF },
  989. { "kdbr", 0x18, INSTR_RRE_FF },
  990. { "cdbr", 0x19, INSTR_RRE_FF },
  991. { "adbr", 0x1a, INSTR_RRE_FF },
  992. { "sdbr", 0x1b, INSTR_RRE_FF },
  993. { "mdbr", 0x1c, INSTR_RRE_FF },
  994. { "ddbr", 0x1d, INSTR_RRE_FF },
  995. { "madbr", 0x1e, INSTR_RRF_F0FF },
  996. { "msdbr", 0x1f, INSTR_RRF_F0FF },
  997. { "lder", 0x24, INSTR_RRE_FF },
  998. { "lxdr", 0x25, INSTR_RRE_FF },
  999. { "lxer", 0x26, INSTR_RRE_FF },
  1000. { "maer", 0x2e, INSTR_RRF_F0FF },
  1001. { "mser", 0x2f, INSTR_RRF_F0FF },
  1002. { "sqxr", 0x36, INSTR_RRE_FF },
  1003. { "meer", 0x37, INSTR_RRE_FF },
  1004. { "madr", 0x3e, INSTR_RRF_F0FF },
  1005. { "msdr", 0x3f, INSTR_RRF_F0FF },
  1006. { "lpxbr", 0x40, INSTR_RRE_FF },
  1007. { "lnxbr", 0x41, INSTR_RRE_FF },
  1008. { "ltxbr", 0x42, INSTR_RRE_FF },
  1009. { "lcxbr", 0x43, INSTR_RRE_FF },
  1010. { { 0, LONG_INSN_LEDBRA }, 0x44, INSTR_RRF_UUFF },
  1011. { { 0, LONG_INSN_LDXBRA }, 0x45, INSTR_RRF_UUFF },
  1012. { { 0, LONG_INSN_LEXBRA }, 0x46, INSTR_RRF_UUFF },
  1013. { { 0, LONG_INSN_FIXBRA }, 0x47, INSTR_RRF_UUFF },
  1014. { "kxbr", 0x48, INSTR_RRE_FF },
  1015. { "cxbr", 0x49, INSTR_RRE_FF },
  1016. { "axbr", 0x4a, INSTR_RRE_FF },
  1017. { "sxbr", 0x4b, INSTR_RRE_FF },
  1018. { "mxbr", 0x4c, INSTR_RRE_FF },
  1019. { "dxbr", 0x4d, INSTR_RRE_FF },
  1020. { "tbedr", 0x50, INSTR_RRF_U0FF },
  1021. { "tbdr", 0x51, INSTR_RRF_U0FF },
  1022. { "diebr", 0x53, INSTR_RRF_FUFF },
  1023. { { 0, LONG_INSN_FIEBRA }, 0x57, INSTR_RRF_UUFF },
  1024. { "thder", 0x58, INSTR_RRE_FF },
  1025. { "thdr", 0x59, INSTR_RRE_FF },
  1026. { "didbr", 0x5b, INSTR_RRF_FUFF },
  1027. { { 0, LONG_INSN_FIDBRA }, 0x5f, INSTR_RRF_UUFF },
  1028. { "lpxr", 0x60, INSTR_RRE_FF },
  1029. { "lnxr", 0x61, INSTR_RRE_FF },
  1030. { "ltxr", 0x62, INSTR_RRE_FF },
  1031. { "lcxr", 0x63, INSTR_RRE_FF },
  1032. { "lxr", 0x65, INSTR_RRE_FF },
  1033. { "lexr", 0x66, INSTR_RRE_FF },
  1034. { "fixr", 0x67, INSTR_RRE_FF },
  1035. { "cxr", 0x69, INSTR_RRE_FF },
  1036. { "lzer", 0x74, INSTR_RRE_F0 },
  1037. { "lzdr", 0x75, INSTR_RRE_F0 },
  1038. { "lzxr", 0x76, INSTR_RRE_F0 },
  1039. { "fier", 0x77, INSTR_RRE_FF },
  1040. { "fidr", 0x7f, INSTR_RRE_FF },
  1041. { "sfpc", 0x84, INSTR_RRE_RR_OPT },
  1042. { "efpc", 0x8c, INSTR_RRE_RR_OPT },
  1043. { "cefbr", 0x94, INSTR_RRE_RF },
  1044. { "cdfbr", 0x95, INSTR_RRE_RF },
  1045. { "cxfbr", 0x96, INSTR_RRE_RF },
  1046. { "cfebr", 0x98, INSTR_RRF_U0RF },
  1047. { "cfdbr", 0x99, INSTR_RRF_U0RF },
  1048. { "cfxbr", 0x9a, INSTR_RRF_U0RF },
  1049. { "cefr", 0xb4, INSTR_RRE_FR },
  1050. { "cdfr", 0xb5, INSTR_RRE_FR },
  1051. { "cxfr", 0xb6, INSTR_RRE_FR },
  1052. { "cfer", 0xb8, INSTR_RRF_U0RF },
  1053. { "cfdr", 0xb9, INSTR_RRF_U0RF },
  1054. { "cfxr", 0xba, INSTR_RRF_U0RF },
  1055. { "", 0, INSTR_INVALID }
  1056. };
  1057. static struct s390_insn opcode_b9[] = {
  1058. { "lpgr", 0x00, INSTR_RRE_RR },
  1059. { "lngr", 0x01, INSTR_RRE_RR },
  1060. { "ltgr", 0x02, INSTR_RRE_RR },
  1061. { "lcgr", 0x03, INSTR_RRE_RR },
  1062. { "lgr", 0x04, INSTR_RRE_RR },
  1063. { "lurag", 0x05, INSTR_RRE_RR },
  1064. { "lgbr", 0x06, INSTR_RRE_RR },
  1065. { "lghr", 0x07, INSTR_RRE_RR },
  1066. { "agr", 0x08, INSTR_RRE_RR },
  1067. { "sgr", 0x09, INSTR_RRE_RR },
  1068. { "algr", 0x0a, INSTR_RRE_RR },
  1069. { "slgr", 0x0b, INSTR_RRE_RR },
  1070. { "msgr", 0x0c, INSTR_RRE_RR },
  1071. { "dsgr", 0x0d, INSTR_RRE_RR },
  1072. { "eregg", 0x0e, INSTR_RRE_RR },
  1073. { "lrvgr", 0x0f, INSTR_RRE_RR },
  1074. { "lpgfr", 0x10, INSTR_RRE_RR },
  1075. { "lngfr", 0x11, INSTR_RRE_RR },
  1076. { "ltgfr", 0x12, INSTR_RRE_RR },
  1077. { "lcgfr", 0x13, INSTR_RRE_RR },
  1078. { "lgfr", 0x14, INSTR_RRE_RR },
  1079. { "llgfr", 0x16, INSTR_RRE_RR },
  1080. { "llgtr", 0x17, INSTR_RRE_RR },
  1081. { "agfr", 0x18, INSTR_RRE_RR },
  1082. { "sgfr", 0x19, INSTR_RRE_RR },
  1083. { "algfr", 0x1a, INSTR_RRE_RR },
  1084. { "slgfr", 0x1b, INSTR_RRE_RR },
  1085. { "msgfr", 0x1c, INSTR_RRE_RR },
  1086. { "dsgfr", 0x1d, INSTR_RRE_RR },
  1087. { "cgr", 0x20, INSTR_RRE_RR },
  1088. { "clgr", 0x21, INSTR_RRE_RR },
  1089. { "sturg", 0x25, INSTR_RRE_RR },
  1090. { "lbr", 0x26, INSTR_RRE_RR },
  1091. { "lhr", 0x27, INSTR_RRE_RR },
  1092. { "cgfr", 0x30, INSTR_RRE_RR },
  1093. { "clgfr", 0x31, INSTR_RRE_RR },
  1094. { "cfdtr", 0x41, INSTR_RRF_UURF },
  1095. { { 0, LONG_INSN_CLGDTR }, 0x42, INSTR_RRF_UURF },
  1096. { { 0, LONG_INSN_CLFDTR }, 0x43, INSTR_RRF_UURF },
  1097. { "bctgr", 0x46, INSTR_RRE_RR },
  1098. { "cfxtr", 0x49, INSTR_RRF_UURF },
  1099. { { 0, LONG_INSN_CLGXTR }, 0x4a, INSTR_RRF_UUFR },
  1100. { { 0, LONG_INSN_CLFXTR }, 0x4b, INSTR_RRF_UUFR },
  1101. { "cdftr", 0x51, INSTR_RRF_UUFR },
  1102. { { 0, LONG_INSN_CDLGTR }, 0x52, INSTR_RRF_UUFR },
  1103. { { 0, LONG_INSN_CDLFTR }, 0x53, INSTR_RRF_UUFR },
  1104. { "cxftr", 0x59, INSTR_RRF_UURF },
  1105. { { 0, LONG_INSN_CXLGTR }, 0x5a, INSTR_RRF_UURF },
  1106. { { 0, LONG_INSN_CXLFTR }, 0x5b, INSTR_RRF_UUFR },
  1107. { "cgrt", 0x60, INSTR_RRF_U0RR },
  1108. { "clgrt", 0x61, INSTR_RRF_U0RR },
  1109. { "crt", 0x72, INSTR_RRF_U0RR },
  1110. { "clrt", 0x73, INSTR_RRF_U0RR },
  1111. { "ngr", 0x80, INSTR_RRE_RR },
  1112. { "ogr", 0x81, INSTR_RRE_RR },
  1113. { "xgr", 0x82, INSTR_RRE_RR },
  1114. { "flogr", 0x83, INSTR_RRE_RR },
  1115. { "llgcr", 0x84, INSTR_RRE_RR },
  1116. { "llghr", 0x85, INSTR_RRE_RR },
  1117. { "mlgr", 0x86, INSTR_RRE_RR },
  1118. { "dlgr", 0x87, INSTR_RRE_RR },
  1119. { "alcgr", 0x88, INSTR_RRE_RR },
  1120. { "slbgr", 0x89, INSTR_RRE_RR },
  1121. { "cspg", 0x8a, INSTR_RRE_RR },
  1122. { "idte", 0x8e, INSTR_RRF_R0RR },
  1123. { "crdte", 0x8f, INSTR_RRF_RMRR },
  1124. { "llcr", 0x94, INSTR_RRE_RR },
  1125. { "llhr", 0x95, INSTR_RRE_RR },
  1126. { "esea", 0x9d, INSTR_RRE_R0 },
  1127. { "ptf", 0xa2, INSTR_RRE_R0 },
  1128. { "lptea", 0xaa, INSTR_RRF_RURR },
  1129. { "rrbm", 0xae, INSTR_RRE_RR },
  1130. { "pfmf", 0xaf, INSTR_RRE_RR },
  1131. { "cu14", 0xb0, INSTR_RRF_M0RR },
  1132. { "cu24", 0xb1, INSTR_RRF_M0RR },
  1133. { "cu41", 0xb2, INSTR_RRE_RR },
  1134. { "cu42", 0xb3, INSTR_RRE_RR },
  1135. { "trtre", 0xbd, INSTR_RRF_M0RR },
  1136. { "srstu", 0xbe, INSTR_RRE_RR },
  1137. { "trte", 0xbf, INSTR_RRF_M0RR },
  1138. { "ahhhr", 0xc8, INSTR_RRF_R0RR2 },
  1139. { "shhhr", 0xc9, INSTR_RRF_R0RR2 },
  1140. { { 0, LONG_INSN_ALHHHR }, 0xca, INSTR_RRF_R0RR2 },
  1141. { { 0, LONG_INSN_SLHHHR }, 0xcb, INSTR_RRF_R0RR2 },
  1142. { "chhr", 0xcd, INSTR_RRE_RR },
  1143. { "clhhr", 0xcf, INSTR_RRE_RR },
  1144. { { 0, LONG_INSN_PCISTG }, 0xd0, INSTR_RRE_RR },
  1145. { "pcilg", 0xd2, INSTR_RRE_RR },
  1146. { "rpcit", 0xd3, INSTR_RRE_RR },
  1147. { "ahhlr", 0xd8, INSTR_RRF_R0RR2 },
  1148. { "shhlr", 0xd9, INSTR_RRF_R0RR2 },
  1149. { { 0, LONG_INSN_ALHHLR }, 0xda, INSTR_RRF_R0RR2 },
  1150. { { 0, LONG_INSN_SLHHLR }, 0xdb, INSTR_RRF_R0RR2 },
  1151. { "chlr", 0xdd, INSTR_RRE_RR },
  1152. { "clhlr", 0xdf, INSTR_RRE_RR },
  1153. { { 0, LONG_INSN_POPCNT }, 0xe1, INSTR_RRE_RR },
  1154. { "locgr", 0xe2, INSTR_RRF_M0RR },
  1155. { "ngrk", 0xe4, INSTR_RRF_R0RR2 },
  1156. { "ogrk", 0xe6, INSTR_RRF_R0RR2 },
  1157. { "xgrk", 0xe7, INSTR_RRF_R0RR2 },
  1158. { "agrk", 0xe8, INSTR_RRF_R0RR2 },
  1159. { "sgrk", 0xe9, INSTR_RRF_R0RR2 },
  1160. { "algrk", 0xea, INSTR_RRF_R0RR2 },
  1161. { "slgrk", 0xeb, INSTR_RRF_R0RR2 },
  1162. { "locr", 0xf2, INSTR_RRF_M0RR },
  1163. { "nrk", 0xf4, INSTR_RRF_R0RR2 },
  1164. { "ork", 0xf6, INSTR_RRF_R0RR2 },
  1165. { "xrk", 0xf7, INSTR_RRF_R0RR2 },
  1166. { "ark", 0xf8, INSTR_RRF_R0RR2 },
  1167. { "srk", 0xf9, INSTR_RRF_R0RR2 },
  1168. { "alrk", 0xfa, INSTR_RRF_R0RR2 },
  1169. { "slrk", 0xfb, INSTR_RRF_R0RR2 },
  1170. { "kmac", 0x1e, INSTR_RRE_RR },
  1171. { "lrvr", 0x1f, INSTR_RRE_RR },
  1172. { "km", 0x2e, INSTR_RRE_RR },
  1173. { "kmc", 0x2f, INSTR_RRE_RR },
  1174. { "kimd", 0x3e, INSTR_RRE_RR },
  1175. { "klmd", 0x3f, INSTR_RRE_RR },
  1176. { "epsw", 0x8d, INSTR_RRE_RR },
  1177. { "trtt", 0x90, INSTR_RRF_M0RR },
  1178. { "trto", 0x91, INSTR_RRF_M0RR },
  1179. { "trot", 0x92, INSTR_RRF_M0RR },
  1180. { "troo", 0x93, INSTR_RRF_M0RR },
  1181. { "mlr", 0x96, INSTR_RRE_RR },
  1182. { "dlr", 0x97, INSTR_RRE_RR },
  1183. { "alcr", 0x98, INSTR_RRE_RR },
  1184. { "slbr", 0x99, INSTR_RRE_RR },
  1185. { "", 0, INSTR_INVALID }
  1186. };
  1187. static struct s390_insn opcode_c0[] = {
  1188. { "lgfi", 0x01, INSTR_RIL_RI },
  1189. { "xihf", 0x06, INSTR_RIL_RU },
  1190. { "xilf", 0x07, INSTR_RIL_RU },
  1191. { "iihf", 0x08, INSTR_RIL_RU },
  1192. { "iilf", 0x09, INSTR_RIL_RU },
  1193. { "nihf", 0x0a, INSTR_RIL_RU },
  1194. { "nilf", 0x0b, INSTR_RIL_RU },
  1195. { "oihf", 0x0c, INSTR_RIL_RU },
  1196. { "oilf", 0x0d, INSTR_RIL_RU },
  1197. { "llihf", 0x0e, INSTR_RIL_RU },
  1198. { "llilf", 0x0f, INSTR_RIL_RU },
  1199. { "larl", 0x00, INSTR_RIL_RP },
  1200. { "brcl", 0x04, INSTR_RIL_UP },
  1201. { "brasl", 0x05, INSTR_RIL_RP },
  1202. { "", 0, INSTR_INVALID }
  1203. };
  1204. static struct s390_insn opcode_c2[] = {
  1205. { "msgfi", 0x00, INSTR_RIL_RI },
  1206. { "msfi", 0x01, INSTR_RIL_RI },
  1207. { "slgfi", 0x04, INSTR_RIL_RU },
  1208. { "slfi", 0x05, INSTR_RIL_RU },
  1209. { "agfi", 0x08, INSTR_RIL_RI },
  1210. { "afi", 0x09, INSTR_RIL_RI },
  1211. { "algfi", 0x0a, INSTR_RIL_RU },
  1212. { "alfi", 0x0b, INSTR_RIL_RU },
  1213. { "cgfi", 0x0c, INSTR_RIL_RI },
  1214. { "cfi", 0x0d, INSTR_RIL_RI },
  1215. { "clgfi", 0x0e, INSTR_RIL_RU },
  1216. { "clfi", 0x0f, INSTR_RIL_RU },
  1217. { "", 0, INSTR_INVALID }
  1218. };
  1219. static struct s390_insn opcode_c4[] = {
  1220. { "llhrl", 0x02, INSTR_RIL_RP },
  1221. { "lghrl", 0x04, INSTR_RIL_RP },
  1222. { "lhrl", 0x05, INSTR_RIL_RP },
  1223. { { 0, LONG_INSN_LLGHRL }, 0x06, INSTR_RIL_RP },
  1224. { "sthrl", 0x07, INSTR_RIL_RP },
  1225. { "lgrl", 0x08, INSTR_RIL_RP },
  1226. { "stgrl", 0x0b, INSTR_RIL_RP },
  1227. { "lgfrl", 0x0c, INSTR_RIL_RP },
  1228. { "lrl", 0x0d, INSTR_RIL_RP },
  1229. { { 0, LONG_INSN_LLGFRL }, 0x0e, INSTR_RIL_RP },
  1230. { "strl", 0x0f, INSTR_RIL_RP },
  1231. { "", 0, INSTR_INVALID }
  1232. };
  1233. static struct s390_insn opcode_c6[] = {
  1234. { "exrl", 0x00, INSTR_RIL_RP },
  1235. { "pfdrl", 0x02, INSTR_RIL_UP },
  1236. { "cghrl", 0x04, INSTR_RIL_RP },
  1237. { "chrl", 0x05, INSTR_RIL_RP },
  1238. { { 0, LONG_INSN_CLGHRL }, 0x06, INSTR_RIL_RP },
  1239. { "clhrl", 0x07, INSTR_RIL_RP },
  1240. { "cgrl", 0x08, INSTR_RIL_RP },
  1241. { "clgrl", 0x0a, INSTR_RIL_RP },
  1242. { "cgfrl", 0x0c, INSTR_RIL_RP },
  1243. { "crl", 0x0d, INSTR_RIL_RP },
  1244. { { 0, LONG_INSN_CLGFRL }, 0x0e, INSTR_RIL_RP },
  1245. { "clrl", 0x0f, INSTR_RIL_RP },
  1246. { "", 0, INSTR_INVALID }
  1247. };
  1248. static struct s390_insn opcode_c8[] = {
  1249. { "mvcos", 0x00, INSTR_SSF_RRDRD },
  1250. { "ectg", 0x01, INSTR_SSF_RRDRD },
  1251. { "csst", 0x02, INSTR_SSF_RRDRD },
  1252. { "lpd", 0x04, INSTR_SSF_RRDRD2 },
  1253. { "lpdg", 0x05, INSTR_SSF_RRDRD2 },
  1254. { "", 0, INSTR_INVALID }
  1255. };
  1256. static struct s390_insn opcode_cc[] = {
  1257. { "brcth", 0x06, INSTR_RIL_RP },
  1258. { "aih", 0x08, INSTR_RIL_RI },
  1259. { "alsih", 0x0a, INSTR_RIL_RI },
  1260. { { 0, LONG_INSN_ALSIHN }, 0x0b, INSTR_RIL_RI },
  1261. { "cih", 0x0d, INSTR_RIL_RI },
  1262. { "clih", 0x0f, INSTR_RIL_RI },
  1263. { "", 0, INSTR_INVALID }
  1264. };
  1265. static struct s390_insn opcode_e3[] = {
  1266. { "ltg", 0x02, INSTR_RXY_RRRD },
  1267. { "lrag", 0x03, INSTR_RXY_RRRD },
  1268. { "lg", 0x04, INSTR_RXY_RRRD },
  1269. { "cvby", 0x06, INSTR_RXY_RRRD },
  1270. { "ag", 0x08, INSTR_RXY_RRRD },
  1271. { "sg", 0x09, INSTR_RXY_RRRD },
  1272. { "alg", 0x0a, INSTR_RXY_RRRD },
  1273. { "slg", 0x0b, INSTR_RXY_RRRD },
  1274. { "msg", 0x0c, INSTR_RXY_RRRD },
  1275. { "dsg", 0x0d, INSTR_RXY_RRRD },
  1276. { "cvbg", 0x0e, INSTR_RXY_RRRD },
  1277. { "lrvg", 0x0f, INSTR_RXY_RRRD },
  1278. { "lt", 0x12, INSTR_RXY_RRRD },
  1279. { "lray", 0x13, INSTR_RXY_RRRD },
  1280. { "lgf", 0x14, INSTR_RXY_RRRD },
  1281. { "lgh", 0x15, INSTR_RXY_RRRD },
  1282. { "llgf", 0x16, INSTR_RXY_RRRD },
  1283. { "llgt", 0x17, INSTR_RXY_RRRD },
  1284. { "agf", 0x18, INSTR_RXY_RRRD },
  1285. { "sgf", 0x19, INSTR_RXY_RRRD },
  1286. { "algf", 0x1a, INSTR_RXY_RRRD },
  1287. { "slgf", 0x1b, INSTR_RXY_RRRD },
  1288. { "msgf", 0x1c, INSTR_RXY_RRRD },
  1289. { "dsgf", 0x1d, INSTR_RXY_RRRD },
  1290. { "cg", 0x20, INSTR_RXY_RRRD },
  1291. { "clg", 0x21, INSTR_RXY_RRRD },
  1292. { "stg", 0x24, INSTR_RXY_RRRD },
  1293. { "ntstg", 0x25, INSTR_RXY_RRRD },
  1294. { "cvdy", 0x26, INSTR_RXY_RRRD },
  1295. { "cvdg", 0x2e, INSTR_RXY_RRRD },
  1296. { "strvg", 0x2f, INSTR_RXY_RRRD },
  1297. { "cgf", 0x30, INSTR_RXY_RRRD },
  1298. { "clgf", 0x31, INSTR_RXY_RRRD },
  1299. { "ltgf", 0x32, INSTR_RXY_RRRD },
  1300. { "cgh", 0x34, INSTR_RXY_RRRD },
  1301. { "pfd", 0x36, INSTR_RXY_URRD },
  1302. { "strvh", 0x3f, INSTR_RXY_RRRD },
  1303. { "bctg", 0x46, INSTR_RXY_RRRD },
  1304. { "sty", 0x50, INSTR_RXY_RRRD },
  1305. { "msy", 0x51, INSTR_RXY_RRRD },
  1306. { "ny", 0x54, INSTR_RXY_RRRD },
  1307. { "cly", 0x55, INSTR_RXY_RRRD },
  1308. { "oy", 0x56, INSTR_RXY_RRRD },
  1309. { "xy", 0x57, INSTR_RXY_RRRD },
  1310. { "ly", 0x58, INSTR_RXY_RRRD },
  1311. { "cy", 0x59, INSTR_RXY_RRRD },
  1312. { "ay", 0x5a, INSTR_RXY_RRRD },
  1313. { "sy", 0x5b, INSTR_RXY_RRRD },
  1314. { "mfy", 0x5c, INSTR_RXY_RRRD },
  1315. { "aly", 0x5e, INSTR_RXY_RRRD },
  1316. { "sly", 0x5f, INSTR_RXY_RRRD },
  1317. { "sthy", 0x70, INSTR_RXY_RRRD },
  1318. { "lay", 0x71, INSTR_RXY_RRRD },
  1319. { "stcy", 0x72, INSTR_RXY_RRRD },
  1320. { "icy", 0x73, INSTR_RXY_RRRD },
  1321. { "laey", 0x75, INSTR_RXY_RRRD },
  1322. { "lb", 0x76, INSTR_RXY_RRRD },
  1323. { "lgb", 0x77, INSTR_RXY_RRRD },
  1324. { "lhy", 0x78, INSTR_RXY_RRRD },
  1325. { "chy", 0x79, INSTR_RXY_RRRD },
  1326. { "ahy", 0x7a, INSTR_RXY_RRRD },
  1327. { "shy", 0x7b, INSTR_RXY_RRRD },
  1328. { "mhy", 0x7c, INSTR_RXY_RRRD },
  1329. { "ng", 0x80, INSTR_RXY_RRRD },
  1330. { "og", 0x81, INSTR_RXY_RRRD },
  1331. { "xg", 0x82, INSTR_RXY_RRRD },
  1332. { "lgat", 0x85, INSTR_RXY_RRRD },
  1333. { "mlg", 0x86, INSTR_RXY_RRRD },
  1334. { "dlg", 0x87, INSTR_RXY_RRRD },
  1335. { "alcg", 0x88, INSTR_RXY_RRRD },
  1336. { "slbg", 0x89, INSTR_RXY_RRRD },
  1337. { "stpq", 0x8e, INSTR_RXY_RRRD },
  1338. { "lpq", 0x8f, INSTR_RXY_RRRD },
  1339. { "llgc", 0x90, INSTR_RXY_RRRD },
  1340. { "llgh", 0x91, INSTR_RXY_RRRD },
  1341. { "llc", 0x94, INSTR_RXY_RRRD },
  1342. { "llh", 0x95, INSTR_RXY_RRRD },
  1343. { { 0, LONG_INSN_LLGTAT }, 0x9c, INSTR_RXY_RRRD },
  1344. { { 0, LONG_INSN_LLGFAT }, 0x9d, INSTR_RXY_RRRD },
  1345. { "lat", 0x9f, INSTR_RXY_RRRD },
  1346. { "lbh", 0xc0, INSTR_RXY_RRRD },
  1347. { "llch", 0xc2, INSTR_RXY_RRRD },
  1348. { "stch", 0xc3, INSTR_RXY_RRRD },
  1349. { "lhh", 0xc4, INSTR_RXY_RRRD },
  1350. { "llhh", 0xc6, INSTR_RXY_RRRD },
  1351. { "sthh", 0xc7, INSTR_RXY_RRRD },
  1352. { "lfhat", 0xc8, INSTR_RXY_RRRD },
  1353. { "lfh", 0xca, INSTR_RXY_RRRD },
  1354. { "stfh", 0xcb, INSTR_RXY_RRRD },
  1355. { "chf", 0xcd, INSTR_RXY_RRRD },
  1356. { "clhf", 0xcf, INSTR_RXY_RRRD },
  1357. { { 0, LONG_INSN_MPCIFC }, 0xd0, INSTR_RXY_RRRD },
  1358. { { 0, LONG_INSN_STPCIFC }, 0xd4, INSTR_RXY_RRRD },
  1359. { "lrv", 0x1e, INSTR_RXY_RRRD },
  1360. { "lrvh", 0x1f, INSTR_RXY_RRRD },
  1361. { "strv", 0x3e, INSTR_RXY_RRRD },
  1362. { "ml", 0x96, INSTR_RXY_RRRD },
  1363. { "dl", 0x97, INSTR_RXY_RRRD },
  1364. { "alc", 0x98, INSTR_RXY_RRRD },
  1365. { "slb", 0x99, INSTR_RXY_RRRD },
  1366. { "", 0, INSTR_INVALID }
  1367. };
  1368. static struct s390_insn opcode_e5[] = {
  1369. { "strag", 0x02, INSTR_SSE_RDRD },
  1370. { "mvhhi", 0x44, INSTR_SIL_RDI },
  1371. { "mvghi", 0x48, INSTR_SIL_RDI },
  1372. { "mvhi", 0x4c, INSTR_SIL_RDI },
  1373. { "chhsi", 0x54, INSTR_SIL_RDI },
  1374. { { 0, LONG_INSN_CLHHSI }, 0x55, INSTR_SIL_RDU },
  1375. { "cghsi", 0x58, INSTR_SIL_RDI },
  1376. { { 0, LONG_INSN_CLGHSI }, 0x59, INSTR_SIL_RDU },
  1377. { "chsi", 0x5c, INSTR_SIL_RDI },
  1378. { { 0, LONG_INSN_CLFHSI }, 0x5d, INSTR_SIL_RDU },
  1379. { { 0, LONG_INSN_TBEGIN }, 0x60, INSTR_SIL_RDU },
  1380. { { 0, LONG_INSN_TBEGINC }, 0x61, INSTR_SIL_RDU },
  1381. { "lasp", 0x00, INSTR_SSE_RDRD },
  1382. { "tprot", 0x01, INSTR_SSE_RDRD },
  1383. { "mvcsk", 0x0e, INSTR_SSE_RDRD },
  1384. { "mvcdk", 0x0f, INSTR_SSE_RDRD },
  1385. { "", 0, INSTR_INVALID }
  1386. };
  1387. static struct s390_insn opcode_e7[] = {
  1388. { "lcbb", 0x27, INSTR_RXE_RRRDM },
  1389. { "vgef", 0x13, INSTR_VRV_VVRDM },
  1390. { "vgeg", 0x12, INSTR_VRV_VVRDM },
  1391. { "vgbm", 0x44, INSTR_VRI_V0I0 },
  1392. { "vgm", 0x46, INSTR_VRI_V0IIM },
  1393. { "vl", 0x06, INSTR_VRX_VRRD0 },
  1394. { "vlr", 0x56, INSTR_VRR_VV00000 },
  1395. { "vlrp", 0x05, INSTR_VRX_VRRDM },
  1396. { "vleb", 0x00, INSTR_VRX_VRRDM },
  1397. { "vleh", 0x01, INSTR_VRX_VRRDM },
  1398. { "vlef", 0x03, INSTR_VRX_VRRDM },
  1399. { "vleg", 0x02, INSTR_VRX_VRRDM },
  1400. { "vleib", 0x40, INSTR_VRI_V0IM },
  1401. { "vleih", 0x41, INSTR_VRI_V0IM },
  1402. { "vleif", 0x43, INSTR_VRI_V0IM },
  1403. { "vleig", 0x42, INSTR_VRI_V0IM },
  1404. { "vlgv", 0x21, INSTR_VRS_RVRDM },
  1405. { "vllez", 0x04, INSTR_VRX_VRRDM },
  1406. { "vlm", 0x36, INSTR_VRS_VVRD0 },
  1407. { "vlbb", 0x07, INSTR_VRX_VRRDM },
  1408. { "vlvg", 0x22, INSTR_VRS_VRRDM },
  1409. { "vlvgp", 0x62, INSTR_VRR_VRR0000 },
  1410. { "vll", 0x37, INSTR_VRS_VRRD0 },
  1411. { "vmrh", 0x61, INSTR_VRR_VVV000M },
  1412. { "vmrl", 0x60, INSTR_VRR_VVV000M },
  1413. { "vpk", 0x94, INSTR_VRR_VVV000M },
  1414. { "vpks", 0x97, INSTR_VRR_VVV0M0M },
  1415. { "vpkls", 0x95, INSTR_VRR_VVV0M0M },
  1416. { "vperm", 0x8c, INSTR_VRR_VVV000V },
  1417. { "vpdi", 0x84, INSTR_VRR_VVV000M },
  1418. { "vrep", 0x4d, INSTR_VRI_VVIM },
  1419. { "vrepi", 0x45, INSTR_VRI_V0IM },
  1420. { "vscef", 0x1b, INSTR_VRV_VWRDM },
  1421. { "vsceg", 0x1a, INSTR_VRV_VWRDM },
  1422. { "vsel", 0x8d, INSTR_VRR_VVV000V },
  1423. { "vseg", 0x5f, INSTR_VRR_VV0000M },
  1424. { "vst", 0x0e, INSTR_VRX_VRRD0 },
  1425. { "vsteb", 0x08, INSTR_VRX_VRRDM },
  1426. { "vsteh", 0x09, INSTR_VRX_VRRDM },
  1427. { "vstef", 0x0b, INSTR_VRX_VRRDM },
  1428. { "vsteg", 0x0a, INSTR_VRX_VRRDM },
  1429. { "vstm", 0x3e, INSTR_VRS_VVRD0 },
  1430. { "vstl", 0x3f, INSTR_VRS_VRRD0 },
  1431. { "vuph", 0xd7, INSTR_VRR_VV0000M },
  1432. { "vuplh", 0xd5, INSTR_VRR_VV0000M },
  1433. { "vupl", 0xd6, INSTR_VRR_VV0000M },
  1434. { "vupll", 0xd4, INSTR_VRR_VV0000M },
  1435. { "va", 0xf3, INSTR_VRR_VVV000M },
  1436. { "vacc", 0xf1, INSTR_VRR_VVV000M },
  1437. { "vac", 0xbb, INSTR_VRR_VVVM00V },
  1438. { "vaccc", 0xb9, INSTR_VRR_VVVM00V },
  1439. { "vn", 0x68, INSTR_VRR_VVV0000 },
  1440. { "vnc", 0x69, INSTR_VRR_VVV0000 },
  1441. { "vavg", 0xf2, INSTR_VRR_VVV000M },
  1442. { "vavgl", 0xf0, INSTR_VRR_VVV000M },
  1443. { "vcksm", 0x66, INSTR_VRR_VVV0000 },
  1444. { "vec", 0xdb, INSTR_VRR_VV0000M },
  1445. { "vecl", 0xd9, INSTR_VRR_VV0000M },
  1446. { "vceq", 0xf8, INSTR_VRR_VVV0M0M },
  1447. { "vch", 0xfb, INSTR_VRR_VVV0M0M },
  1448. { "vchl", 0xf9, INSTR_VRR_VVV0M0M },
  1449. { "vclz", 0x53, INSTR_VRR_VV0000M },
  1450. { "vctz", 0x52, INSTR_VRR_VV0000M },
  1451. { "vx", 0x6d, INSTR_VRR_VVV0000 },
  1452. { "vgfm", 0xb4, INSTR_VRR_VVV000M },
  1453. { "vgfma", 0xbc, INSTR_VRR_VVVM00V },
  1454. { "vlc", 0xde, INSTR_VRR_VV0000M },
  1455. { "vlp", 0xdf, INSTR_VRR_VV0000M },
  1456. { "vmx", 0xff, INSTR_VRR_VVV000M },
  1457. { "vmxl", 0xfd, INSTR_VRR_VVV000M },
  1458. { "vmn", 0xfe, INSTR_VRR_VVV000M },
  1459. { "vmnl", 0xfc, INSTR_VRR_VVV000M },
  1460. { "vmal", 0xaa, INSTR_VRR_VVVM00V },
  1461. { "vmae", 0xae, INSTR_VRR_VVVM00V },
  1462. { "vmale", 0xac, INSTR_VRR_VVVM00V },
  1463. { "vmah", 0xab, INSTR_VRR_VVVM00V },
  1464. { "vmalh", 0xa9, INSTR_VRR_VVVM00V },
  1465. { "vmao", 0xaf, INSTR_VRR_VVVM00V },
  1466. { "vmalo", 0xad, INSTR_VRR_VVVM00V },
  1467. { "vmh", 0xa3, INSTR_VRR_VVV000M },
  1468. { "vmlh", 0xa1, INSTR_VRR_VVV000M },
  1469. { "vml", 0xa2, INSTR_VRR_VVV000M },
  1470. { "vme", 0xa6, INSTR_VRR_VVV000M },
  1471. { "vmle", 0xa4, INSTR_VRR_VVV000M },
  1472. { "vmo", 0xa7, INSTR_VRR_VVV000M },
  1473. { "vmlo", 0xa5, INSTR_VRR_VVV000M },
  1474. { "vno", 0x6b, INSTR_VRR_VVV0000 },
  1475. { "vo", 0x6a, INSTR_VRR_VVV0000 },
  1476. { { 0, LONG_INSN_VPOPCT }, 0x50, INSTR_VRR_VV0000M },
  1477. { { 0, LONG_INSN_VERLLV }, 0x73, INSTR_VRR_VVV000M },
  1478. { "verll", 0x33, INSTR_VRS_VVRDM },
  1479. { "verim", 0x72, INSTR_VRI_VVV0IM },
  1480. { "veslv", 0x70, INSTR_VRR_VVV000M },
  1481. { "vesl", 0x30, INSTR_VRS_VVRDM },
  1482. { { 0, LONG_INSN_VESRAV }, 0x7a, INSTR_VRR_VVV000M },
  1483. { "vesra", 0x3a, INSTR_VRS_VVRDM },
  1484. { { 0, LONG_INSN_VESRLV }, 0x78, INSTR_VRR_VVV000M },
  1485. { "vesrl", 0x38, INSTR_VRS_VVRDM },
  1486. { "vsl", 0x74, INSTR_VRR_VVV0000 },
  1487. { "vslb", 0x75, INSTR_VRR_VVV0000 },
  1488. { "vsldb", 0x77, INSTR_VRI_VVV0I0 },
  1489. { "vsra", 0x7e, INSTR_VRR_VVV0000 },
  1490. { "vsrab", 0x7f, INSTR_VRR_VVV0000 },
  1491. { "vsrl", 0x7c, INSTR_VRR_VVV0000 },
  1492. { "vsrlb", 0x7d, INSTR_VRR_VVV0000 },
  1493. { "vs", 0xf7, INSTR_VRR_VVV000M },
  1494. { "vscb", 0xf5, INSTR_VRR_VVV000M },
  1495. { "vsb", 0xbf, INSTR_VRR_VVVM00V },
  1496. { { 0, LONG_INSN_VSBCBI }, 0xbd, INSTR_VRR_VVVM00V },
  1497. { "vsumg", 0x65, INSTR_VRR_VVV000M },
  1498. { "vsumq", 0x67, INSTR_VRR_VVV000M },
  1499. { "vsum", 0x64, INSTR_VRR_VVV000M },
  1500. { "vtm", 0xd8, INSTR_VRR_VV00000 },
  1501. { "vfae", 0x82, INSTR_VRR_VVV0M0M },
  1502. { "vfee", 0x80, INSTR_VRR_VVV0M0M },
  1503. { "vfene", 0x81, INSTR_VRR_VVV0M0M },
  1504. { "vistr", 0x5c, INSTR_VRR_VV00M0M },
  1505. { "vstrc", 0x8a, INSTR_VRR_VVVMM0V },
  1506. { "vfa", 0xe3, INSTR_VRR_VVV00MM },
  1507. { "wfc", 0xcb, INSTR_VRR_VV000MM },
  1508. { "wfk", 0xca, INSTR_VRR_VV000MM },
  1509. { "vfce", 0xe8, INSTR_VRR_VVV0MMM },
  1510. { "vfch", 0xeb, INSTR_VRR_VVV0MMM },
  1511. { "vfche", 0xea, INSTR_VRR_VVV0MMM },
  1512. { "vcdg", 0xc3, INSTR_VRR_VV00MMM },
  1513. { "vcdlg", 0xc1, INSTR_VRR_VV00MMM },
  1514. { "vcgd", 0xc2, INSTR_VRR_VV00MMM },
  1515. { "vclgd", 0xc0, INSTR_VRR_VV00MMM },
  1516. { "vfd", 0xe5, INSTR_VRR_VVV00MM },
  1517. { "vfi", 0xc7, INSTR_VRR_VV00MMM },
  1518. { "vlde", 0xc4, INSTR_VRR_VV000MM },
  1519. { "vled", 0xc5, INSTR_VRR_VV00MMM },
  1520. { "vfm", 0xe7, INSTR_VRR_VVV00MM },
  1521. { "vfma", 0x8f, INSTR_VRR_VVVM0MV },
  1522. { "vfms", 0x8e, INSTR_VRR_VVVM0MV },
  1523. { "vfpso", 0xcc, INSTR_VRR_VV00MMM },
  1524. { "vfsq", 0xce, INSTR_VRR_VV000MM },
  1525. { "vfs", 0xe2, INSTR_VRR_VVV00MM },
  1526. { "vftci", 0x4a, INSTR_VRI_VVIMM },
  1527. { "", 0, INSTR_INVALID }
  1528. };
  1529. static struct s390_insn opcode_eb[] = {
  1530. { "lmg", 0x04, INSTR_RSY_RRRD },
  1531. { "srag", 0x0a, INSTR_RSY_RRRD },
  1532. { "slag", 0x0b, INSTR_RSY_RRRD },
  1533. { "srlg", 0x0c, INSTR_RSY_RRRD },
  1534. { "sllg", 0x0d, INSTR_RSY_RRRD },
  1535. { "tracg", 0x0f, INSTR_RSY_RRRD },
  1536. { "csy", 0x14, INSTR_RSY_RRRD },
  1537. { "rllg", 0x1c, INSTR_RSY_RRRD },
  1538. { "clmh", 0x20, INSTR_RSY_RURD },
  1539. { "clmy", 0x21, INSTR_RSY_RURD },
  1540. { "clt", 0x23, INSTR_RSY_RURD },
  1541. { "stmg", 0x24, INSTR_RSY_RRRD },
  1542. { "stctg", 0x25, INSTR_RSY_CCRD },
  1543. { "stmh", 0x26, INSTR_RSY_RRRD },
  1544. { "clgt", 0x2b, INSTR_RSY_RURD },
  1545. { "stcmh", 0x2c, INSTR_RSY_RURD },
  1546. { "stcmy", 0x2d, INSTR_RSY_RURD },
  1547. { "lctlg", 0x2f, INSTR_RSY_CCRD },
  1548. { "csg", 0x30, INSTR_RSY_RRRD },
  1549. { "cdsy", 0x31, INSTR_RSY_RRRD },
  1550. { "cdsg", 0x3e, INSTR_RSY_RRRD },
  1551. { "bxhg", 0x44, INSTR_RSY_RRRD },
  1552. { "bxleg", 0x45, INSTR_RSY_RRRD },
  1553. { "ecag", 0x4c, INSTR_RSY_RRRD },
  1554. { "tmy", 0x51, INSTR_SIY_URD },
  1555. { "mviy", 0x52, INSTR_SIY_URD },
  1556. { "niy", 0x54, INSTR_SIY_URD },
  1557. { "cliy", 0x55, INSTR_SIY_URD },
  1558. { "oiy", 0x56, INSTR_SIY_URD },
  1559. { "xiy", 0x57, INSTR_SIY_URD },
  1560. { "asi", 0x6a, INSTR_SIY_IRD },
  1561. { "alsi", 0x6e, INSTR_SIY_IRD },
  1562. { "agsi", 0x7a, INSTR_SIY_IRD },
  1563. { "algsi", 0x7e, INSTR_SIY_IRD },
  1564. { "icmh", 0x80, INSTR_RSY_RURD },
  1565. { "icmy", 0x81, INSTR_RSY_RURD },
  1566. { "clclu", 0x8f, INSTR_RSY_RRRD },
  1567. { "stmy", 0x90, INSTR_RSY_RRRD },
  1568. { "lmh", 0x96, INSTR_RSY_RRRD },
  1569. { "lmy", 0x98, INSTR_RSY_RRRD },
  1570. { "lamy", 0x9a, INSTR_RSY_AARD },
  1571. { "stamy", 0x9b, INSTR_RSY_AARD },
  1572. { { 0, LONG_INSN_PCISTB }, 0xd0, INSTR_RSY_RRRD },
  1573. { "sic", 0xd1, INSTR_RSY_RRRD },
  1574. { "srak", 0xdc, INSTR_RSY_RRRD },
  1575. { "slak", 0xdd, INSTR_RSY_RRRD },
  1576. { "srlk", 0xde, INSTR_RSY_RRRD },
  1577. { "sllk", 0xdf, INSTR_RSY_RRRD },
  1578. { "locg", 0xe2, INSTR_RSY_RDRM },
  1579. { "stocg", 0xe3, INSTR_RSY_RDRM },
  1580. { "lang", 0xe4, INSTR_RSY_RRRD },
  1581. { "laog", 0xe6, INSTR_RSY_RRRD },
  1582. { "laxg", 0xe7, INSTR_RSY_RRRD },
  1583. { "laag", 0xe8, INSTR_RSY_RRRD },
  1584. { "laalg", 0xea, INSTR_RSY_RRRD },
  1585. { "loc", 0xf2, INSTR_RSY_RDRM },
  1586. { "stoc", 0xf3, INSTR_RSY_RDRM },
  1587. { "lan", 0xf4, INSTR_RSY_RRRD },
  1588. { "lao", 0xf6, INSTR_RSY_RRRD },
  1589. { "lax", 0xf7, INSTR_RSY_RRRD },
  1590. { "laa", 0xf8, INSTR_RSY_RRRD },
  1591. { "laal", 0xfa, INSTR_RSY_RRRD },
  1592. { "lric", 0x60, INSTR_RSY_RDRM },
  1593. { "stric", 0x61, INSTR_RSY_RDRM },
  1594. { "mric", 0x62, INSTR_RSY_RDRM },
  1595. { { 0, LONG_INSN_STCCTM }, 0x17, INSTR_RSY_RMRD },
  1596. { "rll", 0x1d, INSTR_RSY_RRRD },
  1597. { "mvclu", 0x8e, INSTR_RSY_RRRD },
  1598. { "tp", 0xc0, INSTR_RSL_R0RD },
  1599. { "", 0, INSTR_INVALID }
  1600. };
  1601. static struct s390_insn opcode_ec[] = {
  1602. { "brxhg", 0x44, INSTR_RIE_RRP },
  1603. { "brxlg", 0x45, INSTR_RIE_RRP },
  1604. { { 0, LONG_INSN_RISBLG }, 0x51, INSTR_RIE_RRUUU },
  1605. { "rnsbg", 0x54, INSTR_RIE_RRUUU },
  1606. { "risbg", 0x55, INSTR_RIE_RRUUU },
  1607. { "rosbg", 0x56, INSTR_RIE_RRUUU },
  1608. { "rxsbg", 0x57, INSTR_RIE_RRUUU },
  1609. { { 0, LONG_INSN_RISBGN }, 0x59, INSTR_RIE_RRUUU },
  1610. { { 0, LONG_INSN_RISBHG }, 0x5D, INSTR_RIE_RRUUU },
  1611. { "cgrj", 0x64, INSTR_RIE_RRPU },
  1612. { "clgrj", 0x65, INSTR_RIE_RRPU },
  1613. { "cgit", 0x70, INSTR_RIE_R0IU },
  1614. { "clgit", 0x71, INSTR_RIE_R0UU },
  1615. { "cit", 0x72, INSTR_RIE_R0IU },
  1616. { "clfit", 0x73, INSTR_RIE_R0UU },
  1617. { "crj", 0x76, INSTR_RIE_RRPU },
  1618. { "clrj", 0x77, INSTR_RIE_RRPU },
  1619. { "cgij", 0x7c, INSTR_RIE_RUPI },
  1620. { "clgij", 0x7d, INSTR_RIE_RUPU },
  1621. { "cij", 0x7e, INSTR_RIE_RUPI },
  1622. { "clij", 0x7f, INSTR_RIE_RUPU },
  1623. { "ahik", 0xd8, INSTR_RIE_RRI0 },
  1624. { "aghik", 0xd9, INSTR_RIE_RRI0 },
  1625. { { 0, LONG_INSN_ALHSIK }, 0xda, INSTR_RIE_RRI0 },
  1626. { { 0, LONG_INSN_ALGHSIK }, 0xdb, INSTR_RIE_RRI0 },
  1627. { "cgrb", 0xe4, INSTR_RRS_RRRDU },
  1628. { "clgrb", 0xe5, INSTR_RRS_RRRDU },
  1629. { "crb", 0xf6, INSTR_RRS_RRRDU },
  1630. { "clrb", 0xf7, INSTR_RRS_RRRDU },
  1631. { "cgib", 0xfc, INSTR_RIS_RURDI },
  1632. { "clgib", 0xfd, INSTR_RIS_RURDU },
  1633. { "cib", 0xfe, INSTR_RIS_RURDI },
  1634. { "clib", 0xff, INSTR_RIS_RURDU },
  1635. { "", 0, INSTR_INVALID }
  1636. };
  1637. static struct s390_insn opcode_ed[] = {
  1638. { "mayl", 0x38, INSTR_RXF_FRRDF },
  1639. { "myl", 0x39, INSTR_RXF_FRRDF },
  1640. { "may", 0x3a, INSTR_RXF_FRRDF },
  1641. { "my", 0x3b, INSTR_RXF_FRRDF },
  1642. { "mayh", 0x3c, INSTR_RXF_FRRDF },
  1643. { "myh", 0x3d, INSTR_RXF_FRRDF },
  1644. { "sldt", 0x40, INSTR_RXF_FRRDF },
  1645. { "srdt", 0x41, INSTR_RXF_FRRDF },
  1646. { "slxt", 0x48, INSTR_RXF_FRRDF },
  1647. { "srxt", 0x49, INSTR_RXF_FRRDF },
  1648. { "tdcet", 0x50, INSTR_RXE_FRRD },
  1649. { "tdget", 0x51, INSTR_RXE_FRRD },
  1650. { "tdcdt", 0x54, INSTR_RXE_FRRD },
  1651. { "tdgdt", 0x55, INSTR_RXE_FRRD },
  1652. { "tdcxt", 0x58, INSTR_RXE_FRRD },
  1653. { "tdgxt", 0x59, INSTR_RXE_FRRD },
  1654. { "ley", 0x64, INSTR_RXY_FRRD },
  1655. { "ldy", 0x65, INSTR_RXY_FRRD },
  1656. { "stey", 0x66, INSTR_RXY_FRRD },
  1657. { "stdy", 0x67, INSTR_RXY_FRRD },
  1658. { "czdt", 0xa8, INSTR_RSL_LRDFU },
  1659. { "czxt", 0xa9, INSTR_RSL_LRDFU },
  1660. { "cdzt", 0xaa, INSTR_RSL_LRDFU },
  1661. { "cxzt", 0xab, INSTR_RSL_LRDFU },
  1662. { "ldeb", 0x04, INSTR_RXE_FRRD },
  1663. { "lxdb", 0x05, INSTR_RXE_FRRD },
  1664. { "lxeb", 0x06, INSTR_RXE_FRRD },
  1665. { "mxdb", 0x07, INSTR_RXE_FRRD },
  1666. { "keb", 0x08, INSTR_RXE_FRRD },
  1667. { "ceb", 0x09, INSTR_RXE_FRRD },
  1668. { "aeb", 0x0a, INSTR_RXE_FRRD },
  1669. { "seb", 0x0b, INSTR_RXE_FRRD },
  1670. { "mdeb", 0x0c, INSTR_RXE_FRRD },
  1671. { "deb", 0x0d, INSTR_RXE_FRRD },
  1672. { "maeb", 0x0e, INSTR_RXF_FRRDF },
  1673. { "mseb", 0x0f, INSTR_RXF_FRRDF },
  1674. { "tceb", 0x10, INSTR_RXE_FRRD },
  1675. { "tcdb", 0x11, INSTR_RXE_FRRD },
  1676. { "tcxb", 0x12, INSTR_RXE_FRRD },
  1677. { "sqeb", 0x14, INSTR_RXE_FRRD },
  1678. { "sqdb", 0x15, INSTR_RXE_FRRD },
  1679. { "meeb", 0x17, INSTR_RXE_FRRD },
  1680. { "kdb", 0x18, INSTR_RXE_FRRD },
  1681. { "cdb", 0x19, INSTR_RXE_FRRD },
  1682. { "adb", 0x1a, INSTR_RXE_FRRD },
  1683. { "sdb", 0x1b, INSTR_RXE_FRRD },
  1684. { "mdb", 0x1c, INSTR_RXE_FRRD },
  1685. { "ddb", 0x1d, INSTR_RXE_FRRD },
  1686. { "madb", 0x1e, INSTR_RXF_FRRDF },
  1687. { "msdb", 0x1f, INSTR_RXF_FRRDF },
  1688. { "lde", 0x24, INSTR_RXE_FRRD },
  1689. { "lxd", 0x25, INSTR_RXE_FRRD },
  1690. { "lxe", 0x26, INSTR_RXE_FRRD },
  1691. { "mae", 0x2e, INSTR_RXF_FRRDF },
  1692. { "mse", 0x2f, INSTR_RXF_FRRDF },
  1693. { "sqe", 0x34, INSTR_RXE_FRRD },
  1694. { "sqd", 0x35, INSTR_RXE_FRRD },
  1695. { "mee", 0x37, INSTR_RXE_FRRD },
  1696. { "mad", 0x3e, INSTR_RXF_FRRDF },
  1697. { "msd", 0x3f, INSTR_RXF_FRRDF },
  1698. { "", 0, INSTR_INVALID }
  1699. };
  1700. /* Extracts an operand value from an instruction. */
  1701. static unsigned int extract_operand(unsigned char *code,
  1702. const struct s390_operand *operand)
  1703. {
  1704. unsigned char *cp;
  1705. unsigned int val;
  1706. int bits;
  1707. /* Extract fragments of the operand byte for byte. */
  1708. cp = code + operand->shift / 8;
  1709. bits = (operand->shift & 7) + operand->bits;
  1710. val = 0;
  1711. do {
  1712. val <<= 8;
  1713. val |= (unsigned int) *cp++;
  1714. bits -= 8;
  1715. } while (bits > 0);
  1716. val >>= -bits;
  1717. val &= ((1U << (operand->bits - 1)) << 1) - 1;
  1718. /* Check for special long displacement case. */
  1719. if (operand->bits == 20 && operand->shift == 20)
  1720. val = (val & 0xff) << 12 | (val & 0xfff00) >> 8;
  1721. /* Check for register extensions bits for vector registers. */
  1722. if (operand->flags & OPERAND_VR) {
  1723. if (operand->shift == 8)
  1724. val |= (code[4] & 8) << 1;
  1725. else if (operand->shift == 12)
  1726. val |= (code[4] & 4) << 2;
  1727. else if (operand->shift == 16)
  1728. val |= (code[4] & 2) << 3;
  1729. else if (operand->shift == 32)
  1730. val |= (code[4] & 1) << 4;
  1731. }
  1732. /* Sign extend value if the operand is signed or pc relative. */
  1733. if ((operand->flags & (OPERAND_SIGNED | OPERAND_PCREL)) &&
  1734. (val & (1U << (operand->bits - 1))))
  1735. val |= (-1U << (operand->bits - 1)) << 1;
  1736. /* Double value if the operand is pc relative. */
  1737. if (operand->flags & OPERAND_PCREL)
  1738. val <<= 1;
  1739. /* Length x in an instructions has real length x + 1. */
  1740. if (operand->flags & OPERAND_LENGTH)
  1741. val++;
  1742. return val;
  1743. }
  1744. struct s390_insn *find_insn(unsigned char *code)
  1745. {
  1746. unsigned char opfrag = code[1];
  1747. unsigned char opmask;
  1748. struct s390_insn *table;
  1749. switch (code[0]) {
  1750. case 0x01:
  1751. table = opcode_01;
  1752. break;
  1753. case 0xa5:
  1754. table = opcode_a5;
  1755. break;
  1756. case 0xa7:
  1757. table = opcode_a7;
  1758. break;
  1759. case 0xaa:
  1760. table = opcode_aa;
  1761. break;
  1762. case 0xb2:
  1763. table = opcode_b2;
  1764. break;
  1765. case 0xb3:
  1766. table = opcode_b3;
  1767. break;
  1768. case 0xb9:
  1769. table = opcode_b9;
  1770. break;
  1771. case 0xc0:
  1772. table = opcode_c0;
  1773. break;
  1774. case 0xc2:
  1775. table = opcode_c2;
  1776. break;
  1777. case 0xc4:
  1778. table = opcode_c4;
  1779. break;
  1780. case 0xc6:
  1781. table = opcode_c6;
  1782. break;
  1783. case 0xc8:
  1784. table = opcode_c8;
  1785. break;
  1786. case 0xcc:
  1787. table = opcode_cc;
  1788. break;
  1789. case 0xe3:
  1790. table = opcode_e3;
  1791. opfrag = code[5];
  1792. break;
  1793. case 0xe5:
  1794. table = opcode_e5;
  1795. break;
  1796. case 0xe7:
  1797. table = opcode_e7;
  1798. opfrag = code[5];
  1799. break;
  1800. case 0xeb:
  1801. table = opcode_eb;
  1802. opfrag = code[5];
  1803. break;
  1804. case 0xec:
  1805. table = opcode_ec;
  1806. opfrag = code[5];
  1807. break;
  1808. case 0xed:
  1809. table = opcode_ed;
  1810. opfrag = code[5];
  1811. break;
  1812. default:
  1813. table = opcode;
  1814. opfrag = code[0];
  1815. break;
  1816. }
  1817. while (table->format != INSTR_INVALID) {
  1818. opmask = formats[table->format][0];
  1819. if (table->opfrag == (opfrag & opmask))
  1820. return table;
  1821. table++;
  1822. }
  1823. return NULL;
  1824. }
  1825. /**
  1826. * insn_to_mnemonic - decode an s390 instruction
  1827. * @instruction: instruction to decode
  1828. * @buf: buffer to fill with mnemonic
  1829. * @len: length of buffer
  1830. *
  1831. * Decode the instruction at @instruction and store the corresponding
  1832. * mnemonic into @buf of length @len.
  1833. * @buf is left unchanged if the instruction could not be decoded.
  1834. * Returns:
  1835. * %0 on success, %-ENOENT if the instruction was not found.
  1836. */
  1837. int insn_to_mnemonic(unsigned char *instruction, char *buf, unsigned int len)
  1838. {
  1839. struct s390_insn *insn;
  1840. insn = find_insn(instruction);
  1841. if (!insn)
  1842. return -ENOENT;
  1843. if (insn->name[0] == '\0')
  1844. snprintf(buf, len, "%s",
  1845. long_insn_name[(int) insn->name[1]]);
  1846. else
  1847. snprintf(buf, len, "%.5s", insn->name);
  1848. return 0;
  1849. }
  1850. EXPORT_SYMBOL_GPL(insn_to_mnemonic);
  1851. static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
  1852. {
  1853. struct s390_insn *insn;
  1854. const unsigned char *ops;
  1855. const struct s390_operand *operand;
  1856. unsigned int value;
  1857. char separator;
  1858. char *ptr;
  1859. int i;
  1860. ptr = buffer;
  1861. insn = find_insn(code);
  1862. if (insn) {
  1863. if (insn->name[0] == '\0')
  1864. ptr += sprintf(ptr, "%s\t",
  1865. long_insn_name[(int) insn->name[1]]);
  1866. else
  1867. ptr += sprintf(ptr, "%.5s\t", insn->name);
  1868. /* Extract the operands. */
  1869. separator = 0;
  1870. for (ops = formats[insn->format] + 1, i = 0;
  1871. *ops != 0 && i < 6; ops++, i++) {
  1872. operand = operands + *ops;
  1873. value = extract_operand(code, operand);
  1874. if ((operand->flags & OPERAND_INDEX) && value == 0)
  1875. continue;
  1876. if ((operand->flags & OPERAND_BASE) &&
  1877. value == 0 && separator == '(') {
  1878. separator = ',';
  1879. continue;
  1880. }
  1881. if (separator)
  1882. ptr += sprintf(ptr, "%c", separator);
  1883. /*
  1884. * Use four '%' characters below because of the
  1885. * following two conversions:
  1886. *
  1887. * 1) sprintf: %%%%r -> %%r
  1888. * 2) printk : %%r -> %r
  1889. */
  1890. if (operand->flags & OPERAND_GPR)
  1891. ptr += sprintf(ptr, "%%%%r%i", value);
  1892. else if (operand->flags & OPERAND_FPR)
  1893. ptr += sprintf(ptr, "%%%%f%i", value);
  1894. else if (operand->flags & OPERAND_AR)
  1895. ptr += sprintf(ptr, "%%%%a%i", value);
  1896. else if (operand->flags & OPERAND_CR)
  1897. ptr += sprintf(ptr, "%%%%c%i", value);
  1898. else if (operand->flags & OPERAND_VR)
  1899. ptr += sprintf(ptr, "%%%%v%i", value);
  1900. else if (operand->flags & OPERAND_PCREL)
  1901. ptr += sprintf(ptr, "%lx", (signed int) value
  1902. + addr);
  1903. else if (operand->flags & OPERAND_SIGNED)
  1904. ptr += sprintf(ptr, "%i", value);
  1905. else
  1906. ptr += sprintf(ptr, "%u", value);
  1907. if (operand->flags & OPERAND_DISP)
  1908. separator = '(';
  1909. else if (operand->flags & OPERAND_BASE) {
  1910. ptr += sprintf(ptr, ")");
  1911. separator = ',';
  1912. } else
  1913. separator = ',';
  1914. }
  1915. } else
  1916. ptr += sprintf(ptr, "unknown");
  1917. return (int) (ptr - buffer);
  1918. }
  1919. void show_code(struct pt_regs *regs)
  1920. {
  1921. char *mode = user_mode(regs) ? "User" : "Krnl";
  1922. unsigned char code[64];
  1923. char buffer[128], *ptr;
  1924. mm_segment_t old_fs;
  1925. unsigned long addr;
  1926. int start, end, opsize, hops, i;
  1927. /* Get a snapshot of the 64 bytes surrounding the fault address. */
  1928. old_fs = get_fs();
  1929. set_fs(user_mode(regs) ? USER_DS : KERNEL_DS);
  1930. for (start = 32; start && regs->psw.addr >= 34 - start; start -= 2) {
  1931. addr = regs->psw.addr - 34 + start;
  1932. if (__copy_from_user(code + start - 2,
  1933. (char __user *) addr, 2))
  1934. break;
  1935. }
  1936. for (end = 32; end < 64; end += 2) {
  1937. addr = regs->psw.addr + end - 32;
  1938. if (__copy_from_user(code + end,
  1939. (char __user *) addr, 2))
  1940. break;
  1941. }
  1942. set_fs(old_fs);
  1943. /* Code snapshot useable ? */
  1944. if ((regs->psw.addr & 1) || start >= end) {
  1945. printk("%s Code: Bad PSW.\n", mode);
  1946. return;
  1947. }
  1948. /* Find a starting point for the disassembly. */
  1949. while (start < 32) {
  1950. for (i = 0, hops = 0; start + i < 32 && hops < 3; hops++) {
  1951. if (!find_insn(code + start + i))
  1952. break;
  1953. i += insn_length(code[start + i]);
  1954. }
  1955. if (start + i == 32)
  1956. /* Looks good, sequence ends at PSW. */
  1957. break;
  1958. start += 2;
  1959. }
  1960. /* Decode the instructions. */
  1961. ptr = buffer;
  1962. ptr += sprintf(ptr, "%s Code:", mode);
  1963. hops = 0;
  1964. while (start < end && hops < 8) {
  1965. opsize = insn_length(code[start]);
  1966. if (start + opsize == 32)
  1967. *ptr++ = '#';
  1968. else if (start == 32)
  1969. *ptr++ = '>';
  1970. else
  1971. *ptr++ = ' ';
  1972. addr = regs->psw.addr + start - 32;
  1973. ptr += sprintf(ptr, "%016lx: ", addr);
  1974. if (start + opsize >= end)
  1975. break;
  1976. for (i = 0; i < opsize; i++)
  1977. ptr += sprintf(ptr, "%02x", code[start + i]);
  1978. *ptr++ = '\t';
  1979. if (i < 6)
  1980. *ptr++ = '\t';
  1981. ptr += print_insn(ptr, code + start, addr);
  1982. start += opsize;
  1983. printk(buffer);
  1984. ptr = buffer;
  1985. ptr += sprintf(ptr, "\n\t ");
  1986. hops++;
  1987. }
  1988. printk("\n");
  1989. }
  1990. void print_fn_code(unsigned char *code, unsigned long len)
  1991. {
  1992. char buffer[64], *ptr;
  1993. int opsize, i;
  1994. while (len) {
  1995. ptr = buffer;
  1996. opsize = insn_length(*code);
  1997. if (opsize > len)
  1998. break;
  1999. ptr += sprintf(ptr, "%p: ", code);
  2000. for (i = 0; i < opsize; i++)
  2001. ptr += sprintf(ptr, "%02x", code[i]);
  2002. *ptr++ = '\t';
  2003. if (i < 4)
  2004. *ptr++ = '\t';
  2005. ptr += print_insn(ptr, code, (unsigned long) code);
  2006. *ptr++ = '\n';
  2007. *ptr++ = 0;
  2008. printk(buffer);
  2009. code += opsize;
  2010. len -= opsize;
  2011. }
  2012. }