mips-dis.c 205 KB

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