mips-dis.c 207 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873
  1. /* Print mips instructions for GDB, the GNU debugger, or for objdump.
  2. Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
  3. 2000, 2001, 2002, 2003
  4. Free Software Foundation, Inc.
  5. Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp).
  6. This file is part of GDB, GAS, and the GNU binutils.
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  17. #include "dis-asm.h"
  18. /* mips.h. Mips opcode list for GDB, the GNU debugger.
  19. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
  20. Free Software Foundation, Inc.
  21. Contributed by Ralph Campbell and OSF
  22. Commented and modified by Ian Lance Taylor, Cygnus Support
  23. This file is part of GDB, GAS, and the GNU binutils.
  24. GDB, GAS, and the GNU binutils are free software; you can redistribute
  25. them and/or modify them under the terms of the GNU General Public
  26. License as published by the Free Software Foundation; either version
  27. 1, or (at your option) any later version.
  28. GDB, GAS, and the GNU binutils are distributed in the hope that they
  29. will be useful, but WITHOUT ANY WARRANTY; without even the implied
  30. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  31. the GNU General Public License for more details.
  32. You should have received a copy of the GNU General Public License
  33. along with this file; see the file COPYING. If not,
  34. see <http://www.gnu.org/licenses/>. */
  35. /* These are bit masks and shift counts to use to access the various
  36. fields of an instruction. To retrieve the X field of an
  37. instruction, use the expression
  38. (i >> OP_SH_X) & OP_MASK_X
  39. To set the same field (to j), use
  40. i = (i &~ (OP_MASK_X << OP_SH_X)) | (j << OP_SH_X)
  41. Make sure you use fields that are appropriate for the instruction,
  42. of course.
  43. The 'i' format uses OP, RS, RT and IMMEDIATE.
  44. The 'j' format uses OP and TARGET.
  45. The 'r' format uses OP, RS, RT, RD, SHAMT and FUNCT.
  46. The 'b' format uses OP, RS, RT and DELTA.
  47. The floating point 'i' format uses OP, RS, RT and IMMEDIATE.
  48. The floating point 'r' format uses OP, FMT, FT, FS, FD and FUNCT.
  49. A breakpoint instruction uses OP, CODE and SPEC (10 bits of the
  50. breakpoint instruction are not defined; Kane says the breakpoint
  51. code field in BREAK is 20 bits; yet MIPS assemblers and debuggers
  52. only use ten bits). An optional two-operand form of break/sdbbp
  53. allows the lower ten bits to be set too, and MIPS32 and later
  54. architectures allow 20 bits to be set with a signal operand
  55. (using CODE20).
  56. The syscall instruction uses CODE20.
  57. The general coprocessor instructions use COPZ. */
  58. #define OP_MASK_OP 0x3f
  59. #define OP_SH_OP 26
  60. #define OP_MASK_RS 0x1f
  61. #define OP_SH_RS 21
  62. #define OP_MASK_FR 0x1f
  63. #define OP_SH_FR 21
  64. #define OP_MASK_FMT 0x1f
  65. #define OP_SH_FMT 21
  66. #define OP_MASK_BCC 0x7
  67. #define OP_SH_BCC 18
  68. #define OP_MASK_CODE 0x3ff
  69. #define OP_SH_CODE 16
  70. #define OP_MASK_CODE2 0x3ff
  71. #define OP_SH_CODE2 6
  72. #define OP_MASK_RT 0x1f
  73. #define OP_SH_RT 16
  74. #define OP_MASK_FT 0x1f
  75. #define OP_SH_FT 16
  76. #define OP_MASK_CACHE 0x1f
  77. #define OP_SH_CACHE 16
  78. #define OP_MASK_RD 0x1f
  79. #define OP_SH_RD 11
  80. #define OP_MASK_FS 0x1f
  81. #define OP_SH_FS 11
  82. #define OP_MASK_PREFX 0x1f
  83. #define OP_SH_PREFX 11
  84. #define OP_MASK_CCC 0x7
  85. #define OP_SH_CCC 8
  86. #define OP_MASK_CODE20 0xfffff /* 20 bit syscall/breakpoint code. */
  87. #define OP_SH_CODE20 6
  88. #define OP_MASK_SHAMT 0x1f
  89. #define OP_SH_SHAMT 6
  90. #define OP_MASK_FD 0x1f
  91. #define OP_SH_FD 6
  92. #define OP_MASK_TARGET 0x3ffffff
  93. #define OP_SH_TARGET 0
  94. #define OP_MASK_COPZ 0x1ffffff
  95. #define OP_SH_COPZ 0
  96. #define OP_MASK_IMMEDIATE 0xffff
  97. #define OP_SH_IMMEDIATE 0
  98. #define OP_MASK_DELTA 0xffff
  99. #define OP_SH_DELTA 0
  100. #define OP_MASK_FUNCT 0x3f
  101. #define OP_SH_FUNCT 0
  102. #define OP_MASK_SPEC 0x3f
  103. #define OP_SH_SPEC 0
  104. #define OP_SH_LOCC 8 /* FP condition code. */
  105. #define OP_SH_HICC 18 /* FP condition code. */
  106. #define OP_MASK_CC 0x7
  107. #define OP_SH_COP1NORM 25 /* Normal COP1 encoding. */
  108. #define OP_MASK_COP1NORM 0x1 /* a single bit. */
  109. #define OP_SH_COP1SPEC 21 /* COP1 encodings. */
  110. #define OP_MASK_COP1SPEC 0xf
  111. #define OP_MASK_COP1SCLR 0x4
  112. #define OP_MASK_COP1CMP 0x3
  113. #define OP_SH_COP1CMP 4
  114. #define OP_SH_FORMAT 21 /* FP short format field. */
  115. #define OP_MASK_FORMAT 0x7
  116. #define OP_SH_TRUE 16
  117. #define OP_MASK_TRUE 0x1
  118. #define OP_SH_GE 17
  119. #define OP_MASK_GE 0x01
  120. #define OP_SH_UNSIGNED 16
  121. #define OP_MASK_UNSIGNED 0x1
  122. #define OP_SH_HINT 16
  123. #define OP_MASK_HINT 0x1f
  124. #define OP_SH_MMI 0 /* Multimedia (parallel) op. */
  125. #define OP_MASK_MMI 0x3f
  126. #define OP_SH_MMISUB 6
  127. #define OP_MASK_MMISUB 0x1f
  128. #define OP_MASK_PERFREG 0x1f /* Performance monitoring. */
  129. #define OP_SH_PERFREG 1
  130. #define OP_SH_SEL 0 /* Coprocessor select field. */
  131. #define OP_MASK_SEL 0x7 /* The sel field of mfcZ and mtcZ. */
  132. #define OP_SH_CODE19 6 /* 19 bit wait code. */
  133. #define OP_MASK_CODE19 0x7ffff
  134. #define OP_SH_ALN 21
  135. #define OP_MASK_ALN 0x7
  136. #define OP_SH_VSEL 21
  137. #define OP_MASK_VSEL 0x1f
  138. #define OP_MASK_VECBYTE 0x7 /* Selector field is really 4 bits,
  139. but 0x8-0xf don't select bytes. */
  140. #define OP_SH_VECBYTE 22
  141. #define OP_MASK_VECALIGN 0x7 /* Vector byte-align (alni.ob) op. */
  142. #define OP_SH_VECALIGN 21
  143. #define OP_MASK_INSMSB 0x1f /* "ins" MSB. */
  144. #define OP_SH_INSMSB 11
  145. #define OP_MASK_EXTMSBD 0x1f /* "ext" MSBD. */
  146. #define OP_SH_EXTMSBD 11
  147. #define OP_OP_COP0 0x10
  148. #define OP_OP_COP1 0x11
  149. #define OP_OP_COP2 0x12
  150. #define OP_OP_COP3 0x13
  151. #define OP_OP_LWC1 0x31
  152. #define OP_OP_LWC2 0x32
  153. #define OP_OP_LWC3 0x33 /* a.k.a. pref */
  154. #define OP_OP_LDC1 0x35
  155. #define OP_OP_LDC2 0x36
  156. #define OP_OP_LDC3 0x37 /* a.k.a. ld */
  157. #define OP_OP_SWC1 0x39
  158. #define OP_OP_SWC2 0x3a
  159. #define OP_OP_SWC3 0x3b
  160. #define OP_OP_SDC1 0x3d
  161. #define OP_OP_SDC2 0x3e
  162. #define OP_OP_SDC3 0x3f /* a.k.a. sd */
  163. /* MIPS DSP ASE */
  164. #define OP_SH_DSPACC 11
  165. #define OP_MASK_DSPACC 0x3
  166. #define OP_SH_DSPACC_S 21
  167. #define OP_MASK_DSPACC_S 0x3
  168. #define OP_SH_DSPSFT 20
  169. #define OP_MASK_DSPSFT 0x3f
  170. #define OP_SH_DSPSFT_7 19
  171. #define OP_MASK_DSPSFT_7 0x7f
  172. #define OP_SH_SA3 21
  173. #define OP_MASK_SA3 0x7
  174. #define OP_SH_SA4 21
  175. #define OP_MASK_SA4 0xf
  176. #define OP_SH_IMM8 16
  177. #define OP_MASK_IMM8 0xff
  178. #define OP_SH_IMM10 16
  179. #define OP_MASK_IMM10 0x3ff
  180. #define OP_SH_WRDSP 11
  181. #define OP_MASK_WRDSP 0x3f
  182. #define OP_SH_RDDSP 16
  183. #define OP_MASK_RDDSP 0x3f
  184. #define OP_SH_BP 11
  185. #define OP_MASK_BP 0x3
  186. /* MIPS MT ASE */
  187. #define OP_SH_MT_U 5
  188. #define OP_MASK_MT_U 0x1
  189. #define OP_SH_MT_H 4
  190. #define OP_MASK_MT_H 0x1
  191. #define OP_SH_MTACC_T 18
  192. #define OP_MASK_MTACC_T 0x3
  193. #define OP_SH_MTACC_D 13
  194. #define OP_MASK_MTACC_D 0x3
  195. #define OP_OP_COP0 0x10
  196. #define OP_OP_COP1 0x11
  197. #define OP_OP_COP2 0x12
  198. #define OP_OP_COP3 0x13
  199. #define OP_OP_LWC1 0x31
  200. #define OP_OP_LWC2 0x32
  201. #define OP_OP_LWC3 0x33 /* a.k.a. pref */
  202. #define OP_OP_LDC1 0x35
  203. #define OP_OP_LDC2 0x36
  204. #define OP_OP_LDC3 0x37 /* a.k.a. ld */
  205. #define OP_OP_SWC1 0x39
  206. #define OP_OP_SWC2 0x3a
  207. #define OP_OP_SWC3 0x3b
  208. #define OP_OP_SDC1 0x3d
  209. #define OP_OP_SDC2 0x3e
  210. #define OP_OP_SDC3 0x3f /* a.k.a. sd */
  211. /* Values in the 'VSEL' field. */
  212. #define MDMX_FMTSEL_IMM_QH 0x1d
  213. #define MDMX_FMTSEL_IMM_OB 0x1e
  214. #define MDMX_FMTSEL_VEC_QH 0x15
  215. #define MDMX_FMTSEL_VEC_OB 0x16
  216. /* UDI */
  217. #define OP_SH_UDI1 6
  218. #define OP_MASK_UDI1 0x1f
  219. #define OP_SH_UDI2 6
  220. #define OP_MASK_UDI2 0x3ff
  221. #define OP_SH_UDI3 6
  222. #define OP_MASK_UDI3 0x7fff
  223. #define OP_SH_UDI4 6
  224. #define OP_MASK_UDI4 0xfffff
  225. /* This structure holds information for a particular instruction. */
  226. struct mips_opcode
  227. {
  228. /* The name of the instruction. */
  229. const char *name;
  230. /* A string describing the arguments for this instruction. */
  231. const char *args;
  232. /* The basic opcode for the instruction. When assembling, this
  233. opcode is modified by the arguments to produce the actual opcode
  234. that is used. If pinfo is INSN_MACRO, then this is 0. */
  235. unsigned long match;
  236. /* If pinfo is not INSN_MACRO, then this is a bit mask for the
  237. relevant portions of the opcode when disassembling. If the
  238. actual opcode anded with the match field equals the opcode field,
  239. then we have found the correct instruction. If pinfo is
  240. INSN_MACRO, then this field is the macro identifier. */
  241. unsigned long mask;
  242. /* For a macro, this is INSN_MACRO. Otherwise, it is a collection
  243. of bits describing the instruction, notably any relevant hazard
  244. information. */
  245. unsigned long pinfo;
  246. /* A collection of additional bits describing the instruction. */
  247. unsigned long pinfo2;
  248. /* A collection of bits describing the instruction sets of which this
  249. instruction or macro is a member. */
  250. unsigned long membership;
  251. };
  252. /* These are the characters which may appear in the args field of an
  253. instruction. They appear in the order in which the fields appear
  254. when the instruction is used. Commas and parentheses in the args
  255. string are ignored when assembling, and written into the output
  256. when disassembling.
  257. Each of these characters corresponds to a mask field defined above.
  258. "<" 5 bit shift amount (OP_*_SHAMT)
  259. ">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT)
  260. "a" 26 bit target address (OP_*_TARGET)
  261. "b" 5 bit base register (OP_*_RS)
  262. "c" 10 bit breakpoint code (OP_*_CODE)
  263. "d" 5 bit destination register specifier (OP_*_RD)
  264. "h" 5 bit prefx hint (OP_*_PREFX)
  265. "i" 16 bit unsigned immediate (OP_*_IMMEDIATE)
  266. "j" 16 bit signed immediate (OP_*_DELTA)
  267. "k" 5 bit cache opcode in target register position (OP_*_CACHE)
  268. Also used for immediate operands in vr5400 vector insns.
  269. "o" 16 bit signed offset (OP_*_DELTA)
  270. "p" 16 bit PC relative branch target address (OP_*_DELTA)
  271. "q" 10 bit extra breakpoint code (OP_*_CODE2)
  272. "r" 5 bit same register used as both source and target (OP_*_RS)
  273. "s" 5 bit source register specifier (OP_*_RS)
  274. "t" 5 bit target register (OP_*_RT)
  275. "u" 16 bit upper 16 bits of address (OP_*_IMMEDIATE)
  276. "v" 5 bit same register used as both source and destination (OP_*_RS)
  277. "w" 5 bit same register used as both target and destination (OP_*_RT)
  278. "U" 5 bit same destination register in both OP_*_RD and OP_*_RT
  279. (used by clo and clz)
  280. "C" 25 bit coprocessor function code (OP_*_COPZ)
  281. "B" 20 bit syscall/breakpoint function code (OP_*_CODE20)
  282. "J" 19 bit wait function code (OP_*_CODE19)
  283. "x" accept and ignore register name
  284. "z" must be zero register
  285. "K" 5 bit Hardware Register (rdhwr instruction) (OP_*_RD)
  286. "+A" 5 bit ins/ext/dins/dext/dinsm/dextm position, which becomes
  287. LSB (OP_*_SHAMT).
  288. Enforces: 0 <= pos < 32.
  289. "+B" 5 bit ins/dins size, which becomes MSB (OP_*_INSMSB).
  290. Requires that "+A" or "+E" occur first to set position.
  291. Enforces: 0 < (pos+size) <= 32.
  292. "+C" 5 bit ext/dext size, which becomes MSBD (OP_*_EXTMSBD).
  293. Requires that "+A" or "+E" occur first to set position.
  294. Enforces: 0 < (pos+size) <= 32.
  295. (Also used by "dext" w/ different limits, but limits for
  296. that are checked by the M_DEXT macro.)
  297. "+E" 5 bit dinsu/dextu position, which becomes LSB-32 (OP_*_SHAMT).
  298. Enforces: 32 <= pos < 64.
  299. "+F" 5 bit "dinsm/dinsu" size, which becomes MSB-32 (OP_*_INSMSB).
  300. Requires that "+A" or "+E" occur first to set position.
  301. Enforces: 32 < (pos+size) <= 64.
  302. "+G" 5 bit "dextm" size, which becomes MSBD-32 (OP_*_EXTMSBD).
  303. Requires that "+A" or "+E" occur first to set position.
  304. Enforces: 32 < (pos+size) <= 64.
  305. "+H" 5 bit "dextu" size, which becomes MSBD (OP_*_EXTMSBD).
  306. Requires that "+A" or "+E" occur first to set position.
  307. Enforces: 32 < (pos+size) <= 64.
  308. Floating point instructions:
  309. "D" 5 bit destination register (OP_*_FD)
  310. "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up)
  311. "N" 3 bit branch condition code (OP_*_BCC) (only used for mips4 and up)
  312. "S" 5 bit fs source 1 register (OP_*_FS)
  313. "T" 5 bit ft source 2 register (OP_*_FT)
  314. "R" 5 bit fr source 3 register (OP_*_FR)
  315. "V" 5 bit same register used as floating source and destination (OP_*_FS)
  316. "W" 5 bit same register used as floating target and destination (OP_*_FT)
  317. Coprocessor instructions:
  318. "E" 5 bit target register (OP_*_RT)
  319. "G" 5 bit destination register (OP_*_RD)
  320. "H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL)
  321. "P" 5 bit performance-monitor register (OP_*_PERFREG)
  322. "e" 5 bit vector register byte specifier (OP_*_VECBYTE)
  323. "%" 3 bit immediate vr5400 vector alignment operand (OP_*_VECALIGN)
  324. see also "k" above
  325. "+D" Combined destination register ("G") and sel ("H") for CP0 ops,
  326. for pretty-printing in disassembly only.
  327. Macro instructions:
  328. "A" General 32 bit expression
  329. "I" 32 bit immediate (value placed in imm_expr).
  330. "+I" 32 bit immediate (value placed in imm2_expr).
  331. "F" 64 bit floating point constant in .rdata
  332. "L" 64 bit floating point constant in .lit8
  333. "f" 32 bit floating point constant
  334. "l" 32 bit floating point constant in .lit4
  335. MDMX instruction operands (note that while these use the FP register
  336. fields, they accept both $fN and $vN names for the registers):
  337. "O" MDMX alignment offset (OP_*_ALN)
  338. "Q" MDMX vector/scalar/immediate source (OP_*_VSEL and OP_*_FT)
  339. "X" MDMX destination register (OP_*_FD)
  340. "Y" MDMX source register (OP_*_FS)
  341. "Z" MDMX source register (OP_*_FT)
  342. DSP ASE usage:
  343. "2" 2 bit unsigned immediate for byte align (OP_*_BP)
  344. "3" 3 bit unsigned immediate (OP_*_SA3)
  345. "4" 4 bit unsigned immediate (OP_*_SA4)
  346. "5" 8 bit unsigned immediate (OP_*_IMM8)
  347. "6" 5 bit unsigned immediate (OP_*_RS)
  348. "7" 2 bit dsp accumulator register (OP_*_DSPACC)
  349. "8" 6 bit unsigned immediate (OP_*_WRDSP)
  350. "9" 2 bit dsp accumulator register (OP_*_DSPACC_S)
  351. "0" 6 bit signed immediate (OP_*_DSPSFT)
  352. ":" 7 bit signed immediate (OP_*_DSPSFT_7)
  353. "'" 6 bit unsigned immediate (OP_*_RDDSP)
  354. "@" 10 bit signed immediate (OP_*_IMM10)
  355. MT ASE usage:
  356. "!" 1 bit usermode flag (OP_*_MT_U)
  357. "$" 1 bit load high flag (OP_*_MT_H)
  358. "*" 2 bit dsp/smartmips accumulator register (OP_*_MTACC_T)
  359. "&" 2 bit dsp/smartmips accumulator register (OP_*_MTACC_D)
  360. "g" 5 bit coprocessor 1 and 2 destination register (OP_*_RD)
  361. "+t" 5 bit coprocessor 0 destination register (OP_*_RT)
  362. "+T" 5 bit coprocessor 0 destination register (OP_*_RT) - disassembly only
  363. UDI immediates:
  364. "+1" UDI immediate bits 6-10
  365. "+2" UDI immediate bits 6-15
  366. "+3" UDI immediate bits 6-20
  367. "+4" UDI immediate bits 6-25
  368. Other:
  369. "()" parens surrounding optional value
  370. "," separates operands
  371. "[]" brackets around index for vector-op scalar operand specifier (vr5400)
  372. "+" Start of extension sequence.
  373. Characters used so far, for quick reference when adding more:
  374. "234567890"
  375. "%[]<>(),+:'@!$*&"
  376. "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  377. "abcdefghijklopqrstuvwxz"
  378. Extension character sequences used so far ("+" followed by the
  379. following), for quick reference when adding more:
  380. "1234"
  381. "ABCDEFGHIT"
  382. "t"
  383. */
  384. /* These are the bits which may be set in the pinfo field of an
  385. instructions, if it is not equal to INSN_MACRO. */
  386. /* Modifies the general purpose register in OP_*_RD. */
  387. #define INSN_WRITE_GPR_D 0x00000001
  388. /* Modifies the general purpose register in OP_*_RT. */
  389. #define INSN_WRITE_GPR_T 0x00000002
  390. /* Modifies general purpose register 31. */
  391. #define INSN_WRITE_GPR_31 0x00000004
  392. /* Modifies the floating point register in OP_*_FD. */
  393. #define INSN_WRITE_FPR_D 0x00000008
  394. /* Modifies the floating point register in OP_*_FS. */
  395. #define INSN_WRITE_FPR_S 0x00000010
  396. /* Modifies the floating point register in OP_*_FT. */
  397. #define INSN_WRITE_FPR_T 0x00000020
  398. /* Reads the general purpose register in OP_*_RS. */
  399. #define INSN_READ_GPR_S 0x00000040
  400. /* Reads the general purpose register in OP_*_RT. */
  401. #define INSN_READ_GPR_T 0x00000080
  402. /* Reads the floating point register in OP_*_FS. */
  403. #define INSN_READ_FPR_S 0x00000100
  404. /* Reads the floating point register in OP_*_FT. */
  405. #define INSN_READ_FPR_T 0x00000200
  406. /* Reads the floating point register in OP_*_FR. */
  407. #define INSN_READ_FPR_R 0x00000400
  408. /* Modifies coprocessor condition code. */
  409. #define INSN_WRITE_COND_CODE 0x00000800
  410. /* Reads coprocessor condition code. */
  411. #define INSN_READ_COND_CODE 0x00001000
  412. /* TLB operation. */
  413. #define INSN_TLB 0x00002000
  414. /* Reads coprocessor register other than floating point register. */
  415. #define INSN_COP 0x00004000
  416. /* Instruction loads value from memory, requiring delay. */
  417. #define INSN_LOAD_MEMORY_DELAY 0x00008000
  418. /* Instruction loads value from coprocessor, requiring delay. */
  419. #define INSN_LOAD_COPROC_DELAY 0x00010000
  420. /* Instruction has unconditional branch delay slot. */
  421. #define INSN_UNCOND_BRANCH_DELAY 0x00020000
  422. /* Instruction has conditional branch delay slot. */
  423. #define INSN_COND_BRANCH_DELAY 0x00040000
  424. /* Conditional branch likely: if branch not taken, insn nullified. */
  425. #define INSN_COND_BRANCH_LIKELY 0x00080000
  426. /* Moves to coprocessor register, requiring delay. */
  427. #define INSN_COPROC_MOVE_DELAY 0x00100000
  428. /* Loads coprocessor register from memory, requiring delay. */
  429. #define INSN_COPROC_MEMORY_DELAY 0x00200000
  430. /* Reads the HI register. */
  431. #define INSN_READ_HI 0x00400000
  432. /* Reads the LO register. */
  433. #define INSN_READ_LO 0x00800000
  434. /* Modifies the HI register. */
  435. #define INSN_WRITE_HI 0x01000000
  436. /* Modifies the LO register. */
  437. #define INSN_WRITE_LO 0x02000000
  438. /* Takes a trap (easier to keep out of delay slot). */
  439. #define INSN_TRAP 0x04000000
  440. /* Instruction stores value into memory. */
  441. #define INSN_STORE_MEMORY 0x08000000
  442. /* Instruction uses single precision floating point. */
  443. #define FP_S 0x10000000
  444. /* Instruction uses double precision floating point. */
  445. #define FP_D 0x20000000
  446. /* Instruction is part of the tx39's integer multiply family. */
  447. #define INSN_MULT 0x40000000
  448. /* Instruction synchronize shared memory. */
  449. #define INSN_SYNC 0x80000000
  450. /* These are the bits which may be set in the pinfo2 field of an
  451. instruction. */
  452. /* Instruction is a simple alias (I.E. "move" for daddu/addu/or) */
  453. #define INSN2_ALIAS 0x00000001
  454. /* Instruction reads MDMX accumulator. */
  455. #define INSN2_READ_MDMX_ACC 0x00000002
  456. /* Instruction writes MDMX accumulator. */
  457. #define INSN2_WRITE_MDMX_ACC 0x00000004
  458. /* Instruction is actually a macro. It should be ignored by the
  459. disassembler, and requires special treatment by the assembler. */
  460. #define INSN_MACRO 0xffffffff
  461. /* Masks used to mark instructions to indicate which MIPS ISA level
  462. they were introduced in. ISAs, as defined below, are logical
  463. ORs of these bits, indicating that they support the instructions
  464. defined at the given level. */
  465. #define INSN_ISA_MASK 0x00000fff
  466. #define INSN_ISA1 0x00000001
  467. #define INSN_ISA2 0x00000002
  468. #define INSN_ISA3 0x00000004
  469. #define INSN_ISA4 0x00000008
  470. #define INSN_ISA5 0x00000010
  471. #define INSN_ISA32 0x00000020
  472. #define INSN_ISA64 0x00000040
  473. #define INSN_ISA32R2 0x00000080
  474. #define INSN_ISA64R2 0x00000100
  475. /* Masks used for MIPS-defined ASEs. */
  476. #define INSN_ASE_MASK 0x0000f000
  477. /* DSP ASE */
  478. #define INSN_DSP 0x00001000
  479. #define INSN_DSP64 0x00002000
  480. /* MIPS 16 ASE */
  481. #define INSN_MIPS16 0x00004000
  482. /* MIPS-3D ASE */
  483. #define INSN_MIPS3D 0x00008000
  484. /* Chip specific instructions. These are bitmasks. */
  485. /* MIPS R4650 instruction. */
  486. #define INSN_4650 0x00010000
  487. /* LSI R4010 instruction. */
  488. #define INSN_4010 0x00020000
  489. /* NEC VR4100 instruction. */
  490. #define INSN_4100 0x00040000
  491. /* Toshiba R3900 instruction. */
  492. #define INSN_3900 0x00080000
  493. /* MIPS R10000 instruction. */
  494. #define INSN_10000 0x00100000
  495. /* Broadcom SB-1 instruction. */
  496. #define INSN_SB1 0x00200000
  497. /* NEC VR4111/VR4181 instruction. */
  498. #define INSN_4111 0x00400000
  499. /* NEC VR4120 instruction. */
  500. #define INSN_4120 0x00800000
  501. /* NEC VR5400 instruction. */
  502. #define INSN_5400 0x01000000
  503. /* NEC VR5500 instruction. */
  504. #define INSN_5500 0x02000000
  505. /* MDMX ASE */
  506. #define INSN_MDMX 0x04000000
  507. /* MT ASE */
  508. #define INSN_MT 0x08000000
  509. /* SmartMIPS ASE */
  510. #define INSN_SMARTMIPS 0x10000000
  511. /* DSP R2 ASE */
  512. #define INSN_DSPR2 0x20000000
  513. /* ST Microelectronics Loongson 2E. */
  514. #define INSN_LOONGSON_2E 0x40000000
  515. /* ST Microelectronics Loongson 2F. */
  516. #define INSN_LOONGSON_2F 0x80000000
  517. /* MIPS ISA defines, use instead of hardcoding ISA level. */
  518. #define ISA_UNKNOWN 0 /* Gas internal use. */
  519. #define ISA_MIPS1 (INSN_ISA1)
  520. #define ISA_MIPS2 (ISA_MIPS1 | INSN_ISA2)
  521. #define ISA_MIPS3 (ISA_MIPS2 | INSN_ISA3)
  522. #define ISA_MIPS4 (ISA_MIPS3 | INSN_ISA4)
  523. #define ISA_MIPS5 (ISA_MIPS4 | INSN_ISA5)
  524. #define ISA_MIPS32 (ISA_MIPS2 | INSN_ISA32)
  525. #define ISA_MIPS64 (ISA_MIPS5 | INSN_ISA32 | INSN_ISA64)
  526. #define ISA_MIPS32R2 (ISA_MIPS32 | INSN_ISA32R2)
  527. #define ISA_MIPS64R2 (ISA_MIPS64 | INSN_ISA32R2 | INSN_ISA64R2)
  528. /* CPU defines, use instead of hardcoding processor number. Keep this
  529. in sync with bfd/archures.c in order for machine selection to work. */
  530. #define CPU_UNKNOWN 0 /* Gas internal use. */
  531. #define CPU_R3000 3000
  532. #define CPU_R3900 3900
  533. #define CPU_R4000 4000
  534. #define CPU_R4010 4010
  535. #define CPU_VR4100 4100
  536. #define CPU_R4111 4111
  537. #define CPU_VR4120 4120
  538. #define CPU_R4300 4300
  539. #define CPU_R4400 4400
  540. #define CPU_R4600 4600
  541. #define CPU_R4650 4650
  542. #define CPU_R5000 5000
  543. #define CPU_VR5400 5400
  544. #define CPU_VR5500 5500
  545. #define CPU_R6000 6000
  546. #define CPU_RM7000 7000
  547. #define CPU_R8000 8000
  548. #define CPU_R10000 10000
  549. #define CPU_R12000 12000
  550. #define CPU_MIPS16 16
  551. #define CPU_MIPS32 32
  552. #define CPU_MIPS32R2 33
  553. #define CPU_MIPS5 5
  554. #define CPU_MIPS64 64
  555. #define CPU_MIPS64R2 65
  556. #define CPU_SB1 12310201 /* octal 'SB', 01. */
  557. /* Test for membership in an ISA including chip specific ISAs. INSN
  558. is pointer to an element of the opcode table; ISA is the specified
  559. ISA/ASE bitmask to test against; and CPU is the CPU specific ISA to
  560. test, or zero if no CPU specific ISA test is desired. */
  561. #if 0
  562. #define OPCODE_IS_MEMBER(insn, isa, cpu) \
  563. (((insn)->membership & isa) != 0 \
  564. || (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0) \
  565. || (cpu == CPU_RM7000 && ((insn)->membership & INSN_4650) != 0) \
  566. || (cpu == CPU_RM9000 && ((insn)->membership & INSN_4650) != 0) \
  567. || (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0) \
  568. || (cpu == CPU_VR4100 && ((insn)->membership & INSN_4100) != 0) \
  569. || (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0) \
  570. || ((cpu == CPU_R10000 || cpu == CPU_R12000) \
  571. && ((insn)->membership & INSN_10000) != 0) \
  572. || (cpu == CPU_SB1 && ((insn)->membership & INSN_SB1) != 0) \
  573. || (cpu == CPU_R4111 && ((insn)->membership & INSN_4111) != 0) \
  574. || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \
  575. || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \
  576. || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \
  577. || 0) /* Please keep this term for easier source merging. */
  578. #else
  579. #define OPCODE_IS_MEMBER(insn, isa, cpu) \
  580. (1 != 0)
  581. #endif
  582. /* This is a list of macro expanded instructions.
  583. _I appended means immediate
  584. _A appended means address
  585. _AB appended means address with base register
  586. _D appended means 64 bit floating point constant
  587. _S appended means 32 bit floating point constant. */
  588. enum
  589. {
  590. M_ABS,
  591. M_ADD_I,
  592. M_ADDU_I,
  593. M_AND_I,
  594. M_BALIGN,
  595. M_BEQ,
  596. M_BEQ_I,
  597. M_BEQL_I,
  598. M_BGE,
  599. M_BGEL,
  600. M_BGE_I,
  601. M_BGEL_I,
  602. M_BGEU,
  603. M_BGEUL,
  604. M_BGEU_I,
  605. M_BGEUL_I,
  606. M_BGT,
  607. M_BGTL,
  608. M_BGT_I,
  609. M_BGTL_I,
  610. M_BGTU,
  611. M_BGTUL,
  612. M_BGTU_I,
  613. M_BGTUL_I,
  614. M_BLE,
  615. M_BLEL,
  616. M_BLE_I,
  617. M_BLEL_I,
  618. M_BLEU,
  619. M_BLEUL,
  620. M_BLEU_I,
  621. M_BLEUL_I,
  622. M_BLT,
  623. M_BLTL,
  624. M_BLT_I,
  625. M_BLTL_I,
  626. M_BLTU,
  627. M_BLTUL,
  628. M_BLTU_I,
  629. M_BLTUL_I,
  630. M_BNE,
  631. M_BNE_I,
  632. M_BNEL_I,
  633. M_CACHE_AB,
  634. M_DABS,
  635. M_DADD_I,
  636. M_DADDU_I,
  637. M_DDIV_3,
  638. M_DDIV_3I,
  639. M_DDIVU_3,
  640. M_DDIVU_3I,
  641. M_DEXT,
  642. M_DINS,
  643. M_DIV_3,
  644. M_DIV_3I,
  645. M_DIVU_3,
  646. M_DIVU_3I,
  647. M_DLA_AB,
  648. M_DLCA_AB,
  649. M_DLI,
  650. M_DMUL,
  651. M_DMUL_I,
  652. M_DMULO,
  653. M_DMULO_I,
  654. M_DMULOU,
  655. M_DMULOU_I,
  656. M_DREM_3,
  657. M_DREM_3I,
  658. M_DREMU_3,
  659. M_DREMU_3I,
  660. M_DSUB_I,
  661. M_DSUBU_I,
  662. M_DSUBU_I_2,
  663. M_J_A,
  664. M_JAL_1,
  665. M_JAL_2,
  666. M_JAL_A,
  667. M_L_DOB,
  668. M_L_DAB,
  669. M_LA_AB,
  670. M_LB_A,
  671. M_LB_AB,
  672. M_LBU_A,
  673. M_LBU_AB,
  674. M_LCA_AB,
  675. M_LD_A,
  676. M_LD_OB,
  677. M_LD_AB,
  678. M_LDC1_AB,
  679. M_LDC2_AB,
  680. M_LDC3_AB,
  681. M_LDL_AB,
  682. M_LDR_AB,
  683. M_LH_A,
  684. M_LH_AB,
  685. M_LHU_A,
  686. M_LHU_AB,
  687. M_LI,
  688. M_LI_D,
  689. M_LI_DD,
  690. M_LI_S,
  691. M_LI_SS,
  692. M_LL_AB,
  693. M_LLD_AB,
  694. M_LS_A,
  695. M_LW_A,
  696. M_LW_AB,
  697. M_LWC0_A,
  698. M_LWC0_AB,
  699. M_LWC1_A,
  700. M_LWC1_AB,
  701. M_LWC2_A,
  702. M_LWC2_AB,
  703. M_LWC3_A,
  704. M_LWC3_AB,
  705. M_LWL_A,
  706. M_LWL_AB,
  707. M_LWR_A,
  708. M_LWR_AB,
  709. M_LWU_AB,
  710. M_MOVE,
  711. M_MUL,
  712. M_MUL_I,
  713. M_MULO,
  714. M_MULO_I,
  715. M_MULOU,
  716. M_MULOU_I,
  717. M_NOR_I,
  718. M_OR_I,
  719. M_REM_3,
  720. M_REM_3I,
  721. M_REMU_3,
  722. M_REMU_3I,
  723. M_DROL,
  724. M_ROL,
  725. M_DROL_I,
  726. M_ROL_I,
  727. M_DROR,
  728. M_ROR,
  729. M_DROR_I,
  730. M_ROR_I,
  731. M_S_DA,
  732. M_S_DOB,
  733. M_S_DAB,
  734. M_S_S,
  735. M_SC_AB,
  736. M_SCD_AB,
  737. M_SD_A,
  738. M_SD_OB,
  739. M_SD_AB,
  740. M_SDC1_AB,
  741. M_SDC2_AB,
  742. M_SDC3_AB,
  743. M_SDL_AB,
  744. M_SDR_AB,
  745. M_SEQ,
  746. M_SEQ_I,
  747. M_SGE,
  748. M_SGE_I,
  749. M_SGEU,
  750. M_SGEU_I,
  751. M_SGT,
  752. M_SGT_I,
  753. M_SGTU,
  754. M_SGTU_I,
  755. M_SLE,
  756. M_SLE_I,
  757. M_SLEU,
  758. M_SLEU_I,
  759. M_SLT_I,
  760. M_SLTU_I,
  761. M_SNE,
  762. M_SNE_I,
  763. M_SB_A,
  764. M_SB_AB,
  765. M_SH_A,
  766. M_SH_AB,
  767. M_SW_A,
  768. M_SW_AB,
  769. M_SWC0_A,
  770. M_SWC0_AB,
  771. M_SWC1_A,
  772. M_SWC1_AB,
  773. M_SWC2_A,
  774. M_SWC2_AB,
  775. M_SWC3_A,
  776. M_SWC3_AB,
  777. M_SWL_A,
  778. M_SWL_AB,
  779. M_SWR_A,
  780. M_SWR_AB,
  781. M_SUB_I,
  782. M_SUBU_I,
  783. M_SUBU_I_2,
  784. M_TEQ_I,
  785. M_TGE_I,
  786. M_TGEU_I,
  787. M_TLT_I,
  788. M_TLTU_I,
  789. M_TNE_I,
  790. M_TRUNCWD,
  791. M_TRUNCWS,
  792. M_ULD,
  793. M_ULD_A,
  794. M_ULH,
  795. M_ULH_A,
  796. M_ULHU,
  797. M_ULHU_A,
  798. M_ULW,
  799. M_ULW_A,
  800. M_USH,
  801. M_USH_A,
  802. M_USW,
  803. M_USW_A,
  804. M_USD,
  805. M_USD_A,
  806. M_XOR_I,
  807. M_COP0,
  808. M_COP1,
  809. M_COP2,
  810. M_COP3,
  811. M_NUM_MACROS
  812. };
  813. /* The order of overloaded instructions matters. Label arguments and
  814. register arguments look the same. Instructions that can have either
  815. for arguments must apear in the correct order in this table for the
  816. assembler to pick the right one. In other words, entries with
  817. immediate operands must apear after the same instruction with
  818. registers.
  819. Many instructions are short hand for other instructions (i.e., The
  820. jal <register> instruction is short for jalr <register>). */
  821. extern const struct mips_opcode mips_builtin_opcodes[];
  822. extern const int bfd_mips_num_builtin_opcodes;
  823. extern struct mips_opcode *mips_opcodes;
  824. extern int bfd_mips_num_opcodes;
  825. #define NUMOPCODES bfd_mips_num_opcodes
  826. /* The rest of this file adds definitions for the mips16 TinyRISC
  827. processor. */
  828. /* These are the bitmasks and shift counts used for the different
  829. fields in the instruction formats. Other than OP, no masks are
  830. provided for the fixed portions of an instruction, since they are
  831. not needed.
  832. The I format uses IMM11.
  833. The RI format uses RX and IMM8.
  834. The RR format uses RX, and RY.
  835. The RRI format uses RX, RY, and IMM5.
  836. The RRR format uses RX, RY, and RZ.
  837. The RRI_A format uses RX, RY, and IMM4.
  838. The SHIFT format uses RX, RY, and SHAMT.
  839. The I8 format uses IMM8.
  840. The I8_MOVR32 format uses RY and REGR32.
  841. The IR_MOV32R format uses REG32R and MOV32Z.
  842. The I64 format uses IMM8.
  843. The RI64 format uses RY and IMM5.
  844. */
  845. #define MIPS16OP_MASK_OP 0x1f
  846. #define MIPS16OP_SH_OP 11
  847. #define MIPS16OP_MASK_IMM11 0x7ff
  848. #define MIPS16OP_SH_IMM11 0
  849. #define MIPS16OP_MASK_RX 0x7
  850. #define MIPS16OP_SH_RX 8
  851. #define MIPS16OP_MASK_IMM8 0xff
  852. #define MIPS16OP_SH_IMM8 0
  853. #define MIPS16OP_MASK_RY 0x7
  854. #define MIPS16OP_SH_RY 5
  855. #define MIPS16OP_MASK_IMM5 0x1f
  856. #define MIPS16OP_SH_IMM5 0
  857. #define MIPS16OP_MASK_RZ 0x7
  858. #define MIPS16OP_SH_RZ 2
  859. #define MIPS16OP_MASK_IMM4 0xf
  860. #define MIPS16OP_SH_IMM4 0
  861. #define MIPS16OP_MASK_REGR32 0x1f
  862. #define MIPS16OP_SH_REGR32 0
  863. #define MIPS16OP_MASK_REG32R 0x1f
  864. #define MIPS16OP_SH_REG32R 3
  865. #define MIPS16OP_EXTRACT_REG32R(i) ((((i) >> 5) & 7) | ((i) & 0x18))
  866. #define MIPS16OP_MASK_MOVE32Z 0x7
  867. #define MIPS16OP_SH_MOVE32Z 0
  868. #define MIPS16OP_MASK_IMM6 0x3f
  869. #define MIPS16OP_SH_IMM6 5
  870. /* These are the characters which may appears in the args field of an
  871. instruction. They appear in the order in which the fields appear
  872. when the instruction is used. Commas and parentheses in the args
  873. string are ignored when assembling, and written into the output
  874. when disassembling.
  875. "y" 3 bit register (MIPS16OP_*_RY)
  876. "x" 3 bit register (MIPS16OP_*_RX)
  877. "z" 3 bit register (MIPS16OP_*_RZ)
  878. "Z" 3 bit register (MIPS16OP_*_MOVE32Z)
  879. "v" 3 bit same register as source and destination (MIPS16OP_*_RX)
  880. "w" 3 bit same register as source and destination (MIPS16OP_*_RY)
  881. "0" zero register ($0)
  882. "S" stack pointer ($sp or $29)
  883. "P" program counter
  884. "R" return address register ($ra or $31)
  885. "X" 5 bit MIPS register (MIPS16OP_*_REGR32)
  886. "Y" 5 bit MIPS register (MIPS16OP_*_REG32R)
  887. "6" 6 bit unsigned break code (MIPS16OP_*_IMM6)
  888. "a" 26 bit jump address
  889. "e" 11 bit extension value
  890. "l" register list for entry instruction
  891. "L" register list for exit instruction
  892. The remaining codes may be extended. Except as otherwise noted,
  893. the full extended operand is a 16 bit signed value.
  894. "<" 3 bit unsigned shift count * 0 (MIPS16OP_*_RZ) (full 5 bit unsigned)
  895. ">" 3 bit unsigned shift count * 0 (MIPS16OP_*_RX) (full 5 bit unsigned)
  896. "[" 3 bit unsigned shift count * 0 (MIPS16OP_*_RZ) (full 6 bit unsigned)
  897. "]" 3 bit unsigned shift count * 0 (MIPS16OP_*_RX) (full 6 bit unsigned)
  898. "4" 4 bit signed immediate * 0 (MIPS16OP_*_IMM4) (full 15 bit signed)
  899. "5" 5 bit unsigned immediate * 0 (MIPS16OP_*_IMM5)
  900. "H" 5 bit unsigned immediate * 2 (MIPS16OP_*_IMM5)
  901. "W" 5 bit unsigned immediate * 4 (MIPS16OP_*_IMM5)
  902. "D" 5 bit unsigned immediate * 8 (MIPS16OP_*_IMM5)
  903. "j" 5 bit signed immediate * 0 (MIPS16OP_*_IMM5)
  904. "8" 8 bit unsigned immediate * 0 (MIPS16OP_*_IMM8)
  905. "V" 8 bit unsigned immediate * 4 (MIPS16OP_*_IMM8)
  906. "C" 8 bit unsigned immediate * 8 (MIPS16OP_*_IMM8)
  907. "U" 8 bit unsigned immediate * 0 (MIPS16OP_*_IMM8) (full 16 bit unsigned)
  908. "k" 8 bit signed immediate * 0 (MIPS16OP_*_IMM8)
  909. "K" 8 bit signed immediate * 8 (MIPS16OP_*_IMM8)
  910. "p" 8 bit conditional branch address (MIPS16OP_*_IMM8)
  911. "q" 11 bit branch address (MIPS16OP_*_IMM11)
  912. "A" 8 bit PC relative address * 4 (MIPS16OP_*_IMM8)
  913. "B" 5 bit PC relative address * 8 (MIPS16OP_*_IMM5)
  914. "E" 5 bit PC relative address * 4 (MIPS16OP_*_IMM5)
  915. */
  916. /* Save/restore encoding for the args field when all 4 registers are
  917. either saved as arguments or saved/restored as statics. */
  918. #define MIPS16_ALL_ARGS 0xe
  919. #define MIPS16_ALL_STATICS 0xb
  920. /* For the mips16, we use the same opcode table format and a few of
  921. the same flags. However, most of the flags are different. */
  922. /* Modifies the register in MIPS16OP_*_RX. */
  923. #define MIPS16_INSN_WRITE_X 0x00000001
  924. /* Modifies the register in MIPS16OP_*_RY. */
  925. #define MIPS16_INSN_WRITE_Y 0x00000002
  926. /* Modifies the register in MIPS16OP_*_RZ. */
  927. #define MIPS16_INSN_WRITE_Z 0x00000004
  928. /* Modifies the T ($24) register. */
  929. #define MIPS16_INSN_WRITE_T 0x00000008
  930. /* Modifies the SP ($29) register. */
  931. #define MIPS16_INSN_WRITE_SP 0x00000010
  932. /* Modifies the RA ($31) register. */
  933. #define MIPS16_INSN_WRITE_31 0x00000020
  934. /* Modifies the general purpose register in MIPS16OP_*_REG32R. */
  935. #define MIPS16_INSN_WRITE_GPR_Y 0x00000040
  936. /* Reads the register in MIPS16OP_*_RX. */
  937. #define MIPS16_INSN_READ_X 0x00000080
  938. /* Reads the register in MIPS16OP_*_RY. */
  939. #define MIPS16_INSN_READ_Y 0x00000100
  940. /* Reads the register in MIPS16OP_*_MOVE32Z. */
  941. #define MIPS16_INSN_READ_Z 0x00000200
  942. /* Reads the T ($24) register. */
  943. #define MIPS16_INSN_READ_T 0x00000400
  944. /* Reads the SP ($29) register. */
  945. #define MIPS16_INSN_READ_SP 0x00000800
  946. /* Reads the RA ($31) register. */
  947. #define MIPS16_INSN_READ_31 0x00001000
  948. /* Reads the program counter. */
  949. #define MIPS16_INSN_READ_PC 0x00002000
  950. /* Reads the general purpose register in MIPS16OP_*_REGR32. */
  951. #define MIPS16_INSN_READ_GPR_X 0x00004000
  952. /* Is a branch insn. */
  953. #define MIPS16_INSN_BRANCH 0x00010000
  954. /* The following flags have the same value for the mips16 opcode
  955. table:
  956. INSN_UNCOND_BRANCH_DELAY
  957. INSN_COND_BRANCH_DELAY
  958. INSN_COND_BRANCH_LIKELY (never used)
  959. INSN_READ_HI
  960. INSN_READ_LO
  961. INSN_WRITE_HI
  962. INSN_WRITE_LO
  963. INSN_TRAP
  964. INSN_ISA3
  965. */
  966. extern const struct mips_opcode mips16_opcodes[];
  967. extern const int bfd_mips16_num_opcodes;
  968. /* Short hand so the lines aren't too long. */
  969. #define LDD INSN_LOAD_MEMORY_DELAY
  970. #define LCD INSN_LOAD_COPROC_DELAY
  971. #define UBD INSN_UNCOND_BRANCH_DELAY
  972. #define CBD INSN_COND_BRANCH_DELAY
  973. #define COD INSN_COPROC_MOVE_DELAY
  974. #define CLD INSN_COPROC_MEMORY_DELAY
  975. #define CBL INSN_COND_BRANCH_LIKELY
  976. #define TRAP INSN_TRAP
  977. #define SM INSN_STORE_MEMORY
  978. #define WR_d INSN_WRITE_GPR_D
  979. #define WR_t INSN_WRITE_GPR_T
  980. #define WR_31 INSN_WRITE_GPR_31
  981. #define WR_D INSN_WRITE_FPR_D
  982. #define WR_T INSN_WRITE_FPR_T
  983. #define WR_S INSN_WRITE_FPR_S
  984. #define RD_s INSN_READ_GPR_S
  985. #define RD_b INSN_READ_GPR_S
  986. #define RD_t INSN_READ_GPR_T
  987. #define RD_S INSN_READ_FPR_S
  988. #define RD_T INSN_READ_FPR_T
  989. #define RD_R INSN_READ_FPR_R
  990. #define WR_CC INSN_WRITE_COND_CODE
  991. #define RD_CC INSN_READ_COND_CODE
  992. #define RD_C0 INSN_COP
  993. #define RD_C1 INSN_COP
  994. #define RD_C2 INSN_COP
  995. #define RD_C3 INSN_COP
  996. #define WR_C0 INSN_COP
  997. #define WR_C1 INSN_COP
  998. #define WR_C2 INSN_COP
  999. #define WR_C3 INSN_COP
  1000. #define WR_HI INSN_WRITE_HI
  1001. #define RD_HI INSN_READ_HI
  1002. #define MOD_HI WR_HI|RD_HI
  1003. #define WR_LO INSN_WRITE_LO
  1004. #define RD_LO INSN_READ_LO
  1005. #define MOD_LO WR_LO|RD_LO
  1006. #define WR_HILO WR_HI|WR_LO
  1007. #define RD_HILO RD_HI|RD_LO
  1008. #define MOD_HILO WR_HILO|RD_HILO
  1009. #define IS_M INSN_MULT
  1010. #define WR_MACC INSN2_WRITE_MDMX_ACC
  1011. #define RD_MACC INSN2_READ_MDMX_ACC
  1012. #define I1 INSN_ISA1
  1013. #define I2 INSN_ISA2
  1014. #define I3 INSN_ISA3
  1015. #define I4 INSN_ISA4
  1016. #define I5 INSN_ISA5
  1017. #define I32 INSN_ISA32
  1018. #define I64 INSN_ISA64
  1019. #define I33 INSN_ISA32R2
  1020. #define I65 INSN_ISA64R2
  1021. /* MIPS64 MIPS-3D ASE support. */
  1022. #define I16 INSN_MIPS16
  1023. /* MIPS32 SmartMIPS ASE support. */
  1024. #define SMT INSN_SMARTMIPS
  1025. /* MIPS64 MIPS-3D ASE support. */
  1026. #define M3D INSN_MIPS3D
  1027. /* MIPS64 MDMX ASE support. */
  1028. #define MX INSN_MDMX
  1029. #define IL2E (INSN_LOONGSON_2E)
  1030. #define IL2F (INSN_LOONGSON_2F)
  1031. #define P3 INSN_4650
  1032. #define L1 INSN_4010
  1033. #define V1 (INSN_4100 | INSN_4111 | INSN_4120)
  1034. #define T3 INSN_3900
  1035. #define M1 INSN_10000
  1036. #define SB1 INSN_SB1
  1037. #define N411 INSN_4111
  1038. #define N412 INSN_4120
  1039. #define N5 (INSN_5400 | INSN_5500)
  1040. #define N54 INSN_5400
  1041. #define N55 INSN_5500
  1042. #define G1 (T3 \
  1043. )
  1044. #define G2 (T3 \
  1045. )
  1046. #define G3 (I4 \
  1047. )
  1048. /* MIPS DSP ASE support.
  1049. NOTE:
  1050. 1. MIPS DSP ASE includes 4 accumulators ($ac0 - $ac3). $ac0 is the pair
  1051. of original HI and LO. $ac1, $ac2 and $ac3 are new registers, and have
  1052. the same structure as $ac0 (HI + LO). For DSP instructions that write or
  1053. read accumulators (that may be $ac0), we add WR_a (WR_HILO) or RD_a
  1054. (RD_HILO) attributes, such that HILO dependencies are maintained
  1055. conservatively.
  1056. 2. For some mul. instructions that use integer registers as destinations
  1057. but destroy HI+LO as side-effect, we add WR_HILO to their attributes.
  1058. 3. MIPS DSP ASE includes a new DSP control register, which has 6 fields
  1059. (ccond, outflag, EFI, c, scount, pos). Many DSP instructions read or write
  1060. certain fields of the DSP control register. For simplicity, we decide not
  1061. to track dependencies of these fields.
  1062. However, "bposge32" is a branch instruction that depends on the "pos"
  1063. field. In order to make sure that GAS does not reorder DSP instructions
  1064. that writes the "pos" field and "bposge32", we add DSP_VOLA (INSN_TRAP)
  1065. attribute to those instructions that write the "pos" field. */
  1066. #define WR_a WR_HILO /* Write dsp accumulators (reuse WR_HILO) */
  1067. #define RD_a RD_HILO /* Read dsp accumulators (reuse RD_HILO) */
  1068. #define MOD_a WR_a|RD_a
  1069. #define DSP_VOLA INSN_TRAP
  1070. #define D32 INSN_DSP
  1071. #define D33 INSN_DSPR2
  1072. #define D64 INSN_DSP64
  1073. /* MIPS MT ASE support. */
  1074. #define MT32 INSN_MT
  1075. /* The order of overloaded instructions matters. Label arguments and
  1076. register arguments look the same. Instructions that can have either
  1077. for arguments must apear in the correct order in this table for the
  1078. assembler to pick the right one. In other words, entries with
  1079. immediate operands must apear after the same instruction with
  1080. registers.
  1081. Because of the lookup algorithm used, entries with the same opcode
  1082. name must be contiguous.
  1083. Many instructions are short hand for other instructions (i.e., The
  1084. jal <register> instruction is short for jalr <register>). */
  1085. const struct mips_opcode mips_builtin_opcodes[] =
  1086. {
  1087. /* These instructions appear first so that the disassembler will find
  1088. them first. The assemblers uses a hash table based on the
  1089. instruction name anyhow. */
  1090. /* name, args, match, mask, pinfo, membership */
  1091. {"pref", "k,o(b)", 0xcc000000, 0xfc000000, RD_b, 0, I4|I32|G3 },
  1092. {"prefx", "h,t(b)", 0x4c00000f, 0xfc0007ff, RD_b|RD_t, 0, I4|I33 },
  1093. {"nop", "", 0x00000000, 0xffffffff, 0, INSN2_ALIAS, I1 }, /* sll */
  1094. {"ssnop", "", 0x00000040, 0xffffffff, 0, INSN2_ALIAS, I32|N55 }, /* sll */
  1095. {"ehb", "", 0x000000c0, 0xffffffff, 0, INSN2_ALIAS, I33 }, /* sll */
  1096. {"li", "t,j", 0x24000000, 0xffe00000, WR_t, INSN2_ALIAS, I1 }, /* addiu */
  1097. {"li", "t,i", 0x34000000, 0xffe00000, WR_t, INSN2_ALIAS, I1 }, /* ori */
  1098. {"li", "t,I", 0, (int) M_LI, INSN_MACRO, 0, I1 },
  1099. {"move", "d,s", 0, (int) M_MOVE, INSN_MACRO, 0, I1 },
  1100. {"move", "d,s", 0x0000002d, 0xfc1f07ff, WR_d|RD_s, INSN2_ALIAS, I3 },/* daddu */
  1101. {"move", "d,s", 0x00000021, 0xfc1f07ff, WR_d|RD_s, INSN2_ALIAS, I1 },/* addu */
  1102. {"move", "d,s", 0x00000025, 0xfc1f07ff, WR_d|RD_s, INSN2_ALIAS, I1 },/* or */
  1103. {"b", "p", 0x10000000, 0xffff0000, UBD, INSN2_ALIAS, I1 },/* beq 0,0 */
  1104. {"b", "p", 0x04010000, 0xffff0000, UBD, INSN2_ALIAS, I1 },/* bgez 0 */
  1105. {"bal", "p", 0x04110000, 0xffff0000, UBD|WR_31, INSN2_ALIAS, I1 },/* bgezal 0*/
  1106. {"abs", "d,v", 0, (int) M_ABS, INSN_MACRO, 0, I1 },
  1107. {"abs.s", "D,V", 0x46000005, 0xffff003f, WR_D|RD_S|FP_S, 0, I1 },
  1108. {"abs.d", "D,V", 0x46200005, 0xffff003f, WR_D|RD_S|FP_D, 0, I1 },
  1109. {"abs.ps", "D,V", 0x46c00005, 0xffff003f, WR_D|RD_S|FP_D, 0, I5|I33 },
  1110. {"add", "d,v,t", 0x00000020, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  1111. {"add", "t,r,I", 0, (int) M_ADD_I, INSN_MACRO, 0, I1 },
  1112. {"add.s", "D,V,T", 0x46000000, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, I1 },
  1113. {"add.d", "D,V,T", 0x46200000, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I1 },
  1114. {"add.ob", "X,Y,Q", 0x7800000b, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1115. {"add.ob", "D,S,T", 0x4ac0000b, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1116. {"add.ob", "D,S,T[e]", 0x4800000b, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1117. {"add.ob", "D,S,k", 0x4bc0000b, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1118. {"add.ps", "D,V,T", 0x46c00000, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1119. {"add.qh", "X,Y,Q", 0x7820000b, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1120. {"adda.ob", "Y,Q", 0x78000037, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  1121. {"adda.qh", "Y,Q", 0x78200037, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  1122. {"addi", "t,r,j", 0x20000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  1123. {"addiu", "t,r,j", 0x24000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  1124. {"addl.ob", "Y,Q", 0x78000437, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  1125. {"addl.qh", "Y,Q", 0x78200437, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  1126. {"addr.ps", "D,S,T", 0x46c00018, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, M3D },
  1127. {"addu", "d,v,t", 0x00000021, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  1128. {"addu", "t,r,I", 0, (int) M_ADDU_I, INSN_MACRO, 0, I1 },
  1129. {"alni.ob", "X,Y,Z,O", 0x78000018, 0xff00003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1130. {"alni.ob", "D,S,T,%", 0x48000018, 0xff00003f, WR_D|RD_S|RD_T, 0, N54 },
  1131. {"alni.qh", "X,Y,Z,O", 0x7800001a, 0xff00003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1132. {"alnv.ps", "D,V,T,s", 0x4c00001e, 0xfc00003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1133. {"alnv.ob", "X,Y,Z,s", 0x78000019, 0xfc00003f, WR_D|RD_S|RD_T|RD_s|FP_D, 0, MX|SB1 },
  1134. {"alnv.qh", "X,Y,Z,s", 0x7800001b, 0xfc00003f, WR_D|RD_S|RD_T|RD_s|FP_D, 0, MX },
  1135. {"and", "d,v,t", 0x00000024, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  1136. {"and", "t,r,I", 0, (int) M_AND_I, INSN_MACRO, 0, I1 },
  1137. {"and.ob", "X,Y,Q", 0x7800000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1138. {"and.ob", "D,S,T", 0x4ac0000c, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1139. {"and.ob", "D,S,T[e]", 0x4800000c, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1140. {"and.ob", "D,S,k", 0x4bc0000c, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1141. {"and.qh", "X,Y,Q", 0x7820000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1142. {"andi", "t,r,i", 0x30000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  1143. /* b is at the top of the table. */
  1144. /* bal is at the top of the table. */
  1145. /* bc0[tf]l? are at the bottom of the table. */
  1146. {"bc1any2f", "N,p", 0x45200000, 0xffe30000, CBD|RD_CC|FP_S, 0, M3D },
  1147. {"bc1any2t", "N,p", 0x45210000, 0xffe30000, CBD|RD_CC|FP_S, 0, M3D },
  1148. {"bc1any4f", "N,p", 0x45400000, 0xffe30000, CBD|RD_CC|FP_S, 0, M3D },
  1149. {"bc1any4t", "N,p", 0x45410000, 0xffe30000, CBD|RD_CC|FP_S, 0, M3D },
  1150. {"bc1f", "p", 0x45000000, 0xffff0000, CBD|RD_CC|FP_S, 0, I1 },
  1151. {"bc1f", "N,p", 0x45000000, 0xffe30000, CBD|RD_CC|FP_S, 0, I4|I32 },
  1152. {"bc1fl", "p", 0x45020000, 0xffff0000, CBL|RD_CC|FP_S, 0, I2|T3 },
  1153. {"bc1fl", "N,p", 0x45020000, 0xffe30000, CBL|RD_CC|FP_S, 0, I4|I32 },
  1154. {"bc1t", "p", 0x45010000, 0xffff0000, CBD|RD_CC|FP_S, 0, I1 },
  1155. {"bc1t", "N,p", 0x45010000, 0xffe30000, CBD|RD_CC|FP_S, 0, I4|I32 },
  1156. {"bc1tl", "p", 0x45030000, 0xffff0000, CBL|RD_CC|FP_S, 0, I2|T3 },
  1157. {"bc1tl", "N,p", 0x45030000, 0xffe30000, CBL|RD_CC|FP_S, 0, I4|I32 },
  1158. /* bc2* are at the bottom of the table. */
  1159. /* bc3* are at the bottom of the table. */
  1160. {"beqz", "s,p", 0x10000000, 0xfc1f0000, CBD|RD_s, 0, I1 },
  1161. {"beqzl", "s,p", 0x50000000, 0xfc1f0000, CBL|RD_s, 0, I2|T3 },
  1162. {"beq", "s,t,p", 0x10000000, 0xfc000000, CBD|RD_s|RD_t, 0, I1 },
  1163. {"beq", "s,I,p", 0, (int) M_BEQ_I, INSN_MACRO, 0, I1 },
  1164. {"beql", "s,t,p", 0x50000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 },
  1165. {"beql", "s,I,p", 0, (int) M_BEQL_I, INSN_MACRO, 0, I2|T3 },
  1166. {"bge", "s,t,p", 0, (int) M_BGE, INSN_MACRO, 0, I1 },
  1167. {"bge", "s,I,p", 0, (int) M_BGE_I, INSN_MACRO, 0, I1 },
  1168. {"bgel", "s,t,p", 0, (int) M_BGEL, INSN_MACRO, 0, I2|T3 },
  1169. {"bgel", "s,I,p", 0, (int) M_BGEL_I, INSN_MACRO, 0, I2|T3 },
  1170. {"bgeu", "s,t,p", 0, (int) M_BGEU, INSN_MACRO, 0, I1 },
  1171. {"bgeu", "s,I,p", 0, (int) M_BGEU_I, INSN_MACRO, 0, I1 },
  1172. {"bgeul", "s,t,p", 0, (int) M_BGEUL, INSN_MACRO, 0, I2|T3 },
  1173. {"bgeul", "s,I,p", 0, (int) M_BGEUL_I, INSN_MACRO, 0, I2|T3 },
  1174. {"bgez", "s,p", 0x04010000, 0xfc1f0000, CBD|RD_s, 0, I1 },
  1175. {"bgezl", "s,p", 0x04030000, 0xfc1f0000, CBL|RD_s, 0, I2|T3 },
  1176. {"bgezal", "s,p", 0x04110000, 0xfc1f0000, CBD|RD_s|WR_31, 0, I1 },
  1177. {"bgezall", "s,p", 0x04130000, 0xfc1f0000, CBL|RD_s|WR_31, 0, I2|T3 },
  1178. {"bgt", "s,t,p", 0, (int) M_BGT, INSN_MACRO, 0, I1 },
  1179. {"bgt", "s,I,p", 0, (int) M_BGT_I, INSN_MACRO, 0, I1 },
  1180. {"bgtl", "s,t,p", 0, (int) M_BGTL, INSN_MACRO, 0, I2|T3 },
  1181. {"bgtl", "s,I,p", 0, (int) M_BGTL_I, INSN_MACRO, 0, I2|T3 },
  1182. {"bgtu", "s,t,p", 0, (int) M_BGTU, INSN_MACRO, 0, I1 },
  1183. {"bgtu", "s,I,p", 0, (int) M_BGTU_I, INSN_MACRO, 0, I1 },
  1184. {"bgtul", "s,t,p", 0, (int) M_BGTUL, INSN_MACRO, 0, I2|T3 },
  1185. {"bgtul", "s,I,p", 0, (int) M_BGTUL_I, INSN_MACRO, 0, I2|T3 },
  1186. {"bgtz", "s,p", 0x1c000000, 0xfc1f0000, CBD|RD_s, 0, I1 },
  1187. {"bgtzl", "s,p", 0x5c000000, 0xfc1f0000, CBL|RD_s, 0, I2|T3 },
  1188. {"ble", "s,t,p", 0, (int) M_BLE, INSN_MACRO, 0, I1 },
  1189. {"ble", "s,I,p", 0, (int) M_BLE_I, INSN_MACRO, 0, I1 },
  1190. {"blel", "s,t,p", 0, (int) M_BLEL, INSN_MACRO, 0, I2|T3 },
  1191. {"blel", "s,I,p", 0, (int) M_BLEL_I, INSN_MACRO, 0, I2|T3 },
  1192. {"bleu", "s,t,p", 0, (int) M_BLEU, INSN_MACRO, 0, I1 },
  1193. {"bleu", "s,I,p", 0, (int) M_BLEU_I, INSN_MACRO, 0, I1 },
  1194. {"bleul", "s,t,p", 0, (int) M_BLEUL, INSN_MACRO, 0, I2|T3 },
  1195. {"bleul", "s,I,p", 0, (int) M_BLEUL_I, INSN_MACRO, 0, I2|T3 },
  1196. {"blez", "s,p", 0x18000000, 0xfc1f0000, CBD|RD_s, 0, I1 },
  1197. {"blezl", "s,p", 0x58000000, 0xfc1f0000, CBL|RD_s, 0, I2|T3 },
  1198. {"blt", "s,t,p", 0, (int) M_BLT, INSN_MACRO, 0, I1 },
  1199. {"blt", "s,I,p", 0, (int) M_BLT_I, INSN_MACRO, 0, I1 },
  1200. {"bltl", "s,t,p", 0, (int) M_BLTL, INSN_MACRO, 0, I2|T3 },
  1201. {"bltl", "s,I,p", 0, (int) M_BLTL_I, INSN_MACRO, 0, I2|T3 },
  1202. {"bltu", "s,t,p", 0, (int) M_BLTU, INSN_MACRO, 0, I1 },
  1203. {"bltu", "s,I,p", 0, (int) M_BLTU_I, INSN_MACRO, 0, I1 },
  1204. {"bltul", "s,t,p", 0, (int) M_BLTUL, INSN_MACRO, 0, I2|T3 },
  1205. {"bltul", "s,I,p", 0, (int) M_BLTUL_I, INSN_MACRO, 0, I2|T3 },
  1206. {"bltz", "s,p", 0x04000000, 0xfc1f0000, CBD|RD_s, 0, I1 },
  1207. {"bltzl", "s,p", 0x04020000, 0xfc1f0000, CBL|RD_s, 0, I2|T3 },
  1208. {"bltzal", "s,p", 0x04100000, 0xfc1f0000, CBD|RD_s|WR_31, 0, I1 },
  1209. {"bltzall", "s,p", 0x04120000, 0xfc1f0000, CBL|RD_s|WR_31, 0, I2|T3 },
  1210. {"bnez", "s,p", 0x14000000, 0xfc1f0000, CBD|RD_s, 0, I1 },
  1211. {"bnezl", "s,p", 0x54000000, 0xfc1f0000, CBL|RD_s, 0, I2|T3 },
  1212. {"bne", "s,t,p", 0x14000000, 0xfc000000, CBD|RD_s|RD_t, 0, I1 },
  1213. {"bne", "s,I,p", 0, (int) M_BNE_I, INSN_MACRO, 0, I1 },
  1214. {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 },
  1215. {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 },
  1216. {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 },
  1217. {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 },
  1218. {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 },
  1219. {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1220. {"c.f.d", "M,S,T", 0x46200030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1221. {"c.f.s", "S,T", 0x46000030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1222. {"c.f.s", "M,S,T", 0x46000030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1223. {"c.f.ps", "S,T", 0x46c00030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1224. {"c.f.ps", "M,S,T", 0x46c00030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1225. {"c.un.d", "S,T", 0x46200031, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1226. {"c.un.d", "M,S,T", 0x46200031, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1227. {"c.un.s", "S,T", 0x46000031, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1228. {"c.un.s", "M,S,T", 0x46000031, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1229. {"c.un.ps", "S,T", 0x46c00031, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1230. {"c.un.ps", "M,S,T", 0x46c00031, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1231. {"c.eq.d", "S,T", 0x46200032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1232. {"c.eq.d", "M,S,T", 0x46200032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1233. {"c.eq.s", "S,T", 0x46000032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1234. {"c.eq.s", "M,S,T", 0x46000032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1235. {"c.eq.ob", "Y,Q", 0x78000001, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1236. {"c.eq.ob", "S,T", 0x4ac00001, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1237. {"c.eq.ob", "S,T[e]", 0x48000001, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1238. {"c.eq.ob", "S,k", 0x4bc00001, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1239. {"c.eq.ps", "S,T", 0x46c00032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1240. {"c.eq.ps", "M,S,T", 0x46c00032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1241. {"c.eq.qh", "Y,Q", 0x78200001, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, 0, MX },
  1242. {"c.ueq.d", "S,T", 0x46200033, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1243. {"c.ueq.d", "M,S,T", 0x46200033, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1244. {"c.ueq.s", "S,T", 0x46000033, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1245. {"c.ueq.s", "M,S,T", 0x46000033, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1246. {"c.ueq.ps","S,T", 0x46c00033, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1247. {"c.ueq.ps","M,S,T", 0x46c00033, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1248. {"c.olt.d", "S,T", 0x46200034, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1249. {"c.olt.d", "M,S,T", 0x46200034, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1250. {"c.olt.s", "S,T", 0x46000034, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1251. {"c.olt.s", "M,S,T", 0x46000034, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1252. {"c.olt.ps","S,T", 0x46c00034, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1253. {"c.olt.ps","M,S,T", 0x46c00034, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1254. {"c.ult.d", "S,T", 0x46200035, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1255. {"c.ult.d", "M,S,T", 0x46200035, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1256. {"c.ult.s", "S,T", 0x46000035, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1257. {"c.ult.s", "M,S,T", 0x46000035, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1258. {"c.ult.ps","S,T", 0x46c00035, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1259. {"c.ult.ps","M,S,T", 0x46c00035, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1260. {"c.ole.d", "S,T", 0x46200036, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1261. {"c.ole.d", "M,S,T", 0x46200036, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1262. {"c.ole.s", "S,T", 0x46000036, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1263. {"c.ole.s", "M,S,T", 0x46000036, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1264. {"c.ole.ps","S,T", 0x46c00036, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1265. {"c.ole.ps","M,S,T", 0x46c00036, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1266. {"c.ule.d", "S,T", 0x46200037, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1267. {"c.ule.d", "M,S,T", 0x46200037, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1268. {"c.ule.s", "S,T", 0x46000037, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1269. {"c.ule.s", "M,S,T", 0x46000037, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1270. {"c.ule.ps","S,T", 0x46c00037, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1271. {"c.ule.ps","M,S,T", 0x46c00037, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1272. {"c.sf.d", "S,T", 0x46200038, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1273. {"c.sf.d", "M,S,T", 0x46200038, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1274. {"c.sf.s", "S,T", 0x46000038, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1275. {"c.sf.s", "M,S,T", 0x46000038, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1276. {"c.sf.ps", "S,T", 0x46c00038, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1277. {"c.sf.ps", "M,S,T", 0x46c00038, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1278. {"c.ngle.d","S,T", 0x46200039, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1279. {"c.ngle.d","M,S,T", 0x46200039, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1280. {"c.ngle.s","S,T", 0x46000039, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1281. {"c.ngle.s","M,S,T", 0x46000039, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1282. {"c.ngle.ps","S,T", 0x46c00039, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1283. {"c.ngle.ps","M,S,T", 0x46c00039, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1284. {"c.seq.d", "S,T", 0x4620003a, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1285. {"c.seq.d", "M,S,T", 0x4620003a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1286. {"c.seq.s", "S,T", 0x4600003a, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1287. {"c.seq.s", "M,S,T", 0x4600003a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1288. {"c.seq.ps","S,T", 0x46c0003a, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1289. {"c.seq.ps","M,S,T", 0x46c0003a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1290. {"c.ngl.d", "S,T", 0x4620003b, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1291. {"c.ngl.d", "M,S,T", 0x4620003b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1292. {"c.ngl.s", "S,T", 0x4600003b, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1293. {"c.ngl.s", "M,S,T", 0x4600003b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1294. {"c.ngl.ps","S,T", 0x46c0003b, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1295. {"c.ngl.ps","M,S,T", 0x46c0003b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1296. {"c.lt.d", "S,T", 0x4620003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1297. {"c.lt.d", "M,S,T", 0x4620003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1298. {"c.lt.s", "S,T", 0x4600003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1299. {"c.lt.s", "M,S,T", 0x4600003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1300. {"c.lt.ob", "Y,Q", 0x78000004, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1301. {"c.lt.ob", "S,T", 0x4ac00004, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1302. {"c.lt.ob", "S,T[e]", 0x48000004, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1303. {"c.lt.ob", "S,k", 0x4bc00004, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1304. {"c.lt.ps", "S,T", 0x46c0003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1305. {"c.lt.ps", "M,S,T", 0x46c0003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1306. {"c.lt.qh", "Y,Q", 0x78200004, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, 0, MX },
  1307. {"c.nge.d", "S,T", 0x4620003d, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1308. {"c.nge.d", "M,S,T", 0x4620003d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1309. {"c.nge.s", "S,T", 0x4600003d, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1310. {"c.nge.s", "M,S,T", 0x4600003d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1311. {"c.nge.ps","S,T", 0x46c0003d, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1312. {"c.nge.ps","M,S,T", 0x46c0003d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1313. {"c.le.d", "S,T", 0x4620003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1314. {"c.le.d", "M,S,T", 0x4620003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1315. {"c.le.s", "S,T", 0x4600003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1316. {"c.le.s", "M,S,T", 0x4600003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1317. {"c.le.ob", "Y,Q", 0x78000005, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1318. {"c.le.ob", "S,T", 0x4ac00005, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1319. {"c.le.ob", "S,T[e]", 0x48000005, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1320. {"c.le.ob", "S,k", 0x4bc00005, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1321. {"c.le.ps", "S,T", 0x46c0003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1322. {"c.le.ps", "M,S,T", 0x46c0003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1323. {"c.le.qh", "Y,Q", 0x78200005, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, 0, MX },
  1324. {"c.ngt.d", "S,T", 0x4620003f, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
  1325. {"c.ngt.d", "M,S,T", 0x4620003f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I4|I32 },
  1326. {"c.ngt.s", "S,T", 0x4600003f, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, 0, I1 },
  1327. {"c.ngt.s", "M,S,T", 0x4600003f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, I4|I32 },
  1328. {"c.ngt.ps","S,T", 0x46c0003f, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1329. {"c.ngt.ps","M,S,T", 0x46c0003f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, I5|I33 },
  1330. {"cabs.eq.d", "M,S,T", 0x46200072, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1331. {"cabs.eq.ps", "M,S,T", 0x46c00072, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1332. {"cabs.eq.s", "M,S,T", 0x46000072, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1333. {"cabs.f.d", "M,S,T", 0x46200070, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1334. {"cabs.f.ps", "M,S,T", 0x46c00070, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1335. {"cabs.f.s", "M,S,T", 0x46000070, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1336. {"cabs.le.d", "M,S,T", 0x4620007e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1337. {"cabs.le.ps", "M,S,T", 0x46c0007e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1338. {"cabs.le.s", "M,S,T", 0x4600007e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1339. {"cabs.lt.d", "M,S,T", 0x4620007c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1340. {"cabs.lt.ps", "M,S,T", 0x46c0007c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1341. {"cabs.lt.s", "M,S,T", 0x4600007c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1342. {"cabs.nge.d", "M,S,T", 0x4620007d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1343. {"cabs.nge.ps","M,S,T", 0x46c0007d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1344. {"cabs.nge.s", "M,S,T", 0x4600007d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1345. {"cabs.ngl.d", "M,S,T", 0x4620007b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1346. {"cabs.ngl.ps","M,S,T", 0x46c0007b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1347. {"cabs.ngl.s", "M,S,T", 0x4600007b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1348. {"cabs.ngle.d","M,S,T", 0x46200079, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1349. {"cabs.ngle.ps","M,S,T",0x46c00079, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1350. {"cabs.ngle.s","M,S,T", 0x46000079, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1351. {"cabs.ngt.d", "M,S,T", 0x4620007f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1352. {"cabs.ngt.ps","M,S,T", 0x46c0007f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1353. {"cabs.ngt.s", "M,S,T", 0x4600007f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1354. {"cabs.ole.d", "M,S,T", 0x46200076, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1355. {"cabs.ole.ps","M,S,T", 0x46c00076, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1356. {"cabs.ole.s", "M,S,T", 0x46000076, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1357. {"cabs.olt.d", "M,S,T", 0x46200074, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1358. {"cabs.olt.ps","M,S,T", 0x46c00074, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1359. {"cabs.olt.s", "M,S,T", 0x46000074, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1360. {"cabs.seq.d", "M,S,T", 0x4620007a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1361. {"cabs.seq.ps","M,S,T", 0x46c0007a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1362. {"cabs.seq.s", "M,S,T", 0x4600007a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1363. {"cabs.sf.d", "M,S,T", 0x46200078, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1364. {"cabs.sf.ps", "M,S,T", 0x46c00078, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1365. {"cabs.sf.s", "M,S,T", 0x46000078, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1366. {"cabs.ueq.d", "M,S,T", 0x46200073, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1367. {"cabs.ueq.ps","M,S,T", 0x46c00073, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1368. {"cabs.ueq.s", "M,S,T", 0x46000073, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1369. {"cabs.ule.d", "M,S,T", 0x46200077, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1370. {"cabs.ule.ps","M,S,T", 0x46c00077, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1371. {"cabs.ule.s", "M,S,T", 0x46000077, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1372. {"cabs.ult.d", "M,S,T", 0x46200075, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1373. {"cabs.ult.ps","M,S,T", 0x46c00075, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1374. {"cabs.ult.s", "M,S,T", 0x46000075, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1375. {"cabs.un.d", "M,S,T", 0x46200071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1376. {"cabs.un.ps", "M,S,T", 0x46c00071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
  1377. {"cabs.un.s", "M,S,T", 0x46000071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
  1378. /* CW4010 instructions which are aliases for the cache instruction. */
  1379. {"flushi", "", 0xbc010000, 0xffffffff, 0, 0, L1 },
  1380. {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 },
  1381. {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 },
  1382. {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 },
  1383. {"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3},
  1384. {"cache", "k,A(b)", 0, (int) M_CACHE_AB, INSN_MACRO, 0, I3|I32|T3},
  1385. {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 },
  1386. {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 },
  1387. {"ceil.w.d", "D,S", 0x4620000e, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 },
  1388. {"ceil.w.s", "D,S", 0x4600000e, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
  1389. {"cfc0", "t,G", 0x40400000, 0xffe007ff, LCD|WR_t|RD_C0, 0, I1 },
  1390. {"cfc1", "t,G", 0x44400000, 0xffe007ff, LCD|WR_t|RD_C1|FP_S, 0, I1 },
  1391. {"cfc1", "t,S", 0x44400000, 0xffe007ff, LCD|WR_t|RD_C1|FP_S, 0, I1 },
  1392. /* cfc2 is at the bottom of the table. */
  1393. /* cfc3 is at the bottom of the table. */
  1394. {"cftc1", "d,E", 0x41000023, 0xffe007ff, TRAP|LCD|WR_d|RD_C1|FP_S, 0, MT32 },
  1395. {"cftc1", "d,T", 0x41000023, 0xffe007ff, TRAP|LCD|WR_d|RD_C1|FP_S, 0, MT32 },
  1396. {"cftc2", "d,E", 0x41000025, 0xffe007ff, TRAP|LCD|WR_d|RD_C2, 0, MT32 },
  1397. {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 },
  1398. {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 },
  1399. {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 },
  1400. {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 },
  1401. {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 },
  1402. /* ctc2 is at the bottom of the table. */
  1403. /* ctc3 is at the bottom of the table. */
  1404. {"cttc1", "t,g", 0x41800023, 0xffe007ff, TRAP|COD|RD_t|WR_CC|FP_S, 0, MT32 },
  1405. {"cttc1", "t,S", 0x41800023, 0xffe007ff, TRAP|COD|RD_t|WR_CC|FP_S, 0, MT32 },
  1406. {"cttc2", "t,g", 0x41800025, 0xffe007ff, TRAP|COD|RD_t|WR_CC, 0, MT32 },
  1407. {"cvt.d.l", "D,S", 0x46a00021, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 },
  1408. {"cvt.d.s", "D,S", 0x46000021, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I1 },
  1409. {"cvt.d.w", "D,S", 0x46800021, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I1 },
  1410. {"cvt.l.d", "D,S", 0x46200025, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 },
  1411. {"cvt.l.s", "D,S", 0x46000025, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 },
  1412. {"cvt.s.l", "D,S", 0x46a00020, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 },
  1413. {"cvt.s.d", "D,S", 0x46200020, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I1 },
  1414. {"cvt.s.w", "D,S", 0x46800020, 0xffff003f, WR_D|RD_S|FP_S, 0, I1 },
  1415. {"cvt.s.pl","D,S", 0x46c00028, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I5|I33 },
  1416. {"cvt.s.pu","D,S", 0x46c00020, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I5|I33 },
  1417. {"cvt.w.d", "D,S", 0x46200024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I1 },
  1418. {"cvt.w.s", "D,S", 0x46000024, 0xffff003f, WR_D|RD_S|FP_S, 0, I1 },
  1419. {"cvt.ps.pw", "D,S", 0x46800026, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D },
  1420. {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_S|FP_D, 0, I5|I33 },
  1421. {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D },
  1422. {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 },
  1423. {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
  1424. {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, 0, I3 },
  1425. {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, 0, I3 },
  1426. {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, 0, I3 },
  1427. {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
  1428. {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3 },
  1429. {"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5 },
  1430. {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 },
  1431. {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 },
  1432. /* dctr and dctw are used on the r5000. */
  1433. {"dctr", "o(b)", 0xbc050000, 0xfc1f0000, RD_b, 0, I3 },
  1434. {"dctw", "o(b)", 0xbc090000, 0xfc1f0000, RD_b, 0, I3 },
  1435. {"deret", "", 0x4200001f, 0xffffffff, 0, 0, I32|G2 },
  1436. {"dext", "t,r,I,+I", 0, (int) M_DEXT, INSN_MACRO, 0, I65 },
  1437. {"dext", "t,r,+A,+C", 0x7c000003, 0xfc00003f, WR_t|RD_s, 0, I65 },
  1438. {"dextm", "t,r,+A,+G", 0x7c000001, 0xfc00003f, WR_t|RD_s, 0, I65 },
  1439. {"dextu", "t,r,+E,+H", 0x7c000002, 0xfc00003f, WR_t|RD_s, 0, I65 },
  1440. /* For ddiv, see the comments about div. */
  1441. {"ddiv", "z,s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
  1442. {"ddiv", "d,v,t", 0, (int) M_DDIV_3, INSN_MACRO, 0, I3 },
  1443. {"ddiv", "d,v,I", 0, (int) M_DDIV_3I, INSN_MACRO, 0, I3 },
  1444. /* For ddivu, see the comments about div. */
  1445. {"ddivu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
  1446. {"ddivu", "d,v,t", 0, (int) M_DDIVU_3, INSN_MACRO, 0, I3 },
  1447. {"ddivu", "d,v,I", 0, (int) M_DDIVU_3I, INSN_MACRO, 0, I3 },
  1448. {"di", "", 0x41606000, 0xffffffff, WR_t|WR_C0, 0, I33 },
  1449. {"di", "t", 0x41606000, 0xffe0ffff, WR_t|WR_C0, 0, I33 },
  1450. {"dins", "t,r,I,+I", 0, (int) M_DINS, INSN_MACRO, 0, I65 },
  1451. {"dins", "t,r,+A,+B", 0x7c000007, 0xfc00003f, WR_t|RD_s, 0, I65 },
  1452. {"dinsm", "t,r,+A,+F", 0x7c000005, 0xfc00003f, WR_t|RD_s, 0, I65 },
  1453. {"dinsu", "t,r,+E,+F", 0x7c000006, 0xfc00003f, WR_t|RD_s, 0, I65 },
  1454. /* The MIPS assembler treats the div opcode with two operands as
  1455. though the first operand appeared twice (the first operand is both
  1456. a source and a destination). To get the div machine instruction,
  1457. you must use an explicit destination of $0. */
  1458. {"div", "z,s,t", 0x0000001a, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I1 },
  1459. {"div", "z,t", 0x0000001a, 0xffe0ffff, RD_s|RD_t|WR_HILO, 0, I1 },
  1460. {"div", "d,v,t", 0, (int) M_DIV_3, INSN_MACRO, 0, I1 },
  1461. {"div", "d,v,I", 0, (int) M_DIV_3I, INSN_MACRO, 0, I1 },
  1462. {"div.d", "D,V,T", 0x46200003, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I1 },
  1463. {"div.s", "D,V,T", 0x46000003, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, I1 },
  1464. {"div.ps", "D,V,T", 0x46c00003, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, SB1 },
  1465. /* For divu, see the comments about div. */
  1466. {"divu", "z,s,t", 0x0000001b, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I1 },
  1467. {"divu", "z,t", 0x0000001b, 0xffe0ffff, RD_s|RD_t|WR_HILO, 0, I1 },
  1468. {"divu", "d,v,t", 0, (int) M_DIVU_3, INSN_MACRO, 0, I1 },
  1469. {"divu", "d,v,I", 0, (int) M_DIVU_3I, INSN_MACRO, 0, I1 },
  1470. {"dla", "t,A(b)", 0, (int) M_DLA_AB, INSN_MACRO, 0, I3 },
  1471. {"dlca", "t,A(b)", 0, (int) M_DLCA_AB, INSN_MACRO, 0, I3 },
  1472. {"dli", "t,j", 0x24000000, 0xffe00000, WR_t, 0, I3 }, /* addiu */
  1473. {"dli", "t,i", 0x34000000, 0xffe00000, WR_t, 0, I3 }, /* ori */
  1474. {"dli", "t,I", 0, (int) M_DLI, INSN_MACRO, 0, I3 },
  1475. {"dmacc", "d,s,t", 0x00000029, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1476. {"dmacchi", "d,s,t", 0x00000229, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1477. {"dmacchis", "d,s,t", 0x00000629, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1478. {"dmacchiu", "d,s,t", 0x00000269, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1479. {"dmacchius", "d,s,t", 0x00000669, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1480. {"dmaccs", "d,s,t", 0x00000429, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1481. {"dmaccu", "d,s,t", 0x00000069, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1482. {"dmaccus", "d,s,t", 0x00000469, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, 0, N412 },
  1483. {"dmadd16", "s,t", 0x00000029, 0xfc00ffff, RD_s|RD_t|MOD_LO, 0, N411 },
  1484. {"dmfc0", "t,G", 0x40200000, 0xffe007ff, LCD|WR_t|RD_C0, 0, I3 },
  1485. {"dmfc0", "t,+D", 0x40200000, 0xffe007f8, LCD|WR_t|RD_C0, 0, I64 },
  1486. {"dmfc0", "t,G,H", 0x40200000, 0xffe007f8, LCD|WR_t|RD_C0, 0, I64 },
  1487. {"dmt", "", 0x41600bc1, 0xffffffff, TRAP, 0, MT32 },
  1488. {"dmt", "t", 0x41600bc1, 0xffe0ffff, TRAP|WR_t, 0, MT32 },
  1489. {"dmtc0", "t,G", 0x40a00000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC, 0, I3 },
  1490. {"dmtc0", "t,+D", 0x40a00000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, 0, I64 },
  1491. {"dmtc0", "t,G,H", 0x40a00000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, 0, I64 },
  1492. {"dmfc1", "t,S", 0x44200000, 0xffe007ff, LCD|WR_t|RD_S|FP_D, 0, I3 },
  1493. {"dmfc1", "t,G", 0x44200000, 0xffe007ff, LCD|WR_t|RD_S|FP_D, 0, I3 },
  1494. {"dmtc1", "t,S", 0x44a00000, 0xffe007ff, COD|RD_t|WR_S|FP_D, 0, I3 },
  1495. {"dmtc1", "t,G", 0x44a00000, 0xffe007ff, COD|RD_t|WR_S|FP_D, 0, I3 },
  1496. /* dmfc2 is at the bottom of the table. */
  1497. /* dmtc2 is at the bottom of the table. */
  1498. /* dmfc3 is at the bottom of the table. */
  1499. /* dmtc3 is at the bottom of the table. */
  1500. {"dmul", "d,v,t", 0, (int) M_DMUL, INSN_MACRO, 0, I3 },
  1501. {"dmul", "d,v,I", 0, (int) M_DMUL_I, INSN_MACRO, 0, I3 },
  1502. {"dmulo", "d,v,t", 0, (int) M_DMULO, INSN_MACRO, 0, I3 },
  1503. {"dmulo", "d,v,I", 0, (int) M_DMULO_I, INSN_MACRO, 0, I3 },
  1504. {"dmulou", "d,v,t", 0, (int) M_DMULOU, INSN_MACRO, 0, I3 },
  1505. {"dmulou", "d,v,I", 0, (int) M_DMULOU_I, INSN_MACRO, 0, I3 },
  1506. {"dmult", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
  1507. {"dmultu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
  1508. {"dneg", "d,w", 0x0000002e, 0xffe007ff, WR_d|RD_t, 0, I3 }, /* dsub 0 */
  1509. {"dnegu", "d,w", 0x0000002f, 0xffe007ff, WR_d|RD_t, 0, I3 }, /* dsubu 0*/
  1510. {"drem", "z,s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
  1511. {"drem", "d,v,t", 3, (int) M_DREM_3, INSN_MACRO, 0, I3 },
  1512. {"drem", "d,v,I", 3, (int) M_DREM_3I, INSN_MACRO, 0, I3 },
  1513. {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
  1514. {"dremu", "d,v,t", 3, (int) M_DREMU_3, INSN_MACRO, 0, I3 },
  1515. {"dremu", "d,v,I", 3, (int) M_DREMU_3I, INSN_MACRO, 0, I3 },
  1516. {"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5 },
  1517. {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I3 },
  1518. {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I3 },
  1519. {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I3 },
  1520. {"dror", "d,v,I", 0, (int) M_DROR_I, INSN_MACRO, 0, I3 },
  1521. {"dror", "d,w,<", 0x0020003a, 0xffe0003f, WR_d|RD_t, 0, N5|I65 },
  1522. {"drorv", "d,t,s", 0x00000056, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I65 },
  1523. {"dror32", "d,w,<", 0x0020003e, 0xffe0003f, WR_d|RD_t, 0, N5|I65 },
  1524. {"drotl", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I65 },
  1525. {"drotl", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I65 },
  1526. {"drotr", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I65 },
  1527. {"drotr", "d,v,I", 0, (int) M_DROR_I, INSN_MACRO, 0, I65 },
  1528. {"drotrv", "d,t,s", 0x00000056, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I65 },
  1529. {"drotr32", "d,w,<", 0x0020003e, 0xffe0003f, WR_d|RD_t, 0, I65 },
  1530. {"dsbh", "d,w", 0x7c0000a4, 0xffe007ff, WR_d|RD_t, 0, I65 },
  1531. {"dshd", "d,w", 0x7c000164, 0xffe007ff, WR_d|RD_t, 0, I65 },
  1532. {"dsllv", "d,t,s", 0x00000014, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I3 },
  1533. {"dsll32", "d,w,<", 0x0000003c, 0xffe0003f, WR_d|RD_t, 0, I3 },
  1534. {"dsll", "d,w,s", 0x00000014, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I3 }, /* dsllv */
  1535. {"dsll", "d,w,>", 0x0000003c, 0xffe0003f, WR_d|RD_t, 0, I3 }, /* dsll32 */
  1536. {"dsll", "d,w,<", 0x00000038, 0xffe0003f, WR_d|RD_t, 0, I3 },
  1537. {"dsrav", "d,t,s", 0x00000017, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I3 },
  1538. {"dsra32", "d,w,<", 0x0000003f, 0xffe0003f, WR_d|RD_t, 0, I3 },
  1539. {"dsra", "d,w,s", 0x00000017, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I3 }, /* dsrav */
  1540. {"dsra", "d,w,>", 0x0000003f, 0xffe0003f, WR_d|RD_t, 0, I3 }, /* dsra32 */
  1541. {"dsra", "d,w,<", 0x0000003b, 0xffe0003f, WR_d|RD_t, 0, I3 },
  1542. {"dsrlv", "d,t,s", 0x00000016, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I3 },
  1543. {"dsrl32", "d,w,<", 0x0000003e, 0xffe0003f, WR_d|RD_t, 0, I3 },
  1544. {"dsrl", "d,w,s", 0x00000016, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I3 }, /* dsrlv */
  1545. {"dsrl", "d,w,>", 0x0000003e, 0xffe0003f, WR_d|RD_t, 0, I3 }, /* dsrl32 */
  1546. {"dsrl", "d,w,<", 0x0000003a, 0xffe0003f, WR_d|RD_t, 0, I3 },
  1547. {"dsub", "d,v,t", 0x0000002e, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
  1548. {"dsub", "d,v,I", 0, (int) M_DSUB_I, INSN_MACRO, 0, I3 },
  1549. {"dsubu", "d,v,t", 0x0000002f, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
  1550. {"dsubu", "d,v,I", 0, (int) M_DSUBU_I, INSN_MACRO, 0, I3 },
  1551. {"dvpe", "", 0x41600001, 0xffffffff, TRAP, 0, MT32 },
  1552. {"dvpe", "t", 0x41600001, 0xffe0ffff, TRAP|WR_t, 0, MT32 },
  1553. {"ei", "", 0x41606020, 0xffffffff, WR_t|WR_C0, 0, I33 },
  1554. {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 },
  1555. {"emt", "", 0x41600be1, 0xffffffff, TRAP, 0, MT32 },
  1556. {"emt", "t", 0x41600be1, 0xffe0ffff, TRAP|WR_t, 0, MT32 },
  1557. {"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32 },
  1558. {"evpe", "", 0x41600021, 0xffffffff, TRAP, 0, MT32 },
  1559. {"evpe", "t", 0x41600021, 0xffe0ffff, TRAP|WR_t, 0, MT32 },
  1560. {"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33 },
  1561. {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 },
  1562. {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 },
  1563. {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 },
  1564. {"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
  1565. {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 },
  1566. {"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 },
  1567. {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 },
  1568. /* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with
  1569. the same hazard barrier effect. */
  1570. {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, 0, I32 },
  1571. {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr */
  1572. /* SVR4 PIC code requires special handling for j, so it must be a
  1573. macro. */
  1574. {"j", "a", 0, (int) M_J_A, INSN_MACRO, 0, I1 },
  1575. /* This form of j is used by the disassembler and internally by the
  1576. assembler, but will never match user input (because the line above
  1577. will match first). */
  1578. {"j", "a", 0x08000000, 0xfc000000, UBD, 0, I1 },
  1579. {"jalr", "s", 0x0000f809, 0xfc1fffff, UBD|RD_s|WR_d, 0, I1 },
  1580. {"jalr", "d,s", 0x00000009, 0xfc1f07ff, UBD|RD_s|WR_d, 0, I1 },
  1581. /* jalr.hb is officially MIPS{32,64}R2, but it works on R1 as jalr
  1582. with the same hazard barrier effect. */
  1583. {"jalr.hb", "s", 0x0000fc09, 0xfc1fffff, UBD|RD_s|WR_d, 0, I32 },
  1584. {"jalr.hb", "d,s", 0x00000409, 0xfc1f07ff, UBD|RD_s|WR_d, 0, I32 },
  1585. /* SVR4 PIC code requires special handling for jal, so it must be a
  1586. macro. */
  1587. {"jal", "d,s", 0, (int) M_JAL_2, INSN_MACRO, 0, I1 },
  1588. {"jal", "s", 0, (int) M_JAL_1, INSN_MACRO, 0, I1 },
  1589. {"jal", "a", 0, (int) M_JAL_A, INSN_MACRO, 0, I1 },
  1590. /* This form of jal is used by the disassembler and internally by the
  1591. assembler, but will never match user input (because the line above
  1592. will match first). */
  1593. {"jal", "a", 0x0c000000, 0xfc000000, UBD|WR_31, 0, I1 },
  1594. {"jalx", "a", 0x74000000, 0xfc000000, UBD|WR_31, 0, I16 },
  1595. {"la", "t,A(b)", 0, (int) M_LA_AB, INSN_MACRO, 0, I1 },
  1596. {"lb", "t,o(b)", 0x80000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1597. {"lb", "t,A(b)", 0, (int) M_LB_AB, INSN_MACRO, 0, I1 },
  1598. {"lbu", "t,o(b)", 0x90000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1599. {"lbu", "t,A(b)", 0, (int) M_LBU_AB, INSN_MACRO, 0, I1 },
  1600. {"lca", "t,A(b)", 0, (int) M_LCA_AB, INSN_MACRO, 0, I1 },
  1601. {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, 0, I3 },
  1602. {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, 0, I1 },
  1603. {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1 },
  1604. {"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
  1605. {"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
  1606. {"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
  1607. {"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
  1608. {"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */
  1609. {"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 },
  1610. {"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 },
  1611. {"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
  1612. {"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 },
  1613. {"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
  1614. {"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 },
  1615. {"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 },
  1616. {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 },
  1617. {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 },
  1618. {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 },
  1619. {"ldxc1", "D,t(b)", 0x4c000001, 0xfc00f83f, LDD|WR_D|RD_t|RD_b|FP_D, 0, I4|I33 },
  1620. {"lh", "t,o(b)", 0x84000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1621. {"lh", "t,A(b)", 0, (int) M_LH_AB, INSN_MACRO, 0, I1 },
  1622. {"lhu", "t,o(b)", 0x94000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1623. {"lhu", "t,A(b)", 0, (int) M_LHU_AB, INSN_MACRO, 0, I1 },
  1624. /* li is at the start of the table. */
  1625. {"li.d", "t,F", 0, (int) M_LI_D, INSN_MACRO, 0, I1 },
  1626. {"li.d", "T,L", 0, (int) M_LI_DD, INSN_MACRO, 0, I1 },
  1627. {"li.s", "t,f", 0, (int) M_LI_S, INSN_MACRO, 0, I1 },
  1628. {"li.s", "T,l", 0, (int) M_LI_SS, INSN_MACRO, 0, I1 },
  1629. {"ll", "t,o(b)", 0xc0000000, 0xfc000000, LDD|RD_b|WR_t, 0, I2 },
  1630. {"ll", "t,A(b)", 0, (int) M_LL_AB, INSN_MACRO, 0, I2 },
  1631. {"lld", "t,o(b)", 0xd0000000, 0xfc000000, LDD|RD_b|WR_t, 0, I3 },
  1632. {"lld", "t,A(b)", 0, (int) M_LLD_AB, INSN_MACRO, 0, I3 },
  1633. {"lui", "t,u", 0x3c000000, 0xffe00000, WR_t, 0, I1 },
  1634. {"luxc1", "D,t(b)", 0x4c000005, 0xfc00f83f, LDD|WR_D|RD_t|RD_b|FP_D, 0, I5|I33|N55},
  1635. {"lw", "t,o(b)", 0x8c000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1636. {"lw", "t,A(b)", 0, (int) M_LW_AB, INSN_MACRO, 0, I1 },
  1637. {"lwc0", "E,o(b)", 0xc0000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
  1638. {"lwc0", "E,A(b)", 0, (int) M_LWC0_AB, INSN_MACRO, 0, I1 },
  1639. {"lwc1", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 },
  1640. {"lwc1", "E,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 },
  1641. {"lwc1", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
  1642. {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
  1643. {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */
  1644. {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
  1645. {"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
  1646. {"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 },
  1647. {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
  1648. {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 },
  1649. {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1650. {"lwl", "t,A(b)", 0, (int) M_LWL_AB, INSN_MACRO, 0, I1 },
  1651. {"lcache", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I2 }, /* same */
  1652. {"lcache", "t,A(b)", 0, (int) M_LWL_AB, INSN_MACRO, 0, I2 }, /* as lwl */
  1653. {"lwr", "t,o(b)", 0x98000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
  1654. {"lwr", "t,A(b)", 0, (int) M_LWR_AB, INSN_MACRO, 0, I1 },
  1655. {"flush", "t,o(b)", 0x98000000, 0xfc000000, LDD|RD_b|WR_t, 0, I2 }, /* same */
  1656. {"flush", "t,A(b)", 0, (int) M_LWR_AB, INSN_MACRO, 0, I2 }, /* as lwr */
  1657. {"fork", "d,s,t", 0x7c000008, 0xfc0007ff, TRAP|WR_d|RD_s|RD_t, 0, MT32 },
  1658. {"lwu", "t,o(b)", 0x9c000000, 0xfc000000, LDD|RD_b|WR_t, 0, I3 },
  1659. {"lwu", "t,A(b)", 0, (int) M_LWU_AB, INSN_MACRO, 0, I3 },
  1660. {"lwxc1", "D,t(b)", 0x4c000000, 0xfc00f83f, LDD|WR_D|RD_t|RD_b|FP_D, 0, I4|I33 },
  1661. {"lwxs", "d,t(b)", 0x70000088, 0xfc0007ff, LDD|RD_b|RD_t|WR_d, 0, SMT },
  1662. {"macc", "d,s,t", 0x00000028, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1663. {"macc", "d,s,t", 0x00000158, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1664. {"maccs", "d,s,t", 0x00000428, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1665. {"macchi", "d,s,t", 0x00000228, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1666. {"macchi", "d,s,t", 0x00000358, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1667. {"macchis", "d,s,t", 0x00000628, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1668. {"macchiu", "d,s,t", 0x00000268, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1669. {"macchiu", "d,s,t", 0x00000359, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1670. {"macchius","d,s,t", 0x00000668, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1671. {"maccu", "d,s,t", 0x00000068, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1672. {"maccu", "d,s,t", 0x00000159, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1673. {"maccus", "d,s,t", 0x00000468, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N412 },
  1674. {"mad", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, P3 },
  1675. {"madu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, P3 },
  1676. {"madd.d", "D,R,S,T", 0x4c000021, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I4|I33 },
  1677. {"madd.s", "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4|I33 },
  1678. {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5|I33 },
  1679. {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
  1680. {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
  1681. {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 },
  1682. {"madd", "7,s,t", 0x70000000, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  1683. {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
  1684. {"maddp", "s,t", 0x70000441, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, SMT },
  1685. {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
  1686. {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
  1687. {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 },
  1688. {"maddu", "7,s,t", 0x70000001, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  1689. {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
  1690. {"madd16", "s,t", 0x00000028, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, N411 },
  1691. {"max.ob", "X,Y,Q", 0x78000007, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1692. {"max.ob", "D,S,T", 0x4ac00007, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1693. {"max.ob", "D,S,T[e]", 0x48000007, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1694. {"max.ob", "D,S,k", 0x4bc00007, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1695. {"max.qh", "X,Y,Q", 0x78200007, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1696. {"mfpc", "t,P", 0x4000c801, 0xffe0ffc1, LCD|WR_t|RD_C0, 0, M1|N5 },
  1697. {"mfps", "t,P", 0x4000c800, 0xffe0ffc1, LCD|WR_t|RD_C0, 0, M1|N5 },
  1698. {"mftacx", "d", 0x41020021, 0xffff07ff, TRAP|WR_d|RD_a, 0, MT32 },
  1699. {"mftacx", "d,*", 0x41020021, 0xfff307ff, TRAP|WR_d|RD_a, 0, MT32 },
  1700. {"mftc0", "d,+t", 0x41000000, 0xffe007ff, TRAP|LCD|WR_d|RD_C0, 0, MT32 },
  1701. {"mftc0", "d,+T", 0x41000000, 0xffe007f8, TRAP|LCD|WR_d|RD_C0, 0, MT32 },
  1702. {"mftc0", "d,E,H", 0x41000000, 0xffe007f8, TRAP|LCD|WR_d|RD_C0, 0, MT32 },
  1703. {"mftc1", "d,T", 0x41000022, 0xffe007ff, TRAP|LCD|WR_d|RD_T|FP_S, 0, MT32 },
  1704. {"mftc1", "d,E", 0x41000022, 0xffe007ff, TRAP|LCD|WR_d|RD_T|FP_S, 0, MT32 },
  1705. {"mftc2", "d,E", 0x41000024, 0xffe007ff, TRAP|LCD|WR_d|RD_C2, 0, MT32 },
  1706. {"mftdsp", "d", 0x41100021, 0xffff07ff, TRAP|WR_d, 0, MT32 },
  1707. {"mftgpr", "d,t", 0x41000020, 0xffe007ff, TRAP|WR_d|RD_t, 0, MT32 },
  1708. {"mfthc1", "d,T", 0x41000032, 0xffe007ff, TRAP|LCD|WR_d|RD_T|FP_D, 0, MT32 },
  1709. {"mfthc1", "d,E", 0x41000032, 0xffe007ff, TRAP|LCD|WR_d|RD_T|FP_D, 0, MT32 },
  1710. {"mfthc2", "d,E", 0x41000034, 0xffe007ff, TRAP|LCD|WR_d|RD_C2, 0, MT32 },
  1711. {"mfthi", "d", 0x41010021, 0xffff07ff, TRAP|WR_d|RD_a, 0, MT32 },
  1712. {"mfthi", "d,*", 0x41010021, 0xfff307ff, TRAP|WR_d|RD_a, 0, MT32 },
  1713. {"mftlo", "d", 0x41000021, 0xffff07ff, TRAP|WR_d|RD_a, 0, MT32 },
  1714. {"mftlo", "d,*", 0x41000021, 0xfff307ff, TRAP|WR_d|RD_a, 0, MT32 },
  1715. {"mftr", "d,t,!,H,$", 0x41000000, 0xffe007c8, TRAP|WR_d, 0, MT32 },
  1716. {"mfc0", "t,G", 0x40000000, 0xffe007ff, LCD|WR_t|RD_C0, 0, I1 },
  1717. {"mfc0", "t,+D", 0x40000000, 0xffe007f8, LCD|WR_t|RD_C0, 0, I32 },
  1718. {"mfc0", "t,G,H", 0x40000000, 0xffe007f8, LCD|WR_t|RD_C0, 0, I32 },
  1719. {"mfc1", "t,S", 0x44000000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, 0, I1 },
  1720. {"mfc1", "t,G", 0x44000000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, 0, I1 },
  1721. {"mfhc1", "t,S", 0x44600000, 0xffe007ff, LCD|WR_t|RD_S|FP_D, 0, I33 },
  1722. {"mfhc1", "t,G", 0x44600000, 0xffe007ff, LCD|WR_t|RD_S|FP_D, 0, I33 },
  1723. /* mfc2 is at the bottom of the table. */
  1724. /* mfhc2 is at the bottom of the table. */
  1725. /* mfc3 is at the bottom of the table. */
  1726. {"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5 },
  1727. {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, 0, I1 },
  1728. {"mfhi", "d,9", 0x00000010, 0xff9f07ff, WR_d|RD_HI, 0, D32 },
  1729. {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, 0, I1 },
  1730. {"mflo", "d,9", 0x00000012, 0xff9f07ff, WR_d|RD_LO, 0, D32 },
  1731. {"mflhxu", "d", 0x00000052, 0xffff07ff, WR_d|MOD_HILO, 0, SMT },
  1732. {"min.ob", "X,Y,Q", 0x78000006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1733. {"min.ob", "D,S,T", 0x4ac00006, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1734. {"min.ob", "D,S,T[e]", 0x48000006, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1735. {"min.ob", "D,S,k", 0x4bc00006, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1736. {"min.qh", "X,Y,Q", 0x78200006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1737. {"mov.d", "D,S", 0x46200006, 0xffff003f, WR_D|RD_S|FP_D, 0, I1 },
  1738. {"mov.s", "D,S", 0x46000006, 0xffff003f, WR_D|RD_S|FP_S, 0, I1 },
  1739. {"mov.ps", "D,S", 0x46c00006, 0xffff003f, WR_D|RD_S|FP_D, 0, I5|I33 },
  1740. {"movf", "d,s,N", 0x00000001, 0xfc0307ff, WR_d|RD_s|RD_CC|FP_S|FP_D, 0, I4|I32 },
  1741. {"movf.d", "D,S,N", 0x46200011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I4|I32 },
  1742. {"movf.l", "D,S,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
  1743. {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
  1744. {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 },
  1745. {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5|I33 },
  1746. {"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 },
  1747. {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 },
  1748. {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 },
  1749. {"movn.l", "D,S,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
  1750. {"movn.l", "X,Y,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
  1751. {"movn.s", "D,S,t", 0x46000013, 0xffe0003f, WR_D|RD_S|RD_t|FP_S, 0, I4|I32 },
  1752. {"movn.ps", "D,S,t", 0x46c00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I5|I33 },
  1753. {"movt", "d,s,N", 0x00010001, 0xfc0307ff, WR_d|RD_s|RD_CC|FP_S|FP_D, 0, I4|I32 },
  1754. {"movt.d", "D,S,N", 0x46210011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I4|I32 },
  1755. {"movt.l", "D,S,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
  1756. {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
  1757. {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 },
  1758. {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5|I33 },
  1759. {"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 },
  1760. {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 },
  1761. {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 },
  1762. {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
  1763. {"movz.l", "X,Y,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
  1764. {"movz.s", "D,S,t", 0x46000012, 0xffe0003f, WR_D|RD_S|RD_t|FP_S, 0, I4|I32 },
  1765. {"movz.ps", "D,S,t", 0x46c00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I5|I33 },
  1766. {"msac", "d,s,t", 0x000001d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1767. {"msacu", "d,s,t", 0x000001d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1768. {"msachi", "d,s,t", 0x000003d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1769. {"msachiu", "d,s,t", 0x000003d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1770. /* move is at the top of the table. */
  1771. {"msgn.qh", "X,Y,Q", 0x78200000, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1772. {"msub.d", "D,R,S,T", 0x4c000029, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I4|I33 },
  1773. {"msub.s", "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4|I33 },
  1774. {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5|I33 },
  1775. {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
  1776. {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
  1777. {"msub", "7,s,t", 0x70000004, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  1778. {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
  1779. {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
  1780. {"msubu", "7,s,t", 0x70000005, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  1781. {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 },
  1782. {"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 },
  1783. {"mtc0", "t,G", 0x40800000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC, 0, I1 },
  1784. {"mtc0", "t,+D", 0x40800000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, 0, I32 },
  1785. {"mtc0", "t,G,H", 0x40800000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, 0, I32 },
  1786. {"mtc1", "t,S", 0x44800000, 0xffe007ff, COD|RD_t|WR_S|FP_S, 0, I1 },
  1787. {"mtc1", "t,G", 0x44800000, 0xffe007ff, COD|RD_t|WR_S|FP_S, 0, I1 },
  1788. {"mthc1", "t,S", 0x44e00000, 0xffe007ff, COD|RD_t|WR_S|FP_D, 0, I33 },
  1789. {"mthc1", "t,G", 0x44e00000, 0xffe007ff, COD|RD_t|WR_S|FP_D, 0, I33 },
  1790. /* mtc2 is at the bottom of the table. */
  1791. /* mthc2 is at the bottom of the table. */
  1792. /* mtc3 is at the bottom of the table. */
  1793. {"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5 },
  1794. {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, 0, I1 },
  1795. {"mthi", "s,7", 0x00000011, 0xfc1fe7ff, RD_s|WR_HI, 0, D32 },
  1796. {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, 0, I1 },
  1797. {"mtlo", "s,7", 0x00000013, 0xfc1fe7ff, RD_s|WR_LO, 0, D32 },
  1798. {"mtlhx", "s", 0x00000053, 0xfc1fffff, RD_s|MOD_HILO, 0, SMT },
  1799. {"mttc0", "t,G", 0x41800000, 0xffe007ff, TRAP|COD|RD_t|WR_C0|WR_CC, 0, MT32 },
  1800. {"mttc0", "t,+D", 0x41800000, 0xffe007f8, TRAP|COD|RD_t|WR_C0|WR_CC, 0, MT32 },
  1801. {"mttc0", "t,G,H", 0x41800000, 0xffe007f8, TRAP|COD|RD_t|WR_C0|WR_CC, 0, MT32 },
  1802. {"mttc1", "t,S", 0x41800022, 0xffe007ff, TRAP|COD|RD_t|WR_S|FP_S, 0, MT32 },
  1803. {"mttc1", "t,G", 0x41800022, 0xffe007ff, TRAP|COD|RD_t|WR_S|FP_S, 0, MT32 },
  1804. {"mttc2", "t,g", 0x41800024, 0xffe007ff, TRAP|COD|RD_t|WR_C2|WR_CC, 0, MT32 },
  1805. {"mttacx", "t", 0x41801021, 0xffe0ffff, TRAP|WR_a|RD_t, 0, MT32 },
  1806. {"mttacx", "t,&", 0x41801021, 0xffe09fff, TRAP|WR_a|RD_t, 0, MT32 },
  1807. {"mttdsp", "t", 0x41808021, 0xffe0ffff, TRAP|RD_t, 0, MT32 },
  1808. {"mttgpr", "t,d", 0x41800020, 0xffe007ff, TRAP|WR_d|RD_t, 0, MT32 },
  1809. {"mtthc1", "t,S", 0x41800032, 0xffe007ff, TRAP|COD|RD_t|WR_S|FP_D, 0, MT32 },
  1810. {"mtthc1", "t,G", 0x41800032, 0xffe007ff, TRAP|COD|RD_t|WR_S|FP_D, 0, MT32 },
  1811. {"mtthc2", "t,g", 0x41800034, 0xffe007ff, TRAP|COD|RD_t|WR_C2|WR_CC, 0, MT32 },
  1812. {"mtthi", "t", 0x41800821, 0xffe0ffff, TRAP|WR_a|RD_t, 0, MT32 },
  1813. {"mtthi", "t,&", 0x41800821, 0xffe09fff, TRAP|WR_a|RD_t, 0, MT32 },
  1814. {"mttlo", "t", 0x41800021, 0xffe0ffff, TRAP|WR_a|RD_t, 0, MT32 },
  1815. {"mttlo", "t,&", 0x41800021, 0xffe09fff, TRAP|WR_a|RD_t, 0, MT32 },
  1816. {"mttr", "t,d,!,H,$", 0x41800000, 0xffe007c8, TRAP|RD_t, 0, MT32 },
  1817. {"mul.d", "D,V,T", 0x46200002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I1 },
  1818. {"mul.s", "D,V,T", 0x46000002, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, I1 },
  1819. {"mul.ob", "X,Y,Q", 0x78000030, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1820. {"mul.ob", "D,S,T", 0x4ac00030, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1821. {"mul.ob", "D,S,T[e]", 0x48000030, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1822. {"mul.ob", "D,S,k", 0x4bc00030, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1823. {"mul.ps", "D,V,T", 0x46c00002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1824. {"mul.qh", "X,Y,Q", 0x78200030, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1825. {"mul", "d,v,t", 0x70000002, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, I32|P3|N55},
  1826. {"mul", "d,s,t", 0x00000058, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N54 },
  1827. {"mul", "d,v,t", 0, (int) M_MUL, INSN_MACRO, 0, I1 },
  1828. {"mul", "d,v,I", 0, (int) M_MUL_I, INSN_MACRO, 0, I1 },
  1829. {"mula.ob", "Y,Q", 0x78000033, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  1830. {"mula.ob", "S,T", 0x4ac00033, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1831. {"mula.ob", "S,T[e]", 0x48000033, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1832. {"mula.ob", "S,k", 0x4bc00033, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1833. {"mula.qh", "Y,Q", 0x78200033, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  1834. {"mulhi", "d,s,t", 0x00000258, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1835. {"mulhiu", "d,s,t", 0x00000259, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1836. {"mull.ob", "Y,Q", 0x78000433, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  1837. {"mull.ob", "S,T", 0x4ac00433, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1838. {"mull.ob", "S,T[e]", 0x48000433, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1839. {"mull.ob", "S,k", 0x4bc00433, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1840. {"mull.qh", "Y,Q", 0x78200433, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  1841. {"mulo", "d,v,t", 0, (int) M_MULO, INSN_MACRO, 0, I1 },
  1842. {"mulo", "d,v,I", 0, (int) M_MULO_I, INSN_MACRO, 0, I1 },
  1843. {"mulou", "d,v,t", 0, (int) M_MULOU, INSN_MACRO, 0, I1 },
  1844. {"mulou", "d,v,I", 0, (int) M_MULOU_I, INSN_MACRO, 0, I1 },
  1845. {"mulr.ps", "D,S,T", 0x46c0001a, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, M3D },
  1846. {"muls", "d,s,t", 0x000000d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1847. {"mulsu", "d,s,t", 0x000000d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1848. {"mulshi", "d,s,t", 0x000002d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1849. {"mulshiu", "d,s,t", 0x000002d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1850. {"muls.ob", "Y,Q", 0x78000032, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  1851. {"muls.ob", "S,T", 0x4ac00032, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1852. {"muls.ob", "S,T[e]", 0x48000032, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1853. {"muls.ob", "S,k", 0x4bc00032, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1854. {"muls.qh", "Y,Q", 0x78200032, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  1855. {"mulsl.ob", "Y,Q", 0x78000432, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  1856. {"mulsl.ob", "S,T", 0x4ac00432, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1857. {"mulsl.ob", "S,T[e]", 0x48000432, 0xfe2007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1858. {"mulsl.ob", "S,k", 0x4bc00432, 0xffe007ff, WR_CC|RD_S|RD_T, 0, N54 },
  1859. {"mulsl.qh", "Y,Q", 0x78200432, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  1860. {"mult", "s,t", 0x00000018, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, I1 },
  1861. {"mult", "7,s,t", 0x00000018, 0xfc00e7ff, WR_a|RD_s|RD_t, 0, D33 },
  1862. {"mult", "d,s,t", 0x00000018, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
  1863. {"multp", "s,t", 0x00000459, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, SMT },
  1864. {"multu", "s,t", 0x00000019, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, I1 },
  1865. {"multu", "7,s,t", 0x00000019, 0xfc00e7ff, WR_a|RD_s|RD_t, 0, D33 },
  1866. {"multu", "d,s,t", 0x00000019, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
  1867. {"mulu", "d,s,t", 0x00000059, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, 0, N5 },
  1868. {"neg", "d,w", 0x00000022, 0xffe007ff, WR_d|RD_t, 0, I1 }, /* sub 0 */
  1869. {"negu", "d,w", 0x00000023, 0xffe007ff, WR_d|RD_t, 0, I1 }, /* subu 0 */
  1870. {"neg.d", "D,V", 0x46200007, 0xffff003f, WR_D|RD_S|FP_D, 0, I1 },
  1871. {"neg.s", "D,V", 0x46000007, 0xffff003f, WR_D|RD_S|FP_S, 0, I1 },
  1872. {"neg.ps", "D,V", 0x46c00007, 0xffff003f, WR_D|RD_S|FP_D, 0, I5|I33 },
  1873. {"nmadd.d", "D,R,S,T", 0x4c000031, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I4|I33 },
  1874. {"nmadd.s", "D,R,S,T", 0x4c000030, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4|I33 },
  1875. {"nmadd.ps","D,R,S,T", 0x4c000036, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5|I33 },
  1876. {"nmsub.d", "D,R,S,T", 0x4c000039, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I4|I33 },
  1877. {"nmsub.s", "D,R,S,T", 0x4c000038, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4|I33 },
  1878. {"nmsub.ps","D,R,S,T", 0x4c00003e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5|I33 },
  1879. /* nop is at the start of the table. */
  1880. {"nor", "d,v,t", 0x00000027, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  1881. {"nor", "t,r,I", 0, (int) M_NOR_I, INSN_MACRO, 0, I1 },
  1882. {"nor.ob", "X,Y,Q", 0x7800000f, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1883. {"nor.ob", "D,S,T", 0x4ac0000f, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1884. {"nor.ob", "D,S,T[e]", 0x4800000f, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1885. {"nor.ob", "D,S,k", 0x4bc0000f, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1886. {"nor.qh", "X,Y,Q", 0x7820000f, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1887. {"not", "d,v", 0x00000027, 0xfc1f07ff, WR_d|RD_s|RD_t, 0, I1 },/*nor d,s,0*/
  1888. {"or", "d,v,t", 0x00000025, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  1889. {"or", "t,r,I", 0, (int) M_OR_I, INSN_MACRO, 0, I1 },
  1890. {"or.ob", "X,Y,Q", 0x7800000e, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1891. {"or.ob", "D,S,T", 0x4ac0000e, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1892. {"or.ob", "D,S,T[e]", 0x4800000e, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1893. {"or.ob", "D,S,k", 0x4bc0000e, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1894. {"or.qh", "X,Y,Q", 0x7820000e, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1895. {"ori", "t,r,i", 0x34000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  1896. {"pabsdiff.ob", "X,Y,Q",0x78000009, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, SB1 },
  1897. {"pabsdiffc.ob", "Y,Q", 0x78000035, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, SB1 },
  1898. {"pavg.ob", "X,Y,Q", 0x78000008, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, SB1 },
  1899. {"pickf.ob", "X,Y,Q", 0x78000002, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1900. {"pickf.ob", "D,S,T", 0x4ac00002, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1901. {"pickf.ob", "D,S,T[e]",0x48000002, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1902. {"pickf.ob", "D,S,k", 0x4bc00002, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1903. {"pickf.qh", "X,Y,Q", 0x78200002, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1904. {"pickt.ob", "X,Y,Q", 0x78000003, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  1905. {"pickt.ob", "D,S,T", 0x4ac00003, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1906. {"pickt.ob", "D,S,T[e]",0x48000003, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  1907. {"pickt.ob", "D,S,k", 0x4bc00003, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  1908. {"pickt.qh", "X,Y,Q", 0x78200003, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  1909. {"pll.ps", "D,V,T", 0x46c0002c, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1910. {"plu.ps", "D,V,T", 0x46c0002d, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1911. /* pref and prefx are at the start of the table. */
  1912. {"pul.ps", "D,V,T", 0x46c0002e, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1913. {"puu.ps", "D,V,T", 0x46c0002f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  1914. {"pperm", "s,t", 0x70000481, 0xfc00ffff, MOD_HILO|RD_s|RD_t, 0, SMT },
  1915. {"rach.ob", "X", 0x7a00003f, 0xfffff83f, WR_D|FP_D, RD_MACC, MX|SB1 },
  1916. {"rach.ob", "D", 0x4a00003f, 0xfffff83f, WR_D, 0, N54 },
  1917. {"rach.qh", "X", 0x7a20003f, 0xfffff83f, WR_D|FP_D, RD_MACC, MX },
  1918. {"racl.ob", "X", 0x7800003f, 0xfffff83f, WR_D|FP_D, RD_MACC, MX|SB1 },
  1919. {"racl.ob", "D", 0x4800003f, 0xfffff83f, WR_D, 0, N54 },
  1920. {"racl.qh", "X", 0x7820003f, 0xfffff83f, WR_D|FP_D, RD_MACC, MX },
  1921. {"racm.ob", "X", 0x7900003f, 0xfffff83f, WR_D|FP_D, RD_MACC, MX|SB1 },
  1922. {"racm.ob", "D", 0x4900003f, 0xfffff83f, WR_D, 0, N54 },
  1923. {"racm.qh", "X", 0x7920003f, 0xfffff83f, WR_D|FP_D, RD_MACC, MX },
  1924. {"recip.d", "D,S", 0x46200015, 0xffff003f, WR_D|RD_S|FP_D, 0, I4|I33 },
  1925. {"recip.ps","D,S", 0x46c00015, 0xffff003f, WR_D|RD_S|FP_D, 0, SB1 },
  1926. {"recip.s", "D,S", 0x46000015, 0xffff003f, WR_D|RD_S|FP_S, 0, I4|I33 },
  1927. {"recip1.d", "D,S", 0x4620001d, 0xffff003f, WR_D|RD_S|FP_D, 0, M3D },
  1928. {"recip1.ps", "D,S", 0x46c0001d, 0xffff003f, WR_D|RD_S|FP_S, 0, M3D },
  1929. {"recip1.s", "D,S", 0x4600001d, 0xffff003f, WR_D|RD_S|FP_S, 0, M3D },
  1930. {"recip2.d", "D,S,T", 0x4620001c, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, M3D },
  1931. {"recip2.ps", "D,S,T", 0x46c0001c, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, M3D },
  1932. {"recip2.s", "D,S,T", 0x4600001c, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, M3D },
  1933. {"rem", "z,s,t", 0x0000001a, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I1 },
  1934. {"rem", "d,v,t", 0, (int) M_REM_3, INSN_MACRO, 0, I1 },
  1935. {"rem", "d,v,I", 0, (int) M_REM_3I, INSN_MACRO, 0, I1 },
  1936. {"remu", "z,s,t", 0x0000001b, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I1 },
  1937. {"remu", "d,v,t", 0, (int) M_REMU_3, INSN_MACRO, 0, I1 },
  1938. {"remu", "d,v,I", 0, (int) M_REMU_3I, INSN_MACRO, 0, I1 },
  1939. {"rdhwr", "t,K", 0x7c00003b, 0xffe007ff, WR_t, 0, I33 },
  1940. {"rdpgpr", "d,w", 0x41400000, 0xffe007ff, WR_d, 0, I33 },
  1941. {"rfe", "", 0x42000010, 0xffffffff, 0, 0, I1|T3 },
  1942. {"rnas.qh", "X,Q", 0x78200025, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
  1943. {"rnau.ob", "X,Q", 0x78000021, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX|SB1 },
  1944. {"rnau.qh", "X,Q", 0x78200021, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
  1945. {"rnes.qh", "X,Q", 0x78200026, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
  1946. {"rneu.ob", "X,Q", 0x78000022, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX|SB1 },
  1947. {"rneu.qh", "X,Q", 0x78200022, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
  1948. {"rol", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I1 },
  1949. {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 },
  1950. {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 },
  1951. {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 },
  1952. {"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|SMT },
  1953. {"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|SMT },
  1954. {"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|SMT },
  1955. {"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|SMT },
  1956. {"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|SMT },
  1957. {"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|SMT },
  1958. {"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|SMT },
  1959. {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 },
  1960. {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 },
  1961. {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 },
  1962. {"round.w.s", "D,S", 0x4600000c, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
  1963. {"rsqrt.d", "D,S", 0x46200016, 0xffff003f, WR_D|RD_S|FP_D, 0, I4|I33 },
  1964. {"rsqrt.ps","D,S", 0x46c00016, 0xffff003f, WR_D|RD_S|FP_D, 0, SB1 },
  1965. {"rsqrt.s", "D,S", 0x46000016, 0xffff003f, WR_D|RD_S|FP_S, 0, I4|I33 },
  1966. {"rsqrt1.d", "D,S", 0x4620001e, 0xffff003f, WR_D|RD_S|FP_D, 0, M3D },
  1967. {"rsqrt1.ps", "D,S", 0x46c0001e, 0xffff003f, WR_D|RD_S|FP_S, 0, M3D },
  1968. {"rsqrt1.s", "D,S", 0x4600001e, 0xffff003f, WR_D|RD_S|FP_S, 0, M3D },
  1969. {"rsqrt2.d", "D,S,T", 0x4620001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, M3D },
  1970. {"rsqrt2.ps", "D,S,T", 0x46c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, M3D },
  1971. {"rsqrt2.s", "D,S,T", 0x4600001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, M3D },
  1972. {"rzs.qh", "X,Q", 0x78200024, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
  1973. {"rzu.ob", "X,Q", 0x78000020, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX|SB1 },
  1974. {"rzu.ob", "D,k", 0x4bc00020, 0xffe0f83f, WR_D|RD_S|RD_T, 0, N54 },
  1975. {"rzu.qh", "X,Q", 0x78200020, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
  1976. {"sb", "t,o(b)", 0xa0000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
  1977. {"sb", "t,A(b)", 0, (int) M_SB_AB, INSN_MACRO, 0, I1 },
  1978. {"sc", "t,o(b)", 0xe0000000, 0xfc000000, SM|RD_t|WR_t|RD_b, 0, I2 },
  1979. {"sc", "t,A(b)", 0, (int) M_SC_AB, INSN_MACRO, 0, I2 },
  1980. {"scd", "t,o(b)", 0xf0000000, 0xfc000000, SM|RD_t|WR_t|RD_b, 0, I3 },
  1981. {"scd", "t,A(b)", 0, (int) M_SCD_AB, INSN_MACRO, 0, I3 },
  1982. {"sd", "t,o(b)", 0xfc000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
  1983. {"sd", "t,o(b)", 0, (int) M_SD_OB, INSN_MACRO, 0, I1 },
  1984. {"sd", "t,A(b)", 0, (int) M_SD_AB, INSN_MACRO, 0, I1 },
  1985. {"sdbbp", "", 0x0000000e, 0xffffffff, TRAP, 0, G2 },
  1986. {"sdbbp", "c", 0x0000000e, 0xfc00ffff, TRAP, 0, G2 },
  1987. {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 },
  1988. {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 },
  1989. {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 },
  1990. {"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
  1991. {"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
  1992. {"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
  1993. {"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
  1994. {"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 },
  1995. {"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 },
  1996. {"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 },
  1997. {"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 },
  1998. {"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
  1999. {"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 },
  2000. {"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 },
  2001. {"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
  2002. {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, 0, I3 },
  2003. {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
  2004. {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, 0, I3 },
  2005. {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b|FP_D, 0, I4|I33 },
  2006. {"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33 },
  2007. {"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33 },
  2008. {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 },
  2009. {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 },
  2010. {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, 0, I1 },
  2011. {"seq", "d,v,I", 0, (int) M_SEQ_I, INSN_MACRO, 0, I1 },
  2012. {"sge", "d,v,t", 0, (int) M_SGE, INSN_MACRO, 0, I1 },
  2013. {"sge", "d,v,I", 0, (int) M_SGE_I, INSN_MACRO, 0, I1 },
  2014. {"sgeu", "d,v,t", 0, (int) M_SGEU, INSN_MACRO, 0, I1 },
  2015. {"sgeu", "d,v,I", 0, (int) M_SGEU_I, INSN_MACRO, 0, I1 },
  2016. {"sgt", "d,v,t", 0, (int) M_SGT, INSN_MACRO, 0, I1 },
  2017. {"sgt", "d,v,I", 0, (int) M_SGT_I, INSN_MACRO, 0, I1 },
  2018. {"sgtu", "d,v,t", 0, (int) M_SGTU, INSN_MACRO, 0, I1 },
  2019. {"sgtu", "d,v,I", 0, (int) M_SGTU_I, INSN_MACRO, 0, I1 },
  2020. {"sh", "t,o(b)", 0xa4000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
  2021. {"sh", "t,A(b)", 0, (int) M_SH_AB, INSN_MACRO, 0, I1 },
  2022. {"shfl.bfla.qh", "X,Y,Z", 0x7a20001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2023. {"shfl.mixh.ob", "X,Y,Z", 0x7980001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2024. {"shfl.mixh.ob", "D,S,T", 0x4980001f, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2025. {"shfl.mixh.qh", "X,Y,Z", 0x7820001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2026. {"shfl.mixl.ob", "X,Y,Z", 0x79c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2027. {"shfl.mixl.ob", "D,S,T", 0x49c0001f, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2028. {"shfl.mixl.qh", "X,Y,Z", 0x78a0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2029. {"shfl.pach.ob", "X,Y,Z", 0x7900001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2030. {"shfl.pach.ob", "D,S,T", 0x4900001f, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2031. {"shfl.pach.qh", "X,Y,Z", 0x7920001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2032. {"shfl.pacl.ob", "D,S,T", 0x4940001f, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2033. {"shfl.repa.qh", "X,Y,Z", 0x7b20001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2034. {"shfl.repb.qh", "X,Y,Z", 0x7ba0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2035. {"shfl.upsl.ob", "X,Y,Z", 0x78c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2036. {"sle", "d,v,t", 0, (int) M_SLE, INSN_MACRO, 0, I1 },
  2037. {"sle", "d,v,I", 0, (int) M_SLE_I, INSN_MACRO, 0, I1 },
  2038. {"sleu", "d,v,t", 0, (int) M_SLEU, INSN_MACRO, 0, I1 },
  2039. {"sleu", "d,v,I", 0, (int) M_SLEU_I, INSN_MACRO, 0, I1 },
  2040. {"sllv", "d,t,s", 0x00000004, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I1 },
  2041. {"sll", "d,w,s", 0x00000004, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I1 }, /* sllv */
  2042. {"sll", "d,w,<", 0x00000000, 0xffe0003f, WR_d|RD_t, 0, I1 },
  2043. {"sll.ob", "X,Y,Q", 0x78000010, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2044. {"sll.ob", "D,S,T[e]", 0x48000010, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  2045. {"sll.ob", "D,S,k", 0x4bc00010, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2046. {"sll.qh", "X,Y,Q", 0x78200010, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2047. {"slt", "d,v,t", 0x0000002a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  2048. {"slt", "d,v,I", 0, (int) M_SLT_I, INSN_MACRO, 0, I1 },
  2049. {"slti", "t,r,j", 0x28000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  2050. {"sltiu", "t,r,j", 0x2c000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  2051. {"sltu", "d,v,t", 0x0000002b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  2052. {"sltu", "d,v,I", 0, (int) M_SLTU_I, INSN_MACRO, 0, I1 },
  2053. {"sne", "d,v,t", 0, (int) M_SNE, INSN_MACRO, 0, I1 },
  2054. {"sne", "d,v,I", 0, (int) M_SNE_I, INSN_MACRO, 0, I1 },
  2055. {"sqrt.d", "D,S", 0x46200004, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
  2056. {"sqrt.s", "D,S", 0x46000004, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
  2057. {"sqrt.ps", "D,S", 0x46c00004, 0xffff003f, WR_D|RD_S|FP_D, 0, SB1 },
  2058. {"srav", "d,t,s", 0x00000007, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I1 },
  2059. {"sra", "d,w,s", 0x00000007, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I1 }, /* srav */
  2060. {"sra", "d,w,<", 0x00000003, 0xffe0003f, WR_d|RD_t, 0, I1 },
  2061. {"sra.qh", "X,Y,Q", 0x78200013, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2062. {"srlv", "d,t,s", 0x00000006, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I1 },
  2063. {"srl", "d,w,s", 0x00000006, 0xfc0007ff, WR_d|RD_t|RD_s, 0, I1 }, /* srlv */
  2064. {"srl", "d,w,<", 0x00000002, 0xffe0003f, WR_d|RD_t, 0, I1 },
  2065. {"srl.ob", "X,Y,Q", 0x78000012, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2066. {"srl.ob", "D,S,T[e]", 0x48000012, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  2067. {"srl.ob", "D,S,k", 0x4bc00012, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2068. {"srl.qh", "X,Y,Q", 0x78200012, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2069. /* ssnop is at the start of the table. */
  2070. {"standby", "", 0x42000021, 0xffffffff, 0, 0, V1 },
  2071. {"sub", "d,v,t", 0x00000022, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  2072. {"sub", "d,v,I", 0, (int) M_SUB_I, INSN_MACRO, 0, I1 },
  2073. {"sub.d", "D,V,T", 0x46200001, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I1 },
  2074. {"sub.s", "D,V,T", 0x46000001, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, 0, I1 },
  2075. {"sub.ob", "X,Y,Q", 0x7800000a, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2076. {"sub.ob", "D,S,T", 0x4ac0000a, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2077. {"sub.ob", "D,S,T[e]", 0x4800000a, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  2078. {"sub.ob", "D,S,k", 0x4bc0000a, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2079. {"sub.ps", "D,V,T", 0x46c00001, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5|I33 },
  2080. {"sub.qh", "X,Y,Q", 0x7820000a, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2081. {"suba.ob", "Y,Q", 0x78000036, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  2082. {"suba.qh", "Y,Q", 0x78200036, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  2083. {"subl.ob", "Y,Q", 0x78000436, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  2084. {"subl.qh", "Y,Q", 0x78200436, 0xfc2007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  2085. {"subu", "d,v,t", 0x00000023, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  2086. {"subu", "d,v,I", 0, (int) M_SUBU_I, INSN_MACRO, 0, I1 },
  2087. {"suspend", "", 0x42000022, 0xffffffff, 0, 0, V1 },
  2088. {"suxc1", "S,t(b)", 0x4c00000d, 0xfc0007ff, SM|RD_S|RD_t|RD_b, 0, I5|I33|N55},
  2089. {"sw", "t,o(b)", 0xac000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
  2090. {"sw", "t,A(b)", 0, (int) M_SW_AB, INSN_MACRO, 0, I1 },
  2091. {"swc0", "E,o(b)", 0xe0000000, 0xfc000000, SM|RD_C0|RD_b, 0, I1 },
  2092. {"swc0", "E,A(b)", 0, (int) M_SWC0_AB, INSN_MACRO, 0, I1 },
  2093. {"swc1", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 },
  2094. {"swc1", "E,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 },
  2095. {"swc1", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
  2096. {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
  2097. {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */
  2098. {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
  2099. {"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 },
  2100. {"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 },
  2101. {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 },
  2102. {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 },
  2103. {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
  2104. {"swl", "t,A(b)", 0, (int) M_SWL_AB, INSN_MACRO, 0, I1 },
  2105. {"scache", "t,o(b)", 0xa8000000, 0xfc000000, RD_t|RD_b, 0, I2 }, /* same */
  2106. {"scache", "t,A(b)", 0, (int) M_SWL_AB, INSN_MACRO, 0, I2 }, /* as swl */
  2107. {"swr", "t,o(b)", 0xb8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
  2108. {"swr", "t,A(b)", 0, (int) M_SWR_AB, INSN_MACRO, 0, I1 },
  2109. {"invalidate", "t,o(b)",0xb8000000, 0xfc000000, RD_t|RD_b, 0, I2 }, /* same */
  2110. {"invalidate", "t,A(b)",0, (int) M_SWR_AB, INSN_MACRO, 0, I2 }, /* as swr */
  2111. {"swxc1", "S,t(b)", 0x4c000008, 0xfc0007ff, SM|RD_S|RD_t|RD_b|FP_S, 0, I4|I33 },
  2112. {"sync", "", 0x0000000f, 0xffffffff, INSN_SYNC, 0, I2|G1 },
  2113. {"sync.p", "", 0x0000040f, 0xffffffff, INSN_SYNC, 0, I2 },
  2114. {"sync.l", "", 0x0000000f, 0xffffffff, INSN_SYNC, 0, I2 },
  2115. {"synci", "o(b)", 0x041f0000, 0xfc1f0000, SM|RD_b, 0, I33 },
  2116. {"syscall", "", 0x0000000c, 0xffffffff, TRAP, 0, I1 },
  2117. {"syscall", "B", 0x0000000c, 0xfc00003f, TRAP, 0, I1 },
  2118. {"teqi", "s,j", 0x040c0000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
  2119. {"teq", "s,t", 0x00000034, 0xfc00ffff, RD_s|RD_t|TRAP, 0, I2 },
  2120. {"teq", "s,t,q", 0x00000034, 0xfc00003f, RD_s|RD_t|TRAP, 0, I2 },
  2121. {"teq", "s,j", 0x040c0000, 0xfc1f0000, RD_s|TRAP, 0, I2 }, /* teqi */
  2122. {"teq", "s,I", 0, (int) M_TEQ_I, INSN_MACRO, 0, I2 },
  2123. {"tgei", "s,j", 0x04080000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
  2124. {"tge", "s,t", 0x00000030, 0xfc00ffff, RD_s|RD_t|TRAP, 0, I2 },
  2125. {"tge", "s,t,q", 0x00000030, 0xfc00003f, RD_s|RD_t|TRAP, 0, I2 },
  2126. {"tge", "s,j", 0x04080000, 0xfc1f0000, RD_s|TRAP, 0, I2 }, /* tgei */
  2127. {"tge", "s,I", 0, (int) M_TGE_I, INSN_MACRO, 0, I2 },
  2128. {"tgeiu", "s,j", 0x04090000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
  2129. {"tgeu", "s,t", 0x00000031, 0xfc00ffff, RD_s|RD_t|TRAP, 0, I2 },
  2130. {"tgeu", "s,t,q", 0x00000031, 0xfc00003f, RD_s|RD_t|TRAP, 0, I2 },
  2131. {"tgeu", "s,j", 0x04090000, 0xfc1f0000, RD_s|TRAP, 0, I2 }, /* tgeiu */
  2132. {"tgeu", "s,I", 0, (int) M_TGEU_I, INSN_MACRO, 0, I2 },
  2133. {"tlbp", "", 0x42000008, 0xffffffff, INSN_TLB, 0, I1 },
  2134. {"tlbr", "", 0x42000001, 0xffffffff, INSN_TLB, 0, I1 },
  2135. {"tlbwi", "", 0x42000002, 0xffffffff, INSN_TLB, 0, I1 },
  2136. {"tlbwr", "", 0x42000006, 0xffffffff, INSN_TLB, 0, I1 },
  2137. {"tlti", "s,j", 0x040a0000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
  2138. {"tlt", "s,t", 0x00000032, 0xfc00ffff, RD_s|RD_t|TRAP, 0, I2 },
  2139. {"tlt", "s,t,q", 0x00000032, 0xfc00003f, RD_s|RD_t|TRAP, 0, I2 },
  2140. {"tlt", "s,j", 0x040a0000, 0xfc1f0000, RD_s|TRAP, 0, I2 }, /* tlti */
  2141. {"tlt", "s,I", 0, (int) M_TLT_I, INSN_MACRO, 0, I2 },
  2142. {"tltiu", "s,j", 0x040b0000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
  2143. {"tltu", "s,t", 0x00000033, 0xfc00ffff, RD_s|RD_t|TRAP, 0, I2 },
  2144. {"tltu", "s,t,q", 0x00000033, 0xfc00003f, RD_s|RD_t|TRAP, 0, I2 },
  2145. {"tltu", "s,j", 0x040b0000, 0xfc1f0000, RD_s|TRAP, 0, I2 }, /* tltiu */
  2146. {"tltu", "s,I", 0, (int) M_TLTU_I, INSN_MACRO, 0, I2 },
  2147. {"tnei", "s,j", 0x040e0000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
  2148. {"tne", "s,t", 0x00000036, 0xfc00ffff, RD_s|RD_t|TRAP, 0, I2 },
  2149. {"tne", "s,t,q", 0x00000036, 0xfc00003f, RD_s|RD_t|TRAP, 0, I2 },
  2150. {"tne", "s,j", 0x040e0000, 0xfc1f0000, RD_s|TRAP, 0, I2 }, /* tnei */
  2151. {"tne", "s,I", 0, (int) M_TNE_I, INSN_MACRO, 0, I2 },
  2152. {"trunc.l.d", "D,S", 0x46200009, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 },
  2153. {"trunc.l.s", "D,S", 0x46000009, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 },
  2154. {"trunc.w.d", "D,S", 0x4620000d, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 },
  2155. {"trunc.w.d", "D,S,x", 0x4620000d, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 },
  2156. {"trunc.w.d", "D,S,t", 0, (int) M_TRUNCWD, INSN_MACRO, 0, I1 },
  2157. {"trunc.w.s", "D,S", 0x4600000d, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
  2158. {"trunc.w.s", "D,S,x", 0x4600000d, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
  2159. {"trunc.w.s", "D,S,t", 0, (int) M_TRUNCWS, INSN_MACRO, 0, I1 },
  2160. {"uld", "t,o(b)", 0, (int) M_ULD, INSN_MACRO, 0, I3 },
  2161. {"uld", "t,A(b)", 0, (int) M_ULD_A, INSN_MACRO, 0, I3 },
  2162. {"ulh", "t,o(b)", 0, (int) M_ULH, INSN_MACRO, 0, I1 },
  2163. {"ulh", "t,A(b)", 0, (int) M_ULH_A, INSN_MACRO, 0, I1 },
  2164. {"ulhu", "t,o(b)", 0, (int) M_ULHU, INSN_MACRO, 0, I1 },
  2165. {"ulhu", "t,A(b)", 0, (int) M_ULHU_A, INSN_MACRO, 0, I1 },
  2166. {"ulw", "t,o(b)", 0, (int) M_ULW, INSN_MACRO, 0, I1 },
  2167. {"ulw", "t,A(b)", 0, (int) M_ULW_A, INSN_MACRO, 0, I1 },
  2168. {"usd", "t,o(b)", 0, (int) M_USD, INSN_MACRO, 0, I3 },
  2169. {"usd", "t,A(b)", 0, (int) M_USD_A, INSN_MACRO, 0, I3 },
  2170. {"ush", "t,o(b)", 0, (int) M_USH, INSN_MACRO, 0, I1 },
  2171. {"ush", "t,A(b)", 0, (int) M_USH_A, INSN_MACRO, 0, I1 },
  2172. {"usw", "t,o(b)", 0, (int) M_USW, INSN_MACRO, 0, I1 },
  2173. {"usw", "t,A(b)", 0, (int) M_USW_A, INSN_MACRO, 0, I1 },
  2174. {"wach.ob", "Y", 0x7a00003e, 0xffff07ff, RD_S|FP_D, WR_MACC, MX|SB1 },
  2175. {"wach.ob", "S", 0x4a00003e, 0xffff07ff, RD_S, 0, N54 },
  2176. {"wach.qh", "Y", 0x7a20003e, 0xffff07ff, RD_S|FP_D, WR_MACC, MX },
  2177. {"wacl.ob", "Y,Z", 0x7800003e, 0xffe007ff, RD_S|RD_T|FP_D, WR_MACC, MX|SB1 },
  2178. {"wacl.ob", "S,T", 0x4800003e, 0xffe007ff, RD_S|RD_T, 0, N54 },
  2179. {"wacl.qh", "Y,Z", 0x7820003e, 0xffe007ff, RD_S|RD_T|FP_D, WR_MACC, MX },
  2180. {"wait", "", 0x42000020, 0xffffffff, TRAP, 0, I3|I32 },
  2181. {"wait", "J", 0x42000020, 0xfe00003f, TRAP, 0, I32|N55 },
  2182. {"waiti", "", 0x42000020, 0xffffffff, TRAP, 0, L1 },
  2183. {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 },
  2184. {"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33 },
  2185. {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
  2186. {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 },
  2187. {"xor.ob", "X,Y,Q", 0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
  2188. {"xor.ob", "D,S,T", 0x4ac0000d, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2189. {"xor.ob", "D,S,T[e]", 0x4800000d, 0xfe20003f, WR_D|RD_S|RD_T, 0, N54 },
  2190. {"xor.ob", "D,S,k", 0x4bc0000d, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
  2191. {"xor.qh", "X,Y,Q", 0x7820000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
  2192. {"xori", "t,r,i", 0x38000000, 0xfc000000, WR_t|RD_s, 0, I1 },
  2193. {"yield", "s", 0x7c000009, 0xfc1fffff, TRAP|RD_s, 0, MT32 },
  2194. {"yield", "d,s", 0x7c000009, 0xfc1f07ff, TRAP|WR_d|RD_s, 0, MT32 },
  2195. /* User Defined Instruction. */
  2196. {"udi0", "s,t,d,+1",0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2197. {"udi0", "s,t,+2", 0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2198. {"udi0", "s,+3", 0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2199. {"udi0", "+4", 0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2200. {"udi1", "s,t,d,+1",0x70000011, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2201. {"udi1", "s,t,+2", 0x70000011, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2202. {"udi1", "s,+3", 0x70000011, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2203. {"udi1", "+4", 0x70000011, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2204. {"udi2", "s,t,d,+1",0x70000012, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2205. {"udi2", "s,t,+2", 0x70000012, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2206. {"udi2", "s,+3", 0x70000012, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2207. {"udi2", "+4", 0x70000012, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2208. {"udi3", "s,t,d,+1",0x70000013, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2209. {"udi3", "s,t,+2", 0x70000013, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2210. {"udi3", "s,+3", 0x70000013, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2211. {"udi3", "+4", 0x70000013, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2212. {"udi4", "s,t,d,+1",0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2213. {"udi4", "s,t,+2", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2214. {"udi4", "s,+3", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2215. {"udi4", "+4", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2216. {"udi5", "s,t,d,+1",0x70000015, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2217. {"udi5", "s,t,+2", 0x70000015, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2218. {"udi5", "s,+3", 0x70000015, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2219. {"udi5", "+4", 0x70000015, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2220. {"udi6", "s,t,d,+1",0x70000016, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2221. {"udi6", "s,t,+2", 0x70000016, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2222. {"udi6", "s,+3", 0x70000016, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2223. {"udi6", "+4", 0x70000016, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2224. {"udi7", "s,t,d,+1",0x70000017, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2225. {"udi7", "s,t,+2", 0x70000017, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2226. {"udi7", "s,+3", 0x70000017, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2227. {"udi7", "+4", 0x70000017, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2228. {"udi8", "s,t,d,+1",0x70000018, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2229. {"udi8", "s,t,+2", 0x70000018, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2230. {"udi8", "s,+3", 0x70000018, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2231. {"udi8", "+4", 0x70000018, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2232. {"udi9", "s,t,d,+1",0x70000019, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2233. {"udi9", "s,t,+2", 0x70000019, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2234. {"udi9", "s,+3", 0x70000019, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2235. {"udi9", "+4", 0x70000019, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2236. {"udi10", "s,t,d,+1",0x7000001a, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2237. {"udi10", "s,t,+2", 0x7000001a, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2238. {"udi10", "s,+3", 0x7000001a, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2239. {"udi10", "+4", 0x7000001a, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2240. {"udi11", "s,t,d,+1",0x7000001b, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2241. {"udi11", "s,t,+2", 0x7000001b, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2242. {"udi11", "s,+3", 0x7000001b, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2243. {"udi11", "+4", 0x7000001b, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2244. {"udi12", "s,t,d,+1",0x7000001c, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2245. {"udi12", "s,t,+2", 0x7000001c, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2246. {"udi12", "s,+3", 0x7000001c, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2247. {"udi12", "+4", 0x7000001c, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2248. {"udi13", "s,t,d,+1",0x7000001d, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2249. {"udi13", "s,t,+2", 0x7000001d, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2250. {"udi13", "s,+3", 0x7000001d, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2251. {"udi13", "+4", 0x7000001d, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2252. {"udi14", "s,t,d,+1",0x7000001e, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2253. {"udi14", "s,t,+2", 0x7000001e, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2254. {"udi14", "s,+3", 0x7000001e, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2255. {"udi14", "+4", 0x7000001e, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2256. {"udi15", "s,t,d,+1",0x7000001f, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2257. {"udi15", "s,t,+2", 0x7000001f, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2258. {"udi15", "s,+3", 0x7000001f, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2259. {"udi15", "+4", 0x7000001f, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 },
  2260. /* Coprocessor 2 move/branch operations overlap with VR5400 .ob format
  2261. instructions so they are here for the latters to take precedence. */
  2262. {"bc2f", "p", 0x49000000, 0xffff0000, CBD|RD_CC, 0, I1 },
  2263. {"bc2f", "N,p", 0x49000000, 0xffe30000, CBD|RD_CC, 0, I32 },
  2264. {"bc2fl", "p", 0x49020000, 0xffff0000, CBL|RD_CC, 0, I2|T3 },
  2265. {"bc2fl", "N,p", 0x49020000, 0xffe30000, CBL|RD_CC, 0, I32 },
  2266. {"bc2t", "p", 0x49010000, 0xffff0000, CBD|RD_CC, 0, I1 },
  2267. {"bc2t", "N,p", 0x49010000, 0xffe30000, CBD|RD_CC, 0, I32 },
  2268. {"bc2tl", "p", 0x49030000, 0xffff0000, CBL|RD_CC, 0, I2|T3 },
  2269. {"bc2tl", "N,p", 0x49030000, 0xffe30000, CBL|RD_CC, 0, I32 },
  2270. {"cfc2", "t,G", 0x48400000, 0xffe007ff, LCD|WR_t|RD_C2, 0, I1 },
  2271. {"ctc2", "t,G", 0x48c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 },
  2272. {"dmfc2", "t,G", 0x48200000, 0xffe007ff, LCD|WR_t|RD_C2, 0, I3 },
  2273. {"dmfc2", "t,G,H", 0x48200000, 0xffe007f8, LCD|WR_t|RD_C2, 0, I64 },
  2274. {"dmtc2", "t,G", 0x48a00000, 0xffe007ff, COD|RD_t|WR_C2|WR_CC, 0, I3 },
  2275. {"dmtc2", "t,G,H", 0x48a00000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I64 },
  2276. {"mfc2", "t,G", 0x48000000, 0xffe007ff, LCD|WR_t|RD_C2, 0, I1 },
  2277. {"mfc2", "t,G,H", 0x48000000, 0xffe007f8, LCD|WR_t|RD_C2, 0, I32 },
  2278. {"mfhc2", "t,G", 0x48600000, 0xffe007ff, LCD|WR_t|RD_C2, 0, I33 },
  2279. {"mfhc2", "t,G,H", 0x48600000, 0xffe007f8, LCD|WR_t|RD_C2, 0, I33 },
  2280. {"mfhc2", "t,i", 0x48600000, 0xffe00000, LCD|WR_t|RD_C2, 0, I33 },
  2281. {"mtc2", "t,G", 0x48800000, 0xffe007ff, COD|RD_t|WR_C2|WR_CC, 0, I1 },
  2282. {"mtc2", "t,G,H", 0x48800000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I32 },
  2283. {"mthc2", "t,G", 0x48e00000, 0xffe007ff, COD|RD_t|WR_C2|WR_CC, 0, I33 },
  2284. {"mthc2", "t,G,H", 0x48e00000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I33 },
  2285. {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33 },
  2286. /* Coprocessor 3 move/branch operations overlap with MIPS IV COP1X
  2287. instructions, so they are here for the latters to take precedence. */
  2288. {"bc3f", "p", 0x4d000000, 0xffff0000, CBD|RD_CC, 0, I1 },
  2289. {"bc3fl", "p", 0x4d020000, 0xffff0000, CBL|RD_CC, 0, I2|T3 },
  2290. {"bc3t", "p", 0x4d010000, 0xffff0000, CBD|RD_CC, 0, I1 },
  2291. {"bc3tl", "p", 0x4d030000, 0xffff0000, CBL|RD_CC, 0, I2|T3 },
  2292. {"cfc3", "t,G", 0x4c400000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I1 },
  2293. {"ctc3", "t,G", 0x4cc00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 },
  2294. {"dmfc3", "t,G", 0x4c200000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I3 },
  2295. {"dmtc3", "t,G", 0x4ca00000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, 0, I3 },
  2296. {"mfc3", "t,G", 0x4c000000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I1 },
  2297. {"mfc3", "t,G,H", 0x4c000000, 0xffe007f8, LCD|WR_t|RD_C3, 0, I32 },
  2298. {"mtc3", "t,G", 0x4c800000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, 0, I1 },
  2299. {"mtc3", "t,G,H", 0x4c800000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC, 0, I32 },
  2300. /* No hazard protection on coprocessor instructions--they shouldn't
  2301. change the state of the processor and if they do it's up to the
  2302. user to put in nops as necessary. These are at the end so that the
  2303. disassembler recognizes more specific versions first. */
  2304. {"c0", "C", 0x42000000, 0xfe000000, 0, 0, I1 },
  2305. {"c1", "C", 0x46000000, 0xfe000000, 0, 0, I1 },
  2306. {"c2", "C", 0x4a000000, 0xfe000000, 0, 0, I1 },
  2307. {"c3", "C", 0x4e000000, 0xfe000000, 0, 0, I1 },
  2308. {"cop0", "C", 0, (int) M_COP0, INSN_MACRO, 0, I1 },
  2309. {"cop1", "C", 0, (int) M_COP1, INSN_MACRO, 0, I1 },
  2310. {"cop2", "C", 0, (int) M_COP2, INSN_MACRO, 0, I1 },
  2311. {"cop3", "C", 0, (int) M_COP3, INSN_MACRO, 0, I1 },
  2312. /* Conflicts with the 4650's "mul" instruction. Nobody's using the
  2313. 4010 any more, so move this insn out of the way. If the object
  2314. format gave us more info, we could do this right. */
  2315. {"addciu", "t,r,j", 0x70000000, 0xfc000000, WR_t|RD_s, 0, L1 },
  2316. /* MIPS DSP ASE */
  2317. {"absq_s.ph", "d,t", 0x7c000252, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2318. {"absq_s.pw", "d,t", 0x7c000456, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2319. {"absq_s.qh", "d,t", 0x7c000256, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2320. {"absq_s.w", "d,t", 0x7c000452, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2321. {"addq.ph", "d,s,t", 0x7c000290, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2322. {"addq.pw", "d,s,t", 0x7c000494, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2323. {"addq.qh", "d,s,t", 0x7c000294, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2324. {"addq_s.ph", "d,s,t", 0x7c000390, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2325. {"addq_s.pw", "d,s,t", 0x7c000594, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2326. {"addq_s.qh", "d,s,t", 0x7c000394, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2327. {"addq_s.w", "d,s,t", 0x7c000590, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2328. {"addsc", "d,s,t", 0x7c000410, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2329. {"addu.ob", "d,s,t", 0x7c000014, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2330. {"addu.qb", "d,s,t", 0x7c000010, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2331. {"addu_s.ob", "d,s,t", 0x7c000114, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2332. {"addu_s.qb", "d,s,t", 0x7c000110, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2333. {"addwc", "d,s,t", 0x7c000450, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2334. {"bitrev", "d,t", 0x7c0006d2, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2335. {"bposge32", "p", 0x041c0000, 0xffff0000, CBD, 0, D32 },
  2336. {"bposge64", "p", 0x041d0000, 0xffff0000, CBD, 0, D64 },
  2337. {"cmp.eq.ph", "s,t", 0x7c000211, 0xfc00ffff, RD_s|RD_t, 0, D32 },
  2338. {"cmp.eq.pw", "s,t", 0x7c000415, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2339. {"cmp.eq.qh", "s,t", 0x7c000215, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2340. {"cmpgu.eq.ob", "d,s,t", 0x7c000115, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2341. {"cmpgu.eq.qb", "d,s,t", 0x7c000111, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2342. {"cmpgu.le.ob", "d,s,t", 0x7c000195, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2343. {"cmpgu.le.qb", "d,s,t", 0x7c000191, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2344. {"cmpgu.lt.ob", "d,s,t", 0x7c000155, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2345. {"cmpgu.lt.qb", "d,s,t", 0x7c000151, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2346. {"cmp.le.ph", "s,t", 0x7c000291, 0xfc00ffff, RD_s|RD_t, 0, D32 },
  2347. {"cmp.le.pw", "s,t", 0x7c000495, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2348. {"cmp.le.qh", "s,t", 0x7c000295, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2349. {"cmp.lt.ph", "s,t", 0x7c000251, 0xfc00ffff, RD_s|RD_t, 0, D32 },
  2350. {"cmp.lt.pw", "s,t", 0x7c000455, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2351. {"cmp.lt.qh", "s,t", 0x7c000255, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2352. {"cmpu.eq.ob", "s,t", 0x7c000015, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2353. {"cmpu.eq.qb", "s,t", 0x7c000011, 0xfc00ffff, RD_s|RD_t, 0, D32 },
  2354. {"cmpu.le.ob", "s,t", 0x7c000095, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2355. {"cmpu.le.qb", "s,t", 0x7c000091, 0xfc00ffff, RD_s|RD_t, 0, D32 },
  2356. {"cmpu.lt.ob", "s,t", 0x7c000055, 0xfc00ffff, RD_s|RD_t, 0, D64 },
  2357. {"cmpu.lt.qb", "s,t", 0x7c000051, 0xfc00ffff, RD_s|RD_t, 0, D32 },
  2358. {"dextpdp", "t,7,6", 0x7c0002bc, 0xfc00e7ff, WR_t|RD_a|DSP_VOLA, 0, D64 },
  2359. {"dextpdpv", "t,7,s", 0x7c0002fc, 0xfc00e7ff, WR_t|RD_a|RD_s|DSP_VOLA, 0, D64 },
  2360. {"dextp", "t,7,6", 0x7c0000bc, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2361. {"dextpv", "t,7,s", 0x7c0000fc, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2362. {"dextr.l", "t,7,6", 0x7c00043c, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2363. {"dextr_r.l", "t,7,6", 0x7c00053c, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2364. {"dextr_rs.l", "t,7,6", 0x7c0005bc, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2365. {"dextr_rs.w", "t,7,6", 0x7c0001bc, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2366. {"dextr_r.w", "t,7,6", 0x7c00013c, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2367. {"dextr_s.h", "t,7,6", 0x7c0003bc, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2368. {"dextrv.l", "t,7,s", 0x7c00047c, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2369. {"dextrv_r.l", "t,7,s", 0x7c00057c, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2370. {"dextrv_rs.l", "t,7,s", 0x7c0005fc, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2371. {"dextrv_rs.w", "t,7,s", 0x7c0001fc, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2372. {"dextrv_r.w", "t,7,s", 0x7c00017c, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2373. {"dextrv_s.h", "t,7,s", 0x7c0003fc, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2374. {"dextrv.w", "t,7,s", 0x7c00007c, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D64 },
  2375. {"dextr.w", "t,7,6", 0x7c00003c, 0xfc00e7ff, WR_t|RD_a, 0, D64 },
  2376. {"dinsv", "t,s", 0x7c00000d, 0xfc00ffff, WR_t|RD_s, 0, D64 },
  2377. {"dmadd", "7,s,t", 0x7c000674, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2378. {"dmaddu", "7,s,t", 0x7c000774, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2379. {"dmsub", "7,s,t", 0x7c0006f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2380. {"dmsubu", "7,s,t", 0x7c0007f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2381. {"dmthlip", "s,7", 0x7c0007fc, 0xfc1fe7ff, RD_s|MOD_a|DSP_VOLA, 0, D64 },
  2382. {"dpaq_sa.l.pw", "7,s,t", 0x7c000334, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2383. {"dpaq_sa.l.w", "7,s,t", 0x7c000330, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2384. {"dpaq_s.w.ph", "7,s,t", 0x7c000130, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2385. {"dpaq_s.w.qh", "7,s,t", 0x7c000134, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2386. {"dpau.h.obl", "7,s,t", 0x7c0000f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2387. {"dpau.h.obr", "7,s,t", 0x7c0001f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2388. {"dpau.h.qbl", "7,s,t", 0x7c0000f0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2389. {"dpau.h.qbr", "7,s,t", 0x7c0001f0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2390. {"dpsq_sa.l.pw", "7,s,t", 0x7c000374, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2391. {"dpsq_sa.l.w", "7,s,t", 0x7c000370, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2392. {"dpsq_s.w.ph", "7,s,t", 0x7c000170, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2393. {"dpsq_s.w.qh", "7,s,t", 0x7c000174, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2394. {"dpsu.h.obl", "7,s,t", 0x7c0002f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2395. {"dpsu.h.obr", "7,s,t", 0x7c0003f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2396. {"dpsu.h.qbl", "7,s,t", 0x7c0002f0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2397. {"dpsu.h.qbr", "7,s,t", 0x7c0003f0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2398. {"dshilo", "7,:", 0x7c0006bc, 0xfc07e7ff, MOD_a, 0, D64 },
  2399. {"dshilov", "7,s", 0x7c0006fc, 0xfc1fe7ff, MOD_a|RD_s, 0, D64 },
  2400. {"extpdp", "t,7,6", 0x7c0002b8, 0xfc00e7ff, WR_t|RD_a|DSP_VOLA, 0, D32 },
  2401. {"extpdpv", "t,7,s", 0x7c0002f8, 0xfc00e7ff, WR_t|RD_a|RD_s|DSP_VOLA, 0, D32 },
  2402. {"extp", "t,7,6", 0x7c0000b8, 0xfc00e7ff, WR_t|RD_a, 0, D32 },
  2403. {"extpv", "t,7,s", 0x7c0000f8, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D32 },
  2404. {"extr_rs.w", "t,7,6", 0x7c0001b8, 0xfc00e7ff, WR_t|RD_a, 0, D32 },
  2405. {"extr_r.w", "t,7,6", 0x7c000138, 0xfc00e7ff, WR_t|RD_a, 0, D32 },
  2406. {"extr_s.h", "t,7,6", 0x7c0003b8, 0xfc00e7ff, WR_t|RD_a, 0, D32 },
  2407. {"extrv_rs.w", "t,7,s", 0x7c0001f8, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D32 },
  2408. {"extrv_r.w", "t,7,s", 0x7c000178, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D32 },
  2409. {"extrv_s.h", "t,7,s", 0x7c0003f8, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D32 },
  2410. {"extrv.w", "t,7,s", 0x7c000078, 0xfc00e7ff, WR_t|RD_a|RD_s, 0, D32 },
  2411. {"extr.w", "t,7,6", 0x7c000038, 0xfc00e7ff, WR_t|RD_a, 0, D32 },
  2412. {"insv", "t,s", 0x7c00000c, 0xfc00ffff, WR_t|RD_s, 0, D32 },
  2413. {"lbux", "d,t(b)", 0x7c00018a, 0xfc0007ff, LDD|WR_d|RD_t|RD_b, 0, D32 },
  2414. {"ldx", "d,t(b)", 0x7c00020a, 0xfc0007ff, LDD|WR_d|RD_t|RD_b, 0, D64 },
  2415. {"lhx", "d,t(b)", 0x7c00010a, 0xfc0007ff, LDD|WR_d|RD_t|RD_b, 0, D32 },
  2416. {"lwx", "d,t(b)", 0x7c00000a, 0xfc0007ff, LDD|WR_d|RD_t|RD_b, 0, D32 },
  2417. {"maq_sa.w.phl", "7,s,t", 0x7c000430, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2418. {"maq_sa.w.phr", "7,s,t", 0x7c0004b0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2419. {"maq_sa.w.qhll", "7,s,t", 0x7c000434, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2420. {"maq_sa.w.qhlr", "7,s,t", 0x7c000474, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2421. {"maq_sa.w.qhrl", "7,s,t", 0x7c0004b4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2422. {"maq_sa.w.qhrr", "7,s,t", 0x7c0004f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2423. {"maq_s.l.pwl", "7,s,t", 0x7c000734, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2424. {"maq_s.l.pwr", "7,s,t", 0x7c0007b4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2425. {"maq_s.w.phl", "7,s,t", 0x7c000530, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2426. {"maq_s.w.phr", "7,s,t", 0x7c0005b0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2427. {"maq_s.w.qhll", "7,s,t", 0x7c000534, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2428. {"maq_s.w.qhlr", "7,s,t", 0x7c000574, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2429. {"maq_s.w.qhrl", "7,s,t", 0x7c0005b4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2430. {"maq_s.w.qhrr", "7,s,t", 0x7c0005f4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2431. {"modsub", "d,s,t", 0x7c000490, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2432. {"mthlip", "s,7", 0x7c0007f8, 0xfc1fe7ff, RD_s|MOD_a|DSP_VOLA, 0, D32 },
  2433. {"muleq_s.pw.qhl", "d,s,t", 0x7c000714, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D64 },
  2434. {"muleq_s.pw.qhr", "d,s,t", 0x7c000754, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D64 },
  2435. {"muleq_s.w.phl", "d,s,t", 0x7c000710, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D32 },
  2436. {"muleq_s.w.phr", "d,s,t", 0x7c000750, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D32 },
  2437. {"muleu_s.ph.qbl", "d,s,t", 0x7c000190, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D32 },
  2438. {"muleu_s.ph.qbr", "d,s,t", 0x7c0001d0, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D32 },
  2439. {"muleu_s.qh.obl", "d,s,t", 0x7c000194, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D64 },
  2440. {"muleu_s.qh.obr", "d,s,t", 0x7c0001d4, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D64 },
  2441. {"mulq_rs.ph", "d,s,t", 0x7c0007d0, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D32 },
  2442. {"mulq_rs.qh", "d,s,t", 0x7c0007d4, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D64 },
  2443. {"mulsaq_s.l.pw", "7,s,t", 0x7c0003b4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2444. {"mulsaq_s.w.ph", "7,s,t", 0x7c0001b0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 },
  2445. {"mulsaq_s.w.qh", "7,s,t", 0x7c0001b4, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D64 },
  2446. {"packrl.ph", "d,s,t", 0x7c000391, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2447. {"packrl.pw", "d,s,t", 0x7c000395, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2448. {"pick.ob", "d,s,t", 0x7c0000d5, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2449. {"pick.ph", "d,s,t", 0x7c0002d1, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2450. {"pick.pw", "d,s,t", 0x7c0004d5, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2451. {"pick.qb", "d,s,t", 0x7c0000d1, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2452. {"pick.qh", "d,s,t", 0x7c0002d5, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2453. {"preceq.pw.qhla", "d,t", 0x7c000396, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2454. {"preceq.pw.qhl", "d,t", 0x7c000316, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2455. {"preceq.pw.qhra", "d,t", 0x7c0003d6, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2456. {"preceq.pw.qhr", "d,t", 0x7c000356, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2457. {"preceq.s.l.pwl", "d,t", 0x7c000516, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2458. {"preceq.s.l.pwr", "d,t", 0x7c000556, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2459. {"precequ.ph.qbla", "d,t", 0x7c000192, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2460. {"precequ.ph.qbl", "d,t", 0x7c000112, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2461. {"precequ.ph.qbra", "d,t", 0x7c0001d2, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2462. {"precequ.ph.qbr", "d,t", 0x7c000152, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2463. {"precequ.pw.qhla", "d,t", 0x7c000196, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2464. {"precequ.pw.qhl", "d,t", 0x7c000116, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2465. {"precequ.pw.qhra", "d,t", 0x7c0001d6, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2466. {"precequ.pw.qhr", "d,t", 0x7c000156, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2467. {"preceq.w.phl", "d,t", 0x7c000312, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2468. {"preceq.w.phr", "d,t", 0x7c000352, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2469. {"preceu.ph.qbla", "d,t", 0x7c000792, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2470. {"preceu.ph.qbl", "d,t", 0x7c000712, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2471. {"preceu.ph.qbra", "d,t", 0x7c0007d2, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2472. {"preceu.ph.qbr", "d,t", 0x7c000752, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2473. {"preceu.qh.obla", "d,t", 0x7c000796, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2474. {"preceu.qh.obl", "d,t", 0x7c000716, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2475. {"preceu.qh.obra", "d,t", 0x7c0007d6, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2476. {"preceu.qh.obr", "d,t", 0x7c000756, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2477. {"precrq.ob.qh", "d,s,t", 0x7c000315, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2478. {"precrq.ph.w", "d,s,t", 0x7c000511, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2479. {"precrq.pw.l", "d,s,t", 0x7c000715, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2480. {"precrq.qb.ph", "d,s,t", 0x7c000311, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2481. {"precrq.qh.pw", "d,s,t", 0x7c000515, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2482. {"precrq_rs.ph.w", "d,s,t", 0x7c000551, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2483. {"precrq_rs.qh.pw", "d,s,t", 0x7c000555, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2484. {"precrqu_s.ob.qh", "d,s,t", 0x7c0003d5, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2485. {"precrqu_s.qb.ph", "d,s,t", 0x7c0003d1, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2486. {"raddu.l.ob", "d,s", 0x7c000514, 0xfc1f07ff, WR_d|RD_s, 0, D64 },
  2487. {"raddu.w.qb", "d,s", 0x7c000510, 0xfc1f07ff, WR_d|RD_s, 0, D32 },
  2488. {"rddsp", "d", 0x7fff04b8, 0xffff07ff, WR_d, 0, D32 },
  2489. {"rddsp", "d,'", 0x7c0004b8, 0xffc007ff, WR_d, 0, D32 },
  2490. {"repl.ob", "d,5", 0x7c000096, 0xff0007ff, WR_d, 0, D64 },
  2491. {"repl.ph", "d,@", 0x7c000292, 0xfc0007ff, WR_d, 0, D32 },
  2492. {"repl.pw", "d,@", 0x7c000496, 0xfc0007ff, WR_d, 0, D64 },
  2493. {"repl.qb", "d,5", 0x7c000092, 0xff0007ff, WR_d, 0, D32 },
  2494. {"repl.qh", "d,@", 0x7c000296, 0xfc0007ff, WR_d, 0, D64 },
  2495. {"replv.ob", "d,t", 0x7c0000d6, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2496. {"replv.ph", "d,t", 0x7c0002d2, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2497. {"replv.pw", "d,t", 0x7c0004d6, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2498. {"replv.qb", "d,t", 0x7c0000d2, 0xffe007ff, WR_d|RD_t, 0, D32 },
  2499. {"replv.qh", "d,t", 0x7c0002d6, 0xffe007ff, WR_d|RD_t, 0, D64 },
  2500. {"shilo", "7,0", 0x7c0006b8, 0xfc0fe7ff, MOD_a, 0, D32 },
  2501. {"shilov", "7,s", 0x7c0006f8, 0xfc1fe7ff, MOD_a|RD_s, 0, D32 },
  2502. {"shll.ob", "d,t,3", 0x7c000017, 0xff0007ff, WR_d|RD_t, 0, D64 },
  2503. {"shll.ph", "d,t,4", 0x7c000213, 0xfe0007ff, WR_d|RD_t, 0, D32 },
  2504. {"shll.pw", "d,t,6", 0x7c000417, 0xfc0007ff, WR_d|RD_t, 0, D64 },
  2505. {"shll.qb", "d,t,3", 0x7c000013, 0xff0007ff, WR_d|RD_t, 0, D32 },
  2506. {"shll.qh", "d,t,4", 0x7c000217, 0xfe0007ff, WR_d|RD_t, 0, D64 },
  2507. {"shll_s.ph", "d,t,4", 0x7c000313, 0xfe0007ff, WR_d|RD_t, 0, D32 },
  2508. {"shll_s.pw", "d,t,6", 0x7c000517, 0xfc0007ff, WR_d|RD_t, 0, D64 },
  2509. {"shll_s.qh", "d,t,4", 0x7c000317, 0xfe0007ff, WR_d|RD_t, 0, D64 },
  2510. {"shll_s.w", "d,t,6", 0x7c000513, 0xfc0007ff, WR_d|RD_t, 0, D32 },
  2511. {"shllv.ob", "d,t,s", 0x7c000097, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2512. {"shllv.ph", "d,t,s", 0x7c000293, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2513. {"shllv.pw", "d,t,s", 0x7c000497, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2514. {"shllv.qb", "d,t,s", 0x7c000093, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2515. {"shllv.qh", "d,t,s", 0x7c000297, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2516. {"shllv_s.ph", "d,t,s", 0x7c000393, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2517. {"shllv_s.pw", "d,t,s", 0x7c000597, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2518. {"shllv_s.qh", "d,t,s", 0x7c000397, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2519. {"shllv_s.w", "d,t,s", 0x7c000593, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2520. {"shra.ph", "d,t,4", 0x7c000253, 0xfe0007ff, WR_d|RD_t, 0, D32 },
  2521. {"shra.pw", "d,t,6", 0x7c000457, 0xfc0007ff, WR_d|RD_t, 0, D64 },
  2522. {"shra.qh", "d,t,4", 0x7c000257, 0xfe0007ff, WR_d|RD_t, 0, D64 },
  2523. {"shra_r.ph", "d,t,4", 0x7c000353, 0xfe0007ff, WR_d|RD_t, 0, D32 },
  2524. {"shra_r.pw", "d,t,6", 0x7c000557, 0xfc0007ff, WR_d|RD_t, 0, D64 },
  2525. {"shra_r.qh", "d,t,4", 0x7c000357, 0xfe0007ff, WR_d|RD_t, 0, D64 },
  2526. {"shra_r.w", "d,t,6", 0x7c000553, 0xfc0007ff, WR_d|RD_t, 0, D32 },
  2527. {"shrav.ph", "d,t,s", 0x7c0002d3, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2528. {"shrav.pw", "d,t,s", 0x7c0004d7, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2529. {"shrav.qh", "d,t,s", 0x7c0002d7, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2530. {"shrav_r.ph", "d,t,s", 0x7c0003d3, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2531. {"shrav_r.pw", "d,t,s", 0x7c0005d7, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2532. {"shrav_r.qh", "d,t,s", 0x7c0003d7, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2533. {"shrav_r.w", "d,t,s", 0x7c0005d3, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2534. {"shrl.ob", "d,t,3", 0x7c000057, 0xff0007ff, WR_d|RD_t, 0, D64 },
  2535. {"shrl.qb", "d,t,3", 0x7c000053, 0xff0007ff, WR_d|RD_t, 0, D32 },
  2536. {"shrlv.ob", "d,t,s", 0x7c0000d7, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2537. {"shrlv.qb", "d,t,s", 0x7c0000d3, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2538. {"subq.ph", "d,s,t", 0x7c0002d0, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2539. {"subq.pw", "d,s,t", 0x7c0004d4, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2540. {"subq.qh", "d,s,t", 0x7c0002d4, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2541. {"subq_s.ph", "d,s,t", 0x7c0003d0, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2542. {"subq_s.pw", "d,s,t", 0x7c0005d4, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2543. {"subq_s.qh", "d,s,t", 0x7c0003d4, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2544. {"subq_s.w", "d,s,t", 0x7c0005d0, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2545. {"subu.ob", "d,s,t", 0x7c000054, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2546. {"subu.qb", "d,s,t", 0x7c000050, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2547. {"subu_s.ob", "d,s,t", 0x7c000154, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 },
  2548. {"subu_s.qb", "d,s,t", 0x7c000150, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 },
  2549. {"wrdsp", "s", 0x7c1ffcf8, 0xfc1fffff, RD_s|DSP_VOLA, 0, D32 },
  2550. {"wrdsp", "s,8", 0x7c0004f8, 0xfc1e07ff, RD_s|DSP_VOLA, 0, D32 },
  2551. /* MIPS DSP ASE Rev2 */
  2552. {"absq_s.qb", "d,t", 0x7c000052, 0xffe007ff, WR_d|RD_t, 0, D33 },
  2553. {"addu.ph", "d,s,t", 0x7c000210, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2554. {"addu_s.ph", "d,s,t", 0x7c000310, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2555. {"adduh.qb", "d,s,t", 0x7c000018, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2556. {"adduh_r.qb", "d,s,t", 0x7c000098, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2557. {"append", "t,s,h", 0x7c000031, 0xfc0007ff, WR_t|RD_t|RD_s, 0, D33 },
  2558. {"balign", "t,s,I", 0, (int) M_BALIGN, INSN_MACRO, 0, D33 },
  2559. {"balign", "t,s,2", 0x7c000431, 0xfc00e7ff, WR_t|RD_t|RD_s, 0, D33 },
  2560. {"cmpgdu.eq.qb", "d,s,t", 0x7c000611, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2561. {"cmpgdu.lt.qb", "d,s,t", 0x7c000651, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2562. {"cmpgdu.le.qb", "d,s,t", 0x7c000691, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2563. {"dpa.w.ph", "7,s,t", 0x7c000030, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2564. {"dps.w.ph", "7,s,t", 0x7c000070, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2565. {"mul.ph", "d,s,t", 0x7c000318, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D33 },
  2566. {"mul_s.ph", "d,s,t", 0x7c000398, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D33 },
  2567. {"mulq_rs.w", "d,s,t", 0x7c0005d8, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D33 },
  2568. {"mulq_s.ph", "d,s,t", 0x7c000790, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D33 },
  2569. {"mulq_s.w", "d,s,t", 0x7c000598, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, 0, D33 },
  2570. {"mulsa.w.ph", "7,s,t", 0x7c0000b0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2571. {"precr.qb.ph", "d,s,t", 0x7c000351, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2572. {"precr_sra.ph.w", "t,s,h", 0x7c000791, 0xfc0007ff, WR_t|RD_t|RD_s, 0, D33 },
  2573. {"precr_sra_r.ph.w", "t,s,h", 0x7c0007d1, 0xfc0007ff, WR_t|RD_t|RD_s, 0, D33 },
  2574. {"prepend", "t,s,h", 0x7c000071, 0xfc0007ff, WR_t|RD_t|RD_s, 0, D33 },
  2575. {"shra.qb", "d,t,3", 0x7c000113, 0xff0007ff, WR_d|RD_t, 0, D33 },
  2576. {"shra_r.qb", "d,t,3", 0x7c000153, 0xff0007ff, WR_d|RD_t, 0, D33 },
  2577. {"shrav.qb", "d,t,s", 0x7c000193, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2578. {"shrav_r.qb", "d,t,s", 0x7c0001d3, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2579. {"shrl.ph", "d,t,4", 0x7c000653, 0xfe0007ff, WR_d|RD_t, 0, D33 },
  2580. {"shrlv.ph", "d,t,s", 0x7c0006d3, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2581. {"subu.ph", "d,s,t", 0x7c000250, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2582. {"subu_s.ph", "d,s,t", 0x7c000350, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2583. {"subuh.qb", "d,s,t", 0x7c000058, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2584. {"subuh_r.qb", "d,s,t", 0x7c0000d8, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2585. {"addqh.ph", "d,s,t", 0x7c000218, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2586. {"addqh_r.ph", "d,s,t", 0x7c000298, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2587. {"addqh.w", "d,s,t", 0x7c000418, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2588. {"addqh_r.w", "d,s,t", 0x7c000498, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2589. {"subqh.ph", "d,s,t", 0x7c000258, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2590. {"subqh_r.ph", "d,s,t", 0x7c0002d8, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2591. {"subqh.w", "d,s,t", 0x7c000458, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2592. {"subqh_r.w", "d,s,t", 0x7c0004d8, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D33 },
  2593. {"dpax.w.ph", "7,s,t", 0x7c000230, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2594. {"dpsx.w.ph", "7,s,t", 0x7c000270, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2595. {"dpaqx_s.w.ph", "7,s,t", 0x7c000630, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2596. {"dpaqx_sa.w.ph", "7,s,t", 0x7c0006b0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2597. {"dpsqx_s.w.ph", "7,s,t", 0x7c000670, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2598. {"dpsqx_sa.w.ph", "7,s,t", 0x7c0006f0, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 },
  2599. /* Move bc0* after mftr and mttr to avoid opcode collision. */
  2600. {"bc0f", "p", 0x41000000, 0xffff0000, CBD|RD_CC, 0, I1 },
  2601. {"bc0fl", "p", 0x41020000, 0xffff0000, CBL|RD_CC, 0, I2|T3 },
  2602. {"bc0t", "p", 0x41010000, 0xffff0000, CBD|RD_CC, 0, I1 },
  2603. {"bc0tl", "p", 0x41030000, 0xffff0000, CBL|RD_CC, 0, I2|T3 },
  2604. /* ST Microelectronics Loongson-2E and -2F. */
  2605. {"mult.g", "d,s,t", 0x7c000018, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2606. {"mult.g", "d,s,t", 0x70000010, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2607. {"multu.g", "d,s,t", 0x7c000019, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2608. {"multu.g", "d,s,t", 0x70000012, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2609. {"dmult.g", "d,s,t", 0x7c00001c, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2610. {"dmult.g", "d,s,t", 0x70000011, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2611. {"dmultu.g", "d,s,t", 0x7c00001d, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2612. {"dmultu.g", "d,s,t", 0x70000013, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2613. {"div.g", "d,s,t", 0x7c00001a, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2614. {"div.g", "d,s,t", 0x70000014, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2615. {"divu.g", "d,s,t", 0x7c00001b, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2616. {"divu.g", "d,s,t", 0x70000016, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2617. {"ddiv.g", "d,s,t", 0x7c00001e, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2618. {"ddiv.g", "d,s,t", 0x70000015, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2619. {"ddivu.g", "d,s,t", 0x7c00001f, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2620. {"ddivu.g", "d,s,t", 0x70000017, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2621. {"mod.g", "d,s,t", 0x7c000022, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2622. {"mod.g", "d,s,t", 0x7000001c, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2623. {"modu.g", "d,s,t", 0x7c000023, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2624. {"modu.g", "d,s,t", 0x7000001e, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2625. {"dmod.g", "d,s,t", 0x7c000026, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2626. {"dmod.g", "d,s,t", 0x7000001d, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2627. {"dmodu.g", "d,s,t", 0x7c000027, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2E },
  2628. {"dmodu.g", "d,s,t", 0x7000001f, 0xfc0007ff, RD_s|RD_t|WR_d, 0, IL2F },
  2629. };
  2630. #define MIPS_NUM_OPCODES \
  2631. ((sizeof mips_builtin_opcodes) / (sizeof (mips_builtin_opcodes[0])))
  2632. const int bfd_mips_num_builtin_opcodes = MIPS_NUM_OPCODES;
  2633. /* const removed from the following to allow for dynamic extensions to the
  2634. * built-in instruction set. */
  2635. struct mips_opcode *mips_opcodes =
  2636. (struct mips_opcode *) mips_builtin_opcodes;
  2637. int bfd_mips_num_opcodes = MIPS_NUM_OPCODES;
  2638. #undef MIPS_NUM_OPCODES
  2639. /* Mips instructions are at maximum this many bytes long. */
  2640. #define INSNLEN 4
  2641. /* FIXME: These should be shared with gdb somehow. */
  2642. struct mips_cp0sel_name
  2643. {
  2644. unsigned int cp0reg;
  2645. unsigned int sel;
  2646. const char * const name;
  2647. };
  2648. /* The mips16 registers. */
  2649. static const unsigned int mips16_to_32_reg_map[] =
  2650. {
  2651. 16, 17, 2, 3, 4, 5, 6, 7
  2652. };
  2653. #define mips16_reg_names(rn) mips_gpr_names[mips16_to_32_reg_map[rn]]
  2654. static const char * const mips_gpr_names_numeric[32] =
  2655. {
  2656. "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7",
  2657. "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
  2658. "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",
  2659. "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
  2660. };
  2661. static const char * const mips_gpr_names_oldabi[32] =
  2662. {
  2663. "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
  2664. "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
  2665. "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
  2666. "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra"
  2667. };
  2668. static const char * const mips_gpr_names_newabi[32] =
  2669. {
  2670. "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
  2671. "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
  2672. "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
  2673. "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra"
  2674. };
  2675. static const char * const mips_fpr_names_numeric[32] =
  2676. {
  2677. "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7",
  2678. "$f8", "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15",
  2679. "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23",
  2680. "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31"
  2681. };
  2682. static const char * const mips_fpr_names_32[32] =
  2683. {
  2684. "fv0", "fv0f", "fv1", "fv1f", "ft0", "ft0f", "ft1", "ft1f",
  2685. "ft2", "ft2f", "ft3", "ft3f", "fa0", "fa0f", "fa1", "fa1f",
  2686. "ft4", "ft4f", "ft5", "ft5f", "fs0", "fs0f", "fs1", "fs1f",
  2687. "fs2", "fs2f", "fs3", "fs3f", "fs4", "fs4f", "fs5", "fs5f"
  2688. };
  2689. static const char * const mips_fpr_names_n32[32] =
  2690. {
  2691. "fv0", "ft14", "fv1", "ft15", "ft0", "ft1", "ft2", "ft3",
  2692. "ft4", "ft5", "ft6", "ft7", "fa0", "fa1", "fa2", "fa3",
  2693. "fa4", "fa5", "fa6", "fa7", "fs0", "ft8", "fs1", "ft9",
  2694. "fs2", "ft10", "fs3", "ft11", "fs4", "ft12", "fs5", "ft13"
  2695. };
  2696. static const char * const mips_fpr_names_64[32] =
  2697. {
  2698. "fv0", "ft12", "fv1", "ft13", "ft0", "ft1", "ft2", "ft3",
  2699. "ft4", "ft5", "ft6", "ft7", "fa0", "fa1", "fa2", "fa3",
  2700. "fa4", "fa5", "fa6", "fa7", "ft8", "ft9", "ft10", "ft11",
  2701. "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7"
  2702. };
  2703. static const char * const mips_cp0_names_numeric[32] =
  2704. {
  2705. "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7",
  2706. "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
  2707. "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",
  2708. "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
  2709. };
  2710. static const char * const mips_cp0_names_mips3264[32] =
  2711. {
  2712. "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1",
  2713. "c0_context", "c0_pagemask", "c0_wired", "$7",
  2714. "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare",
  2715. "c0_status", "c0_cause", "c0_epc", "c0_prid",
  2716. "c0_config", "c0_lladdr", "c0_watchlo", "c0_watchhi",
  2717. "c0_xcontext", "$21", "$22", "c0_debug",
  2718. "c0_depc", "c0_perfcnt", "c0_errctl", "c0_cacheerr",
  2719. "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave",
  2720. };
  2721. static const struct mips_cp0sel_name mips_cp0sel_names_mips3264[] =
  2722. {
  2723. { 4, 1, "c0_contextconfig" },
  2724. { 0, 1, "c0_mvpcontrol" },
  2725. { 0, 2, "c0_mvpconf0" },
  2726. { 0, 3, "c0_mvpconf1" },
  2727. { 1, 1, "c0_vpecontrol" },
  2728. { 1, 2, "c0_vpeconf0" },
  2729. { 1, 3, "c0_vpeconf1" },
  2730. { 1, 4, "c0_yqmask" },
  2731. { 1, 5, "c0_vpeschedule" },
  2732. { 1, 6, "c0_vpeschefback" },
  2733. { 2, 1, "c0_tcstatus" },
  2734. { 2, 2, "c0_tcbind" },
  2735. { 2, 3, "c0_tcrestart" },
  2736. { 2, 4, "c0_tchalt" },
  2737. { 2, 5, "c0_tccontext" },
  2738. { 2, 6, "c0_tcschedule" },
  2739. { 2, 7, "c0_tcschefback" },
  2740. { 5, 1, "c0_pagegrain" },
  2741. { 6, 1, "c0_srsconf0" },
  2742. { 6, 2, "c0_srsconf1" },
  2743. { 6, 3, "c0_srsconf2" },
  2744. { 6, 4, "c0_srsconf3" },
  2745. { 6, 5, "c0_srsconf4" },
  2746. { 12, 1, "c0_intctl" },
  2747. { 12, 2, "c0_srsctl" },
  2748. { 12, 3, "c0_srsmap" },
  2749. { 15, 1, "c0_ebase" },
  2750. { 16, 1, "c0_config1" },
  2751. { 16, 2, "c0_config2" },
  2752. { 16, 3, "c0_config3" },
  2753. { 18, 1, "c0_watchlo,1" },
  2754. { 18, 2, "c0_watchlo,2" },
  2755. { 18, 3, "c0_watchlo,3" },
  2756. { 18, 4, "c0_watchlo,4" },
  2757. { 18, 5, "c0_watchlo,5" },
  2758. { 18, 6, "c0_watchlo,6" },
  2759. { 18, 7, "c0_watchlo,7" },
  2760. { 19, 1, "c0_watchhi,1" },
  2761. { 19, 2, "c0_watchhi,2" },
  2762. { 19, 3, "c0_watchhi,3" },
  2763. { 19, 4, "c0_watchhi,4" },
  2764. { 19, 5, "c0_watchhi,5" },
  2765. { 19, 6, "c0_watchhi,6" },
  2766. { 19, 7, "c0_watchhi,7" },
  2767. { 23, 1, "c0_tracecontrol" },
  2768. { 23, 2, "c0_tracecontrol2" },
  2769. { 23, 3, "c0_usertracedata" },
  2770. { 23, 4, "c0_tracebpc" },
  2771. { 25, 1, "c0_perfcnt,1" },
  2772. { 25, 2, "c0_perfcnt,2" },
  2773. { 25, 3, "c0_perfcnt,3" },
  2774. { 25, 4, "c0_perfcnt,4" },
  2775. { 25, 5, "c0_perfcnt,5" },
  2776. { 25, 6, "c0_perfcnt,6" },
  2777. { 25, 7, "c0_perfcnt,7" },
  2778. { 27, 1, "c0_cacheerr,1" },
  2779. { 27, 2, "c0_cacheerr,2" },
  2780. { 27, 3, "c0_cacheerr,3" },
  2781. { 28, 1, "c0_datalo" },
  2782. { 28, 2, "c0_taglo1" },
  2783. { 28, 3, "c0_datalo1" },
  2784. { 28, 4, "c0_taglo2" },
  2785. { 28, 5, "c0_datalo2" },
  2786. { 28, 6, "c0_taglo3" },
  2787. { 28, 7, "c0_datalo3" },
  2788. { 29, 1, "c0_datahi" },
  2789. { 29, 2, "c0_taghi1" },
  2790. { 29, 3, "c0_datahi1" },
  2791. { 29, 4, "c0_taghi2" },
  2792. { 29, 5, "c0_datahi2" },
  2793. { 29, 6, "c0_taghi3" },
  2794. { 29, 7, "c0_datahi3" },
  2795. };
  2796. static const char * const mips_cp0_names_mips3264r2[32] =
  2797. {
  2798. "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1",
  2799. "c0_context", "c0_pagemask", "c0_wired", "c0_hwrena",
  2800. "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare",
  2801. "c0_status", "c0_cause", "c0_epc", "c0_prid",
  2802. "c0_config", "c0_lladdr", "c0_watchlo", "c0_watchhi",
  2803. "c0_xcontext", "$21", "$22", "c0_debug",
  2804. "c0_depc", "c0_perfcnt", "c0_errctl", "c0_cacheerr",
  2805. "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave",
  2806. };
  2807. static const struct mips_cp0sel_name mips_cp0sel_names_mips3264r2[] =
  2808. {
  2809. { 4, 1, "c0_contextconfig" },
  2810. { 5, 1, "c0_pagegrain" },
  2811. { 12, 1, "c0_intctl" },
  2812. { 12, 2, "c0_srsctl" },
  2813. { 12, 3, "c0_srsmap" },
  2814. { 15, 1, "c0_ebase" },
  2815. { 16, 1, "c0_config1" },
  2816. { 16, 2, "c0_config2" },
  2817. { 16, 3, "c0_config3" },
  2818. { 18, 1, "c0_watchlo,1" },
  2819. { 18, 2, "c0_watchlo,2" },
  2820. { 18, 3, "c0_watchlo,3" },
  2821. { 18, 4, "c0_watchlo,4" },
  2822. { 18, 5, "c0_watchlo,5" },
  2823. { 18, 6, "c0_watchlo,6" },
  2824. { 18, 7, "c0_watchlo,7" },
  2825. { 19, 1, "c0_watchhi,1" },
  2826. { 19, 2, "c0_watchhi,2" },
  2827. { 19, 3, "c0_watchhi,3" },
  2828. { 19, 4, "c0_watchhi,4" },
  2829. { 19, 5, "c0_watchhi,5" },
  2830. { 19, 6, "c0_watchhi,6" },
  2831. { 19, 7, "c0_watchhi,7" },
  2832. { 23, 1, "c0_tracecontrol" },
  2833. { 23, 2, "c0_tracecontrol2" },
  2834. { 23, 3, "c0_usertracedata" },
  2835. { 23, 4, "c0_tracebpc" },
  2836. { 25, 1, "c0_perfcnt,1" },
  2837. { 25, 2, "c0_perfcnt,2" },
  2838. { 25, 3, "c0_perfcnt,3" },
  2839. { 25, 4, "c0_perfcnt,4" },
  2840. { 25, 5, "c0_perfcnt,5" },
  2841. { 25, 6, "c0_perfcnt,6" },
  2842. { 25, 7, "c0_perfcnt,7" },
  2843. { 27, 1, "c0_cacheerr,1" },
  2844. { 27, 2, "c0_cacheerr,2" },
  2845. { 27, 3, "c0_cacheerr,3" },
  2846. { 28, 1, "c0_datalo" },
  2847. { 28, 2, "c0_taglo1" },
  2848. { 28, 3, "c0_datalo1" },
  2849. { 28, 4, "c0_taglo2" },
  2850. { 28, 5, "c0_datalo2" },
  2851. { 28, 6, "c0_taglo3" },
  2852. { 28, 7, "c0_datalo3" },
  2853. { 29, 1, "c0_datahi" },
  2854. { 29, 2, "c0_taghi1" },
  2855. { 29, 3, "c0_datahi1" },
  2856. { 29, 4, "c0_taghi2" },
  2857. { 29, 5, "c0_datahi2" },
  2858. { 29, 6, "c0_taghi3" },
  2859. { 29, 7, "c0_datahi3" },
  2860. };
  2861. /* SB-1: MIPS64 (mips_cp0_names_mips3264) with minor mods. */
  2862. static const char * const mips_cp0_names_sb1[32] =
  2863. {
  2864. "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1",
  2865. "c0_context", "c0_pagemask", "c0_wired", "$7",
  2866. "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare",
  2867. "c0_status", "c0_cause", "c0_epc", "c0_prid",
  2868. "c0_config", "c0_lladdr", "c0_watchlo", "c0_watchhi",
  2869. "c0_xcontext", "$21", "$22", "c0_debug",
  2870. "c0_depc", "c0_perfcnt", "c0_errctl", "c0_cacheerr_i",
  2871. "c0_taglo_i", "c0_taghi_i", "c0_errorepc", "c0_desave",
  2872. };
  2873. static const struct mips_cp0sel_name mips_cp0sel_names_sb1[] =
  2874. {
  2875. { 16, 1, "c0_config1" },
  2876. { 18, 1, "c0_watchlo,1" },
  2877. { 19, 1, "c0_watchhi,1" },
  2878. { 22, 0, "c0_perftrace" },
  2879. { 23, 3, "c0_edebug" },
  2880. { 25, 1, "c0_perfcnt,1" },
  2881. { 25, 2, "c0_perfcnt,2" },
  2882. { 25, 3, "c0_perfcnt,3" },
  2883. { 25, 4, "c0_perfcnt,4" },
  2884. { 25, 5, "c0_perfcnt,5" },
  2885. { 25, 6, "c0_perfcnt,6" },
  2886. { 25, 7, "c0_perfcnt,7" },
  2887. { 26, 1, "c0_buserr_pa" },
  2888. { 27, 1, "c0_cacheerr_d" },
  2889. { 27, 3, "c0_cacheerr_d_pa" },
  2890. { 28, 1, "c0_datalo_i" },
  2891. { 28, 2, "c0_taglo_d" },
  2892. { 28, 3, "c0_datalo_d" },
  2893. { 29, 1, "c0_datahi_i" },
  2894. { 29, 2, "c0_taghi_d" },
  2895. { 29, 3, "c0_datahi_d" },
  2896. };
  2897. static const char * const mips_hwr_names_numeric[32] =
  2898. {
  2899. "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7",
  2900. "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
  2901. "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",
  2902. "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
  2903. };
  2904. static const char * const mips_hwr_names_mips3264r2[32] =
  2905. {
  2906. "hwr_cpunum", "hwr_synci_step", "hwr_cc", "hwr_ccres",
  2907. "$4", "$5", "$6", "$7",
  2908. "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
  2909. "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",
  2910. "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
  2911. };
  2912. struct mips_abi_choice
  2913. {
  2914. const char *name;
  2915. const char * const *gpr_names;
  2916. const char * const *fpr_names;
  2917. };
  2918. static struct mips_abi_choice mips_abi_choices[] =
  2919. {
  2920. { "numeric", mips_gpr_names_numeric, mips_fpr_names_numeric },
  2921. { "32", mips_gpr_names_oldabi, mips_fpr_names_32 },
  2922. { "n32", mips_gpr_names_newabi, mips_fpr_names_n32 },
  2923. { "64", mips_gpr_names_newabi, mips_fpr_names_64 },
  2924. };
  2925. struct mips_arch_choice
  2926. {
  2927. const char *name;
  2928. int bfd_mach_valid;
  2929. unsigned long bfd_mach;
  2930. int processor;
  2931. int isa;
  2932. const char * const *cp0_names;
  2933. const struct mips_cp0sel_name *cp0sel_names;
  2934. unsigned int cp0sel_names_len;
  2935. const char * const *hwr_names;
  2936. };
  2937. #define bfd_mach_mips3000 3000
  2938. #define bfd_mach_mips3900 3900
  2939. #define bfd_mach_mips4000 4000
  2940. #define bfd_mach_mips4010 4010
  2941. #define bfd_mach_mips4100 4100
  2942. #define bfd_mach_mips4111 4111
  2943. #define bfd_mach_mips4120 4120
  2944. #define bfd_mach_mips4300 4300
  2945. #define bfd_mach_mips4400 4400
  2946. #define bfd_mach_mips4600 4600
  2947. #define bfd_mach_mips4650 4650
  2948. #define bfd_mach_mips5000 5000
  2949. #define bfd_mach_mips5400 5400
  2950. #define bfd_mach_mips5500 5500
  2951. #define bfd_mach_mips6000 6000
  2952. #define bfd_mach_mips7000 7000
  2953. #define bfd_mach_mips8000 8000
  2954. #define bfd_mach_mips9000 9000
  2955. #define bfd_mach_mips10000 10000
  2956. #define bfd_mach_mips12000 12000
  2957. #define bfd_mach_mips16 16
  2958. #define bfd_mach_mips5 5
  2959. #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
  2960. #define bfd_mach_mipsisa32 32
  2961. #define bfd_mach_mipsisa32r2 33
  2962. #define bfd_mach_mipsisa64 64
  2963. #define bfd_mach_mipsisa64r2 65
  2964. static const struct mips_arch_choice mips_arch_choices[] =
  2965. {
  2966. { "numeric", 0, 0, 0, 0,
  2967. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2968. { "r3000", 1, bfd_mach_mips3000, CPU_R3000, ISA_MIPS1,
  2969. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2970. { "r3900", 1, bfd_mach_mips3900, CPU_R3900, ISA_MIPS1,
  2971. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2972. { "r4000", 1, bfd_mach_mips4000, CPU_R4000, ISA_MIPS3,
  2973. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2974. { "r4010", 1, bfd_mach_mips4010, CPU_R4010, ISA_MIPS2,
  2975. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2976. { "vr4100", 1, bfd_mach_mips4100, CPU_VR4100, ISA_MIPS3,
  2977. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2978. { "vr4111", 1, bfd_mach_mips4111, CPU_R4111, ISA_MIPS3,
  2979. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2980. { "vr4120", 1, bfd_mach_mips4120, CPU_VR4120, ISA_MIPS3,
  2981. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2982. { "r4300", 1, bfd_mach_mips4300, CPU_R4300, ISA_MIPS3,
  2983. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2984. { "r4400", 1, bfd_mach_mips4400, CPU_R4400, ISA_MIPS3,
  2985. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2986. { "r4600", 1, bfd_mach_mips4600, CPU_R4600, ISA_MIPS3,
  2987. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2988. { "r4650", 1, bfd_mach_mips4650, CPU_R4650, ISA_MIPS3,
  2989. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2990. { "r5000", 1, bfd_mach_mips5000, CPU_R5000, ISA_MIPS4,
  2991. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2992. { "vr5400", 1, bfd_mach_mips5400, CPU_VR5400, ISA_MIPS4,
  2993. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2994. { "vr5500", 1, bfd_mach_mips5500, CPU_VR5500, ISA_MIPS4,
  2995. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2996. { "r6000", 1, bfd_mach_mips6000, CPU_R6000, ISA_MIPS2,
  2997. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  2998. { "rm7000", 1, bfd_mach_mips7000, CPU_RM7000, ISA_MIPS4,
  2999. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3000. { "rm9000", 1, bfd_mach_mips7000, CPU_RM7000, ISA_MIPS4,
  3001. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3002. { "r8000", 1, bfd_mach_mips8000, CPU_R8000, ISA_MIPS4,
  3003. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3004. { "r10000", 1, bfd_mach_mips10000, CPU_R10000, ISA_MIPS4,
  3005. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3006. { "r12000", 1, bfd_mach_mips12000, CPU_R12000, ISA_MIPS4,
  3007. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3008. { "mips5", 1, bfd_mach_mips5, CPU_MIPS5, ISA_MIPS5,
  3009. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3010. /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs.
  3011. Note that MIPS-3D and MDMX are not applicable to MIPS32. (See
  3012. _MIPS32 Architecture For Programmers Volume I: Introduction to the
  3013. MIPS32 Architecture_ (MIPS Document Number MD00082, Revision 0.95),
  3014. page 1. */
  3015. { "mips32", 1, bfd_mach_mipsisa32, CPU_MIPS32,
  3016. ISA_MIPS32 | INSN_MIPS16 | INSN_SMARTMIPS,
  3017. mips_cp0_names_mips3264,
  3018. mips_cp0sel_names_mips3264, ARRAY_SIZE (mips_cp0sel_names_mips3264),
  3019. mips_hwr_names_numeric },
  3020. { "mips32r2", 1, bfd_mach_mipsisa32r2, CPU_MIPS32R2,
  3021. (ISA_MIPS32R2 | INSN_MIPS16 | INSN_SMARTMIPS | INSN_DSP | INSN_DSPR2
  3022. | INSN_MIPS3D | INSN_MT),
  3023. mips_cp0_names_mips3264r2,
  3024. mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
  3025. mips_hwr_names_mips3264r2 },
  3026. /* For stock MIPS64, disassemble all applicable MIPS-specified ASEs. */
  3027. { "mips64", 1, bfd_mach_mipsisa64, CPU_MIPS64,
  3028. ISA_MIPS64 | INSN_MIPS16 | INSN_MIPS3D | INSN_MDMX,
  3029. mips_cp0_names_mips3264,
  3030. mips_cp0sel_names_mips3264, ARRAY_SIZE (mips_cp0sel_names_mips3264),
  3031. mips_hwr_names_numeric },
  3032. { "mips64r2", 1, bfd_mach_mipsisa64r2, CPU_MIPS64R2,
  3033. (ISA_MIPS64R2 | INSN_MIPS16 | INSN_MIPS3D | INSN_DSP | INSN_DSPR2
  3034. | INSN_DSP64 | INSN_MT | INSN_MDMX),
  3035. mips_cp0_names_mips3264r2,
  3036. mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
  3037. mips_hwr_names_mips3264r2 },
  3038. { "sb1", 1, bfd_mach_mips_sb1, CPU_SB1,
  3039. ISA_MIPS64 | INSN_MIPS3D | INSN_SB1,
  3040. mips_cp0_names_sb1,
  3041. mips_cp0sel_names_sb1, ARRAY_SIZE (mips_cp0sel_names_sb1),
  3042. mips_hwr_names_numeric },
  3043. /* This entry, mips16, is here only for ISA/processor selection; do
  3044. not print its name. */
  3045. { "", 1, bfd_mach_mips16, CPU_MIPS16, ISA_MIPS3 | INSN_MIPS16,
  3046. mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
  3047. };
  3048. /* ISA and processor type to disassemble for, and register names to use.
  3049. set_default_mips_dis_options and parse_mips_dis_options fill in these
  3050. values. */
  3051. static int mips_processor;
  3052. static int mips_isa;
  3053. static const char * const *mips_gpr_names;
  3054. static const char * const *mips_fpr_names;
  3055. static const char * const *mips_cp0_names;
  3056. static const struct mips_cp0sel_name *mips_cp0sel_names;
  3057. static int mips_cp0sel_names_len;
  3058. static const char * const *mips_hwr_names;
  3059. /* Other options */
  3060. static int no_aliases; /* If set disassemble as most general inst. */
  3061. static const struct mips_abi_choice *
  3062. choose_abi_by_name (const char *name, unsigned int namelen)
  3063. {
  3064. const struct mips_abi_choice *c;
  3065. unsigned int i;
  3066. for (i = 0, c = NULL; i < ARRAY_SIZE (mips_abi_choices) && c == NULL; i++)
  3067. if (strncmp (mips_abi_choices[i].name, name, namelen) == 0
  3068. && strlen (mips_abi_choices[i].name) == namelen)
  3069. c = &mips_abi_choices[i];
  3070. return c;
  3071. }
  3072. static const struct mips_arch_choice *
  3073. choose_arch_by_name (const char *name, unsigned int namelen)
  3074. {
  3075. const struct mips_arch_choice *c = NULL;
  3076. unsigned int i;
  3077. for (i = 0, c = NULL; i < ARRAY_SIZE (mips_arch_choices) && c == NULL; i++)
  3078. if (strncmp (mips_arch_choices[i].name, name, namelen) == 0
  3079. && strlen (mips_arch_choices[i].name) == namelen)
  3080. c = &mips_arch_choices[i];
  3081. return c;
  3082. }
  3083. static const struct mips_arch_choice *
  3084. choose_arch_by_number (unsigned long mach)
  3085. {
  3086. static unsigned long hint_bfd_mach;
  3087. static const struct mips_arch_choice *hint_arch_choice;
  3088. const struct mips_arch_choice *c;
  3089. unsigned int i;
  3090. /* We optimize this because even if the user specifies no
  3091. flags, this will be done for every instruction! */
  3092. if (hint_bfd_mach == mach
  3093. && hint_arch_choice != NULL
  3094. && hint_arch_choice->bfd_mach == hint_bfd_mach)
  3095. return hint_arch_choice;
  3096. for (i = 0, c = NULL; i < ARRAY_SIZE (mips_arch_choices) && c == NULL; i++)
  3097. {
  3098. if (mips_arch_choices[i].bfd_mach_valid
  3099. && mips_arch_choices[i].bfd_mach == mach)
  3100. {
  3101. c = &mips_arch_choices[i];
  3102. hint_bfd_mach = mach;
  3103. hint_arch_choice = c;
  3104. }
  3105. }
  3106. return c;
  3107. }
  3108. static void
  3109. set_default_mips_dis_options (struct disassemble_info *info)
  3110. {
  3111. const struct mips_arch_choice *chosen_arch;
  3112. /* Defaults: mipsIII/r3000 (?!), (o)32-style ("oldabi") GPR names,
  3113. and numeric FPR, CP0 register, and HWR names. */
  3114. mips_isa = ISA_MIPS3;
  3115. mips_processor = CPU_R3000;
  3116. mips_gpr_names = mips_gpr_names_oldabi;
  3117. mips_fpr_names = mips_fpr_names_numeric;
  3118. mips_cp0_names = mips_cp0_names_numeric;
  3119. mips_cp0sel_names = NULL;
  3120. mips_cp0sel_names_len = 0;
  3121. mips_hwr_names = mips_hwr_names_numeric;
  3122. no_aliases = 0;
  3123. /* If an ELF "newabi" binary, use the n32/(n)64 GPR names. */
  3124. #if 0
  3125. if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
  3126. {
  3127. Elf_Internal_Ehdr *header;
  3128. header = elf_elfheader (info->section->owner);
  3129. if (is_newabi (header))
  3130. mips_gpr_names = mips_gpr_names_newabi;
  3131. }
  3132. #endif
  3133. /* Set ISA, architecture, and cp0 register names as best we can. */
  3134. #if !defined(SYMTAB_AVAILABLE) && 0
  3135. /* This is running out on a target machine, not in a host tool.
  3136. FIXME: Where does mips_target_info come from? */
  3137. target_processor = mips_target_info.processor;
  3138. mips_isa = mips_target_info.isa;
  3139. #else
  3140. chosen_arch = choose_arch_by_number (info->mach);
  3141. if (chosen_arch != NULL)
  3142. {
  3143. mips_processor = chosen_arch->processor;
  3144. mips_isa = chosen_arch->isa;
  3145. mips_cp0_names = chosen_arch->cp0_names;
  3146. mips_cp0sel_names = chosen_arch->cp0sel_names;
  3147. mips_cp0sel_names_len = chosen_arch->cp0sel_names_len;
  3148. mips_hwr_names = chosen_arch->hwr_names;
  3149. }
  3150. #endif
  3151. }
  3152. static void
  3153. parse_mips_dis_option (const char *option, unsigned int len)
  3154. {
  3155. unsigned int i, optionlen, vallen;
  3156. const char *val;
  3157. const struct mips_abi_choice *chosen_abi;
  3158. const struct mips_arch_choice *chosen_arch;
  3159. /* Look for the = that delimits the end of the option name. */
  3160. for (i = 0; i < len; i++)
  3161. {
  3162. if (option[i] == '=')
  3163. break;
  3164. }
  3165. if (i == 0) /* Invalid option: no name before '='. */
  3166. return;
  3167. if (i == len) /* Invalid option: no '='. */
  3168. return;
  3169. if (i == (len - 1)) /* Invalid option: no value after '='. */
  3170. return;
  3171. optionlen = i;
  3172. val = option + (optionlen + 1);
  3173. vallen = len - (optionlen + 1);
  3174. if (strncmp("gpr-names", option, optionlen) == 0
  3175. && strlen("gpr-names") == optionlen)
  3176. {
  3177. chosen_abi = choose_abi_by_name (val, vallen);
  3178. if (chosen_abi != NULL)
  3179. mips_gpr_names = chosen_abi->gpr_names;
  3180. return;
  3181. }
  3182. if (strncmp("fpr-names", option, optionlen) == 0
  3183. && strlen("fpr-names") == optionlen)
  3184. {
  3185. chosen_abi = choose_abi_by_name (val, vallen);
  3186. if (chosen_abi != NULL)
  3187. mips_fpr_names = chosen_abi->fpr_names;
  3188. return;
  3189. }
  3190. if (strncmp("cp0-names", option, optionlen) == 0
  3191. && strlen("cp0-names") == optionlen)
  3192. {
  3193. chosen_arch = choose_arch_by_name (val, vallen);
  3194. if (chosen_arch != NULL)
  3195. {
  3196. mips_cp0_names = chosen_arch->cp0_names;
  3197. mips_cp0sel_names = chosen_arch->cp0sel_names;
  3198. mips_cp0sel_names_len = chosen_arch->cp0sel_names_len;
  3199. }
  3200. return;
  3201. }
  3202. if (strncmp("hwr-names", option, optionlen) == 0
  3203. && strlen("hwr-names") == optionlen)
  3204. {
  3205. chosen_arch = choose_arch_by_name (val, vallen);
  3206. if (chosen_arch != NULL)
  3207. mips_hwr_names = chosen_arch->hwr_names;
  3208. return;
  3209. }
  3210. if (strncmp("reg-names", option, optionlen) == 0
  3211. && strlen("reg-names") == optionlen)
  3212. {
  3213. /* We check both ABI and ARCH here unconditionally, so
  3214. that "numeric" will do the desirable thing: select
  3215. numeric register names for all registers. Other than
  3216. that, a given name probably won't match both. */
  3217. chosen_abi = choose_abi_by_name (val, vallen);
  3218. if (chosen_abi != NULL)
  3219. {
  3220. mips_gpr_names = chosen_abi->gpr_names;
  3221. mips_fpr_names = chosen_abi->fpr_names;
  3222. }
  3223. chosen_arch = choose_arch_by_name (val, vallen);
  3224. if (chosen_arch != NULL)
  3225. {
  3226. mips_cp0_names = chosen_arch->cp0_names;
  3227. mips_cp0sel_names = chosen_arch->cp0sel_names;
  3228. mips_cp0sel_names_len = chosen_arch->cp0sel_names_len;
  3229. mips_hwr_names = chosen_arch->hwr_names;
  3230. }
  3231. return;
  3232. }
  3233. /* Invalid option. */
  3234. }
  3235. static void
  3236. parse_mips_dis_options (const char *options)
  3237. {
  3238. const char *option_end;
  3239. if (options == NULL)
  3240. return;
  3241. while (*options != '\0')
  3242. {
  3243. /* Skip empty options. */
  3244. if (*options == ',')
  3245. {
  3246. options++;
  3247. continue;
  3248. }
  3249. /* We know that *options is neither NUL or a comma. */
  3250. option_end = options + 1;
  3251. while (*option_end != ',' && *option_end != '\0')
  3252. option_end++;
  3253. parse_mips_dis_option (options, option_end - options);
  3254. /* Go on to the next one. If option_end points to a comma, it
  3255. will be skipped above. */
  3256. options = option_end;
  3257. }
  3258. }
  3259. static const struct mips_cp0sel_name *
  3260. lookup_mips_cp0sel_name (const struct mips_cp0sel_name *names,
  3261. unsigned int len,
  3262. unsigned int cp0reg,
  3263. unsigned int sel)
  3264. {
  3265. unsigned int i;
  3266. for (i = 0; i < len; i++)
  3267. if (names[i].cp0reg == cp0reg && names[i].sel == sel)
  3268. return &names[i];
  3269. return NULL;
  3270. }
  3271. /* Print insn arguments for 32/64-bit code. */
  3272. static void
  3273. print_insn_args (const char *d,
  3274. register unsigned long int l,
  3275. bfd_vma pc,
  3276. struct disassemble_info *info,
  3277. const struct mips_opcode *opp)
  3278. {
  3279. int op, delta;
  3280. unsigned int lsb, msb, msbd;
  3281. lsb = 0;
  3282. for (; *d != '\0'; d++)
  3283. {
  3284. switch (*d)
  3285. {
  3286. case ',':
  3287. case '(':
  3288. case ')':
  3289. case '[':
  3290. case ']':
  3291. (*info->fprintf_func) (info->stream, "%c", *d);
  3292. break;
  3293. case '+':
  3294. /* Extension character; switch for second char. */
  3295. d++;
  3296. switch (*d)
  3297. {
  3298. case '\0':
  3299. /* xgettext:c-format */
  3300. (*info->fprintf_func) (info->stream,
  3301. _("# internal error, incomplete extension sequence (+)"));
  3302. return;
  3303. case 'A':
  3304. lsb = (l >> OP_SH_SHAMT) & OP_MASK_SHAMT;
  3305. (*info->fprintf_func) (info->stream, "0x%x", lsb);
  3306. break;
  3307. case 'B':
  3308. msb = (l >> OP_SH_INSMSB) & OP_MASK_INSMSB;
  3309. (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1);
  3310. break;
  3311. case '1':
  3312. (*info->fprintf_func) (info->stream, "0x%lx",
  3313. (l >> OP_SH_UDI1) & OP_MASK_UDI1);
  3314. break;
  3315. case '2':
  3316. (*info->fprintf_func) (info->stream, "0x%lx",
  3317. (l >> OP_SH_UDI2) & OP_MASK_UDI2);
  3318. break;
  3319. case '3':
  3320. (*info->fprintf_func) (info->stream, "0x%lx",
  3321. (l >> OP_SH_UDI3) & OP_MASK_UDI3);
  3322. break;
  3323. case '4':
  3324. (*info->fprintf_func) (info->stream, "0x%lx",
  3325. (l >> OP_SH_UDI4) & OP_MASK_UDI4);
  3326. break;
  3327. case 'C':
  3328. case 'H':
  3329. msbd = (l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD;
  3330. (*info->fprintf_func) (info->stream, "0x%x", msbd + 1);
  3331. break;
  3332. case 'D':
  3333. {
  3334. const struct mips_cp0sel_name *n;
  3335. unsigned int cp0reg, sel;
  3336. cp0reg = (l >> OP_SH_RD) & OP_MASK_RD;
  3337. sel = (l >> OP_SH_SEL) & OP_MASK_SEL;
  3338. /* CP0 register including 'sel' code for mtcN (et al.), to be
  3339. printed textually if known. If not known, print both
  3340. CP0 register name and sel numerically since CP0 register
  3341. with sel 0 may have a name unrelated to register being
  3342. printed. */
  3343. n = lookup_mips_cp0sel_name(mips_cp0sel_names,
  3344. mips_cp0sel_names_len, cp0reg, sel);
  3345. if (n != NULL)
  3346. (*info->fprintf_func) (info->stream, "%s", n->name);
  3347. else
  3348. (*info->fprintf_func) (info->stream, "$%d,%d", cp0reg, sel);
  3349. break;
  3350. }
  3351. case 'E':
  3352. lsb = ((l >> OP_SH_SHAMT) & OP_MASK_SHAMT) + 32;
  3353. (*info->fprintf_func) (info->stream, "0x%x", lsb);
  3354. break;
  3355. case 'F':
  3356. msb = ((l >> OP_SH_INSMSB) & OP_MASK_INSMSB) + 32;
  3357. (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1);
  3358. break;
  3359. case 'G':
  3360. msbd = ((l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD) + 32;
  3361. (*info->fprintf_func) (info->stream, "0x%x", msbd + 1);
  3362. break;
  3363. case 't': /* Coprocessor 0 reg name */
  3364. (*info->fprintf_func) (info->stream, "%s",
  3365. mips_cp0_names[(l >> OP_SH_RT) &
  3366. OP_MASK_RT]);
  3367. break;
  3368. case 'T': /* Coprocessor 0 reg name */
  3369. {
  3370. const struct mips_cp0sel_name *n;
  3371. unsigned int cp0reg, sel;
  3372. cp0reg = (l >> OP_SH_RT) & OP_MASK_RT;
  3373. sel = (l >> OP_SH_SEL) & OP_MASK_SEL;
  3374. /* CP0 register including 'sel' code for mftc0, to be
  3375. printed textually if known. If not known, print both
  3376. CP0 register name and sel numerically since CP0 register
  3377. with sel 0 may have a name unrelated to register being
  3378. printed. */
  3379. n = lookup_mips_cp0sel_name(mips_cp0sel_names,
  3380. mips_cp0sel_names_len, cp0reg, sel);
  3381. if (n != NULL)
  3382. (*info->fprintf_func) (info->stream, "%s", n->name);
  3383. else
  3384. (*info->fprintf_func) (info->stream, "$%d,%d", cp0reg, sel);
  3385. break;
  3386. }
  3387. default:
  3388. /* xgettext:c-format */
  3389. (*info->fprintf_func) (info->stream,
  3390. _("# internal error, undefined extension sequence (+%c)"),
  3391. *d);
  3392. return;
  3393. }
  3394. break;
  3395. case '2':
  3396. (*info->fprintf_func) (info->stream, "0x%lx",
  3397. (l >> OP_SH_BP) & OP_MASK_BP);
  3398. break;
  3399. case '3':
  3400. (*info->fprintf_func) (info->stream, "0x%lx",
  3401. (l >> OP_SH_SA3) & OP_MASK_SA3);
  3402. break;
  3403. case '4':
  3404. (*info->fprintf_func) (info->stream, "0x%lx",
  3405. (l >> OP_SH_SA4) & OP_MASK_SA4);
  3406. break;
  3407. case '5':
  3408. (*info->fprintf_func) (info->stream, "0x%lx",
  3409. (l >> OP_SH_IMM8) & OP_MASK_IMM8);
  3410. break;
  3411. case '6':
  3412. (*info->fprintf_func) (info->stream, "0x%lx",
  3413. (l >> OP_SH_RS) & OP_MASK_RS);
  3414. break;
  3415. case '7':
  3416. (*info->fprintf_func) (info->stream, "$ac%ld",
  3417. (l >> OP_SH_DSPACC) & OP_MASK_DSPACC);
  3418. break;
  3419. case '8':
  3420. (*info->fprintf_func) (info->stream, "0x%lx",
  3421. (l >> OP_SH_WRDSP) & OP_MASK_WRDSP);
  3422. break;
  3423. case '9':
  3424. (*info->fprintf_func) (info->stream, "$ac%ld",
  3425. (l >> OP_SH_DSPACC_S) & OP_MASK_DSPACC_S);
  3426. break;
  3427. case '0': /* dsp 6-bit signed immediate in bit 20 */
  3428. delta = ((l >> OP_SH_DSPSFT) & OP_MASK_DSPSFT);
  3429. if (delta & 0x20) /* test sign bit */
  3430. delta |= ~OP_MASK_DSPSFT;
  3431. (*info->fprintf_func) (info->stream, "%d", delta);
  3432. break;
  3433. case ':': /* dsp 7-bit signed immediate in bit 19 */
  3434. delta = ((l >> OP_SH_DSPSFT_7) & OP_MASK_DSPSFT_7);
  3435. if (delta & 0x40) /* test sign bit */
  3436. delta |= ~OP_MASK_DSPSFT_7;
  3437. (*info->fprintf_func) (info->stream, "%d", delta);
  3438. break;
  3439. case '\'':
  3440. (*info->fprintf_func) (info->stream, "0x%lx",
  3441. (l >> OP_SH_RDDSP) & OP_MASK_RDDSP);
  3442. break;
  3443. case '@': /* dsp 10-bit signed immediate in bit 16 */
  3444. delta = ((l >> OP_SH_IMM10) & OP_MASK_IMM10);
  3445. if (delta & 0x200) /* test sign bit */
  3446. delta |= ~OP_MASK_IMM10;
  3447. (*info->fprintf_func) (info->stream, "%d", delta);
  3448. break;
  3449. case '!':
  3450. (*info->fprintf_func) (info->stream, "%ld",
  3451. (l >> OP_SH_MT_U) & OP_MASK_MT_U);
  3452. break;
  3453. case '$':
  3454. (*info->fprintf_func) (info->stream, "%ld",
  3455. (l >> OP_SH_MT_H) & OP_MASK_MT_H);
  3456. break;
  3457. case '*':
  3458. (*info->fprintf_func) (info->stream, "$ac%ld",
  3459. (l >> OP_SH_MTACC_T) & OP_MASK_MTACC_T);
  3460. break;
  3461. case '&':
  3462. (*info->fprintf_func) (info->stream, "$ac%ld",
  3463. (l >> OP_SH_MTACC_D) & OP_MASK_MTACC_D);
  3464. break;
  3465. case 'g':
  3466. /* Coprocessor register for CTTC1, MTTC2, MTHC2, CTTC2. */
  3467. (*info->fprintf_func) (info->stream, "$%ld",
  3468. (l >> OP_SH_RD) & OP_MASK_RD);
  3469. break;
  3470. case 's':
  3471. case 'b':
  3472. case 'r':
  3473. case 'v':
  3474. (*info->fprintf_func) (info->stream, "%s",
  3475. mips_gpr_names[(l >> OP_SH_RS) & OP_MASK_RS]);
  3476. break;
  3477. case 't':
  3478. case 'w':
  3479. (*info->fprintf_func) (info->stream, "%s",
  3480. mips_gpr_names[(l >> OP_SH_RT) & OP_MASK_RT]);
  3481. break;
  3482. case 'i':
  3483. case 'u':
  3484. (*info->fprintf_func) (info->stream, "0x%lx",
  3485. (l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE);
  3486. break;
  3487. case 'j': /* Same as i, but sign-extended. */
  3488. case 'o':
  3489. delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA;
  3490. if (delta & 0x8000)
  3491. delta |= ~0xffff;
  3492. (*info->fprintf_func) (info->stream, "%d",
  3493. delta);
  3494. break;
  3495. case 'h':
  3496. (*info->fprintf_func) (info->stream, "0x%x",
  3497. (unsigned int) ((l >> OP_SH_PREFX)
  3498. & OP_MASK_PREFX));
  3499. break;
  3500. case 'k':
  3501. (*info->fprintf_func) (info->stream, "0x%x",
  3502. (unsigned int) ((l >> OP_SH_CACHE)
  3503. & OP_MASK_CACHE));
  3504. break;
  3505. case 'a':
  3506. info->target = (((pc + 4) & ~(bfd_vma) 0x0fffffff)
  3507. | (((l >> OP_SH_TARGET) & OP_MASK_TARGET) << 2));
  3508. /* For gdb disassembler, force odd address on jalx. */
  3509. if (info->flavour == bfd_target_unknown_flavour
  3510. && strcmp (opp->name, "jalx") == 0)
  3511. info->target |= 1;
  3512. (*info->print_address_func) (info->target, info);
  3513. break;
  3514. case 'p':
  3515. /* Sign extend the displacement. */
  3516. delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA;
  3517. if (delta & 0x8000)
  3518. delta |= ~0xffff;
  3519. info->target = (delta << 2) + pc + INSNLEN;
  3520. (*info->print_address_func) (info->target, info);
  3521. break;
  3522. case 'd':
  3523. (*info->fprintf_func) (info->stream, "%s",
  3524. mips_gpr_names[(l >> OP_SH_RD) & OP_MASK_RD]);
  3525. break;
  3526. case 'U':
  3527. {
  3528. /* First check for both rd and rt being equal. */
  3529. unsigned int reg = (l >> OP_SH_RD) & OP_MASK_RD;
  3530. if (reg == ((l >> OP_SH_RT) & OP_MASK_RT))
  3531. (*info->fprintf_func) (info->stream, "%s",
  3532. mips_gpr_names[reg]);
  3533. else
  3534. {
  3535. /* If one is zero use the other. */
  3536. if (reg == 0)
  3537. (*info->fprintf_func) (info->stream, "%s",
  3538. mips_gpr_names[(l >> OP_SH_RT) & OP_MASK_RT]);
  3539. else if (((l >> OP_SH_RT) & OP_MASK_RT) == 0)
  3540. (*info->fprintf_func) (info->stream, "%s",
  3541. mips_gpr_names[reg]);
  3542. else /* Bogus, result depends on processor. */
  3543. (*info->fprintf_func) (info->stream, "%s or %s",
  3544. mips_gpr_names[reg],
  3545. mips_gpr_names[(l >> OP_SH_RT) & OP_MASK_RT]);
  3546. }
  3547. }
  3548. break;
  3549. case 'z':
  3550. (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[0]);
  3551. break;
  3552. case '<':
  3553. (*info->fprintf_func) (info->stream, "0x%lx",
  3554. (l >> OP_SH_SHAMT) & OP_MASK_SHAMT);
  3555. break;
  3556. case 'c':
  3557. (*info->fprintf_func) (info->stream, "0x%lx",
  3558. (l >> OP_SH_CODE) & OP_MASK_CODE);
  3559. break;
  3560. case 'q':
  3561. (*info->fprintf_func) (info->stream, "0x%lx",
  3562. (l >> OP_SH_CODE2) & OP_MASK_CODE2);
  3563. break;
  3564. case 'C':
  3565. (*info->fprintf_func) (info->stream, "0x%lx",
  3566. (l >> OP_SH_COPZ) & OP_MASK_COPZ);
  3567. break;
  3568. case 'B':
  3569. (*info->fprintf_func) (info->stream, "0x%lx",
  3570. (l >> OP_SH_CODE20) & OP_MASK_CODE20);
  3571. break;
  3572. case 'J':
  3573. (*info->fprintf_func) (info->stream, "0x%lx",
  3574. (l >> OP_SH_CODE19) & OP_MASK_CODE19);
  3575. break;
  3576. case 'S':
  3577. case 'V':
  3578. (*info->fprintf_func) (info->stream, "%s",
  3579. mips_fpr_names[(l >> OP_SH_FS) & OP_MASK_FS]);
  3580. break;
  3581. case 'T':
  3582. case 'W':
  3583. (*info->fprintf_func) (info->stream, "%s",
  3584. mips_fpr_names[(l >> OP_SH_FT) & OP_MASK_FT]);
  3585. break;
  3586. case 'D':
  3587. (*info->fprintf_func) (info->stream, "%s",
  3588. mips_fpr_names[(l >> OP_SH_FD) & OP_MASK_FD]);
  3589. break;
  3590. case 'R':
  3591. (*info->fprintf_func) (info->stream, "%s",
  3592. mips_fpr_names[(l >> OP_SH_FR) & OP_MASK_FR]);
  3593. break;
  3594. case 'E':
  3595. /* Coprocessor register for lwcN instructions, et al.
  3596. Note that there is no load/store cp0 instructions, and
  3597. that FPU (cp1) instructions disassemble this field using
  3598. 'T' format. Therefore, until we gain understanding of
  3599. cp2 register names, we can simply print the register
  3600. numbers. */
  3601. (*info->fprintf_func) (info->stream, "$%ld",
  3602. (l >> OP_SH_RT) & OP_MASK_RT);
  3603. break;
  3604. case 'G':
  3605. /* Coprocessor register for mtcN instructions, et al. Note
  3606. that FPU (cp1) instructions disassemble this field using
  3607. 'S' format. Therefore, we only need to worry about cp0,
  3608. cp2, and cp3. */
  3609. op = (l >> OP_SH_OP) & OP_MASK_OP;
  3610. if (op == OP_OP_COP0)
  3611. (*info->fprintf_func) (info->stream, "%s",
  3612. mips_cp0_names[(l >> OP_SH_RD) & OP_MASK_RD]);
  3613. else
  3614. (*info->fprintf_func) (info->stream, "$%ld",
  3615. (l >> OP_SH_RD) & OP_MASK_RD);
  3616. break;
  3617. case 'K':
  3618. (*info->fprintf_func) (info->stream, "%s",
  3619. mips_hwr_names[(l >> OP_SH_RD) & OP_MASK_RD]);
  3620. break;
  3621. case 'N':
  3622. (*info->fprintf_func) (info->stream,
  3623. ((opp->pinfo & (FP_D | FP_S)) != 0
  3624. ? "$fcc%ld" : "$cc%ld"),
  3625. (l >> OP_SH_BCC) & OP_MASK_BCC);
  3626. break;
  3627. case 'M':
  3628. (*info->fprintf_func) (info->stream, "$fcc%ld",
  3629. (l >> OP_SH_CCC) & OP_MASK_CCC);
  3630. break;
  3631. case 'P':
  3632. (*info->fprintf_func) (info->stream, "%ld",
  3633. (l >> OP_SH_PERFREG) & OP_MASK_PERFREG);
  3634. break;
  3635. case 'e':
  3636. (*info->fprintf_func) (info->stream, "%ld",
  3637. (l >> OP_SH_VECBYTE) & OP_MASK_VECBYTE);
  3638. break;
  3639. case '%':
  3640. (*info->fprintf_func) (info->stream, "%ld",
  3641. (l >> OP_SH_VECALIGN) & OP_MASK_VECALIGN);
  3642. break;
  3643. case 'H':
  3644. (*info->fprintf_func) (info->stream, "%ld",
  3645. (l >> OP_SH_SEL) & OP_MASK_SEL);
  3646. break;
  3647. case 'O':
  3648. (*info->fprintf_func) (info->stream, "%ld",
  3649. (l >> OP_SH_ALN) & OP_MASK_ALN);
  3650. break;
  3651. case 'Q':
  3652. {
  3653. unsigned int vsel = (l >> OP_SH_VSEL) & OP_MASK_VSEL;
  3654. if ((vsel & 0x10) == 0)
  3655. {
  3656. int fmt;
  3657. vsel &= 0x0f;
  3658. for (fmt = 0; fmt < 3; fmt++, vsel >>= 1)
  3659. if ((vsel & 1) == 0)
  3660. break;
  3661. (*info->fprintf_func) (info->stream, "$v%ld[%d]",
  3662. (l >> OP_SH_FT) & OP_MASK_FT,
  3663. vsel >> 1);
  3664. }
  3665. else if ((vsel & 0x08) == 0)
  3666. {
  3667. (*info->fprintf_func) (info->stream, "$v%ld",
  3668. (l >> OP_SH_FT) & OP_MASK_FT);
  3669. }
  3670. else
  3671. {
  3672. (*info->fprintf_func) (info->stream, "0x%lx",
  3673. (l >> OP_SH_FT) & OP_MASK_FT);
  3674. }
  3675. }
  3676. break;
  3677. case 'X':
  3678. (*info->fprintf_func) (info->stream, "$v%ld",
  3679. (l >> OP_SH_FD) & OP_MASK_FD);
  3680. break;
  3681. case 'Y':
  3682. (*info->fprintf_func) (info->stream, "$v%ld",
  3683. (l >> OP_SH_FS) & OP_MASK_FS);
  3684. break;
  3685. case 'Z':
  3686. (*info->fprintf_func) (info->stream, "$v%ld",
  3687. (l >> OP_SH_FT) & OP_MASK_FT);
  3688. break;
  3689. default:
  3690. /* xgettext:c-format */
  3691. (*info->fprintf_func) (info->stream,
  3692. _("# internal error, undefined modifier(%c)"),
  3693. *d);
  3694. return;
  3695. }
  3696. }
  3697. }
  3698. /* Check if the object uses NewABI conventions. */
  3699. #if 0
  3700. static int
  3701. is_newabi (header)
  3702. Elf_Internal_Ehdr *header;
  3703. {
  3704. /* There are no old-style ABIs which use 64-bit ELF. */
  3705. if (header->e_ident[EI_CLASS] == ELFCLASS64)
  3706. return 1;
  3707. /* If a 32-bit ELF file, n32 is a new-style ABI. */
  3708. if ((header->e_flags & EF_MIPS_ABI2) != 0)
  3709. return 1;
  3710. return 0;
  3711. }
  3712. #endif
  3713. /* Print the mips instruction at address MEMADDR in debugged memory,
  3714. on using INFO. Returns length of the instruction, in bytes, which is
  3715. always INSNLEN. BIGENDIAN must be 1 if this is big-endian code, 0 if
  3716. this is little-endian code. */
  3717. static int
  3718. print_insn_mips (bfd_vma memaddr,
  3719. unsigned long int word,
  3720. struct disassemble_info *info)
  3721. {
  3722. const struct mips_opcode *op;
  3723. static bfd_boolean init = 0;
  3724. static const struct mips_opcode *mips_hash[OP_MASK_OP + 1];
  3725. /* Build a hash table to shorten the search time. */
  3726. if (! init)
  3727. {
  3728. unsigned int i;
  3729. for (i = 0; i <= OP_MASK_OP; i++)
  3730. {
  3731. for (op = mips_opcodes; op < &mips_opcodes[NUMOPCODES]; op++)
  3732. {
  3733. if (op->pinfo == INSN_MACRO
  3734. || (no_aliases && (op->pinfo2 & INSN2_ALIAS)))
  3735. continue;
  3736. if (i == ((op->match >> OP_SH_OP) & OP_MASK_OP))
  3737. {
  3738. mips_hash[i] = op;
  3739. break;
  3740. }
  3741. }
  3742. }
  3743. init = 1;
  3744. }
  3745. info->bytes_per_chunk = INSNLEN;
  3746. info->display_endian = info->endian;
  3747. info->insn_info_valid = 1;
  3748. info->branch_delay_insns = 0;
  3749. info->data_size = 0;
  3750. info->insn_type = dis_nonbranch;
  3751. info->target = 0;
  3752. info->target2 = 0;
  3753. op = mips_hash[(word >> OP_SH_OP) & OP_MASK_OP];
  3754. if (op != NULL)
  3755. {
  3756. for (; op < &mips_opcodes[NUMOPCODES]; op++)
  3757. {
  3758. if (op->pinfo != INSN_MACRO
  3759. && !(no_aliases && (op->pinfo2 & INSN2_ALIAS))
  3760. && (word & op->mask) == op->match)
  3761. {
  3762. const char *d;
  3763. /* We always allow to disassemble the jalx instruction. */
  3764. if (! OPCODE_IS_MEMBER (op, mips_isa, mips_processor)
  3765. && strcmp (op->name, "jalx"))
  3766. continue;
  3767. /* Figure out instruction type and branch delay information. */
  3768. if ((op->pinfo & INSN_UNCOND_BRANCH_DELAY) != 0)
  3769. {
  3770. if ((info->insn_type & INSN_WRITE_GPR_31) != 0)
  3771. info->insn_type = dis_jsr;
  3772. else
  3773. info->insn_type = dis_branch;
  3774. info->branch_delay_insns = 1;
  3775. }
  3776. else if ((op->pinfo & (INSN_COND_BRANCH_DELAY
  3777. | INSN_COND_BRANCH_LIKELY)) != 0)
  3778. {
  3779. if ((info->insn_type & INSN_WRITE_GPR_31) != 0)
  3780. info->insn_type = dis_condjsr;
  3781. else
  3782. info->insn_type = dis_condbranch;
  3783. info->branch_delay_insns = 1;
  3784. }
  3785. else if ((op->pinfo & (INSN_STORE_MEMORY
  3786. | INSN_LOAD_MEMORY_DELAY)) != 0)
  3787. info->insn_type = dis_dref;
  3788. (*info->fprintf_func) (info->stream, "%s", op->name);
  3789. d = op->args;
  3790. if (d != NULL && *d != '\0')
  3791. {
  3792. (*info->fprintf_func) (info->stream, "\t");
  3793. print_insn_args (d, word, memaddr, info, op);
  3794. }
  3795. return INSNLEN;
  3796. }
  3797. }
  3798. }
  3799. /* Handle undefined instructions. */
  3800. info->insn_type = dis_noninsn;
  3801. (*info->fprintf_func) (info->stream, "0x%lx", word);
  3802. return INSNLEN;
  3803. }
  3804. /* In an environment where we do not know the symbol type of the
  3805. instruction we are forced to assume that the low order bit of the
  3806. instructions' address may mark it as a mips16 instruction. If we
  3807. are single stepping, or the pc is within the disassembled function,
  3808. this works. Otherwise, we need a clue. Sometimes. */
  3809. static int
  3810. _print_insn_mips (bfd_vma memaddr,
  3811. struct disassemble_info *info,
  3812. enum bfd_endian endianness)
  3813. {
  3814. bfd_byte buffer[INSNLEN];
  3815. int status;
  3816. set_default_mips_dis_options (info);
  3817. parse_mips_dis_options (info->disassembler_options);
  3818. #if 0
  3819. #if 1
  3820. /* FIXME: If odd address, this is CLEARLY a mips 16 instruction. */
  3821. /* Only a few tools will work this way. */
  3822. if (memaddr & 0x01)
  3823. return print_insn_mips16 (memaddr, info);
  3824. #endif
  3825. #if SYMTAB_AVAILABLE
  3826. if (info->mach == bfd_mach_mips16
  3827. || (info->flavour == bfd_target_elf_flavour
  3828. && info->symbols != NULL
  3829. && ((*(elf_symbol_type **) info->symbols)->internal_elf_sym.st_other
  3830. == STO_MIPS16)))
  3831. return print_insn_mips16 (memaddr, info);
  3832. #endif
  3833. #endif
  3834. status = (*info->read_memory_func) (memaddr, buffer, INSNLEN, info);
  3835. if (status == 0)
  3836. {
  3837. unsigned long insn;
  3838. if (endianness == BFD_ENDIAN_BIG)
  3839. insn = (unsigned long) bfd_getb32 (buffer);
  3840. else
  3841. insn = (unsigned long) bfd_getl32 (buffer);
  3842. return print_insn_mips (memaddr, insn, info);
  3843. }
  3844. else
  3845. {
  3846. (*info->memory_error_func) (status, memaddr, info);
  3847. return -1;
  3848. }
  3849. }
  3850. int
  3851. print_insn_big_mips (bfd_vma memaddr, struct disassemble_info *info)
  3852. {
  3853. return _print_insn_mips (memaddr, info, BFD_ENDIAN_BIG);
  3854. }
  3855. int
  3856. print_insn_little_mips (bfd_vma memaddr, struct disassemble_info *info)
  3857. {
  3858. return _print_insn_mips (memaddr, info, BFD_ENDIAN_LITTLE);
  3859. }
  3860. /* Disassemble mips16 instructions. */
  3861. #if 0
  3862. static int
  3863. print_insn_mips16 (bfd_vma memaddr, struct disassemble_info *info)
  3864. {
  3865. int status;
  3866. bfd_byte buffer[2];
  3867. int length;
  3868. int insn;
  3869. bfd_boolean use_extend;
  3870. int extend = 0;
  3871. const struct mips_opcode *op, *opend;
  3872. info->bytes_per_chunk = 2;
  3873. info->display_endian = info->endian;
  3874. info->insn_info_valid = 1;
  3875. info->branch_delay_insns = 0;
  3876. info->data_size = 0;
  3877. info->insn_type = dis_nonbranch;
  3878. info->target = 0;
  3879. info->target2 = 0;
  3880. status = (*info->read_memory_func) (memaddr, buffer, 2, info);
  3881. if (status != 0)
  3882. {
  3883. (*info->memory_error_func) (status, memaddr, info);
  3884. return -1;
  3885. }
  3886. length = 2;
  3887. if (info->endian == BFD_ENDIAN_BIG)
  3888. insn = bfd_getb16 (buffer);
  3889. else
  3890. insn = bfd_getl16 (buffer);
  3891. /* Handle the extend opcode specially. */
  3892. use_extend = FALSE;
  3893. if ((insn & 0xf800) == 0xf000)
  3894. {
  3895. use_extend = TRUE;
  3896. extend = insn & 0x7ff;
  3897. memaddr += 2;
  3898. status = (*info->read_memory_func) (memaddr, buffer, 2, info);
  3899. if (status != 0)
  3900. {
  3901. (*info->fprintf_func) (info->stream, "extend 0x%x",
  3902. (unsigned int) extend);
  3903. (*info->memory_error_func) (status, memaddr, info);
  3904. return -1;
  3905. }
  3906. if (info->endian == BFD_ENDIAN_BIG)
  3907. insn = bfd_getb16 (buffer);
  3908. else
  3909. insn = bfd_getl16 (buffer);
  3910. /* Check for an extend opcode followed by an extend opcode. */
  3911. if ((insn & 0xf800) == 0xf000)
  3912. {
  3913. (*info->fprintf_func) (info->stream, "extend 0x%x",
  3914. (unsigned int) extend);
  3915. info->insn_type = dis_noninsn;
  3916. return length;
  3917. }
  3918. length += 2;
  3919. }
  3920. /* FIXME: Should probably use a hash table on the major opcode here. */
  3921. opend = mips16_opcodes + bfd_mips16_num_opcodes;
  3922. for (op = mips16_opcodes; op < opend; op++)
  3923. {
  3924. if (op->pinfo != INSN_MACRO
  3925. && !(no_aliases && (op->pinfo2 & INSN2_ALIAS))
  3926. && (insn & op->mask) == op->match)
  3927. {
  3928. const char *s;
  3929. if (strchr (op->args, 'a') != NULL)
  3930. {
  3931. if (use_extend)
  3932. {
  3933. (*info->fprintf_func) (info->stream, "extend 0x%x",
  3934. (unsigned int) extend);
  3935. info->insn_type = dis_noninsn;
  3936. return length - 2;
  3937. }
  3938. use_extend = FALSE;
  3939. memaddr += 2;
  3940. status = (*info->read_memory_func) (memaddr, buffer, 2,
  3941. info);
  3942. if (status == 0)
  3943. {
  3944. use_extend = TRUE;
  3945. if (info->endian == BFD_ENDIAN_BIG)
  3946. extend = bfd_getb16 (buffer);
  3947. else
  3948. extend = bfd_getl16 (buffer);
  3949. length += 2;
  3950. }
  3951. }
  3952. (*info->fprintf_func) (info->stream, "%s", op->name);
  3953. if (op->args[0] != '\0')
  3954. (*info->fprintf_func) (info->stream, "\t");
  3955. for (s = op->args; *s != '\0'; s++)
  3956. {
  3957. if (*s == ','
  3958. && s[1] == 'w'
  3959. && (((insn >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX)
  3960. == ((insn >> MIPS16OP_SH_RY) & MIPS16OP_MASK_RY)))
  3961. {
  3962. /* Skip the register and the comma. */
  3963. ++s;
  3964. continue;
  3965. }
  3966. if (*s == ','
  3967. && s[1] == 'v'
  3968. && (((insn >> MIPS16OP_SH_RZ) & MIPS16OP_MASK_RZ)
  3969. == ((insn >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX)))
  3970. {
  3971. /* Skip the register and the comma. */
  3972. ++s;
  3973. continue;
  3974. }
  3975. print_mips16_insn_arg (*s, op, insn, use_extend, extend, memaddr,
  3976. info);
  3977. }
  3978. if ((op->pinfo & INSN_UNCOND_BRANCH_DELAY) != 0)
  3979. {
  3980. info->branch_delay_insns = 1;
  3981. if (info->insn_type != dis_jsr)
  3982. info->insn_type = dis_branch;
  3983. }
  3984. return length;
  3985. }
  3986. }
  3987. if (use_extend)
  3988. (*info->fprintf_func) (info->stream, "0x%x", extend | 0xf000);
  3989. (*info->fprintf_func) (info->stream, "0x%x", insn);
  3990. info->insn_type = dis_noninsn;
  3991. return length;
  3992. }
  3993. /* Disassemble an operand for a mips16 instruction. */
  3994. static void
  3995. print_mips16_insn_arg (char type,
  3996. const struct mips_opcode *op,
  3997. int l,
  3998. bfd_boolean use_extend,
  3999. int extend,
  4000. bfd_vma memaddr,
  4001. struct disassemble_info *info)
  4002. {
  4003. switch (type)
  4004. {
  4005. case ',':
  4006. case '(':
  4007. case ')':
  4008. (*info->fprintf_func) (info->stream, "%c", type);
  4009. break;
  4010. case 'y':
  4011. case 'w':
  4012. (*info->fprintf_func) (info->stream, "%s",
  4013. mips16_reg_names(((l >> MIPS16OP_SH_RY)
  4014. & MIPS16OP_MASK_RY)));
  4015. break;
  4016. case 'x':
  4017. case 'v':
  4018. (*info->fprintf_func) (info->stream, "%s",
  4019. mips16_reg_names(((l >> MIPS16OP_SH_RX)
  4020. & MIPS16OP_MASK_RX)));
  4021. break;
  4022. case 'z':
  4023. (*info->fprintf_func) (info->stream, "%s",
  4024. mips16_reg_names(((l >> MIPS16OP_SH_RZ)
  4025. & MIPS16OP_MASK_RZ)));
  4026. break;
  4027. case 'Z':
  4028. (*info->fprintf_func) (info->stream, "%s",
  4029. mips16_reg_names(((l >> MIPS16OP_SH_MOVE32Z)
  4030. & MIPS16OP_MASK_MOVE32Z)));
  4031. break;
  4032. case '0':
  4033. (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[0]);
  4034. break;
  4035. case 'S':
  4036. (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[29]);
  4037. break;
  4038. case 'P':
  4039. (*info->fprintf_func) (info->stream, "$pc");
  4040. break;
  4041. case 'R':
  4042. (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[31]);
  4043. break;
  4044. case 'X':
  4045. (*info->fprintf_func) (info->stream, "%s",
  4046. mips_gpr_names[((l >> MIPS16OP_SH_REGR32)
  4047. & MIPS16OP_MASK_REGR32)]);
  4048. break;
  4049. case 'Y':
  4050. (*info->fprintf_func) (info->stream, "%s",
  4051. mips_gpr_names[MIPS16OP_EXTRACT_REG32R (l)]);
  4052. break;
  4053. case '<':
  4054. case '>':
  4055. case '[':
  4056. case ']':
  4057. case '4':
  4058. case '5':
  4059. case 'H':
  4060. case 'W':
  4061. case 'D':
  4062. case 'j':
  4063. case '6':
  4064. case '8':
  4065. case 'V':
  4066. case 'C':
  4067. case 'U':
  4068. case 'k':
  4069. case 'K':
  4070. case 'p':
  4071. case 'q':
  4072. case 'A':
  4073. case 'B':
  4074. case 'E':
  4075. {
  4076. int immed, nbits, shift, signedp, extbits, pcrel, extu, branch;
  4077. shift = 0;
  4078. signedp = 0;
  4079. extbits = 16;
  4080. pcrel = 0;
  4081. extu = 0;
  4082. branch = 0;
  4083. switch (type)
  4084. {
  4085. case '<':
  4086. nbits = 3;
  4087. immed = (l >> MIPS16OP_SH_RZ) & MIPS16OP_MASK_RZ;
  4088. extbits = 5;
  4089. extu = 1;
  4090. break;
  4091. case '>':
  4092. nbits = 3;
  4093. immed = (l >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX;
  4094. extbits = 5;
  4095. extu = 1;
  4096. break;
  4097. case '[':
  4098. nbits = 3;
  4099. immed = (l >> MIPS16OP_SH_RZ) & MIPS16OP_MASK_RZ;
  4100. extbits = 6;
  4101. extu = 1;
  4102. break;
  4103. case ']':
  4104. nbits = 3;
  4105. immed = (l >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX;
  4106. extbits = 6;
  4107. extu = 1;
  4108. break;
  4109. case '4':
  4110. nbits = 4;
  4111. immed = (l >> MIPS16OP_SH_IMM4) & MIPS16OP_MASK_IMM4;
  4112. signedp = 1;
  4113. extbits = 15;
  4114. break;
  4115. case '5':
  4116. nbits = 5;
  4117. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4118. info->insn_type = dis_dref;
  4119. info->data_size = 1;
  4120. break;
  4121. case 'H':
  4122. nbits = 5;
  4123. shift = 1;
  4124. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4125. info->insn_type = dis_dref;
  4126. info->data_size = 2;
  4127. break;
  4128. case 'W':
  4129. nbits = 5;
  4130. shift = 2;
  4131. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4132. if ((op->pinfo & MIPS16_INSN_READ_PC) == 0
  4133. && (op->pinfo & MIPS16_INSN_READ_SP) == 0)
  4134. {
  4135. info->insn_type = dis_dref;
  4136. info->data_size = 4;
  4137. }
  4138. break;
  4139. case 'D':
  4140. nbits = 5;
  4141. shift = 3;
  4142. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4143. info->insn_type = dis_dref;
  4144. info->data_size = 8;
  4145. break;
  4146. case 'j':
  4147. nbits = 5;
  4148. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4149. signedp = 1;
  4150. break;
  4151. case '6':
  4152. nbits = 6;
  4153. immed = (l >> MIPS16OP_SH_IMM6) & MIPS16OP_MASK_IMM6;
  4154. break;
  4155. case '8':
  4156. nbits = 8;
  4157. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4158. break;
  4159. case 'V':
  4160. nbits = 8;
  4161. shift = 2;
  4162. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4163. /* FIXME: This might be lw, or it might be addiu to $sp or
  4164. $pc. We assume it's load. */
  4165. info->insn_type = dis_dref;
  4166. info->data_size = 4;
  4167. break;
  4168. case 'C':
  4169. nbits = 8;
  4170. shift = 3;
  4171. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4172. info->insn_type = dis_dref;
  4173. info->data_size = 8;
  4174. break;
  4175. case 'U':
  4176. nbits = 8;
  4177. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4178. extu = 1;
  4179. break;
  4180. case 'k':
  4181. nbits = 8;
  4182. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4183. signedp = 1;
  4184. break;
  4185. case 'K':
  4186. nbits = 8;
  4187. shift = 3;
  4188. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4189. signedp = 1;
  4190. break;
  4191. case 'p':
  4192. nbits = 8;
  4193. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4194. signedp = 1;
  4195. pcrel = 1;
  4196. branch = 1;
  4197. info->insn_type = dis_condbranch;
  4198. break;
  4199. case 'q':
  4200. nbits = 11;
  4201. immed = (l >> MIPS16OP_SH_IMM11) & MIPS16OP_MASK_IMM11;
  4202. signedp = 1;
  4203. pcrel = 1;
  4204. branch = 1;
  4205. info->insn_type = dis_branch;
  4206. break;
  4207. case 'A':
  4208. nbits = 8;
  4209. shift = 2;
  4210. immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
  4211. pcrel = 1;
  4212. /* FIXME: This can be lw or la. We assume it is lw. */
  4213. info->insn_type = dis_dref;
  4214. info->data_size = 4;
  4215. break;
  4216. case 'B':
  4217. nbits = 5;
  4218. shift = 3;
  4219. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4220. pcrel = 1;
  4221. info->insn_type = dis_dref;
  4222. info->data_size = 8;
  4223. break;
  4224. case 'E':
  4225. nbits = 5;
  4226. shift = 2;
  4227. immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
  4228. pcrel = 1;
  4229. break;
  4230. default:
  4231. abort ();
  4232. }
  4233. if (! use_extend)
  4234. {
  4235. if (signedp && immed >= (1 << (nbits - 1)))
  4236. immed -= 1 << nbits;
  4237. immed <<= shift;
  4238. if ((type == '<' || type == '>' || type == '[' || type == ']')
  4239. && immed == 0)
  4240. immed = 8;
  4241. }
  4242. else
  4243. {
  4244. if (extbits == 16)
  4245. immed |= ((extend & 0x1f) << 11) | (extend & 0x7e0);
  4246. else if (extbits == 15)
  4247. immed |= ((extend & 0xf) << 11) | (extend & 0x7f0);
  4248. else
  4249. immed = ((extend >> 6) & 0x1f) | (extend & 0x20);
  4250. immed &= (1 << extbits) - 1;
  4251. if (! extu && immed >= (1 << (extbits - 1)))
  4252. immed -= 1 << extbits;
  4253. }
  4254. if (! pcrel)
  4255. (*info->fprintf_func) (info->stream, "%d", immed);
  4256. else
  4257. {
  4258. bfd_vma baseaddr;
  4259. if (branch)
  4260. {
  4261. immed *= 2;
  4262. baseaddr = memaddr + 2;
  4263. }
  4264. else if (use_extend)
  4265. baseaddr = memaddr - 2;
  4266. else
  4267. {
  4268. int status;
  4269. bfd_byte buffer[2];
  4270. baseaddr = memaddr;
  4271. /* If this instruction is in the delay slot of a jr
  4272. instruction, the base address is the address of the
  4273. jr instruction. If it is in the delay slot of jalr
  4274. instruction, the base address is the address of the
  4275. jalr instruction. This test is unreliable: we have
  4276. no way of knowing whether the previous word is
  4277. instruction or data. */
  4278. status = (*info->read_memory_func) (memaddr - 4, buffer, 2,
  4279. info);
  4280. if (status == 0
  4281. && (((info->endian == BFD_ENDIAN_BIG
  4282. ? bfd_getb16 (buffer)
  4283. : bfd_getl16 (buffer))
  4284. & 0xf800) == 0x1800))
  4285. baseaddr = memaddr - 4;
  4286. else
  4287. {
  4288. status = (*info->read_memory_func) (memaddr - 2, buffer,
  4289. 2, info);
  4290. if (status == 0
  4291. && (((info->endian == BFD_ENDIAN_BIG
  4292. ? bfd_getb16 (buffer)
  4293. : bfd_getl16 (buffer))
  4294. & 0xf81f) == 0xe800))
  4295. baseaddr = memaddr - 2;
  4296. }
  4297. }
  4298. info->target = (baseaddr & ~((1 << shift) - 1)) + immed;
  4299. if (pcrel && branch
  4300. && info->flavour == bfd_target_unknown_flavour)
  4301. /* For gdb disassembler, maintain odd address. */
  4302. info->target |= 1;
  4303. (*info->print_address_func) (info->target, info);
  4304. }
  4305. }
  4306. break;
  4307. case 'a':
  4308. {
  4309. int jalx = l & 0x400;
  4310. if (! use_extend)
  4311. extend = 0;
  4312. l = ((l & 0x1f) << 23) | ((l & 0x3e0) << 13) | (extend << 2);
  4313. if (!jalx && info->flavour == bfd_target_unknown_flavour)
  4314. /* For gdb disassembler, maintain odd address. */
  4315. l |= 1;
  4316. }
  4317. info->target = ((memaddr + 4) & ~(bfd_vma) 0x0fffffff) | l;
  4318. (*info->print_address_func) (info->target, info);
  4319. info->insn_type = dis_jsr;
  4320. info->branch_delay_insns = 1;
  4321. break;
  4322. case 'l':
  4323. case 'L':
  4324. {
  4325. int need_comma, amask, smask;
  4326. need_comma = 0;
  4327. l = (l >> MIPS16OP_SH_IMM6) & MIPS16OP_MASK_IMM6;
  4328. amask = (l >> 3) & 7;
  4329. if (amask > 0 && amask < 5)
  4330. {
  4331. (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[4]);
  4332. if (amask > 1)
  4333. (*info->fprintf_func) (info->stream, "-%s",
  4334. mips_gpr_names[amask + 3]);
  4335. need_comma = 1;
  4336. }
  4337. smask = (l >> 1) & 3;
  4338. if (smask == 3)
  4339. {
  4340. (*info->fprintf_func) (info->stream, "%s??",
  4341. need_comma ? "," : "");
  4342. need_comma = 1;
  4343. }
  4344. else if (smask > 0)
  4345. {
  4346. (*info->fprintf_func) (info->stream, "%s%s",
  4347. need_comma ? "," : "",
  4348. mips_gpr_names[16]);
  4349. if (smask > 1)
  4350. (*info->fprintf_func) (info->stream, "-%s",
  4351. mips_gpr_names[smask + 15]);
  4352. need_comma = 1;
  4353. }
  4354. if (l & 1)
  4355. {
  4356. (*info->fprintf_func) (info->stream, "%s%s",
  4357. need_comma ? "," : "",
  4358. mips_gpr_names[31]);
  4359. need_comma = 1;
  4360. }
  4361. if (amask == 5 || amask == 6)
  4362. {
  4363. (*info->fprintf_func) (info->stream, "%s$f0",
  4364. need_comma ? "," : "");
  4365. if (amask == 6)
  4366. (*info->fprintf_func) (info->stream, "-$f1");
  4367. }
  4368. }
  4369. break;
  4370. case 'm':
  4371. case 'M':
  4372. /* MIPS16e save/restore. */
  4373. {
  4374. int need_comma = 0;
  4375. int amask, args, statics;
  4376. int nsreg, smask;
  4377. int framesz;
  4378. int i, j;
  4379. l = l & 0x7f;
  4380. if (use_extend)
  4381. l |= extend << 16;
  4382. amask = (l >> 16) & 0xf;
  4383. if (amask == MIPS16_ALL_ARGS)
  4384. {
  4385. args = 4;
  4386. statics = 0;
  4387. }
  4388. else if (amask == MIPS16_ALL_STATICS)
  4389. {
  4390. args = 0;
  4391. statics = 4;
  4392. }
  4393. else
  4394. {
  4395. args = amask >> 2;
  4396. statics = amask & 3;
  4397. }
  4398. if (args > 0) {
  4399. (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[4]);
  4400. if (args > 1)
  4401. (*info->fprintf_func) (info->stream, "-%s",
  4402. mips_gpr_names[4 + args - 1]);
  4403. need_comma = 1;
  4404. }
  4405. framesz = (((l >> 16) & 0xf0) | (l & 0x0f)) * 8;
  4406. if (framesz == 0 && !use_extend)
  4407. framesz = 128;
  4408. (*info->fprintf_func) (info->stream, "%s%d",
  4409. need_comma ? "," : "",
  4410. framesz);
  4411. if (l & 0x40) /* $ra */
  4412. (*info->fprintf_func) (info->stream, ",%s", mips_gpr_names[31]);
  4413. nsreg = (l >> 24) & 0x7;
  4414. smask = 0;
  4415. if (l & 0x20) /* $s0 */
  4416. smask |= 1 << 0;
  4417. if (l & 0x10) /* $s1 */
  4418. smask |= 1 << 1;
  4419. if (nsreg > 0) /* $s2-$s8 */
  4420. smask |= ((1 << nsreg) - 1) << 2;
  4421. /* Find first set static reg bit. */
  4422. for (i = 0; i < 9; i++)
  4423. {
  4424. if (smask & (1 << i))
  4425. {
  4426. (*info->fprintf_func) (info->stream, ",%s",
  4427. mips_gpr_names[i == 8 ? 30 : (16 + i)]);
  4428. /* Skip over string of set bits. */
  4429. for (j = i; smask & (2 << j); j++)
  4430. continue;
  4431. if (j > i)
  4432. (*info->fprintf_func) (info->stream, "-%s",
  4433. mips_gpr_names[j == 8 ? 30 : (16 + j)]);
  4434. i = j + 1;
  4435. }
  4436. }
  4437. /* Statics $ax - $a3. */
  4438. if (statics == 1)
  4439. (*info->fprintf_func) (info->stream, ",%s", mips_gpr_names[7]);
  4440. else if (statics > 0)
  4441. (*info->fprintf_func) (info->stream, ",%s-%s",
  4442. mips_gpr_names[7 - statics + 1],
  4443. mips_gpr_names[7]);
  4444. }
  4445. break;
  4446. default:
  4447. /* xgettext:c-format */
  4448. (*info->fprintf_func)
  4449. (info->stream,
  4450. _("# internal disassembler error, unrecognised modifier (%c)"),
  4451. type);
  4452. abort ();
  4453. }
  4454. }
  4455. void
  4456. print_mips_disassembler_options (FILE *stream)
  4457. {
  4458. unsigned int i;
  4459. fprintf (stream, _("\n\
  4460. The following MIPS specific disassembler options are supported for use\n\
  4461. with the -M switch (multiple options should be separated by commas):\n"));
  4462. fprintf (stream, _("\n\
  4463. gpr-names=ABI Print GPR names according to specified ABI.\n\
  4464. Default: based on binary being disassembled.\n"));
  4465. fprintf (stream, _("\n\
  4466. fpr-names=ABI Print FPR names according to specified ABI.\n\
  4467. Default: numeric.\n"));
  4468. fprintf (stream, _("\n\
  4469. cp0-names=ARCH Print CP0 register names according to\n\
  4470. specified architecture.\n\
  4471. Default: based on binary being disassembled.\n"));
  4472. fprintf (stream, _("\n\
  4473. hwr-names=ARCH Print HWR names according to specified \n\
  4474. architecture.\n\
  4475. Default: based on binary being disassembled.\n"));
  4476. fprintf (stream, _("\n\
  4477. reg-names=ABI Print GPR and FPR names according to\n\
  4478. specified ABI.\n"));
  4479. fprintf (stream, _("\n\
  4480. reg-names=ARCH Print CP0 register and HWR names according to\n\
  4481. specified architecture.\n"));
  4482. fprintf (stream, _("\n\
  4483. For the options above, the following values are supported for \"ABI\":\n\
  4484. "));
  4485. for (i = 0; i < ARRAY_SIZE (mips_abi_choices); i++)
  4486. fprintf (stream, " %s", mips_abi_choices[i].name);
  4487. fprintf (stream, _("\n"));
  4488. fprintf (stream, _("\n\
  4489. For the options above, The following values are supported for \"ARCH\":\n\
  4490. "));
  4491. for (i = 0; i < ARRAY_SIZE (mips_arch_choices); i++)
  4492. if (*mips_arch_choices[i].name != '\0')
  4493. fprintf (stream, " %s", mips_arch_choices[i].name);
  4494. fprintf (stream, _("\n"));
  4495. fprintf (stream, _("\n"));
  4496. }
  4497. #endif