micromips.igen 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115
  1. // Simulator definition for the micromips ASE.
  2. // Copyright (C) 2005-2022 Free Software Foundation, Inc.
  3. // Contributed by Imagination Technologies, Ltd.
  4. // Written by Andrew Bennett <andrew.bennett@imgtec.com>
  5. //
  6. // This file is part of the MIPS sim.
  7. //
  8. // This program is free software; you can redistribute it and/or modify
  9. // it under the terms of the GNU General Public License as published by
  10. // the Free Software Foundation; either version 3 of the License, or
  11. // (at your option) any later version.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU General Public License
  19. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. :compute:::int:TBASE:BASE:((BASE < 2) ? (16 + BASE) \: BASE)
  21. :compute:::int:TRD:RD:((RD < 2) ? (16 + RD) \: RD)
  22. :compute:::int:TRS:RS:((RS < 2) ? (16 + RS) \: RS)
  23. :compute:::int:TRT:RT:((RT < 2) ? (16 + RT) \: RT)
  24. :compute:::int:TRT_S:RT_S:((RT_S == 1 ) ? 17 \: RT_S)
  25. :compute:::int:ERT:RT:(compute_movep_src_reg (SD_, RT))
  26. :compute:::int:ERS:RS:(compute_movep_src_reg (SD_, RS))
  27. :compute:::int:IMM_DEC1:IMMEDIATE:((IMMEDIATE == 7) ? -1 \: ((IMMEDIATE == 0) ? 1 \: IMMEDIATE << 2))
  28. :compute:::int:IMM_DEC2:IMMEDIATE:((IMMEDIATE < 8) ? IMMEDIATE \: (IMMEDIATE - 16))
  29. :compute:::int:IMM_DEC3:IMMEDIATE:((IMMEDIATE < 2) ? IMMEDIATE + 256 \: ((IMMEDIATE < 256) ? IMMEDIATE \: ((IMMEDIATE < 510) ? IMMEDIATE - 512 \: IMMEDIATE - 768)))
  30. :compute:::int:IMM_DEC4:IMMEDIATE:(compute_andi16_imm (SD_, IMMEDIATE))
  31. :compute:::int:IMM_DEC5:IMMEDIATE:((IMMEDIATE < 15) ? IMMEDIATE \: -1)
  32. :compute:::int:IMM_DEC6:IMMEDIATE:((IMMEDIATE < 127) ? IMMEDIATE \: -1)
  33. :compute:::int:SHIFT_DEC:SHIFT:((SHIFT == 0) ? 8 \: SHIFT)
  34. :compute:::int:IMM_SHIFT_1BIT:IMMEDIATE:(IMMEDIATE << 1)
  35. :compute:::int:IMM_SHIFT_2BIT:IMMEDIATE:(IMMEDIATE << 2)
  36. :function:::address_word:delayslot_micromips:address_word target, address_word nia, int delayslot_instruction_size
  37. *micromips32:
  38. *micromips64:
  39. *micromipsdsp:
  40. {
  41. instruction_word delay_insn;
  42. sim_events_slip (SD, 1);
  43. DSPC = CIA;
  44. CIA = nia;
  45. STATE |= simDELAYSLOT;
  46. ENGINE_ISSUE_PREFIX_HOOK();
  47. micromips_instruction_decode (SD, CPU, CIA, delayslot_instruction_size);
  48. STATE &= ~simDELAYSLOT;
  49. return target;
  50. }
  51. :function:::address_word:process_isa_mode:address_word target
  52. *micromips32:
  53. *micromips64:
  54. {
  55. struct mips_sim_state *state = MIPS_SIM_STATE (SD);
  56. state->isa_mode = target & 0x1;
  57. return (target & (-(1 << 1)));
  58. }
  59. :function:::address_word:do_micromips_jalr:int rt, int rs, address_word nia, int delayslot_instruction_size
  60. *micromips32:
  61. *micromips64:
  62. {
  63. GPR[rt] = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
  64. return (process_isa_mode (SD_,
  65. delayslot_micromips (SD_, GPR[rs], nia, delayslot_instruction_size)));
  66. }
  67. :function:::address_word:do_micromips_jal:address_word target, address_word nia, int delayslot_instruction_size
  68. *micromips32:
  69. *micromips64:
  70. {
  71. RA = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
  72. return delayslot_micromips (SD_, target, nia, delayslot_instruction_size);
  73. }
  74. :function:::uint32_t:compute_movep_src_reg:int reg
  75. *micromips32:
  76. *micromips64:
  77. {
  78. switch (reg)
  79. {
  80. case 0: return 0;
  81. case 1: return 17;
  82. case 2: return 2;
  83. case 3: return 3;
  84. case 4: return 16;
  85. case 5: return 18;
  86. case 6: return 19;
  87. case 7: return 20;
  88. default: return 0;
  89. }
  90. }
  91. :function:::uint32_t:compute_andi16_imm:int encoded_imm
  92. *micromips32:
  93. *micromips64:
  94. {
  95. switch (encoded_imm)
  96. {
  97. case 0: return 128;
  98. case 1: return 1;
  99. case 2: return 2;
  100. case 3: return 3;
  101. case 4: return 4;
  102. case 5: return 7;
  103. case 6: return 8;
  104. case 7: return 15;
  105. case 8: return 16;
  106. case 9: return 31;
  107. case 10: return 32;
  108. case 11: return 63;
  109. case 12: return 64;
  110. case 13: return 255;
  111. case 14: return 32768;
  112. case 15: return 65535;
  113. default: return 0;
  114. }
  115. }
  116. :function:::FP_formats:convert_fmt_micromips:int fmt
  117. *micromips32:
  118. *micromips64:
  119. {
  120. switch (fmt)
  121. {
  122. case 0: return fmt_single;
  123. case 1: return fmt_double;
  124. case 2: return fmt_ps;
  125. default: return fmt_unknown;
  126. }
  127. }
  128. :function:::FP_formats:convert_fmt_micromips_cvt_d:int fmt
  129. *micromips32:
  130. *micromips64:
  131. {
  132. switch (fmt)
  133. {
  134. case 0: return fmt_single;
  135. case 1: return fmt_word;
  136. case 2: return fmt_long;
  137. default: return fmt_unknown;
  138. }
  139. }
  140. :function:::FP_formats:convert_fmt_micromips_cvt_s:int fmt
  141. *micromips32:
  142. *micromips64:
  143. {
  144. switch (fmt)
  145. {
  146. case 0: return fmt_double;
  147. case 1: return fmt_word;
  148. case 2: return fmt_long;
  149. default: return fmt_unknown;
  150. }
  151. }
  152. 011011,3.RD,6.IMMEDIATE,1:POOL16E:16::ADDIUR1SP
  153. "addiur1sp r<TRD>, <IMMEDIATE>"
  154. *micromips32:
  155. *micromips64:
  156. {
  157. do_addiu (SD_, SPIDX, TRD, IMMEDIATE << 2);
  158. }
  159. 011011,3.RD,3.RS,3.IMMEDIATE,0:POOL16E:16::ADDIUR2
  160. "addiur2 r<TRD>, r<TRS>, <IMM_DEC1>"
  161. *micromips32:
  162. *micromips64:
  163. {
  164. do_addiu (SD_, TRS, TRD, IMM_DEC1);
  165. }
  166. 010011,5.RD,4.IMMEDIATE,0:POOL16D:16::ADDIUS5
  167. "addius5 r<RD>, <IMM_DEC2>"
  168. *micromips32:
  169. *micromips64:
  170. {
  171. do_addiu (SD_, RD, RD, IMM_DEC2);
  172. }
  173. 010011,9.IMMEDIATE,1:POOL16D:16::ADDIUSP
  174. "addiusp <IMM_DEC3>"
  175. *micromips32:
  176. *micromips64:
  177. {
  178. do_addiu (SD_, SPIDX, SPIDX, IMM_DEC3 << 2);
  179. }
  180. 000001,3.RD,3.RT,3.RS,0:POOL16A:16::ADDU16
  181. "addu16 r<TRD>, r<TRS>, r<TRT>"
  182. *micromips32:
  183. *micromips64:
  184. {
  185. do_addu (SD_, TRS, TRT, TRD);
  186. }
  187. 001011,3.RD,3.RS,4.IMMEDIATE:MICROMIPS:16::ANDI16
  188. "andi16 r<TRD>, r<TRS>, <IMM_DEC4>"
  189. *micromips32:
  190. *micromips64:
  191. {
  192. do_andi (SD_, TRS, TRD, IMM_DEC4);
  193. }
  194. 010001,0010,3.RT,3.RS:POOL16C:16::AND16
  195. "and16 r<TRT>, r<TRS>"
  196. *micromips32:
  197. *micromips64:
  198. {
  199. do_and (SD_, TRS, TRT, TRT);
  200. }
  201. 110011,10.IMMEDIATE:MICROMIPS:16::B16
  202. "b16 <IMMEDIATE>"
  203. *micromips32:
  204. *micromips64:
  205. {
  206. NIA = delayslot_micromips (SD_, NIA + (EXTEND11 (IMMEDIATE << 1)),
  207. NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
  208. }
  209. 100011,3.RS,7.IMMEDIATE:MICROMIPS:16::BEQZ16
  210. "beqz16 r<TRS>, <IMMEDIATE>"
  211. *micromips32:
  212. *micromips64:
  213. {
  214. if (GPR[TRS] == 0)
  215. NIA = delayslot_micromips (SD_, NIA + (EXTEND8 (IMMEDIATE << 1)),
  216. NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
  217. }
  218. 101011,3.RS,7.IMMEDIATE:MICROMIPS:16::BNEZ16
  219. "bnez16 r<TRS>, <IMMEDIATE>"
  220. *micromips32:
  221. *micromips64:
  222. {
  223. if (GPR[TRS] != 0)
  224. NIA = delayslot_micromips (SD_, NIA + (EXTEND8 (IMMEDIATE << 1)),
  225. NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
  226. }
  227. 010001,101000,4.CODE:POOL16C:16::BREAK16
  228. "break16 %#lx<CODE>"
  229. *micromips32:
  230. *micromips64:
  231. {
  232. do_break16 (SD_, instruction_0);
  233. }
  234. 010001,01110,5.RS:POOL16C:16::JALR16
  235. "jalr16 r<RS>"
  236. *micromips32:
  237. *micromips64:
  238. {
  239. NIA = do_micromips_jalr (SD_, RAIDX, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
  240. }
  241. 010001,01111,5.RS:POOL16C:16::JALRS16
  242. "jalrs16 r<RS>"
  243. *micromips32:
  244. *micromips64:
  245. {
  246. NIA = do_micromips_jalr (SD_, RAIDX, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
  247. }
  248. 010001,01100,5.RS:POOL16C:16::JR16
  249. "jr16 r<RS>"
  250. *micromips32:
  251. *micromips64:
  252. {
  253. NIA = process_isa_mode (SD_,
  254. delayslot_micromips (SD_, GPR[RS], NIA, MICROMIPS_DELAYSLOT_SIZE_ANY));
  255. }
  256. 010001,11000,5.IMMEDIATE:POOL16C:16::JRADDIUSP
  257. "jraddiusp <IMMEDIATE>"
  258. *micromips32:
  259. *micromips64:
  260. {
  261. address_word temp = RA;
  262. do_addiu (SD_, SPIDX, SPIDX, IMMEDIATE << 2);
  263. NIA = process_isa_mode (SD_, temp);
  264. }
  265. 010001,01101,5.RS:POOL16C:16::JRC
  266. "jrc r<RS>"
  267. *micromips32:
  268. *micromips64:
  269. {
  270. NIA = process_isa_mode (SD_, GPR[RS]);
  271. }
  272. 000010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LBU16
  273. "lbu16 r<TRT>, <IMM_DEC5>(r<TBASE>)"
  274. *micromips32:
  275. *micromips64:
  276. {
  277. /* LBU can have a negative offset. As the offset argument to do_load is
  278. unsigned we need to do the address calcuation before the function call so
  279. that the load address has been correctly calculated */
  280. GPR[TRT] = do_load (SD_, AccessLength_BYTE, GPR[TBASE] + IMM_DEC5, 0);
  281. }
  282. 001010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LHU16
  283. "lhu16 r<TRT>, <IMM_SHIFT_1BIT>(r<TBASE>)"
  284. *micromips32:
  285. *micromips64:
  286. {
  287. GPR[TRT] = do_load (SD_, AccessLength_HALFWORD, GPR[TBASE], IMM_SHIFT_1BIT);
  288. }
  289. 111011,3.RD,7.IMMEDIATE:MICROMIPS:16::LI16
  290. "li16 r<TRD>, <IMM_DEC6>"
  291. *micromips32:
  292. *micromips64:
  293. {
  294. GPR[TRD] = IMM_DEC6;
  295. }
  296. 011010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LW16
  297. "lw16 r<TRT>, <IMM_SHIFT_2BIT>(r<TBASE>)"
  298. *micromips32:
  299. *micromips64:
  300. {
  301. GPR[TRT] = EXTEND32 (
  302. do_load (SD_, AccessLength_WORD, GPR[TBASE], IMM_SHIFT_2BIT));
  303. }
  304. :%s::::LWMREGS:int lwmregs
  305. *micromips32:
  306. *micromips64:
  307. {
  308. if (lwmregs == 3)
  309. return "s0, s1, s2, s3, ra";
  310. else if (lwmregs == 2)
  311. return "s0, s1, s2, ra";
  312. else if (lwmregs == 1)
  313. return "s0, s1, ra";
  314. else if (lwmregs == 0)
  315. return "s0, ra";
  316. else
  317. return "";
  318. }
  319. 010001,0100,2.LWMREGS,4.IMMEDIATE:POOL16C:16::LWM16
  320. "lwm16 %s<LWMREGS>, <IMM_SHIFT_2BIT>(sp)"
  321. *micromips32:
  322. *micromips64:
  323. {
  324. int address = GPR[SPIDX] + IMM_SHIFT_2BIT;
  325. int reg_offset;
  326. for (reg_offset = 0; reg_offset <= LWMREGS; reg_offset++)
  327. GPR[16 + reg_offset] = EXTEND32 (
  328. do_load (SD_, AccessLength_WORD, address, reg_offset * 4));
  329. RA = EXTEND32 (do_load (SD_, AccessLength_WORD, address, reg_offset * 4));
  330. }
  331. 011001,3.RT,7.IMMEDIATE:MICROMIPS:16::LWGP
  332. "lwgp r<TRT>, <IMM_SHIFT_2BIT>(gp)"
  333. *micromips32:
  334. *micromips64:
  335. {
  336. GPR[TRT] = EXTEND32 (
  337. do_load (SD_, AccessLength_WORD, GPR[28], IMM_SHIFT_2BIT));
  338. }
  339. 010010,5.RT,5.IMMEDIATE:MICROMIPS:16::LWSP
  340. "lwsp r<RT>, <IMM_SHIFT_2BIT>(sp)"
  341. *micromips32:
  342. *micromips64:
  343. {
  344. GPR[RT] = EXTEND32 (do_load (SD_, AccessLength_WORD, SP, IMM_SHIFT_2BIT));
  345. }
  346. 010001,10000,5.RD:POOL16C:16::MFHI16
  347. "mfhi16 r<RD>"
  348. *micromips32:
  349. *micromips64:
  350. {
  351. do_mfhi (SD_, RD);
  352. }
  353. 010001,10010,5.RD:POOL16C:16::MFLO16
  354. "mflo16 r<RD>"
  355. *micromips32:
  356. *micromips64:
  357. {
  358. do_mflo (SD_, RD);
  359. }
  360. 000011,5.RD,5.RS:MICROMIPS:16::MOVE16
  361. "nop":RD==0&&RS==0
  362. "move16 r<RD>, r<RS>"
  363. *micromips32:
  364. *micromips64:
  365. {
  366. GPR[RD] = GPR[RS];
  367. }
  368. :%s::::DESTREGS:int regs
  369. *micromips32:
  370. *micromips64:
  371. {
  372. switch (regs)
  373. {
  374. case 0: return "a1, a2,";
  375. case 1: return "a1, a3,";
  376. case 2: return "a2, a3,";
  377. case 3: return "a0, s5,";
  378. case 4: return "a0, s6,";
  379. case 5: return "a0, a1,";
  380. case 6: return "a0, a2,";
  381. case 7: return "a0, a3,";
  382. default: return "";
  383. }
  384. }
  385. 100001,3.DESTREGS,3.RT,3.RS,0:MICROMIPS:16::MOVEP
  386. "movep %s<DESTREGS> r<ERS>, r<ERT>"
  387. *micromips32:
  388. *micromips64:
  389. {
  390. int rd;
  391. int re;
  392. int dest = DESTREGS;
  393. if (dest == 0 || dest == 1)
  394. rd = 5;
  395. else if (dest == 2)
  396. rd = 6;
  397. else
  398. rd = 4;
  399. if (dest == 0 || dest == 6)
  400. re = 6;
  401. else if (dest == 1 || dest == 2 || dest == 7)
  402. re = 7;
  403. else if (dest == 3)
  404. re = 21;
  405. else if (dest == 4)
  406. re = 22;
  407. /* assume dest is 5 */
  408. else
  409. re = 5;
  410. GPR[rd] = GPR[ERS];
  411. GPR[re] = GPR[ERT];
  412. }
  413. 010001,0000,3.RT,3.RS:POOL16C:16::NOT16
  414. "not16 r<TRT>, r<TRS>"
  415. *micromips32:
  416. *micromips64:
  417. {
  418. do_nor (SD_, 0, TRS, TRT);
  419. }
  420. 010001,0011,3.RT,3.RS:POOL16C:16::OR16
  421. "or16 r<TRT>, r<TRS>"
  422. *micromips32:
  423. *micromips64:
  424. {
  425. do_or (SD_, TRS, TRT, TRT);
  426. }
  427. 100010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SB16
  428. "sb16 r<TRT_S>, <IMMEDIATE>(r<TBASE>)"
  429. *micromips32:
  430. *micromips64:
  431. {
  432. do_store (SD_, AccessLength_BYTE, GPR[TBASE], IMMEDIATE, GPR[TRT_S]);
  433. }
  434. 010001,101100,4.CODE:POOL16C:16::SDBBP16
  435. "sdbbp16 %#lx<CODE>"
  436. *micromips32:
  437. *micromips64:
  438. {
  439. SignalException (DebugBreakPoint, instruction_0);
  440. }
  441. 101010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SH16
  442. "sh16 r<TRT_S>, <IMM_SHIFT_1BIT>(r<TBASE>)"
  443. *micromips32:
  444. *micromips64:
  445. {
  446. do_store (SD_, AccessLength_HALFWORD, GPR[TBASE], IMM_SHIFT_1BIT, GPR[TRT_S]);
  447. }
  448. 001001,3.RD,3.RT,3.SHIFT,0:POOL16B:16::SLL16
  449. "sll16 r<TRD>, r<TRT>, <SHIFT_DEC>"
  450. *micromips32:
  451. *micromips64:
  452. {
  453. do_sll (SD_, TRT, TRD, SHIFT_DEC);
  454. }
  455. 001001,3.RD,3.RT,3.SHIFT,1:POOL16B:16::SRL16
  456. "srl16 r<TRD>, r<TRT>, <SHIFT_DEC>"
  457. *micromips32:
  458. *micromips64:
  459. {
  460. do_srl (SD_, TRT, TRD, SHIFT_DEC);
  461. }
  462. 000001,3.RD,3.RT,3.RS,1:POOL16A:16::SUBU16
  463. "subu16 r<TRD>, r<TRS>, r<TRT>"
  464. *micromips32:
  465. *micromips64:
  466. {
  467. do_subu (SD_, TRS, TRT, TRD);
  468. }
  469. 111010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SW16
  470. "sw16 r<TRT_S>, <IMM_SHIFT_2BIT>(r<TBASE>)"
  471. *micromips32:
  472. *micromips64:
  473. {
  474. do_store (SD_, AccessLength_WORD, GPR[TBASE], IMM_SHIFT_2BIT, GPR[TRT_S]);
  475. }
  476. 110010,5.RT,5.IMMEDIATE:MICROMIPS:16::SWSP
  477. "swsp r<RT>, <IMM_SHIFT_2BIT>(sp)"
  478. *micromips32:
  479. *micromips64:
  480. {
  481. do_store (SD_, AccessLength_WORD, SP, IMM_SHIFT_2BIT, GPR[RT]);
  482. }
  483. 010001,0101,2.LWMREGS,4.IMMEDIATE:POOL16C:16::SWM16
  484. "swm16 %s<LWMREGS>, <IMM_SHIFT_2BIT>(sp)"
  485. *micromips32:
  486. *micromips64:
  487. {
  488. int address = GPR[SPIDX] + IMM_SHIFT_2BIT;
  489. int reg_offset;
  490. for (reg_offset = 0; reg_offset <= LWMREGS; reg_offset++)
  491. do_store (SD_, AccessLength_WORD, address, reg_offset * 4,
  492. GPR[16 + reg_offset]);
  493. do_store (SD_, AccessLength_WORD, address, reg_offset * 4, RA);
  494. }
  495. 010001,0001,3.RT,3.RS:POOL16C:16::XOR16
  496. "xor16 r<TRT>, r<TRS>"
  497. *micromips32:
  498. *micromips64:
  499. {
  500. do_xor (SD_, TRS, TRT, TRT);
  501. }
  502. 000000,5.RT,5.RS,5.RD,00100,010000:POOL32A:32::ADD
  503. "add r<RD>, r<RS>, r<RT>"
  504. *micromips32:
  505. *micromips64:
  506. {
  507. do_add (SD_, RS, RT, RD);
  508. }
  509. 000100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ADDI
  510. "addi r<RT>, r<RS>, <IMMEDIATE>"
  511. *micromips32:
  512. *micromips64:
  513. {
  514. do_addi (SD_, RS, RT, IMMEDIATE);
  515. }
  516. 001100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ADDIU
  517. "li r<RT>, <IMMEDIATE>":RS==0
  518. "addiu r<RT>, r<RS>, <IMMEDIATE>"
  519. *micromips32:
  520. *micromips64:
  521. {
  522. do_addiu (SD_, RS, RT, IMMEDIATE);
  523. }
  524. 011110,3.RS,23.IMMEDIATE:MICROMIPS:32::ADDIUPC
  525. "addiupc r<TRS>, <IMM_SHIFT_2BIT>"
  526. *micromips32:
  527. *micromips64:
  528. {
  529. GPR[TRS] = EXTEND32 ((CIA & ~3) + EXTEND25 (IMM_SHIFT_2BIT));
  530. }
  531. 000000,5.RT,5.RS,5.RD,00101,010000:POOL32A:32::ADDU
  532. "addu r<RD>, r<RS>, r<RT>"
  533. *micromips32:
  534. *micromips64:
  535. {
  536. do_addu (SD_, RS, RT, RD);
  537. }
  538. 000000,5.RT,5.RS,5.RD,01001,010000:POOL32A:32::AND
  539. "and r<RD>, r<RS>, r<RT>"
  540. *micromips32:
  541. *micromips64:
  542. {
  543. do_and (SD_, RS, RT, RD);
  544. }
  545. 110100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ANDI
  546. "andi r<RT>, r<RS>, <IMMEDIATE>"
  547. *micromips32:
  548. *micromips64:
  549. {
  550. do_andi (SD_, RS, RT, IMMEDIATE);
  551. }
  552. 010000,1110,1.TF,3.CC,00,16.IMMEDIATE:POOL32I:32,f::BC1a
  553. "bc1%s<TF> <IMMEDIATE>":CC == 0
  554. "bc1%s<TF> <CC>, <IMMEDIATE>"
  555. *micromips32:
  556. *micromips64:
  557. {
  558. check_fpu (SD_);
  559. if (GETFCC(CC) == TF)
  560. {
  561. address_word dest = NIA + (EXTEND16 (IMMEDIATE) << 1);
  562. NIA = delayslot_micromips (SD_, dest, NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
  563. }
  564. }
  565. 010000,1010,1.TF,3.CC,00,16.IMMEDIATE:POOL32I:32::BC2a
  566. "bc2%s<TF> <CC>, <IMMEDIATE>":CC == 0
  567. "bc2%s<TF> <CC>, <IMMEDIATE>"
  568. *micromips32:
  569. *micromips64:
  570. 100101,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::BEQ
  571. "b <IMMEDIATE>":RT == 0 && RS == 0
  572. "beq r<RS>, r<RT>, <IMMEDIATE>"
  573. *micromips32:
  574. *micromips64:
  575. {
  576. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  577. if ((signed_word) GPR[RS] == (signed_word) GPR[RT])
  578. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  579. MICROMIPS_DELAYSLOT_SIZE_ANY);
  580. }
  581. 010000,00010,5.RS,16.IMMEDIATE:POOL32I:32::BGEZ
  582. "bgez r<RS>, <IMMEDIATE>"
  583. *micromips32:
  584. *micromips64:
  585. {
  586. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  587. if ((signed_word) GPR[RS] >= 0)
  588. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  589. MICROMIPS_DELAYSLOT_SIZE_ANY);
  590. }
  591. 010000,00111,5.RS,16.IMMEDIATE:POOL32I:32::BEQZC
  592. "beqzc r<RS>, <IMMEDIATE>"
  593. *micromips32:
  594. *micromips64:
  595. {
  596. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  597. if (GPR[RS] == 0)
  598. NIA = NIA + offset;
  599. }
  600. 010000,00011,5.RS,16.IMMEDIATE:POOL32I:32::BGEZAL
  601. "bal <IMMEDIATE>":RS == 0
  602. "bgezal r<RS>, <IMMEDIATE>"
  603. *micromips32:
  604. *micromips64:
  605. {
  606. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  607. if (RS == 31)
  608. Unpredictable ();
  609. RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_32) | ISA_MODE_MICROMIPS;
  610. if ((signed_word) GPR[RS] >= 0)
  611. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  612. MICROMIPS_DELAYSLOT_SIZE_32);
  613. }
  614. 010000,00110,5.RS,16.IMMEDIATE:POOL32I:32::BGTZ
  615. "bgtz r<RS>, <IMMEDIATE>"
  616. *micromips32:
  617. *micromips64:
  618. {
  619. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  620. if ((signed_word) GPR[RS] > 0)
  621. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  622. MICROMIPS_DELAYSLOT_SIZE_ANY);
  623. }
  624. 010000,10011,5.RS,16.IMMEDIATE:POOL32I:32::BGEZALS
  625. "bal <IMMEDIATE>":RS == 0
  626. "bgezals r<RS>, <IMMEDIATE>"
  627. *micromips32:
  628. *micromips64:
  629. {
  630. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  631. if (RS == 31)
  632. Unpredictable ();
  633. RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_16) | ISA_MODE_MICROMIPS;
  634. if ((signed_word) GPR[RS] >= 0)
  635. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  636. MICROMIPS_DELAYSLOT_SIZE_16);
  637. }
  638. 010000,00100,5.RS,16.IMMEDIATE:POOL32I:32::BLEZ
  639. "blez r<RS>, <IMMEDIATE>"
  640. *micromips32:
  641. *micromips64:
  642. {
  643. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  644. /* NOTE: The branch occurs AFTER the next instruction has been
  645. executed */
  646. if ((signed_word) GPR[RS] <= 0)
  647. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  648. MICROMIPS_DELAYSLOT_SIZE_ANY);
  649. }
  650. 010000,00000,5.RS,16.IMMEDIATE:POOL32I:32::BLTZ
  651. "bltz r<RS>, <IMMEDIATE>"
  652. *micromips32:
  653. *micromips64:
  654. {
  655. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  656. if ((signed_word) GPR[RS] < 0)
  657. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  658. MICROMIPS_DELAYSLOT_SIZE_ANY);
  659. }
  660. 010000,00001,5.RS,16.IMMEDIATE:POOL32I:32::BLTZAL
  661. "bltzal r<RS>, <IMMEDIATE>"
  662. *micromips32:
  663. *micromips64:
  664. {
  665. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  666. if (RS == 31)
  667. Unpredictable ();
  668. RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_32) | ISA_MODE_MICROMIPS;
  669. /* NOTE: The branch occurs AFTER the next instruction has been
  670. executed */
  671. if ((signed_word) GPR[RS] < 0)
  672. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  673. MICROMIPS_DELAYSLOT_SIZE_32);
  674. }
  675. 010000,10001,5.RS,16.IMMEDIATE:POOL32I:32::BLTZALS
  676. "bltzals r<RS>, <IMMEDIATE>"
  677. *micromips32:
  678. *micromips64:
  679. {
  680. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  681. if (RS == 31)
  682. Unpredictable ();
  683. RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_16) | ISA_MODE_MICROMIPS;
  684. if ((signed_word) GPR[RS] < 0)
  685. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  686. MICROMIPS_DELAYSLOT_SIZE_16);
  687. }
  688. 101101,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::BNE
  689. "bne r<RS>, r<RT>, <IMMEDIATE>"
  690. *micromips32:
  691. *micromips64:
  692. {
  693. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  694. if ((signed_word) GPR[RS] != (signed_word) GPR[RT])
  695. NIA = delayslot_micromips (SD_, NIA + offset, NIA,
  696. MICROMIPS_DELAYSLOT_SIZE_ANY);
  697. }
  698. 010000,00101,5.RS,16.IMMEDIATE:POOL32I:32::BNEZC
  699. "bnezc r<RS>, <IMMEDIATE>"
  700. *micromips32:
  701. *micromips64:
  702. {
  703. address_word offset = EXTEND16 (IMMEDIATE) << 1;
  704. if ((signed_word) GPR[RS] != 0)
  705. NIA = NIA + offset;
  706. }
  707. 000000,20.CODE,000111:POOL32A:32::BREAK
  708. "break %#lx<CODE>"
  709. *micromips32:
  710. *micromips64:
  711. {
  712. do_break (SD_, instruction_0);
  713. }
  714. 001000,5.OP,5.BASE,0110,12.IMMEDIATE:POOL32B:32::CACHE
  715. "cache <OP>, <IMMEDIATE>(r<BASE>)"
  716. *micromips32:
  717. *micromips64:
  718. {
  719. address_word base = GPR[BASE];
  720. address_word offset = EXTEND12 (IMMEDIATE);
  721. address_word vaddr = loadstore_ea (SD_, base, offset);
  722. address_word paddr = vaddr;
  723. CacheOp (OP, vaddr, paddr, instruction_0);
  724. }
  725. 011000,5.OP,5.BASE,1010011,9.IMMEDIATE:POOL32C:32::CACHEE
  726. "cachee <OP>, <IMMEDIATE>(r<BASE>)"
  727. *micromips32:
  728. *micromips64:
  729. 010101,5.RT,5.FS,0001000000,111011:POOL32F:32,f::CFC1
  730. "cfc1 r<RT>, f<FS>"
  731. *micromips32:
  732. *micromips64:
  733. {
  734. do_cfc1 (SD_, RT, FS);
  735. }
  736. 000000,5.RT,5.IMPL,1100110100,111100:POOL32A:32::CFC2
  737. "cfc2 r<RT>, <IMPL>"
  738. *micromips32:
  739. *micromips64:
  740. 000000,5.RT,5.RS,0100101100,111100:POOL32A:32::CLO
  741. "clo r<RT>, r<RS>"
  742. *micromips32:
  743. *micromips64:
  744. {
  745. do_clo (SD_, RT, RS);
  746. }
  747. 000000,5.RT,5.RS,0101101100,111100:POOL32A:32::CLZ
  748. "clz r<RT>, r<RS>"
  749. *micromips32:
  750. *micromips64:
  751. {
  752. do_clz (SD_, RT, RS);
  753. }
  754. 000000,23.COFUN,010:POOL32A:32::COP2
  755. "cop2 <COFUN>"
  756. *micromips32:
  757. *micromips64:
  758. 010101,5.RT,5.FS,0001100000,111011:POOL32F:32,f::CTC1
  759. "ctc1 r<RT>, f<FS>"
  760. *micromips32:
  761. *micromips64:
  762. {
  763. do_ctc1 (SD_, RT, FS);
  764. }
  765. 000000,5.RT,5.IMPL,1101110100,111100:POOL32A:32::CTC2
  766. "ctc2 r<RT>, <IMPL>"
  767. *micromips32:
  768. *micromips64:
  769. 000000,00000000001110001101,111100:POOL32A:32::DERET
  770. "deret"
  771. *micromips32:
  772. *micromips64:
  773. 000000,00000,5.RS,0100011101,111100:POOL32A:32::DI
  774. "di":RS == 0
  775. "di r<RS>"
  776. *micromips32:
  777. *micromips64:
  778. {
  779. do_di (SD_, RS);
  780. }
  781. 000000,5.RT,5.RS,1010101100,111100:POOL32A:32::DIV
  782. "div r<RS>, r<RT>"
  783. *micromips32:
  784. *micromips64:
  785. {
  786. do_div (SD_, RS, RT);
  787. }
  788. 000000,5.RT,5.RS,1011101100,111100:POOL32A:32::DIVU
  789. "divu r<RS>, r<RT>"
  790. *micromips32:
  791. *micromips64:
  792. {
  793. do_divu (SD_, RS, RT);
  794. }
  795. 000000,00000000000001100000,000000:POOL32A:32::EHB
  796. "ehb"
  797. *micromips32:
  798. *micromips64:
  799. 000000,00000,5.RS,0101011101,111100:POOL32A:32::EI
  800. "ei":RS == 0
  801. "ei r<RS>"
  802. *micromips32:
  803. *micromips64:
  804. {
  805. do_ei (SD_, RS);
  806. }
  807. 000000,00000000001111001101,111100:POOL32A:32::ERET
  808. "eret"
  809. *micromips32:
  810. *micromips64:
  811. {
  812. if (SR & status_ERL)
  813. {
  814. /* Oops, not yet available */
  815. sim_io_printf (SD, "Warning: ERET when SR[ERL] set not supported");
  816. NIA = EPC;
  817. SR &= ~status_ERL;
  818. }
  819. else
  820. {
  821. NIA = EPC;
  822. SR &= ~status_EXL;
  823. }
  824. }
  825. 000000,5.RT,5.RS,5.MSBD,5.LSB,101100:POOL32A:32::EXT
  826. "ext r<RT>, r<RS>, <LSB>, <MSBD+1>"
  827. *micromips32:
  828. *micromips64:
  829. {
  830. do_ext (SD_, RT, RS, LSB, MSBD);
  831. }
  832. 000000,5.RT,5.RS,5.MSBD,5.LSB,001100:POOL32A:32::INS
  833. "ins r<RT>, r<RS>, <LSB>, <MSBD-LSB+1>"
  834. *micromips32:
  835. *micromips64:
  836. {
  837. do_ins (SD_, RT, RS, LSB, MSBD);
  838. }
  839. 110101,26.IMMEDIATE:MICROMIPS:32::J
  840. "j <IMM_SHIFT_1BIT>"
  841. *micromips32:
  842. *micromips64:
  843. {
  844. address_word region = (NIA & MASK (63, 27));
  845. NIA = delayslot_micromips (SD_, region | (IMM_SHIFT_1BIT), NIA,
  846. MICROMIPS_DELAYSLOT_SIZE_ANY);
  847. }
  848. 111101,26.IMMEDIATE:MICROMIPS:32::JAL
  849. "jal <IMM_SHIFT_1BIT>"
  850. *micromips32:
  851. *micromips64:
  852. {
  853. /* NOTE: The region used is that of the delay slot and NOT the
  854. current instruction */
  855. address_word region = (NIA & MASK (63, 27));
  856. NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_1BIT)), NIA,
  857. MICROMIPS_DELAYSLOT_SIZE_32);
  858. }
  859. 011101,26.IMMEDIATE:MICROMIPS:32::JALS
  860. "jals <IMM_SHIFT_1BIT>"
  861. *micromips32:
  862. *micromips64:
  863. {
  864. address_word region = (NIA & MASK (63, 27));
  865. NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_1BIT)), NIA,
  866. MICROMIPS_DELAYSLOT_SIZE_16);
  867. }
  868. 000000,5.RT!0,5.RS,0000111100,111100:POOL32A:32::JALR
  869. "jalr r<RS>":RT == 31
  870. "jalr r<RT>, r<RS>"
  871. *micromips32:
  872. *micromips64:
  873. {
  874. if (RS == RT)
  875. Unpredictable ();
  876. NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
  877. }
  878. 000000,5.RT,5.RS,0100111100,111100:POOL32A:32::JALRS
  879. "jalrs r<RT>, r<RS>"
  880. *micromips32:
  881. *micromips64:
  882. {
  883. if (RS == RT)
  884. Unpredictable ();
  885. NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
  886. }
  887. 111100,26.IMMEDIATE:MICROMIPS:32::JALX
  888. "jalx <IMM_SHIFT_2BIT>"
  889. *micromips32:
  890. *micromips64:
  891. {
  892. struct mips_sim_state *state = MIPS_SIM_STATE (SD);
  893. address_word region = (NIA & MASK (63, 26));
  894. NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_2BIT)) | ISA_MODE_MIPS32,
  895. NIA, MICROMIPS_DELAYSLOT_SIZE_32);
  896. state->isa_mode = ISA_MODE_MIPS32;
  897. }
  898. 000000,00000,5.RS,0000111100,111100:POOL32A:32::JR
  899. "jr r<RS>"
  900. *micromips32:
  901. *micromips64:
  902. {
  903. NIA = process_isa_mode (SD_,
  904. delayslot_micromips (SD_, GPR[RS], NIA,
  905. MICROMIPS_DELAYSLOT_SIZE_32));
  906. }
  907. 000000,5.RT,5.RS,0001111100,111100:POOL32A:32::JALR.HB
  908. "jalr.hb r<RT>, r<RS>"
  909. *micromips32:
  910. *micromips64:
  911. {
  912. if (RS == RT)
  913. Unpredictable ();
  914. NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
  915. }
  916. 000000,5.RT,5.RS,0101111100,111100:POOL32A:32::JALRS.HB
  917. "jalrs.hb r<RT>, r<RS>"
  918. *micromips32:
  919. *micromips64:
  920. {
  921. if (RS == RT)
  922. Unpredictable ();
  923. NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
  924. }
  925. 000000,00000,5.RS,0111111100,111100:POOL32A:32::JR.HB
  926. "jr.hb r<RS>"
  927. *micromips32:
  928. *micromips64:
  929. {
  930. NIA = process_isa_mode (SD_,
  931. delayslot_micromips (SD_, GPR[RS], NIA,
  932. MICROMIPS_DELAYSLOT_SIZE_32));
  933. }
  934. 000111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LB
  935. "lb r<RT>, <IMMEDIATE>(r<BASE>)"
  936. *micromips32:
  937. *micromips64:
  938. {
  939. do_lb (SD_, RT, IMMEDIATE, BASE);
  940. }
  941. 011000,5.RT,5.BASE,0110100,9.IMMEDIATE:POOL32C:32::LBE
  942. "lbe r<RT>, <IMMEDIATE>(r<BASE>)"
  943. *micromips32:
  944. *micromips64:
  945. 000101,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LBU
  946. "lbu r<RT>, <IMMEDIATE>(r<BASE>)"
  947. *micromips32:
  948. *micromips64:
  949. {
  950. do_lbu (SD_, RT, IMMEDIATE, BASE);
  951. }
  952. 011000,5.RT,5.BASE,0110000,9.IMMEDIATE:POOL32C:32::LBUE
  953. "lbue r<RT>, <IMMEDIATE>(r<BASE>)"
  954. *micromips32:
  955. *micromips64:
  956. 101111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LDC1a
  957. "ldc1 f<FT>, <IMMEDIATE>(r<BASE>)"
  958. *micromips32:
  959. {
  960. check_fpu (SD_);
  961. COP_LD (1, FT, do_load_double (SD_, GPR[BASE], EXTEND16 (IMMEDIATE)));
  962. }
  963. 101111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LDC1b
  964. "ldc1 f<FT>, <IMMEDIATE>(r<BASE>)"
  965. *micromips64:
  966. {
  967. check_fpu (SD_);
  968. COP_LD (1, FT, do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
  969. EXTEND16 (IMMEDIATE)));
  970. }
  971. 001000,5.RT,5.BASE,0010,12.IMMEDIATE:POOL32B:32::LDC2
  972. "ldc2 r<RT>, <IMMEDIATE>(r<BASE>)"
  973. *micromips32:
  974. *micromips64:
  975. 001111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LH
  976. "lh r<RT>, <IMMEDIATE>(r<BASE>)"
  977. *micromips32:
  978. *micromips64:
  979. {
  980. do_lh (SD_, RT, IMMEDIATE, BASE);
  981. }
  982. 011000,5.RT,5.BASE,0110101,9.IMMEDIATE:POOL32C:32::LHE
  983. "lhe r<RT>, <IMMEDIATE>(r<BASE>)"
  984. *micromips32:
  985. *micromips64:
  986. 001101,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LHU
  987. "lhu r<RT>, <IMMEDIATE>(r<BASE>)"
  988. *micromips32:
  989. *micromips64:
  990. {
  991. do_lhu (SD_, RT, IMMEDIATE, BASE);
  992. }
  993. 011000,5.RT,5.BASE,0110001,9.IMMEDIATE:POOL32C:32::LHUE
  994. "lhue r<RT>, <IMMEDIATE>(r<BASE>)"
  995. *micromips32:
  996. *micromips64:
  997. 011000,5.RT,5.BASE,0011,12.IMMEDIATE:POOL32C:32::LL
  998. "ll r<RT>, <IMMEDIATE>(r<BASE>)"
  999. *micromips32:
  1000. *micromips64:
  1001. {
  1002. do_ll (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
  1003. }
  1004. 011000,5.RT,5.BASE,0110110,9.IMMEDIATE:POOL32C:32::LLE
  1005. "lle r<RT>, <IMMEDIATE>(r<BASE>)"
  1006. *micromips32:
  1007. *micromips64:
  1008. 010000,01101,5.RS,16.IMMEDIATE:POOL32I:32::LUI
  1009. "lui r<RS>, <IMMEDIATE>"
  1010. *micromips32:
  1011. *micromips64:
  1012. {
  1013. do_lui (SD_, RS, IMMEDIATE);
  1014. }
  1015. 010101,5.INDEX,5.BASE,5.FD,00101,001000:POOL32F:32,f::LUXC1
  1016. "luxc1 f<FD>, r<INDEX>(r<BASE>)"
  1017. *micromips32:
  1018. {
  1019. do_luxc1_32 (SD_, FD, INDEX, BASE);
  1020. }
  1021. 010101,5.INDEX,5.BASE,5.FD,00101,001000:POOL32F:64,f::LUXC1
  1022. "luxc1 f<FD>, r<INDEX>(r<BASE>)"
  1023. *micromips64:
  1024. {
  1025. check_fpu (SD_);
  1026. check_u64 (SD_, instruction_0);
  1027. do_luxc1_64 (SD_, FD, INDEX, BASE);
  1028. }
  1029. 111111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LW
  1030. "lw r<RT>, <IMMEDIATE>(r<BASE>)"
  1031. *micromips32:
  1032. *micromips64:
  1033. {
  1034. do_lw (SD_, RT, IMMEDIATE, BASE);
  1035. }
  1036. 100111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LWC1
  1037. "lwc1 f<FT>, <IMMEDIATE>(r<BASE>)"
  1038. *micromips32:
  1039. *micromips64:
  1040. {
  1041. do_lwc1 (SD_, FT, IMMEDIATE, BASE);
  1042. }
  1043. 001000,5.RT,5.BASE,0000,12.IMMEDIATE:POOL32B:32::LWC2
  1044. "lwc2 r<RT>, <IMMEDIATE>(r<BASE>)"
  1045. *micromips32:
  1046. *micromips64:
  1047. 011000,5.RT,5.BASE,0110111,9.IMMEDIATE:POOL32C:32::LWE
  1048. "lwe r<RT>, <IMMEDIATE>(r<BASE>)"
  1049. *micromips32:
  1050. *micromips64:
  1051. 011000,5.RT,5.BASE,0110011,9.IMMEDIATE:POOL32C:32::LWEE
  1052. "lwee r<RT>, <IMMEDIATE>(r<BASE>)"
  1053. *micromips32:
  1054. *micromips64:
  1055. 011000,5.RT,5.BASE,0000,12.IMMEDIATE:POOL32C:32::LWL
  1056. "lwl r<RT>, <IMMEDIATE>(r<BASE>)"
  1057. *micromips32:
  1058. *micromips64:
  1059. {
  1060. do_lwl (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
  1061. }
  1062. 011000,5.RT,5.BASE,0110010,9.IMMEDIATE:POOL32C:32::LWLE
  1063. "lwle r<RT>, <IMMEDIATE>(r<BASE>)"
  1064. *micromips32:
  1065. *micromips64:
  1066. :%s::::LWM32REGS:int lwmregs
  1067. *micromips32:
  1068. *micromips64:
  1069. {
  1070. if (lwmregs & 0x10)
  1071. {
  1072. switch (lwmregs & 0xf)
  1073. {
  1074. case 0:
  1075. return "ra";
  1076. case 1:
  1077. return "s0, ra";
  1078. case 2:
  1079. return "s0, s1, ra";
  1080. case 3:
  1081. return "s0, s1, s2, ra";
  1082. case 4:
  1083. return "s0, s1, s2, s3, ra";
  1084. case 5:
  1085. return "s0, s1, s2, s3, s4, ra";
  1086. case 6:
  1087. return "s0, s1, s2, s3, s4, s5, ra";
  1088. case 7:
  1089. return "s0, s1, s2, s3, s4, s5, s6, ra";
  1090. case 8:
  1091. return "s0, s1, s2, s3, s4, s5, s6, s7, ra";
  1092. case 9:
  1093. return "s0, s1, s2, s3, s4, s5, s6, s7, s8, ra";
  1094. default:
  1095. return "";
  1096. }
  1097. }
  1098. else
  1099. {
  1100. switch (lwmregs & 0xf)
  1101. {
  1102. case 1:
  1103. return "s0";
  1104. case 2:
  1105. return "s0, s1";
  1106. case 3:
  1107. return "s0, s1, s2";
  1108. case 4:
  1109. return "s0, s1, s2, s3";
  1110. case 5:
  1111. return "s0, s1, s2, s3, s4";
  1112. case 6:
  1113. return "s0, s1, s2, s3, s4, s5";
  1114. case 7:
  1115. return "s0, s1, s2, s3, s4, s5, s6";
  1116. case 8:
  1117. return "s0, s1, s2, s3, s4, s5, s6, s7";
  1118. case 9:
  1119. return "s0, s1, s2, s3, s4, s5, s6, s7, s8";
  1120. default:
  1121. return "";
  1122. }
  1123. }
  1124. }
  1125. 001000,5.LWM32REGS,5.BASE,0101,12.IMMEDIATE:POOL32B:32::LWM32
  1126. "lwm32 %s<LWM32REGS>, <IMMEDIATE>(r<BASE>)"
  1127. *micromips32:
  1128. *micromips64:
  1129. {
  1130. int address_base = GPR[BASE] + EXTEND12 (IMMEDIATE);
  1131. int reg_offset;
  1132. for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
  1133. {
  1134. int dst = (reg_offset == 8) ? 30 : 16 + reg_offset;
  1135. GPR[dst] = EXTEND32 (do_load (SD_, AccessLength_WORD, address_base,
  1136. 4 * reg_offset));
  1137. }
  1138. if (LWM32REGS & 0x10)
  1139. RA = EXTEND32 (do_load (SD_, AccessLength_WORD, address_base,
  1140. 4 * reg_offset));
  1141. }
  1142. 001000,5.RD,5.BASE,0001,12.IMMEDIATE:POOL32B:32::LWP
  1143. "lwp r<RD>, <IMMEDIATE>(r<BASE>)"
  1144. *micromips32:
  1145. *micromips64:
  1146. {
  1147. if (BASE == RD || RD == 31)
  1148. Unpredictable ();
  1149. else
  1150. {
  1151. do_lw (SD_, RD, EXTEND12 (IMMEDIATE), BASE);
  1152. do_lw (SD_, RD + 1, EXTEND12 (IMMEDIATE) + 4, BASE);
  1153. }
  1154. }
  1155. 011000,5.RT,5.BASE,0001,12.IMMEDIATE:POOL32C:32::LWR
  1156. "lwr r<RT>, <IMMEDIATE>(r<BASE>)"
  1157. *micromips32:
  1158. *micromips64:
  1159. {
  1160. do_lwr (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
  1161. }
  1162. 011000,5.RT,5.BASE,1110,12.IMMEDIATE:POOL32C:32::LWU
  1163. "lwu r<RT>, <IMMEDIATE>(r<BASE>)"
  1164. *micromips32:
  1165. *micromips64:
  1166. {
  1167. do_lwu (SD_, RT, IMMEDIATE, BASE, instruction_0);
  1168. }
  1169. 010101,5.INDEX,5.BASE,5.FD,00001,001000:POOL32F:32,f::LWXC1
  1170. "lwxc1 f<FD>, <INDEX>(r<BASE>)"
  1171. *micromips32:
  1172. *micromips64:
  1173. {
  1174. do_lwxc1 (SD_, FD, INDEX, BASE, instruction_0);
  1175. }
  1176. 000000,5.INDEX,5.BASE,5.RD,00100,011000:POOL32A:32::LWXS
  1177. "lwxs r<RD>, r<INDEX>(r<BASE>)"
  1178. *micromips32:
  1179. *micromips64:
  1180. {
  1181. GPR[RD] = EXTEND32 (do_load (SD_, AccessLength_WORD, GPR[BASE],
  1182. GPR[INDEX] * 4));
  1183. }
  1184. 000000,5.RT,5.RS,1100101100,111100:POOL32A:32::MADD
  1185. "madd r<RS>, r<RT>"
  1186. *micromips32:
  1187. *micromips64:
  1188. {
  1189. do_madd (SD_, RS, RT);
  1190. }
  1191. 000000,5.RT,5.RS,1101101100,111100:POOL32A:32::MADDU
  1192. "maddu r<RS>, r<RT>"
  1193. *micromips32:
  1194. *micromips64:
  1195. {
  1196. do_maddu (SD_, RS, RT);
  1197. }
  1198. 000000,5.RT,5.RS,00,3.SEL,00011,111100:POOL32A:32::MFC0
  1199. "mfc0 r<RS>, r<RT>": SEL == 0
  1200. "mfc0 r<RS>, r<RT>, <SEL>"
  1201. *micromips32:
  1202. *micromips64:
  1203. {
  1204. DecodeCoproc (instruction_0, 0, cp0_mfc0, RT, RS, SEL);
  1205. }
  1206. 010101,5.RT,5.FS,0010000000,111011:POOL32F:32,f::MFC1
  1207. "mfc1 r<RT>, f<FS>"
  1208. *micromips32:
  1209. *micromips64:
  1210. {
  1211. do_mfc1b (SD_, RT, FS);
  1212. }
  1213. 000000,5.RT,5.IMPL,0100110100,111100:POOL32A:32::MFC2
  1214. "mfc2 r<RT>, <IMPL>"
  1215. *micromips32:
  1216. *micromips64:
  1217. 010101,5.RT,5.FS,0011000000,111011:POOL32F:32,f::MFHC1
  1218. "mfhc1 r<RT>, f<FS>"
  1219. *micromips32:
  1220. *micromips64:
  1221. {
  1222. do_mfhc1 (SD_, RT, FS);
  1223. }
  1224. 000000,5.RT,5.IMPL,1000110100,111100:POOL32A:32::MFHC2
  1225. "mfhc2 r<RT>, <IMPL>"
  1226. *micromips32:
  1227. *micromips64:
  1228. 000000,00000,5.RS,0000110101,111100:POOL32A:32::MFHI
  1229. "mfhi r<RS>"
  1230. *micromips32:
  1231. *micromips64:
  1232. {
  1233. do_mfhi (SD_, RS);
  1234. }
  1235. 000000,00000,5.RS,0001110101,111100:POOL32A:32::MFLO
  1236. "mflo r<RS>"
  1237. *micromips32:
  1238. *micromips64:
  1239. {
  1240. do_mflo (SD_, RS);
  1241. }
  1242. // MOVF
  1243. // MOVT
  1244. 010101,5.RT,5.RS,3.CC,0,1.TF,00101,111011:POOL32F:32::MOVtf
  1245. "mov%s<TF> r<RT>, r<RS>, CC"
  1246. *micromips32:
  1247. *micromips64:
  1248. {
  1249. do_movtf (SD_, TF, RT, RS, CC);
  1250. }
  1251. 000000,5.RT,5.RS,5.RD,00000,011000:POOL32A:32::MOVN
  1252. "movn r<RD>, r<RS>, r<RT>"
  1253. *micromips32:
  1254. *micromips64:
  1255. {
  1256. do_movn (SD_, RD, RS, RT);
  1257. }
  1258. 000000,5.RT,5.RS,5.RD,00001,011000:POOL32A:32::MOVZ
  1259. "movz r<RD>, r<RS>, r<RT>"
  1260. *micromips32:
  1261. *micromips64:
  1262. {
  1263. do_movz (SD_, RD, RS, RT);
  1264. }
  1265. 000000,5.RT,5.RS,1110101100,111100:POOL32A:32::MSUB
  1266. "msub r<RS>, r<RT>"
  1267. *micromips32:
  1268. *micromips64:
  1269. {
  1270. do_msub (SD_, RS, RT);
  1271. }
  1272. 000000,5.RT,5.RS,1111101100,111100:POOL32A:32::MSUBU
  1273. "msubu r<RS>, r<RT>"
  1274. *micromips32:
  1275. *micromips64:
  1276. {
  1277. do_msubu (SD_, RS, RT);
  1278. }
  1279. 000000,5.RT,5.RS,00,3.SEL,01011,111100:POOL32A:32::MTC0
  1280. "mtc0 r<RS>, r<RT>": SEL == 0
  1281. "mtc0 r<RS>, r<RT>, <SEL>"
  1282. *micromips32:
  1283. *micromips64:
  1284. {
  1285. DecodeCoproc (instruction_0, 0, cp0_mtc0, RT, RS, SEL);
  1286. }
  1287. 010101,5.RT,5.FS,0010100000,111011:POOL32F:32,f::MTC1
  1288. "mtc1 r<RT>, f<FS>"
  1289. *micromips32:
  1290. *micromips64:
  1291. {
  1292. do_mtc1b (SD_, RT, FS);
  1293. }
  1294. 000000,5.RT,5.IMPL,0101110100,111100:POOL32A:32::MTC2
  1295. "mtc2 r<RT>, <IMPL>"
  1296. *micromips32:
  1297. *micromips64:
  1298. 010101,5.RT,5.FS,0011100000,111011:POOL32F:32,f::MTHC1
  1299. "mthc1 r<RT>, f<FS>"
  1300. *micromips32:
  1301. *micromips64:
  1302. {
  1303. do_mthc1 (SD_, RT, FS);
  1304. }
  1305. 000000,5.RT,5.IMPL,1001110100,111100:POOL32A:32::MTHC2
  1306. "mthc2 r<RT>, <IMPL>"
  1307. *micromips32:
  1308. *micromips64:
  1309. 000000,00000,5.RS,0010110101,111100:POOL32A:32::MTHI
  1310. "mthi r<RS>"
  1311. *micromips32:
  1312. *micromips64:
  1313. {
  1314. do_mthi (SD_, RS);
  1315. }
  1316. 000000,00000,5.RS,0011110101,111100:POOL32A:32::MTLO
  1317. "mtlo r<RS>"
  1318. *micromips32:
  1319. *micromips64:
  1320. {
  1321. do_mtlo (SD_, RS);
  1322. }
  1323. 000000,5.RT,5.RS,5.RD,01000,010000:POOL32A:32::MUL
  1324. "mul r<RD>, r<RS>, r<RT>"
  1325. *micromips32:
  1326. *micromips64:
  1327. {
  1328. do_mul (SD_, RD, RS, RT);
  1329. }
  1330. 000000,5.RT,5.RS,1000101100,111100:POOL32A:32::MULT
  1331. "mult r<RS>, r<RT>"
  1332. *micromips32:
  1333. *micromips64:
  1334. {
  1335. do_mult (SD_, RS, RT, 0);
  1336. }
  1337. 000000,5.RT,5.RS,1001101100,111100:POOL32A:32::MULTU
  1338. "multu r<RS> r<RT>"
  1339. *micromips32:
  1340. *micromips64:
  1341. {
  1342. do_multu (SD_, RS, RT, 0);
  1343. }
  1344. 000000,00000000000000000000,000000:POOL32A:32::NOP
  1345. "nop"
  1346. *micromips32:
  1347. *micromips64:
  1348. {
  1349. }
  1350. 000000,5.RT,5.RS,5.RD,01011,010000:POOL32A:32::NOR
  1351. "nor r<RD>, r<RS>, r<RT>"
  1352. *micromips32:
  1353. *micromips64:
  1354. {
  1355. do_nor (SD_, RS, RT, RD);
  1356. }
  1357. 000000,5.RT,5.RS,5.RD,01010,010000:POOL32A:32::OR
  1358. "or r<RD>, r<RS>, r<RT>"
  1359. *micromips32:
  1360. *micromips64:
  1361. {
  1362. do_or (SD_, RS, RT, RD);
  1363. }
  1364. 010100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ORI
  1365. "ori r<RT>, r<RS>, <IMMEDIATE>"
  1366. *micromips32:
  1367. *micromips64:
  1368. {
  1369. do_ori (SD_, RS, RT, IMMEDIATE);
  1370. }
  1371. 000000,00000000000010100000,000000:POOL32A:32::PAUSE
  1372. "pause"
  1373. *micromips32:
  1374. *micromips64:
  1375. 011000,5.HINT,5.BASE,0010,12.IMMEDIATE:POOL32C:32::PREF
  1376. "pref <HINT>, <IMMEDIATE>(r<BASE>)"
  1377. *micromips32:
  1378. *micromips64:
  1379. {
  1380. do_pref (SD_, HINT, EXTEND12 (IMMEDIATE), BASE);
  1381. }
  1382. 011000,5.HINT,5.BASE,1010010,9.IMMEDIATE:POOL32C:32::PREFE
  1383. "prefe <HINT>, <IMMEDIATE>(r<BASE>)"
  1384. *micromips32:
  1385. *micromips64:
  1386. 010101,5.INDEX,5.BASE,5.HINT,00110,100000:POOL32F:32::PREFX
  1387. "prefx <HINT>, r<INDEX>(r<BASE>)"
  1388. *micromips32:
  1389. *micromips64:
  1390. {
  1391. do_prefx (SD_, HINT, INDEX, BASE);
  1392. }
  1393. 000000,5.RT,5.RS,0110101100,111100:POOL32A:32::RDHWR
  1394. "rdhwr r<RS>, r<RT>"
  1395. *micromips32:
  1396. *micromips64:
  1397. {
  1398. do_rdhwr (SD_, RT, RS);
  1399. }
  1400. 000000,5.RT,5.RS,1110000101,111100:POOL32A:32::RDPGPR
  1401. "rdpgpr r<RS>, r<RT>"
  1402. *micromips32:
  1403. *micromips64:
  1404. 000000,5.RT,5.RS,5.SHIFT,00011,000000:POOL32A:32::ROTR
  1405. "rotr r<RT>, r<RS>, <SHIFT>"
  1406. *micromips32:
  1407. *micromips64:
  1408. {
  1409. GPR[RT] = do_ror (SD_, GPR[RS], SHIFT);
  1410. }
  1411. 000000,5.RT,5.RS,5.RD,00011,010000:POOL32A:32::ROTRV
  1412. "rotrv r<RD>, r<RT>, r<RS>"
  1413. *micromips32:
  1414. *micromips64:
  1415. {
  1416. GPR[RD] = do_ror (SD_, GPR[RT], GPR[RS]);
  1417. }
  1418. 000110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SB
  1419. "sb r<RT>, <IMMEDIATE>(r<BASE>)"
  1420. *micromips32:
  1421. *micromips64:
  1422. {
  1423. do_store (SD_, AccessLength_BYTE, GPR[BASE], EXTEND16 (IMMEDIATE), GPR[RT]);
  1424. }
  1425. 011000,5.RT,5.BASE,1010101,9.IMMEDIATE:POOL32C:32::SBE
  1426. "sbe r<RT>, <IMMEDIATE>(r<BASE>)"
  1427. *micromips32:
  1428. *micromips64:
  1429. 011000,5.RT,5.BASE,1011,12.IMMEDIATE:POOL32C:32::SC
  1430. "sc r<RT>, <IMMEDIATE>(r<BASE>)"
  1431. *micromips32:
  1432. *micromips64:
  1433. {
  1434. do_sc (SD_, RT, EXTEND12 (IMMEDIATE), BASE, instruction_0, 1);
  1435. }
  1436. 011000,5.RT,5.BASE,1010110,9.IMMEDIATE:POOL32C:32::SCE
  1437. "sce r<RT>, <IMMEDIATE>(r<BASE>)"
  1438. *micromips32:
  1439. *micromips64:
  1440. 000000,10.CODE,1101101101,111100:POOL32A:32::SDBBP
  1441. "sdbbp %#lx<CODE>"
  1442. *micromips32:
  1443. *micromips64:
  1444. {
  1445. SignalException (DebugBreakPoint, instruction_0);
  1446. }
  1447. 101110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SDC1a
  1448. "sdc1 f<FT>, <IMMEDIATE>(r<BASE>)"
  1449. *micromips32:
  1450. {
  1451. do_sdc1 (SD_, FT, IMMEDIATE, BASE);
  1452. }
  1453. 101110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SDC1b
  1454. "sdc1 f<FT>, <IMMEDIATE>(r<BASE>)"
  1455. *micromips64:
  1456. {
  1457. check_fpu (SD_);
  1458. do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND16 (IMMEDIATE),
  1459. COP_SD (1, FT));
  1460. }
  1461. 001000,5.RT,5.BASE,1010,12.IMMEDIATE:MICROMIPS:32::SDC2
  1462. "sdc2 r<RT>, <IMMEDIATE>(r<BASE>)"
  1463. *micromips32:
  1464. *micromips64:
  1465. 000000,5.RT,5.RS,0010101100,111100:POOL32A:32::SEB
  1466. "seb r<RT>, r<RS>"
  1467. *micromips32:
  1468. *micromips64:
  1469. {
  1470. do_seb (SD_, RT, RS);
  1471. }
  1472. 000000,5.RT,5.RS,0011101100,111100:POOL32A:32::SEH
  1473. "seh r<RT>, r<RS>"
  1474. *micromips32:
  1475. *micromips64:
  1476. {
  1477. do_seh (SD_, RT, RS);
  1478. }
  1479. 001110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SH
  1480. "sh r<RT>, <IMMEDIATE>(r<BASE>)"
  1481. *micromips32:
  1482. *micromips64:
  1483. {
  1484. do_store (SD_, AccessLength_HALFWORD, GPR[BASE], EXTEND16 (IMMEDIATE),
  1485. GPR[RT]);
  1486. }
  1487. 011000,5.RT,5.BASE,1010100,9.IMMEDIATE:POOL32C:32::SHE
  1488. "she r<RT>, <IMMEDIATE>(r<BASE>)"
  1489. *micromips32:
  1490. *micromips64:
  1491. 000000,5.RT!0,5.RS!0,5.SHIFT,00000,000000:POOL32A:32::SLL
  1492. "sll r<RT>, r<RS>, <SHIFT>"
  1493. *micromips32:
  1494. *micromips64:
  1495. {
  1496. do_sll (SD_, RS, RT, SHIFT);
  1497. }
  1498. 000000,5.RT,5.RS,5.RD,00000,010000:POOL32A:32::SLLV
  1499. "sllv r<RD>, r<RT>, r<RS>"
  1500. *micromips32:
  1501. *micromips64:
  1502. {
  1503. do_sllv (SD_, RS, RT, RD);
  1504. }
  1505. 000000,5.RT,5.RS,5.RD,01101,010000:POOL32A:32::SLT
  1506. "slt r<RD>, r<RS>, r<RT>"
  1507. *micromips32:
  1508. *micromips64:
  1509. {
  1510. do_slt (SD_, RS, RT, RD);
  1511. }
  1512. 100100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::SLTI
  1513. "slti r<RT>, r<RS>, <IMMEDIATE>"
  1514. *micromips32:
  1515. *micromips64:
  1516. {
  1517. do_slti (SD_, RS, RT, IMMEDIATE);
  1518. }
  1519. 101100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::SLTIU
  1520. "sltiu r<RT>, r<RS>, <IMMEDIATE>"
  1521. *micromips32:
  1522. *micromips64:
  1523. {
  1524. do_sltiu (SD_, RS, RT, IMMEDIATE);
  1525. }
  1526. 000000,5.RT,5.RS,5.RD,01110,010000:POOL32A:32::SLTU
  1527. "sltu r<RD>, r<RS>, r<RT>"
  1528. *micromips32:
  1529. *micromips64:
  1530. {
  1531. do_sltu (SD_, RS, RT, RD);
  1532. }
  1533. 000000,5.RT,5.RS,5.SHIFT,00010,000000:POOL32A:32::SRA
  1534. "sra r<RT>, r<RS>, <SHIFT>"
  1535. *micromips32:
  1536. *micromips64:
  1537. {
  1538. do_sra (SD_, RS, RT, SHIFT);
  1539. }
  1540. 000000,5.RT,5.RS,5.RD,00010,010000:POOL32A:32::SRAV
  1541. "srav r<RD>, r<RT>, r<RS>"
  1542. *micromips32:
  1543. *micromips64:
  1544. {
  1545. do_srav (SD_, RS, RT, RD);
  1546. }
  1547. 000000,5.RT,5.RS,5.SHIFT,00001,000000:POOL32A:32::SRL
  1548. "srl r<RT>, r<RS>, <SHIFT>"
  1549. *micromips32:
  1550. *micromips64:
  1551. {
  1552. do_srl (SD_, RS, RT, SHIFT);
  1553. }
  1554. 000000,5.RT,5.RS,5.RD,00001,010000:POOL32A:32::SRLV
  1555. "srlv r<RD>, r<RT>, r<RS>"
  1556. *micromips32:
  1557. *micromips64:
  1558. {
  1559. do_srlv (SD_, RS, RT, RD);
  1560. }
  1561. 000000,00000000000000100000,000000:POOL32A:32::SSNOP
  1562. "ssnop"
  1563. *micromips32:
  1564. *micromips64:
  1565. {
  1566. }
  1567. 000000,5.RT,5.RS,5.RD,00110,010000:POOL32A:32::SUB
  1568. "sub r<RD>, r<RS>, r<RT>"
  1569. *micromips32:
  1570. *micromips64:
  1571. {
  1572. do_sub (SD_, RD, RS, RT);
  1573. }
  1574. 000000,5.RT,5.RS,5.RD,00111,010000:POOL32A:32::SUBU
  1575. "subu r<RD>, r<RS>, r<RT>"
  1576. *micromips32:
  1577. *micromips64:
  1578. {
  1579. do_subu (SD_, RS, RT, RD);
  1580. }
  1581. 010101,5.INDEX,5.BASE,5.FD,00110,001000:POOL32F:32,f::SUXC1
  1582. "suxc1 f<FD>, r<INDEX>(r<BASE>)"
  1583. *micromips32:
  1584. {
  1585. do_suxc1_32 (SD_, FD, INDEX, BASE);
  1586. }
  1587. 010101,5.INDEX,5.BASE,5.FD,00110,001000:POOL32F:64,f::SUXC1
  1588. "suxc1 f<FD>, r<INDEX>(r<BASE>)"
  1589. *micromips64:
  1590. {
  1591. check_fpu (SD_);
  1592. check_u64 (SD_, instruction_0);
  1593. do_suxc1_64 (SD_, FD, INDEX, BASE);
  1594. }
  1595. 111110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SW
  1596. "sw r<RT>, <IMMEDIATE>(r<BASE>)"
  1597. *micromips32:
  1598. *micromips64:
  1599. {
  1600. do_store (SD_, AccessLength_WORD, GPR[BASE], EXTEND16 (IMMEDIATE), GPR[RT]);
  1601. }
  1602. 100110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SWC1
  1603. "swc1 f<FT>, <IMMEDIATE>(r<BASE>)"
  1604. *micromips32:
  1605. *micromips64:
  1606. {
  1607. do_swc1 (SD_, FT, IMMEDIATE, BASE, instruction_0);
  1608. }
  1609. 001000,5.RT,5.BASE,1000,12.IMMEDIATE:POOL32B:32::SWC2
  1610. "swc2 r<RT>, <IMMEDIATE>(r<BASE>)"
  1611. *micromips32:
  1612. *micromips64:
  1613. 011000,5.RT,5.BASE,1010111,9.IMMEDIATE:POOL32C:32::SWE
  1614. "swe r<RT>, <IMMEDIATE>(r<BASE>)"
  1615. *micromips32:
  1616. *micromips64:
  1617. 011000,5.RT,5.BASE,1000,12.IMMEDIATE:POOL32C:32::SWL
  1618. "swl r<RT>, <IMMEDIATE>(r<BASE>)"
  1619. *micromips32:
  1620. *micromips64:
  1621. {
  1622. do_store_left (SD_, AccessLength_WORD, GPR[BASE], EXTEND12 (IMMEDIATE),
  1623. GPR[RT]);
  1624. }
  1625. 011000,5.RT,5.BASE,1010000,9.IMMEDIATE:POOL32C:32::SWLE
  1626. "swle r<RT>, <IMMEDIATE>(r<BASE>)"
  1627. *micromips32:
  1628. *micromips64:
  1629. 001000,5.LWM32REGS,5.BASE,1101,12.IMMEDIATE:POOL32B:32::SWM32
  1630. "swm32 %s<LWM32REGS>, <IMMEDIATE>(r<BASE>)"
  1631. *micromips32:
  1632. *micromips64:
  1633. {
  1634. int address_base = GPR[BASE] + EXTEND12 (IMMEDIATE);
  1635. int reg_offset;
  1636. for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
  1637. {
  1638. int src = (reg_offset == 8) ? 30 : 16 + reg_offset;
  1639. do_store (SD_, AccessLength_WORD, address_base, 4 * reg_offset,
  1640. GPR[src]);
  1641. }
  1642. if (LWM32REGS & 0x10)
  1643. do_store (SD_, AccessLength_WORD, address_base, 4 * reg_offset, RA);
  1644. }
  1645. 001000,5.RS1,5.BASE,1001,12.IMMEDIATE:POOL32B:32::SWP
  1646. "swp r<RS1>, <IMMEDIATE>(r<BASE>)"
  1647. *micromips32:
  1648. *micromips64:
  1649. {
  1650. if (RS1 == 31)
  1651. Unpredictable ();
  1652. else
  1653. {
  1654. do_sw (SD_, RS1, EXTEND12 (IMMEDIATE), BASE);
  1655. do_sw (SD_, RS1 + 1, EXTEND12 (IMMEDIATE) + 4, BASE);
  1656. }
  1657. }
  1658. 011000,5.RT,5.BASE,1001,12.IMMEDIATE:POOL32C:32::SWR
  1659. "swr r<RT>, <IMMEDIATE>(r<BASE>)"
  1660. *micromips32:
  1661. *micromips64:
  1662. {
  1663. do_store_right (SD_, AccessLength_WORD, GPR[BASE], EXTEND12 (IMMEDIATE),
  1664. GPR[RT]);
  1665. }
  1666. 011000,5.RT,5.BASE,1010001,9.IMMEDIATE:POOL32C:32::SWRE
  1667. "swre r<RT>, <IMMEDIATE>(r<BASE>)"
  1668. *micromips32:
  1669. *micromips64:
  1670. 010101,5.INDEX,5.BASE,5.FD,00010,001000:POOL32F:32,f::SWXC1
  1671. "swxc1 f<FD>, r<INDEX>(r<BASE>)"
  1672. *micromips32:
  1673. *micromips64:
  1674. {
  1675. do_swxc1 (SD_, FD, INDEX, BASE, instruction_0);
  1676. }
  1677. 000000,00000,5.STYPE,0110101101,111100:POOL32A:32::SYNC
  1678. "sync <STYPE>"
  1679. *micromips32:
  1680. *micromips64:
  1681. {
  1682. SyncOperation (STYPE);
  1683. }
  1684. 010000,10000,5.BASE,16.IMMEDIATE:POOL32I:32::SYNCI
  1685. "synci <IMMEDIATE>(r<BASE>)"
  1686. *micromips32:
  1687. *micromips64:
  1688. {
  1689. }
  1690. 000000,10.CODE,1000101101,111100:POOL32A:32::SYSCALL
  1691. "syscall %#lx<CODE>"
  1692. *micromips32:
  1693. *micromips64:
  1694. {
  1695. SignalException (SystemCall, instruction_0);
  1696. }
  1697. 000000,5.RT,5.RS,4.CODE,000000,111100:POOL32A:32::TEQ
  1698. "teq r<RS>, r<RT>"
  1699. *micromips32:
  1700. *micromips64:
  1701. {
  1702. do_teq (SD_, RS, RT, instruction_0);
  1703. }
  1704. 010000,01110,5.RS,16.IMMEDIATE:POOL32I:32::TEQI
  1705. "teqi r<RS>, <IMMEDIATE>"
  1706. *micromips32:
  1707. *micromips64:
  1708. {
  1709. do_teqi (SD_, RS, IMMEDIATE, instruction_0);
  1710. }
  1711. 000000,5.RT,5.RS,4.CODE,001000,111100:POOL32A:32::TGE
  1712. "tge r<RS>, r<RT>"
  1713. *micromips32:
  1714. *micromips64:
  1715. {
  1716. do_tge (SD_, RS, RT, instruction_0);
  1717. }
  1718. 010000,01001,5.RS,16.IMMEDIATE:POOL32I:32::TGEI
  1719. "tgei r<RS>, <IMMEDIATE>"
  1720. *micromips32:
  1721. *micromips64:
  1722. {
  1723. do_tgei (SD_, RS, IMMEDIATE, instruction_0);
  1724. }
  1725. 010000,01011,5.RS,16.IMMEDIATE:POOL32I:32::TGEIU
  1726. "tgeiu r<RS>, <IMMEDIATE>"
  1727. *micromips32:
  1728. *micromips64:
  1729. {
  1730. do_tgeiu (SD_, RS, IMMEDIATE, instruction_0);
  1731. }
  1732. 000000,5.RT,5.RS,4.CODE,010000,111100:POOL32A:32::TGEU
  1733. "tgeu r<RS>, r<RT>"
  1734. *micromips32:
  1735. *micromips64:
  1736. {
  1737. do_tgeu (SD_, RS, RT, instruction_0);
  1738. }
  1739. 000000,00000000000000001101,111100:POOL32A:32::TLBP
  1740. "tlbp"
  1741. *micromips32:
  1742. *micromips64:
  1743. 000000,00000000000001001101,111100:POOL32A:32::TLBR
  1744. "tlbr"
  1745. *micromips32:
  1746. *micromips64:
  1747. 000000,00000000000010001101,111100:POOL32A:32::TLBWI
  1748. "tlbwi"
  1749. *micromips32:
  1750. *micromips64:
  1751. 000000,00000000000011001101,111100:POOL32A:32::TLBWR
  1752. "tlbwr"
  1753. *micromips32:
  1754. *micromips64:
  1755. 000000,5.RT,5.RS,4.CODE,100000,111100:POOL32A:32::TLT
  1756. "tlt r<RS>, r<RT>, %#lx<CODE>"
  1757. *micromips32:
  1758. *micromips64:
  1759. {
  1760. do_tlt (SD_, RS, RT, instruction_0);
  1761. }
  1762. 010000,01000,5.RS,16.IMMEDIATE:POOL32I:32::TLTI
  1763. "tlti r<RS>, <IMMEDIATE>"
  1764. *micromips32:
  1765. *micromips64:
  1766. {
  1767. do_tlti (SD_, RS, IMMEDIATE, instruction_0);
  1768. }
  1769. 010000,01010,5.RS,16.IMMEDIATE:POOL32I:32::TLTIU
  1770. "tltiu r<RS>, <IMMEDIATE>"
  1771. *micromips32:
  1772. *micromips64:
  1773. {
  1774. do_tltiu (SD_, RS, IMMEDIATE, instruction_0);
  1775. }
  1776. 000000,5.RT,5.RS,4.CODE,101000,111100:POOL32A:32::TLTU
  1777. "tltu r<RS>, r<RT>"
  1778. *micromips32:
  1779. *micromips64:
  1780. {
  1781. do_tltu (SD_, RS, RT, instruction_0);
  1782. }
  1783. 000000,5.RT,5.RS,4.CODE,110000,111100:POOL32A:32::TNE
  1784. "tne r<RS>, r<RT>"
  1785. *micromips32:
  1786. *micromips64:
  1787. {
  1788. do_tne (SD_, RS, RT, instruction_0);
  1789. }
  1790. 010000,01100,5.RS,16.IMMEDIATE:POOL32I:32::TNEI
  1791. "tnei r<RS>, <IMMEDIATE>"
  1792. *micromips32:
  1793. *micromips64:
  1794. {
  1795. do_tnei (SD_, RS, IMMEDIATE, instruction_0);
  1796. }
  1797. 000000,10.CODE,1001001101,111100:POOL32A:32::WAIT
  1798. "wait"
  1799. *micromips32:
  1800. *micromips64:
  1801. 000000,5.RT,5.RS,1111000101,111100:POOL32A:32::WRPGPR
  1802. "wrpgpr r<RS>, r<RT>"
  1803. *micromips32:
  1804. *micromips64:
  1805. 000000,5.RT,5.RS,0111101100,111100:POOL32A:32::WSBH
  1806. "wsbh r<RT>, r<RS>"
  1807. *micromips32:
  1808. *micromips64:
  1809. {
  1810. do_wsbh (SD_, RT, RS);
  1811. }
  1812. 000000,5.RT,5.RS,5.RD,01100,010000:POOL32A:32::XOR
  1813. "xor r<RD>, r<RS>, r<RT>"
  1814. *micromips32:
  1815. *micromips64:
  1816. {
  1817. do_xor (SD_, RS, RT, RD);
  1818. }
  1819. 011100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::XORI
  1820. "xori r<RT>, r<RS>, <IMMEDIATE>"
  1821. *micromips32:
  1822. *micromips64:
  1823. {
  1824. do_xori (SD_, RS, RT, IMMEDIATE);
  1825. }
  1826. :%s::::FMT_MICROMIPS:int fmt
  1827. *micromips32:
  1828. *micromips64:
  1829. {
  1830. switch (fmt)
  1831. {
  1832. case 0: return "s";
  1833. case 1: return "d";
  1834. case 2: return "ps";
  1835. default: return "?";
  1836. }
  1837. }
  1838. :%s::::FMT_MICROMIPS_CVT_D:int fmt
  1839. *micromips32:
  1840. *micromips64:
  1841. {
  1842. switch (fmt)
  1843. {
  1844. case 0: return "s";
  1845. case 1: return "w";
  1846. case 2: return "l";
  1847. default: return "?";
  1848. }
  1849. }
  1850. :%s::::FMT_MICROMIPS_CVT_S:int fmt
  1851. *micromips32:
  1852. *micromips64:
  1853. {
  1854. switch (fmt)
  1855. {
  1856. case 0: return "d";
  1857. case 1: return "w";
  1858. case 2: return "l";
  1859. default: return "?";
  1860. }
  1861. }
  1862. 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0001101,111011:POOL32F:32,f::ABS.fmt
  1863. "abs.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1864. *micromips32:
  1865. *micromips64:
  1866. {
  1867. do_abs_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
  1868. instruction_0);
  1869. }
  1870. 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,00,110000:POOL32F:32,f::ADD.fmt
  1871. "add.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
  1872. *micromips32:
  1873. *micromips64:
  1874. {
  1875. do_add_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
  1876. instruction_0);
  1877. }
  1878. 010101,5.FT,5.FS,5.FD,5.RS,011001:POOL32F:32,f::ALNV.PS
  1879. "alnv.ps f<FD>, f<FS>, f<FT>, r<RS>"
  1880. *micromips32:
  1881. *micromips64:
  1882. {
  1883. do_alnv_ps (SD_, FD, FS, FT, RS, instruction_0);
  1884. }
  1885. 010101,5.FT,5.FS,3.CC,0,2.FMT_MICROMIPS!3,4.COND,111100:POOL32F:32,f::C.cond.fmt
  1886. "c.%s<COND>.%s<FMT_MICROMIPS> f<FS>, f<FT>":CC == 0
  1887. "c.%s<COND>.%s<FMT_MICROMIPS> <CC>, f<FS>, f<FT>"
  1888. *micromips32:
  1889. *micromips64:
  1890. {
  1891. do_c_cond_fmt (SD_, COND, convert_fmt_micromips (SD_, FMT_MICROMIPS), CC,
  1892. FS, FT, instruction_0);
  1893. }
  1894. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01001100,111011:POOL32F:32,f::CEIL.L.fmt
  1895. "ceil.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1896. *micromips32:
  1897. *micromips64:
  1898. {
  1899. do_ceil_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS, instruction_0);
  1900. }
  1901. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01101100,111011:POOL32F:32,f::CEIL.W.fmt
  1902. "ceil.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1903. *micromips32:
  1904. *micromips64:
  1905. {
  1906. do_ceil_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS, instruction_0);
  1907. }
  1908. 010101,5.FT,5.FS,0,2.FMT_MICROMIPS_CVT_D!3,1001101,111011:POOL32F:32,f::CVT.D.fmt
  1909. "cvt.d.%s<FMT_MICROMIPS_CVT_D> f<FT>, f<FS>"
  1910. *micromips32:
  1911. *micromips64:
  1912. {
  1913. do_cvt_d_fmt (SD_, convert_fmt_micromips_cvt_d (SD_, FMT_MICROMIPS_CVT_D),
  1914. FT, FS, instruction_0);
  1915. }
  1916. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00000100,111011:POOL32F:32,f::CVT.L.fmt
  1917. "cvt.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1918. *micromips32:
  1919. *micromips64:
  1920. {
  1921. do_cvt_l_fmt (SD_, FMT_MICROMIPS, FT, FS, instruction_0);
  1922. }
  1923. 010101,5.FT,5.FS,5.FD,00110,000000:POOL32F:32,f::CVT.PS.S
  1924. "cvt.ps.s f<FD>, f<FS>, f<FT>"
  1925. *micromips32:
  1926. *micromips64:
  1927. {
  1928. do_cvt_ps_s (SD_, FD, FS, FT, instruction_0);
  1929. }
  1930. 010101,5.FT,5.FS,0,2.FMT_MICROMIPS_CVT_S!3,1101101,111011:POOL32F:32,f::CVT.S.fmt
  1931. "cvt.s.%s<FMT_MICROMIPS_CVT_S> f<FT>, f<FS>"
  1932. *micromips32:
  1933. *micromips64:
  1934. {
  1935. do_cvt_s_fmt (SD_, convert_fmt_micromips_cvt_s (SD_, FMT_MICROMIPS_CVT_S),
  1936. FT, FS, instruction_0);
  1937. }
  1938. 010101,5.FT,5.FS,00,10000100,111011:POOL32F:32,f::CVT.S.PL
  1939. "cvt.s.pl f<FT>, f<FS>"
  1940. *micromips32:
  1941. *micromips64:
  1942. {
  1943. do_cvt_s_pl (SD_, FT, FS, instruction_0);
  1944. }
  1945. 010101,5.FT,5.FS,00,10100100,111011:POOL32F:32,f::CVT.S.PU
  1946. "cvt.s.pu f<FT>, f<FS>"
  1947. *micromips32:
  1948. *micromips64:
  1949. {
  1950. do_cvt_s_pu (SD_, FT, FS, instruction_0);
  1951. }
  1952. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00100100,111011:POOL32F:32,f::CVT.W.fmt
  1953. "cvt.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1954. *micromips32:
  1955. *micromips64:
  1956. {
  1957. do_cvt_w_fmt (SD_, FMT_MICROMIPS, FT, FS, instruction_0);
  1958. }
  1959. 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!2!3,11,110000:POOL32F:32,f::DIV.fmt
  1960. "div.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
  1961. *micromips32:
  1962. *micromips64:
  1963. {
  1964. do_div_fmt (SD_, FMT_MICROMIPS, FD, FS, FT, instruction_0);
  1965. }
  1966. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00001100,111011:POOL32F:32,f::FLOOR.L.fmt
  1967. "floor.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1968. *micromips32:
  1969. *micromips64:
  1970. {
  1971. do_floor_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
  1972. }
  1973. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00101100,111011:POOL32F:32,f::FLOOR.W.fmt
  1974. "floor.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1975. *micromips32:
  1976. *micromips64:
  1977. {
  1978. do_floor_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
  1979. }
  1980. 010101,5.FT,5.FS,5.FD,5.FR,0,2.FMT_MICROMIPS!3,001:POOL32F:32,f::MADD.fmt
  1981. "madd.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
  1982. *micromips32:
  1983. *micromips64:
  1984. {
  1985. do_madd_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
  1986. FT, instruction_0);
  1987. }
  1988. 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0000001,111011:POOL32F:32,f::MOV.fmt
  1989. "mov.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  1990. *micromips32:
  1991. *micromips64:
  1992. {
  1993. do_mov_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
  1994. instruction_0);
  1995. }
  1996. 010101,5.FT,5.FS,3.CC,00,2.FMT_MICROMIPS!3,00,1.TF,100000:POOL32F:32,f::MOVtf.fmt
  1997. "mov%s<TF>.%s<FMT_MICROMIPS> f<FT>, f<FS>, <CC>"
  1998. *micromips32:
  1999. *micromips64:
  2000. {
  2001. do_movtf_fmt (SD_, TF, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT,
  2002. FS, CC);
  2003. }
  2004. 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,00,111000:POOL32F:32,f::MOVN.fmt
  2005. "movn.%s<FMT_MICROMIPS> f<FD>, f<FS>, r<FT>"
  2006. *micromips32:
  2007. *micromips64:
  2008. {
  2009. do_movn_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT);
  2010. }
  2011. 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,01,111000:POOL32F:32,f::MOVZ.fmt
  2012. "movz.%s<FMT_MICROMIPS> f<FD>, f<FS>, r<FT>"
  2013. *micromips32:
  2014. *micromips64:
  2015. {
  2016. do_movz_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT);
  2017. }
  2018. 010101,5.FT,5.FS,5.FD,5.FR,1,2.FMT_MICROMIPS!3,001:POOL32F:32,f::MSUB.fmt
  2019. "msub.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
  2020. *micromips32:
  2021. *micromips64:
  2022. {
  2023. do_msub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
  2024. FT, instruction_0);
  2025. }
  2026. 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,10,110000:POOL32F:32,f::MUL.fmt
  2027. "mul.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
  2028. *micromips32:
  2029. *micromips64:
  2030. {
  2031. do_mul_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
  2032. instruction_0);
  2033. }
  2034. 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0101101,111011:POOL32F:32,f::NEG.fmt
  2035. "neg.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2036. *micromips32:
  2037. *micromips64:
  2038. {
  2039. do_neg_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
  2040. instruction_0);
  2041. }
  2042. 010101,5.FT,5.FS,5.FD,5.FR,0,2.FMT_MICROMIPS!3,010:POOL32F:32,f::NMADD.fmt
  2043. "nmadd.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
  2044. *micromips32:
  2045. *micromips64:
  2046. {
  2047. do_nmadd_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
  2048. FT, instruction_0);
  2049. }
  2050. 010101,5.FT,5.FS,5.FD,5.FR,1,2.FMT_MICROMIPS!3,010:POOL32F:32,f::NMSUB.fmt
  2051. "nmsub.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
  2052. *micromips32:
  2053. *micromips64:
  2054. {
  2055. do_nmsub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
  2056. FT, instruction_0);
  2057. }
  2058. 010101,5.FT,5.FS,5.FD,00010,000000:POOL32F:32,f::PLL.PS
  2059. "pll.ps f<FD>, f<FS>, f<FT>"
  2060. *micromips32:
  2061. *micromips64:
  2062. {
  2063. do_pll_ps (SD_, FD, FS, FT, instruction_0);
  2064. }
  2065. 010101,5.FT,5.FS,5.FD,00011,000000:POOL32F:32,f::PLU.PS
  2066. "plu.ps f<FD>, f<FS>, f<FT>"
  2067. *micromips32:
  2068. *micromips64:
  2069. {
  2070. do_plu_ps (SD_, FD, FS, FT, instruction_0);
  2071. }
  2072. 010101,5.FT,5.FS,5.FD,00100,000000:POOL32F:32,f::PUL.PS
  2073. "pul.ps f<FD>, f<FS>, f<FT>"
  2074. *micromips32:
  2075. *micromips64:
  2076. {
  2077. do_pul_ps (SD_, FD, FS, FT, instruction_0);
  2078. }
  2079. 010101,5.FT,5.FS,5.FD,00101,000000:POOL32F:32,f::PUU.PS
  2080. "puu.ps f<FD>, f<FS>, f<FT>"
  2081. *micromips32:
  2082. *micromips64:
  2083. {
  2084. do_puu_ps (SD_, FD, FS, FT, instruction_0);
  2085. }
  2086. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01001000,111011:POOL32F:32,f::RECIP.fmt
  2087. "recip.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2088. *micromips32:
  2089. *micromips64:
  2090. {
  2091. do_recip_fmt (SD_, FMT_MICROMIPS, FT, FS);
  2092. }
  2093. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,11001100,111011:POOL32F:32,f::ROUND.L.fmt
  2094. "round.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2095. *micromips32:
  2096. *micromips64:
  2097. {
  2098. do_round_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
  2099. }
  2100. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,11101100,111011:POOL32F:32,f::ROUND.W.fmt
  2101. "round.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2102. *micromips32:
  2103. *micromips64:
  2104. {
  2105. do_round_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
  2106. }
  2107. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00001000,111011:POOL32F:32,f::RSQRT.fmt
  2108. "rsqrt.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2109. *micromips32:
  2110. *micromips64:
  2111. {
  2112. do_rsqrt_fmt (SD_, FMT_MICROMIPS, FT, FS);
  2113. }
  2114. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00101000,111011:POOL32F:32,f::SQRT.fmt
  2115. "sqrt.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2116. *micromips32:
  2117. *micromips64:
  2118. {
  2119. do_sqrt_fmt (SD_, FMT_MICROMIPS, FT, FS);
  2120. }
  2121. 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,01,110000:POOL32F:32,f::SUB.fmt
  2122. "sub.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
  2123. *micromips32:
  2124. *micromips64:
  2125. {
  2126. do_sub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
  2127. instruction_0);
  2128. }
  2129. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,10001100,111011:POOL32F:32,f::TRUNC.L.fmt
  2130. "trunc.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2131. *micromips32:
  2132. *micromips64:
  2133. {
  2134. do_trunc_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
  2135. }
  2136. 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,10101100,111011:POOL32F:32,f::TRUNC.W.fmt
  2137. "trunc.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
  2138. *micromips32:
  2139. *micromips64:
  2140. {
  2141. do_trunc_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
  2142. }
  2143. 001000,5.LWM32REGS,5.BASE,0111,12.OFFSET:POOL32B:64::LDM
  2144. "ldm %s<LWM32REGS>, <OFFSET>(r<BASE>)"
  2145. *micromips64:
  2146. {
  2147. int address_base = GPR[BASE] + EXTEND12 (OFFSET);
  2148. int reg_offset;
  2149. for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
  2150. {
  2151. int dst = (reg_offset == 8) ? 30 : 16 + reg_offset;
  2152. GPR[dst] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, address_base,
  2153. 8 * reg_offset));
  2154. }
  2155. if (LWM32REGS & 0x10)
  2156. RA = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, address_base,
  2157. 8 * reg_offset));
  2158. }
  2159. 001000,5.RD,5.BASE,0100,12.OFFSET:POOL32B:64::LDP
  2160. "ldp r<RD>, <OFFSET>(r<BASE>)"
  2161. *micromips64:
  2162. {
  2163. if (BASE == RD || RD == 31)
  2164. Unpredictable ();
  2165. else
  2166. {
  2167. check_u64 (SD_, instruction_0);
  2168. GPR[RD] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
  2169. EXTEND12 (OFFSET)));
  2170. GPR[RD + 1] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
  2171. EXTEND12 (OFFSET) + 8));
  2172. }
  2173. }
  2174. 001000,5.LWM32REGS,5.BASE,1111,12.OFFSET:POOL32B:64::SDM
  2175. "sdm %s<LWM32REGS>, <OFFSET>(r<BASE>)"
  2176. *micromips64:
  2177. {
  2178. int address_base = GPR[BASE] + EXTEND12 (OFFSET);
  2179. int reg_offset;
  2180. for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
  2181. {
  2182. int src = (reg_offset == 8) ? 30 : 16 + reg_offset;
  2183. do_store (SD_, AccessLength_DOUBLEWORD, address_base, 8 * reg_offset,
  2184. GPR[src]);
  2185. }
  2186. if (LWM32REGS & 0x10)
  2187. do_store (SD_, AccessLength_DOUBLEWORD, address_base, 8 * reg_offset, RA);
  2188. }
  2189. 001000,5.RD,5.BASE,1100,12.OFFSET:POOL32B:64::SDP
  2190. "sdp r<RD>, <OFFSET>(r<BASE>)"
  2191. *micromips64:
  2192. {
  2193. if (RD == 31)
  2194. Unpredictable ();
  2195. else
  2196. {
  2197. check_u64 (SD_, instruction_0);
  2198. do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
  2199. GPR[RD]);
  2200. do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET) + 8,
  2201. GPR[RD + 1]);
  2202. }
  2203. }
  2204. 010110,5.RT,5.RS,5.RD,00,100010000:POOL32S:64::DADD
  2205. "dadd r<RD>, r<RS>, r<RT>"
  2206. *micromips64:
  2207. {
  2208. check_u64 (SD_, instruction_0);
  2209. do_dadd (SD_, RD, RS, RT);
  2210. }
  2211. 010110,5.RT,5.RS,10.IMMEDIATE,011100:POOL32S:64::DADDI
  2212. "daddi r<RT>, r<RS>, <IMMEDIATE>"
  2213. *micromips64:
  2214. {
  2215. check_u64 (SD_, instruction_0);
  2216. do_daddi (SD_, RT, RS, IMMEDIATE);
  2217. }
  2218. 010111,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:64::DADDIU
  2219. "daddiu r<RT>, r<RS>, <IMMEDIATE>"
  2220. *micromips64:
  2221. {
  2222. check_u64 (SD_, instruction_0);
  2223. do_daddiu (SD_, RS, RT, IMMEDIATE);
  2224. }
  2225. 010110,5.RT,5.RS,5.RD,00,101010000:POOL32S:64::DADDU
  2226. "daddu r<RD>, r<RS>, r<RT>"
  2227. *micromips64:
  2228. {
  2229. check_u64 (SD_, instruction_0);
  2230. do_daddu (SD_, RS, RT, RD);
  2231. }
  2232. 010110,5.RT,5.RS,0100101100,111100:POOL32S:64::DCLO
  2233. "dclo r<RT>, r<RS>"
  2234. *micromips64:
  2235. {
  2236. check_u64 (SD_, instruction_0);
  2237. do_dclo (SD_, RT, RS);
  2238. }
  2239. 010110,5.RT,5.RS,0101101100,111100:POOL32S:64::DCLZ
  2240. "dclz r<RT>, r<RS>"
  2241. *micromips64:
  2242. {
  2243. check_u64 (SD_, instruction_0);
  2244. do_dclz (SD_, RT, RS);
  2245. }
  2246. 010110,5.RT,5.RS,1010101100,111100:POOL32S:64::DDIV
  2247. "ddiv r<RS>, r<RT>"
  2248. *micromips64:
  2249. {
  2250. check_u64 (SD_, instruction_0);
  2251. do_ddiv (SD_, RS, RT);
  2252. }
  2253. 010110,5.RT,5.RS,1011101100,111100:POOL32S:64::DDIVU
  2254. "ddivu r<RS>, r<RT>"
  2255. *micromips64:
  2256. {
  2257. check_u64 (SD_, instruction_0);
  2258. do_ddivu (SD_, RS, RT);
  2259. }
  2260. 010110,5.RT,5.RS,5.SIZE,5.LSB,101100:POOL32S:64::DEXT
  2261. "dext r<RT>, r<RS>, <LSB>, <SIZE+1>"
  2262. *micromips64:
  2263. {
  2264. check_u64 (SD_, instruction_0);
  2265. do_dext (SD_, RT, RS, LSB, SIZE);
  2266. }
  2267. 010110,5.RT,5.RS,5.SIZE,5.LSB,100100:POOL32S:64::DEXTM
  2268. "dextm r<RT>, r<RS>, <LSB>, <SIZE+33>"
  2269. *micromips64:
  2270. {
  2271. check_u64 (SD_, instruction_0);
  2272. do_dextm (SD_, RT, RS, LSB, SIZE);
  2273. }
  2274. 010110,5.RT,5.RS,5.SIZE,5.LSB,010100:POOL32S:64::DEXTU
  2275. "dextu r<RT>, r<RS>, <LSB+32>, <SIZE+1>"
  2276. *micromips64:
  2277. {
  2278. check_u64 (SD_, instruction_0);
  2279. do_dextu (SD_, RT, RS, LSB, SIZE);
  2280. }
  2281. 010110,5.RT,5.RS,5.MSB,5.LSB,001100:POOL32S:64::DINS
  2282. "dins r<RT>, r<RS>, <LSB>, <MSB-LSB+1>"
  2283. *micromips64:
  2284. {
  2285. check_u64 (SD_, instruction_0);
  2286. do_dins (SD_, RT, RS, LSB, MSB);
  2287. }
  2288. 010110,5.RT,5.RS,5.MSB,5.LSB,000100:POOL32S:64::DINSM
  2289. "dinsm r<RT>, r<RS>, <LSB>, <MSB+32-LSB+1>"
  2290. *micromips64:
  2291. {
  2292. check_u64 (SD_, instruction_0);
  2293. do_dinsm (SD_, RT, RS, LSB, MSB);
  2294. }
  2295. 010110,5.RT,5.RS,5.MSB,5.LSB,110100:POOL32S:64::DINSU
  2296. "dinsu r<RT>, r<RS>, <LSB+32>, <MSB-LSB+1>"
  2297. *micromips64:
  2298. {
  2299. check_u64 (SD_, instruction_0);
  2300. do_dinsu (SD_, RT, RS, LSB, MSB);
  2301. }
  2302. 010110,5.RT,5.RS,00,3.SEL,00011,111100:POOL32S:64::DMFC0
  2303. "dmfc0 r<RT>, r<RS>": SEL == 0
  2304. "dmfc0 r<RT>, r<RS>, <SEL>"
  2305. *micromips64:
  2306. {
  2307. check_u64 (SD_, instruction_0);
  2308. DecodeCoproc (instruction_0, 0, cp0_dmfc0, RT, RS, SEL);
  2309. }
  2310. 010101,5.RT,5.FS,00,10010000,111011:POOL32F:64::DMFC1
  2311. "dmfc1 r<RT>, f<FS>"
  2312. *micromips64:
  2313. {
  2314. check_fpu (SD_);
  2315. check_u64 (SD_, instruction_0);
  2316. do_dmfc1b (SD_, RT, FS);
  2317. }
  2318. 010110,5.RT,5.RS,00,3.SEL,01011,111100:POOL32S:64::DMTC0
  2319. "dmtc0 r<RT>, r<RS>": SEL == 0
  2320. "dmtc0 r<RT>, r<RS>, <SEL>"
  2321. *micromips64:
  2322. {
  2323. check_u64 (SD_, instruction_0);
  2324. DecodeCoproc (instruction_0, 0, cp0_dmtc0, RT, RS, SEL);
  2325. }
  2326. 010101,5.RT,5.FS,00,10110000,111011:POOL32F:64::DMTC1
  2327. "dmtc1 r<RT>, f<FS>"
  2328. *micromips64:
  2329. {
  2330. check_fpu (SD_);
  2331. check_u64 (SD_, instruction_0);
  2332. do_dmtc1b (SD_, RT, FS);
  2333. }
  2334. 010110,5.RT,5.RS,1000101100,111100:POOL32S:64::DMULT
  2335. "dmult r<RS>, r<RT>"
  2336. *micromips64:
  2337. {
  2338. check_u64 (SD_, instruction_0);
  2339. do_dmult (SD_, RS, RT, 0);
  2340. }
  2341. 010110,5.RT,5.RS,1001101100,111100:POOL32S:64::DMULTU
  2342. "dmultu r<RS>, r<RT>"
  2343. *micromips64:
  2344. {
  2345. check_u64 (SD_, instruction_0);
  2346. do_dmultu (SD_, RS, RT, 0);
  2347. }
  2348. 010110,5.RT,5.RS,5.SA,00,011000000:POOL32S:64::DROTR
  2349. "drotr r<RT>, r<RS>, <SA>"
  2350. *micromips64:
  2351. {
  2352. check_u64 (SD_, instruction_0);
  2353. GPR[RT] = do_dror (SD_, GPR[RS], SA);
  2354. }
  2355. 010110,5.RT,5.RS,5.SA,00,011001000:POOL32S:64::DROTR32
  2356. "drotr32 r<RT>, r<RS>, <SA+32>"
  2357. *micromips64:
  2358. {
  2359. check_u64 (SD_, instruction_0);
  2360. GPR[RT] = do_dror (SD_, GPR[RS], SA + 32);
  2361. }
  2362. 010110,5.RT,5.RS,5.RD,00,011010000:POOL32S:64::DROTRV
  2363. "drotrv r<RD>, r<RT>, r<RS>"
  2364. *micromips64:
  2365. {
  2366. check_u64 (SD_, instruction_0);
  2367. GPR[RD] = do_dror (SD_, GPR[RT], GPR[RS]);
  2368. }
  2369. 010110,5.RT,5.RS,0111101100,111100:POOL32S:64::DSBH
  2370. "dsbh r<RT>, r<RS>"
  2371. *micromips64:
  2372. {
  2373. check_u64 (SD_, instruction_0);
  2374. do_dsbh (SD_, RT, RS);
  2375. }
  2376. 010110,5.RT,5.RS,1111101100,111100:POOL32S:64::DSHD
  2377. "dshd r<RT>, r<RS>"
  2378. *micromips64:
  2379. {
  2380. check_u64 (SD_, instruction_0);
  2381. do_dshd (SD_, RS, RT);
  2382. }
  2383. 010110,5.RT,5.RS,5.SA,00,000000000:POOL32S:64::DSLL
  2384. "dsll r<RT>, r<RS>, <SA>"
  2385. *micromips64:
  2386. {
  2387. check_u64 (SD_, instruction_0);
  2388. do_dsll (SD_, RS, RT, SA);
  2389. }
  2390. 010110,5.RT,5.RS,5.SA,00,000001000:POOL32S:64::DSLL32
  2391. "dsll32 r<RT>, r<RS>, <SA>"
  2392. *micromips64:
  2393. {
  2394. check_u64 (SD_, instruction_0);
  2395. do_dsll32 (SD_, RT, RS, SA);
  2396. }
  2397. 010110,5.RT,5.RS,5.RD,00,000010000:POOL32S:64::DSLLV
  2398. "dsllv r<RD>, r<RT>, r<RS>"
  2399. *micromips64:
  2400. {
  2401. check_u64 (SD_, instruction_0);
  2402. do_dsllv (SD_, RS, RT, RD);
  2403. }
  2404. 010110,5.RT,5.RS,5.SA,00,010000000:POOL32S:64::DSRA
  2405. "dsra r<RT>, r<RS>, <SA>"
  2406. *micromips64:
  2407. {
  2408. check_u64 (SD_, instruction_0);
  2409. do_dsra (SD_, RS, RT, SA);
  2410. }
  2411. 010110,5.RT,5.RS,5.SA,00,010001000:POOL32S:64::DSRA32
  2412. "dsra32 r<RT>, r<RS>, <SA>"
  2413. *micromips64:
  2414. {
  2415. check_u64 (SD_, instruction_0);
  2416. do_dsra32 (SD_, RT, RS, SA);
  2417. }
  2418. 010110,5.RT,5.RS,5.RD,00,010010000:POOL32S:64::DSRAV
  2419. "dsrav r<RD>, r<RS>, r<RT>"
  2420. *micromips64:
  2421. {
  2422. check_u64 (SD_, instruction_0);
  2423. do_dsrav (SD_, RS, RT, RD);
  2424. }
  2425. 010110,5.RT,5.RS,5.SA,00,001000000:POOL32S:64::DSRL
  2426. "dsrl r<RT>, r<RS>, <SA>"
  2427. *micromips64:
  2428. {
  2429. check_u64 (SD_, instruction_0);
  2430. do_dsrl (SD_, RS, RT, SA);
  2431. }
  2432. 010110,5.RT,5.RS,5.SA,00,001001000:POOL32S:64::DSRL32
  2433. "dsrl32 r<RT>, r<RS>, <SA>"
  2434. *micromips64:
  2435. {
  2436. check_u64 (SD_, instruction_0);
  2437. do_dsrl32 (SD_, RT, RS, SA);
  2438. }
  2439. 010110,5.RT,5.RS,5.RD,00,001010000:POOL32S:64::DSRLV
  2440. "dsrlv r<RD>, r<RT>, r<RS>"
  2441. *micromips64:
  2442. {
  2443. check_u64 (SD_, instruction_0);
  2444. do_dsrlv (SD_, RS, RT, RD);
  2445. }
  2446. 010110,5.RT,5.RS,5.RD,00,110001000:POOL32S:64::DSUB
  2447. "dsub r<RD>, r<RS>, r<RT>"
  2448. *micromips64:
  2449. {
  2450. check_u64 (SD_, instruction_0);
  2451. do_dsub (SD_, RD, RS, RT);
  2452. }
  2453. 010110,5.RT,5.RS,5.RD,00,111001000:POOL32S:64::DSUBU
  2454. "dsubu r<RD>, r<RS>, r<RT>"
  2455. *micromips64:
  2456. {
  2457. check_u64 (SD_, instruction_0);
  2458. do_dsubu (SD_, RS, RT, RD);
  2459. }
  2460. 110111,5.RT,5.BASE,16.OFFSET:MICROMIPS64:64::LD
  2461. "ld r<RT>, <OFFSET>(r<BASE>)"
  2462. *micromips64:
  2463. {
  2464. check_u64 (SD_, instruction_0);
  2465. GPR[RT] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
  2466. EXTEND16 (OFFSET)));
  2467. }
  2468. 011000,5.RT,5.BASE,0100,12.OFFSET:POOL32C:64::LDL
  2469. "ldl r<RT>, <OFFSET>(r<BASE>)"
  2470. *micromips64:
  2471. {
  2472. check_u64 (SD_, instruction_0);
  2473. GPR[RT] = do_load_left (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
  2474. EXTEND12 (OFFSET), GPR[RT]);
  2475. }
  2476. 011000,5.RT,5.BASE,0101,12.OFFSET:POOL32C:64::LDR
  2477. "ldr r<RT>, <OFFSET>(r<BASE>)"
  2478. *micromips64:
  2479. {
  2480. check_u64 (SD_, instruction_0);
  2481. GPR[RT] = do_load_right (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
  2482. EXTEND12 (OFFSET), GPR[RT]);
  2483. }
  2484. 010101,5.INDEX,5.BASE,5.FD,00,011001000:POOL32F:64,f::LDXC1
  2485. "ldxc1 f<FD>, r<INDEX>(r<BASE>)"
  2486. *micromips64:
  2487. {
  2488. check_fpu (SD_);
  2489. check_u64 (SD_, instruction_0);
  2490. COP_LD (1, FD, do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE], GPR[INDEX]));
  2491. }
  2492. 011000,5.RT,5.BASE,0111,12.OFFSET:POOL32C:64::LLD
  2493. "lld r<RT>, <OFFSET>(r<BASE>)"
  2494. *micromips64:
  2495. {
  2496. check_u64 (SD_, instruction_0);
  2497. do_lld (SD_, RT, OFFSET, BASE);
  2498. }
  2499. 011000,5.RT,5.BASE,1111,12.OFFSET:POOL32C:64::SCD
  2500. "scd r<RT>, <OFFSET>(r<BASE>)"
  2501. *micromips64:
  2502. {
  2503. check_u64 (SD_, instruction_0);
  2504. do_scd (SD_, RT, OFFSET, BASE, 1);
  2505. }
  2506. 110110,5.RT,5.BASE,16.OFFSET:MICROMIPS64:64::SD
  2507. "sd r<RT>, <OFFSET>(r<BASE>)"
  2508. *micromips64:
  2509. {
  2510. check_u64 (SD_, instruction_0);
  2511. do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND16 (OFFSET),
  2512. GPR[RT]);
  2513. }
  2514. 011000,5.RT,5.BASE,1100,12.OFFSET:POOL32C:64::SDL
  2515. "sdl r<RT>, <OFFSET>(r<BASE>)"
  2516. *micromips64:
  2517. {
  2518. check_u64 (SD_, instruction_0);
  2519. do_store_left (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
  2520. GPR[RT]);
  2521. }
  2522. 011000,5.RT,5.BASE,1101,12.OFFSET:POOL32C:64::SDR
  2523. "sdr r<RT>, <OFFSET>(r<BASE>)"
  2524. *micromips64:
  2525. {
  2526. check_u64 (SD_, instruction_0);
  2527. do_store_right (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
  2528. GPR[RT]);
  2529. }
  2530. 010101,5.INDEX,5.BASE,5.FD,00,100001000:POOL32F:64,f::SDXC1
  2531. "sdxc1 f<FD>, r<INDEX>(r<BASE>)"
  2532. *micromips64:
  2533. {
  2534. check_fpu (SD_);
  2535. check_u64 (SD_, instruction_0);
  2536. do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], GPR[INDEX],
  2537. COP_SD (1, FD));
  2538. }