dis.c 67 KB

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