2
0

arm-dis.c 158 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165
  1. /* Instruction printing code for the ARM
  2. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
  3. 2007, Free Software Foundation, Inc.
  4. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
  5. Modification by James G. Smith (jsmith@cygnus.co.uk)
  6. This file is part of libopcodes.
  7. This program is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 2 of the License, or (at your option)
  10. any later version.
  11. This program is distributed in the hope that it will be useful, but WITHOUT
  12. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  18. /* Start of qemu specific additions. Mostly this is stub definitions
  19. for things we don't care about. */
  20. #include "dis-asm.h"
  21. #define FALSE 0
  22. #define TRUE (!FALSE)
  23. #define ATTRIBUTE_UNUSED __attribute__((unused))
  24. #define ISSPACE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')
  25. #define ARM_EXT_V1 0
  26. #define ARM_EXT_V2 0
  27. #define ARM_EXT_V2S 0
  28. #define ARM_EXT_V3 0
  29. #define ARM_EXT_V3M 0
  30. #define ARM_EXT_V4 0
  31. #define ARM_EXT_V4T 0
  32. #define ARM_EXT_V5 0
  33. #define ARM_EXT_V5T 0
  34. #define ARM_EXT_V5ExP 0
  35. #define ARM_EXT_V5E 0
  36. #define ARM_EXT_V5J 0
  37. #define ARM_EXT_V6 0
  38. #define ARM_EXT_V6K 0
  39. #define ARM_EXT_V6Z 0
  40. #define ARM_EXT_V6T2 0
  41. #define ARM_EXT_V7 0
  42. #define ARM_EXT_DIV 0
  43. /* Co-processor space extensions. */
  44. #define ARM_CEXT_XSCALE 0
  45. #define ARM_CEXT_MAVERICK 0
  46. #define ARM_CEXT_IWMMXT 0
  47. #define FPU_FPA_EXT_V1 0
  48. #define FPU_FPA_EXT_V2 0
  49. #define FPU_VFP_EXT_NONE 0
  50. #define FPU_VFP_EXT_V1xD 0
  51. #define FPU_VFP_EXT_V1 0
  52. #define FPU_VFP_EXT_V2 0
  53. #define FPU_MAVERICK 0
  54. #define FPU_VFP_EXT_V3 0
  55. #define FPU_NEON_EXT_V1 0
  56. int floatformat_ieee_single_little;
  57. /* Assume host uses ieee float. */
  58. static void floatformat_to_double (int *ignored, unsigned char *data,
  59. double *dest)
  60. {
  61. union {
  62. uint32_t i;
  63. float f;
  64. } u;
  65. u.i = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
  66. *dest = u.f;
  67. }
  68. /* End of qemu specific additions. */
  69. /* FIXME: Belongs in global header. */
  70. #ifndef strneq
  71. #define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)
  72. #endif
  73. #ifndef NUM_ELEM
  74. #define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0])
  75. #endif
  76. struct opcode32
  77. {
  78. unsigned long arch; /* Architecture defining this insn. */
  79. unsigned long value, mask; /* Recognise insn if (op&mask)==value. */
  80. const char *assembler; /* How to disassemble this insn. */
  81. };
  82. struct opcode16
  83. {
  84. unsigned long arch; /* Architecture defining this insn. */
  85. unsigned short value, mask; /* Recognise insn if (op&mask)==value. */
  86. const char *assembler; /* How to disassemble this insn. */
  87. };
  88. /* print_insn_coprocessor recognizes the following format control codes:
  89. %% %
  90. %c print condition code (always bits 28-31 in ARM mode)
  91. %q print shifter argument
  92. %u print condition code (unconditional in ARM mode)
  93. %A print address for ldc/stc/ldf/stf instruction
  94. %B print vstm/vldm register list
  95. %C print vstr/vldr address operand
  96. %I print cirrus signed shift immediate: bits 0..3|4..6
  97. %F print the COUNT field of a LFM/SFM instruction.
  98. %P print floating point precision in arithmetic insn
  99. %Q print floating point precision in ldf/stf insn
  100. %R print floating point rounding mode
  101. %<bitfield>r print as an ARM register
  102. %<bitfield>d print the bitfield in decimal
  103. %<bitfield>k print immediate for VFPv3 conversion instruction
  104. %<bitfield>x print the bitfield in hex
  105. %<bitfield>X print the bitfield as 1 hex digit without leading "0x"
  106. %<bitfield>f print a floating point constant if >7 else a
  107. floating point register
  108. %<bitfield>w print as an iWMMXt width field - [bhwd]ss/us
  109. %<bitfield>g print as an iWMMXt 64-bit register
  110. %<bitfield>G print as an iWMMXt general purpose or control register
  111. %<bitfield>D print as a NEON D register
  112. %<bitfield>Q print as a NEON Q register
  113. %y<code> print a single precision VFP reg.
  114. Codes: 0=>Sm, 1=>Sd, 2=>Sn, 3=>multi-list, 4=>Sm pair
  115. %z<code> print a double precision VFP reg
  116. Codes: 0=>Dm, 1=>Dd, 2=>Dn, 3=>multi-list
  117. %<bitfield>'c print specified char iff bitfield is all ones
  118. %<bitfield>`c print specified char iff bitfield is all zeroes
  119. %<bitfield>?ab... select from array of values in big endian order
  120. %L print as an iWMMXt N/M width field.
  121. %Z print the Immediate of a WSHUFH instruction.
  122. %l like 'A' except use byte offsets for 'B' & 'H'
  123. versions.
  124. %i print 5-bit immediate in bits 8,3..0
  125. (print "32" when 0)
  126. %r print register offset address for wldt/wstr instruction
  127. */
  128. /* Common coprocessor opcodes shared between Arm and Thumb-2. */
  129. static const struct opcode32 coprocessor_opcodes[] =
  130. {
  131. /* XScale instructions. */
  132. {ARM_CEXT_XSCALE, 0x0e200010, 0x0fff0ff0, "mia%c\tacc0, %0-3r, %12-15r"},
  133. {ARM_CEXT_XSCALE, 0x0e280010, 0x0fff0ff0, "miaph%c\tacc0, %0-3r, %12-15r"},
  134. {ARM_CEXT_XSCALE, 0x0e2c0010, 0x0ffc0ff0, "mia%17'T%17`B%16'T%16`B%c\tacc0, %0-3r, %12-15r"},
  135. {ARM_CEXT_XSCALE, 0x0c400000, 0x0ff00fff, "mar%c\tacc0, %12-15r, %16-19r"},
  136. {ARM_CEXT_XSCALE, 0x0c500000, 0x0ff00fff, "mra%c\t%12-15r, %16-19r, acc0"},
  137. /* Intel Wireless MMX technology instructions. */
  138. #define FIRST_IWMMXT_INSN 0x0e130130
  139. #define IWMMXT_INSN_COUNT 73
  140. {ARM_CEXT_IWMMXT, 0x0e130130, 0x0f3f0fff, "tandc%22-23w%c\t%12-15r"},
  141. {ARM_CEXT_XSCALE, 0x0e400010, 0x0ff00f3f, "tbcst%6-7w%c\t%16-19g, %12-15r"},
  142. {ARM_CEXT_XSCALE, 0x0e130170, 0x0f3f0ff8, "textrc%22-23w%c\t%12-15r, #%0-2d"},
  143. {ARM_CEXT_XSCALE, 0x0e100070, 0x0f300ff0, "textrm%3?su%22-23w%c\t%12-15r, %16-19g, #%0-2d"},
  144. {ARM_CEXT_XSCALE, 0x0e600010, 0x0ff00f38, "tinsr%6-7w%c\t%16-19g, %12-15r, #%0-2d"},
  145. {ARM_CEXT_XSCALE, 0x0e000110, 0x0ff00fff, "tmcr%c\t%16-19G, %12-15r"},
  146. {ARM_CEXT_XSCALE, 0x0c400000, 0x0ff00ff0, "tmcrr%c\t%0-3g, %12-15r, %16-19r"},
  147. {ARM_CEXT_XSCALE, 0x0e2c0010, 0x0ffc0e10, "tmia%17?tb%16?tb%c\t%5-8g, %0-3r, %12-15r"},
  148. {ARM_CEXT_XSCALE, 0x0e200010, 0x0fff0e10, "tmia%c\t%5-8g, %0-3r, %12-15r"},
  149. {ARM_CEXT_XSCALE, 0x0e280010, 0x0fff0e10, "tmiaph%c\t%5-8g, %0-3r, %12-15r"},
  150. {ARM_CEXT_XSCALE, 0x0e100030, 0x0f300fff, "tmovmsk%22-23w%c\t%12-15r, %16-19g"},
  151. {ARM_CEXT_XSCALE, 0x0e100110, 0x0ff00ff0, "tmrc%c\t%12-15r, %16-19G"},
  152. {ARM_CEXT_XSCALE, 0x0c500000, 0x0ff00ff0, "tmrrc%c\t%12-15r, %16-19r, %0-3g"},
  153. {ARM_CEXT_XSCALE, 0x0e130150, 0x0f3f0fff, "torc%22-23w%c\t%12-15r"},
  154. {ARM_CEXT_XSCALE, 0x0e130190, 0x0f3f0fff, "torvsc%22-23w%c\t%12-15r"},
  155. {ARM_CEXT_XSCALE, 0x0e2001c0, 0x0f300fff, "wabs%22-23w%c\t%12-15g, %16-19g"},
  156. {ARM_CEXT_XSCALE, 0x0e0001c0, 0x0f300fff, "wacc%22-23w%c\t%12-15g, %16-19g"},
  157. {ARM_CEXT_XSCALE, 0x0e000180, 0x0f000ff0, "wadd%20-23w%c\t%12-15g, %16-19g, %0-3g"},
  158. {ARM_CEXT_XSCALE, 0x0e2001a0, 0x0f300ff0, "waddbhus%22?ml%c\t%12-15g, %16-19g, %0-3g"},
  159. {ARM_CEXT_XSCALE, 0x0ea001a0, 0x0ff00ff0, "waddsubhx%c\t%12-15g, %16-19g, %0-3g"},
  160. {ARM_CEXT_XSCALE, 0x0e000020, 0x0f800ff0, "waligni%c\t%12-15g, %16-19g, %0-3g, #%20-22d"},
  161. {ARM_CEXT_XSCALE, 0x0e800020, 0x0fc00ff0, "walignr%20-21d%c\t%12-15g, %16-19g, %0-3g"},
  162. {ARM_CEXT_XSCALE, 0x0e200000, 0x0fe00ff0, "wand%20'n%c\t%12-15g, %16-19g, %0-3g"},
  163. {ARM_CEXT_XSCALE, 0x0e800000, 0x0fa00ff0, "wavg2%22?hb%20'r%c\t%12-15g, %16-19g, %0-3g"},
  164. {ARM_CEXT_XSCALE, 0x0e400000, 0x0fe00ff0, "wavg4%20'r%c\t%12-15g, %16-19g, %0-3g"},
  165. {ARM_CEXT_XSCALE, 0x0e000060, 0x0f300ff0, "wcmpeq%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  166. {ARM_CEXT_XSCALE, 0x0e100060, 0x0f100ff0, "wcmpgt%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  167. {ARM_CEXT_XSCALE, 0xfc500100, 0xfe500f00, "wldrd\t%12-15g, %r"},
  168. {ARM_CEXT_XSCALE, 0xfc100100, 0xfe500f00, "wldrw\t%12-15G, %A"},
  169. {ARM_CEXT_XSCALE, 0x0c100000, 0x0e100e00, "wldr%L%c\t%12-15g, %l"},
  170. {ARM_CEXT_XSCALE, 0x0e400100, 0x0fc00ff0, "wmac%21?su%20'z%c\t%12-15g, %16-19g, %0-3g"},
  171. {ARM_CEXT_XSCALE, 0x0e800100, 0x0fc00ff0, "wmadd%21?su%20'x%c\t%12-15g, %16-19g, %0-3g"},
  172. {ARM_CEXT_XSCALE, 0x0ec00100, 0x0fd00ff0, "wmadd%21?sun%c\t%12-15g, %16-19g, %0-3g"},
  173. {ARM_CEXT_XSCALE, 0x0e000160, 0x0f100ff0, "wmax%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  174. {ARM_CEXT_XSCALE, 0x0e000080, 0x0f100fe0, "wmerge%c\t%12-15g, %16-19g, %0-3g, #%21-23d"},
  175. {ARM_CEXT_XSCALE, 0x0e0000a0, 0x0f800ff0, "wmia%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
  176. {ARM_CEXT_XSCALE, 0x0e800120, 0x0f800ff0, "wmiaw%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
  177. {ARM_CEXT_XSCALE, 0x0e100160, 0x0f100ff0, "wmin%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  178. {ARM_CEXT_XSCALE, 0x0e000100, 0x0fc00ff0, "wmul%21?su%20?ml%23'r%c\t%12-15g, %16-19g, %0-3g"},
  179. {ARM_CEXT_XSCALE, 0x0ed00100, 0x0fd00ff0, "wmul%21?sumr%c\t%12-15g, %16-19g, %0-3g"},
  180. {ARM_CEXT_XSCALE, 0x0ee000c0, 0x0fe00ff0, "wmulwsm%20`r%c\t%12-15g, %16-19g, %0-3g"},
  181. {ARM_CEXT_XSCALE, 0x0ec000c0, 0x0fe00ff0, "wmulwum%20`r%c\t%12-15g, %16-19g, %0-3g"},
  182. {ARM_CEXT_XSCALE, 0x0eb000c0, 0x0ff00ff0, "wmulwl%c\t%12-15g, %16-19g, %0-3g"},
  183. {ARM_CEXT_XSCALE, 0x0e8000a0, 0x0f800ff0, "wqmia%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
  184. {ARM_CEXT_XSCALE, 0x0e100080, 0x0fd00ff0, "wqmulm%21'r%c\t%12-15g, %16-19g, %0-3g"},
  185. {ARM_CEXT_XSCALE, 0x0ec000e0, 0x0fd00ff0, "wqmulwm%21'r%c\t%12-15g, %16-19g, %0-3g"},
  186. {ARM_CEXT_XSCALE, 0x0e000000, 0x0ff00ff0, "wor%c\t%12-15g, %16-19g, %0-3g"},
  187. {ARM_CEXT_XSCALE, 0x0e000080, 0x0f000ff0, "wpack%20-23w%c\t%12-15g, %16-19g, %0-3g"},
  188. {ARM_CEXT_XSCALE, 0xfe300040, 0xff300ef0, "wror%22-23w\t%12-15g, %16-19g, #%i"},
  189. {ARM_CEXT_XSCALE, 0x0e300040, 0x0f300ff0, "wror%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  190. {ARM_CEXT_XSCALE, 0x0e300140, 0x0f300ff0, "wror%22-23wg%c\t%12-15g, %16-19g, %0-3G"},
  191. {ARM_CEXT_XSCALE, 0x0e000120, 0x0fa00ff0, "wsad%22?hb%20'z%c\t%12-15g, %16-19g, %0-3g"},
  192. {ARM_CEXT_XSCALE, 0x0e0001e0, 0x0f000ff0, "wshufh%c\t%12-15g, %16-19g, #%Z"},
  193. {ARM_CEXT_XSCALE, 0xfe100040, 0xff300ef0, "wsll%22-23w\t%12-15g, %16-19g, #%i"},
  194. {ARM_CEXT_XSCALE, 0x0e100040, 0x0f300ff0, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
  195. {ARM_CEXT_XSCALE, 0x0e100148, 0x0f300ffc, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
  196. {ARM_CEXT_XSCALE, 0xfe000040, 0xff300ef0, "wsra%22-23w\t%12-15g, %16-19g, #%i"},
  197. {ARM_CEXT_XSCALE, 0x0e000040, 0x0f300ff0, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
  198. {ARM_CEXT_XSCALE, 0x0e000148, 0x0f300ffc, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
  199. {ARM_CEXT_XSCALE, 0xfe200040, 0xff300ef0, "wsrl%22-23w\t%12-15g, %16-19g, #%i"},
  200. {ARM_CEXT_XSCALE, 0x0e200040, 0x0f300ff0, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
  201. {ARM_CEXT_XSCALE, 0x0e200148, 0x0f300ffc, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
  202. {ARM_CEXT_XSCALE, 0xfc400100, 0xfe500f00, "wstrd\t%12-15g, %r"},
  203. {ARM_CEXT_XSCALE, 0xfc000100, 0xfe500f00, "wstrw\t%12-15G, %A"},
  204. {ARM_CEXT_XSCALE, 0x0c000000, 0x0e100e00, "wstr%L%c\t%12-15g, %l"},
  205. {ARM_CEXT_XSCALE, 0x0e0001a0, 0x0f000ff0, "wsub%20-23w%c\t%12-15g, %16-19g, %0-3g"},
  206. {ARM_CEXT_XSCALE, 0x0ed001c0, 0x0ff00ff0, "wsubaddhx%c\t%12-15g, %16-19g, %0-3g"},
  207. {ARM_CEXT_XSCALE, 0x0e1001c0, 0x0f300ff0, "wabsdiff%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  208. {ARM_CEXT_XSCALE, 0x0e0000c0, 0x0fd00fff, "wunpckeh%21?sub%c\t%12-15g, %16-19g"},
  209. {ARM_CEXT_XSCALE, 0x0e4000c0, 0x0fd00fff, "wunpckeh%21?suh%c\t%12-15g, %16-19g"},
  210. {ARM_CEXT_XSCALE, 0x0e8000c0, 0x0fd00fff, "wunpckeh%21?suw%c\t%12-15g, %16-19g"},
  211. {ARM_CEXT_XSCALE, 0x0e0000e0, 0x0f100fff, "wunpckel%21?su%22-23w%c\t%12-15g, %16-19g"},
  212. {ARM_CEXT_XSCALE, 0x0e1000c0, 0x0f300ff0, "wunpckih%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  213. {ARM_CEXT_XSCALE, 0x0e1000e0, 0x0f300ff0, "wunpckil%22-23w%c\t%12-15g, %16-19g, %0-3g"},
  214. {ARM_CEXT_XSCALE, 0x0e100000, 0x0ff00ff0, "wxor%c\t%12-15g, %16-19g, %0-3g"},
  215. /* Floating point coprocessor (FPA) instructions */
  216. {FPU_FPA_EXT_V1, 0x0e000100, 0x0ff08f10, "adf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  217. {FPU_FPA_EXT_V1, 0x0e100100, 0x0ff08f10, "muf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  218. {FPU_FPA_EXT_V1, 0x0e200100, 0x0ff08f10, "suf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  219. {FPU_FPA_EXT_V1, 0x0e300100, 0x0ff08f10, "rsf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  220. {FPU_FPA_EXT_V1, 0x0e400100, 0x0ff08f10, "dvf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  221. {FPU_FPA_EXT_V1, 0x0e500100, 0x0ff08f10, "rdf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  222. {FPU_FPA_EXT_V1, 0x0e600100, 0x0ff08f10, "pow%c%P%R\t%12-14f, %16-18f, %0-3f"},
  223. {FPU_FPA_EXT_V1, 0x0e700100, 0x0ff08f10, "rpw%c%P%R\t%12-14f, %16-18f, %0-3f"},
  224. {FPU_FPA_EXT_V1, 0x0e800100, 0x0ff08f10, "rmf%c%P%R\t%12-14f, %16-18f, %0-3f"},
  225. {FPU_FPA_EXT_V1, 0x0e900100, 0x0ff08f10, "fml%c%P%R\t%12-14f, %16-18f, %0-3f"},
  226. {FPU_FPA_EXT_V1, 0x0ea00100, 0x0ff08f10, "fdv%c%P%R\t%12-14f, %16-18f, %0-3f"},
  227. {FPU_FPA_EXT_V1, 0x0eb00100, 0x0ff08f10, "frd%c%P%R\t%12-14f, %16-18f, %0-3f"},
  228. {FPU_FPA_EXT_V1, 0x0ec00100, 0x0ff08f10, "pol%c%P%R\t%12-14f, %16-18f, %0-3f"},
  229. {FPU_FPA_EXT_V1, 0x0e008100, 0x0ff08f10, "mvf%c%P%R\t%12-14f, %0-3f"},
  230. {FPU_FPA_EXT_V1, 0x0e108100, 0x0ff08f10, "mnf%c%P%R\t%12-14f, %0-3f"},
  231. {FPU_FPA_EXT_V1, 0x0e208100, 0x0ff08f10, "abs%c%P%R\t%12-14f, %0-3f"},
  232. {FPU_FPA_EXT_V1, 0x0e308100, 0x0ff08f10, "rnd%c%P%R\t%12-14f, %0-3f"},
  233. {FPU_FPA_EXT_V1, 0x0e408100, 0x0ff08f10, "sqt%c%P%R\t%12-14f, %0-3f"},
  234. {FPU_FPA_EXT_V1, 0x0e508100, 0x0ff08f10, "log%c%P%R\t%12-14f, %0-3f"},
  235. {FPU_FPA_EXT_V1, 0x0e608100, 0x0ff08f10, "lgn%c%P%R\t%12-14f, %0-3f"},
  236. {FPU_FPA_EXT_V1, 0x0e708100, 0x0ff08f10, "exp%c%P%R\t%12-14f, %0-3f"},
  237. {FPU_FPA_EXT_V1, 0x0e808100, 0x0ff08f10, "sin%c%P%R\t%12-14f, %0-3f"},
  238. {FPU_FPA_EXT_V1, 0x0e908100, 0x0ff08f10, "cos%c%P%R\t%12-14f, %0-3f"},
  239. {FPU_FPA_EXT_V1, 0x0ea08100, 0x0ff08f10, "tan%c%P%R\t%12-14f, %0-3f"},
  240. {FPU_FPA_EXT_V1, 0x0eb08100, 0x0ff08f10, "asn%c%P%R\t%12-14f, %0-3f"},
  241. {FPU_FPA_EXT_V1, 0x0ec08100, 0x0ff08f10, "acs%c%P%R\t%12-14f, %0-3f"},
  242. {FPU_FPA_EXT_V1, 0x0ed08100, 0x0ff08f10, "atn%c%P%R\t%12-14f, %0-3f"},
  243. {FPU_FPA_EXT_V1, 0x0ee08100, 0x0ff08f10, "urd%c%P%R\t%12-14f, %0-3f"},
  244. {FPU_FPA_EXT_V1, 0x0ef08100, 0x0ff08f10, "nrm%c%P%R\t%12-14f, %0-3f"},
  245. {FPU_FPA_EXT_V1, 0x0e000110, 0x0ff00f1f, "flt%c%P%R\t%16-18f, %12-15r"},
  246. {FPU_FPA_EXT_V1, 0x0e100110, 0x0fff0f98, "fix%c%R\t%12-15r, %0-2f"},
  247. {FPU_FPA_EXT_V1, 0x0e200110, 0x0fff0fff, "wfs%c\t%12-15r"},
  248. {FPU_FPA_EXT_V1, 0x0e300110, 0x0fff0fff, "rfs%c\t%12-15r"},
  249. {FPU_FPA_EXT_V1, 0x0e400110, 0x0fff0fff, "wfc%c\t%12-15r"},
  250. {FPU_FPA_EXT_V1, 0x0e500110, 0x0fff0fff, "rfc%c\t%12-15r"},
  251. {FPU_FPA_EXT_V1, 0x0e90f110, 0x0ff8fff0, "cmf%c\t%16-18f, %0-3f"},
  252. {FPU_FPA_EXT_V1, 0x0eb0f110, 0x0ff8fff0, "cnf%c\t%16-18f, %0-3f"},
  253. {FPU_FPA_EXT_V1, 0x0ed0f110, 0x0ff8fff0, "cmfe%c\t%16-18f, %0-3f"},
  254. {FPU_FPA_EXT_V1, 0x0ef0f110, 0x0ff8fff0, "cnfe%c\t%16-18f, %0-3f"},
  255. {FPU_FPA_EXT_V1, 0x0c000100, 0x0e100f00, "stf%c%Q\t%12-14f, %A"},
  256. {FPU_FPA_EXT_V1, 0x0c100100, 0x0e100f00, "ldf%c%Q\t%12-14f, %A"},
  257. {FPU_FPA_EXT_V2, 0x0c000200, 0x0e100f00, "sfm%c\t%12-14f, %F, %A"},
  258. {FPU_FPA_EXT_V2, 0x0c100200, 0x0e100f00, "lfm%c\t%12-14f, %F, %A"},
  259. /* Register load/store */
  260. {FPU_NEON_EXT_V1, 0x0d200b00, 0x0fb00f01, "vstmdb%c\t%16-19r%21'!, %B"},
  261. {FPU_NEON_EXT_V1, 0x0d300b00, 0x0fb00f01, "vldmdb%c\t%16-19r%21'!, %B"},
  262. {FPU_NEON_EXT_V1, 0x0c800b00, 0x0f900f01, "vstmia%c\t%16-19r%21'!, %B"},
  263. {FPU_NEON_EXT_V1, 0x0c900b00, 0x0f900f01, "vldmia%c\t%16-19r%21'!, %B"},
  264. {FPU_NEON_EXT_V1, 0x0d000b00, 0x0f300f00, "vstr%c\t%12-15,22D, %C"},
  265. {FPU_NEON_EXT_V1, 0x0d100b00, 0x0f300f00, "vldr%c\t%12-15,22D, %C"},
  266. /* Data transfer between ARM and NEON registers */
  267. {FPU_NEON_EXT_V1, 0x0e800b10, 0x0ff00f70, "vdup%c.32\t%16-19,7D, %12-15r"},
  268. {FPU_NEON_EXT_V1, 0x0e800b30, 0x0ff00f70, "vdup%c.16\t%16-19,7D, %12-15r"},
  269. {FPU_NEON_EXT_V1, 0x0ea00b10, 0x0ff00f70, "vdup%c.32\t%16-19,7Q, %12-15r"},
  270. {FPU_NEON_EXT_V1, 0x0ea00b30, 0x0ff00f70, "vdup%c.16\t%16-19,7Q, %12-15r"},
  271. {FPU_NEON_EXT_V1, 0x0ec00b10, 0x0ff00f70, "vdup%c.8\t%16-19,7D, %12-15r"},
  272. {FPU_NEON_EXT_V1, 0x0ee00b10, 0x0ff00f70, "vdup%c.8\t%16-19,7Q, %12-15r"},
  273. {FPU_NEON_EXT_V1, 0x0c400b10, 0x0ff00fd0, "vmov%c\t%0-3,5D, %12-15r, %16-19r"},
  274. {FPU_NEON_EXT_V1, 0x0c500b10, 0x0ff00fd0, "vmov%c\t%12-15r, %16-19r, %0-3,5D"},
  275. {FPU_NEON_EXT_V1, 0x0e000b10, 0x0fd00f70, "vmov%c.32\t%16-19,7D[%21d], %12-15r"},
  276. {FPU_NEON_EXT_V1, 0x0e100b10, 0x0f500f70, "vmov%c.32\t%12-15r, %16-19,7D[%21d]"},
  277. {FPU_NEON_EXT_V1, 0x0e000b30, 0x0fd00f30, "vmov%c.16\t%16-19,7D[%6,21d], %12-15r"},
  278. {FPU_NEON_EXT_V1, 0x0e100b30, 0x0f500f30, "vmov%c.%23?us16\t%12-15r, %16-19,7D[%6,21d]"},
  279. {FPU_NEON_EXT_V1, 0x0e400b10, 0x0fd00f10, "vmov%c.8\t%16-19,7D[%5,6,21d], %12-15r"},
  280. {FPU_NEON_EXT_V1, 0x0e500b10, 0x0f500f10, "vmov%c.%23?us8\t%12-15r, %16-19,7D[%5,6,21d]"},
  281. /* Floating point coprocessor (VFP) instructions */
  282. {FPU_VFP_EXT_V1xD, 0x0ef1fa10, 0x0fffffff, "fmstat%c"},
  283. {FPU_VFP_EXT_V1xD, 0x0ee00a10, 0x0fff0fff, "fmxr%c\tfpsid, %12-15r"},
  284. {FPU_VFP_EXT_V1xD, 0x0ee10a10, 0x0fff0fff, "fmxr%c\tfpscr, %12-15r"},
  285. {FPU_VFP_EXT_V1xD, 0x0ee60a10, 0x0fff0fff, "fmxr%c\tmvfr1, %12-15r"},
  286. {FPU_VFP_EXT_V1xD, 0x0ee70a10, 0x0fff0fff, "fmxr%c\tmvfr0, %12-15r"},
  287. {FPU_VFP_EXT_V1xD, 0x0ee80a10, 0x0fff0fff, "fmxr%c\tfpexc, %12-15r"},
  288. {FPU_VFP_EXT_V1xD, 0x0ee90a10, 0x0fff0fff, "fmxr%c\tfpinst, %12-15r\t@ Impl def"},
  289. {FPU_VFP_EXT_V1xD, 0x0eea0a10, 0x0fff0fff, "fmxr%c\tfpinst2, %12-15r\t@ Impl def"},
  290. {FPU_VFP_EXT_V1xD, 0x0ef00a10, 0x0fff0fff, "fmrx%c\t%12-15r, fpsid"},
  291. {FPU_VFP_EXT_V1xD, 0x0ef10a10, 0x0fff0fff, "fmrx%c\t%12-15r, fpscr"},
  292. {FPU_VFP_EXT_V1xD, 0x0ef60a10, 0x0fff0fff, "fmrx%c\t%12-15r, mvfr1"},
  293. {FPU_VFP_EXT_V1xD, 0x0ef70a10, 0x0fff0fff, "fmrx%c\t%12-15r, mvfr0"},
  294. {FPU_VFP_EXT_V1xD, 0x0ef80a10, 0x0fff0fff, "fmrx%c\t%12-15r, fpexc"},
  295. {FPU_VFP_EXT_V1xD, 0x0ef90a10, 0x0fff0fff, "fmrx%c\t%12-15r, fpinst\t@ Impl def"},
  296. {FPU_VFP_EXT_V1xD, 0x0efa0a10, 0x0fff0fff, "fmrx%c\t%12-15r, fpinst2\t@ Impl def"},
  297. {FPU_VFP_EXT_V1, 0x0e000b10, 0x0ff00fff, "fmdlr%c\t%z2, %12-15r"},
  298. {FPU_VFP_EXT_V1, 0x0e100b10, 0x0ff00fff, "fmrdl%c\t%12-15r, %z2"},
  299. {FPU_VFP_EXT_V1, 0x0e200b10, 0x0ff00fff, "fmdhr%c\t%z2, %12-15r"},
  300. {FPU_VFP_EXT_V1, 0x0e300b10, 0x0ff00fff, "fmrdh%c\t%12-15r, %z2"},
  301. {FPU_VFP_EXT_V1xD, 0x0ee00a10, 0x0ff00fff, "fmxr%c\t<impl def %16-19x>, %12-15r"},
  302. {FPU_VFP_EXT_V1xD, 0x0ef00a10, 0x0ff00fff, "fmrx%c\t%12-15r, <impl def %16-19x>"},
  303. {FPU_VFP_EXT_V1xD, 0x0e000a10, 0x0ff00f7f, "fmsr%c\t%y2, %12-15r"},
  304. {FPU_VFP_EXT_V1xD, 0x0e100a10, 0x0ff00f7f, "fmrs%c\t%12-15r, %y2"},
  305. {FPU_VFP_EXT_V1xD, 0x0eb50a40, 0x0fbf0f70, "fcmp%7'ezs%c\t%y1"},
  306. {FPU_VFP_EXT_V1, 0x0eb50b40, 0x0fbf0f70, "fcmp%7'ezd%c\t%z1"},
  307. {FPU_VFP_EXT_V1xD, 0x0eb00a40, 0x0fbf0fd0, "fcpys%c\t%y1, %y0"},
  308. {FPU_VFP_EXT_V1xD, 0x0eb00ac0, 0x0fbf0fd0, "fabss%c\t%y1, %y0"},
  309. {FPU_VFP_EXT_V1, 0x0eb00b40, 0x0fbf0fd0, "fcpyd%c\t%z1, %z0"},
  310. {FPU_VFP_EXT_V1, 0x0eb00bc0, 0x0fbf0fd0, "fabsd%c\t%z1, %z0"},
  311. {FPU_VFP_EXT_V1xD, 0x0eb10a40, 0x0fbf0fd0, "fnegs%c\t%y1, %y0"},
  312. {FPU_VFP_EXT_V1xD, 0x0eb10ac0, 0x0fbf0fd0, "fsqrts%c\t%y1, %y0"},
  313. {FPU_VFP_EXT_V1, 0x0eb10b40, 0x0fbf0fd0, "fnegd%c\t%z1, %z0"},
  314. {FPU_VFP_EXT_V1, 0x0eb10bc0, 0x0fbf0fd0, "fsqrtd%c\t%z1, %z0"},
  315. {FPU_VFP_EXT_V1, 0x0eb70ac0, 0x0fbf0fd0, "fcvtds%c\t%z1, %y0"},
  316. {FPU_VFP_EXT_V1, 0x0eb70bc0, 0x0fbf0fd0, "fcvtsd%c\t%y1, %z0"},
  317. {FPU_VFP_EXT_V1xD, 0x0eb80a40, 0x0fbf0fd0, "fuitos%c\t%y1, %y0"},
  318. {FPU_VFP_EXT_V1xD, 0x0eb80ac0, 0x0fbf0fd0, "fsitos%c\t%y1, %y0"},
  319. {FPU_VFP_EXT_V1, 0x0eb80b40, 0x0fbf0fd0, "fuitod%c\t%z1, %y0"},
  320. {FPU_VFP_EXT_V1, 0x0eb80bc0, 0x0fbf0fd0, "fsitod%c\t%z1, %y0"},
  321. {FPU_VFP_EXT_V1xD, 0x0eb40a40, 0x0fbf0f50, "fcmp%7'es%c\t%y1, %y0"},
  322. {FPU_VFP_EXT_V1, 0x0eb40b40, 0x0fbf0f50, "fcmp%7'ed%c\t%z1, %z0"},
  323. {FPU_VFP_EXT_V3, 0x0eba0a40, 0x0fbe0f50, "f%16?us%7?lhtos%c\t%y1, #%5,0-3k"},
  324. {FPU_VFP_EXT_V3, 0x0eba0b40, 0x0fbe0f50, "f%16?us%7?lhtod%c\t%z1, #%5,0-3k"},
  325. {FPU_VFP_EXT_V1xD, 0x0ebc0a40, 0x0fbe0f50, "fto%16?sui%7'zs%c\t%y1, %y0"},
  326. {FPU_VFP_EXT_V1, 0x0ebc0b40, 0x0fbe0f50, "fto%16?sui%7'zd%c\t%y1, %z0"},
  327. {FPU_VFP_EXT_V3, 0x0ebe0a40, 0x0fbe0f50, "fto%16?us%7?lhs%c\t%y1, #%5,0-3k"},
  328. {FPU_VFP_EXT_V3, 0x0ebe0b40, 0x0fbe0f50, "fto%16?us%7?lhd%c\t%z1, #%5,0-3k"},
  329. {FPU_VFP_EXT_V1, 0x0c500b10, 0x0fb00ff0, "fmrrd%c\t%12-15r, %16-19r, %z0"},
  330. {FPU_VFP_EXT_V3, 0x0eb00a00, 0x0fb00ff0, "fconsts%c\t%y1, #%0-3,16-19d"},
  331. {FPU_VFP_EXT_V3, 0x0eb00b00, 0x0fb00ff0, "fconstd%c\t%z1, #%0-3,16-19d"},
  332. {FPU_VFP_EXT_V2, 0x0c400a10, 0x0ff00fd0, "fmsrr%c\t%y4, %12-15r, %16-19r"},
  333. {FPU_VFP_EXT_V2, 0x0c400b10, 0x0ff00fd0, "fmdrr%c\t%z0, %12-15r, %16-19r"},
  334. {FPU_VFP_EXT_V2, 0x0c500a10, 0x0ff00fd0, "fmrrs%c\t%12-15r, %16-19r, %y4"},
  335. {FPU_VFP_EXT_V1xD, 0x0e000a00, 0x0fb00f50, "fmacs%c\t%y1, %y2, %y0"},
  336. {FPU_VFP_EXT_V1xD, 0x0e000a40, 0x0fb00f50, "fnmacs%c\t%y1, %y2, %y0"},
  337. {FPU_VFP_EXT_V1, 0x0e000b00, 0x0fb00f50, "fmacd%c\t%z1, %z2, %z0"},
  338. {FPU_VFP_EXT_V1, 0x0e000b40, 0x0fb00f50, "fnmacd%c\t%z1, %z2, %z0"},
  339. {FPU_VFP_EXT_V1xD, 0x0e100a00, 0x0fb00f50, "fmscs%c\t%y1, %y2, %y0"},
  340. {FPU_VFP_EXT_V1xD, 0x0e100a40, 0x0fb00f50, "fnmscs%c\t%y1, %y2, %y0"},
  341. {FPU_VFP_EXT_V1, 0x0e100b00, 0x0fb00f50, "fmscd%c\t%z1, %z2, %z0"},
  342. {FPU_VFP_EXT_V1, 0x0e100b40, 0x0fb00f50, "fnmscd%c\t%z1, %z2, %z0"},
  343. {FPU_VFP_EXT_V1xD, 0x0e200a00, 0x0fb00f50, "fmuls%c\t%y1, %y2, %y0"},
  344. {FPU_VFP_EXT_V1xD, 0x0e200a40, 0x0fb00f50, "fnmuls%c\t%y1, %y2, %y0"},
  345. {FPU_VFP_EXT_V1, 0x0e200b00, 0x0fb00f50, "fmuld%c\t%z1, %z2, %z0"},
  346. {FPU_VFP_EXT_V1, 0x0e200b40, 0x0fb00f50, "fnmuld%c\t%z1, %z2, %z0"},
  347. {FPU_VFP_EXT_V1xD, 0x0e300a00, 0x0fb00f50, "fadds%c\t%y1, %y2, %y0"},
  348. {FPU_VFP_EXT_V1xD, 0x0e300a40, 0x0fb00f50, "fsubs%c\t%y1, %y2, %y0"},
  349. {FPU_VFP_EXT_V1, 0x0e300b00, 0x0fb00f50, "faddd%c\t%z1, %z2, %z0"},
  350. {FPU_VFP_EXT_V1, 0x0e300b40, 0x0fb00f50, "fsubd%c\t%z1, %z2, %z0"},
  351. {FPU_VFP_EXT_V1xD, 0x0e800a00, 0x0fb00f50, "fdivs%c\t%y1, %y2, %y0"},
  352. {FPU_VFP_EXT_V1, 0x0e800b00, 0x0fb00f50, "fdivd%c\t%z1, %z2, %z0"},
  353. {FPU_VFP_EXT_V1xD, 0x0d200a00, 0x0fb00f00, "fstmdbs%c\t%16-19r!, %y3"},
  354. {FPU_VFP_EXT_V1xD, 0x0d200b00, 0x0fb00f00, "fstmdb%0?xd%c\t%16-19r!, %z3"},
  355. {FPU_VFP_EXT_V1xD, 0x0d300a00, 0x0fb00f00, "fldmdbs%c\t%16-19r!, %y3"},
  356. {FPU_VFP_EXT_V1xD, 0x0d300b00, 0x0fb00f00, "fldmdb%0?xd%c\t%16-19r!, %z3"},
  357. {FPU_VFP_EXT_V1xD, 0x0d000a00, 0x0f300f00, "fsts%c\t%y1, %A"},
  358. {FPU_VFP_EXT_V1, 0x0d000b00, 0x0f300f00, "fstd%c\t%z1, %A"},
  359. {FPU_VFP_EXT_V1xD, 0x0d100a00, 0x0f300f00, "flds%c\t%y1, %A"},
  360. {FPU_VFP_EXT_V1, 0x0d100b00, 0x0f300f00, "fldd%c\t%z1, %A"},
  361. {FPU_VFP_EXT_V1xD, 0x0c800a00, 0x0f900f00, "fstmias%c\t%16-19r%21'!, %y3"},
  362. {FPU_VFP_EXT_V1xD, 0x0c800b00, 0x0f900f00, "fstmia%0?xd%c\t%16-19r%21'!, %z3"},
  363. {FPU_VFP_EXT_V1xD, 0x0c900a00, 0x0f900f00, "fldmias%c\t%16-19r%21'!, %y3"},
  364. {FPU_VFP_EXT_V1xD, 0x0c900b00, 0x0f900f00, "fldmia%0?xd%c\t%16-19r%21'!, %z3"},
  365. /* Cirrus coprocessor instructions. */
  366. {ARM_CEXT_MAVERICK, 0x0d100400, 0x0f500f00, "cfldrs%c\tmvf%12-15d, %A"},
  367. {ARM_CEXT_MAVERICK, 0x0c100400, 0x0f500f00, "cfldrs%c\tmvf%12-15d, %A"},
  368. {ARM_CEXT_MAVERICK, 0x0d500400, 0x0f500f00, "cfldrd%c\tmvd%12-15d, %A"},
  369. {ARM_CEXT_MAVERICK, 0x0c500400, 0x0f500f00, "cfldrd%c\tmvd%12-15d, %A"},
  370. {ARM_CEXT_MAVERICK, 0x0d100500, 0x0f500f00, "cfldr32%c\tmvfx%12-15d, %A"},
  371. {ARM_CEXT_MAVERICK, 0x0c100500, 0x0f500f00, "cfldr32%c\tmvfx%12-15d, %A"},
  372. {ARM_CEXT_MAVERICK, 0x0d500500, 0x0f500f00, "cfldr64%c\tmvdx%12-15d, %A"},
  373. {ARM_CEXT_MAVERICK, 0x0c500500, 0x0f500f00, "cfldr64%c\tmvdx%12-15d, %A"},
  374. {ARM_CEXT_MAVERICK, 0x0d000400, 0x0f500f00, "cfstrs%c\tmvf%12-15d, %A"},
  375. {ARM_CEXT_MAVERICK, 0x0c000400, 0x0f500f00, "cfstrs%c\tmvf%12-15d, %A"},
  376. {ARM_CEXT_MAVERICK, 0x0d400400, 0x0f500f00, "cfstrd%c\tmvd%12-15d, %A"},
  377. {ARM_CEXT_MAVERICK, 0x0c400400, 0x0f500f00, "cfstrd%c\tmvd%12-15d, %A"},
  378. {ARM_CEXT_MAVERICK, 0x0d000500, 0x0f500f00, "cfstr32%c\tmvfx%12-15d, %A"},
  379. {ARM_CEXT_MAVERICK, 0x0c000500, 0x0f500f00, "cfstr32%c\tmvfx%12-15d, %A"},
  380. {ARM_CEXT_MAVERICK, 0x0d400500, 0x0f500f00, "cfstr64%c\tmvdx%12-15d, %A"},
  381. {ARM_CEXT_MAVERICK, 0x0c400500, 0x0f500f00, "cfstr64%c\tmvdx%12-15d, %A"},
  382. {ARM_CEXT_MAVERICK, 0x0e000450, 0x0ff00ff0, "cfmvsr%c\tmvf%16-19d, %12-15r"},
  383. {ARM_CEXT_MAVERICK, 0x0e100450, 0x0ff00ff0, "cfmvrs%c\t%12-15r, mvf%16-19d"},
  384. {ARM_CEXT_MAVERICK, 0x0e000410, 0x0ff00ff0, "cfmvdlr%c\tmvd%16-19d, %12-15r"},
  385. {ARM_CEXT_MAVERICK, 0x0e100410, 0x0ff00ff0, "cfmvrdl%c\t%12-15r, mvd%16-19d"},
  386. {ARM_CEXT_MAVERICK, 0x0e000430, 0x0ff00ff0, "cfmvdhr%c\tmvd%16-19d, %12-15r"},
  387. {ARM_CEXT_MAVERICK, 0x0e100430, 0x0ff00fff, "cfmvrdh%c\t%12-15r, mvd%16-19d"},
  388. {ARM_CEXT_MAVERICK, 0x0e000510, 0x0ff00fff, "cfmv64lr%c\tmvdx%16-19d, %12-15r"},
  389. {ARM_CEXT_MAVERICK, 0x0e100510, 0x0ff00fff, "cfmvr64l%c\t%12-15r, mvdx%16-19d"},
  390. {ARM_CEXT_MAVERICK, 0x0e000530, 0x0ff00fff, "cfmv64hr%c\tmvdx%16-19d, %12-15r"},
  391. {ARM_CEXT_MAVERICK, 0x0e100530, 0x0ff00fff, "cfmvr64h%c\t%12-15r, mvdx%16-19d"},
  392. {ARM_CEXT_MAVERICK, 0x0e200440, 0x0ff00fff, "cfmval32%c\tmvax%12-15d, mvfx%16-19d"},
  393. {ARM_CEXT_MAVERICK, 0x0e100440, 0x0ff00fff, "cfmv32al%c\tmvfx%12-15d, mvax%16-19d"},
  394. {ARM_CEXT_MAVERICK, 0x0e200460, 0x0ff00fff, "cfmvam32%c\tmvax%12-15d, mvfx%16-19d"},
  395. {ARM_CEXT_MAVERICK, 0x0e100460, 0x0ff00fff, "cfmv32am%c\tmvfx%12-15d, mvax%16-19d"},
  396. {ARM_CEXT_MAVERICK, 0x0e200480, 0x0ff00fff, "cfmvah32%c\tmvax%12-15d, mvfx%16-19d"},
  397. {ARM_CEXT_MAVERICK, 0x0e100480, 0x0ff00fff, "cfmv32ah%c\tmvfx%12-15d, mvax%16-19d"},
  398. {ARM_CEXT_MAVERICK, 0x0e2004a0, 0x0ff00fff, "cfmva32%c\tmvax%12-15d, mvfx%16-19d"},
  399. {ARM_CEXT_MAVERICK, 0x0e1004a0, 0x0ff00fff, "cfmv32a%c\tmvfx%12-15d, mvax%16-19d"},
  400. {ARM_CEXT_MAVERICK, 0x0e2004c0, 0x0ff00fff, "cfmva64%c\tmvax%12-15d, mvdx%16-19d"},
  401. {ARM_CEXT_MAVERICK, 0x0e1004c0, 0x0ff00fff, "cfmv64a%c\tmvdx%12-15d, mvax%16-19d"},
  402. {ARM_CEXT_MAVERICK, 0x0e2004e0, 0x0fff0fff, "cfmvsc32%c\tdspsc, mvdx%12-15d"},
  403. {ARM_CEXT_MAVERICK, 0x0e1004e0, 0x0fff0fff, "cfmv32sc%c\tmvdx%12-15d, dspsc"},
  404. {ARM_CEXT_MAVERICK, 0x0e000400, 0x0ff00fff, "cfcpys%c\tmvf%12-15d, mvf%16-19d"},
  405. {ARM_CEXT_MAVERICK, 0x0e000420, 0x0ff00fff, "cfcpyd%c\tmvd%12-15d, mvd%16-19d"},
  406. {ARM_CEXT_MAVERICK, 0x0e000460, 0x0ff00fff, "cfcvtsd%c\tmvd%12-15d, mvf%16-19d"},
  407. {ARM_CEXT_MAVERICK, 0x0e000440, 0x0ff00fff, "cfcvtds%c\tmvf%12-15d, mvd%16-19d"},
  408. {ARM_CEXT_MAVERICK, 0x0e000480, 0x0ff00fff, "cfcvt32s%c\tmvf%12-15d, mvfx%16-19d"},
  409. {ARM_CEXT_MAVERICK, 0x0e0004a0, 0x0ff00fff, "cfcvt32d%c\tmvd%12-15d, mvfx%16-19d"},
  410. {ARM_CEXT_MAVERICK, 0x0e0004c0, 0x0ff00fff, "cfcvt64s%c\tmvf%12-15d, mvdx%16-19d"},
  411. {ARM_CEXT_MAVERICK, 0x0e0004e0, 0x0ff00fff, "cfcvt64d%c\tmvd%12-15d, mvdx%16-19d"},
  412. {ARM_CEXT_MAVERICK, 0x0e100580, 0x0ff00fff, "cfcvts32%c\tmvfx%12-15d, mvf%16-19d"},
  413. {ARM_CEXT_MAVERICK, 0x0e1005a0, 0x0ff00fff, "cfcvtd32%c\tmvfx%12-15d, mvd%16-19d"},
  414. {ARM_CEXT_MAVERICK, 0x0e1005c0, 0x0ff00fff, "cftruncs32%c\tmvfx%12-15d, mvf%16-19d"},
  415. {ARM_CEXT_MAVERICK, 0x0e1005e0, 0x0ff00fff, "cftruncd32%c\tmvfx%12-15d, mvd%16-19d"},
  416. {ARM_CEXT_MAVERICK, 0x0e000550, 0x0ff00ff0, "cfrshl32%c\tmvfx%16-19d, mvfx%0-3d, %12-15r"},
  417. {ARM_CEXT_MAVERICK, 0x0e000570, 0x0ff00ff0, "cfrshl64%c\tmvdx%16-19d, mvdx%0-3d, %12-15r"},
  418. {ARM_CEXT_MAVERICK, 0x0e000500, 0x0ff00f10, "cfsh32%c\tmvfx%12-15d, mvfx%16-19d, #%I"},
  419. {ARM_CEXT_MAVERICK, 0x0e200500, 0x0ff00f10, "cfsh64%c\tmvdx%12-15d, mvdx%16-19d, #%I"},
  420. {ARM_CEXT_MAVERICK, 0x0e100490, 0x0ff00ff0, "cfcmps%c\t%12-15r, mvf%16-19d, mvf%0-3d"},
  421. {ARM_CEXT_MAVERICK, 0x0e1004b0, 0x0ff00ff0, "cfcmpd%c\t%12-15r, mvd%16-19d, mvd%0-3d"},
  422. {ARM_CEXT_MAVERICK, 0x0e100590, 0x0ff00ff0, "cfcmp32%c\t%12-15r, mvfx%16-19d, mvfx%0-3d"},
  423. {ARM_CEXT_MAVERICK, 0x0e1005b0, 0x0ff00ff0, "cfcmp64%c\t%12-15r, mvdx%16-19d, mvdx%0-3d"},
  424. {ARM_CEXT_MAVERICK, 0x0e300400, 0x0ff00fff, "cfabss%c\tmvf%12-15d, mvf%16-19d"},
  425. {ARM_CEXT_MAVERICK, 0x0e300420, 0x0ff00fff, "cfabsd%c\tmvd%12-15d, mvd%16-19d"},
  426. {ARM_CEXT_MAVERICK, 0x0e300440, 0x0ff00fff, "cfnegs%c\tmvf%12-15d, mvf%16-19d"},
  427. {ARM_CEXT_MAVERICK, 0x0e300460, 0x0ff00fff, "cfnegd%c\tmvd%12-15d, mvd%16-19d"},
  428. {ARM_CEXT_MAVERICK, 0x0e300480, 0x0ff00ff0, "cfadds%c\tmvf%12-15d, mvf%16-19d, mvf%0-3d"},
  429. {ARM_CEXT_MAVERICK, 0x0e3004a0, 0x0ff00ff0, "cfaddd%c\tmvd%12-15d, mvd%16-19d, mvd%0-3d"},
  430. {ARM_CEXT_MAVERICK, 0x0e3004c0, 0x0ff00ff0, "cfsubs%c\tmvf%12-15d, mvf%16-19d, mvf%0-3d"},
  431. {ARM_CEXT_MAVERICK, 0x0e3004e0, 0x0ff00ff0, "cfsubd%c\tmvd%12-15d, mvd%16-19d, mvd%0-3d"},
  432. {ARM_CEXT_MAVERICK, 0x0e100400, 0x0ff00ff0, "cfmuls%c\tmvf%12-15d, mvf%16-19d, mvf%0-3d"},
  433. {ARM_CEXT_MAVERICK, 0x0e100420, 0x0ff00ff0, "cfmuld%c\tmvd%12-15d, mvd%16-19d, mvd%0-3d"},
  434. {ARM_CEXT_MAVERICK, 0x0e300500, 0x0ff00fff, "cfabs32%c\tmvfx%12-15d, mvfx%16-19d"},
  435. {ARM_CEXT_MAVERICK, 0x0e300520, 0x0ff00fff, "cfabs64%c\tmvdx%12-15d, mvdx%16-19d"},
  436. {ARM_CEXT_MAVERICK, 0x0e300540, 0x0ff00fff, "cfneg32%c\tmvfx%12-15d, mvfx%16-19d"},
  437. {ARM_CEXT_MAVERICK, 0x0e300560, 0x0ff00fff, "cfneg64%c\tmvdx%12-15d, mvdx%16-19d"},
  438. {ARM_CEXT_MAVERICK, 0x0e300580, 0x0ff00ff0, "cfadd32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  439. {ARM_CEXT_MAVERICK, 0x0e3005a0, 0x0ff00ff0, "cfadd64%c\tmvdx%12-15d, mvdx%16-19d, mvdx%0-3d"},
  440. {ARM_CEXT_MAVERICK, 0x0e3005c0, 0x0ff00ff0, "cfsub32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  441. {ARM_CEXT_MAVERICK, 0x0e3005e0, 0x0ff00ff0, "cfsub64%c\tmvdx%12-15d, mvdx%16-19d, mvdx%0-3d"},
  442. {ARM_CEXT_MAVERICK, 0x0e100500, 0x0ff00ff0, "cfmul32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  443. {ARM_CEXT_MAVERICK, 0x0e100520, 0x0ff00ff0, "cfmul64%c\tmvdx%12-15d, mvdx%16-19d, mvdx%0-3d"},
  444. {ARM_CEXT_MAVERICK, 0x0e100540, 0x0ff00ff0, "cfmac32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  445. {ARM_CEXT_MAVERICK, 0x0e100560, 0x0ff00ff0, "cfmsc32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  446. {ARM_CEXT_MAVERICK, 0x0e000600, 0x0ff00f10, "cfmadd32%c\tmvax%5-7d, mvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  447. {ARM_CEXT_MAVERICK, 0x0e100600, 0x0ff00f10, "cfmsub32%c\tmvax%5-7d, mvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
  448. {ARM_CEXT_MAVERICK, 0x0e200600, 0x0ff00f10, "cfmadda32%c\tmvax%5-7d, mvax%12-15d, mvfx%16-19d, mvfx%0-3d"},
  449. {ARM_CEXT_MAVERICK, 0x0e300600, 0x0ff00f10, "cfmsuba32%c\tmvax%5-7d, mvax%12-15d, mvfx%16-19d, mvfx%0-3d"},
  450. /* Generic coprocessor instructions */
  451. {ARM_EXT_V2, 0x0c400000, 0x0ff00000, "mcrr%c\t%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"},
  452. {ARM_EXT_V2, 0x0c500000, 0x0ff00000, "mrrc%c\t%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"},
  453. {ARM_EXT_V2, 0x0e000000, 0x0f000010, "cdp%c\t%8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d, {%5-7d}"},
  454. {ARM_EXT_V2, 0x0e100010, 0x0f100010, "mrc%c\t%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}"},
  455. {ARM_EXT_V2, 0x0e000010, 0x0f100010, "mcr%c\t%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}"},
  456. {ARM_EXT_V2, 0x0c000000, 0x0e100000, "stc%22'l%c\t%8-11d, cr%12-15d, %A"},
  457. {ARM_EXT_V2, 0x0c100000, 0x0e100000, "ldc%22'l%c\t%8-11d, cr%12-15d, %A"},
  458. /* V6 coprocessor instructions */
  459. {ARM_EXT_V6, 0xfc500000, 0xfff00000, "mrrc2%c\t%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"},
  460. {ARM_EXT_V6, 0xfc400000, 0xfff00000, "mcrr2%c\t%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"},
  461. /* V5 coprocessor instructions */
  462. {ARM_EXT_V5, 0xfc100000, 0xfe100000, "ldc2%22'l%c\t%8-11d, cr%12-15d, %A"},
  463. {ARM_EXT_V5, 0xfc000000, 0xfe100000, "stc2%22'l%c\t%8-11d, cr%12-15d, %A"},
  464. {ARM_EXT_V5, 0xfe000000, 0xff000010, "cdp2%c\t%8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d, {%5-7d}"},
  465. {ARM_EXT_V5, 0xfe000010, 0xff100010, "mcr2%c\t%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}"},
  466. {ARM_EXT_V5, 0xfe100010, 0xff100010, "mrc2%c\t%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}"},
  467. {0, 0, 0, 0}
  468. };
  469. /* Neon opcode table: This does not encode the top byte -- that is
  470. checked by the print_insn_neon routine, as it depends on whether we are
  471. doing thumb32 or arm32 disassembly. */
  472. /* print_insn_neon recognizes the following format control codes:
  473. %% %
  474. %c print condition code
  475. %A print v{st,ld}[1234] operands
  476. %B print v{st,ld}[1234] any one operands
  477. %C print v{st,ld}[1234] single->all operands
  478. %D print scalar
  479. %E print vmov, vmvn, vorr, vbic encoded constant
  480. %F print vtbl,vtbx register list
  481. %<bitfield>r print as an ARM register
  482. %<bitfield>d print the bitfield in decimal
  483. %<bitfield>e print the 2^N - bitfield in decimal
  484. %<bitfield>D print as a NEON D register
  485. %<bitfield>Q print as a NEON Q register
  486. %<bitfield>R print as a NEON D or Q register
  487. %<bitfield>Sn print byte scaled width limited by n
  488. %<bitfield>Tn print short scaled width limited by n
  489. %<bitfield>Un print long scaled width limited by n
  490. %<bitfield>'c print specified char iff bitfield is all ones
  491. %<bitfield>`c print specified char iff bitfield is all zeroes
  492. %<bitfield>?ab... select from array of values in big endian order */
  493. static const struct opcode32 neon_opcodes[] =
  494. {
  495. /* Extract */
  496. {FPU_NEON_EXT_V1, 0xf2b00840, 0xffb00850, "vext%c.8\t%12-15,22R, %16-19,7R, %0-3,5R, #%8-11d"},
  497. {FPU_NEON_EXT_V1, 0xf2b00000, 0xffb00810, "vext%c.8\t%12-15,22R, %16-19,7R, %0-3,5R, #%8-11d"},
  498. /* Move data element to all lanes */
  499. {FPU_NEON_EXT_V1, 0xf3b40c00, 0xffb70f90, "vdup%c.32\t%12-15,22R, %0-3,5D[%19d]"},
  500. {FPU_NEON_EXT_V1, 0xf3b20c00, 0xffb30f90, "vdup%c.16\t%12-15,22R, %0-3,5D[%18-19d]"},
  501. {FPU_NEON_EXT_V1, 0xf3b10c00, 0xffb10f90, "vdup%c.8\t%12-15,22R, %0-3,5D[%17-19d]"},
  502. /* Table lookup */
  503. {FPU_NEON_EXT_V1, 0xf3b00800, 0xffb00c50, "vtbl%c.8\t%12-15,22D, %F, %0-3,5D"},
  504. {FPU_NEON_EXT_V1, 0xf3b00840, 0xffb00c50, "vtbx%c.8\t%12-15,22D, %F, %0-3,5D"},
  505. /* Two registers, miscellaneous */
  506. {FPU_NEON_EXT_V1, 0xf2880a10, 0xfebf0fd0, "vmovl%c.%24?us8\t%12-15,22Q, %0-3,5D"},
  507. {FPU_NEON_EXT_V1, 0xf2900a10, 0xfebf0fd0, "vmovl%c.%24?us16\t%12-15,22Q, %0-3,5D"},
  508. {FPU_NEON_EXT_V1, 0xf2a00a10, 0xfebf0fd0, "vmovl%c.%24?us32\t%12-15,22Q, %0-3,5D"},
  509. {FPU_NEON_EXT_V1, 0xf3b00500, 0xffbf0f90, "vcnt%c.8\t%12-15,22R, %0-3,5R"},
  510. {FPU_NEON_EXT_V1, 0xf3b00580, 0xffbf0f90, "vmvn%c\t%12-15,22R, %0-3,5R"},
  511. {FPU_NEON_EXT_V1, 0xf3b20000, 0xffbf0f90, "vswp%c\t%12-15,22R, %0-3,5R"},
  512. {FPU_NEON_EXT_V1, 0xf3b20200, 0xffb30fd0, "vmovn%c.i%18-19T2\t%12-15,22D, %0-3,5Q"},
  513. {FPU_NEON_EXT_V1, 0xf3b20240, 0xffb30fd0, "vqmovun%c.s%18-19T2\t%12-15,22D, %0-3,5Q"},
  514. {FPU_NEON_EXT_V1, 0xf3b20280, 0xffb30fd0, "vqmovn%c.s%18-19T2\t%12-15,22D, %0-3,5Q"},
  515. {FPU_NEON_EXT_V1, 0xf3b202c0, 0xffb30fd0, "vqmovn%c.u%18-19T2\t%12-15,22D, %0-3,5Q"},
  516. {FPU_NEON_EXT_V1, 0xf3b20300, 0xffb30fd0, "vshll%c.i%18-19S2\t%12-15,22Q, %0-3,5D, #%18-19S2"},
  517. {FPU_NEON_EXT_V1, 0xf3bb0400, 0xffbf0e90, "vrecpe%c.%8?fu%18-19S2\t%12-15,22R, %0-3,5R"},
  518. {FPU_NEON_EXT_V1, 0xf3bb0480, 0xffbf0e90, "vrsqrte%c.%8?fu%18-19S2\t%12-15,22R, %0-3,5R"},
  519. {FPU_NEON_EXT_V1, 0xf3b00000, 0xffb30f90, "vrev64%c.%18-19S2\t%12-15,22R, %0-3,5R"},
  520. {FPU_NEON_EXT_V1, 0xf3b00080, 0xffb30f90, "vrev32%c.%18-19S2\t%12-15,22R, %0-3,5R"},
  521. {FPU_NEON_EXT_V1, 0xf3b00100, 0xffb30f90, "vrev16%c.%18-19S2\t%12-15,22R, %0-3,5R"},
  522. {FPU_NEON_EXT_V1, 0xf3b00400, 0xffb30f90, "vcls%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
  523. {FPU_NEON_EXT_V1, 0xf3b00480, 0xffb30f90, "vclz%c.i%18-19S2\t%12-15,22R, %0-3,5R"},
  524. {FPU_NEON_EXT_V1, 0xf3b00700, 0xffb30f90, "vqabs%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
  525. {FPU_NEON_EXT_V1, 0xf3b00780, 0xffb30f90, "vqneg%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
  526. {FPU_NEON_EXT_V1, 0xf3b20080, 0xffb30f90, "vtrn%c.%18-19S2\t%12-15,22R, %0-3,5R"},
  527. {FPU_NEON_EXT_V1, 0xf3b20100, 0xffb30f90, "vuzp%c.%18-19S2\t%12-15,22R, %0-3,5R"},
  528. {FPU_NEON_EXT_V1, 0xf3b20180, 0xffb30f90, "vzip%c.%18-19S2\t%12-15,22R, %0-3,5R"},
  529. {FPU_NEON_EXT_V1, 0xf3b10000, 0xffb30b90, "vcgt%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
  530. {FPU_NEON_EXT_V1, 0xf3b10080, 0xffb30b90, "vcge%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
  531. {FPU_NEON_EXT_V1, 0xf3b10100, 0xffb30b90, "vceq%c.%10?fi%18-19S2\t%12-15,22R, %0-3,5R, #0"},
  532. {FPU_NEON_EXT_V1, 0xf3b10180, 0xffb30b90, "vcle%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
  533. {FPU_NEON_EXT_V1, 0xf3b10200, 0xffb30b90, "vclt%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
  534. {FPU_NEON_EXT_V1, 0xf3b10300, 0xffb30b90, "vabs%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R"},
  535. {FPU_NEON_EXT_V1, 0xf3b10380, 0xffb30b90, "vneg%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R"},
  536. {FPU_NEON_EXT_V1, 0xf3b00200, 0xffb30f10, "vpaddl%c.%7?us%18-19S2\t%12-15,22R, %0-3,5R"},
  537. {FPU_NEON_EXT_V1, 0xf3b00600, 0xffb30f10, "vpadal%c.%7?us%18-19S2\t%12-15,22R, %0-3,5R"},
  538. {FPU_NEON_EXT_V1, 0xf3b30600, 0xffb30e10, "vcvt%c.%7-8?usff%18-19Sa.%7-8?ffus%18-19Sa\t%12-15,22R, %0-3,5R"},
  539. /* Three registers of the same length */
  540. {FPU_NEON_EXT_V1, 0xf2000110, 0xffb00f10, "vand%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  541. {FPU_NEON_EXT_V1, 0xf2100110, 0xffb00f10, "vbic%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  542. {FPU_NEON_EXT_V1, 0xf2200110, 0xffb00f10, "vorr%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  543. {FPU_NEON_EXT_V1, 0xf2300110, 0xffb00f10, "vorn%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  544. {FPU_NEON_EXT_V1, 0xf3000110, 0xffb00f10, "veor%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  545. {FPU_NEON_EXT_V1, 0xf3100110, 0xffb00f10, "vbsl%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  546. {FPU_NEON_EXT_V1, 0xf3200110, 0xffb00f10, "vbit%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  547. {FPU_NEON_EXT_V1, 0xf3300110, 0xffb00f10, "vbif%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
  548. {FPU_NEON_EXT_V1, 0xf2000d00, 0xffa00f10, "vadd%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  549. {FPU_NEON_EXT_V1, 0xf2000d10, 0xffa00f10, "vmla%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  550. {FPU_NEON_EXT_V1, 0xf2000e00, 0xffa00f10, "vceq%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  551. {FPU_NEON_EXT_V1, 0xf2000f00, 0xffa00f10, "vmax%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  552. {FPU_NEON_EXT_V1, 0xf2000f10, 0xffa00f10, "vrecps%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  553. {FPU_NEON_EXT_V1, 0xf2200d00, 0xffa00f10, "vsub%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  554. {FPU_NEON_EXT_V1, 0xf2200d10, 0xffa00f10, "vmls%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  555. {FPU_NEON_EXT_V1, 0xf2200f00, 0xffa00f10, "vmin%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  556. {FPU_NEON_EXT_V1, 0xf2200f10, 0xffa00f10, "vrsqrts%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  557. {FPU_NEON_EXT_V1, 0xf3000d00, 0xffa00f10, "vpadd%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  558. {FPU_NEON_EXT_V1, 0xf3000d10, 0xffa00f10, "vmul%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  559. {FPU_NEON_EXT_V1, 0xf3000e00, 0xffa00f10, "vcge%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  560. {FPU_NEON_EXT_V1, 0xf3000e10, 0xffa00f10, "vacge%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  561. {FPU_NEON_EXT_V1, 0xf3000f00, 0xffa00f10, "vpmax%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  562. {FPU_NEON_EXT_V1, 0xf3200d00, 0xffa00f10, "vabd%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  563. {FPU_NEON_EXT_V1, 0xf3200e00, 0xffa00f10, "vcgt%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  564. {FPU_NEON_EXT_V1, 0xf3200e10, 0xffa00f10, "vacgt%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  565. {FPU_NEON_EXT_V1, 0xf3200f00, 0xffa00f10, "vpmin%c.f%20U0\t%12-15,22R, %16-19,7R, %0-3,5R"},
  566. {FPU_NEON_EXT_V1, 0xf2000800, 0xff800f10, "vadd%c.i%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
  567. {FPU_NEON_EXT_V1, 0xf2000810, 0xff800f10, "vtst%c.%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  568. {FPU_NEON_EXT_V1, 0xf2000900, 0xff800f10, "vmla%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  569. {FPU_NEON_EXT_V1, 0xf2000b00, 0xff800f10, "vqdmulh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
  570. {FPU_NEON_EXT_V1, 0xf2000b10, 0xff800f10, "vpadd%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  571. {FPU_NEON_EXT_V1, 0xf3000800, 0xff800f10, "vsub%c.i%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
  572. {FPU_NEON_EXT_V1, 0xf3000810, 0xff800f10, "vceq%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  573. {FPU_NEON_EXT_V1, 0xf3000900, 0xff800f10, "vmls%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  574. {FPU_NEON_EXT_V1, 0xf3000b00, 0xff800f10, "vqrdmulh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
  575. {FPU_NEON_EXT_V1, 0xf2000000, 0xfe800f10, "vhadd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  576. {FPU_NEON_EXT_V1, 0xf2000010, 0xfe800f10, "vqadd%c.%24?us%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
  577. {FPU_NEON_EXT_V1, 0xf2000100, 0xfe800f10, "vrhadd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  578. {FPU_NEON_EXT_V1, 0xf2000200, 0xfe800f10, "vhsub%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  579. {FPU_NEON_EXT_V1, 0xf2000210, 0xfe800f10, "vqsub%c.%24?us%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
  580. {FPU_NEON_EXT_V1, 0xf2000300, 0xfe800f10, "vcgt%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  581. {FPU_NEON_EXT_V1, 0xf2000310, 0xfe800f10, "vcge%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  582. {FPU_NEON_EXT_V1, 0xf2000400, 0xfe800f10, "vshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
  583. {FPU_NEON_EXT_V1, 0xf2000410, 0xfe800f10, "vqshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
  584. {FPU_NEON_EXT_V1, 0xf2000500, 0xfe800f10, "vrshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
  585. {FPU_NEON_EXT_V1, 0xf2000510, 0xfe800f10, "vqrshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
  586. {FPU_NEON_EXT_V1, 0xf2000600, 0xfe800f10, "vmax%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  587. {FPU_NEON_EXT_V1, 0xf2000610, 0xfe800f10, "vmin%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  588. {FPU_NEON_EXT_V1, 0xf2000700, 0xfe800f10, "vabd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  589. {FPU_NEON_EXT_V1, 0xf2000710, 0xfe800f10, "vaba%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  590. {FPU_NEON_EXT_V1, 0xf2000910, 0xfe800f10, "vmul%c.%24?pi%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  591. {FPU_NEON_EXT_V1, 0xf2000a00, 0xfe800f10, "vpmax%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  592. {FPU_NEON_EXT_V1, 0xf2000a10, 0xfe800f10, "vpmin%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
  593. /* One register and an immediate value */
  594. {FPU_NEON_EXT_V1, 0xf2800e10, 0xfeb80fb0, "vmov%c.i8\t%12-15,22R, %E"},
  595. {FPU_NEON_EXT_V1, 0xf2800e30, 0xfeb80fb0, "vmov%c.i64\t%12-15,22R, %E"},
  596. {FPU_NEON_EXT_V1, 0xf2800f10, 0xfeb80fb0, "vmov%c.f32\t%12-15,22R, %E"},
  597. {FPU_NEON_EXT_V1, 0xf2800810, 0xfeb80db0, "vmov%c.i16\t%12-15,22R, %E"},
  598. {FPU_NEON_EXT_V1, 0xf2800830, 0xfeb80db0, "vmvn%c.i16\t%12-15,22R, %E"},
  599. {FPU_NEON_EXT_V1, 0xf2800910, 0xfeb80db0, "vorr%c.i16\t%12-15,22R, %E"},
  600. {FPU_NEON_EXT_V1, 0xf2800930, 0xfeb80db0, "vbic%c.i16\t%12-15,22R, %E"},
  601. {FPU_NEON_EXT_V1, 0xf2800c10, 0xfeb80eb0, "vmov%c.i32\t%12-15,22R, %E"},
  602. {FPU_NEON_EXT_V1, 0xf2800c30, 0xfeb80eb0, "vmvn%c.i32\t%12-15,22R, %E"},
  603. {FPU_NEON_EXT_V1, 0xf2800110, 0xfeb809b0, "vorr%c.i32\t%12-15,22R, %E"},
  604. {FPU_NEON_EXT_V1, 0xf2800130, 0xfeb809b0, "vbic%c.i32\t%12-15,22R, %E"},
  605. {FPU_NEON_EXT_V1, 0xf2800010, 0xfeb808b0, "vmov%c.i32\t%12-15,22R, %E"},
  606. {FPU_NEON_EXT_V1, 0xf2800030, 0xfeb808b0, "vmvn%c.i32\t%12-15,22R, %E"},
  607. /* Two registers and a shift amount */
  608. {FPU_NEON_EXT_V1, 0xf2880810, 0xffb80fd0, "vshrn%c.i16\t%12-15,22D, %0-3,5Q, #%16-18e"},
  609. {FPU_NEON_EXT_V1, 0xf2880850, 0xffb80fd0, "vrshrn%c.i16\t%12-15,22D, %0-3,5Q, #%16-18e"},
  610. {FPU_NEON_EXT_V1, 0xf2880810, 0xfeb80fd0, "vqshrun%c.s16\t%12-15,22D, %0-3,5Q, #%16-18e"},
  611. {FPU_NEON_EXT_V1, 0xf2880850, 0xfeb80fd0, "vqrshrun%c.s16\t%12-15,22D, %0-3,5Q, #%16-18e"},
  612. {FPU_NEON_EXT_V1, 0xf2880910, 0xfeb80fd0, "vqshrn%c.%24?us16\t%12-15,22D, %0-3,5Q, #%16-18e"},
  613. {FPU_NEON_EXT_V1, 0xf2880950, 0xfeb80fd0, "vqrshrn%c.%24?us16\t%12-15,22D, %0-3,5Q, #%16-18e"},
  614. {FPU_NEON_EXT_V1, 0xf2880a10, 0xfeb80fd0, "vshll%c.%24?us8\t%12-15,22D, %0-3,5Q, #%16-18d"},
  615. {FPU_NEON_EXT_V1, 0xf2900810, 0xffb00fd0, "vshrn%c.i32\t%12-15,22D, %0-3,5Q, #%16-19e"},
  616. {FPU_NEON_EXT_V1, 0xf2900850, 0xffb00fd0, "vrshrn%c.i32\t%12-15,22D, %0-3,5Q, #%16-19e"},
  617. {FPU_NEON_EXT_V1, 0xf2880510, 0xffb80f90, "vshl%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18d"},
  618. {FPU_NEON_EXT_V1, 0xf3880410, 0xffb80f90, "vsri%c.8\t%12-15,22R, %0-3,5R, #%16-18e"},
  619. {FPU_NEON_EXT_V1, 0xf3880510, 0xffb80f90, "vsli%c.8\t%12-15,22R, %0-3,5R, #%16-18d"},
  620. {FPU_NEON_EXT_V1, 0xf3880610, 0xffb80f90, "vqshlu%c.s8\t%12-15,22R, %0-3,5R, #%16-18d"},
  621. {FPU_NEON_EXT_V1, 0xf2900810, 0xfeb00fd0, "vqshrun%c.s32\t%12-15,22D, %0-3,5Q, #%16-19e"},
  622. {FPU_NEON_EXT_V1, 0xf2900850, 0xfeb00fd0, "vqrshrun%c.s32\t%12-15,22D, %0-3,5Q, #%16-19e"},
  623. {FPU_NEON_EXT_V1, 0xf2900910, 0xfeb00fd0, "vqshrn%c.%24?us32\t%12-15,22D, %0-3,5Q, #%16-19e"},
  624. {FPU_NEON_EXT_V1, 0xf2900950, 0xfeb00fd0, "vqrshrn%c.%24?us32\t%12-15,22D, %0-3,5Q, #%16-19e"},
  625. {FPU_NEON_EXT_V1, 0xf2900a10, 0xfeb00fd0, "vshll%c.%24?us16\t%12-15,22D, %0-3,5Q, #%16-19d"},
  626. {FPU_NEON_EXT_V1, 0xf2880010, 0xfeb80f90, "vshr%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
  627. {FPU_NEON_EXT_V1, 0xf2880110, 0xfeb80f90, "vsra%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
  628. {FPU_NEON_EXT_V1, 0xf2880210, 0xfeb80f90, "vrshr%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
  629. {FPU_NEON_EXT_V1, 0xf2880310, 0xfeb80f90, "vrsra%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
  630. {FPU_NEON_EXT_V1, 0xf2880710, 0xfeb80f90, "vqshl%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18d"},
  631. {FPU_NEON_EXT_V1, 0xf2a00810, 0xffa00fd0, "vshrn%c.i64\t%12-15,22D, %0-3,5Q, #%16-20e"},
  632. {FPU_NEON_EXT_V1, 0xf2a00850, 0xffa00fd0, "vrshrn%c.i64\t%12-15,22D, %0-3,5Q, #%16-20e"},
  633. {FPU_NEON_EXT_V1, 0xf2900510, 0xffb00f90, "vshl%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19d"},
  634. {FPU_NEON_EXT_V1, 0xf3900410, 0xffb00f90, "vsri%c.16\t%12-15,22R, %0-3,5R, #%16-19e"},
  635. {FPU_NEON_EXT_V1, 0xf3900510, 0xffb00f90, "vsli%c.16\t%12-15,22R, %0-3,5R, #%16-19d"},
  636. {FPU_NEON_EXT_V1, 0xf3900610, 0xffb00f90, "vqshlu%c.s16\t%12-15,22R, %0-3,5R, #%16-19d"},
  637. {FPU_NEON_EXT_V1, 0xf2a00a10, 0xfea00fd0, "vshll%c.%24?us32\t%12-15,22D, %0-3,5Q, #%16-20d"},
  638. {FPU_NEON_EXT_V1, 0xf2900010, 0xfeb00f90, "vshr%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
  639. {FPU_NEON_EXT_V1, 0xf2900110, 0xfeb00f90, "vsra%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
  640. {FPU_NEON_EXT_V1, 0xf2900210, 0xfeb00f90, "vrshr%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
  641. {FPU_NEON_EXT_V1, 0xf2900310, 0xfeb00f90, "vrsra%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
  642. {FPU_NEON_EXT_V1, 0xf2900710, 0xfeb00f90, "vqshl%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19d"},
  643. {FPU_NEON_EXT_V1, 0xf2800810, 0xfec00fd0, "vqshrun%c.s64\t%12-15,22D, %0-3,5Q, #%16-20e"},
  644. {FPU_NEON_EXT_V1, 0xf2800850, 0xfec00fd0, "vqrshrun%c.s64\t%12-15,22D, %0-3,5Q, #%16-20e"},
  645. {FPU_NEON_EXT_V1, 0xf2800910, 0xfec00fd0, "vqshrn%c.%24?us64\t%12-15,22D, %0-3,5Q, #%16-20e"},
  646. {FPU_NEON_EXT_V1, 0xf2800950, 0xfec00fd0, "vqrshrn%c.%24?us64\t%12-15,22D, %0-3,5Q, #%16-20e"},
  647. {FPU_NEON_EXT_V1, 0xf2a00510, 0xffa00f90, "vshl%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20d"},
  648. {FPU_NEON_EXT_V1, 0xf3a00410, 0xffa00f90, "vsri%c.32\t%12-15,22R, %0-3,5R, #%16-20e"},
  649. {FPU_NEON_EXT_V1, 0xf3a00510, 0xffa00f90, "vsli%c.32\t%12-15,22R, %0-3,5R, #%16-20d"},
  650. {FPU_NEON_EXT_V1, 0xf3a00610, 0xffa00f90, "vqshlu%c.s32\t%12-15,22R, %0-3,5R, #%16-20d"},
  651. {FPU_NEON_EXT_V1, 0xf2a00010, 0xfea00f90, "vshr%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
  652. {FPU_NEON_EXT_V1, 0xf2a00110, 0xfea00f90, "vsra%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
  653. {FPU_NEON_EXT_V1, 0xf2a00210, 0xfea00f90, "vrshr%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
  654. {FPU_NEON_EXT_V1, 0xf2a00310, 0xfea00f90, "vrsra%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
  655. {FPU_NEON_EXT_V1, 0xf2a00710, 0xfea00f90, "vqshl%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20d"},
  656. {FPU_NEON_EXT_V1, 0xf2800590, 0xff800f90, "vshl%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21d"},
  657. {FPU_NEON_EXT_V1, 0xf3800490, 0xff800f90, "vsri%c.64\t%12-15,22R, %0-3,5R, #%16-21e"},
  658. {FPU_NEON_EXT_V1, 0xf3800590, 0xff800f90, "vsli%c.64\t%12-15,22R, %0-3,5R, #%16-21d"},
  659. {FPU_NEON_EXT_V1, 0xf3800690, 0xff800f90, "vqshlu%c.s64\t%12-15,22R, %0-3,5R, #%16-21d"},
  660. {FPU_NEON_EXT_V1, 0xf2800090, 0xfe800f90, "vshr%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
  661. {FPU_NEON_EXT_V1, 0xf2800190, 0xfe800f90, "vsra%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
  662. {FPU_NEON_EXT_V1, 0xf2800290, 0xfe800f90, "vrshr%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
  663. {FPU_NEON_EXT_V1, 0xf2800390, 0xfe800f90, "vrsra%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
  664. {FPU_NEON_EXT_V1, 0xf2800790, 0xfe800f90, "vqshl%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21d"},
  665. {FPU_NEON_EXT_V1, 0xf2a00e10, 0xfea00e90, "vcvt%c.%24,8?usff32.%24,8?ffus32\t%12-15,22R, %0-3,5R, #%16-20e"},
  666. /* Three registers of different lengths */
  667. {FPU_NEON_EXT_V1, 0xf2800e00, 0xfea00f50, "vmull%c.p%20S0\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  668. {FPU_NEON_EXT_V1, 0xf2800400, 0xff800f50, "vaddhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
  669. {FPU_NEON_EXT_V1, 0xf2800600, 0xff800f50, "vsubhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
  670. {FPU_NEON_EXT_V1, 0xf2800900, 0xff800f50, "vqdmlal%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  671. {FPU_NEON_EXT_V1, 0xf2800b00, 0xff800f50, "vqdmlsl%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  672. {FPU_NEON_EXT_V1, 0xf2800d00, 0xff800f50, "vqdmull%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  673. {FPU_NEON_EXT_V1, 0xf3800400, 0xff800f50, "vraddhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
  674. {FPU_NEON_EXT_V1, 0xf3800600, 0xff800f50, "vrsubhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
  675. {FPU_NEON_EXT_V1, 0xf2800000, 0xfe800f50, "vaddl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  676. {FPU_NEON_EXT_V1, 0xf2800100, 0xfe800f50, "vaddw%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7Q, %0-3,5D"},
  677. {FPU_NEON_EXT_V1, 0xf2800200, 0xfe800f50, "vsubl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  678. {FPU_NEON_EXT_V1, 0xf2800300, 0xfe800f50, "vsubw%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7Q, %0-3,5D"},
  679. {FPU_NEON_EXT_V1, 0xf2800500, 0xfe800f50, "vabal%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  680. {FPU_NEON_EXT_V1, 0xf2800700, 0xfe800f50, "vabdl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  681. {FPU_NEON_EXT_V1, 0xf2800800, 0xfe800f50, "vmlal%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  682. {FPU_NEON_EXT_V1, 0xf2800a00, 0xfe800f50, "vmlsl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  683. {FPU_NEON_EXT_V1, 0xf2800c00, 0xfe800f50, "vmull%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
  684. /* Two registers and a scalar */
  685. {FPU_NEON_EXT_V1, 0xf2800040, 0xff800f50, "vmla%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
  686. {FPU_NEON_EXT_V1, 0xf2800140, 0xff800f50, "vmla%c.f%20-21Sa\t%12-15,22D, %16-19,7D, %D"},
  687. {FPU_NEON_EXT_V1, 0xf2800340, 0xff800f50, "vqdmlal%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
  688. {FPU_NEON_EXT_V1, 0xf2800440, 0xff800f50, "vmls%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
  689. {FPU_NEON_EXT_V1, 0xf2800540, 0xff800f50, "vmls%c.f%20-21S6\t%12-15,22D, %16-19,7D, %D"},
  690. {FPU_NEON_EXT_V1, 0xf2800740, 0xff800f50, "vqdmlsl%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
  691. {FPU_NEON_EXT_V1, 0xf2800840, 0xff800f50, "vmul%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
  692. {FPU_NEON_EXT_V1, 0xf2800940, 0xff800f50, "vmul%c.f%20-21Sa\t%12-15,22D, %16-19,7D, %D"},
  693. {FPU_NEON_EXT_V1, 0xf2800b40, 0xff800f50, "vqdmull%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
  694. {FPU_NEON_EXT_V1, 0xf2800c40, 0xff800f50, "vqdmulh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
  695. {FPU_NEON_EXT_V1, 0xf2800d40, 0xff800f50, "vqrdmulh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
  696. {FPU_NEON_EXT_V1, 0xf3800040, 0xff800f50, "vmla%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
  697. {FPU_NEON_EXT_V1, 0xf3800140, 0xff800f50, "vmla%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
  698. {FPU_NEON_EXT_V1, 0xf3800440, 0xff800f50, "vmls%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
  699. {FPU_NEON_EXT_V1, 0xf3800540, 0xff800f50, "vmls%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
  700. {FPU_NEON_EXT_V1, 0xf3800840, 0xff800f50, "vmul%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
  701. {FPU_NEON_EXT_V1, 0xf3800940, 0xff800f50, "vmul%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
  702. {FPU_NEON_EXT_V1, 0xf3800c40, 0xff800f50, "vqdmulh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
  703. {FPU_NEON_EXT_V1, 0xf3800d40, 0xff800f50, "vqrdmulh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
  704. {FPU_NEON_EXT_V1, 0xf2800240, 0xfe800f50, "vmlal%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
  705. {FPU_NEON_EXT_V1, 0xf2800640, 0xfe800f50, "vmlsl%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
  706. {FPU_NEON_EXT_V1, 0xf2800a40, 0xfe800f50, "vmull%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
  707. /* Element and structure load/store */
  708. {FPU_NEON_EXT_V1, 0xf4a00fc0, 0xffb00fc0, "vld4%c.32\t%C"},
  709. {FPU_NEON_EXT_V1, 0xf4a00c00, 0xffb00f00, "vld1%c.%6-7S2\t%C"},
  710. {FPU_NEON_EXT_V1, 0xf4a00d00, 0xffb00f00, "vld2%c.%6-7S2\t%C"},
  711. {FPU_NEON_EXT_V1, 0xf4a00e00, 0xffb00f00, "vld3%c.%6-7S2\t%C"},
  712. {FPU_NEON_EXT_V1, 0xf4a00f00, 0xffb00f00, "vld4%c.%6-7S2\t%C"},
  713. {FPU_NEON_EXT_V1, 0xf4000200, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
  714. {FPU_NEON_EXT_V1, 0xf4000300, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
  715. {FPU_NEON_EXT_V1, 0xf4000400, 0xff900f00, "v%21?ls%21?dt3%c.%6-7S2\t%A"},
  716. {FPU_NEON_EXT_V1, 0xf4000500, 0xff900f00, "v%21?ls%21?dt3%c.%6-7S2\t%A"},
  717. {FPU_NEON_EXT_V1, 0xf4000600, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
  718. {FPU_NEON_EXT_V1, 0xf4000700, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
  719. {FPU_NEON_EXT_V1, 0xf4000800, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
  720. {FPU_NEON_EXT_V1, 0xf4000900, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
  721. {FPU_NEON_EXT_V1, 0xf4000a00, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
  722. {FPU_NEON_EXT_V1, 0xf4000000, 0xff900e00, "v%21?ls%21?dt4%c.%6-7S2\t%A"},
  723. {FPU_NEON_EXT_V1, 0xf4800000, 0xff900300, "v%21?ls%21?dt1%c.%10-11S2\t%B"},
  724. {FPU_NEON_EXT_V1, 0xf4800100, 0xff900300, "v%21?ls%21?dt2%c.%10-11S2\t%B"},
  725. {FPU_NEON_EXT_V1, 0xf4800200, 0xff900300, "v%21?ls%21?dt3%c.%10-11S2\t%B"},
  726. {FPU_NEON_EXT_V1, 0xf4800300, 0xff900300, "v%21?ls%21?dt4%c.%10-11S2\t%B"},
  727. {0,0 ,0, 0}
  728. };
  729. /* Opcode tables: ARM, 16-bit Thumb, 32-bit Thumb. All three are partially
  730. ordered: they must be searched linearly from the top to obtain a correct
  731. match. */
  732. /* print_insn_arm recognizes the following format control codes:
  733. %% %
  734. %a print address for ldr/str instruction
  735. %s print address for ldr/str halfword/signextend instruction
  736. %b print branch destination
  737. %c print condition code (always bits 28-31)
  738. %m print register mask for ldm/stm instruction
  739. %o print operand2 (immediate or register + shift)
  740. %p print 'p' iff bits 12-15 are 15
  741. %t print 't' iff bit 21 set and bit 24 clear
  742. %B print arm BLX(1) destination
  743. %C print the PSR sub type.
  744. %U print barrier type.
  745. %P print address for pli instruction.
  746. %<bitfield>r print as an ARM register
  747. %<bitfield>d print the bitfield in decimal
  748. %<bitfield>W print the bitfield plus one in decimal
  749. %<bitfield>x print the bitfield in hex
  750. %<bitfield>X print the bitfield as 1 hex digit without leading "0x"
  751. %<bitfield>'c print specified char iff bitfield is all ones
  752. %<bitfield>`c print specified char iff bitfield is all zeroes
  753. %<bitfield>?ab... select from array of values in big endian order
  754. %e print arm SMI operand (bits 0..7,8..19).
  755. %E print the LSB and WIDTH fields of a BFI or BFC instruction.
  756. %V print the 16-bit immediate field of a MOVT or MOVW instruction. */
  757. static const struct opcode32 arm_opcodes[] =
  758. {
  759. /* ARM instructions. */
  760. {ARM_EXT_V1, 0xe1a00000, 0xffffffff, "nop\t\t\t(mov r0,r0)"},
  761. {ARM_EXT_V4T | ARM_EXT_V5, 0x012FFF10, 0x0ffffff0, "bx%c\t%0-3r"},
  762. {ARM_EXT_V2, 0x00000090, 0x0fe000f0, "mul%20's%c\t%16-19r, %0-3r, %8-11r"},
  763. {ARM_EXT_V2, 0x00200090, 0x0fe000f0, "mla%20's%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  764. {ARM_EXT_V2S, 0x01000090, 0x0fb00ff0, "swp%22'b%c\t%12-15r, %0-3r, [%16-19r]"},
  765. {ARM_EXT_V3M, 0x00800090, 0x0fa000f0, "%22?sumull%20's%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  766. {ARM_EXT_V3M, 0x00a00090, 0x0fa000f0, "%22?sumlal%20's%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  767. /* V7 instructions. */
  768. {ARM_EXT_V7, 0xf450f000, 0xfd70f000, "pli\t%P"},
  769. {ARM_EXT_V7, 0x0320f0f0, 0x0ffffff0, "dbg%c\t#%0-3d"},
  770. {ARM_EXT_V7, 0xf57ff050, 0xfffffff0, "dmb\t%U"},
  771. {ARM_EXT_V7, 0xf57ff040, 0xfffffff0, "dsb\t%U"},
  772. {ARM_EXT_V7, 0xf57ff060, 0xfffffff0, "isb\t%U"},
  773. /* ARM V6T2 instructions. */
  774. {ARM_EXT_V6T2, 0x07c0001f, 0x0fe0007f, "bfc%c\t%12-15r, %E"},
  775. {ARM_EXT_V6T2, 0x07c00010, 0x0fe00070, "bfi%c\t%12-15r, %0-3r, %E"},
  776. {ARM_EXT_V6T2, 0x00600090, 0x0ff000f0, "mls%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  777. {ARM_EXT_V6T2, 0x006000b0, 0x0f7000f0, "strht%c\t%12-15r, %s"},
  778. {ARM_EXT_V6T2, 0x00300090, 0x0f300090, "ldr%6's%5?hbt%c\t%12-15r, %s"},
  779. {ARM_EXT_V6T2, 0x03000000, 0x0ff00000, "movw%c\t%12-15r, %V"},
  780. {ARM_EXT_V6T2, 0x03400000, 0x0ff00000, "movt%c\t%12-15r, %V"},
  781. {ARM_EXT_V6T2, 0x06ff0f30, 0x0fff0ff0, "rbit%c\t%12-15r, %0-3r"},
  782. {ARM_EXT_V6T2, 0x07a00050, 0x0fa00070, "%22?usbfx%c\t%12-15r, %0-3r, #%7-11d, #%16-20W"},
  783. /* ARM V6Z instructions. */
  784. {ARM_EXT_V6Z, 0x01600070, 0x0ff000f0, "smc%c\t%e"},
  785. /* ARM V6K instructions. */
  786. {ARM_EXT_V6K, 0xf57ff01f, 0xffffffff, "clrex"},
  787. {ARM_EXT_V6K, 0x01d00f9f, 0x0ff00fff, "ldrexb%c\t%12-15r, [%16-19r]"},
  788. {ARM_EXT_V6K, 0x01b00f9f, 0x0ff00fff, "ldrexd%c\t%12-15r, [%16-19r]"},
  789. {ARM_EXT_V6K, 0x01f00f9f, 0x0ff00fff, "ldrexh%c\t%12-15r, [%16-19r]"},
  790. {ARM_EXT_V6K, 0x01c00f90, 0x0ff00ff0, "strexb%c\t%12-15r, %0-3r, [%16-19r]"},
  791. {ARM_EXT_V6K, 0x01a00f90, 0x0ff00ff0, "strexd%c\t%12-15r, %0-3r, [%16-19r]"},
  792. {ARM_EXT_V6K, 0x01e00f90, 0x0ff00ff0, "strexh%c\t%12-15r, %0-3r, [%16-19r]"},
  793. /* ARM V6K NOP hints. */
  794. {ARM_EXT_V6K, 0x0320f001, 0x0fffffff, "yield%c"},
  795. {ARM_EXT_V6K, 0x0320f002, 0x0fffffff, "wfe%c"},
  796. {ARM_EXT_V6K, 0x0320f003, 0x0fffffff, "wfi%c"},
  797. {ARM_EXT_V6K, 0x0320f004, 0x0fffffff, "sev%c"},
  798. {ARM_EXT_V6K, 0x0320f000, 0x0fffff00, "nop%c\t{%0-7d}"},
  799. /* ARM V6 instructions. */
  800. {ARM_EXT_V6, 0xf1080000, 0xfffffe3f, "cpsie\t%8'a%7'i%6'f"},
  801. {ARM_EXT_V6, 0xf10a0000, 0xfffffe20, "cpsie\t%8'a%7'i%6'f,#%0-4d"},
  802. {ARM_EXT_V6, 0xf10C0000, 0xfffffe3f, "cpsid\t%8'a%7'i%6'f"},
  803. {ARM_EXT_V6, 0xf10e0000, 0xfffffe20, "cpsid\t%8'a%7'i%6'f,#%0-4d"},
  804. {ARM_EXT_V6, 0xf1000000, 0xfff1fe20, "cps\t#%0-4d"},
  805. {ARM_EXT_V6, 0x06800010, 0x0ff00ff0, "pkhbt%c\t%12-15r, %16-19r, %0-3r"},
  806. {ARM_EXT_V6, 0x06800010, 0x0ff00070, "pkhbt%c\t%12-15r, %16-19r, %0-3r, lsl #%7-11d"},
  807. {ARM_EXT_V6, 0x06800050, 0x0ff00ff0, "pkhtb%c\t%12-15r, %16-19r, %0-3r, asr #32"},
  808. {ARM_EXT_V6, 0x06800050, 0x0ff00070, "pkhtb%c\t%12-15r, %16-19r, %0-3r, asr #%7-11d"},
  809. {ARM_EXT_V6, 0x01900f9f, 0x0ff00fff, "ldrex%c\tr%12-15d, [%16-19r]"},
  810. {ARM_EXT_V6, 0x06200f10, 0x0ff00ff0, "qadd16%c\t%12-15r, %16-19r, %0-3r"},
  811. {ARM_EXT_V6, 0x06200f90, 0x0ff00ff0, "qadd8%c\t%12-15r, %16-19r, %0-3r"},
  812. {ARM_EXT_V6, 0x06200f30, 0x0ff00ff0, "qaddsubx%c\t%12-15r, %16-19r, %0-3r"},
  813. {ARM_EXT_V6, 0x06200f70, 0x0ff00ff0, "qsub16%c\t%12-15r, %16-19r, %0-3r"},
  814. {ARM_EXT_V6, 0x06200ff0, 0x0ff00ff0, "qsub8%c\t%12-15r, %16-19r, %0-3r"},
  815. {ARM_EXT_V6, 0x06200f50, 0x0ff00ff0, "qsubaddx%c\t%12-15r, %16-19r, %0-3r"},
  816. {ARM_EXT_V6, 0x06100f10, 0x0ff00ff0, "sadd16%c\t%12-15r, %16-19r, %0-3r"},
  817. {ARM_EXT_V6, 0x06100f90, 0x0ff00ff0, "sadd8%c\t%12-15r, %16-19r, %0-3r"},
  818. {ARM_EXT_V6, 0x06100f30, 0x0ff00ff0, "saddaddx%c\t%12-15r, %16-19r, %0-3r"},
  819. {ARM_EXT_V6, 0x06300f10, 0x0ff00ff0, "shadd16%c\t%12-15r, %16-19r, %0-3r"},
  820. {ARM_EXT_V6, 0x06300f90, 0x0ff00ff0, "shadd8%c\t%12-15r, %16-19r, %0-3r"},
  821. {ARM_EXT_V6, 0x06300f30, 0x0ff00ff0, "shaddsubx%c\t%12-15r, %16-19r, %0-3r"},
  822. {ARM_EXT_V6, 0x06300f70, 0x0ff00ff0, "shsub16%c\t%12-15r, %16-19r, %0-3r"},
  823. {ARM_EXT_V6, 0x06300ff0, 0x0ff00ff0, "shsub8%c\t%12-15r, %16-19r, %0-3r"},
  824. {ARM_EXT_V6, 0x06300f50, 0x0ff00ff0, "shsubaddx%c\t%12-15r, %16-19r, %0-3r"},
  825. {ARM_EXT_V6, 0x06100f70, 0x0ff00ff0, "ssub16%c\t%12-15r, %16-19r, %0-3r"},
  826. {ARM_EXT_V6, 0x06100ff0, 0x0ff00ff0, "ssub8%c\t%12-15r, %16-19r, %0-3r"},
  827. {ARM_EXT_V6, 0x06100f50, 0x0ff00ff0, "ssubaddx%c\t%12-15r, %16-19r, %0-3r"},
  828. {ARM_EXT_V6, 0x06500f10, 0x0ff00ff0, "uadd16%c\t%12-15r, %16-19r, %0-3r"},
  829. {ARM_EXT_V6, 0x06500f90, 0x0ff00ff0, "uadd8%c\t%12-15r, %16-19r, %0-3r"},
  830. {ARM_EXT_V6, 0x06500f30, 0x0ff00ff0, "uaddsubx%c\t%12-15r, %16-19r, %0-3r"},
  831. {ARM_EXT_V6, 0x06700f10, 0x0ff00ff0, "uhadd16%c\t%12-15r, %16-19r, %0-3r"},
  832. {ARM_EXT_V6, 0x06700f90, 0x0ff00ff0, "uhadd8%c\t%12-15r, %16-19r, %0-3r"},
  833. {ARM_EXT_V6, 0x06700f30, 0x0ff00ff0, "uhaddsubx%c\t%12-15r, %16-19r, %0-3r"},
  834. {ARM_EXT_V6, 0x06700f70, 0x0ff00ff0, "uhsub16%c\t%12-15r, %16-19r, %0-3r"},
  835. {ARM_EXT_V6, 0x06700ff0, 0x0ff00ff0, "uhsub8%c\t%12-15r, %16-19r, %0-3r"},
  836. {ARM_EXT_V6, 0x06700f50, 0x0ff00ff0, "uhsubaddx%c\t%12-15r, %16-19r, %0-3r"},
  837. {ARM_EXT_V6, 0x06600f10, 0x0ff00ff0, "uqadd16%c\t%12-15r, %16-19r, %0-3r"},
  838. {ARM_EXT_V6, 0x06600f90, 0x0ff00ff0, "uqadd8%c\t%12-15r, %16-19r, %0-3r"},
  839. {ARM_EXT_V6, 0x06600f30, 0x0ff00ff0, "uqaddsubx%c\t%12-15r, %16-19r, %0-3r"},
  840. {ARM_EXT_V6, 0x06600f70, 0x0ff00ff0, "uqsub16%c\t%12-15r, %16-19r, %0-3r"},
  841. {ARM_EXT_V6, 0x06600ff0, 0x0ff00ff0, "uqsub8%c\t%12-15r, %16-19r, %0-3r"},
  842. {ARM_EXT_V6, 0x06600f50, 0x0ff00ff0, "uqsubaddx%c\t%12-15r, %16-19r, %0-3r"},
  843. {ARM_EXT_V6, 0x06500f70, 0x0ff00ff0, "usub16%c\t%12-15r, %16-19r, %0-3r"},
  844. {ARM_EXT_V6, 0x06500ff0, 0x0ff00ff0, "usub8%c\t%12-15r, %16-19r, %0-3r"},
  845. {ARM_EXT_V6, 0x06500f50, 0x0ff00ff0, "usubaddx%c\t%12-15r, %16-19r, %0-3r"},
  846. {ARM_EXT_V6, 0x06bf0f30, 0x0fff0ff0, "rev%c\t\%12-15r, %0-3r"},
  847. {ARM_EXT_V6, 0x06bf0fb0, 0x0fff0ff0, "rev16%c\t\%12-15r, %0-3r"},
  848. {ARM_EXT_V6, 0x06ff0fb0, 0x0fff0ff0, "revsh%c\t\%12-15r, %0-3r"},
  849. {ARM_EXT_V6, 0xf8100a00, 0xfe50ffff, "rfe%23?id%24?ba\t\%16-19r%21'!"},
  850. {ARM_EXT_V6, 0x06bf0070, 0x0fff0ff0, "sxth%c\t%12-15r, %0-3r"},
  851. {ARM_EXT_V6, 0x06bf0470, 0x0fff0ff0, "sxth%c\t%12-15r, %0-3r, ror #8"},
  852. {ARM_EXT_V6, 0x06bf0870, 0x0fff0ff0, "sxth%c\t%12-15r, %0-3r, ror #16"},
  853. {ARM_EXT_V6, 0x06bf0c70, 0x0fff0ff0, "sxth%c\t%12-15r, %0-3r, ror #24"},
  854. {ARM_EXT_V6, 0x068f0070, 0x0fff0ff0, "sxtb16%c\t%12-15r, %0-3r"},
  855. {ARM_EXT_V6, 0x068f0470, 0x0fff0ff0, "sxtb16%c\t%12-15r, %0-3r, ror #8"},
  856. {ARM_EXT_V6, 0x068f0870, 0x0fff0ff0, "sxtb16%c\t%12-15r, %0-3r, ror #16"},
  857. {ARM_EXT_V6, 0x068f0c70, 0x0fff0ff0, "sxtb16%c\t%12-15r, %0-3r, ror #24"},
  858. {ARM_EXT_V6, 0x06af0070, 0x0fff0ff0, "sxtb%c\t%12-15r, %0-3r"},
  859. {ARM_EXT_V6, 0x06af0470, 0x0fff0ff0, "sxtb%c\t%12-15r, %0-3r, ror #8"},
  860. {ARM_EXT_V6, 0x06af0870, 0x0fff0ff0, "sxtb%c\t%12-15r, %0-3r, ror #16"},
  861. {ARM_EXT_V6, 0x06af0c70, 0x0fff0ff0, "sxtb%c\t%12-15r, %0-3r, ror #24"},
  862. {ARM_EXT_V6, 0x06ff0070, 0x0fff0ff0, "uxth%c\t%12-15r, %0-3r"},
  863. {ARM_EXT_V6, 0x06ff0470, 0x0fff0ff0, "uxth%c\t%12-15r, %0-3r, ror #8"},
  864. {ARM_EXT_V6, 0x06ff0870, 0x0fff0ff0, "uxth%c\t%12-15r, %0-3r, ror #16"},
  865. {ARM_EXT_V6, 0x06ff0c70, 0x0fff0ff0, "uxth%c\t%12-15r, %0-3r, ror #24"},
  866. {ARM_EXT_V6, 0x06cf0070, 0x0fff0ff0, "uxtb16%c\t%12-15r, %0-3r"},
  867. {ARM_EXT_V6, 0x06cf0470, 0x0fff0ff0, "uxtb16%c\t%12-15r, %0-3r, ror #8"},
  868. {ARM_EXT_V6, 0x06cf0870, 0x0fff0ff0, "uxtb16%c\t%12-15r, %0-3r, ror #16"},
  869. {ARM_EXT_V6, 0x06cf0c70, 0x0fff0ff0, "uxtb16%c\t%12-15r, %0-3r, ror #24"},
  870. {ARM_EXT_V6, 0x06ef0070, 0x0fff0ff0, "uxtb%c\t%12-15r, %0-3r"},
  871. {ARM_EXT_V6, 0x06ef0470, 0x0fff0ff0, "uxtb%c\t%12-15r, %0-3r, ror #8"},
  872. {ARM_EXT_V6, 0x06ef0870, 0x0fff0ff0, "uxtb%c\t%12-15r, %0-3r, ror #16"},
  873. {ARM_EXT_V6, 0x06ef0c70, 0x0fff0ff0, "uxtb%c\t%12-15r, %0-3r, ror #24"},
  874. {ARM_EXT_V6, 0x06b00070, 0x0ff00ff0, "sxtah%c\t%12-15r, %16-19r, %0-3r"},
  875. {ARM_EXT_V6, 0x06b00470, 0x0ff00ff0, "sxtah%c\t%12-15r, %16-19r, %0-3r, ror #8"},
  876. {ARM_EXT_V6, 0x06b00870, 0x0ff00ff0, "sxtah%c\t%12-15r, %16-19r, %0-3r, ror #16"},
  877. {ARM_EXT_V6, 0x06b00c70, 0x0ff00ff0, "sxtah%c\t%12-15r, %16-19r, %0-3r, ror #24"},
  878. {ARM_EXT_V6, 0x06800070, 0x0ff00ff0, "sxtab16%c\t%12-15r, %16-19r, %0-3r"},
  879. {ARM_EXT_V6, 0x06800470, 0x0ff00ff0, "sxtab16%c\t%12-15r, %16-19r, %0-3r, ror #8"},
  880. {ARM_EXT_V6, 0x06800870, 0x0ff00ff0, "sxtab16%c\t%12-15r, %16-19r, %0-3r, ror #16"},
  881. {ARM_EXT_V6, 0x06800c70, 0x0ff00ff0, "sxtab16%c\t%12-15r, %16-19r, %0-3r, ror #24"},
  882. {ARM_EXT_V6, 0x06a00070, 0x0ff00ff0, "sxtab%c\t%12-15r, %16-19r, %0-3r"},
  883. {ARM_EXT_V6, 0x06a00470, 0x0ff00ff0, "sxtab%c\t%12-15r, %16-19r, %0-3r, ror #8"},
  884. {ARM_EXT_V6, 0x06a00870, 0x0ff00ff0, "sxtab%c\t%12-15r, %16-19r, %0-3r, ror #16"},
  885. {ARM_EXT_V6, 0x06a00c70, 0x0ff00ff0, "sxtab%c\t%12-15r, %16-19r, %0-3r, ror #24"},
  886. {ARM_EXT_V6, 0x06f00070, 0x0ff00ff0, "uxtah%c\t%12-15r, %16-19r, %0-3r"},
  887. {ARM_EXT_V6, 0x06f00470, 0x0ff00ff0, "uxtah%c\t%12-15r, %16-19r, %0-3r, ror #8"},
  888. {ARM_EXT_V6, 0x06f00870, 0x0ff00ff0, "uxtah%c\t%12-15r, %16-19r, %0-3r, ror #16"},
  889. {ARM_EXT_V6, 0x06f00c70, 0x0ff00ff0, "uxtah%c\t%12-15r, %16-19r, %0-3r, ror #24"},
  890. {ARM_EXT_V6, 0x06c00070, 0x0ff00ff0, "uxtab16%c\t%12-15r, %16-19r, %0-3r"},
  891. {ARM_EXT_V6, 0x06c00470, 0x0ff00ff0, "uxtab16%c\t%12-15r, %16-19r, %0-3r, ror #8"},
  892. {ARM_EXT_V6, 0x06c00870, 0x0ff00ff0, "uxtab16%c\t%12-15r, %16-19r, %0-3r, ror #16"},
  893. {ARM_EXT_V6, 0x06c00c70, 0x0ff00ff0, "uxtab16%c\t%12-15r, %16-19r, %0-3r, ROR #24"},
  894. {ARM_EXT_V6, 0x06e00070, 0x0ff00ff0, "uxtab%c\t%12-15r, %16-19r, %0-3r"},
  895. {ARM_EXT_V6, 0x06e00470, 0x0ff00ff0, "uxtab%c\t%12-15r, %16-19r, %0-3r, ror #8"},
  896. {ARM_EXT_V6, 0x06e00870, 0x0ff00ff0, "uxtab%c\t%12-15r, %16-19r, %0-3r, ror #16"},
  897. {ARM_EXT_V6, 0x06e00c70, 0x0ff00ff0, "uxtab%c\t%12-15r, %16-19r, %0-3r, ror #24"},
  898. {ARM_EXT_V6, 0x06800fb0, 0x0ff00ff0, "sel%c\t%12-15r, %16-19r, %0-3r"},
  899. {ARM_EXT_V6, 0xf1010000, 0xfffffc00, "setend\t%9?ble"},
  900. {ARM_EXT_V6, 0x0700f010, 0x0ff0f0d0, "smuad%5'x%c\t%16-19r, %0-3r, %8-11r"},
  901. {ARM_EXT_V6, 0x0700f050, 0x0ff0f0d0, "smusd%5'x%c\t%16-19r, %0-3r, %8-11r"},
  902. {ARM_EXT_V6, 0x07000010, 0x0ff000d0, "smlad%5'x%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  903. {ARM_EXT_V6, 0x07400010, 0x0ff000d0, "smlald%5'x%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  904. {ARM_EXT_V6, 0x07000050, 0x0ff000d0, "smlsd%5'x%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  905. {ARM_EXT_V6, 0x07400050, 0x0ff000d0, "smlsld%5'x%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  906. {ARM_EXT_V6, 0x0750f010, 0x0ff0f0d0, "smmul%5'r%c\t%16-19r, %0-3r, %8-11r"},
  907. {ARM_EXT_V6, 0x07500010, 0x0ff000d0, "smmla%5'r%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  908. {ARM_EXT_V6, 0x075000d0, 0x0ff000d0, "smmls%5'r%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  909. {ARM_EXT_V6, 0xf84d0500, 0xfe5fffe0, "srs%23?id%24?ba\t%16-19r%21'!, #%0-4d"},
  910. {ARM_EXT_V6, 0x06a00010, 0x0fe00ff0, "ssat%c\t%12-15r, #%16-20W, %0-3r"},
  911. {ARM_EXT_V6, 0x06a00010, 0x0fe00070, "ssat%c\t%12-15r, #%16-20W, %0-3r, lsl #%7-11d"},
  912. {ARM_EXT_V6, 0x06a00050, 0x0fe00070, "ssat%c\t%12-15r, #%16-20W, %0-3r, asr #%7-11d"},
  913. {ARM_EXT_V6, 0x06a00f30, 0x0ff00ff0, "ssat16%c\t%12-15r, #%16-19W, %0-3r"},
  914. {ARM_EXT_V6, 0x01800f90, 0x0ff00ff0, "strex%c\t%12-15r, %0-3r, [%16-19r]"},
  915. {ARM_EXT_V6, 0x00400090, 0x0ff000f0, "umaal%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  916. {ARM_EXT_V6, 0x0780f010, 0x0ff0f0f0, "usad8%c\t%16-19r, %0-3r, %8-11r"},
  917. {ARM_EXT_V6, 0x07800010, 0x0ff000f0, "usada8%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  918. {ARM_EXT_V6, 0x06e00010, 0x0fe00ff0, "usat%c\t%12-15r, #%16-20d, %0-3r"},
  919. {ARM_EXT_V6, 0x06e00010, 0x0fe00070, "usat%c\t%12-15r, #%16-20d, %0-3r, lsl #%7-11d"},
  920. {ARM_EXT_V6, 0x06e00050, 0x0fe00070, "usat%c\t%12-15r, #%16-20d, %0-3r, asr #%7-11d"},
  921. {ARM_EXT_V6, 0x06e00f30, 0x0ff00ff0, "usat16%c\t%12-15r, #%16-19d, %0-3r"},
  922. /* V5J instruction. */
  923. {ARM_EXT_V5J, 0x012fff20, 0x0ffffff0, "bxj%c\t%0-3r"},
  924. /* V5 Instructions. */
  925. {ARM_EXT_V5, 0xe1200070, 0xfff000f0, "bkpt\t0x%16-19X%12-15X%8-11X%0-3X"},
  926. {ARM_EXT_V5, 0xfa000000, 0xfe000000, "blx\t%B"},
  927. {ARM_EXT_V5, 0x012fff30, 0x0ffffff0, "blx%c\t%0-3r"},
  928. {ARM_EXT_V5, 0x016f0f10, 0x0fff0ff0, "clz%c\t%12-15r, %0-3r"},
  929. /* V5E "El Segundo" Instructions. */
  930. {ARM_EXT_V5E, 0x000000d0, 0x0e1000f0, "ldrd%c\t%12-15r, %s"},
  931. {ARM_EXT_V5E, 0x000000f0, 0x0e1000f0, "strd%c\t%12-15r, %s"},
  932. {ARM_EXT_V5E, 0xf450f000, 0xfc70f000, "pld\t%a"},
  933. {ARM_EXT_V5ExP, 0x01000080, 0x0ff000f0, "smlabb%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  934. {ARM_EXT_V5ExP, 0x010000a0, 0x0ff000f0, "smlatb%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  935. {ARM_EXT_V5ExP, 0x010000c0, 0x0ff000f0, "smlabt%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  936. {ARM_EXT_V5ExP, 0x010000e0, 0x0ff000f0, "smlatt%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  937. {ARM_EXT_V5ExP, 0x01200080, 0x0ff000f0, "smlawb%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  938. {ARM_EXT_V5ExP, 0x012000c0, 0x0ff000f0, "smlawt%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
  939. {ARM_EXT_V5ExP, 0x01400080, 0x0ff000f0, "smlalbb%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  940. {ARM_EXT_V5ExP, 0x014000a0, 0x0ff000f0, "smlaltb%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  941. {ARM_EXT_V5ExP, 0x014000c0, 0x0ff000f0, "smlalbt%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  942. {ARM_EXT_V5ExP, 0x014000e0, 0x0ff000f0, "smlaltt%c\t%12-15r, %16-19r, %0-3r, %8-11r"},
  943. {ARM_EXT_V5ExP, 0x01600080, 0x0ff0f0f0, "smulbb%c\t%16-19r, %0-3r, %8-11r"},
  944. {ARM_EXT_V5ExP, 0x016000a0, 0x0ff0f0f0, "smultb%c\t%16-19r, %0-3r, %8-11r"},
  945. {ARM_EXT_V5ExP, 0x016000c0, 0x0ff0f0f0, "smulbt%c\t%16-19r, %0-3r, %8-11r"},
  946. {ARM_EXT_V5ExP, 0x016000e0, 0x0ff0f0f0, "smultt%c\t%16-19r, %0-3r, %8-11r"},
  947. {ARM_EXT_V5ExP, 0x012000a0, 0x0ff0f0f0, "smulwb%c\t%16-19r, %0-3r, %8-11r"},
  948. {ARM_EXT_V5ExP, 0x012000e0, 0x0ff0f0f0, "smulwt%c\t%16-19r, %0-3r, %8-11r"},
  949. {ARM_EXT_V5ExP, 0x01000050, 0x0ff00ff0, "qadd%c\t%12-15r, %0-3r, %16-19r"},
  950. {ARM_EXT_V5ExP, 0x01400050, 0x0ff00ff0, "qdadd%c\t%12-15r, %0-3r, %16-19r"},
  951. {ARM_EXT_V5ExP, 0x01200050, 0x0ff00ff0, "qsub%c\t%12-15r, %0-3r, %16-19r"},
  952. {ARM_EXT_V5ExP, 0x01600050, 0x0ff00ff0, "qdsub%c\t%12-15r, %0-3r, %16-19r"},
  953. /* ARM Instructions. */
  954. {ARM_EXT_V1, 0x00000090, 0x0e100090, "str%6's%5?hb%c\t%12-15r, %s"},
  955. {ARM_EXT_V1, 0x00100090, 0x0e100090, "ldr%6's%5?hb%c\t%12-15r, %s"},
  956. {ARM_EXT_V1, 0x00000000, 0x0de00000, "and%20's%c\t%12-15r, %16-19r, %o"},
  957. {ARM_EXT_V1, 0x00200000, 0x0de00000, "eor%20's%c\t%12-15r, %16-19r, %o"},
  958. {ARM_EXT_V1, 0x00400000, 0x0de00000, "sub%20's%c\t%12-15r, %16-19r, %o"},
  959. {ARM_EXT_V1, 0x00600000, 0x0de00000, "rsb%20's%c\t%12-15r, %16-19r, %o"},
  960. {ARM_EXT_V1, 0x00800000, 0x0de00000, "add%20's%c\t%12-15r, %16-19r, %o"},
  961. {ARM_EXT_V1, 0x00a00000, 0x0de00000, "adc%20's%c\t%12-15r, %16-19r, %o"},
  962. {ARM_EXT_V1, 0x00c00000, 0x0de00000, "sbc%20's%c\t%12-15r, %16-19r, %o"},
  963. {ARM_EXT_V1, 0x00e00000, 0x0de00000, "rsc%20's%c\t%12-15r, %16-19r, %o"},
  964. {ARM_EXT_V3, 0x0120f000, 0x0db0f000, "msr%c\t%22?SCPSR%C, %o"},
  965. {ARM_EXT_V3, 0x010f0000, 0x0fbf0fff, "mrs%c\t%12-15r, %22?SCPSR"},
  966. {ARM_EXT_V1, 0x01000000, 0x0de00000, "tst%p%c\t%16-19r, %o"},
  967. {ARM_EXT_V1, 0x01200000, 0x0de00000, "teq%p%c\t%16-19r, %o"},
  968. {ARM_EXT_V1, 0x01400000, 0x0de00000, "cmp%p%c\t%16-19r, %o"},
  969. {ARM_EXT_V1, 0x01600000, 0x0de00000, "cmn%p%c\t%16-19r, %o"},
  970. {ARM_EXT_V1, 0x01800000, 0x0de00000, "orr%20's%c\t%12-15r, %16-19r, %o"},
  971. {ARM_EXT_V1, 0x03a00000, 0x0fef0000, "mov%20's%c\t%12-15r, %o"},
  972. {ARM_EXT_V1, 0x01a00000, 0x0def0ff0, "mov%20's%c\t%12-15r, %0-3r"},
  973. {ARM_EXT_V1, 0x01a00000, 0x0def0060, "lsl%20's%c\t%12-15r, %q"},
  974. {ARM_EXT_V1, 0x01a00020, 0x0def0060, "lsr%20's%c\t%12-15r, %q"},
  975. {ARM_EXT_V1, 0x01a00040, 0x0def0060, "asr%20's%c\t%12-15r, %q"},
  976. {ARM_EXT_V1, 0x01a00060, 0x0def0ff0, "rrx%20's%c\t%12-15r, %0-3r"},
  977. {ARM_EXT_V1, 0x01a00060, 0x0def0060, "ror%20's%c\t%12-15r, %q"},
  978. {ARM_EXT_V1, 0x01c00000, 0x0de00000, "bic%20's%c\t%12-15r, %16-19r, %o"},
  979. {ARM_EXT_V1, 0x01e00000, 0x0de00000, "mvn%20's%c\t%12-15r, %o"},
  980. {ARM_EXT_V1, 0x052d0004, 0x0fff0fff, "push%c\t{%12-15r}\t\t; (str%c %12-15r, %a)"},
  981. {ARM_EXT_V1, 0x04000000, 0x0e100000, "str%22'b%t%c\t%12-15r, %a"},
  982. {ARM_EXT_V1, 0x06000000, 0x0e100ff0, "str%22'b%t%c\t%12-15r, %a"},
  983. {ARM_EXT_V1, 0x04000000, 0x0c100010, "str%22'b%t%c\t%12-15r, %a"},
  984. {ARM_EXT_V1, 0x06000010, 0x0e000010, "undefined"},
  985. {ARM_EXT_V1, 0x049d0004, 0x0fff0fff, "pop%c\t{%12-15r}\t\t; (ldr%c %12-15r, %a)"},
  986. {ARM_EXT_V1, 0x04100000, 0x0c100000, "ldr%22'b%t%c\t%12-15r, %a"},
  987. {ARM_EXT_V1, 0x092d0000, 0x0fff0000, "push%c\t%m"},
  988. {ARM_EXT_V1, 0x08800000, 0x0ff00000, "stm%c\t%16-19r%21'!, %m%22'^"},
  989. {ARM_EXT_V1, 0x08000000, 0x0e100000, "stm%23?id%24?ba%c\t%16-19r%21'!, %m%22'^"},
  990. {ARM_EXT_V1, 0x08bd0000, 0x0fff0000, "pop%c\t%m"},
  991. {ARM_EXT_V1, 0x08900000, 0x0f900000, "ldm%c\t%16-19r%21'!, %m%22'^"},
  992. {ARM_EXT_V1, 0x08100000, 0x0e100000, "ldm%23?id%24?ba%c\t%16-19r%21'!, %m%22'^"},
  993. {ARM_EXT_V1, 0x0a000000, 0x0e000000, "b%24'l%c\t%b"},
  994. {ARM_EXT_V1, 0x0f000000, 0x0f000000, "svc%c\t%0-23x"},
  995. /* The rest. */
  996. {ARM_EXT_V1, 0x00000000, 0x00000000, "undefined instruction %0-31x"},
  997. {0, 0x00000000, 0x00000000, 0}
  998. };
  999. /* print_insn_thumb16 recognizes the following format control codes:
  1000. %S print Thumb register (bits 3..5 as high number if bit 6 set)
  1001. %D print Thumb register (bits 0..2 as high number if bit 7 set)
  1002. %<bitfield>I print bitfield as a signed decimal
  1003. (top bit of range being the sign bit)
  1004. %N print Thumb register mask (with LR)
  1005. %O print Thumb register mask (with PC)
  1006. %M print Thumb register mask
  1007. %b print CZB's 6-bit unsigned branch destination
  1008. %s print Thumb right-shift immediate (6..10; 0 == 32).
  1009. %c print the condition code
  1010. %C print the condition code, or "s" if not conditional
  1011. %x print warning if conditional an not at end of IT block"
  1012. %X print "\t; unpredictable <IT:code>" if conditional
  1013. %I print IT instruction suffix and operands
  1014. %<bitfield>r print bitfield as an ARM register
  1015. %<bitfield>d print bitfield as a decimal
  1016. %<bitfield>H print (bitfield * 2) as a decimal
  1017. %<bitfield>W print (bitfield * 4) as a decimal
  1018. %<bitfield>a print (bitfield * 4) as a pc-rel offset + decoded symbol
  1019. %<bitfield>B print Thumb branch destination (signed displacement)
  1020. %<bitfield>c print bitfield as a condition code
  1021. %<bitnum>'c print specified char iff bit is one
  1022. %<bitnum>?ab print a if bit is one else print b. */
  1023. static const struct opcode16 thumb_opcodes[] =
  1024. {
  1025. /* Thumb instructions. */
  1026. /* ARM V6K no-argument instructions. */
  1027. {ARM_EXT_V6K, 0xbf00, 0xffff, "nop%c"},
  1028. {ARM_EXT_V6K, 0xbf10, 0xffff, "yield%c"},
  1029. {ARM_EXT_V6K, 0xbf20, 0xffff, "wfe%c"},
  1030. {ARM_EXT_V6K, 0xbf30, 0xffff, "wfi%c"},
  1031. {ARM_EXT_V6K, 0xbf40, 0xffff, "sev%c"},
  1032. {ARM_EXT_V6K, 0xbf00, 0xff0f, "nop%c\t{%4-7d}"},
  1033. /* ARM V6T2 instructions. */
  1034. {ARM_EXT_V6T2, 0xb900, 0xfd00, "cbnz\t%0-2r, %b%X"},
  1035. {ARM_EXT_V6T2, 0xb100, 0xfd00, "cbz\t%0-2r, %b%X"},
  1036. {ARM_EXT_V6T2, 0xbf00, 0xff00, "it%I%X"},
  1037. /* ARM V6. */
  1038. {ARM_EXT_V6, 0xb660, 0xfff8, "cpsie\t%2'a%1'i%0'f%X"},
  1039. {ARM_EXT_V6, 0xb670, 0xfff8, "cpsid\t%2'a%1'i%0'f%X"},
  1040. {ARM_EXT_V6, 0x4600, 0xffc0, "mov%c\t%0-2r, %3-5r"},
  1041. {ARM_EXT_V6, 0xba00, 0xffc0, "rev%c\t%0-2r, %3-5r"},
  1042. {ARM_EXT_V6, 0xba40, 0xffc0, "rev16%c\t%0-2r, %3-5r"},
  1043. {ARM_EXT_V6, 0xbac0, 0xffc0, "revsh%c\t%0-2r, %3-5r"},
  1044. {ARM_EXT_V6, 0xb650, 0xfff7, "setend\t%3?ble%X"},
  1045. {ARM_EXT_V6, 0xb200, 0xffc0, "sxth%c\t%0-2r, %3-5r"},
  1046. {ARM_EXT_V6, 0xb240, 0xffc0, "sxtb%c\t%0-2r, %3-5r"},
  1047. {ARM_EXT_V6, 0xb280, 0xffc0, "uxth%c\t%0-2r, %3-5r"},
  1048. {ARM_EXT_V6, 0xb2c0, 0xffc0, "uxtb%c\t%0-2r, %3-5r"},
  1049. /* ARM V5 ISA extends Thumb. */
  1050. {ARM_EXT_V5T, 0xbe00, 0xff00, "bkpt\t%0-7x"}, /* Is always unconditional. */
  1051. /* This is BLX(2). BLX(1) is a 32-bit instruction. */
  1052. {ARM_EXT_V5T, 0x4780, 0xff87, "blx%c\t%3-6r%x"}, /* note: 4 bit register number. */
  1053. /* ARM V4T ISA (Thumb v1). */
  1054. {ARM_EXT_V4T, 0x46C0, 0xFFFF, "nop%c\t\t\t(mov r8, r8)"},
  1055. /* Format 4. */
  1056. {ARM_EXT_V4T, 0x4000, 0xFFC0, "and%C\t%0-2r, %3-5r"},
  1057. {ARM_EXT_V4T, 0x4040, 0xFFC0, "eor%C\t%0-2r, %3-5r"},
  1058. {ARM_EXT_V4T, 0x4080, 0xFFC0, "lsl%C\t%0-2r, %3-5r"},
  1059. {ARM_EXT_V4T, 0x40C0, 0xFFC0, "lsr%C\t%0-2r, %3-5r"},
  1060. {ARM_EXT_V4T, 0x4100, 0xFFC0, "asr%C\t%0-2r, %3-5r"},
  1061. {ARM_EXT_V4T, 0x4140, 0xFFC0, "adc%C\t%0-2r, %3-5r"},
  1062. {ARM_EXT_V4T, 0x4180, 0xFFC0, "sbc%C\t%0-2r, %3-5r"},
  1063. {ARM_EXT_V4T, 0x41C0, 0xFFC0, "ror%C\t%0-2r, %3-5r"},
  1064. {ARM_EXT_V4T, 0x4200, 0xFFC0, "tst%c\t%0-2r, %3-5r"},
  1065. {ARM_EXT_V4T, 0x4240, 0xFFC0, "neg%C\t%0-2r, %3-5r"},
  1066. {ARM_EXT_V4T, 0x4280, 0xFFC0, "cmp%c\t%0-2r, %3-5r"},
  1067. {ARM_EXT_V4T, 0x42C0, 0xFFC0, "cmn%c\t%0-2r, %3-5r"},
  1068. {ARM_EXT_V4T, 0x4300, 0xFFC0, "orr%C\t%0-2r, %3-5r"},
  1069. {ARM_EXT_V4T, 0x4340, 0xFFC0, "mul%C\t%0-2r, %3-5r"},
  1070. {ARM_EXT_V4T, 0x4380, 0xFFC0, "bic%C\t%0-2r, %3-5r"},
  1071. {ARM_EXT_V4T, 0x43C0, 0xFFC0, "mvn%C\t%0-2r, %3-5r"},
  1072. /* format 13 */
  1073. {ARM_EXT_V4T, 0xB000, 0xFF80, "add%c\tsp, #%0-6W"},
  1074. {ARM_EXT_V4T, 0xB080, 0xFF80, "sub%c\tsp, #%0-6W"},
  1075. /* format 5 */
  1076. {ARM_EXT_V4T, 0x4700, 0xFF80, "bx%c\t%S%x"},
  1077. {ARM_EXT_V4T, 0x4400, 0xFF00, "add%c\t%D, %S"},
  1078. {ARM_EXT_V4T, 0x4500, 0xFF00, "cmp%c\t%D, %S"},
  1079. {ARM_EXT_V4T, 0x4600, 0xFF00, "mov%c\t%D, %S"},
  1080. /* format 14 */
  1081. {ARM_EXT_V4T, 0xB400, 0xFE00, "push%c\t%N"},
  1082. {ARM_EXT_V4T, 0xBC00, 0xFE00, "pop%c\t%O"},
  1083. /* format 2 */
  1084. {ARM_EXT_V4T, 0x1800, 0xFE00, "add%C\t%0-2r, %3-5r, %6-8r"},
  1085. {ARM_EXT_V4T, 0x1A00, 0xFE00, "sub%C\t%0-2r, %3-5r, %6-8r"},
  1086. {ARM_EXT_V4T, 0x1C00, 0xFE00, "add%C\t%0-2r, %3-5r, #%6-8d"},
  1087. {ARM_EXT_V4T, 0x1E00, 0xFE00, "sub%C\t%0-2r, %3-5r, #%6-8d"},
  1088. /* format 8 */
  1089. {ARM_EXT_V4T, 0x5200, 0xFE00, "strh%c\t%0-2r, [%3-5r, %6-8r]"},
  1090. {ARM_EXT_V4T, 0x5A00, 0xFE00, "ldrh%c\t%0-2r, [%3-5r, %6-8r]"},
  1091. {ARM_EXT_V4T, 0x5600, 0xF600, "ldrs%11?hb%c\t%0-2r, [%3-5r, %6-8r]"},
  1092. /* format 7 */
  1093. {ARM_EXT_V4T, 0x5000, 0xFA00, "str%10'b%c\t%0-2r, [%3-5r, %6-8r]"},
  1094. {ARM_EXT_V4T, 0x5800, 0xFA00, "ldr%10'b%c\t%0-2r, [%3-5r, %6-8r]"},
  1095. /* format 1 */
  1096. {ARM_EXT_V4T, 0x0000, 0xF800, "lsl%C\t%0-2r, %3-5r, #%6-10d"},
  1097. {ARM_EXT_V4T, 0x0800, 0xF800, "lsr%C\t%0-2r, %3-5r, %s"},
  1098. {ARM_EXT_V4T, 0x1000, 0xF800, "asr%C\t%0-2r, %3-5r, %s"},
  1099. /* format 3 */
  1100. {ARM_EXT_V4T, 0x2000, 0xF800, "mov%C\t%8-10r, #%0-7d"},
  1101. {ARM_EXT_V4T, 0x2800, 0xF800, "cmp%c\t%8-10r, #%0-7d"},
  1102. {ARM_EXT_V4T, 0x3000, 0xF800, "add%C\t%8-10r, #%0-7d"},
  1103. {ARM_EXT_V4T, 0x3800, 0xF800, "sub%C\t%8-10r, #%0-7d"},
  1104. /* format 6 */
  1105. {ARM_EXT_V4T, 0x4800, 0xF800, "ldr%c\t%8-10r, [pc, #%0-7W]\t(%0-7a)"}, /* TODO: Disassemble PC relative "LDR rD,=<symbolic>" */
  1106. /* format 9 */
  1107. {ARM_EXT_V4T, 0x6000, 0xF800, "str%c\t%0-2r, [%3-5r, #%6-10W]"},
  1108. {ARM_EXT_V4T, 0x6800, 0xF800, "ldr%c\t%0-2r, [%3-5r, #%6-10W]"},
  1109. {ARM_EXT_V4T, 0x7000, 0xF800, "strb%c\t%0-2r, [%3-5r, #%6-10d]"},
  1110. {ARM_EXT_V4T, 0x7800, 0xF800, "ldrb%c\t%0-2r, [%3-5r, #%6-10d]"},
  1111. /* format 10 */
  1112. {ARM_EXT_V4T, 0x8000, 0xF800, "strh%c\t%0-2r, [%3-5r, #%6-10H]"},
  1113. {ARM_EXT_V4T, 0x8800, 0xF800, "ldrh%c\t%0-2r, [%3-5r, #%6-10H]"},
  1114. /* format 11 */
  1115. {ARM_EXT_V4T, 0x9000, 0xF800, "str%c\t%8-10r, [sp, #%0-7W]"},
  1116. {ARM_EXT_V4T, 0x9800, 0xF800, "ldr%c\t%8-10r, [sp, #%0-7W]"},
  1117. /* format 12 */
  1118. {ARM_EXT_V4T, 0xA000, 0xF800, "add%c\t%8-10r, pc, #%0-7W\t(adr %8-10r, %0-7a)"},
  1119. {ARM_EXT_V4T, 0xA800, 0xF800, "add%c\t%8-10r, sp, #%0-7W"},
  1120. /* format 15 */
  1121. {ARM_EXT_V4T, 0xC000, 0xF800, "stmia%c\t%8-10r!, %M"},
  1122. {ARM_EXT_V4T, 0xC800, 0xF800, "ldmia%c\t%8-10r!, %M"},
  1123. /* format 17 */
  1124. {ARM_EXT_V4T, 0xDF00, 0xFF00, "svc%c\t%0-7d"},
  1125. /* format 16 */
  1126. {ARM_EXT_V4T, 0xDE00, 0xFE00, "undefined"},
  1127. {ARM_EXT_V4T, 0xD000, 0xF000, "b%8-11c.n\t%0-7B%X"},
  1128. /* format 18 */
  1129. {ARM_EXT_V4T, 0xE000, 0xF800, "b%c.n\t%0-10B%x"},
  1130. /* The E800 .. FFFF range is unconditionally redirected to the
  1131. 32-bit table, because even in pre-V6T2 ISAs, BL and BLX(1) pairs
  1132. are processed via that table. Thus, we can never encounter a
  1133. bare "second half of BL/BLX(1)" instruction here. */
  1134. {ARM_EXT_V1, 0x0000, 0x0000, "undefined"},
  1135. {0, 0, 0, 0}
  1136. };
  1137. /* Thumb32 opcodes use the same table structure as the ARM opcodes.
  1138. We adopt the convention that hw1 is the high 16 bits of .value and
  1139. .mask, hw2 the low 16 bits.
  1140. print_insn_thumb32 recognizes the following format control codes:
  1141. %% %
  1142. %I print a 12-bit immediate from hw1[10],hw2[14:12,7:0]
  1143. %M print a modified 12-bit immediate (same location)
  1144. %J print a 16-bit immediate from hw1[3:0,10],hw2[14:12,7:0]
  1145. %K print a 16-bit immediate from hw2[3:0],hw1[3:0],hw2[11:4]
  1146. %S print a possibly-shifted Rm
  1147. %a print the address of a plain load/store
  1148. %w print the width and signedness of a core load/store
  1149. %m print register mask for ldm/stm
  1150. %E print the lsb and width fields of a bfc/bfi instruction
  1151. %F print the lsb and width fields of a sbfx/ubfx instruction
  1152. %b print a conditional branch offset
  1153. %B print an unconditional branch offset
  1154. %s print the shift field of an SSAT instruction
  1155. %R print the rotation field of an SXT instruction
  1156. %U print barrier type.
  1157. %P print address for pli instruction.
  1158. %c print the condition code
  1159. %x print warning if conditional an not at end of IT block"
  1160. %X print "\t; unpredictable <IT:code>" if conditional
  1161. %<bitfield>d print bitfield in decimal
  1162. %<bitfield>W print bitfield*4 in decimal
  1163. %<bitfield>r print bitfield as an ARM register
  1164. %<bitfield>c print bitfield as a condition code
  1165. %<bitfield>'c print specified char iff bitfield is all ones
  1166. %<bitfield>`c print specified char iff bitfield is all zeroes
  1167. %<bitfield>?ab... select from array of values in big endian order
  1168. With one exception at the bottom (done because BL and BLX(1) need
  1169. to come dead last), this table was machine-sorted first in
  1170. decreasing order of number of bits set in the mask, then in
  1171. increasing numeric order of mask, then in increasing numeric order
  1172. of opcode. This order is not the clearest for a human reader, but
  1173. is guaranteed never to catch a special-case bit pattern with a more
  1174. general mask, which is important, because this instruction encoding
  1175. makes heavy use of special-case bit patterns. */
  1176. static const struct opcode32 thumb32_opcodes[] =
  1177. {
  1178. /* V7 instructions. */
  1179. {ARM_EXT_V7, 0xf910f000, 0xff70f000, "pli%c\t%a"},
  1180. {ARM_EXT_V7, 0xf3af80f0, 0xfffffff0, "dbg%c\t#%0-3d"},
  1181. {ARM_EXT_V7, 0xf3bf8f50, 0xfffffff0, "dmb%c\t%U"},
  1182. {ARM_EXT_V7, 0xf3bf8f40, 0xfffffff0, "dsb%c\t%U"},
  1183. {ARM_EXT_V7, 0xf3bf8f60, 0xfffffff0, "isb%c\t%U"},
  1184. {ARM_EXT_DIV, 0xfb90f0f0, 0xfff0f0f0, "sdiv%c\t%8-11r, %16-19r, %0-3r"},
  1185. {ARM_EXT_DIV, 0xfbb0f0f0, 0xfff0f0f0, "udiv%c\t%8-11r, %16-19r, %0-3r"},
  1186. /* Instructions defined in the basic V6T2 set. */
  1187. {ARM_EXT_V6T2, 0xf3af8000, 0xffffffff, "nop%c.w"},
  1188. {ARM_EXT_V6T2, 0xf3af8001, 0xffffffff, "yield%c.w"},
  1189. {ARM_EXT_V6T2, 0xf3af8002, 0xffffffff, "wfe%c.w"},
  1190. {ARM_EXT_V6T2, 0xf3af8003, 0xffffffff, "wfi%c.w"},
  1191. {ARM_EXT_V6T2, 0xf3af9004, 0xffffffff, "sev%c.w"},
  1192. {ARM_EXT_V6T2, 0xf3af8000, 0xffffff00, "nop%c.w\t{%0-7d}"},
  1193. {ARM_EXT_V6T2, 0xf3bf8f2f, 0xffffffff, "clrex%c"},
  1194. {ARM_EXT_V6T2, 0xf3af8400, 0xffffff1f, "cpsie.w\t%7'a%6'i%5'f%X"},
  1195. {ARM_EXT_V6T2, 0xf3af8600, 0xffffff1f, "cpsid.w\t%7'a%6'i%5'f%X"},
  1196. {ARM_EXT_V6T2, 0xf3c08f00, 0xfff0ffff, "bxj%c\t%16-19r%x"},
  1197. {ARM_EXT_V6T2, 0xe810c000, 0xffd0ffff, "rfedb%c\t%16-19r%21'!"},
  1198. {ARM_EXT_V6T2, 0xe990c000, 0xffd0ffff, "rfeia%c\t%16-19r%21'!"},
  1199. {ARM_EXT_V6T2, 0xf3ef8000, 0xffeff000, "mrs%c\t%8-11r, %D"},
  1200. {ARM_EXT_V6T2, 0xf3af8100, 0xffffffe0, "cps\t#%0-4d%X"},
  1201. {ARM_EXT_V6T2, 0xe8d0f000, 0xfff0fff0, "tbb%c\t[%16-19r, %0-3r]%x"},
  1202. {ARM_EXT_V6T2, 0xe8d0f010, 0xfff0fff0, "tbh%c\t[%16-19r, %0-3r, lsl #1]%x"},
  1203. {ARM_EXT_V6T2, 0xf3af8500, 0xffffff00, "cpsie\t%7'a%6'i%5'f, #%0-4d%X"},
  1204. {ARM_EXT_V6T2, 0xf3af8700, 0xffffff00, "cpsid\t%7'a%6'i%5'f, #%0-4d%X"},
  1205. {ARM_EXT_V6T2, 0xf3de8f00, 0xffffff00, "subs%c\tpc, lr, #%0-7d"},
  1206. {ARM_EXT_V6T2, 0xf3808000, 0xffe0f000, "msr%c\t%C, %16-19r"},
  1207. {ARM_EXT_V6T2, 0xe8500f00, 0xfff00fff, "ldrex%c\t%12-15r, [%16-19r]"},
  1208. {ARM_EXT_V6T2, 0xe8d00f4f, 0xfff00fef, "ldrex%4?hb%c\t%12-15r, [%16-19r]"},
  1209. {ARM_EXT_V6T2, 0xe800c000, 0xffd0ffe0, "srsdb%c\t%16-19r%21'!, #%0-4d"},
  1210. {ARM_EXT_V6T2, 0xe980c000, 0xffd0ffe0, "srsia%c\t%16-19r%21'!, #%0-4d"},
  1211. {ARM_EXT_V6T2, 0xfa0ff080, 0xfffff0c0, "sxth%c.w\t%8-11r, %0-3r%R"},
  1212. {ARM_EXT_V6T2, 0xfa1ff080, 0xfffff0c0, "uxth%c.w\t%8-11r, %0-3r%R"},
  1213. {ARM_EXT_V6T2, 0xfa2ff080, 0xfffff0c0, "sxtb16%c\t%8-11r, %0-3r%R"},
  1214. {ARM_EXT_V6T2, 0xfa3ff080, 0xfffff0c0, "uxtb16%c\t%8-11r, %0-3r%R"},
  1215. {ARM_EXT_V6T2, 0xfa4ff080, 0xfffff0c0, "sxtb%c.w\t%8-11r, %0-3r%R"},
  1216. {ARM_EXT_V6T2, 0xfa5ff080, 0xfffff0c0, "uxtb%c.w\t%8-11r, %0-3r%R"},
  1217. {ARM_EXT_V6T2, 0xe8400000, 0xfff000ff, "strex%c\t%8-11r, %12-15r, [%16-19r]"},
  1218. {ARM_EXT_V6T2, 0xe8d0007f, 0xfff000ff, "ldrexd%c\t%12-15r, %8-11r, [%16-19r]"},
  1219. {ARM_EXT_V6T2, 0xfa80f000, 0xfff0f0f0, "sadd8%c\t%8-11r, %16-19r, %0-3r"},
  1220. {ARM_EXT_V6T2, 0xfa80f010, 0xfff0f0f0, "qadd8%c\t%8-11r, %16-19r, %0-3r"},
  1221. {ARM_EXT_V6T2, 0xfa80f020, 0xfff0f0f0, "shadd8%c\t%8-11r, %16-19r, %0-3r"},
  1222. {ARM_EXT_V6T2, 0xfa80f040, 0xfff0f0f0, "uadd8%c\t%8-11r, %16-19r, %0-3r"},
  1223. {ARM_EXT_V6T2, 0xfa80f050, 0xfff0f0f0, "uqadd8%c\t%8-11r, %16-19r, %0-3r"},
  1224. {ARM_EXT_V6T2, 0xfa80f060, 0xfff0f0f0, "uhadd8%c\t%8-11r, %16-19r, %0-3r"},
  1225. {ARM_EXT_V6T2, 0xfa80f080, 0xfff0f0f0, "qadd%c\t%8-11r, %0-3r, %16-19r"},
  1226. {ARM_EXT_V6T2, 0xfa80f090, 0xfff0f0f0, "qdadd%c\t%8-11r, %0-3r, %16-19r"},
  1227. {ARM_EXT_V6T2, 0xfa80f0a0, 0xfff0f0f0, "qsub%c\t%8-11r, %0-3r, %16-19r"},
  1228. {ARM_EXT_V6T2, 0xfa80f0b0, 0xfff0f0f0, "qdsub%c\t%8-11r, %0-3r, %16-19r"},
  1229. {ARM_EXT_V6T2, 0xfa90f000, 0xfff0f0f0, "sadd16%c\t%8-11r, %16-19r, %0-3r"},
  1230. {ARM_EXT_V6T2, 0xfa90f010, 0xfff0f0f0, "qadd16%c\t%8-11r, %16-19r, %0-3r"},
  1231. {ARM_EXT_V6T2, 0xfa90f020, 0xfff0f0f0, "shadd16%c\t%8-11r, %16-19r, %0-3r"},
  1232. {ARM_EXT_V6T2, 0xfa90f040, 0xfff0f0f0, "uadd16%c\t%8-11r, %16-19r, %0-3r"},
  1233. {ARM_EXT_V6T2, 0xfa90f050, 0xfff0f0f0, "uqadd16%c\t%8-11r, %16-19r, %0-3r"},
  1234. {ARM_EXT_V6T2, 0xfa90f060, 0xfff0f0f0, "uhadd16%c\t%8-11r, %16-19r, %0-3r"},
  1235. {ARM_EXT_V6T2, 0xfa90f080, 0xfff0f0f0, "rev%c.w\t%8-11r, %16-19r"},
  1236. {ARM_EXT_V6T2, 0xfa90f090, 0xfff0f0f0, "rev16%c.w\t%8-11r, %16-19r"},
  1237. {ARM_EXT_V6T2, 0xfa90f0a0, 0xfff0f0f0, "rbit%c\t%8-11r, %16-19r"},
  1238. {ARM_EXT_V6T2, 0xfa90f0b0, 0xfff0f0f0, "revsh%c.w\t%8-11r, %16-19r"},
  1239. {ARM_EXT_V6T2, 0xfaa0f000, 0xfff0f0f0, "saddsubx%c\t%8-11r, %16-19r, %0-3r"},
  1240. {ARM_EXT_V6T2, 0xfaa0f010, 0xfff0f0f0, "qaddsubx%c\t%8-11r, %16-19r, %0-3r"},
  1241. {ARM_EXT_V6T2, 0xfaa0f020, 0xfff0f0f0, "shaddsubx%c\t%8-11r, %16-19r, %0-3r"},
  1242. {ARM_EXT_V6T2, 0xfaa0f040, 0xfff0f0f0, "uaddsubx%c\t%8-11r, %16-19r, %0-3r"},
  1243. {ARM_EXT_V6T2, 0xfaa0f050, 0xfff0f0f0, "uqaddsubx%c\t%8-11r, %16-19r, %0-3r"},
  1244. {ARM_EXT_V6T2, 0xfaa0f060, 0xfff0f0f0, "uhaddsubx%c\t%8-11r, %16-19r, %0-3r"},
  1245. {ARM_EXT_V6T2, 0xfaa0f080, 0xfff0f0f0, "sel%c\t%8-11r, %16-19r, %0-3r"},
  1246. {ARM_EXT_V6T2, 0xfab0f080, 0xfff0f0f0, "clz%c\t%8-11r, %16-19r"},
  1247. {ARM_EXT_V6T2, 0xfac0f000, 0xfff0f0f0, "ssub8%c\t%8-11r, %16-19r, %0-3r"},
  1248. {ARM_EXT_V6T2, 0xfac0f010, 0xfff0f0f0, "qsub8%c\t%8-11r, %16-19r, %0-3r"},
  1249. {ARM_EXT_V6T2, 0xfac0f020, 0xfff0f0f0, "shsub8%c\t%8-11r, %16-19r, %0-3r"},
  1250. {ARM_EXT_V6T2, 0xfac0f040, 0xfff0f0f0, "usub8%c\t%8-11r, %16-19r, %0-3r"},
  1251. {ARM_EXT_V6T2, 0xfac0f050, 0xfff0f0f0, "uqsub8%c\t%8-11r, %16-19r, %0-3r"},
  1252. {ARM_EXT_V6T2, 0xfac0f060, 0xfff0f0f0, "uhsub8%c\t%8-11r, %16-19r, %0-3r"},
  1253. {ARM_EXT_V6T2, 0xfad0f000, 0xfff0f0f0, "ssub16%c\t%8-11r, %16-19r, %0-3r"},
  1254. {ARM_EXT_V6T2, 0xfad0f010, 0xfff0f0f0, "qsub16%c\t%8-11r, %16-19r, %0-3r"},
  1255. {ARM_EXT_V6T2, 0xfad0f020, 0xfff0f0f0, "shsub16%c\t%8-11r, %16-19r, %0-3r"},
  1256. {ARM_EXT_V6T2, 0xfad0f040, 0xfff0f0f0, "usub16%c\t%8-11r, %16-19r, %0-3r"},
  1257. {ARM_EXT_V6T2, 0xfad0f050, 0xfff0f0f0, "uqsub16%c\t%8-11r, %16-19r, %0-3r"},
  1258. {ARM_EXT_V6T2, 0xfad0f060, 0xfff0f0f0, "uhsub16%c\t%8-11r, %16-19r, %0-3r"},
  1259. {ARM_EXT_V6T2, 0xfae0f000, 0xfff0f0f0, "ssubaddx%c\t%8-11r, %16-19r, %0-3r"},
  1260. {ARM_EXT_V6T2, 0xfae0f010, 0xfff0f0f0, "qsubaddx%c\t%8-11r, %16-19r, %0-3r"},
  1261. {ARM_EXT_V6T2, 0xfae0f020, 0xfff0f0f0, "shsubaddx%c\t%8-11r, %16-19r, %0-3r"},
  1262. {ARM_EXT_V6T2, 0xfae0f040, 0xfff0f0f0, "usubaddx%c\t%8-11r, %16-19r, %0-3r"},
  1263. {ARM_EXT_V6T2, 0xfae0f050, 0xfff0f0f0, "uqsubaddx%c\t%8-11r, %16-19r, %0-3r"},
  1264. {ARM_EXT_V6T2, 0xfae0f060, 0xfff0f0f0, "uhsubaddx%c\t%8-11r, %16-19r, %0-3r"},
  1265. {ARM_EXT_V6T2, 0xfb00f000, 0xfff0f0f0, "mul%c.w\t%8-11r, %16-19r, %0-3r"},
  1266. {ARM_EXT_V6T2, 0xfb70f000, 0xfff0f0f0, "usad8%c\t%8-11r, %16-19r, %0-3r"},
  1267. {ARM_EXT_V6T2, 0xfa00f000, 0xffe0f0f0, "lsl%20's%c.w\t%8-11r, %16-19r, %0-3r"},
  1268. {ARM_EXT_V6T2, 0xfa20f000, 0xffe0f0f0, "lsr%20's%c.w\t%8-11r, %16-19r, %0-3r"},
  1269. {ARM_EXT_V6T2, 0xfa40f000, 0xffe0f0f0, "asr%20's%c.w\t%8-11r, %16-19r, %0-3r"},
  1270. {ARM_EXT_V6T2, 0xfa60f000, 0xffe0f0f0, "ror%20's%c.w\t%8-11r, %16-19r, %0-3r"},
  1271. {ARM_EXT_V6T2, 0xe8c00f40, 0xfff00fe0, "strex%4?hb%c\t%0-3r, %12-15r, [%16-19r]"},
  1272. {ARM_EXT_V6T2, 0xf3200000, 0xfff0f0e0, "ssat16%c\t%8-11r, #%0-4d, %16-19r"},
  1273. {ARM_EXT_V6T2, 0xf3a00000, 0xfff0f0e0, "usat16%c\t%8-11r, #%0-4d, %16-19r"},
  1274. {ARM_EXT_V6T2, 0xfb20f000, 0xfff0f0e0, "smuad%4'x%c\t%8-11r, %16-19r, %0-3r"},
  1275. {ARM_EXT_V6T2, 0xfb30f000, 0xfff0f0e0, "smulw%4?tb%c\t%8-11r, %16-19r, %0-3r"},
  1276. {ARM_EXT_V6T2, 0xfb40f000, 0xfff0f0e0, "smusd%4'x%c\t%8-11r, %16-19r, %0-3r"},
  1277. {ARM_EXT_V6T2, 0xfb50f000, 0xfff0f0e0, "smmul%4'r%c\t%8-11r, %16-19r, %0-3r"},
  1278. {ARM_EXT_V6T2, 0xfa00f080, 0xfff0f0c0, "sxtah%c\t%8-11r, %16-19r, %0-3r%R"},
  1279. {ARM_EXT_V6T2, 0xfa10f080, 0xfff0f0c0, "uxtah%c\t%8-11r, %16-19r, %0-3r%R"},
  1280. {ARM_EXT_V6T2, 0xfa20f080, 0xfff0f0c0, "sxtab16%c\t%8-11r, %16-19r, %0-3r%R"},
  1281. {ARM_EXT_V6T2, 0xfa30f080, 0xfff0f0c0, "uxtab16%c\t%8-11r, %16-19r, %0-3r%R"},
  1282. {ARM_EXT_V6T2, 0xfa40f080, 0xfff0f0c0, "sxtab%c\t%8-11r, %16-19r, %0-3r%R"},
  1283. {ARM_EXT_V6T2, 0xfa50f080, 0xfff0f0c0, "uxtab%c\t%8-11r, %16-19r, %0-3r%R"},
  1284. {ARM_EXT_V6T2, 0xfb10f000, 0xfff0f0c0, "smul%5?tb%4?tb%c\t%8-11r, %16-19r, %0-3r"},
  1285. {ARM_EXT_V6T2, 0xf36f0000, 0xffff8020, "bfc%c\t%8-11r, %E"},
  1286. {ARM_EXT_V6T2, 0xea100f00, 0xfff08f00, "tst%c.w\t%16-19r, %S"},
  1287. {ARM_EXT_V6T2, 0xea900f00, 0xfff08f00, "teq%c\t%16-19r, %S"},
  1288. {ARM_EXT_V6T2, 0xeb100f00, 0xfff08f00, "cmn%c.w\t%16-19r, %S"},
  1289. {ARM_EXT_V6T2, 0xebb00f00, 0xfff08f00, "cmp%c.w\t%16-19r, %S"},
  1290. {ARM_EXT_V6T2, 0xf0100f00, 0xfbf08f00, "tst%c.w\t%16-19r, %M"},
  1291. {ARM_EXT_V6T2, 0xf0900f00, 0xfbf08f00, "teq%c\t%16-19r, %M"},
  1292. {ARM_EXT_V6T2, 0xf1100f00, 0xfbf08f00, "cmn%c.w\t%16-19r, %M"},
  1293. {ARM_EXT_V6T2, 0xf1b00f00, 0xfbf08f00, "cmp%c.w\t%16-19r, %M"},
  1294. {ARM_EXT_V6T2, 0xea4f0000, 0xffef8000, "mov%20's%c.w\t%8-11r, %S"},
  1295. {ARM_EXT_V6T2, 0xea6f0000, 0xffef8000, "mvn%20's%c.w\t%8-11r, %S"},
  1296. {ARM_EXT_V6T2, 0xe8c00070, 0xfff000f0, "strexd%c\t%0-3r, %12-15r, %8-11r, [%16-19r]"},
  1297. {ARM_EXT_V6T2, 0xfb000000, 0xfff000f0, "mla%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1298. {ARM_EXT_V6T2, 0xfb000010, 0xfff000f0, "mls%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1299. {ARM_EXT_V6T2, 0xfb700000, 0xfff000f0, "usada8%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1300. {ARM_EXT_V6T2, 0xfb800000, 0xfff000f0, "smull%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1301. {ARM_EXT_V6T2, 0xfba00000, 0xfff000f0, "umull%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1302. {ARM_EXT_V6T2, 0xfbc00000, 0xfff000f0, "smlal%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1303. {ARM_EXT_V6T2, 0xfbe00000, 0xfff000f0, "umlal%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1304. {ARM_EXT_V6T2, 0xfbe00060, 0xfff000f0, "umaal%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1305. {ARM_EXT_V6T2, 0xe8500f00, 0xfff00f00, "ldrex%c\t%12-15r, [%16-19r, #%0-7W]"},
  1306. {ARM_EXT_V6T2, 0xf7f08000, 0xfff0f000, "smc%c\t%K"},
  1307. {ARM_EXT_V6T2, 0xf04f0000, 0xfbef8000, "mov%20's%c.w\t%8-11r, %M"},
  1308. {ARM_EXT_V6T2, 0xf06f0000, 0xfbef8000, "mvn%20's%c.w\t%8-11r, %M"},
  1309. {ARM_EXT_V6T2, 0xf810f000, 0xff70f000, "pld%c\t%a"},
  1310. {ARM_EXT_V6T2, 0xfb200000, 0xfff000e0, "smlad%4'x%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1311. {ARM_EXT_V6T2, 0xfb300000, 0xfff000e0, "smlaw%4?tb%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1312. {ARM_EXT_V6T2, 0xfb400000, 0xfff000e0, "smlsd%4'x%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1313. {ARM_EXT_V6T2, 0xfb500000, 0xfff000e0, "smmla%4'r%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1314. {ARM_EXT_V6T2, 0xfb600000, 0xfff000e0, "smmls%4'r%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1315. {ARM_EXT_V6T2, 0xfbc000c0, 0xfff000e0, "smlald%4'x%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1316. {ARM_EXT_V6T2, 0xfbd000c0, 0xfff000e0, "smlsld%4'x%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1317. {ARM_EXT_V6T2, 0xeac00000, 0xfff08030, "pkhbt%c\t%8-11r, %16-19r, %S"},
  1318. {ARM_EXT_V6T2, 0xeac00020, 0xfff08030, "pkhtb%c\t%8-11r, %16-19r, %S"},
  1319. {ARM_EXT_V6T2, 0xf3400000, 0xfff08020, "sbfx%c\t%8-11r, %16-19r, %F"},
  1320. {ARM_EXT_V6T2, 0xf3c00000, 0xfff08020, "ubfx%c\t%8-11r, %16-19r, %F"},
  1321. {ARM_EXT_V6T2, 0xf8000e00, 0xff900f00, "str%wt%c\t%12-15r, %a"},
  1322. {ARM_EXT_V6T2, 0xfb100000, 0xfff000c0, "smla%5?tb%4?tb%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
  1323. {ARM_EXT_V6T2, 0xfbc00080, 0xfff000c0, "smlal%5?tb%4?tb%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
  1324. {ARM_EXT_V6T2, 0xf3600000, 0xfff08020, "bfi%c\t%8-11r, %16-19r, %E"},
  1325. {ARM_EXT_V6T2, 0xf8100e00, 0xfe900f00, "ldr%wt%c\t%12-15r, %a"},
  1326. {ARM_EXT_V6T2, 0xf3000000, 0xffd08020, "ssat%c\t%8-11r, #%0-4d, %16-19r%s"},
  1327. {ARM_EXT_V6T2, 0xf3800000, 0xffd08020, "usat%c\t%8-11r, #%0-4d, %16-19r%s"},
  1328. {ARM_EXT_V6T2, 0xf2000000, 0xfbf08000, "addw%c\t%8-11r, %16-19r, %I"},
  1329. {ARM_EXT_V6T2, 0xf2400000, 0xfbf08000, "movw%c\t%8-11r, %J"},
  1330. {ARM_EXT_V6T2, 0xf2a00000, 0xfbf08000, "subw%c\t%8-11r, %16-19r, %I"},
  1331. {ARM_EXT_V6T2, 0xf2c00000, 0xfbf08000, "movt%c\t%8-11r, %J"},
  1332. {ARM_EXT_V6T2, 0xea000000, 0xffe08000, "and%20's%c.w\t%8-11r, %16-19r, %S"},
  1333. {ARM_EXT_V6T2, 0xea200000, 0xffe08000, "bic%20's%c.w\t%8-11r, %16-19r, %S"},
  1334. {ARM_EXT_V6T2, 0xea400000, 0xffe08000, "orr%20's%c.w\t%8-11r, %16-19r, %S"},
  1335. {ARM_EXT_V6T2, 0xea600000, 0xffe08000, "orn%20's%c\t%8-11r, %16-19r, %S"},
  1336. {ARM_EXT_V6T2, 0xea800000, 0xffe08000, "eor%20's%c.w\t%8-11r, %16-19r, %S"},
  1337. {ARM_EXT_V6T2, 0xeb000000, 0xffe08000, "add%20's%c.w\t%8-11r, %16-19r, %S"},
  1338. {ARM_EXT_V6T2, 0xeb400000, 0xffe08000, "adc%20's%c.w\t%8-11r, %16-19r, %S"},
  1339. {ARM_EXT_V6T2, 0xeb600000, 0xffe08000, "sbc%20's%c.w\t%8-11r, %16-19r, %S"},
  1340. {ARM_EXT_V6T2, 0xeba00000, 0xffe08000, "sub%20's%c.w\t%8-11r, %16-19r, %S"},
  1341. {ARM_EXT_V6T2, 0xebc00000, 0xffe08000, "rsb%20's%c\t%8-11r, %16-19r, %S"},
  1342. {ARM_EXT_V6T2, 0xe8400000, 0xfff00000, "strex%c\t%8-11r, %12-15r, [%16-19r, #%0-7W]"},
  1343. {ARM_EXT_V6T2, 0xf0000000, 0xfbe08000, "and%20's%c.w\t%8-11r, %16-19r, %M"},
  1344. {ARM_EXT_V6T2, 0xf0200000, 0xfbe08000, "bic%20's%c.w\t%8-11r, %16-19r, %M"},
  1345. {ARM_EXT_V6T2, 0xf0400000, 0xfbe08000, "orr%20's%c.w\t%8-11r, %16-19r, %M"},
  1346. {ARM_EXT_V6T2, 0xf0600000, 0xfbe08000, "orn%20's%c\t%8-11r, %16-19r, %M"},
  1347. {ARM_EXT_V6T2, 0xf0800000, 0xfbe08000, "eor%20's%c.w\t%8-11r, %16-19r, %M"},
  1348. {ARM_EXT_V6T2, 0xf1000000, 0xfbe08000, "add%20's%c.w\t%8-11r, %16-19r, %M"},
  1349. {ARM_EXT_V6T2, 0xf1400000, 0xfbe08000, "adc%20's%c.w\t%8-11r, %16-19r, %M"},
  1350. {ARM_EXT_V6T2, 0xf1600000, 0xfbe08000, "sbc%20's%c.w\t%8-11r, %16-19r, %M"},
  1351. {ARM_EXT_V6T2, 0xf1a00000, 0xfbe08000, "sub%20's%c.w\t%8-11r, %16-19r, %M"},
  1352. {ARM_EXT_V6T2, 0xf1c00000, 0xfbe08000, "rsb%20's%c\t%8-11r, %16-19r, %M"},
  1353. {ARM_EXT_V6T2, 0xe8800000, 0xffd00000, "stmia%c.w\t%16-19r%21'!, %m"},
  1354. {ARM_EXT_V6T2, 0xe8900000, 0xffd00000, "ldmia%c.w\t%16-19r%21'!, %m"},
  1355. {ARM_EXT_V6T2, 0xe9000000, 0xffd00000, "stmdb%c\t%16-19r%21'!, %m"},
  1356. {ARM_EXT_V6T2, 0xe9100000, 0xffd00000, "ldmdb%c\t%16-19r%21'!, %m"},
  1357. {ARM_EXT_V6T2, 0xe9c00000, 0xffd000ff, "strd%c\t%12-15r, %8-11r, [%16-19r]"},
  1358. {ARM_EXT_V6T2, 0xe9d00000, 0xffd000ff, "ldrd%c\t%12-15r, %8-11r, [%16-19r]"},
  1359. {ARM_EXT_V6T2, 0xe9400000, 0xff500000, "strd%c\t%12-15r, %8-11r, [%16-19r, #%23`-%0-7W]%21'!"},
  1360. {ARM_EXT_V6T2, 0xe9500000, 0xff500000, "ldrd%c\t%12-15r, %8-11r, [%16-19r, #%23`-%0-7W]%21'!"},
  1361. {ARM_EXT_V6T2, 0xe8600000, 0xff700000, "strd%c\t%12-15r, %8-11r, [%16-19r], #%23`-%0-7W"},
  1362. {ARM_EXT_V6T2, 0xe8700000, 0xff700000, "ldrd%c\t%12-15r, %8-11r, [%16-19r], #%23`-%0-7W"},
  1363. {ARM_EXT_V6T2, 0xf8000000, 0xff100000, "str%w%c.w\t%12-15r, %a"},
  1364. {ARM_EXT_V6T2, 0xf8100000, 0xfe100000, "ldr%w%c.w\t%12-15r, %a"},
  1365. /* Filter out Bcc with cond=E or F, which are used for other instructions. */
  1366. {ARM_EXT_V6T2, 0xf3c08000, 0xfbc0d000, "undefined (bcc, cond=0xF)"},
  1367. {ARM_EXT_V6T2, 0xf3808000, 0xfbc0d000, "undefined (bcc, cond=0xE)"},
  1368. {ARM_EXT_V6T2, 0xf0008000, 0xf800d000, "b%22-25c.w\t%b%X"},
  1369. {ARM_EXT_V6T2, 0xf0009000, 0xf800d000, "b%c.w\t%B%x"},
  1370. /* These have been 32-bit since the invention of Thumb. */
  1371. {ARM_EXT_V4T, 0xf000c000, 0xf800d000, "blx%c\t%B%x"},
  1372. {ARM_EXT_V4T, 0xf000d000, 0xf800d000, "bl%c\t%B%x"},
  1373. /* Fallback. */
  1374. {ARM_EXT_V1, 0x00000000, 0x00000000, "undefined"},
  1375. {0, 0, 0, 0}
  1376. };
  1377. static const char *const arm_conditional[] =
  1378. {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
  1379. "hi", "ls", "ge", "lt", "gt", "le", "al", "<und>", ""};
  1380. static const char *const arm_fp_const[] =
  1381. {"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0"};
  1382. static const char *const arm_shift[] =
  1383. {"lsl", "lsr", "asr", "ror"};
  1384. typedef struct
  1385. {
  1386. const char *name;
  1387. const char *description;
  1388. const char *reg_names[16];
  1389. }
  1390. arm_regname;
  1391. static const arm_regname regnames[] =
  1392. {
  1393. { "raw" , "Select raw register names",
  1394. { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"}},
  1395. { "gcc", "Select register names used by GCC",
  1396. { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc" }},
  1397. { "std", "Select register names used in ARM's ISA documentation",
  1398. { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc" }},
  1399. { "apcs", "Select register names used in the APCS",
  1400. { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "sl", "fp", "ip", "sp", "lr", "pc" }},
  1401. { "atpcs", "Select register names used in the ATPCS",
  1402. { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "IP", "SP", "LR", "PC" }},
  1403. { "special-atpcs", "Select special register names used in the ATPCS",
  1404. { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL", "FP", "IP", "SP", "LR", "PC" }},
  1405. };
  1406. static const char *const iwmmxt_wwnames[] =
  1407. {"b", "h", "w", "d"};
  1408. static const char *const iwmmxt_wwssnames[] =
  1409. {"b", "bus", "bc", "bss",
  1410. "h", "hus", "hc", "hss",
  1411. "w", "wus", "wc", "wss",
  1412. "d", "dus", "dc", "dss"
  1413. };
  1414. static const char *const iwmmxt_regnames[] =
  1415. { "wr0", "wr1", "wr2", "wr3", "wr4", "wr5", "wr6", "wr7",
  1416. "wr8", "wr9", "wr10", "wr11", "wr12", "wr13", "wr14", "wr15"
  1417. };
  1418. static const char *const iwmmxt_cregnames[] =
  1419. { "wcid", "wcon", "wcssf", "wcasf", "reserved", "reserved", "reserved", "reserved",
  1420. "wcgr0", "wcgr1", "wcgr2", "wcgr3", "reserved", "reserved", "reserved", "reserved"
  1421. };
  1422. /* Default to GCC register name set. */
  1423. static unsigned int regname_selected = 1;
  1424. #define NUM_ARM_REGNAMES NUM_ELEM (regnames)
  1425. #define arm_regnames regnames[regname_selected].reg_names
  1426. static bfd_boolean force_thumb = FALSE;
  1427. /* Current IT instruction state. This contains the same state as the IT
  1428. bits in the CPSR. */
  1429. static unsigned int ifthen_state;
  1430. /* IT state for the next instruction. */
  1431. static unsigned int ifthen_next_state;
  1432. /* The address of the insn for which the IT state is valid. */
  1433. static bfd_vma ifthen_address;
  1434. #define IFTHEN_COND ((ifthen_state >> 4) & 0xf)
  1435. /* Cached mapping symbol state. */
  1436. enum map_type {
  1437. MAP_ARM,
  1438. MAP_THUMB,
  1439. MAP_DATA
  1440. };
  1441. enum map_type last_type;
  1442. int last_mapping_sym = -1;
  1443. bfd_vma last_mapping_addr = 0;
  1444. /* Functions. */
  1445. int
  1446. get_arm_regname_num_options (void)
  1447. {
  1448. return NUM_ARM_REGNAMES;
  1449. }
  1450. int
  1451. set_arm_regname_option (int option)
  1452. {
  1453. int old = regname_selected;
  1454. regname_selected = option;
  1455. return old;
  1456. }
  1457. int
  1458. get_arm_regnames (int option, const char **setname, const char **setdescription,
  1459. const char *const **register_names)
  1460. {
  1461. *setname = regnames[option].name;
  1462. *setdescription = regnames[option].description;
  1463. *register_names = regnames[option].reg_names;
  1464. return 16;
  1465. }
  1466. /* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?.
  1467. Returns pointer to following character of the format string and
  1468. fills in *VALUEP and *WIDTHP with the extracted value and number of
  1469. bits extracted. WIDTHP can be NULL. */
  1470. static const char *
  1471. arm_decode_bitfield (const char *ptr, unsigned long insn,
  1472. unsigned long *valuep, int *widthp)
  1473. {
  1474. unsigned long value = 0;
  1475. int width = 0;
  1476. do
  1477. {
  1478. int start, end;
  1479. int bits;
  1480. for (start = 0; *ptr >= '0' && *ptr <= '9'; ptr++)
  1481. start = start * 10 + *ptr - '0';
  1482. if (*ptr == '-')
  1483. for (end = 0, ptr++; *ptr >= '0' && *ptr <= '9'; ptr++)
  1484. end = end * 10 + *ptr - '0';
  1485. else
  1486. end = start;
  1487. bits = end - start;
  1488. if (bits < 0)
  1489. abort ();
  1490. value |= ((insn >> start) & ((2ul << bits) - 1)) << width;
  1491. width += bits + 1;
  1492. }
  1493. while (*ptr++ == ',');
  1494. *valuep = value;
  1495. if (widthp)
  1496. *widthp = width;
  1497. return ptr - 1;
  1498. }
  1499. static void
  1500. arm_decode_shift (long given, fprintf_ftype func, void *stream,
  1501. int print_shift)
  1502. {
  1503. func (stream, "%s", arm_regnames[given & 0xf]);
  1504. if ((given & 0xff0) != 0)
  1505. {
  1506. if ((given & 0x10) == 0)
  1507. {
  1508. int amount = (given & 0xf80) >> 7;
  1509. int shift = (given & 0x60) >> 5;
  1510. if (amount == 0)
  1511. {
  1512. if (shift == 3)
  1513. {
  1514. func (stream, ", rrx");
  1515. return;
  1516. }
  1517. amount = 32;
  1518. }
  1519. if (print_shift)
  1520. func (stream, ", %s #%d", arm_shift[shift], amount);
  1521. else
  1522. func (stream, ", #%d", amount);
  1523. }
  1524. else if (print_shift)
  1525. func (stream, ", %s %s", arm_shift[(given & 0x60) >> 5],
  1526. arm_regnames[(given & 0xf00) >> 8]);
  1527. else
  1528. func (stream, ", %s", arm_regnames[(given & 0xf00) >> 8]);
  1529. }
  1530. }
  1531. /* Print one coprocessor instruction on INFO->STREAM.
  1532. Return TRUE if the instuction matched, FALSE if this is not a
  1533. recognised coprocessor instruction. */
  1534. static bfd_boolean
  1535. print_insn_coprocessor (bfd_vma pc, struct disassemble_info *info, long given,
  1536. bfd_boolean thumb)
  1537. {
  1538. const struct opcode32 *insn;
  1539. void *stream = info->stream;
  1540. fprintf_ftype func = info->fprintf_func;
  1541. unsigned long mask;
  1542. unsigned long value;
  1543. int cond;
  1544. for (insn = coprocessor_opcodes; insn->assembler; insn++)
  1545. {
  1546. if (insn->value == FIRST_IWMMXT_INSN
  1547. && info->mach != bfd_mach_arm_XScale
  1548. && info->mach != bfd_mach_arm_iWMMXt
  1549. && info->mach != bfd_mach_arm_iWMMXt2)
  1550. insn = insn + IWMMXT_INSN_COUNT;
  1551. mask = insn->mask;
  1552. value = insn->value;
  1553. if (thumb)
  1554. {
  1555. /* The high 4 bits are 0xe for Arm conditional instructions, and
  1556. 0xe for arm unconditional instructions. The rest of the
  1557. encoding is the same. */
  1558. mask |= 0xf0000000;
  1559. value |= 0xe0000000;
  1560. if (ifthen_state)
  1561. cond = IFTHEN_COND;
  1562. else
  1563. cond = 16;
  1564. }
  1565. else
  1566. {
  1567. /* Only match unconditional instuctions against unconditional
  1568. patterns. */
  1569. if ((given & 0xf0000000) == 0xf0000000)
  1570. {
  1571. mask |= 0xf0000000;
  1572. cond = 16;
  1573. }
  1574. else
  1575. {
  1576. cond = (given >> 28) & 0xf;
  1577. if (cond == 0xe)
  1578. cond = 16;
  1579. }
  1580. }
  1581. if ((given & mask) == value)
  1582. {
  1583. const char *c;
  1584. for (c = insn->assembler; *c; c++)
  1585. {
  1586. if (*c == '%')
  1587. {
  1588. switch (*++c)
  1589. {
  1590. case '%':
  1591. func (stream, "%%");
  1592. break;
  1593. case 'A':
  1594. func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
  1595. if ((given & (1 << 24)) != 0)
  1596. {
  1597. int offset = given & 0xff;
  1598. if (offset)
  1599. func (stream, ", #%s%d]%s",
  1600. ((given & 0x00800000) == 0 ? "-" : ""),
  1601. offset * 4,
  1602. ((given & 0x00200000) != 0 ? "!" : ""));
  1603. else
  1604. func (stream, "]");
  1605. }
  1606. else
  1607. {
  1608. int offset = given & 0xff;
  1609. func (stream, "]");
  1610. if (given & (1 << 21))
  1611. {
  1612. if (offset)
  1613. func (stream, ", #%s%d",
  1614. ((given & 0x00800000) == 0 ? "-" : ""),
  1615. offset * 4);
  1616. }
  1617. else
  1618. func (stream, ", {%d}", offset);
  1619. }
  1620. break;
  1621. case 'B':
  1622. {
  1623. int regno = ((given >> 12) & 0xf) | ((given >> (22 - 4)) & 0x10);
  1624. int offset = (given >> 1) & 0x3f;
  1625. if (offset == 1)
  1626. func (stream, "{d%d}", regno);
  1627. else if (regno + offset > 32)
  1628. func (stream, "{d%d-<overflow reg d%d>}", regno, regno + offset - 1);
  1629. else
  1630. func (stream, "{d%d-d%d}", regno, regno + offset - 1);
  1631. }
  1632. break;
  1633. case 'C':
  1634. {
  1635. int rn = (given >> 16) & 0xf;
  1636. int offset = (given & 0xff) * 4;
  1637. int add = (given >> 23) & 1;
  1638. func (stream, "[%s", arm_regnames[rn]);
  1639. if (offset)
  1640. {
  1641. if (!add)
  1642. offset = -offset;
  1643. func (stream, ", #%d", offset);
  1644. }
  1645. func (stream, "]");
  1646. if (rn == 15)
  1647. {
  1648. func (stream, "\t; ");
  1649. /* FIXME: Unsure if info->bytes_per_chunk is the
  1650. right thing to use here. */
  1651. info->print_address_func (offset + pc
  1652. + info->bytes_per_chunk * 2, info);
  1653. }
  1654. }
  1655. break;
  1656. case 'c':
  1657. func (stream, "%s", arm_conditional[cond]);
  1658. break;
  1659. case 'I':
  1660. /* Print a Cirrus/DSP shift immediate. */
  1661. /* Immediates are 7bit signed ints with bits 0..3 in
  1662. bits 0..3 of opcode and bits 4..6 in bits 5..7
  1663. of opcode. */
  1664. {
  1665. int imm;
  1666. imm = (given & 0xf) | ((given & 0xe0) >> 1);
  1667. /* Is ``imm'' a negative number? */
  1668. if (imm & 0x40)
  1669. imm |= (-1 << 7);
  1670. func (stream, "%d", imm);
  1671. }
  1672. break;
  1673. case 'F':
  1674. switch (given & 0x00408000)
  1675. {
  1676. case 0:
  1677. func (stream, "4");
  1678. break;
  1679. case 0x8000:
  1680. func (stream, "1");
  1681. break;
  1682. case 0x00400000:
  1683. func (stream, "2");
  1684. break;
  1685. default:
  1686. func (stream, "3");
  1687. }
  1688. break;
  1689. case 'P':
  1690. switch (given & 0x00080080)
  1691. {
  1692. case 0:
  1693. func (stream, "s");
  1694. break;
  1695. case 0x80:
  1696. func (stream, "d");
  1697. break;
  1698. case 0x00080000:
  1699. func (stream, "e");
  1700. break;
  1701. default:
  1702. func (stream, _("<illegal precision>"));
  1703. break;
  1704. }
  1705. break;
  1706. case 'Q':
  1707. switch (given & 0x00408000)
  1708. {
  1709. case 0:
  1710. func (stream, "s");
  1711. break;
  1712. case 0x8000:
  1713. func (stream, "d");
  1714. break;
  1715. case 0x00400000:
  1716. func (stream, "e");
  1717. break;
  1718. default:
  1719. func (stream, "p");
  1720. break;
  1721. }
  1722. break;
  1723. case 'R':
  1724. switch (given & 0x60)
  1725. {
  1726. case 0:
  1727. break;
  1728. case 0x20:
  1729. func (stream, "p");
  1730. break;
  1731. case 0x40:
  1732. func (stream, "m");
  1733. break;
  1734. default:
  1735. func (stream, "z");
  1736. break;
  1737. }
  1738. break;
  1739. case '0': case '1': case '2': case '3': case '4':
  1740. case '5': case '6': case '7': case '8': case '9':
  1741. {
  1742. int width;
  1743. unsigned long value;
  1744. c = arm_decode_bitfield (c, given, &value, &width);
  1745. switch (*c)
  1746. {
  1747. case 'r':
  1748. func (stream, "%s", arm_regnames[value]);
  1749. break;
  1750. case 'D':
  1751. func (stream, "d%ld", value);
  1752. break;
  1753. case 'Q':
  1754. if (value & 1)
  1755. func (stream, "<illegal reg q%ld.5>", value >> 1);
  1756. else
  1757. func (stream, "q%ld", value >> 1);
  1758. break;
  1759. case 'd':
  1760. func (stream, "%ld", value);
  1761. break;
  1762. case 'k':
  1763. {
  1764. int from = (given & (1 << 7)) ? 32 : 16;
  1765. func (stream, "%ld", from - value);
  1766. }
  1767. break;
  1768. case 'f':
  1769. if (value > 7)
  1770. func (stream, "#%s", arm_fp_const[value & 7]);
  1771. else
  1772. func (stream, "f%ld", value);
  1773. break;
  1774. case 'w':
  1775. if (width == 2)
  1776. func (stream, "%s", iwmmxt_wwnames[value]);
  1777. else
  1778. func (stream, "%s", iwmmxt_wwssnames[value]);
  1779. break;
  1780. case 'g':
  1781. func (stream, "%s", iwmmxt_regnames[value]);
  1782. break;
  1783. case 'G':
  1784. func (stream, "%s", iwmmxt_cregnames[value]);
  1785. break;
  1786. case 'x':
  1787. func (stream, "0x%lx", value);
  1788. break;
  1789. case '`':
  1790. c++;
  1791. if (value == 0)
  1792. func (stream, "%c", *c);
  1793. break;
  1794. case '\'':
  1795. c++;
  1796. if (value == ((1ul << width) - 1))
  1797. func (stream, "%c", *c);
  1798. break;
  1799. case '?':
  1800. func (stream, "%c", c[(1 << width) - (int)value]);
  1801. c += 1 << width;
  1802. break;
  1803. default:
  1804. abort ();
  1805. }
  1806. break;
  1807. case 'y':
  1808. case 'z':
  1809. {
  1810. int single = *c++ == 'y';
  1811. int regno;
  1812. switch (*c)
  1813. {
  1814. case '4': /* Sm pair */
  1815. func (stream, "{");
  1816. /* Fall through. */
  1817. case '0': /* Sm, Dm */
  1818. regno = given & 0x0000000f;
  1819. if (single)
  1820. {
  1821. regno <<= 1;
  1822. regno += (given >> 5) & 1;
  1823. }
  1824. else
  1825. regno += ((given >> 5) & 1) << 4;
  1826. break;
  1827. case '1': /* Sd, Dd */
  1828. regno = (given >> 12) & 0x0000000f;
  1829. if (single)
  1830. {
  1831. regno <<= 1;
  1832. regno += (given >> 22) & 1;
  1833. }
  1834. else
  1835. regno += ((given >> 22) & 1) << 4;
  1836. break;
  1837. case '2': /* Sn, Dn */
  1838. regno = (given >> 16) & 0x0000000f;
  1839. if (single)
  1840. {
  1841. regno <<= 1;
  1842. regno += (given >> 7) & 1;
  1843. }
  1844. else
  1845. regno += ((given >> 7) & 1) << 4;
  1846. break;
  1847. case '3': /* List */
  1848. func (stream, "{");
  1849. regno = (given >> 12) & 0x0000000f;
  1850. if (single)
  1851. {
  1852. regno <<= 1;
  1853. regno += (given >> 22) & 1;
  1854. }
  1855. else
  1856. regno += ((given >> 22) & 1) << 4;
  1857. break;
  1858. default:
  1859. abort ();
  1860. }
  1861. func (stream, "%c%d", single ? 's' : 'd', regno);
  1862. if (*c == '3')
  1863. {
  1864. int count = given & 0xff;
  1865. if (single == 0)
  1866. count >>= 1;
  1867. if (--count)
  1868. {
  1869. func (stream, "-%c%d",
  1870. single ? 's' : 'd',
  1871. regno + count);
  1872. }
  1873. func (stream, "}");
  1874. }
  1875. else if (*c == '4')
  1876. func (stream, ", %c%d}", single ? 's' : 'd',
  1877. regno + 1);
  1878. }
  1879. break;
  1880. case 'L':
  1881. switch (given & 0x00400100)
  1882. {
  1883. case 0x00000000: func (stream, "b"); break;
  1884. case 0x00400000: func (stream, "h"); break;
  1885. case 0x00000100: func (stream, "w"); break;
  1886. case 0x00400100: func (stream, "d"); break;
  1887. default:
  1888. break;
  1889. }
  1890. break;
  1891. case 'Z':
  1892. {
  1893. int value;
  1894. /* given (20, 23) | given (0, 3) */
  1895. value = ((given >> 16) & 0xf0) | (given & 0xf);
  1896. func (stream, "%d", value);
  1897. }
  1898. break;
  1899. case 'l':
  1900. /* This is like the 'A' operator, except that if
  1901. the width field "M" is zero, then the offset is
  1902. *not* multiplied by four. */
  1903. {
  1904. int offset = given & 0xff;
  1905. int multiplier = (given & 0x00000100) ? 4 : 1;
  1906. func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
  1907. if (offset)
  1908. {
  1909. if ((given & 0x01000000) != 0)
  1910. func (stream, ", #%s%d]%s",
  1911. ((given & 0x00800000) == 0 ? "-" : ""),
  1912. offset * multiplier,
  1913. ((given & 0x00200000) != 0 ? "!" : ""));
  1914. else
  1915. func (stream, "], #%s%d",
  1916. ((given & 0x00800000) == 0 ? "-" : ""),
  1917. offset * multiplier);
  1918. }
  1919. else
  1920. func (stream, "]");
  1921. }
  1922. break;
  1923. case 'r':
  1924. {
  1925. int imm4 = (given >> 4) & 0xf;
  1926. int puw_bits = ((given >> 22) & 6) | ((given >> 21) & 1);
  1927. int ubit = (given >> 23) & 1;
  1928. const char *rm = arm_regnames [given & 0xf];
  1929. const char *rn = arm_regnames [(given >> 16) & 0xf];
  1930. switch (puw_bits)
  1931. {
  1932. case 1:
  1933. /* fall through */
  1934. case 3:
  1935. func (stream, "[%s], %c%s", rn, ubit ? '+' : '-', rm);
  1936. if (imm4)
  1937. func (stream, ", lsl #%d", imm4);
  1938. break;
  1939. case 4:
  1940. /* fall through */
  1941. case 5:
  1942. /* fall through */
  1943. case 6:
  1944. /* fall through */
  1945. case 7:
  1946. func (stream, "[%s, %c%s", rn, ubit ? '+' : '-', rm);
  1947. if (imm4 > 0)
  1948. func (stream, ", lsl #%d", imm4);
  1949. func (stream, "]");
  1950. if (puw_bits == 5 || puw_bits == 7)
  1951. func (stream, "!");
  1952. break;
  1953. default:
  1954. func (stream, "INVALID");
  1955. }
  1956. }
  1957. break;
  1958. case 'i':
  1959. {
  1960. long imm5;
  1961. imm5 = ((given & 0x100) >> 4) | (given & 0xf);
  1962. func (stream, "%ld", (imm5 == 0) ? 32 : imm5);
  1963. }
  1964. break;
  1965. default:
  1966. abort ();
  1967. }
  1968. }
  1969. }
  1970. else
  1971. func (stream, "%c", *c);
  1972. }
  1973. return TRUE;
  1974. }
  1975. }
  1976. return FALSE;
  1977. }
  1978. static void
  1979. print_arm_address (bfd_vma pc, struct disassemble_info *info, long given)
  1980. {
  1981. void *stream = info->stream;
  1982. fprintf_ftype func = info->fprintf_func;
  1983. if (((given & 0x000f0000) == 0x000f0000)
  1984. && ((given & 0x02000000) == 0))
  1985. {
  1986. int offset = given & 0xfff;
  1987. func (stream, "[pc");
  1988. if (given & 0x01000000)
  1989. {
  1990. if ((given & 0x00800000) == 0)
  1991. offset = - offset;
  1992. /* Pre-indexed. */
  1993. func (stream, ", #%d]", offset);
  1994. offset += pc + 8;
  1995. /* Cope with the possibility of write-back
  1996. being used. Probably a very dangerous thing
  1997. for the programmer to do, but who are we to
  1998. argue ? */
  1999. if (given & 0x00200000)
  2000. func (stream, "!");
  2001. }
  2002. else
  2003. {
  2004. /* Post indexed. */
  2005. func (stream, "], #%d", offset);
  2006. /* ie ignore the offset. */
  2007. offset = pc + 8;
  2008. }
  2009. func (stream, "\t; ");
  2010. info->print_address_func (offset, info);
  2011. }
  2012. else
  2013. {
  2014. func (stream, "[%s",
  2015. arm_regnames[(given >> 16) & 0xf]);
  2016. if ((given & 0x01000000) != 0)
  2017. {
  2018. if ((given & 0x02000000) == 0)
  2019. {
  2020. int offset = given & 0xfff;
  2021. if (offset)
  2022. func (stream, ", #%s%d",
  2023. (((given & 0x00800000) == 0)
  2024. ? "-" : ""), offset);
  2025. }
  2026. else
  2027. {
  2028. func (stream, ", %s",
  2029. (((given & 0x00800000) == 0)
  2030. ? "-" : ""));
  2031. arm_decode_shift (given, func, stream, 1);
  2032. }
  2033. func (stream, "]%s",
  2034. ((given & 0x00200000) != 0) ? "!" : "");
  2035. }
  2036. else
  2037. {
  2038. if ((given & 0x02000000) == 0)
  2039. {
  2040. int offset = given & 0xfff;
  2041. if (offset)
  2042. func (stream, "], #%s%d",
  2043. (((given & 0x00800000) == 0)
  2044. ? "-" : ""), offset);
  2045. else
  2046. func (stream, "]");
  2047. }
  2048. else
  2049. {
  2050. func (stream, "], %s",
  2051. (((given & 0x00800000) == 0)
  2052. ? "-" : ""));
  2053. arm_decode_shift (given, func, stream, 1);
  2054. }
  2055. }
  2056. }
  2057. }
  2058. /* Print one neon instruction on INFO->STREAM.
  2059. Return TRUE if the instuction matched, FALSE if this is not a
  2060. recognised neon instruction. */
  2061. static bfd_boolean
  2062. print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb)
  2063. {
  2064. const struct opcode32 *insn;
  2065. void *stream = info->stream;
  2066. fprintf_ftype func = info->fprintf_func;
  2067. if (thumb)
  2068. {
  2069. if ((given & 0xef000000) == 0xef000000)
  2070. {
  2071. /* move bit 28 to bit 24 to translate Thumb2 to ARM encoding. */
  2072. unsigned long bit28 = given & (1 << 28);
  2073. given &= 0x00ffffff;
  2074. if (bit28)
  2075. given |= 0xf3000000;
  2076. else
  2077. given |= 0xf2000000;
  2078. }
  2079. else if ((given & 0xff000000) == 0xf9000000)
  2080. given ^= 0xf9000000 ^ 0xf4000000;
  2081. else
  2082. return FALSE;
  2083. }
  2084. for (insn = neon_opcodes; insn->assembler; insn++)
  2085. {
  2086. if ((given & insn->mask) == insn->value)
  2087. {
  2088. const char *c;
  2089. for (c = insn->assembler; *c; c++)
  2090. {
  2091. if (*c == '%')
  2092. {
  2093. switch (*++c)
  2094. {
  2095. case '%':
  2096. func (stream, "%%");
  2097. break;
  2098. case 'c':
  2099. if (thumb && ifthen_state)
  2100. func (stream, "%s", arm_conditional[IFTHEN_COND]);
  2101. break;
  2102. case 'A':
  2103. {
  2104. static const unsigned char enc[16] =
  2105. {
  2106. 0x4, 0x14, /* st4 0,1 */
  2107. 0x4, /* st1 2 */
  2108. 0x4, /* st2 3 */
  2109. 0x3, /* st3 4 */
  2110. 0x13, /* st3 5 */
  2111. 0x3, /* st1 6 */
  2112. 0x1, /* st1 7 */
  2113. 0x2, /* st2 8 */
  2114. 0x12, /* st2 9 */
  2115. 0x2, /* st1 10 */
  2116. 0, 0, 0, 0, 0
  2117. };
  2118. int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
  2119. int rn = ((given >> 16) & 0xf);
  2120. int rm = ((given >> 0) & 0xf);
  2121. int align = ((given >> 4) & 0x3);
  2122. int type = ((given >> 8) & 0xf);
  2123. int n = enc[type] & 0xf;
  2124. int stride = (enc[type] >> 4) + 1;
  2125. int ix;
  2126. func (stream, "{");
  2127. if (stride > 1)
  2128. for (ix = 0; ix != n; ix++)
  2129. func (stream, "%sd%d", ix ? "," : "", rd + ix * stride);
  2130. else if (n == 1)
  2131. func (stream, "d%d", rd);
  2132. else
  2133. func (stream, "d%d-d%d", rd, rd + n - 1);
  2134. func (stream, "}, [%s", arm_regnames[rn]);
  2135. if (align)
  2136. func (stream, ", :%d", 32 << align);
  2137. func (stream, "]");
  2138. if (rm == 0xd)
  2139. func (stream, "!");
  2140. else if (rm != 0xf)
  2141. func (stream, ", %s", arm_regnames[rm]);
  2142. }
  2143. break;
  2144. case 'B':
  2145. {
  2146. int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
  2147. int rn = ((given >> 16) & 0xf);
  2148. int rm = ((given >> 0) & 0xf);
  2149. int idx_align = ((given >> 4) & 0xf);
  2150. int align = 0;
  2151. int size = ((given >> 10) & 0x3);
  2152. int idx = idx_align >> (size + 1);
  2153. int length = ((given >> 8) & 3) + 1;
  2154. int stride = 1;
  2155. int i;
  2156. if (length > 1 && size > 0)
  2157. stride = (idx_align & (1 << size)) ? 2 : 1;
  2158. switch (length)
  2159. {
  2160. case 1:
  2161. {
  2162. int amask = (1 << size) - 1;
  2163. if ((idx_align & (1 << size)) != 0)
  2164. return FALSE;
  2165. if (size > 0)
  2166. {
  2167. if ((idx_align & amask) == amask)
  2168. align = 8 << size;
  2169. else if ((idx_align & amask) != 0)
  2170. return FALSE;
  2171. }
  2172. }
  2173. break;
  2174. case 2:
  2175. if (size == 2 && (idx_align & 2) != 0)
  2176. return FALSE;
  2177. align = (idx_align & 1) ? 16 << size : 0;
  2178. break;
  2179. case 3:
  2180. if ((size == 2 && (idx_align & 3) != 0)
  2181. || (idx_align & 1) != 0)
  2182. return FALSE;
  2183. break;
  2184. case 4:
  2185. if (size == 2)
  2186. {
  2187. if ((idx_align & 3) == 3)
  2188. return FALSE;
  2189. align = (idx_align & 3) * 64;
  2190. }
  2191. else
  2192. align = (idx_align & 1) ? 32 << size : 0;
  2193. break;
  2194. default:
  2195. abort ();
  2196. }
  2197. func (stream, "{");
  2198. for (i = 0; i < length; i++)
  2199. func (stream, "%sd%d[%d]", (i == 0) ? "" : ",",
  2200. rd + i * stride, idx);
  2201. func (stream, "}, [%s", arm_regnames[rn]);
  2202. if (align)
  2203. func (stream, ", :%d", align);
  2204. func (stream, "]");
  2205. if (rm == 0xd)
  2206. func (stream, "!");
  2207. else if (rm != 0xf)
  2208. func (stream, ", %s", arm_regnames[rm]);
  2209. }
  2210. break;
  2211. case 'C':
  2212. {
  2213. int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
  2214. int rn = ((given >> 16) & 0xf);
  2215. int rm = ((given >> 0) & 0xf);
  2216. int align = ((given >> 4) & 0x1);
  2217. int size = ((given >> 6) & 0x3);
  2218. int type = ((given >> 8) & 0x3);
  2219. int n = type + 1;
  2220. int stride = ((given >> 5) & 0x1);
  2221. int ix;
  2222. if (stride && (n == 1))
  2223. n++;
  2224. else
  2225. stride++;
  2226. func (stream, "{");
  2227. if (stride > 1)
  2228. for (ix = 0; ix != n; ix++)
  2229. func (stream, "%sd%d[]", ix ? "," : "", rd + ix * stride);
  2230. else if (n == 1)
  2231. func (stream, "d%d[]", rd);
  2232. else
  2233. func (stream, "d%d[]-d%d[]", rd, rd + n - 1);
  2234. func (stream, "}, [%s", arm_regnames[rn]);
  2235. if (align)
  2236. {
  2237. int align = (8 * (type + 1)) << size;
  2238. if (type == 3)
  2239. align = (size > 1) ? align >> 1 : align;
  2240. if (type == 2 || (type == 0 && !size))
  2241. func (stream, ", :<bad align %d>", align);
  2242. else
  2243. func (stream, ", :%d", align);
  2244. }
  2245. func (stream, "]");
  2246. if (rm == 0xd)
  2247. func (stream, "!");
  2248. else if (rm != 0xf)
  2249. func (stream, ", %s", arm_regnames[rm]);
  2250. }
  2251. break;
  2252. case 'D':
  2253. {
  2254. int raw_reg = (given & 0xf) | ((given >> 1) & 0x10);
  2255. int size = (given >> 20) & 3;
  2256. int reg = raw_reg & ((4 << size) - 1);
  2257. int ix = raw_reg >> size >> 2;
  2258. func (stream, "d%d[%d]", reg, ix);
  2259. }
  2260. break;
  2261. case 'E':
  2262. /* Neon encoded constant for mov, mvn, vorr, vbic */
  2263. {
  2264. int bits = 0;
  2265. int cmode = (given >> 8) & 0xf;
  2266. int op = (given >> 5) & 0x1;
  2267. unsigned long value = 0, hival = 0;
  2268. unsigned shift;
  2269. int size = 0;
  2270. int isfloat = 0;
  2271. bits |= ((given >> 24) & 1) << 7;
  2272. bits |= ((given >> 16) & 7) << 4;
  2273. bits |= ((given >> 0) & 15) << 0;
  2274. if (cmode < 8)
  2275. {
  2276. shift = (cmode >> 1) & 3;
  2277. value = (unsigned long)bits << (8 * shift);
  2278. size = 32;
  2279. }
  2280. else if (cmode < 12)
  2281. {
  2282. shift = (cmode >> 1) & 1;
  2283. value = (unsigned long)bits << (8 * shift);
  2284. size = 16;
  2285. }
  2286. else if (cmode < 14)
  2287. {
  2288. shift = (cmode & 1) + 1;
  2289. value = (unsigned long)bits << (8 * shift);
  2290. value |= (1ul << (8 * shift)) - 1;
  2291. size = 32;
  2292. }
  2293. else if (cmode == 14)
  2294. {
  2295. if (op)
  2296. {
  2297. /* bit replication into bytes */
  2298. int ix;
  2299. unsigned long mask;
  2300. value = 0;
  2301. hival = 0;
  2302. for (ix = 7; ix >= 0; ix--)
  2303. {
  2304. mask = ((bits >> ix) & 1) ? 0xff : 0;
  2305. if (ix <= 3)
  2306. value = (value << 8) | mask;
  2307. else
  2308. hival = (hival << 8) | mask;
  2309. }
  2310. size = 64;
  2311. }
  2312. else
  2313. {
  2314. /* byte replication */
  2315. value = (unsigned long)bits;
  2316. size = 8;
  2317. }
  2318. }
  2319. else if (!op)
  2320. {
  2321. /* floating point encoding */
  2322. int tmp;
  2323. value = (unsigned long)(bits & 0x7f) << 19;
  2324. value |= (unsigned long)(bits & 0x80) << 24;
  2325. tmp = bits & 0x40 ? 0x3c : 0x40;
  2326. value |= (unsigned long)tmp << 24;
  2327. size = 32;
  2328. isfloat = 1;
  2329. }
  2330. else
  2331. {
  2332. func (stream, "<illegal constant %.8x:%x:%x>",
  2333. bits, cmode, op);
  2334. size = 32;
  2335. break;
  2336. }
  2337. switch (size)
  2338. {
  2339. case 8:
  2340. func (stream, "#%ld\t; 0x%.2lx", value, value);
  2341. break;
  2342. case 16:
  2343. func (stream, "#%ld\t; 0x%.4lx", value, value);
  2344. break;
  2345. case 32:
  2346. if (isfloat)
  2347. {
  2348. unsigned char valbytes[4];
  2349. double fvalue;
  2350. /* Do this a byte at a time so we don't have to
  2351. worry about the host's endianness. */
  2352. valbytes[0] = value & 0xff;
  2353. valbytes[1] = (value >> 8) & 0xff;
  2354. valbytes[2] = (value >> 16) & 0xff;
  2355. valbytes[3] = (value >> 24) & 0xff;
  2356. floatformat_to_double
  2357. (&floatformat_ieee_single_little, valbytes,
  2358. &fvalue);
  2359. func (stream, "#%.7g\t; 0x%.8lx", fvalue,
  2360. value);
  2361. }
  2362. else
  2363. func (stream, "#%ld\t; 0x%.8lx",
  2364. (long) ((value & 0x80000000)
  2365. ? value | ~0xffffffffl : value), value);
  2366. break;
  2367. case 64:
  2368. func (stream, "#0x%.8lx%.8lx", hival, value);
  2369. break;
  2370. default:
  2371. abort ();
  2372. }
  2373. }
  2374. break;
  2375. case 'F':
  2376. {
  2377. int regno = ((given >> 16) & 0xf) | ((given >> (7 - 4)) & 0x10);
  2378. int num = (given >> 8) & 0x3;
  2379. if (!num)
  2380. func (stream, "{d%d}", regno);
  2381. else if (num + regno >= 32)
  2382. func (stream, "{d%d-<overflow reg d%d}", regno, regno + num);
  2383. else
  2384. func (stream, "{d%d-d%d}", regno, regno + num);
  2385. }
  2386. break;
  2387. case '0': case '1': case '2': case '3': case '4':
  2388. case '5': case '6': case '7': case '8': case '9':
  2389. {
  2390. int width;
  2391. unsigned long value;
  2392. c = arm_decode_bitfield (c, given, &value, &width);
  2393. switch (*c)
  2394. {
  2395. case 'r':
  2396. func (stream, "%s", arm_regnames[value]);
  2397. break;
  2398. case 'd':
  2399. func (stream, "%ld", value);
  2400. break;
  2401. case 'e':
  2402. func (stream, "%ld", (1ul << width) - value);
  2403. break;
  2404. case 'S':
  2405. case 'T':
  2406. case 'U':
  2407. /* various width encodings */
  2408. {
  2409. int base = 8 << (*c - 'S'); /* 8,16 or 32 */
  2410. int limit;
  2411. unsigned low, high;
  2412. c++;
  2413. if (*c >= '0' && *c <= '9')
  2414. limit = *c - '0';
  2415. else if (*c >= 'a' && *c <= 'f')
  2416. limit = *c - 'a' + 10;
  2417. else
  2418. abort ();
  2419. low = limit >> 2;
  2420. high = limit & 3;
  2421. if (value < low || value > high)
  2422. func (stream, "<illegal width %d>", base << value);
  2423. else
  2424. func (stream, "%d", base << value);
  2425. }
  2426. break;
  2427. case 'R':
  2428. if (given & (1 << 6))
  2429. goto Q;
  2430. /* FALLTHROUGH */
  2431. case 'D':
  2432. func (stream, "d%ld", value);
  2433. break;
  2434. case 'Q':
  2435. Q:
  2436. if (value & 1)
  2437. func (stream, "<illegal reg q%ld.5>", value >> 1);
  2438. else
  2439. func (stream, "q%ld", value >> 1);
  2440. break;
  2441. case '`':
  2442. c++;
  2443. if (value == 0)
  2444. func (stream, "%c", *c);
  2445. break;
  2446. case '\'':
  2447. c++;
  2448. if (value == ((1ul << width) - 1))
  2449. func (stream, "%c", *c);
  2450. break;
  2451. case '?':
  2452. func (stream, "%c", c[(1 << width) - (int)value]);
  2453. c += 1 << width;
  2454. break;
  2455. default:
  2456. abort ();
  2457. }
  2458. break;
  2459. default:
  2460. abort ();
  2461. }
  2462. }
  2463. }
  2464. else
  2465. func (stream, "%c", *c);
  2466. }
  2467. return TRUE;
  2468. }
  2469. }
  2470. return FALSE;
  2471. }
  2472. /* Print one ARM instruction from PC on INFO->STREAM. */
  2473. static void
  2474. print_insn_arm_internal (bfd_vma pc, struct disassemble_info *info, long given)
  2475. {
  2476. const struct opcode32 *insn;
  2477. void *stream = info->stream;
  2478. fprintf_ftype func = info->fprintf_func;
  2479. if (print_insn_coprocessor (pc, info, given, FALSE))
  2480. return;
  2481. if (print_insn_neon (info, given, FALSE))
  2482. return;
  2483. for (insn = arm_opcodes; insn->assembler; insn++)
  2484. {
  2485. if (insn->value == FIRST_IWMMXT_INSN
  2486. && info->mach != bfd_mach_arm_XScale
  2487. && info->mach != bfd_mach_arm_iWMMXt)
  2488. insn = insn + IWMMXT_INSN_COUNT;
  2489. if ((given & insn->mask) == insn->value
  2490. /* Special case: an instruction with all bits set in the condition field
  2491. (0xFnnn_nnnn) is only matched if all those bits are set in insn->mask,
  2492. or by the catchall at the end of the table. */
  2493. && ((given & 0xF0000000) != 0xF0000000
  2494. || (insn->mask & 0xF0000000) == 0xF0000000
  2495. || (insn->mask == 0 && insn->value == 0)))
  2496. {
  2497. const char *c;
  2498. for (c = insn->assembler; *c; c++)
  2499. {
  2500. if (*c == '%')
  2501. {
  2502. switch (*++c)
  2503. {
  2504. case '%':
  2505. func (stream, "%%");
  2506. break;
  2507. case 'a':
  2508. print_arm_address (pc, info, given);
  2509. break;
  2510. case 'P':
  2511. /* Set P address bit and use normal address
  2512. printing routine. */
  2513. print_arm_address (pc, info, given | (1 << 24));
  2514. break;
  2515. case 's':
  2516. if ((given & 0x004f0000) == 0x004f0000)
  2517. {
  2518. /* PC relative with immediate offset. */
  2519. int offset = ((given & 0xf00) >> 4) | (given & 0xf);
  2520. if ((given & 0x00800000) == 0)
  2521. offset = -offset;
  2522. func (stream, "[pc, #%d]\t; ", offset);
  2523. info->print_address_func (offset + pc + 8, info);
  2524. }
  2525. else
  2526. {
  2527. func (stream, "[%s",
  2528. arm_regnames[(given >> 16) & 0xf]);
  2529. if ((given & 0x01000000) != 0)
  2530. {
  2531. /* Pre-indexed. */
  2532. if ((given & 0x00400000) == 0x00400000)
  2533. {
  2534. /* Immediate. */
  2535. int offset = ((given & 0xf00) >> 4) | (given & 0xf);
  2536. if (offset)
  2537. func (stream, ", #%s%d",
  2538. (((given & 0x00800000) == 0)
  2539. ? "-" : ""), offset);
  2540. }
  2541. else
  2542. {
  2543. /* Register. */
  2544. func (stream, ", %s%s",
  2545. (((given & 0x00800000) == 0)
  2546. ? "-" : ""),
  2547. arm_regnames[given & 0xf]);
  2548. }
  2549. func (stream, "]%s",
  2550. ((given & 0x00200000) != 0) ? "!" : "");
  2551. }
  2552. else
  2553. {
  2554. /* Post-indexed. */
  2555. if ((given & 0x00400000) == 0x00400000)
  2556. {
  2557. /* Immediate. */
  2558. int offset = ((given & 0xf00) >> 4) | (given & 0xf);
  2559. if (offset)
  2560. func (stream, "], #%s%d",
  2561. (((given & 0x00800000) == 0)
  2562. ? "-" : ""), offset);
  2563. else
  2564. func (stream, "]");
  2565. }
  2566. else
  2567. {
  2568. /* Register. */
  2569. func (stream, "], %s%s",
  2570. (((given & 0x00800000) == 0)
  2571. ? "-" : ""),
  2572. arm_regnames[given & 0xf]);
  2573. }
  2574. }
  2575. }
  2576. break;
  2577. case 'b':
  2578. {
  2579. int disp = (((given & 0xffffff) ^ 0x800000) - 0x800000);
  2580. info->print_address_func (disp*4 + pc + 8, info);
  2581. }
  2582. break;
  2583. case 'c':
  2584. if (((given >> 28) & 0xf) != 0xe)
  2585. func (stream, "%s",
  2586. arm_conditional [(given >> 28) & 0xf]);
  2587. break;
  2588. case 'm':
  2589. {
  2590. int started = 0;
  2591. int reg;
  2592. func (stream, "{");
  2593. for (reg = 0; reg < 16; reg++)
  2594. if ((given & (1 << reg)) != 0)
  2595. {
  2596. if (started)
  2597. func (stream, ", ");
  2598. started = 1;
  2599. func (stream, "%s", arm_regnames[reg]);
  2600. }
  2601. func (stream, "}");
  2602. }
  2603. break;
  2604. case 'q':
  2605. arm_decode_shift (given, func, stream, 0);
  2606. break;
  2607. case 'o':
  2608. if ((given & 0x02000000) != 0)
  2609. {
  2610. int rotate = (given & 0xf00) >> 7;
  2611. int immed = (given & 0xff);
  2612. immed = (((immed << (32 - rotate))
  2613. | (immed >> rotate)) & 0xffffffff);
  2614. func (stream, "#%d\t; 0x%x", immed, immed);
  2615. }
  2616. else
  2617. arm_decode_shift (given, func, stream, 1);
  2618. break;
  2619. case 'p':
  2620. if ((given & 0x0000f000) == 0x0000f000)
  2621. func (stream, "p");
  2622. break;
  2623. case 't':
  2624. if ((given & 0x01200000) == 0x00200000)
  2625. func (stream, "t");
  2626. break;
  2627. case 'A':
  2628. func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
  2629. if ((given & (1 << 24)) != 0)
  2630. {
  2631. int offset = given & 0xff;
  2632. if (offset)
  2633. func (stream, ", #%s%d]%s",
  2634. ((given & 0x00800000) == 0 ? "-" : ""),
  2635. offset * 4,
  2636. ((given & 0x00200000) != 0 ? "!" : ""));
  2637. else
  2638. func (stream, "]");
  2639. }
  2640. else
  2641. {
  2642. int offset = given & 0xff;
  2643. func (stream, "]");
  2644. if (given & (1 << 21))
  2645. {
  2646. if (offset)
  2647. func (stream, ", #%s%d",
  2648. ((given & 0x00800000) == 0 ? "-" : ""),
  2649. offset * 4);
  2650. }
  2651. else
  2652. func (stream, ", {%d}", offset);
  2653. }
  2654. break;
  2655. case 'B':
  2656. /* Print ARM V5 BLX(1) address: pc+25 bits. */
  2657. {
  2658. bfd_vma address;
  2659. bfd_vma offset = 0;
  2660. if (given & 0x00800000)
  2661. /* Is signed, hi bits should be ones. */
  2662. offset = (-1) ^ 0x00ffffff;
  2663. /* Offset is (SignExtend(offset field)<<2). */
  2664. offset += given & 0x00ffffff;
  2665. offset <<= 2;
  2666. address = offset + pc + 8;
  2667. if (given & 0x01000000)
  2668. /* H bit allows addressing to 2-byte boundaries. */
  2669. address += 2;
  2670. info->print_address_func (address, info);
  2671. }
  2672. break;
  2673. case 'C':
  2674. func (stream, "_");
  2675. if (given & 0x80000)
  2676. func (stream, "f");
  2677. if (given & 0x40000)
  2678. func (stream, "s");
  2679. if (given & 0x20000)
  2680. func (stream, "x");
  2681. if (given & 0x10000)
  2682. func (stream, "c");
  2683. break;
  2684. case 'U':
  2685. switch (given & 0xf)
  2686. {
  2687. case 0xf: func(stream, "sy"); break;
  2688. case 0x7: func(stream, "un"); break;
  2689. case 0xe: func(stream, "st"); break;
  2690. case 0x6: func(stream, "unst"); break;
  2691. default:
  2692. func(stream, "#%d", (int)given & 0xf);
  2693. break;
  2694. }
  2695. break;
  2696. case '0': case '1': case '2': case '3': case '4':
  2697. case '5': case '6': case '7': case '8': case '9':
  2698. {
  2699. int width;
  2700. unsigned long value;
  2701. c = arm_decode_bitfield (c, given, &value, &width);
  2702. switch (*c)
  2703. {
  2704. case 'r':
  2705. func (stream, "%s", arm_regnames[value]);
  2706. break;
  2707. case 'd':
  2708. func (stream, "%ld", value);
  2709. break;
  2710. case 'b':
  2711. func (stream, "%ld", value * 8);
  2712. break;
  2713. case 'W':
  2714. func (stream, "%ld", value + 1);
  2715. break;
  2716. case 'x':
  2717. func (stream, "0x%08lx", value);
  2718. /* Some SWI instructions have special
  2719. meanings. */
  2720. if ((given & 0x0fffffff) == 0x0FF00000)
  2721. func (stream, "\t; IMB");
  2722. else if ((given & 0x0fffffff) == 0x0FF00001)
  2723. func (stream, "\t; IMBRange");
  2724. break;
  2725. case 'X':
  2726. func (stream, "%01lx", value & 0xf);
  2727. break;
  2728. case '`':
  2729. c++;
  2730. if (value == 0)
  2731. func (stream, "%c", *c);
  2732. break;
  2733. case '\'':
  2734. c++;
  2735. if (value == ((1ul << width) - 1))
  2736. func (stream, "%c", *c);
  2737. break;
  2738. case '?':
  2739. func (stream, "%c", c[(1 << width) - (int)value]);
  2740. c += 1 << width;
  2741. break;
  2742. default:
  2743. abort ();
  2744. }
  2745. break;
  2746. case 'e':
  2747. {
  2748. int imm;
  2749. imm = (given & 0xf) | ((given & 0xfff00) >> 4);
  2750. func (stream, "%d", imm);
  2751. }
  2752. break;
  2753. case 'E':
  2754. /* LSB and WIDTH fields of BFI or BFC. The machine-
  2755. language instruction encodes LSB and MSB. */
  2756. {
  2757. long msb = (given & 0x001f0000) >> 16;
  2758. long lsb = (given & 0x00000f80) >> 7;
  2759. long width = msb - lsb + 1;
  2760. if (width > 0)
  2761. func (stream, "#%lu, #%lu", lsb, width);
  2762. else
  2763. func (stream, "(invalid: %lu:%lu)", lsb, msb);
  2764. }
  2765. break;
  2766. case 'V':
  2767. /* 16-bit unsigned immediate from a MOVT or MOVW
  2768. instruction, encoded in bits 0:11 and 15:19. */
  2769. {
  2770. long hi = (given & 0x000f0000) >> 4;
  2771. long lo = (given & 0x00000fff);
  2772. long imm16 = hi | lo;
  2773. func (stream, "#%lu\t; 0x%lx", imm16, imm16);
  2774. }
  2775. break;
  2776. default:
  2777. abort ();
  2778. }
  2779. }
  2780. }
  2781. else
  2782. func (stream, "%c", *c);
  2783. }
  2784. return;
  2785. }
  2786. }
  2787. abort ();
  2788. }
  2789. /* Print one 16-bit Thumb instruction from PC on INFO->STREAM. */
  2790. static void
  2791. print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
  2792. {
  2793. const struct opcode16 *insn;
  2794. void *stream = info->stream;
  2795. fprintf_ftype func = info->fprintf_func;
  2796. for (insn = thumb_opcodes; insn->assembler; insn++)
  2797. if ((given & insn->mask) == insn->value)
  2798. {
  2799. const char *c = insn->assembler;
  2800. for (; *c; c++)
  2801. {
  2802. int domaskpc = 0;
  2803. int domasklr = 0;
  2804. if (*c != '%')
  2805. {
  2806. func (stream, "%c", *c);
  2807. continue;
  2808. }
  2809. switch (*++c)
  2810. {
  2811. case '%':
  2812. func (stream, "%%");
  2813. break;
  2814. case 'c':
  2815. if (ifthen_state)
  2816. func (stream, "%s", arm_conditional[IFTHEN_COND]);
  2817. break;
  2818. case 'C':
  2819. if (ifthen_state)
  2820. func (stream, "%s", arm_conditional[IFTHEN_COND]);
  2821. else
  2822. func (stream, "s");
  2823. break;
  2824. case 'I':
  2825. {
  2826. unsigned int tmp;
  2827. ifthen_next_state = given & 0xff;
  2828. for (tmp = given << 1; tmp & 0xf; tmp <<= 1)
  2829. func (stream, ((given ^ tmp) & 0x10) ? "e" : "t");
  2830. func (stream, "\t%s", arm_conditional[(given >> 4) & 0xf]);
  2831. }
  2832. break;
  2833. case 'x':
  2834. if (ifthen_next_state)
  2835. func (stream, "\t; unpredictable branch in IT block\n");
  2836. break;
  2837. case 'X':
  2838. if (ifthen_state)
  2839. func (stream, "\t; unpredictable <IT:%s>",
  2840. arm_conditional[IFTHEN_COND]);
  2841. break;
  2842. case 'S':
  2843. {
  2844. long reg;
  2845. reg = (given >> 3) & 0x7;
  2846. if (given & (1 << 6))
  2847. reg += 8;
  2848. func (stream, "%s", arm_regnames[reg]);
  2849. }
  2850. break;
  2851. case 'D':
  2852. {
  2853. long reg;
  2854. reg = given & 0x7;
  2855. if (given & (1 << 7))
  2856. reg += 8;
  2857. func (stream, "%s", arm_regnames[reg]);
  2858. }
  2859. break;
  2860. case 'N':
  2861. if (given & (1 << 8))
  2862. domasklr = 1;
  2863. /* Fall through. */
  2864. case 'O':
  2865. if (*c == 'O' && (given & (1 << 8)))
  2866. domaskpc = 1;
  2867. /* Fall through. */
  2868. case 'M':
  2869. {
  2870. int started = 0;
  2871. int reg;
  2872. func (stream, "{");
  2873. /* It would be nice if we could spot
  2874. ranges, and generate the rS-rE format: */
  2875. for (reg = 0; (reg < 8); reg++)
  2876. if ((given & (1 << reg)) != 0)
  2877. {
  2878. if (started)
  2879. func (stream, ", ");
  2880. started = 1;
  2881. func (stream, "%s", arm_regnames[reg]);
  2882. }
  2883. if (domasklr)
  2884. {
  2885. if (started)
  2886. func (stream, ", ");
  2887. started = 1;
  2888. func (stream, arm_regnames[14] /* "lr" */);
  2889. }
  2890. if (domaskpc)
  2891. {
  2892. if (started)
  2893. func (stream, ", ");
  2894. func (stream, arm_regnames[15] /* "pc" */);
  2895. }
  2896. func (stream, "}");
  2897. }
  2898. break;
  2899. case 'b':
  2900. /* Print ARM V6T2 CZB address: pc+4+6 bits. */
  2901. {
  2902. bfd_vma address = (pc + 4
  2903. + ((given & 0x00f8) >> 2)
  2904. + ((given & 0x0200) >> 3));
  2905. info->print_address_func (address, info);
  2906. }
  2907. break;
  2908. case 's':
  2909. /* Right shift immediate -- bits 6..10; 1-31 print
  2910. as themselves, 0 prints as 32. */
  2911. {
  2912. long imm = (given & 0x07c0) >> 6;
  2913. if (imm == 0)
  2914. imm = 32;
  2915. func (stream, "#%ld", imm);
  2916. }
  2917. break;
  2918. case '0': case '1': case '2': case '3': case '4':
  2919. case '5': case '6': case '7': case '8': case '9':
  2920. {
  2921. int bitstart = *c++ - '0';
  2922. int bitend = 0;
  2923. while (*c >= '0' && *c <= '9')
  2924. bitstart = (bitstart * 10) + *c++ - '0';
  2925. switch (*c)
  2926. {
  2927. case '-':
  2928. {
  2929. long reg;
  2930. c++;
  2931. while (*c >= '0' && *c <= '9')
  2932. bitend = (bitend * 10) + *c++ - '0';
  2933. if (!bitend)
  2934. abort ();
  2935. reg = given >> bitstart;
  2936. reg &= (2 << (bitend - bitstart)) - 1;
  2937. switch (*c)
  2938. {
  2939. case 'r':
  2940. func (stream, "%s", arm_regnames[reg]);
  2941. break;
  2942. case 'd':
  2943. func (stream, "%ld", reg);
  2944. break;
  2945. case 'H':
  2946. func (stream, "%ld", reg << 1);
  2947. break;
  2948. case 'W':
  2949. func (stream, "%ld", reg << 2);
  2950. break;
  2951. case 'a':
  2952. /* PC-relative address -- the bottom two
  2953. bits of the address are dropped
  2954. before the calculation. */
  2955. info->print_address_func
  2956. (((pc + 4) & ~3) + (reg << 2), info);
  2957. break;
  2958. case 'x':
  2959. func (stream, "0x%04lx", reg);
  2960. break;
  2961. case 'B':
  2962. reg = ((reg ^ (1 << bitend)) - (1 << bitend));
  2963. info->print_address_func (reg * 2 + pc + 4, info);
  2964. break;
  2965. case 'c':
  2966. func (stream, "%s", arm_conditional [reg]);
  2967. break;
  2968. default:
  2969. abort ();
  2970. }
  2971. }
  2972. break;
  2973. case '\'':
  2974. c++;
  2975. if ((given & (1 << bitstart)) != 0)
  2976. func (stream, "%c", *c);
  2977. break;
  2978. case '?':
  2979. ++c;
  2980. if ((given & (1 << bitstart)) != 0)
  2981. func (stream, "%c", *c++);
  2982. else
  2983. func (stream, "%c", *++c);
  2984. break;
  2985. default:
  2986. abort ();
  2987. }
  2988. }
  2989. break;
  2990. default:
  2991. abort ();
  2992. }
  2993. }
  2994. return;
  2995. }
  2996. /* No match. */
  2997. abort ();
  2998. }
  2999. /* Return the name of an V7M special register. */
  3000. static const char *
  3001. psr_name (int regno)
  3002. {
  3003. switch (regno)
  3004. {
  3005. case 0: return "APSR";
  3006. case 1: return "IAPSR";
  3007. case 2: return "EAPSR";
  3008. case 3: return "PSR";
  3009. case 5: return "IPSR";
  3010. case 6: return "EPSR";
  3011. case 7: return "IEPSR";
  3012. case 8: return "MSP";
  3013. case 9: return "PSP";
  3014. case 16: return "PRIMASK";
  3015. case 17: return "BASEPRI";
  3016. case 18: return "BASEPRI_MASK";
  3017. case 19: return "FAULTMASK";
  3018. case 20: return "CONTROL";
  3019. default: return "<unknown>";
  3020. }
  3021. }
  3022. /* Print one 32-bit Thumb instruction from PC on INFO->STREAM. */
  3023. static void
  3024. print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
  3025. {
  3026. const struct opcode32 *insn;
  3027. void *stream = info->stream;
  3028. fprintf_ftype func = info->fprintf_func;
  3029. if (print_insn_coprocessor (pc, info, given, TRUE))
  3030. return;
  3031. if (print_insn_neon (info, given, TRUE))
  3032. return;
  3033. for (insn = thumb32_opcodes; insn->assembler; insn++)
  3034. if ((given & insn->mask) == insn->value)
  3035. {
  3036. const char *c = insn->assembler;
  3037. for (; *c; c++)
  3038. {
  3039. if (*c != '%')
  3040. {
  3041. func (stream, "%c", *c);
  3042. continue;
  3043. }
  3044. switch (*++c)
  3045. {
  3046. case '%':
  3047. func (stream, "%%");
  3048. break;
  3049. case 'c':
  3050. if (ifthen_state)
  3051. func (stream, "%s", arm_conditional[IFTHEN_COND]);
  3052. break;
  3053. case 'x':
  3054. if (ifthen_next_state)
  3055. func (stream, "\t; unpredictable branch in IT block\n");
  3056. break;
  3057. case 'X':
  3058. if (ifthen_state)
  3059. func (stream, "\t; unpredictable <IT:%s>",
  3060. arm_conditional[IFTHEN_COND]);
  3061. break;
  3062. case 'I':
  3063. {
  3064. unsigned int imm12 = 0;
  3065. imm12 |= (given & 0x000000ffu);
  3066. imm12 |= (given & 0x00007000u) >> 4;
  3067. imm12 |= (given & 0x04000000u) >> 15;
  3068. func (stream, "#%u\t; 0x%x", imm12, imm12);
  3069. }
  3070. break;
  3071. case 'M':
  3072. {
  3073. unsigned int bits = 0, imm, imm8, mod;
  3074. bits |= (given & 0x000000ffu);
  3075. bits |= (given & 0x00007000u) >> 4;
  3076. bits |= (given & 0x04000000u) >> 15;
  3077. imm8 = (bits & 0x0ff);
  3078. mod = (bits & 0xf00) >> 8;
  3079. switch (mod)
  3080. {
  3081. case 0: imm = imm8; break;
  3082. case 1: imm = ((imm8<<16) | imm8); break;
  3083. case 2: imm = ((imm8<<24) | (imm8 << 8)); break;
  3084. case 3: imm = ((imm8<<24) | (imm8 << 16) | (imm8 << 8) | imm8); break;
  3085. default:
  3086. mod = (bits & 0xf80) >> 7;
  3087. imm8 = (bits & 0x07f) | 0x80;
  3088. imm = (((imm8 << (32 - mod)) | (imm8 >> mod)) & 0xffffffff);
  3089. }
  3090. func (stream, "#%u\t; 0x%x", imm, imm);
  3091. }
  3092. break;
  3093. case 'J':
  3094. {
  3095. unsigned int imm = 0;
  3096. imm |= (given & 0x000000ffu);
  3097. imm |= (given & 0x00007000u) >> 4;
  3098. imm |= (given & 0x04000000u) >> 15;
  3099. imm |= (given & 0x000f0000u) >> 4;
  3100. func (stream, "#%u\t; 0x%x", imm, imm);
  3101. }
  3102. break;
  3103. case 'K':
  3104. {
  3105. unsigned int imm = 0;
  3106. imm |= (given & 0x000f0000u) >> 16;
  3107. imm |= (given & 0x00000ff0u) >> 0;
  3108. imm |= (given & 0x0000000fu) << 12;
  3109. func (stream, "#%u\t; 0x%x", imm, imm);
  3110. }
  3111. break;
  3112. case 'S':
  3113. {
  3114. unsigned int reg = (given & 0x0000000fu);
  3115. unsigned int stp = (given & 0x00000030u) >> 4;
  3116. unsigned int imm = 0;
  3117. imm |= (given & 0x000000c0u) >> 6;
  3118. imm |= (given & 0x00007000u) >> 10;
  3119. func (stream, "%s", arm_regnames[reg]);
  3120. switch (stp)
  3121. {
  3122. case 0:
  3123. if (imm > 0)
  3124. func (stream, ", lsl #%u", imm);
  3125. break;
  3126. case 1:
  3127. if (imm == 0)
  3128. imm = 32;
  3129. func (stream, ", lsr #%u", imm);
  3130. break;
  3131. case 2:
  3132. if (imm == 0)
  3133. imm = 32;
  3134. func (stream, ", asr #%u", imm);
  3135. break;
  3136. case 3:
  3137. if (imm == 0)
  3138. func (stream, ", rrx");
  3139. else
  3140. func (stream, ", ror #%u", imm);
  3141. }
  3142. }
  3143. break;
  3144. case 'a':
  3145. {
  3146. unsigned int Rn = (given & 0x000f0000) >> 16;
  3147. unsigned int U = (given & 0x00800000) >> 23;
  3148. unsigned int op = (given & 0x00000f00) >> 8;
  3149. unsigned int i12 = (given & 0x00000fff);
  3150. unsigned int i8 = (given & 0x000000ff);
  3151. bfd_boolean writeback = FALSE, postind = FALSE;
  3152. int offset = 0;
  3153. func (stream, "[%s", arm_regnames[Rn]);
  3154. if (U) /* 12-bit positive immediate offset */
  3155. offset = i12;
  3156. else if (Rn == 15) /* 12-bit negative immediate offset */
  3157. offset = -(int)i12;
  3158. else if (op == 0x0) /* shifted register offset */
  3159. {
  3160. unsigned int Rm = (i8 & 0x0f);
  3161. unsigned int sh = (i8 & 0x30) >> 4;
  3162. func (stream, ", %s", arm_regnames[Rm]);
  3163. if (sh)
  3164. func (stream, ", lsl #%u", sh);
  3165. func (stream, "]");
  3166. break;
  3167. }
  3168. else switch (op)
  3169. {
  3170. case 0xE: /* 8-bit positive immediate offset */
  3171. offset = i8;
  3172. break;
  3173. case 0xC: /* 8-bit negative immediate offset */
  3174. offset = -i8;
  3175. break;
  3176. case 0xF: /* 8-bit + preindex with wb */
  3177. offset = i8;
  3178. writeback = TRUE;
  3179. break;
  3180. case 0xD: /* 8-bit - preindex with wb */
  3181. offset = -i8;
  3182. writeback = TRUE;
  3183. break;
  3184. case 0xB: /* 8-bit + postindex */
  3185. offset = i8;
  3186. postind = TRUE;
  3187. break;
  3188. case 0x9: /* 8-bit - postindex */
  3189. offset = -i8;
  3190. postind = TRUE;
  3191. break;
  3192. default:
  3193. func (stream, ", <undefined>]");
  3194. goto skip;
  3195. }
  3196. if (postind)
  3197. func (stream, "], #%d", offset);
  3198. else
  3199. {
  3200. if (offset)
  3201. func (stream, ", #%d", offset);
  3202. func (stream, writeback ? "]!" : "]");
  3203. }
  3204. if (Rn == 15)
  3205. {
  3206. func (stream, "\t; ");
  3207. info->print_address_func (((pc + 4) & ~3) + offset, info);
  3208. }
  3209. }
  3210. skip:
  3211. break;
  3212. case 'A':
  3213. {
  3214. unsigned int P = (given & 0x01000000) >> 24;
  3215. unsigned int U = (given & 0x00800000) >> 23;
  3216. unsigned int W = (given & 0x00400000) >> 21;
  3217. unsigned int Rn = (given & 0x000f0000) >> 16;
  3218. unsigned int off = (given & 0x000000ff);
  3219. func (stream, "[%s", arm_regnames[Rn]);
  3220. if (P)
  3221. {
  3222. if (off || !U)
  3223. func (stream, ", #%c%u", U ? '+' : '-', off * 4);
  3224. func (stream, "]");
  3225. if (W)
  3226. func (stream, "!");
  3227. }
  3228. else
  3229. {
  3230. func (stream, "], ");
  3231. if (W)
  3232. func (stream, "#%c%u", U ? '+' : '-', off * 4);
  3233. else
  3234. func (stream, "{%u}", off);
  3235. }
  3236. }
  3237. break;
  3238. case 'w':
  3239. {
  3240. unsigned int Sbit = (given & 0x01000000) >> 24;
  3241. unsigned int type = (given & 0x00600000) >> 21;
  3242. switch (type)
  3243. {
  3244. case 0: func (stream, Sbit ? "sb" : "b"); break;
  3245. case 1: func (stream, Sbit ? "sh" : "h"); break;
  3246. case 2:
  3247. if (Sbit)
  3248. func (stream, "??");
  3249. break;
  3250. case 3:
  3251. func (stream, "??");
  3252. break;
  3253. }
  3254. }
  3255. break;
  3256. case 'm':
  3257. {
  3258. int started = 0;
  3259. int reg;
  3260. func (stream, "{");
  3261. for (reg = 0; reg < 16; reg++)
  3262. if ((given & (1 << reg)) != 0)
  3263. {
  3264. if (started)
  3265. func (stream, ", ");
  3266. started = 1;
  3267. func (stream, "%s", arm_regnames[reg]);
  3268. }
  3269. func (stream, "}");
  3270. }
  3271. break;
  3272. case 'E':
  3273. {
  3274. unsigned int msb = (given & 0x0000001f);
  3275. unsigned int lsb = 0;
  3276. lsb |= (given & 0x000000c0u) >> 6;
  3277. lsb |= (given & 0x00007000u) >> 10;
  3278. func (stream, "#%u, #%u", lsb, msb - lsb + 1);
  3279. }
  3280. break;
  3281. case 'F':
  3282. {
  3283. unsigned int width = (given & 0x0000001f) + 1;
  3284. unsigned int lsb = 0;
  3285. lsb |= (given & 0x000000c0u) >> 6;
  3286. lsb |= (given & 0x00007000u) >> 10;
  3287. func (stream, "#%u, #%u", lsb, width);
  3288. }
  3289. break;
  3290. case 'b':
  3291. {
  3292. unsigned int S = (given & 0x04000000u) >> 26;
  3293. unsigned int J1 = (given & 0x00002000u) >> 13;
  3294. unsigned int J2 = (given & 0x00000800u) >> 11;
  3295. int offset = 0;
  3296. offset |= !S << 20;
  3297. offset |= J2 << 19;
  3298. offset |= J1 << 18;
  3299. offset |= (given & 0x003f0000) >> 4;
  3300. offset |= (given & 0x000007ff) << 1;
  3301. offset -= (1 << 20);
  3302. info->print_address_func (pc + 4 + offset, info);
  3303. }
  3304. break;
  3305. case 'B':
  3306. {
  3307. unsigned int S = (given & 0x04000000u) >> 26;
  3308. unsigned int I1 = (given & 0x00002000u) >> 13;
  3309. unsigned int I2 = (given & 0x00000800u) >> 11;
  3310. int offset = 0;
  3311. offset |= !S << 24;
  3312. offset |= !(I1 ^ S) << 23;
  3313. offset |= !(I2 ^ S) << 22;
  3314. offset |= (given & 0x03ff0000u) >> 4;
  3315. offset |= (given & 0x000007ffu) << 1;
  3316. offset -= (1 << 24);
  3317. offset += pc + 4;
  3318. /* BLX target addresses are always word aligned. */
  3319. if ((given & 0x00001000u) == 0)
  3320. offset &= ~2u;
  3321. info->print_address_func (offset, info);
  3322. }
  3323. break;
  3324. case 's':
  3325. {
  3326. unsigned int shift = 0;
  3327. shift |= (given & 0x000000c0u) >> 6;
  3328. shift |= (given & 0x00007000u) >> 10;
  3329. if (given & 0x00200000u)
  3330. func (stream, ", asr #%u", shift);
  3331. else if (shift)
  3332. func (stream, ", lsl #%u", shift);
  3333. /* else print nothing - lsl #0 */
  3334. }
  3335. break;
  3336. case 'R':
  3337. {
  3338. unsigned int rot = (given & 0x00000030) >> 4;
  3339. if (rot)
  3340. func (stream, ", ror #%u", rot * 8);
  3341. }
  3342. break;
  3343. case 'U':
  3344. switch (given & 0xf)
  3345. {
  3346. case 0xf: func(stream, "sy"); break;
  3347. case 0x7: func(stream, "un"); break;
  3348. case 0xe: func(stream, "st"); break;
  3349. case 0x6: func(stream, "unst"); break;
  3350. default:
  3351. func(stream, "#%d", (int)given & 0xf);
  3352. break;
  3353. }
  3354. break;
  3355. case 'C':
  3356. if ((given & 0xff) == 0)
  3357. {
  3358. func (stream, "%cPSR_", (given & 0x100000) ? 'S' : 'C');
  3359. if (given & 0x800)
  3360. func (stream, "f");
  3361. if (given & 0x400)
  3362. func (stream, "s");
  3363. if (given & 0x200)
  3364. func (stream, "x");
  3365. if (given & 0x100)
  3366. func (stream, "c");
  3367. }
  3368. else
  3369. {
  3370. func (stream, psr_name (given & 0xff));
  3371. }
  3372. break;
  3373. case 'D':
  3374. if ((given & 0xff) == 0)
  3375. func (stream, "%cPSR", (given & 0x100000) ? 'S' : 'C');
  3376. else
  3377. func (stream, psr_name (given & 0xff));
  3378. break;
  3379. case '0': case '1': case '2': case '3': case '4':
  3380. case '5': case '6': case '7': case '8': case '9':
  3381. {
  3382. int width;
  3383. unsigned long val;
  3384. c = arm_decode_bitfield (c, given, &val, &width);
  3385. switch (*c)
  3386. {
  3387. case 'd': func (stream, "%lu", val); break;
  3388. case 'W': func (stream, "%lu", val * 4); break;
  3389. case 'r': func (stream, "%s", arm_regnames[val]); break;
  3390. case 'c':
  3391. func (stream, "%s", arm_conditional[val]);
  3392. break;
  3393. case '\'':
  3394. c++;
  3395. if (val == ((1ul << width) - 1))
  3396. func (stream, "%c", *c);
  3397. break;
  3398. case '`':
  3399. c++;
  3400. if (val == 0)
  3401. func (stream, "%c", *c);
  3402. break;
  3403. case '?':
  3404. func (stream, "%c", c[(1 << width) - (int)val]);
  3405. c += 1 << width;
  3406. break;
  3407. default:
  3408. abort ();
  3409. }
  3410. }
  3411. break;
  3412. default:
  3413. abort ();
  3414. }
  3415. }
  3416. return;
  3417. }
  3418. /* No match. */
  3419. abort ();
  3420. }
  3421. /* Print data bytes on INFO->STREAM. */
  3422. static void
  3423. print_insn_data (bfd_vma pc ATTRIBUTE_UNUSED, struct disassemble_info *info,
  3424. long given)
  3425. {
  3426. switch (info->bytes_per_chunk)
  3427. {
  3428. case 1:
  3429. info->fprintf_func (info->stream, ".byte\t0x%02lx", given);
  3430. break;
  3431. case 2:
  3432. info->fprintf_func (info->stream, ".short\t0x%04lx", given);
  3433. break;
  3434. case 4:
  3435. info->fprintf_func (info->stream, ".word\t0x%08lx", given);
  3436. break;
  3437. default:
  3438. abort ();
  3439. }
  3440. }
  3441. /* Search back through the insn stream to determine if this instruction is
  3442. conditionally executed. */
  3443. static void
  3444. find_ifthen_state (bfd_vma pc, struct disassemble_info *info,
  3445. bfd_boolean little)
  3446. {
  3447. unsigned char b[2];
  3448. unsigned int insn;
  3449. int status;
  3450. /* COUNT is twice the number of instructions seen. It will be odd if we
  3451. just crossed an instruction boundary. */
  3452. int count;
  3453. int it_count;
  3454. unsigned int seen_it;
  3455. bfd_vma addr;
  3456. ifthen_address = pc;
  3457. ifthen_state = 0;
  3458. addr = pc;
  3459. count = 1;
  3460. it_count = 0;
  3461. seen_it = 0;
  3462. /* Scan backwards looking for IT instructions, keeping track of where
  3463. instruction boundaries are. We don't know if something is actually an
  3464. IT instruction until we find a definite instruction boundary. */
  3465. for (;;)
  3466. {
  3467. if (addr == 0 || info->symbol_at_address_func(addr, info))
  3468. {
  3469. /* A symbol must be on an instruction boundary, and will not
  3470. be within an IT block. */
  3471. if (seen_it && (count & 1))
  3472. break;
  3473. return;
  3474. }
  3475. addr -= 2;
  3476. status = info->read_memory_func (addr, (bfd_byte *)b, 2, info);
  3477. if (status)
  3478. return;
  3479. if (little)
  3480. insn = (b[0]) | (b[1] << 8);
  3481. else
  3482. insn = (b[1]) | (b[0] << 8);
  3483. if (seen_it)
  3484. {
  3485. if ((insn & 0xf800) < 0xe800)
  3486. {
  3487. /* Addr + 2 is an instruction boundary. See if this matches
  3488. the expected boundary based on the position of the last
  3489. IT candidate. */
  3490. if (count & 1)
  3491. break;
  3492. seen_it = 0;
  3493. }
  3494. }
  3495. if ((insn & 0xff00) == 0xbf00 && (insn & 0xf) != 0)
  3496. {
  3497. /* This could be an IT instruction. */
  3498. seen_it = insn;
  3499. it_count = count >> 1;
  3500. }
  3501. if ((insn & 0xf800) >= 0xe800)
  3502. count++;
  3503. else
  3504. count = (count + 2) | 1;
  3505. /* IT blocks contain at most 4 instructions. */
  3506. if (count >= 8 && !seen_it)
  3507. return;
  3508. }
  3509. /* We found an IT instruction. */
  3510. ifthen_state = (seen_it & 0xe0) | ((seen_it << it_count) & 0x1f);
  3511. if ((ifthen_state & 0xf) == 0)
  3512. ifthen_state = 0;
  3513. }
  3514. /* NOTE: There are no checks in these routines that
  3515. the relevant number of data bytes exist. */
  3516. int
  3517. print_insn_arm (bfd_vma pc, struct disassemble_info *info)
  3518. {
  3519. unsigned char b[4];
  3520. long given;
  3521. int status;
  3522. int is_thumb = FALSE;
  3523. int is_data = FALSE;
  3524. unsigned int size = 4;
  3525. void (*printer) (bfd_vma, struct disassemble_info *, long);
  3526. #if 0
  3527. bfd_boolean found = FALSE;
  3528. if (info->disassembler_options)
  3529. {
  3530. parse_disassembler_options (info->disassembler_options);
  3531. /* To avoid repeated parsing of these options, we remove them here. */
  3532. info->disassembler_options = NULL;
  3533. }
  3534. /* First check the full symtab for a mapping symbol, even if there
  3535. are no usable non-mapping symbols for this address. */
  3536. if (info->symtab != NULL
  3537. && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
  3538. {
  3539. bfd_vma addr;
  3540. int n;
  3541. int last_sym = -1;
  3542. enum map_type type = MAP_ARM;
  3543. if (pc <= last_mapping_addr)
  3544. last_mapping_sym = -1;
  3545. is_thumb = (last_type == MAP_THUMB);
  3546. found = FALSE;
  3547. /* Start scanning at the start of the function, or wherever
  3548. we finished last time. */
  3549. n = info->symtab_pos + 1;
  3550. if (n < last_mapping_sym)
  3551. n = last_mapping_sym;
  3552. /* Scan up to the location being disassembled. */
  3553. for (; n < info->symtab_size; n++)
  3554. {
  3555. addr = bfd_asymbol_value (info->symtab[n]);
  3556. if (addr > pc)
  3557. break;
  3558. if ((info->section == NULL
  3559. || info->section == info->symtab[n]->section)
  3560. && get_sym_code_type (info, n, &type))
  3561. {
  3562. last_sym = n;
  3563. found = TRUE;
  3564. }
  3565. }
  3566. if (!found)
  3567. {
  3568. n = info->symtab_pos;
  3569. if (n < last_mapping_sym - 1)
  3570. n = last_mapping_sym - 1;
  3571. /* No mapping symbol found at this address. Look backwards
  3572. for a preceeding one. */
  3573. for (; n >= 0; n--)
  3574. {
  3575. if (get_sym_code_type (info, n, &type))
  3576. {
  3577. last_sym = n;
  3578. found = TRUE;
  3579. break;
  3580. }
  3581. }
  3582. }
  3583. last_mapping_sym = last_sym;
  3584. last_type = type;
  3585. is_thumb = (last_type == MAP_THUMB);
  3586. is_data = (last_type == MAP_DATA);
  3587. /* Look a little bit ahead to see if we should print out
  3588. two or four bytes of data. If there's a symbol,
  3589. mapping or otherwise, after two bytes then don't
  3590. print more. */
  3591. if (is_data)
  3592. {
  3593. size = 4 - (pc & 3);
  3594. for (n = last_sym + 1; n < info->symtab_size; n++)
  3595. {
  3596. addr = bfd_asymbol_value (info->symtab[n]);
  3597. if (addr > pc)
  3598. {
  3599. if (addr - pc < size)
  3600. size = addr - pc;
  3601. break;
  3602. }
  3603. }
  3604. /* If the next symbol is after three bytes, we need to
  3605. print only part of the data, so that we can use either
  3606. .byte or .short. */
  3607. if (size == 3)
  3608. size = (pc & 1) ? 1 : 2;
  3609. }
  3610. }
  3611. if (info->symbols != NULL)
  3612. {
  3613. if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
  3614. {
  3615. coff_symbol_type * cs;
  3616. cs = coffsymbol (*info->symbols);
  3617. is_thumb = ( cs->native->u.syment.n_sclass == C_THUMBEXT
  3618. || cs->native->u.syment.n_sclass == C_THUMBSTAT
  3619. || cs->native->u.syment.n_sclass == C_THUMBLABEL
  3620. || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
  3621. || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
  3622. }
  3623. else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
  3624. && !found)
  3625. {
  3626. /* If no mapping symbol has been found then fall back to the type
  3627. of the function symbol. */
  3628. elf_symbol_type * es;
  3629. unsigned int type;
  3630. es = *(elf_symbol_type **)(info->symbols);
  3631. type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
  3632. is_thumb = (type == STT_ARM_TFUNC) || (type == STT_ARM_16BIT);
  3633. }
  3634. }
  3635. #else
  3636. int little;
  3637. little = (info->endian == BFD_ENDIAN_LITTLE);
  3638. is_thumb |= (pc & 1);
  3639. pc &= ~(bfd_vma)1;
  3640. #endif
  3641. if (force_thumb)
  3642. is_thumb = TRUE;
  3643. info->bytes_per_line = 4;
  3644. if (is_data)
  3645. {
  3646. int i;
  3647. /* size was already set above. */
  3648. info->bytes_per_chunk = size;
  3649. printer = print_insn_data;
  3650. status = info->read_memory_func (pc, (bfd_byte *)b, size, info);
  3651. given = 0;
  3652. if (little)
  3653. for (i = size - 1; i >= 0; i--)
  3654. given = b[i] | (given << 8);
  3655. else
  3656. for (i = 0; i < (int) size; i++)
  3657. given = b[i] | (given << 8);
  3658. }
  3659. else if (!is_thumb)
  3660. {
  3661. /* In ARM mode endianness is a straightforward issue: the instruction
  3662. is four bytes long and is either ordered 0123 or 3210. */
  3663. printer = print_insn_arm_internal;
  3664. info->bytes_per_chunk = 4;
  3665. size = 4;
  3666. status = info->read_memory_func (pc, (bfd_byte *)b, 4, info);
  3667. if (little)
  3668. given = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24);
  3669. else
  3670. given = (b[3]) | (b[2] << 8) | (b[1] << 16) | (b[0] << 24);
  3671. }
  3672. else
  3673. {
  3674. /* In Thumb mode we have the additional wrinkle of two
  3675. instruction lengths. Fortunately, the bits that determine
  3676. the length of the current instruction are always to be found
  3677. in the first two bytes. */
  3678. printer = print_insn_thumb16;
  3679. info->bytes_per_chunk = 2;
  3680. size = 2;
  3681. status = info->read_memory_func (pc, (bfd_byte *)b, 2, info);
  3682. if (little)
  3683. given = (b[0]) | (b[1] << 8);
  3684. else
  3685. given = (b[1]) | (b[0] << 8);
  3686. if (!status)
  3687. {
  3688. /* These bit patterns signal a four-byte Thumb
  3689. instruction. */
  3690. if ((given & 0xF800) == 0xF800
  3691. || (given & 0xF800) == 0xF000
  3692. || (given & 0xF800) == 0xE800)
  3693. {
  3694. status = info->read_memory_func (pc + 2, (bfd_byte *)b, 2, info);
  3695. if (little)
  3696. given = (b[0]) | (b[1] << 8) | (given << 16);
  3697. else
  3698. given = (b[1]) | (b[0] << 8) | (given << 16);
  3699. printer = print_insn_thumb32;
  3700. size = 4;
  3701. }
  3702. }
  3703. if (ifthen_address != pc)
  3704. find_ifthen_state(pc, info, little);
  3705. if (ifthen_state)
  3706. {
  3707. if ((ifthen_state & 0xf) == 0x8)
  3708. ifthen_next_state = 0;
  3709. else
  3710. ifthen_next_state = (ifthen_state & 0xe0)
  3711. | ((ifthen_state & 0xf) << 1);
  3712. }
  3713. }
  3714. if (status)
  3715. {
  3716. info->memory_error_func (status, pc, info);
  3717. return -1;
  3718. }
  3719. if (info->flags & INSN_HAS_RELOC)
  3720. /* If the instruction has a reloc associated with it, then
  3721. the offset field in the instruction will actually be the
  3722. addend for the reloc. (We are using REL type relocs).
  3723. In such cases, we can ignore the pc when computing
  3724. addresses, since the addend is not currently pc-relative. */
  3725. pc = 0;
  3726. printer (pc, info, given);
  3727. if (is_thumb)
  3728. {
  3729. ifthen_state = ifthen_next_state;
  3730. ifthen_address += size;
  3731. }
  3732. return size;
  3733. }
  3734. void
  3735. print_arm_disassembler_options (FILE *stream)
  3736. {
  3737. int i;
  3738. fprintf (stream, _("\n\
  3739. The following ARM specific disassembler options are supported for use with\n\
  3740. the -M switch:\n"));
  3741. for (i = NUM_ARM_REGNAMES; i--;)
  3742. fprintf (stream, " reg-names-%s %*c%s\n",
  3743. regnames[i].name,
  3744. (int)(14 - strlen (regnames[i].name)), ' ',
  3745. regnames[i].description);
  3746. fprintf (stream, " force-thumb Assume all insns are Thumb insns\n");
  3747. fprintf (stream, " no-force-thumb Examine preceeding label to determine an insn's type\n\n");
  3748. }