modelx.c 88 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071
  1. /* Simulator model support for m32rxf.
  2. THIS FILE IS MACHINE GENERATED WITH CGEN.
  3. Copyright 1996-2015 Free Software Foundation, Inc.
  4. This file is part of the GNU simulators.
  5. This file is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. It is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License along
  14. with this program; if not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #define WANT_CPU m32rxf
  17. #define WANT_CPU_M32RXF
  18. #include "sim-main.h"
  19. /* The profiling data is recorded here, but is accessed via the profiling
  20. mechanism. After all, this is information for profiling. */
  21. #if WITH_PROFILE_MODEL_P
  22. /* Model handlers for each insn. */
  23. static int
  24. model_m32rx_add (SIM_CPU *current_cpu, void *sem_arg)
  25. {
  26. #define FLD(f) abuf->fields.sfmt_add.f
  27. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  28. const IDESC * UNUSED idesc = abuf->idesc;
  29. int cycles = 0;
  30. {
  31. int referenced = 0;
  32. int UNUSED insn_referenced = abuf->written;
  33. INT in_sr = -1;
  34. INT in_dr = -1;
  35. INT out_dr = -1;
  36. in_sr = FLD (in_sr);
  37. in_dr = FLD (in_dr);
  38. out_dr = FLD (out_dr);
  39. referenced |= 1 << 0;
  40. referenced |= 1 << 1;
  41. referenced |= 1 << 2;
  42. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  43. }
  44. return cycles;
  45. #undef FLD
  46. }
  47. static int
  48. model_m32rx_add3 (SIM_CPU *current_cpu, void *sem_arg)
  49. {
  50. #define FLD(f) abuf->fields.sfmt_add3.f
  51. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  52. const IDESC * UNUSED idesc = abuf->idesc;
  53. int cycles = 0;
  54. {
  55. int referenced = 0;
  56. int UNUSED insn_referenced = abuf->written;
  57. INT in_sr = -1;
  58. INT in_dr = -1;
  59. INT out_dr = -1;
  60. in_sr = FLD (in_sr);
  61. out_dr = FLD (out_dr);
  62. referenced |= 1 << 0;
  63. referenced |= 1 << 2;
  64. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  65. }
  66. return cycles;
  67. #undef FLD
  68. }
  69. static int
  70. model_m32rx_and (SIM_CPU *current_cpu, void *sem_arg)
  71. {
  72. #define FLD(f) abuf->fields.sfmt_add.f
  73. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  74. const IDESC * UNUSED idesc = abuf->idesc;
  75. int cycles = 0;
  76. {
  77. int referenced = 0;
  78. int UNUSED insn_referenced = abuf->written;
  79. INT in_sr = -1;
  80. INT in_dr = -1;
  81. INT out_dr = -1;
  82. in_sr = FLD (in_sr);
  83. in_dr = FLD (in_dr);
  84. out_dr = FLD (out_dr);
  85. referenced |= 1 << 0;
  86. referenced |= 1 << 1;
  87. referenced |= 1 << 2;
  88. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  89. }
  90. return cycles;
  91. #undef FLD
  92. }
  93. static int
  94. model_m32rx_and3 (SIM_CPU *current_cpu, void *sem_arg)
  95. {
  96. #define FLD(f) abuf->fields.sfmt_and3.f
  97. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  98. const IDESC * UNUSED idesc = abuf->idesc;
  99. int cycles = 0;
  100. {
  101. int referenced = 0;
  102. int UNUSED insn_referenced = abuf->written;
  103. INT in_sr = -1;
  104. INT in_dr = -1;
  105. INT out_dr = -1;
  106. in_sr = FLD (in_sr);
  107. out_dr = FLD (out_dr);
  108. referenced |= 1 << 0;
  109. referenced |= 1 << 2;
  110. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  111. }
  112. return cycles;
  113. #undef FLD
  114. }
  115. static int
  116. model_m32rx_or (SIM_CPU *current_cpu, void *sem_arg)
  117. {
  118. #define FLD(f) abuf->fields.sfmt_add.f
  119. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  120. const IDESC * UNUSED idesc = abuf->idesc;
  121. int cycles = 0;
  122. {
  123. int referenced = 0;
  124. int UNUSED insn_referenced = abuf->written;
  125. INT in_sr = -1;
  126. INT in_dr = -1;
  127. INT out_dr = -1;
  128. in_sr = FLD (in_sr);
  129. in_dr = FLD (in_dr);
  130. out_dr = FLD (out_dr);
  131. referenced |= 1 << 0;
  132. referenced |= 1 << 1;
  133. referenced |= 1 << 2;
  134. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  135. }
  136. return cycles;
  137. #undef FLD
  138. }
  139. static int
  140. model_m32rx_or3 (SIM_CPU *current_cpu, void *sem_arg)
  141. {
  142. #define FLD(f) abuf->fields.sfmt_and3.f
  143. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  144. const IDESC * UNUSED idesc = abuf->idesc;
  145. int cycles = 0;
  146. {
  147. int referenced = 0;
  148. int UNUSED insn_referenced = abuf->written;
  149. INT in_sr = -1;
  150. INT in_dr = -1;
  151. INT out_dr = -1;
  152. in_sr = FLD (in_sr);
  153. out_dr = FLD (out_dr);
  154. referenced |= 1 << 0;
  155. referenced |= 1 << 2;
  156. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  157. }
  158. return cycles;
  159. #undef FLD
  160. }
  161. static int
  162. model_m32rx_xor (SIM_CPU *current_cpu, void *sem_arg)
  163. {
  164. #define FLD(f) abuf->fields.sfmt_add.f
  165. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  166. const IDESC * UNUSED idesc = abuf->idesc;
  167. int cycles = 0;
  168. {
  169. int referenced = 0;
  170. int UNUSED insn_referenced = abuf->written;
  171. INT in_sr = -1;
  172. INT in_dr = -1;
  173. INT out_dr = -1;
  174. in_sr = FLD (in_sr);
  175. in_dr = FLD (in_dr);
  176. out_dr = FLD (out_dr);
  177. referenced |= 1 << 0;
  178. referenced |= 1 << 1;
  179. referenced |= 1 << 2;
  180. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  181. }
  182. return cycles;
  183. #undef FLD
  184. }
  185. static int
  186. model_m32rx_xor3 (SIM_CPU *current_cpu, void *sem_arg)
  187. {
  188. #define FLD(f) abuf->fields.sfmt_and3.f
  189. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  190. const IDESC * UNUSED idesc = abuf->idesc;
  191. int cycles = 0;
  192. {
  193. int referenced = 0;
  194. int UNUSED insn_referenced = abuf->written;
  195. INT in_sr = -1;
  196. INT in_dr = -1;
  197. INT out_dr = -1;
  198. in_sr = FLD (in_sr);
  199. out_dr = FLD (out_dr);
  200. referenced |= 1 << 0;
  201. referenced |= 1 << 2;
  202. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  203. }
  204. return cycles;
  205. #undef FLD
  206. }
  207. static int
  208. model_m32rx_addi (SIM_CPU *current_cpu, void *sem_arg)
  209. {
  210. #define FLD(f) abuf->fields.sfmt_addi.f
  211. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  212. const IDESC * UNUSED idesc = abuf->idesc;
  213. int cycles = 0;
  214. {
  215. int referenced = 0;
  216. int UNUSED insn_referenced = abuf->written;
  217. INT in_sr = -1;
  218. INT in_dr = -1;
  219. INT out_dr = -1;
  220. in_dr = FLD (in_dr);
  221. out_dr = FLD (out_dr);
  222. referenced |= 1 << 1;
  223. referenced |= 1 << 2;
  224. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  225. }
  226. return cycles;
  227. #undef FLD
  228. }
  229. static int
  230. model_m32rx_addv (SIM_CPU *current_cpu, void *sem_arg)
  231. {
  232. #define FLD(f) abuf->fields.sfmt_add.f
  233. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  234. const IDESC * UNUSED idesc = abuf->idesc;
  235. int cycles = 0;
  236. {
  237. int referenced = 0;
  238. int UNUSED insn_referenced = abuf->written;
  239. INT in_sr = -1;
  240. INT in_dr = -1;
  241. INT out_dr = -1;
  242. in_sr = FLD (in_sr);
  243. in_dr = FLD (in_dr);
  244. out_dr = FLD (out_dr);
  245. referenced |= 1 << 0;
  246. referenced |= 1 << 1;
  247. referenced |= 1 << 2;
  248. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  249. }
  250. return cycles;
  251. #undef FLD
  252. }
  253. static int
  254. model_m32rx_addv3 (SIM_CPU *current_cpu, void *sem_arg)
  255. {
  256. #define FLD(f) abuf->fields.sfmt_add3.f
  257. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  258. const IDESC * UNUSED idesc = abuf->idesc;
  259. int cycles = 0;
  260. {
  261. int referenced = 0;
  262. int UNUSED insn_referenced = abuf->written;
  263. INT in_sr = -1;
  264. INT in_dr = -1;
  265. INT out_dr = -1;
  266. in_sr = FLD (in_sr);
  267. out_dr = FLD (out_dr);
  268. referenced |= 1 << 0;
  269. referenced |= 1 << 2;
  270. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  271. }
  272. return cycles;
  273. #undef FLD
  274. }
  275. static int
  276. model_m32rx_addx (SIM_CPU *current_cpu, void *sem_arg)
  277. {
  278. #define FLD(f) abuf->fields.sfmt_add.f
  279. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  280. const IDESC * UNUSED idesc = abuf->idesc;
  281. int cycles = 0;
  282. {
  283. int referenced = 0;
  284. int UNUSED insn_referenced = abuf->written;
  285. INT in_sr = -1;
  286. INT in_dr = -1;
  287. INT out_dr = -1;
  288. in_sr = FLD (in_sr);
  289. in_dr = FLD (in_dr);
  290. out_dr = FLD (out_dr);
  291. referenced |= 1 << 0;
  292. referenced |= 1 << 1;
  293. referenced |= 1 << 2;
  294. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  295. }
  296. return cycles;
  297. #undef FLD
  298. }
  299. static int
  300. model_m32rx_bc8 (SIM_CPU *current_cpu, void *sem_arg)
  301. {
  302. #define FLD(f) abuf->fields.sfmt_bl8.f
  303. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  304. const IDESC * UNUSED idesc = abuf->idesc;
  305. int cycles = 0;
  306. {
  307. int referenced = 0;
  308. int UNUSED insn_referenced = abuf->written;
  309. INT in_sr = -1;
  310. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  311. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  312. }
  313. return cycles;
  314. #undef FLD
  315. }
  316. static int
  317. model_m32rx_bc24 (SIM_CPU *current_cpu, void *sem_arg)
  318. {
  319. #define FLD(f) abuf->fields.sfmt_bl24.f
  320. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  321. const IDESC * UNUSED idesc = abuf->idesc;
  322. int cycles = 0;
  323. {
  324. int referenced = 0;
  325. int UNUSED insn_referenced = abuf->written;
  326. INT in_sr = -1;
  327. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  328. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  329. }
  330. return cycles;
  331. #undef FLD
  332. }
  333. static int
  334. model_m32rx_beq (SIM_CPU *current_cpu, void *sem_arg)
  335. {
  336. #define FLD(f) abuf->fields.sfmt_beq.f
  337. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  338. const IDESC * UNUSED idesc = abuf->idesc;
  339. int cycles = 0;
  340. {
  341. int referenced = 0;
  342. int UNUSED insn_referenced = abuf->written;
  343. INT in_sr = -1;
  344. if (insn_referenced & (1 << 3)) referenced |= 1 << 1;
  345. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  346. }
  347. {
  348. int referenced = 0;
  349. int UNUSED insn_referenced = abuf->written;
  350. INT in_src1 = -1;
  351. INT in_src2 = -1;
  352. in_src1 = FLD (in_src1);
  353. in_src2 = FLD (in_src2);
  354. referenced |= 1 << 0;
  355. referenced |= 1 << 1;
  356. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  357. }
  358. return cycles;
  359. #undef FLD
  360. }
  361. static int
  362. model_m32rx_beqz (SIM_CPU *current_cpu, void *sem_arg)
  363. {
  364. #define FLD(f) abuf->fields.sfmt_beq.f
  365. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  366. const IDESC * UNUSED idesc = abuf->idesc;
  367. int cycles = 0;
  368. {
  369. int referenced = 0;
  370. int UNUSED insn_referenced = abuf->written;
  371. INT in_sr = -1;
  372. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  373. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  374. }
  375. {
  376. int referenced = 0;
  377. int UNUSED insn_referenced = abuf->written;
  378. INT in_src1 = -1;
  379. INT in_src2 = -1;
  380. in_src2 = FLD (in_src2);
  381. referenced |= 1 << 1;
  382. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  383. }
  384. return cycles;
  385. #undef FLD
  386. }
  387. static int
  388. model_m32rx_bgez (SIM_CPU *current_cpu, void *sem_arg)
  389. {
  390. #define FLD(f) abuf->fields.sfmt_beq.f
  391. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  392. const IDESC * UNUSED idesc = abuf->idesc;
  393. int cycles = 0;
  394. {
  395. int referenced = 0;
  396. int UNUSED insn_referenced = abuf->written;
  397. INT in_sr = -1;
  398. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  399. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  400. }
  401. {
  402. int referenced = 0;
  403. int UNUSED insn_referenced = abuf->written;
  404. INT in_src1 = -1;
  405. INT in_src2 = -1;
  406. in_src2 = FLD (in_src2);
  407. referenced |= 1 << 1;
  408. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  409. }
  410. return cycles;
  411. #undef FLD
  412. }
  413. static int
  414. model_m32rx_bgtz (SIM_CPU *current_cpu, void *sem_arg)
  415. {
  416. #define FLD(f) abuf->fields.sfmt_beq.f
  417. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  418. const IDESC * UNUSED idesc = abuf->idesc;
  419. int cycles = 0;
  420. {
  421. int referenced = 0;
  422. int UNUSED insn_referenced = abuf->written;
  423. INT in_sr = -1;
  424. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  425. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  426. }
  427. {
  428. int referenced = 0;
  429. int UNUSED insn_referenced = abuf->written;
  430. INT in_src1 = -1;
  431. INT in_src2 = -1;
  432. in_src2 = FLD (in_src2);
  433. referenced |= 1 << 1;
  434. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  435. }
  436. return cycles;
  437. #undef FLD
  438. }
  439. static int
  440. model_m32rx_blez (SIM_CPU *current_cpu, void *sem_arg)
  441. {
  442. #define FLD(f) abuf->fields.sfmt_beq.f
  443. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  444. const IDESC * UNUSED idesc = abuf->idesc;
  445. int cycles = 0;
  446. {
  447. int referenced = 0;
  448. int UNUSED insn_referenced = abuf->written;
  449. INT in_sr = -1;
  450. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  451. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  452. }
  453. {
  454. int referenced = 0;
  455. int UNUSED insn_referenced = abuf->written;
  456. INT in_src1 = -1;
  457. INT in_src2 = -1;
  458. in_src2 = FLD (in_src2);
  459. referenced |= 1 << 1;
  460. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  461. }
  462. return cycles;
  463. #undef FLD
  464. }
  465. static int
  466. model_m32rx_bltz (SIM_CPU *current_cpu, void *sem_arg)
  467. {
  468. #define FLD(f) abuf->fields.sfmt_beq.f
  469. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  470. const IDESC * UNUSED idesc = abuf->idesc;
  471. int cycles = 0;
  472. {
  473. int referenced = 0;
  474. int UNUSED insn_referenced = abuf->written;
  475. INT in_sr = -1;
  476. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  477. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  478. }
  479. {
  480. int referenced = 0;
  481. int UNUSED insn_referenced = abuf->written;
  482. INT in_src1 = -1;
  483. INT in_src2 = -1;
  484. in_src2 = FLD (in_src2);
  485. referenced |= 1 << 1;
  486. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  487. }
  488. return cycles;
  489. #undef FLD
  490. }
  491. static int
  492. model_m32rx_bnez (SIM_CPU *current_cpu, void *sem_arg)
  493. {
  494. #define FLD(f) abuf->fields.sfmt_beq.f
  495. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  496. const IDESC * UNUSED idesc = abuf->idesc;
  497. int cycles = 0;
  498. {
  499. int referenced = 0;
  500. int UNUSED insn_referenced = abuf->written;
  501. INT in_sr = -1;
  502. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  503. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  504. }
  505. {
  506. int referenced = 0;
  507. int UNUSED insn_referenced = abuf->written;
  508. INT in_src1 = -1;
  509. INT in_src2 = -1;
  510. in_src2 = FLD (in_src2);
  511. referenced |= 1 << 1;
  512. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  513. }
  514. return cycles;
  515. #undef FLD
  516. }
  517. static int
  518. model_m32rx_bl8 (SIM_CPU *current_cpu, void *sem_arg)
  519. {
  520. #define FLD(f) abuf->fields.sfmt_bl8.f
  521. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  522. const IDESC * UNUSED idesc = abuf->idesc;
  523. int cycles = 0;
  524. {
  525. int referenced = 0;
  526. int UNUSED insn_referenced = abuf->written;
  527. INT in_sr = -1;
  528. referenced |= 1 << 1;
  529. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  530. }
  531. return cycles;
  532. #undef FLD
  533. }
  534. static int
  535. model_m32rx_bl24 (SIM_CPU *current_cpu, void *sem_arg)
  536. {
  537. #define FLD(f) abuf->fields.sfmt_bl24.f
  538. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  539. const IDESC * UNUSED idesc = abuf->idesc;
  540. int cycles = 0;
  541. {
  542. int referenced = 0;
  543. int UNUSED insn_referenced = abuf->written;
  544. INT in_sr = -1;
  545. referenced |= 1 << 1;
  546. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  547. }
  548. return cycles;
  549. #undef FLD
  550. }
  551. static int
  552. model_m32rx_bcl8 (SIM_CPU *current_cpu, void *sem_arg)
  553. {
  554. #define FLD(f) abuf->fields.sfmt_bl8.f
  555. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  556. const IDESC * UNUSED idesc = abuf->idesc;
  557. int cycles = 0;
  558. {
  559. int referenced = 0;
  560. int UNUSED insn_referenced = abuf->written;
  561. INT in_sr = -1;
  562. if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
  563. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  564. }
  565. return cycles;
  566. #undef FLD
  567. }
  568. static int
  569. model_m32rx_bcl24 (SIM_CPU *current_cpu, void *sem_arg)
  570. {
  571. #define FLD(f) abuf->fields.sfmt_bl24.f
  572. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  573. const IDESC * UNUSED idesc = abuf->idesc;
  574. int cycles = 0;
  575. {
  576. int referenced = 0;
  577. int UNUSED insn_referenced = abuf->written;
  578. INT in_sr = -1;
  579. if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
  580. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  581. }
  582. return cycles;
  583. #undef FLD
  584. }
  585. static int
  586. model_m32rx_bnc8 (SIM_CPU *current_cpu, void *sem_arg)
  587. {
  588. #define FLD(f) abuf->fields.sfmt_bl8.f
  589. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  590. const IDESC * UNUSED idesc = abuf->idesc;
  591. int cycles = 0;
  592. {
  593. int referenced = 0;
  594. int UNUSED insn_referenced = abuf->written;
  595. INT in_sr = -1;
  596. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  597. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  598. }
  599. return cycles;
  600. #undef FLD
  601. }
  602. static int
  603. model_m32rx_bnc24 (SIM_CPU *current_cpu, void *sem_arg)
  604. {
  605. #define FLD(f) abuf->fields.sfmt_bl24.f
  606. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  607. const IDESC * UNUSED idesc = abuf->idesc;
  608. int cycles = 0;
  609. {
  610. int referenced = 0;
  611. int UNUSED insn_referenced = abuf->written;
  612. INT in_sr = -1;
  613. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  614. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  615. }
  616. return cycles;
  617. #undef FLD
  618. }
  619. static int
  620. model_m32rx_bne (SIM_CPU *current_cpu, void *sem_arg)
  621. {
  622. #define FLD(f) abuf->fields.sfmt_beq.f
  623. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  624. const IDESC * UNUSED idesc = abuf->idesc;
  625. int cycles = 0;
  626. {
  627. int referenced = 0;
  628. int UNUSED insn_referenced = abuf->written;
  629. INT in_sr = -1;
  630. if (insn_referenced & (1 << 3)) referenced |= 1 << 1;
  631. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  632. }
  633. {
  634. int referenced = 0;
  635. int UNUSED insn_referenced = abuf->written;
  636. INT in_src1 = -1;
  637. INT in_src2 = -1;
  638. in_src1 = FLD (in_src1);
  639. in_src2 = FLD (in_src2);
  640. referenced |= 1 << 0;
  641. referenced |= 1 << 1;
  642. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
  643. }
  644. return cycles;
  645. #undef FLD
  646. }
  647. static int
  648. model_m32rx_bra8 (SIM_CPU *current_cpu, void *sem_arg)
  649. {
  650. #define FLD(f) abuf->fields.sfmt_bl8.f
  651. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  652. const IDESC * UNUSED idesc = abuf->idesc;
  653. int cycles = 0;
  654. {
  655. int referenced = 0;
  656. int UNUSED insn_referenced = abuf->written;
  657. INT in_sr = -1;
  658. referenced |= 1 << 1;
  659. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  660. }
  661. return cycles;
  662. #undef FLD
  663. }
  664. static int
  665. model_m32rx_bra24 (SIM_CPU *current_cpu, void *sem_arg)
  666. {
  667. #define FLD(f) abuf->fields.sfmt_bl24.f
  668. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  669. const IDESC * UNUSED idesc = abuf->idesc;
  670. int cycles = 0;
  671. {
  672. int referenced = 0;
  673. int UNUSED insn_referenced = abuf->written;
  674. INT in_sr = -1;
  675. referenced |= 1 << 1;
  676. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  677. }
  678. return cycles;
  679. #undef FLD
  680. }
  681. static int
  682. model_m32rx_bncl8 (SIM_CPU *current_cpu, void *sem_arg)
  683. {
  684. #define FLD(f) abuf->fields.sfmt_bl8.f
  685. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  686. const IDESC * UNUSED idesc = abuf->idesc;
  687. int cycles = 0;
  688. {
  689. int referenced = 0;
  690. int UNUSED insn_referenced = abuf->written;
  691. INT in_sr = -1;
  692. if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
  693. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  694. }
  695. return cycles;
  696. #undef FLD
  697. }
  698. static int
  699. model_m32rx_bncl24 (SIM_CPU *current_cpu, void *sem_arg)
  700. {
  701. #define FLD(f) abuf->fields.sfmt_bl24.f
  702. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  703. const IDESC * UNUSED idesc = abuf->idesc;
  704. int cycles = 0;
  705. {
  706. int referenced = 0;
  707. int UNUSED insn_referenced = abuf->written;
  708. INT in_sr = -1;
  709. if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
  710. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  711. }
  712. return cycles;
  713. #undef FLD
  714. }
  715. static int
  716. model_m32rx_cmp (SIM_CPU *current_cpu, void *sem_arg)
  717. {
  718. #define FLD(f) abuf->fields.sfmt_st_plus.f
  719. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  720. const IDESC * UNUSED idesc = abuf->idesc;
  721. int cycles = 0;
  722. {
  723. int referenced = 0;
  724. int UNUSED insn_referenced = abuf->written;
  725. INT in_src1 = -1;
  726. INT in_src2 = -1;
  727. in_src1 = FLD (in_src1);
  728. in_src2 = FLD (in_src2);
  729. referenced |= 1 << 0;
  730. referenced |= 1 << 1;
  731. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  732. }
  733. return cycles;
  734. #undef FLD
  735. }
  736. static int
  737. model_m32rx_cmpi (SIM_CPU *current_cpu, void *sem_arg)
  738. {
  739. #define FLD(f) abuf->fields.sfmt_st_d.f
  740. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  741. const IDESC * UNUSED idesc = abuf->idesc;
  742. int cycles = 0;
  743. {
  744. int referenced = 0;
  745. int UNUSED insn_referenced = abuf->written;
  746. INT in_src1 = -1;
  747. INT in_src2 = -1;
  748. in_src2 = FLD (in_src2);
  749. referenced |= 1 << 1;
  750. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  751. }
  752. return cycles;
  753. #undef FLD
  754. }
  755. static int
  756. model_m32rx_cmpu (SIM_CPU *current_cpu, void *sem_arg)
  757. {
  758. #define FLD(f) abuf->fields.sfmt_st_plus.f
  759. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  760. const IDESC * UNUSED idesc = abuf->idesc;
  761. int cycles = 0;
  762. {
  763. int referenced = 0;
  764. int UNUSED insn_referenced = abuf->written;
  765. INT in_src1 = -1;
  766. INT in_src2 = -1;
  767. in_src1 = FLD (in_src1);
  768. in_src2 = FLD (in_src2);
  769. referenced |= 1 << 0;
  770. referenced |= 1 << 1;
  771. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  772. }
  773. return cycles;
  774. #undef FLD
  775. }
  776. static int
  777. model_m32rx_cmpui (SIM_CPU *current_cpu, void *sem_arg)
  778. {
  779. #define FLD(f) abuf->fields.sfmt_st_d.f
  780. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  781. const IDESC * UNUSED idesc = abuf->idesc;
  782. int cycles = 0;
  783. {
  784. int referenced = 0;
  785. int UNUSED insn_referenced = abuf->written;
  786. INT in_src1 = -1;
  787. INT in_src2 = -1;
  788. in_src2 = FLD (in_src2);
  789. referenced |= 1 << 1;
  790. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  791. }
  792. return cycles;
  793. #undef FLD
  794. }
  795. static int
  796. model_m32rx_cmpeq (SIM_CPU *current_cpu, void *sem_arg)
  797. {
  798. #define FLD(f) abuf->fields.sfmt_st_plus.f
  799. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  800. const IDESC * UNUSED idesc = abuf->idesc;
  801. int cycles = 0;
  802. {
  803. int referenced = 0;
  804. int UNUSED insn_referenced = abuf->written;
  805. INT in_src1 = -1;
  806. INT in_src2 = -1;
  807. in_src1 = FLD (in_src1);
  808. in_src2 = FLD (in_src2);
  809. referenced |= 1 << 0;
  810. referenced |= 1 << 1;
  811. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  812. }
  813. return cycles;
  814. #undef FLD
  815. }
  816. static int
  817. model_m32rx_cmpz (SIM_CPU *current_cpu, void *sem_arg)
  818. {
  819. #define FLD(f) abuf->fields.sfmt_st_plus.f
  820. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  821. const IDESC * UNUSED idesc = abuf->idesc;
  822. int cycles = 0;
  823. {
  824. int referenced = 0;
  825. int UNUSED insn_referenced = abuf->written;
  826. INT in_src1 = -1;
  827. INT in_src2 = -1;
  828. in_src2 = FLD (in_src2);
  829. referenced |= 1 << 1;
  830. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  831. }
  832. return cycles;
  833. #undef FLD
  834. }
  835. static int
  836. model_m32rx_div (SIM_CPU *current_cpu, void *sem_arg)
  837. {
  838. #define FLD(f) abuf->fields.sfmt_add.f
  839. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  840. const IDESC * UNUSED idesc = abuf->idesc;
  841. int cycles = 0;
  842. {
  843. int referenced = 0;
  844. int UNUSED insn_referenced = abuf->written;
  845. INT in_sr = -1;
  846. INT in_dr = -1;
  847. INT out_dr = -1;
  848. in_sr = FLD (in_sr);
  849. in_dr = FLD (in_dr);
  850. out_dr = FLD (out_dr);
  851. referenced |= 1 << 0;
  852. if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
  853. if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
  854. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  855. }
  856. return cycles;
  857. #undef FLD
  858. }
  859. static int
  860. model_m32rx_divu (SIM_CPU *current_cpu, void *sem_arg)
  861. {
  862. #define FLD(f) abuf->fields.sfmt_add.f
  863. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  864. const IDESC * UNUSED idesc = abuf->idesc;
  865. int cycles = 0;
  866. {
  867. int referenced = 0;
  868. int UNUSED insn_referenced = abuf->written;
  869. INT in_sr = -1;
  870. INT in_dr = -1;
  871. INT out_dr = -1;
  872. in_sr = FLD (in_sr);
  873. in_dr = FLD (in_dr);
  874. out_dr = FLD (out_dr);
  875. referenced |= 1 << 0;
  876. if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
  877. if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
  878. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  879. }
  880. return cycles;
  881. #undef FLD
  882. }
  883. static int
  884. model_m32rx_rem (SIM_CPU *current_cpu, void *sem_arg)
  885. {
  886. #define FLD(f) abuf->fields.sfmt_add.f
  887. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  888. const IDESC * UNUSED idesc = abuf->idesc;
  889. int cycles = 0;
  890. {
  891. int referenced = 0;
  892. int UNUSED insn_referenced = abuf->written;
  893. INT in_sr = -1;
  894. INT in_dr = -1;
  895. INT out_dr = -1;
  896. in_sr = FLD (in_sr);
  897. in_dr = FLD (in_dr);
  898. out_dr = FLD (out_dr);
  899. referenced |= 1 << 0;
  900. if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
  901. if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
  902. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  903. }
  904. return cycles;
  905. #undef FLD
  906. }
  907. static int
  908. model_m32rx_remu (SIM_CPU *current_cpu, void *sem_arg)
  909. {
  910. #define FLD(f) abuf->fields.sfmt_add.f
  911. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  912. const IDESC * UNUSED idesc = abuf->idesc;
  913. int cycles = 0;
  914. {
  915. int referenced = 0;
  916. int UNUSED insn_referenced = abuf->written;
  917. INT in_sr = -1;
  918. INT in_dr = -1;
  919. INT out_dr = -1;
  920. in_sr = FLD (in_sr);
  921. in_dr = FLD (in_dr);
  922. out_dr = FLD (out_dr);
  923. referenced |= 1 << 0;
  924. if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
  925. if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
  926. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  927. }
  928. return cycles;
  929. #undef FLD
  930. }
  931. static int
  932. model_m32rx_divh (SIM_CPU *current_cpu, void *sem_arg)
  933. {
  934. #define FLD(f) abuf->fields.sfmt_add.f
  935. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  936. const IDESC * UNUSED idesc = abuf->idesc;
  937. int cycles = 0;
  938. {
  939. int referenced = 0;
  940. int UNUSED insn_referenced = abuf->written;
  941. INT in_sr = -1;
  942. INT in_dr = -1;
  943. INT out_dr = -1;
  944. in_sr = FLD (in_sr);
  945. in_dr = FLD (in_dr);
  946. out_dr = FLD (out_dr);
  947. referenced |= 1 << 0;
  948. if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
  949. if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
  950. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  951. }
  952. return cycles;
  953. #undef FLD
  954. }
  955. static int
  956. model_m32rx_jc (SIM_CPU *current_cpu, void *sem_arg)
  957. {
  958. #define FLD(f) abuf->fields.sfmt_jl.f
  959. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  960. const IDESC * UNUSED idesc = abuf->idesc;
  961. int cycles = 0;
  962. {
  963. int referenced = 0;
  964. int UNUSED insn_referenced = abuf->written;
  965. INT in_sr = -1;
  966. in_sr = FLD (in_sr);
  967. if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
  968. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  969. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  970. }
  971. return cycles;
  972. #undef FLD
  973. }
  974. static int
  975. model_m32rx_jnc (SIM_CPU *current_cpu, void *sem_arg)
  976. {
  977. #define FLD(f) abuf->fields.sfmt_jl.f
  978. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  979. const IDESC * UNUSED idesc = abuf->idesc;
  980. int cycles = 0;
  981. {
  982. int referenced = 0;
  983. int UNUSED insn_referenced = abuf->written;
  984. INT in_sr = -1;
  985. in_sr = FLD (in_sr);
  986. if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
  987. if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
  988. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  989. }
  990. return cycles;
  991. #undef FLD
  992. }
  993. static int
  994. model_m32rx_jl (SIM_CPU *current_cpu, void *sem_arg)
  995. {
  996. #define FLD(f) abuf->fields.sfmt_jl.f
  997. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  998. const IDESC * UNUSED idesc = abuf->idesc;
  999. int cycles = 0;
  1000. {
  1001. int referenced = 0;
  1002. int UNUSED insn_referenced = abuf->written;
  1003. INT in_sr = -1;
  1004. in_sr = FLD (in_sr);
  1005. referenced |= 1 << 0;
  1006. referenced |= 1 << 1;
  1007. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  1008. }
  1009. return cycles;
  1010. #undef FLD
  1011. }
  1012. static int
  1013. model_m32rx_jmp (SIM_CPU *current_cpu, void *sem_arg)
  1014. {
  1015. #define FLD(f) abuf->fields.sfmt_jl.f
  1016. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1017. const IDESC * UNUSED idesc = abuf->idesc;
  1018. int cycles = 0;
  1019. {
  1020. int referenced = 0;
  1021. int UNUSED insn_referenced = abuf->written;
  1022. INT in_sr = -1;
  1023. in_sr = FLD (in_sr);
  1024. referenced |= 1 << 0;
  1025. referenced |= 1 << 1;
  1026. cycles += m32rxf_model_m32rx_u_cti (current_cpu, idesc, 0, referenced, in_sr);
  1027. }
  1028. return cycles;
  1029. #undef FLD
  1030. }
  1031. static int
  1032. model_m32rx_ld (SIM_CPU *current_cpu, void *sem_arg)
  1033. {
  1034. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1035. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1036. const IDESC * UNUSED idesc = abuf->idesc;
  1037. int cycles = 0;
  1038. {
  1039. int referenced = 0;
  1040. int UNUSED insn_referenced = abuf->written;
  1041. INT in_sr = 0;
  1042. INT out_dr = 0;
  1043. in_sr = FLD (in_sr);
  1044. out_dr = FLD (out_dr);
  1045. referenced |= 1 << 0;
  1046. referenced |= 1 << 1;
  1047. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1048. }
  1049. return cycles;
  1050. #undef FLD
  1051. }
  1052. static int
  1053. model_m32rx_ld_d (SIM_CPU *current_cpu, void *sem_arg)
  1054. {
  1055. #define FLD(f) abuf->fields.sfmt_add3.f
  1056. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1057. const IDESC * UNUSED idesc = abuf->idesc;
  1058. int cycles = 0;
  1059. {
  1060. int referenced = 0;
  1061. int UNUSED insn_referenced = abuf->written;
  1062. INT in_sr = 0;
  1063. INT out_dr = 0;
  1064. in_sr = FLD (in_sr);
  1065. out_dr = FLD (out_dr);
  1066. referenced |= 1 << 0;
  1067. referenced |= 1 << 1;
  1068. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1069. }
  1070. return cycles;
  1071. #undef FLD
  1072. }
  1073. static int
  1074. model_m32rx_ldb (SIM_CPU *current_cpu, void *sem_arg)
  1075. {
  1076. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1077. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1078. const IDESC * UNUSED idesc = abuf->idesc;
  1079. int cycles = 0;
  1080. {
  1081. int referenced = 0;
  1082. int UNUSED insn_referenced = abuf->written;
  1083. INT in_sr = 0;
  1084. INT out_dr = 0;
  1085. in_sr = FLD (in_sr);
  1086. out_dr = FLD (out_dr);
  1087. referenced |= 1 << 0;
  1088. referenced |= 1 << 1;
  1089. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1090. }
  1091. return cycles;
  1092. #undef FLD
  1093. }
  1094. static int
  1095. model_m32rx_ldb_d (SIM_CPU *current_cpu, void *sem_arg)
  1096. {
  1097. #define FLD(f) abuf->fields.sfmt_add3.f
  1098. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1099. const IDESC * UNUSED idesc = abuf->idesc;
  1100. int cycles = 0;
  1101. {
  1102. int referenced = 0;
  1103. int UNUSED insn_referenced = abuf->written;
  1104. INT in_sr = 0;
  1105. INT out_dr = 0;
  1106. in_sr = FLD (in_sr);
  1107. out_dr = FLD (out_dr);
  1108. referenced |= 1 << 0;
  1109. referenced |= 1 << 1;
  1110. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1111. }
  1112. return cycles;
  1113. #undef FLD
  1114. }
  1115. static int
  1116. model_m32rx_ldh (SIM_CPU *current_cpu, void *sem_arg)
  1117. {
  1118. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1119. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1120. const IDESC * UNUSED idesc = abuf->idesc;
  1121. int cycles = 0;
  1122. {
  1123. int referenced = 0;
  1124. int UNUSED insn_referenced = abuf->written;
  1125. INT in_sr = 0;
  1126. INT out_dr = 0;
  1127. in_sr = FLD (in_sr);
  1128. out_dr = FLD (out_dr);
  1129. referenced |= 1 << 0;
  1130. referenced |= 1 << 1;
  1131. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1132. }
  1133. return cycles;
  1134. #undef FLD
  1135. }
  1136. static int
  1137. model_m32rx_ldh_d (SIM_CPU *current_cpu, void *sem_arg)
  1138. {
  1139. #define FLD(f) abuf->fields.sfmt_add3.f
  1140. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1141. const IDESC * UNUSED idesc = abuf->idesc;
  1142. int cycles = 0;
  1143. {
  1144. int referenced = 0;
  1145. int UNUSED insn_referenced = abuf->written;
  1146. INT in_sr = 0;
  1147. INT out_dr = 0;
  1148. in_sr = FLD (in_sr);
  1149. out_dr = FLD (out_dr);
  1150. referenced |= 1 << 0;
  1151. referenced |= 1 << 1;
  1152. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1153. }
  1154. return cycles;
  1155. #undef FLD
  1156. }
  1157. static int
  1158. model_m32rx_ldub (SIM_CPU *current_cpu, void *sem_arg)
  1159. {
  1160. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1161. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1162. const IDESC * UNUSED idesc = abuf->idesc;
  1163. int cycles = 0;
  1164. {
  1165. int referenced = 0;
  1166. int UNUSED insn_referenced = abuf->written;
  1167. INT in_sr = 0;
  1168. INT out_dr = 0;
  1169. in_sr = FLD (in_sr);
  1170. out_dr = FLD (out_dr);
  1171. referenced |= 1 << 0;
  1172. referenced |= 1 << 1;
  1173. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1174. }
  1175. return cycles;
  1176. #undef FLD
  1177. }
  1178. static int
  1179. model_m32rx_ldub_d (SIM_CPU *current_cpu, void *sem_arg)
  1180. {
  1181. #define FLD(f) abuf->fields.sfmt_add3.f
  1182. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1183. const IDESC * UNUSED idesc = abuf->idesc;
  1184. int cycles = 0;
  1185. {
  1186. int referenced = 0;
  1187. int UNUSED insn_referenced = abuf->written;
  1188. INT in_sr = 0;
  1189. INT out_dr = 0;
  1190. in_sr = FLD (in_sr);
  1191. out_dr = FLD (out_dr);
  1192. referenced |= 1 << 0;
  1193. referenced |= 1 << 1;
  1194. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1195. }
  1196. return cycles;
  1197. #undef FLD
  1198. }
  1199. static int
  1200. model_m32rx_lduh (SIM_CPU *current_cpu, void *sem_arg)
  1201. {
  1202. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1203. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1204. const IDESC * UNUSED idesc = abuf->idesc;
  1205. int cycles = 0;
  1206. {
  1207. int referenced = 0;
  1208. int UNUSED insn_referenced = abuf->written;
  1209. INT in_sr = 0;
  1210. INT out_dr = 0;
  1211. in_sr = FLD (in_sr);
  1212. out_dr = FLD (out_dr);
  1213. referenced |= 1 << 0;
  1214. referenced |= 1 << 1;
  1215. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1216. }
  1217. return cycles;
  1218. #undef FLD
  1219. }
  1220. static int
  1221. model_m32rx_lduh_d (SIM_CPU *current_cpu, void *sem_arg)
  1222. {
  1223. #define FLD(f) abuf->fields.sfmt_add3.f
  1224. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1225. const IDESC * UNUSED idesc = abuf->idesc;
  1226. int cycles = 0;
  1227. {
  1228. int referenced = 0;
  1229. int UNUSED insn_referenced = abuf->written;
  1230. INT in_sr = 0;
  1231. INT out_dr = 0;
  1232. in_sr = FLD (in_sr);
  1233. out_dr = FLD (out_dr);
  1234. referenced |= 1 << 0;
  1235. referenced |= 1 << 1;
  1236. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1237. }
  1238. return cycles;
  1239. #undef FLD
  1240. }
  1241. static int
  1242. model_m32rx_ld_plus (SIM_CPU *current_cpu, void *sem_arg)
  1243. {
  1244. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1245. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1246. const IDESC * UNUSED idesc = abuf->idesc;
  1247. int cycles = 0;
  1248. {
  1249. int referenced = 0;
  1250. int UNUSED insn_referenced = abuf->written;
  1251. INT in_sr = 0;
  1252. INT out_dr = 0;
  1253. in_sr = FLD (in_sr);
  1254. out_dr = FLD (out_dr);
  1255. referenced |= 1 << 0;
  1256. referenced |= 1 << 1;
  1257. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1258. }
  1259. {
  1260. int referenced = 0;
  1261. int UNUSED insn_referenced = abuf->written;
  1262. INT in_sr = -1;
  1263. INT in_dr = -1;
  1264. INT out_dr = -1;
  1265. in_dr = FLD (in_sr);
  1266. out_dr = FLD (out_sr);
  1267. referenced |= 1 << 0;
  1268. referenced |= 1 << 2;
  1269. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
  1270. }
  1271. return cycles;
  1272. #undef FLD
  1273. }
  1274. static int
  1275. model_m32rx_ld24 (SIM_CPU *current_cpu, void *sem_arg)
  1276. {
  1277. #define FLD(f) abuf->fields.sfmt_ld24.f
  1278. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1279. const IDESC * UNUSED idesc = abuf->idesc;
  1280. int cycles = 0;
  1281. {
  1282. int referenced = 0;
  1283. int UNUSED insn_referenced = abuf->written;
  1284. INT in_sr = -1;
  1285. INT in_dr = -1;
  1286. INT out_dr = -1;
  1287. out_dr = FLD (out_dr);
  1288. referenced |= 1 << 2;
  1289. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1290. }
  1291. return cycles;
  1292. #undef FLD
  1293. }
  1294. static int
  1295. model_m32rx_ldi8 (SIM_CPU *current_cpu, void *sem_arg)
  1296. {
  1297. #define FLD(f) abuf->fields.sfmt_addi.f
  1298. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1299. const IDESC * UNUSED idesc = abuf->idesc;
  1300. int cycles = 0;
  1301. {
  1302. int referenced = 0;
  1303. int UNUSED insn_referenced = abuf->written;
  1304. INT in_sr = -1;
  1305. INT in_dr = -1;
  1306. INT out_dr = -1;
  1307. out_dr = FLD (out_dr);
  1308. referenced |= 1 << 2;
  1309. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1310. }
  1311. return cycles;
  1312. #undef FLD
  1313. }
  1314. static int
  1315. model_m32rx_ldi16 (SIM_CPU *current_cpu, void *sem_arg)
  1316. {
  1317. #define FLD(f) abuf->fields.sfmt_add3.f
  1318. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1319. const IDESC * UNUSED idesc = abuf->idesc;
  1320. int cycles = 0;
  1321. {
  1322. int referenced = 0;
  1323. int UNUSED insn_referenced = abuf->written;
  1324. INT in_sr = -1;
  1325. INT in_dr = -1;
  1326. INT out_dr = -1;
  1327. out_dr = FLD (out_dr);
  1328. referenced |= 1 << 2;
  1329. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1330. }
  1331. return cycles;
  1332. #undef FLD
  1333. }
  1334. static int
  1335. model_m32rx_lock (SIM_CPU *current_cpu, void *sem_arg)
  1336. {
  1337. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1338. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1339. const IDESC * UNUSED idesc = abuf->idesc;
  1340. int cycles = 0;
  1341. {
  1342. int referenced = 0;
  1343. int UNUSED insn_referenced = abuf->written;
  1344. INT in_sr = 0;
  1345. INT out_dr = 0;
  1346. in_sr = FLD (in_sr);
  1347. out_dr = FLD (out_dr);
  1348. referenced |= 1 << 0;
  1349. referenced |= 1 << 1;
  1350. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  1351. }
  1352. return cycles;
  1353. #undef FLD
  1354. }
  1355. static int
  1356. model_m32rx_machi_a (SIM_CPU *current_cpu, void *sem_arg)
  1357. {
  1358. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1359. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1360. const IDESC * UNUSED idesc = abuf->idesc;
  1361. int cycles = 0;
  1362. {
  1363. int referenced = 0;
  1364. int UNUSED insn_referenced = abuf->written;
  1365. INT in_src1 = -1;
  1366. INT in_src2 = -1;
  1367. in_src1 = FLD (in_src1);
  1368. in_src2 = FLD (in_src2);
  1369. referenced |= 1 << 0;
  1370. referenced |= 1 << 1;
  1371. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1372. }
  1373. return cycles;
  1374. #undef FLD
  1375. }
  1376. static int
  1377. model_m32rx_maclo_a (SIM_CPU *current_cpu, void *sem_arg)
  1378. {
  1379. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1380. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1381. const IDESC * UNUSED idesc = abuf->idesc;
  1382. int cycles = 0;
  1383. {
  1384. int referenced = 0;
  1385. int UNUSED insn_referenced = abuf->written;
  1386. INT in_src1 = -1;
  1387. INT in_src2 = -1;
  1388. in_src1 = FLD (in_src1);
  1389. in_src2 = FLD (in_src2);
  1390. referenced |= 1 << 0;
  1391. referenced |= 1 << 1;
  1392. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1393. }
  1394. return cycles;
  1395. #undef FLD
  1396. }
  1397. static int
  1398. model_m32rx_macwhi_a (SIM_CPU *current_cpu, void *sem_arg)
  1399. {
  1400. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1401. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1402. const IDESC * UNUSED idesc = abuf->idesc;
  1403. int cycles = 0;
  1404. {
  1405. int referenced = 0;
  1406. int UNUSED insn_referenced = abuf->written;
  1407. INT in_src1 = -1;
  1408. INT in_src2 = -1;
  1409. in_src1 = FLD (in_src1);
  1410. in_src2 = FLD (in_src2);
  1411. referenced |= 1 << 0;
  1412. referenced |= 1 << 1;
  1413. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1414. }
  1415. return cycles;
  1416. #undef FLD
  1417. }
  1418. static int
  1419. model_m32rx_macwlo_a (SIM_CPU *current_cpu, void *sem_arg)
  1420. {
  1421. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1422. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1423. const IDESC * UNUSED idesc = abuf->idesc;
  1424. int cycles = 0;
  1425. {
  1426. int referenced = 0;
  1427. int UNUSED insn_referenced = abuf->written;
  1428. INT in_src1 = -1;
  1429. INT in_src2 = -1;
  1430. in_src1 = FLD (in_src1);
  1431. in_src2 = FLD (in_src2);
  1432. referenced |= 1 << 0;
  1433. referenced |= 1 << 1;
  1434. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1435. }
  1436. return cycles;
  1437. #undef FLD
  1438. }
  1439. static int
  1440. model_m32rx_mul (SIM_CPU *current_cpu, void *sem_arg)
  1441. {
  1442. #define FLD(f) abuf->fields.sfmt_add.f
  1443. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1444. const IDESC * UNUSED idesc = abuf->idesc;
  1445. int cycles = 0;
  1446. {
  1447. int referenced = 0;
  1448. int UNUSED insn_referenced = abuf->written;
  1449. INT in_sr = -1;
  1450. INT in_dr = -1;
  1451. INT out_dr = -1;
  1452. in_sr = FLD (in_sr);
  1453. in_dr = FLD (in_dr);
  1454. out_dr = FLD (out_dr);
  1455. referenced |= 1 << 0;
  1456. referenced |= 1 << 1;
  1457. referenced |= 1 << 2;
  1458. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1459. }
  1460. return cycles;
  1461. #undef FLD
  1462. }
  1463. static int
  1464. model_m32rx_mulhi_a (SIM_CPU *current_cpu, void *sem_arg)
  1465. {
  1466. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1467. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1468. const IDESC * UNUSED idesc = abuf->idesc;
  1469. int cycles = 0;
  1470. {
  1471. int referenced = 0;
  1472. int UNUSED insn_referenced = abuf->written;
  1473. INT in_src1 = -1;
  1474. INT in_src2 = -1;
  1475. in_src1 = FLD (in_src1);
  1476. in_src2 = FLD (in_src2);
  1477. referenced |= 1 << 0;
  1478. referenced |= 1 << 1;
  1479. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1480. }
  1481. return cycles;
  1482. #undef FLD
  1483. }
  1484. static int
  1485. model_m32rx_mullo_a (SIM_CPU *current_cpu, void *sem_arg)
  1486. {
  1487. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1488. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1489. const IDESC * UNUSED idesc = abuf->idesc;
  1490. int cycles = 0;
  1491. {
  1492. int referenced = 0;
  1493. int UNUSED insn_referenced = abuf->written;
  1494. INT in_src1 = -1;
  1495. INT in_src2 = -1;
  1496. in_src1 = FLD (in_src1);
  1497. in_src2 = FLD (in_src2);
  1498. referenced |= 1 << 0;
  1499. referenced |= 1 << 1;
  1500. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1501. }
  1502. return cycles;
  1503. #undef FLD
  1504. }
  1505. static int
  1506. model_m32rx_mulwhi_a (SIM_CPU *current_cpu, void *sem_arg)
  1507. {
  1508. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1509. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1510. const IDESC * UNUSED idesc = abuf->idesc;
  1511. int cycles = 0;
  1512. {
  1513. int referenced = 0;
  1514. int UNUSED insn_referenced = abuf->written;
  1515. INT in_src1 = -1;
  1516. INT in_src2 = -1;
  1517. in_src1 = FLD (in_src1);
  1518. in_src2 = FLD (in_src2);
  1519. referenced |= 1 << 0;
  1520. referenced |= 1 << 1;
  1521. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1522. }
  1523. return cycles;
  1524. #undef FLD
  1525. }
  1526. static int
  1527. model_m32rx_mulwlo_a (SIM_CPU *current_cpu, void *sem_arg)
  1528. {
  1529. #define FLD(f) abuf->fields.sfmt_machi_a.f
  1530. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1531. const IDESC * UNUSED idesc = abuf->idesc;
  1532. int cycles = 0;
  1533. {
  1534. int referenced = 0;
  1535. int UNUSED insn_referenced = abuf->written;
  1536. INT in_src1 = -1;
  1537. INT in_src2 = -1;
  1538. in_src1 = FLD (in_src1);
  1539. in_src2 = FLD (in_src2);
  1540. referenced |= 1 << 0;
  1541. referenced |= 1 << 1;
  1542. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1543. }
  1544. return cycles;
  1545. #undef FLD
  1546. }
  1547. static int
  1548. model_m32rx_mv (SIM_CPU *current_cpu, void *sem_arg)
  1549. {
  1550. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1551. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1552. const IDESC * UNUSED idesc = abuf->idesc;
  1553. int cycles = 0;
  1554. {
  1555. int referenced = 0;
  1556. int UNUSED insn_referenced = abuf->written;
  1557. INT in_sr = -1;
  1558. INT in_dr = -1;
  1559. INT out_dr = -1;
  1560. in_sr = FLD (in_sr);
  1561. out_dr = FLD (out_dr);
  1562. referenced |= 1 << 0;
  1563. referenced |= 1 << 2;
  1564. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1565. }
  1566. return cycles;
  1567. #undef FLD
  1568. }
  1569. static int
  1570. model_m32rx_mvfachi_a (SIM_CPU *current_cpu, void *sem_arg)
  1571. {
  1572. #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
  1573. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1574. const IDESC * UNUSED idesc = abuf->idesc;
  1575. int cycles = 0;
  1576. {
  1577. int referenced = 0;
  1578. int UNUSED insn_referenced = abuf->written;
  1579. INT in_sr = -1;
  1580. INT in_dr = -1;
  1581. INT out_dr = -1;
  1582. out_dr = FLD (out_dr);
  1583. referenced |= 1 << 2;
  1584. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1585. }
  1586. return cycles;
  1587. #undef FLD
  1588. }
  1589. static int
  1590. model_m32rx_mvfaclo_a (SIM_CPU *current_cpu, void *sem_arg)
  1591. {
  1592. #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
  1593. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1594. const IDESC * UNUSED idesc = abuf->idesc;
  1595. int cycles = 0;
  1596. {
  1597. int referenced = 0;
  1598. int UNUSED insn_referenced = abuf->written;
  1599. INT in_sr = -1;
  1600. INT in_dr = -1;
  1601. INT out_dr = -1;
  1602. out_dr = FLD (out_dr);
  1603. referenced |= 1 << 2;
  1604. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1605. }
  1606. return cycles;
  1607. #undef FLD
  1608. }
  1609. static int
  1610. model_m32rx_mvfacmi_a (SIM_CPU *current_cpu, void *sem_arg)
  1611. {
  1612. #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
  1613. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1614. const IDESC * UNUSED idesc = abuf->idesc;
  1615. int cycles = 0;
  1616. {
  1617. int referenced = 0;
  1618. int UNUSED insn_referenced = abuf->written;
  1619. INT in_sr = -1;
  1620. INT in_dr = -1;
  1621. INT out_dr = -1;
  1622. out_dr = FLD (out_dr);
  1623. referenced |= 1 << 2;
  1624. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1625. }
  1626. return cycles;
  1627. #undef FLD
  1628. }
  1629. static int
  1630. model_m32rx_mvfc (SIM_CPU *current_cpu, void *sem_arg)
  1631. {
  1632. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1633. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1634. const IDESC * UNUSED idesc = abuf->idesc;
  1635. int cycles = 0;
  1636. {
  1637. int referenced = 0;
  1638. int UNUSED insn_referenced = abuf->written;
  1639. INT in_sr = -1;
  1640. INT in_dr = -1;
  1641. INT out_dr = -1;
  1642. out_dr = FLD (out_dr);
  1643. referenced |= 1 << 2;
  1644. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1645. }
  1646. return cycles;
  1647. #undef FLD
  1648. }
  1649. static int
  1650. model_m32rx_mvtachi_a (SIM_CPU *current_cpu, void *sem_arg)
  1651. {
  1652. #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
  1653. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1654. const IDESC * UNUSED idesc = abuf->idesc;
  1655. int cycles = 0;
  1656. {
  1657. int referenced = 0;
  1658. int UNUSED insn_referenced = abuf->written;
  1659. INT in_sr = -1;
  1660. INT in_dr = -1;
  1661. INT out_dr = -1;
  1662. in_sr = FLD (in_src1);
  1663. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1664. }
  1665. return cycles;
  1666. #undef FLD
  1667. }
  1668. static int
  1669. model_m32rx_mvtaclo_a (SIM_CPU *current_cpu, void *sem_arg)
  1670. {
  1671. #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
  1672. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1673. const IDESC * UNUSED idesc = abuf->idesc;
  1674. int cycles = 0;
  1675. {
  1676. int referenced = 0;
  1677. int UNUSED insn_referenced = abuf->written;
  1678. INT in_sr = -1;
  1679. INT in_dr = -1;
  1680. INT out_dr = -1;
  1681. in_sr = FLD (in_src1);
  1682. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1683. }
  1684. return cycles;
  1685. #undef FLD
  1686. }
  1687. static int
  1688. model_m32rx_mvtc (SIM_CPU *current_cpu, void *sem_arg)
  1689. {
  1690. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1691. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1692. const IDESC * UNUSED idesc = abuf->idesc;
  1693. int cycles = 0;
  1694. {
  1695. int referenced = 0;
  1696. int UNUSED insn_referenced = abuf->written;
  1697. INT in_sr = -1;
  1698. INT in_dr = -1;
  1699. INT out_dr = -1;
  1700. in_sr = FLD (in_sr);
  1701. referenced |= 1 << 0;
  1702. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1703. }
  1704. return cycles;
  1705. #undef FLD
  1706. }
  1707. static int
  1708. model_m32rx_neg (SIM_CPU *current_cpu, void *sem_arg)
  1709. {
  1710. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1711. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1712. const IDESC * UNUSED idesc = abuf->idesc;
  1713. int cycles = 0;
  1714. {
  1715. int referenced = 0;
  1716. int UNUSED insn_referenced = abuf->written;
  1717. INT in_sr = -1;
  1718. INT in_dr = -1;
  1719. INT out_dr = -1;
  1720. in_sr = FLD (in_sr);
  1721. out_dr = FLD (out_dr);
  1722. referenced |= 1 << 0;
  1723. referenced |= 1 << 2;
  1724. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1725. }
  1726. return cycles;
  1727. #undef FLD
  1728. }
  1729. static int
  1730. model_m32rx_nop (SIM_CPU *current_cpu, void *sem_arg)
  1731. {
  1732. #define FLD(f) abuf->fields.sfmt_empty.f
  1733. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1734. const IDESC * UNUSED idesc = abuf->idesc;
  1735. int cycles = 0;
  1736. {
  1737. int referenced = 0;
  1738. int UNUSED insn_referenced = abuf->written;
  1739. INT in_sr = -1;
  1740. INT in_dr = -1;
  1741. INT out_dr = -1;
  1742. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1743. }
  1744. return cycles;
  1745. #undef FLD
  1746. }
  1747. static int
  1748. model_m32rx_not (SIM_CPU *current_cpu, void *sem_arg)
  1749. {
  1750. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  1751. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1752. const IDESC * UNUSED idesc = abuf->idesc;
  1753. int cycles = 0;
  1754. {
  1755. int referenced = 0;
  1756. int UNUSED insn_referenced = abuf->written;
  1757. INT in_sr = -1;
  1758. INT in_dr = -1;
  1759. INT out_dr = -1;
  1760. in_sr = FLD (in_sr);
  1761. out_dr = FLD (out_dr);
  1762. referenced |= 1 << 0;
  1763. referenced |= 1 << 2;
  1764. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1765. }
  1766. return cycles;
  1767. #undef FLD
  1768. }
  1769. static int
  1770. model_m32rx_rac_dsi (SIM_CPU *current_cpu, void *sem_arg)
  1771. {
  1772. #define FLD(f) abuf->fields.sfmt_rac_dsi.f
  1773. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1774. const IDESC * UNUSED idesc = abuf->idesc;
  1775. int cycles = 0;
  1776. {
  1777. int referenced = 0;
  1778. int UNUSED insn_referenced = abuf->written;
  1779. INT in_src1 = -1;
  1780. INT in_src2 = -1;
  1781. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1782. }
  1783. return cycles;
  1784. #undef FLD
  1785. }
  1786. static int
  1787. model_m32rx_rach_dsi (SIM_CPU *current_cpu, void *sem_arg)
  1788. {
  1789. #define FLD(f) abuf->fields.sfmt_rac_dsi.f
  1790. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1791. const IDESC * UNUSED idesc = abuf->idesc;
  1792. int cycles = 0;
  1793. {
  1794. int referenced = 0;
  1795. int UNUSED insn_referenced = abuf->written;
  1796. INT in_src1 = -1;
  1797. INT in_src2 = -1;
  1798. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  1799. }
  1800. return cycles;
  1801. #undef FLD
  1802. }
  1803. static int
  1804. model_m32rx_rte (SIM_CPU *current_cpu, void *sem_arg)
  1805. {
  1806. #define FLD(f) abuf->fields.sfmt_empty.f
  1807. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1808. const IDESC * UNUSED idesc = abuf->idesc;
  1809. int cycles = 0;
  1810. {
  1811. int referenced = 0;
  1812. int UNUSED insn_referenced = abuf->written;
  1813. INT in_sr = -1;
  1814. INT in_dr = -1;
  1815. INT out_dr = -1;
  1816. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1817. }
  1818. return cycles;
  1819. #undef FLD
  1820. }
  1821. static int
  1822. model_m32rx_seth (SIM_CPU *current_cpu, void *sem_arg)
  1823. {
  1824. #define FLD(f) abuf->fields.sfmt_seth.f
  1825. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1826. const IDESC * UNUSED idesc = abuf->idesc;
  1827. int cycles = 0;
  1828. {
  1829. int referenced = 0;
  1830. int UNUSED insn_referenced = abuf->written;
  1831. INT in_sr = -1;
  1832. INT in_dr = -1;
  1833. INT out_dr = -1;
  1834. out_dr = FLD (out_dr);
  1835. referenced |= 1 << 2;
  1836. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1837. }
  1838. return cycles;
  1839. #undef FLD
  1840. }
  1841. static int
  1842. model_m32rx_sll (SIM_CPU *current_cpu, void *sem_arg)
  1843. {
  1844. #define FLD(f) abuf->fields.sfmt_add.f
  1845. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1846. const IDESC * UNUSED idesc = abuf->idesc;
  1847. int cycles = 0;
  1848. {
  1849. int referenced = 0;
  1850. int UNUSED insn_referenced = abuf->written;
  1851. INT in_sr = -1;
  1852. INT in_dr = -1;
  1853. INT out_dr = -1;
  1854. in_sr = FLD (in_sr);
  1855. in_dr = FLD (in_dr);
  1856. out_dr = FLD (out_dr);
  1857. referenced |= 1 << 0;
  1858. referenced |= 1 << 1;
  1859. referenced |= 1 << 2;
  1860. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1861. }
  1862. return cycles;
  1863. #undef FLD
  1864. }
  1865. static int
  1866. model_m32rx_sll3 (SIM_CPU *current_cpu, void *sem_arg)
  1867. {
  1868. #define FLD(f) abuf->fields.sfmt_add3.f
  1869. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1870. const IDESC * UNUSED idesc = abuf->idesc;
  1871. int cycles = 0;
  1872. {
  1873. int referenced = 0;
  1874. int UNUSED insn_referenced = abuf->written;
  1875. INT in_sr = -1;
  1876. INT in_dr = -1;
  1877. INT out_dr = -1;
  1878. in_sr = FLD (in_sr);
  1879. out_dr = FLD (out_dr);
  1880. referenced |= 1 << 0;
  1881. referenced |= 1 << 2;
  1882. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1883. }
  1884. return cycles;
  1885. #undef FLD
  1886. }
  1887. static int
  1888. model_m32rx_slli (SIM_CPU *current_cpu, void *sem_arg)
  1889. {
  1890. #define FLD(f) abuf->fields.sfmt_slli.f
  1891. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1892. const IDESC * UNUSED idesc = abuf->idesc;
  1893. int cycles = 0;
  1894. {
  1895. int referenced = 0;
  1896. int UNUSED insn_referenced = abuf->written;
  1897. INT in_sr = -1;
  1898. INT in_dr = -1;
  1899. INT out_dr = -1;
  1900. in_dr = FLD (in_dr);
  1901. out_dr = FLD (out_dr);
  1902. referenced |= 1 << 1;
  1903. referenced |= 1 << 2;
  1904. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1905. }
  1906. return cycles;
  1907. #undef FLD
  1908. }
  1909. static int
  1910. model_m32rx_sra (SIM_CPU *current_cpu, void *sem_arg)
  1911. {
  1912. #define FLD(f) abuf->fields.sfmt_add.f
  1913. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1914. const IDESC * UNUSED idesc = abuf->idesc;
  1915. int cycles = 0;
  1916. {
  1917. int referenced = 0;
  1918. int UNUSED insn_referenced = abuf->written;
  1919. INT in_sr = -1;
  1920. INT in_dr = -1;
  1921. INT out_dr = -1;
  1922. in_sr = FLD (in_sr);
  1923. in_dr = FLD (in_dr);
  1924. out_dr = FLD (out_dr);
  1925. referenced |= 1 << 0;
  1926. referenced |= 1 << 1;
  1927. referenced |= 1 << 2;
  1928. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1929. }
  1930. return cycles;
  1931. #undef FLD
  1932. }
  1933. static int
  1934. model_m32rx_sra3 (SIM_CPU *current_cpu, void *sem_arg)
  1935. {
  1936. #define FLD(f) abuf->fields.sfmt_add3.f
  1937. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1938. const IDESC * UNUSED idesc = abuf->idesc;
  1939. int cycles = 0;
  1940. {
  1941. int referenced = 0;
  1942. int UNUSED insn_referenced = abuf->written;
  1943. INT in_sr = -1;
  1944. INT in_dr = -1;
  1945. INT out_dr = -1;
  1946. in_sr = FLD (in_sr);
  1947. out_dr = FLD (out_dr);
  1948. referenced |= 1 << 0;
  1949. referenced |= 1 << 2;
  1950. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1951. }
  1952. return cycles;
  1953. #undef FLD
  1954. }
  1955. static int
  1956. model_m32rx_srai (SIM_CPU *current_cpu, void *sem_arg)
  1957. {
  1958. #define FLD(f) abuf->fields.sfmt_slli.f
  1959. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1960. const IDESC * UNUSED idesc = abuf->idesc;
  1961. int cycles = 0;
  1962. {
  1963. int referenced = 0;
  1964. int UNUSED insn_referenced = abuf->written;
  1965. INT in_sr = -1;
  1966. INT in_dr = -1;
  1967. INT out_dr = -1;
  1968. in_dr = FLD (in_dr);
  1969. out_dr = FLD (out_dr);
  1970. referenced |= 1 << 1;
  1971. referenced |= 1 << 2;
  1972. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1973. }
  1974. return cycles;
  1975. #undef FLD
  1976. }
  1977. static int
  1978. model_m32rx_srl (SIM_CPU *current_cpu, void *sem_arg)
  1979. {
  1980. #define FLD(f) abuf->fields.sfmt_add.f
  1981. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  1982. const IDESC * UNUSED idesc = abuf->idesc;
  1983. int cycles = 0;
  1984. {
  1985. int referenced = 0;
  1986. int UNUSED insn_referenced = abuf->written;
  1987. INT in_sr = -1;
  1988. INT in_dr = -1;
  1989. INT out_dr = -1;
  1990. in_sr = FLD (in_sr);
  1991. in_dr = FLD (in_dr);
  1992. out_dr = FLD (out_dr);
  1993. referenced |= 1 << 0;
  1994. referenced |= 1 << 1;
  1995. referenced |= 1 << 2;
  1996. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  1997. }
  1998. return cycles;
  1999. #undef FLD
  2000. }
  2001. static int
  2002. model_m32rx_srl3 (SIM_CPU *current_cpu, void *sem_arg)
  2003. {
  2004. #define FLD(f) abuf->fields.sfmt_add3.f
  2005. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2006. const IDESC * UNUSED idesc = abuf->idesc;
  2007. int cycles = 0;
  2008. {
  2009. int referenced = 0;
  2010. int UNUSED insn_referenced = abuf->written;
  2011. INT in_sr = -1;
  2012. INT in_dr = -1;
  2013. INT out_dr = -1;
  2014. in_sr = FLD (in_sr);
  2015. out_dr = FLD (out_dr);
  2016. referenced |= 1 << 0;
  2017. referenced |= 1 << 2;
  2018. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2019. }
  2020. return cycles;
  2021. #undef FLD
  2022. }
  2023. static int
  2024. model_m32rx_srli (SIM_CPU *current_cpu, void *sem_arg)
  2025. {
  2026. #define FLD(f) abuf->fields.sfmt_slli.f
  2027. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2028. const IDESC * UNUSED idesc = abuf->idesc;
  2029. int cycles = 0;
  2030. {
  2031. int referenced = 0;
  2032. int UNUSED insn_referenced = abuf->written;
  2033. INT in_sr = -1;
  2034. INT in_dr = -1;
  2035. INT out_dr = -1;
  2036. in_dr = FLD (in_dr);
  2037. out_dr = FLD (out_dr);
  2038. referenced |= 1 << 1;
  2039. referenced |= 1 << 2;
  2040. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2041. }
  2042. return cycles;
  2043. #undef FLD
  2044. }
  2045. static int
  2046. model_m32rx_st (SIM_CPU *current_cpu, void *sem_arg)
  2047. {
  2048. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2049. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2050. const IDESC * UNUSED idesc = abuf->idesc;
  2051. int cycles = 0;
  2052. {
  2053. int referenced = 0;
  2054. int UNUSED insn_referenced = abuf->written;
  2055. INT in_src1 = 0;
  2056. INT in_src2 = 0;
  2057. in_src1 = FLD (in_src1);
  2058. in_src2 = FLD (in_src2);
  2059. referenced |= 1 << 0;
  2060. referenced |= 1 << 1;
  2061. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2062. }
  2063. return cycles;
  2064. #undef FLD
  2065. }
  2066. static int
  2067. model_m32rx_st_d (SIM_CPU *current_cpu, void *sem_arg)
  2068. {
  2069. #define FLD(f) abuf->fields.sfmt_st_d.f
  2070. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2071. const IDESC * UNUSED idesc = abuf->idesc;
  2072. int cycles = 0;
  2073. {
  2074. int referenced = 0;
  2075. int UNUSED insn_referenced = abuf->written;
  2076. INT in_src1 = 0;
  2077. INT in_src2 = 0;
  2078. in_src1 = FLD (in_src1);
  2079. in_src2 = FLD (in_src2);
  2080. referenced |= 1 << 0;
  2081. referenced |= 1 << 1;
  2082. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2083. }
  2084. return cycles;
  2085. #undef FLD
  2086. }
  2087. static int
  2088. model_m32rx_stb (SIM_CPU *current_cpu, void *sem_arg)
  2089. {
  2090. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2091. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2092. const IDESC * UNUSED idesc = abuf->idesc;
  2093. int cycles = 0;
  2094. {
  2095. int referenced = 0;
  2096. int UNUSED insn_referenced = abuf->written;
  2097. INT in_src1 = 0;
  2098. INT in_src2 = 0;
  2099. in_src1 = FLD (in_src1);
  2100. in_src2 = FLD (in_src2);
  2101. referenced |= 1 << 0;
  2102. referenced |= 1 << 1;
  2103. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2104. }
  2105. return cycles;
  2106. #undef FLD
  2107. }
  2108. static int
  2109. model_m32rx_stb_d (SIM_CPU *current_cpu, void *sem_arg)
  2110. {
  2111. #define FLD(f) abuf->fields.sfmt_st_d.f
  2112. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2113. const IDESC * UNUSED idesc = abuf->idesc;
  2114. int cycles = 0;
  2115. {
  2116. int referenced = 0;
  2117. int UNUSED insn_referenced = abuf->written;
  2118. INT in_src1 = 0;
  2119. INT in_src2 = 0;
  2120. in_src1 = FLD (in_src1);
  2121. in_src2 = FLD (in_src2);
  2122. referenced |= 1 << 0;
  2123. referenced |= 1 << 1;
  2124. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2125. }
  2126. return cycles;
  2127. #undef FLD
  2128. }
  2129. static int
  2130. model_m32rx_sth (SIM_CPU *current_cpu, void *sem_arg)
  2131. {
  2132. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2133. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2134. const IDESC * UNUSED idesc = abuf->idesc;
  2135. int cycles = 0;
  2136. {
  2137. int referenced = 0;
  2138. int UNUSED insn_referenced = abuf->written;
  2139. INT in_src1 = 0;
  2140. INT in_src2 = 0;
  2141. in_src1 = FLD (in_src1);
  2142. in_src2 = FLD (in_src2);
  2143. referenced |= 1 << 0;
  2144. referenced |= 1 << 1;
  2145. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2146. }
  2147. return cycles;
  2148. #undef FLD
  2149. }
  2150. static int
  2151. model_m32rx_sth_d (SIM_CPU *current_cpu, void *sem_arg)
  2152. {
  2153. #define FLD(f) abuf->fields.sfmt_st_d.f
  2154. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2155. const IDESC * UNUSED idesc = abuf->idesc;
  2156. int cycles = 0;
  2157. {
  2158. int referenced = 0;
  2159. int UNUSED insn_referenced = abuf->written;
  2160. INT in_src1 = 0;
  2161. INT in_src2 = 0;
  2162. in_src1 = FLD (in_src1);
  2163. in_src2 = FLD (in_src2);
  2164. referenced |= 1 << 0;
  2165. referenced |= 1 << 1;
  2166. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2167. }
  2168. return cycles;
  2169. #undef FLD
  2170. }
  2171. static int
  2172. model_m32rx_st_plus (SIM_CPU *current_cpu, void *sem_arg)
  2173. {
  2174. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2175. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2176. const IDESC * UNUSED idesc = abuf->idesc;
  2177. int cycles = 0;
  2178. {
  2179. int referenced = 0;
  2180. int UNUSED insn_referenced = abuf->written;
  2181. INT in_src1 = 0;
  2182. INT in_src2 = 0;
  2183. in_src1 = FLD (in_src1);
  2184. in_src2 = FLD (in_src2);
  2185. referenced |= 1 << 0;
  2186. referenced |= 1 << 1;
  2187. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2188. }
  2189. {
  2190. int referenced = 0;
  2191. int UNUSED insn_referenced = abuf->written;
  2192. INT in_sr = -1;
  2193. INT in_dr = -1;
  2194. INT out_dr = -1;
  2195. in_dr = FLD (in_src2);
  2196. out_dr = FLD (out_src2);
  2197. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
  2198. }
  2199. return cycles;
  2200. #undef FLD
  2201. }
  2202. static int
  2203. model_m32rx_sth_plus (SIM_CPU *current_cpu, void *sem_arg)
  2204. {
  2205. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2206. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2207. const IDESC * UNUSED idesc = abuf->idesc;
  2208. int cycles = 0;
  2209. {
  2210. int referenced = 0;
  2211. int UNUSED insn_referenced = abuf->written;
  2212. INT in_src1 = 0;
  2213. INT in_src2 = 0;
  2214. in_src1 = FLD (in_src1);
  2215. in_src2 = FLD (in_src2);
  2216. referenced |= 1 << 0;
  2217. referenced |= 1 << 1;
  2218. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2219. }
  2220. {
  2221. int referenced = 0;
  2222. int UNUSED insn_referenced = abuf->written;
  2223. INT in_sr = -1;
  2224. INT in_dr = -1;
  2225. INT out_dr = -1;
  2226. in_dr = FLD (in_src2);
  2227. out_dr = FLD (out_src2);
  2228. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
  2229. }
  2230. return cycles;
  2231. #undef FLD
  2232. }
  2233. static int
  2234. model_m32rx_stb_plus (SIM_CPU *current_cpu, void *sem_arg)
  2235. {
  2236. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2237. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2238. const IDESC * UNUSED idesc = abuf->idesc;
  2239. int cycles = 0;
  2240. {
  2241. int referenced = 0;
  2242. int UNUSED insn_referenced = abuf->written;
  2243. INT in_src1 = 0;
  2244. INT in_src2 = 0;
  2245. in_src1 = FLD (in_src1);
  2246. in_src2 = FLD (in_src2);
  2247. referenced |= 1 << 0;
  2248. referenced |= 1 << 1;
  2249. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2250. }
  2251. {
  2252. int referenced = 0;
  2253. int UNUSED insn_referenced = abuf->written;
  2254. INT in_sr = -1;
  2255. INT in_dr = -1;
  2256. INT out_dr = -1;
  2257. in_dr = FLD (in_src2);
  2258. out_dr = FLD (out_src2);
  2259. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
  2260. }
  2261. return cycles;
  2262. #undef FLD
  2263. }
  2264. static int
  2265. model_m32rx_st_minus (SIM_CPU *current_cpu, void *sem_arg)
  2266. {
  2267. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2268. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2269. const IDESC * UNUSED idesc = abuf->idesc;
  2270. int cycles = 0;
  2271. {
  2272. int referenced = 0;
  2273. int UNUSED insn_referenced = abuf->written;
  2274. INT in_src1 = 0;
  2275. INT in_src2 = 0;
  2276. in_src1 = FLD (in_src1);
  2277. in_src2 = FLD (in_src2);
  2278. referenced |= 1 << 0;
  2279. referenced |= 1 << 1;
  2280. cycles += m32rxf_model_m32rx_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2281. }
  2282. {
  2283. int referenced = 0;
  2284. int UNUSED insn_referenced = abuf->written;
  2285. INT in_sr = -1;
  2286. INT in_dr = -1;
  2287. INT out_dr = -1;
  2288. in_dr = FLD (in_src2);
  2289. out_dr = FLD (out_src2);
  2290. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
  2291. }
  2292. return cycles;
  2293. #undef FLD
  2294. }
  2295. static int
  2296. model_m32rx_sub (SIM_CPU *current_cpu, void *sem_arg)
  2297. {
  2298. #define FLD(f) abuf->fields.sfmt_add.f
  2299. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2300. const IDESC * UNUSED idesc = abuf->idesc;
  2301. int cycles = 0;
  2302. {
  2303. int referenced = 0;
  2304. int UNUSED insn_referenced = abuf->written;
  2305. INT in_sr = -1;
  2306. INT in_dr = -1;
  2307. INT out_dr = -1;
  2308. in_sr = FLD (in_sr);
  2309. in_dr = FLD (in_dr);
  2310. out_dr = FLD (out_dr);
  2311. referenced |= 1 << 0;
  2312. referenced |= 1 << 1;
  2313. referenced |= 1 << 2;
  2314. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2315. }
  2316. return cycles;
  2317. #undef FLD
  2318. }
  2319. static int
  2320. model_m32rx_subv (SIM_CPU *current_cpu, void *sem_arg)
  2321. {
  2322. #define FLD(f) abuf->fields.sfmt_add.f
  2323. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2324. const IDESC * UNUSED idesc = abuf->idesc;
  2325. int cycles = 0;
  2326. {
  2327. int referenced = 0;
  2328. int UNUSED insn_referenced = abuf->written;
  2329. INT in_sr = -1;
  2330. INT in_dr = -1;
  2331. INT out_dr = -1;
  2332. in_sr = FLD (in_sr);
  2333. in_dr = FLD (in_dr);
  2334. out_dr = FLD (out_dr);
  2335. referenced |= 1 << 0;
  2336. referenced |= 1 << 1;
  2337. referenced |= 1 << 2;
  2338. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2339. }
  2340. return cycles;
  2341. #undef FLD
  2342. }
  2343. static int
  2344. model_m32rx_subx (SIM_CPU *current_cpu, void *sem_arg)
  2345. {
  2346. #define FLD(f) abuf->fields.sfmt_add.f
  2347. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2348. const IDESC * UNUSED idesc = abuf->idesc;
  2349. int cycles = 0;
  2350. {
  2351. int referenced = 0;
  2352. int UNUSED insn_referenced = abuf->written;
  2353. INT in_sr = -1;
  2354. INT in_dr = -1;
  2355. INT out_dr = -1;
  2356. in_sr = FLD (in_sr);
  2357. in_dr = FLD (in_dr);
  2358. out_dr = FLD (out_dr);
  2359. referenced |= 1 << 0;
  2360. referenced |= 1 << 1;
  2361. referenced |= 1 << 2;
  2362. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2363. }
  2364. return cycles;
  2365. #undef FLD
  2366. }
  2367. static int
  2368. model_m32rx_trap (SIM_CPU *current_cpu, void *sem_arg)
  2369. {
  2370. #define FLD(f) abuf->fields.sfmt_trap.f
  2371. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2372. const IDESC * UNUSED idesc = abuf->idesc;
  2373. int cycles = 0;
  2374. {
  2375. int referenced = 0;
  2376. int UNUSED insn_referenced = abuf->written;
  2377. INT in_sr = -1;
  2378. INT in_dr = -1;
  2379. INT out_dr = -1;
  2380. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2381. }
  2382. return cycles;
  2383. #undef FLD
  2384. }
  2385. static int
  2386. model_m32rx_unlock (SIM_CPU *current_cpu, void *sem_arg)
  2387. {
  2388. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2389. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2390. const IDESC * UNUSED idesc = abuf->idesc;
  2391. int cycles = 0;
  2392. {
  2393. int referenced = 0;
  2394. int UNUSED insn_referenced = abuf->written;
  2395. INT in_sr = 0;
  2396. INT out_dr = 0;
  2397. cycles += m32rxf_model_m32rx_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
  2398. }
  2399. return cycles;
  2400. #undef FLD
  2401. }
  2402. static int
  2403. model_m32rx_satb (SIM_CPU *current_cpu, void *sem_arg)
  2404. {
  2405. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  2406. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2407. const IDESC * UNUSED idesc = abuf->idesc;
  2408. int cycles = 0;
  2409. {
  2410. int referenced = 0;
  2411. int UNUSED insn_referenced = abuf->written;
  2412. INT in_sr = -1;
  2413. INT in_dr = -1;
  2414. INT out_dr = -1;
  2415. in_sr = FLD (in_sr);
  2416. out_dr = FLD (out_dr);
  2417. referenced |= 1 << 0;
  2418. referenced |= 1 << 2;
  2419. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2420. }
  2421. return cycles;
  2422. #undef FLD
  2423. }
  2424. static int
  2425. model_m32rx_sath (SIM_CPU *current_cpu, void *sem_arg)
  2426. {
  2427. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  2428. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2429. const IDESC * UNUSED idesc = abuf->idesc;
  2430. int cycles = 0;
  2431. {
  2432. int referenced = 0;
  2433. int UNUSED insn_referenced = abuf->written;
  2434. INT in_sr = -1;
  2435. INT in_dr = -1;
  2436. INT out_dr = -1;
  2437. in_sr = FLD (in_sr);
  2438. out_dr = FLD (out_dr);
  2439. referenced |= 1 << 0;
  2440. referenced |= 1 << 2;
  2441. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2442. }
  2443. return cycles;
  2444. #undef FLD
  2445. }
  2446. static int
  2447. model_m32rx_sat (SIM_CPU *current_cpu, void *sem_arg)
  2448. {
  2449. #define FLD(f) abuf->fields.sfmt_ld_plus.f
  2450. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2451. const IDESC * UNUSED idesc = abuf->idesc;
  2452. int cycles = 0;
  2453. {
  2454. int referenced = 0;
  2455. int UNUSED insn_referenced = abuf->written;
  2456. INT in_sr = -1;
  2457. INT in_dr = -1;
  2458. INT out_dr = -1;
  2459. in_sr = FLD (in_sr);
  2460. out_dr = FLD (out_dr);
  2461. if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
  2462. referenced |= 1 << 2;
  2463. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2464. }
  2465. return cycles;
  2466. #undef FLD
  2467. }
  2468. static int
  2469. model_m32rx_pcmpbz (SIM_CPU *current_cpu, void *sem_arg)
  2470. {
  2471. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2472. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2473. const IDESC * UNUSED idesc = abuf->idesc;
  2474. int cycles = 0;
  2475. {
  2476. int referenced = 0;
  2477. int UNUSED insn_referenced = abuf->written;
  2478. INT in_src1 = -1;
  2479. INT in_src2 = -1;
  2480. in_src2 = FLD (in_src2);
  2481. referenced |= 1 << 1;
  2482. cycles += m32rxf_model_m32rx_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2483. }
  2484. return cycles;
  2485. #undef FLD
  2486. }
  2487. static int
  2488. model_m32rx_sadd (SIM_CPU *current_cpu, void *sem_arg)
  2489. {
  2490. #define FLD(f) abuf->fields.sfmt_empty.f
  2491. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2492. const IDESC * UNUSED idesc = abuf->idesc;
  2493. int cycles = 0;
  2494. {
  2495. int referenced = 0;
  2496. int UNUSED insn_referenced = abuf->written;
  2497. INT in_src1 = -1;
  2498. INT in_src2 = -1;
  2499. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2500. }
  2501. return cycles;
  2502. #undef FLD
  2503. }
  2504. static int
  2505. model_m32rx_macwu1 (SIM_CPU *current_cpu, void *sem_arg)
  2506. {
  2507. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2508. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2509. const IDESC * UNUSED idesc = abuf->idesc;
  2510. int cycles = 0;
  2511. {
  2512. int referenced = 0;
  2513. int UNUSED insn_referenced = abuf->written;
  2514. INT in_src1 = -1;
  2515. INT in_src2 = -1;
  2516. in_src1 = FLD (in_src1);
  2517. in_src2 = FLD (in_src2);
  2518. referenced |= 1 << 0;
  2519. referenced |= 1 << 1;
  2520. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2521. }
  2522. return cycles;
  2523. #undef FLD
  2524. }
  2525. static int
  2526. model_m32rx_msblo (SIM_CPU *current_cpu, void *sem_arg)
  2527. {
  2528. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2529. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2530. const IDESC * UNUSED idesc = abuf->idesc;
  2531. int cycles = 0;
  2532. {
  2533. int referenced = 0;
  2534. int UNUSED insn_referenced = abuf->written;
  2535. INT in_src1 = -1;
  2536. INT in_src2 = -1;
  2537. in_src1 = FLD (in_src1);
  2538. in_src2 = FLD (in_src2);
  2539. referenced |= 1 << 0;
  2540. referenced |= 1 << 1;
  2541. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2542. }
  2543. return cycles;
  2544. #undef FLD
  2545. }
  2546. static int
  2547. model_m32rx_mulwu1 (SIM_CPU *current_cpu, void *sem_arg)
  2548. {
  2549. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2550. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2551. const IDESC * UNUSED idesc = abuf->idesc;
  2552. int cycles = 0;
  2553. {
  2554. int referenced = 0;
  2555. int UNUSED insn_referenced = abuf->written;
  2556. INT in_src1 = -1;
  2557. INT in_src2 = -1;
  2558. in_src1 = FLD (in_src1);
  2559. in_src2 = FLD (in_src2);
  2560. referenced |= 1 << 0;
  2561. referenced |= 1 << 1;
  2562. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2563. }
  2564. return cycles;
  2565. #undef FLD
  2566. }
  2567. static int
  2568. model_m32rx_maclh1 (SIM_CPU *current_cpu, void *sem_arg)
  2569. {
  2570. #define FLD(f) abuf->fields.sfmt_st_plus.f
  2571. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2572. const IDESC * UNUSED idesc = abuf->idesc;
  2573. int cycles = 0;
  2574. {
  2575. int referenced = 0;
  2576. int UNUSED insn_referenced = abuf->written;
  2577. INT in_src1 = -1;
  2578. INT in_src2 = -1;
  2579. in_src1 = FLD (in_src1);
  2580. in_src2 = FLD (in_src2);
  2581. referenced |= 1 << 0;
  2582. referenced |= 1 << 1;
  2583. cycles += m32rxf_model_m32rx_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
  2584. }
  2585. return cycles;
  2586. #undef FLD
  2587. }
  2588. static int
  2589. model_m32rx_sc (SIM_CPU *current_cpu, void *sem_arg)
  2590. {
  2591. #define FLD(f) abuf->fields.sfmt_empty.f
  2592. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2593. const IDESC * UNUSED idesc = abuf->idesc;
  2594. int cycles = 0;
  2595. {
  2596. int referenced = 0;
  2597. int UNUSED insn_referenced = abuf->written;
  2598. INT in_sr = -1;
  2599. INT in_dr = -1;
  2600. INT out_dr = -1;
  2601. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2602. }
  2603. return cycles;
  2604. #undef FLD
  2605. }
  2606. static int
  2607. model_m32rx_snc (SIM_CPU *current_cpu, void *sem_arg)
  2608. {
  2609. #define FLD(f) abuf->fields.sfmt_empty.f
  2610. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2611. const IDESC * UNUSED idesc = abuf->idesc;
  2612. int cycles = 0;
  2613. {
  2614. int referenced = 0;
  2615. int UNUSED insn_referenced = abuf->written;
  2616. INT in_sr = -1;
  2617. INT in_dr = -1;
  2618. INT out_dr = -1;
  2619. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2620. }
  2621. return cycles;
  2622. #undef FLD
  2623. }
  2624. static int
  2625. model_m32rx_clrpsw (SIM_CPU *current_cpu, void *sem_arg)
  2626. {
  2627. #define FLD(f) abuf->fields.sfmt_clrpsw.f
  2628. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2629. const IDESC * UNUSED idesc = abuf->idesc;
  2630. int cycles = 0;
  2631. {
  2632. int referenced = 0;
  2633. int UNUSED insn_referenced = abuf->written;
  2634. INT in_sr = -1;
  2635. INT in_dr = -1;
  2636. INT out_dr = -1;
  2637. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2638. }
  2639. return cycles;
  2640. #undef FLD
  2641. }
  2642. static int
  2643. model_m32rx_setpsw (SIM_CPU *current_cpu, void *sem_arg)
  2644. {
  2645. #define FLD(f) abuf->fields.sfmt_clrpsw.f
  2646. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2647. const IDESC * UNUSED idesc = abuf->idesc;
  2648. int cycles = 0;
  2649. {
  2650. int referenced = 0;
  2651. int UNUSED insn_referenced = abuf->written;
  2652. INT in_sr = -1;
  2653. INT in_dr = -1;
  2654. INT out_dr = -1;
  2655. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2656. }
  2657. return cycles;
  2658. #undef FLD
  2659. }
  2660. static int
  2661. model_m32rx_bset (SIM_CPU *current_cpu, void *sem_arg)
  2662. {
  2663. #define FLD(f) abuf->fields.sfmt_bset.f
  2664. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2665. const IDESC * UNUSED idesc = abuf->idesc;
  2666. int cycles = 0;
  2667. {
  2668. int referenced = 0;
  2669. int UNUSED insn_referenced = abuf->written;
  2670. INT in_sr = -1;
  2671. INT in_dr = -1;
  2672. INT out_dr = -1;
  2673. in_sr = FLD (in_sr);
  2674. referenced |= 1 << 0;
  2675. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2676. }
  2677. return cycles;
  2678. #undef FLD
  2679. }
  2680. static int
  2681. model_m32rx_bclr (SIM_CPU *current_cpu, void *sem_arg)
  2682. {
  2683. #define FLD(f) abuf->fields.sfmt_bset.f
  2684. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2685. const IDESC * UNUSED idesc = abuf->idesc;
  2686. int cycles = 0;
  2687. {
  2688. int referenced = 0;
  2689. int UNUSED insn_referenced = abuf->written;
  2690. INT in_sr = -1;
  2691. INT in_dr = -1;
  2692. INT out_dr = -1;
  2693. in_sr = FLD (in_sr);
  2694. referenced |= 1 << 0;
  2695. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2696. }
  2697. return cycles;
  2698. #undef FLD
  2699. }
  2700. static int
  2701. model_m32rx_btst (SIM_CPU *current_cpu, void *sem_arg)
  2702. {
  2703. #define FLD(f) abuf->fields.sfmt_bset.f
  2704. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  2705. const IDESC * UNUSED idesc = abuf->idesc;
  2706. int cycles = 0;
  2707. {
  2708. int referenced = 0;
  2709. int UNUSED insn_referenced = abuf->written;
  2710. INT in_sr = -1;
  2711. INT in_dr = -1;
  2712. INT out_dr = -1;
  2713. in_sr = FLD (in_sr);
  2714. referenced |= 1 << 0;
  2715. cycles += m32rxf_model_m32rx_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
  2716. }
  2717. return cycles;
  2718. #undef FLD
  2719. }
  2720. /* We assume UNIT_NONE == 0 because the tables don't always terminate
  2721. entries with it. */
  2722. /* Model timing data for `m32rx'. */
  2723. static const INSN_TIMING m32rx_timing[] = {
  2724. { M32RXF_INSN_X_INVALID, 0, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2725. { M32RXF_INSN_X_AFTER, 0, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2726. { M32RXF_INSN_X_BEFORE, 0, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2727. { M32RXF_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2728. { M32RXF_INSN_X_CHAIN, 0, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2729. { M32RXF_INSN_X_BEGIN, 0, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2730. { M32RXF_INSN_ADD, model_m32rx_add, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2731. { M32RXF_INSN_ADD3, model_m32rx_add3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2732. { M32RXF_INSN_AND, model_m32rx_and, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2733. { M32RXF_INSN_AND3, model_m32rx_and3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2734. { M32RXF_INSN_OR, model_m32rx_or, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2735. { M32RXF_INSN_OR3, model_m32rx_or3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2736. { M32RXF_INSN_XOR, model_m32rx_xor, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2737. { M32RXF_INSN_XOR3, model_m32rx_xor3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2738. { M32RXF_INSN_ADDI, model_m32rx_addi, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2739. { M32RXF_INSN_ADDV, model_m32rx_addv, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2740. { M32RXF_INSN_ADDV3, model_m32rx_addv3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2741. { M32RXF_INSN_ADDX, model_m32rx_addx, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2742. { M32RXF_INSN_BC8, model_m32rx_bc8, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2743. { M32RXF_INSN_BC24, model_m32rx_bc24, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2744. { M32RXF_INSN_BEQ, model_m32rx_beq, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2745. { M32RXF_INSN_BEQZ, model_m32rx_beqz, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2746. { M32RXF_INSN_BGEZ, model_m32rx_bgez, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2747. { M32RXF_INSN_BGTZ, model_m32rx_bgtz, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2748. { M32RXF_INSN_BLEZ, model_m32rx_blez, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2749. { M32RXF_INSN_BLTZ, model_m32rx_bltz, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2750. { M32RXF_INSN_BNEZ, model_m32rx_bnez, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2751. { M32RXF_INSN_BL8, model_m32rx_bl8, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2752. { M32RXF_INSN_BL24, model_m32rx_bl24, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2753. { M32RXF_INSN_BCL8, model_m32rx_bcl8, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2754. { M32RXF_INSN_BCL24, model_m32rx_bcl24, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2755. { M32RXF_INSN_BNC8, model_m32rx_bnc8, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2756. { M32RXF_INSN_BNC24, model_m32rx_bnc24, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2757. { M32RXF_INSN_BNE, model_m32rx_bne, { { (int) UNIT_M32RX_U_CTI, 1, 1 }, { (int) UNIT_M32RX_U_CMP, 1, 0 } } },
  2758. { M32RXF_INSN_BRA8, model_m32rx_bra8, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2759. { M32RXF_INSN_BRA24, model_m32rx_bra24, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2760. { M32RXF_INSN_BNCL8, model_m32rx_bncl8, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2761. { M32RXF_INSN_BNCL24, model_m32rx_bncl24, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2762. { M32RXF_INSN_CMP, model_m32rx_cmp, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2763. { M32RXF_INSN_CMPI, model_m32rx_cmpi, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2764. { M32RXF_INSN_CMPU, model_m32rx_cmpu, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2765. { M32RXF_INSN_CMPUI, model_m32rx_cmpui, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2766. { M32RXF_INSN_CMPEQ, model_m32rx_cmpeq, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2767. { M32RXF_INSN_CMPZ, model_m32rx_cmpz, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2768. { M32RXF_INSN_DIV, model_m32rx_div, { { (int) UNIT_M32RX_U_EXEC, 1, 37 } } },
  2769. { M32RXF_INSN_DIVU, model_m32rx_divu, { { (int) UNIT_M32RX_U_EXEC, 1, 37 } } },
  2770. { M32RXF_INSN_REM, model_m32rx_rem, { { (int) UNIT_M32RX_U_EXEC, 1, 37 } } },
  2771. { M32RXF_INSN_REMU, model_m32rx_remu, { { (int) UNIT_M32RX_U_EXEC, 1, 37 } } },
  2772. { M32RXF_INSN_DIVH, model_m32rx_divh, { { (int) UNIT_M32RX_U_EXEC, 1, 21 } } },
  2773. { M32RXF_INSN_JC, model_m32rx_jc, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2774. { M32RXF_INSN_JNC, model_m32rx_jnc, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2775. { M32RXF_INSN_JL, model_m32rx_jl, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2776. { M32RXF_INSN_JMP, model_m32rx_jmp, { { (int) UNIT_M32RX_U_CTI, 1, 1 } } },
  2777. { M32RXF_INSN_LD, model_m32rx_ld, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2778. { M32RXF_INSN_LD_D, model_m32rx_ld_d, { { (int) UNIT_M32RX_U_LOAD, 1, 2 } } },
  2779. { M32RXF_INSN_LDB, model_m32rx_ldb, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2780. { M32RXF_INSN_LDB_D, model_m32rx_ldb_d, { { (int) UNIT_M32RX_U_LOAD, 1, 2 } } },
  2781. { M32RXF_INSN_LDH, model_m32rx_ldh, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2782. { M32RXF_INSN_LDH_D, model_m32rx_ldh_d, { { (int) UNIT_M32RX_U_LOAD, 1, 2 } } },
  2783. { M32RXF_INSN_LDUB, model_m32rx_ldub, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2784. { M32RXF_INSN_LDUB_D, model_m32rx_ldub_d, { { (int) UNIT_M32RX_U_LOAD, 1, 2 } } },
  2785. { M32RXF_INSN_LDUH, model_m32rx_lduh, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2786. { M32RXF_INSN_LDUH_D, model_m32rx_lduh_d, { { (int) UNIT_M32RX_U_LOAD, 1, 2 } } },
  2787. { M32RXF_INSN_LD_PLUS, model_m32rx_ld_plus, { { (int) UNIT_M32RX_U_LOAD, 1, 1 }, { (int) UNIT_M32RX_U_EXEC, 1, 0 } } },
  2788. { M32RXF_INSN_LD24, model_m32rx_ld24, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2789. { M32RXF_INSN_LDI8, model_m32rx_ldi8, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2790. { M32RXF_INSN_LDI16, model_m32rx_ldi16, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2791. { M32RXF_INSN_LOCK, model_m32rx_lock, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2792. { M32RXF_INSN_MACHI_A, model_m32rx_machi_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2793. { M32RXF_INSN_MACLO_A, model_m32rx_maclo_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2794. { M32RXF_INSN_MACWHI_A, model_m32rx_macwhi_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2795. { M32RXF_INSN_MACWLO_A, model_m32rx_macwlo_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2796. { M32RXF_INSN_MUL, model_m32rx_mul, { { (int) UNIT_M32RX_U_EXEC, 1, 4 } } },
  2797. { M32RXF_INSN_MULHI_A, model_m32rx_mulhi_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2798. { M32RXF_INSN_MULLO_A, model_m32rx_mullo_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2799. { M32RXF_INSN_MULWHI_A, model_m32rx_mulwhi_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2800. { M32RXF_INSN_MULWLO_A, model_m32rx_mulwlo_a, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2801. { M32RXF_INSN_MV, model_m32rx_mv, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2802. { M32RXF_INSN_MVFACHI_A, model_m32rx_mvfachi_a, { { (int) UNIT_M32RX_U_EXEC, 1, 2 } } },
  2803. { M32RXF_INSN_MVFACLO_A, model_m32rx_mvfaclo_a, { { (int) UNIT_M32RX_U_EXEC, 1, 2 } } },
  2804. { M32RXF_INSN_MVFACMI_A, model_m32rx_mvfacmi_a, { { (int) UNIT_M32RX_U_EXEC, 1, 2 } } },
  2805. { M32RXF_INSN_MVFC, model_m32rx_mvfc, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2806. { M32RXF_INSN_MVTACHI_A, model_m32rx_mvtachi_a, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2807. { M32RXF_INSN_MVTACLO_A, model_m32rx_mvtaclo_a, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2808. { M32RXF_INSN_MVTC, model_m32rx_mvtc, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2809. { M32RXF_INSN_NEG, model_m32rx_neg, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2810. { M32RXF_INSN_NOP, model_m32rx_nop, { { (int) UNIT_M32RX_U_EXEC, 1, 0 } } },
  2811. { M32RXF_INSN_NOT, model_m32rx_not, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2812. { M32RXF_INSN_RAC_DSI, model_m32rx_rac_dsi, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2813. { M32RXF_INSN_RACH_DSI, model_m32rx_rach_dsi, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2814. { M32RXF_INSN_RTE, model_m32rx_rte, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2815. { M32RXF_INSN_SETH, model_m32rx_seth, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2816. { M32RXF_INSN_SLL, model_m32rx_sll, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2817. { M32RXF_INSN_SLL3, model_m32rx_sll3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2818. { M32RXF_INSN_SLLI, model_m32rx_slli, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2819. { M32RXF_INSN_SRA, model_m32rx_sra, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2820. { M32RXF_INSN_SRA3, model_m32rx_sra3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2821. { M32RXF_INSN_SRAI, model_m32rx_srai, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2822. { M32RXF_INSN_SRL, model_m32rx_srl, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2823. { M32RXF_INSN_SRL3, model_m32rx_srl3, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2824. { M32RXF_INSN_SRLI, model_m32rx_srli, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2825. { M32RXF_INSN_ST, model_m32rx_st, { { (int) UNIT_M32RX_U_STORE, 1, 1 } } },
  2826. { M32RXF_INSN_ST_D, model_m32rx_st_d, { { (int) UNIT_M32RX_U_STORE, 1, 2 } } },
  2827. { M32RXF_INSN_STB, model_m32rx_stb, { { (int) UNIT_M32RX_U_STORE, 1, 1 } } },
  2828. { M32RXF_INSN_STB_D, model_m32rx_stb_d, { { (int) UNIT_M32RX_U_STORE, 1, 2 } } },
  2829. { M32RXF_INSN_STH, model_m32rx_sth, { { (int) UNIT_M32RX_U_STORE, 1, 1 } } },
  2830. { M32RXF_INSN_STH_D, model_m32rx_sth_d, { { (int) UNIT_M32RX_U_STORE, 1, 2 } } },
  2831. { M32RXF_INSN_ST_PLUS, model_m32rx_st_plus, { { (int) UNIT_M32RX_U_STORE, 1, 1 }, { (int) UNIT_M32RX_U_EXEC, 1, 0 } } },
  2832. { M32RXF_INSN_STH_PLUS, model_m32rx_sth_plus, { { (int) UNIT_M32RX_U_STORE, 1, 1 }, { (int) UNIT_M32RX_U_EXEC, 1, 0 } } },
  2833. { M32RXF_INSN_STB_PLUS, model_m32rx_stb_plus, { { (int) UNIT_M32RX_U_STORE, 1, 1 }, { (int) UNIT_M32RX_U_EXEC, 1, 0 } } },
  2834. { M32RXF_INSN_ST_MINUS, model_m32rx_st_minus, { { (int) UNIT_M32RX_U_STORE, 1, 1 }, { (int) UNIT_M32RX_U_EXEC, 1, 0 } } },
  2835. { M32RXF_INSN_SUB, model_m32rx_sub, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2836. { M32RXF_INSN_SUBV, model_m32rx_subv, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2837. { M32RXF_INSN_SUBX, model_m32rx_subx, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2838. { M32RXF_INSN_TRAP, model_m32rx_trap, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2839. { M32RXF_INSN_UNLOCK, model_m32rx_unlock, { { (int) UNIT_M32RX_U_LOAD, 1, 1 } } },
  2840. { M32RXF_INSN_SATB, model_m32rx_satb, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2841. { M32RXF_INSN_SATH, model_m32rx_sath, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2842. { M32RXF_INSN_SAT, model_m32rx_sat, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2843. { M32RXF_INSN_PCMPBZ, model_m32rx_pcmpbz, { { (int) UNIT_M32RX_U_CMP, 1, 1 } } },
  2844. { M32RXF_INSN_SADD, model_m32rx_sadd, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2845. { M32RXF_INSN_MACWU1, model_m32rx_macwu1, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2846. { M32RXF_INSN_MSBLO, model_m32rx_msblo, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2847. { M32RXF_INSN_MULWU1, model_m32rx_mulwu1, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2848. { M32RXF_INSN_MACLH1, model_m32rx_maclh1, { { (int) UNIT_M32RX_U_MAC, 1, 1 } } },
  2849. { M32RXF_INSN_SC, model_m32rx_sc, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2850. { M32RXF_INSN_SNC, model_m32rx_snc, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2851. { M32RXF_INSN_CLRPSW, model_m32rx_clrpsw, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2852. { M32RXF_INSN_SETPSW, model_m32rx_setpsw, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2853. { M32RXF_INSN_BSET, model_m32rx_bset, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2854. { M32RXF_INSN_BCLR, model_m32rx_bclr, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2855. { M32RXF_INSN_BTST, model_m32rx_btst, { { (int) UNIT_M32RX_U_EXEC, 1, 1 } } },
  2856. };
  2857. #endif /* WITH_PROFILE_MODEL_P */
  2858. static void
  2859. m32rx_model_init (SIM_CPU *cpu)
  2860. {
  2861. CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_M32RX_DATA));
  2862. }
  2863. #if WITH_PROFILE_MODEL_P
  2864. #define TIMING_DATA(td) td
  2865. #else
  2866. #define TIMING_DATA(td) 0
  2867. #endif
  2868. static const MODEL m32rx_models[] =
  2869. {
  2870. { "m32rx", & m32rx_mach, MODEL_M32RX, TIMING_DATA (& m32rx_timing[0]), m32rx_model_init },
  2871. { 0 }
  2872. };
  2873. /* The properties of this cpu's implementation. */
  2874. static const MACH_IMP_PROPERTIES m32rxf_imp_properties =
  2875. {
  2876. sizeof (SIM_CPU),
  2877. #if WITH_SCACHE
  2878. sizeof (SCACHE)
  2879. #else
  2880. 0
  2881. #endif
  2882. };
  2883. static void
  2884. m32rxf_prepare_run (SIM_CPU *cpu)
  2885. {
  2886. if (CPU_IDESC (cpu) == NULL)
  2887. m32rxf_init_idesc_table (cpu);
  2888. }
  2889. static const CGEN_INSN *
  2890. m32rxf_get_idata (SIM_CPU *cpu, int inum)
  2891. {
  2892. return CPU_IDESC (cpu) [inum].idata;
  2893. }
  2894. static void
  2895. m32rx_init_cpu (SIM_CPU *cpu)
  2896. {
  2897. CPU_REG_FETCH (cpu) = m32rxf_fetch_register;
  2898. CPU_REG_STORE (cpu) = m32rxf_store_register;
  2899. CPU_PC_FETCH (cpu) = m32rxf_h_pc_get;
  2900. CPU_PC_STORE (cpu) = m32rxf_h_pc_set;
  2901. CPU_GET_IDATA (cpu) = m32rxf_get_idata;
  2902. CPU_MAX_INSNS (cpu) = M32RXF_INSN__MAX;
  2903. CPU_INSN_NAME (cpu) = cgen_insn_name;
  2904. CPU_FULL_ENGINE_FN (cpu) = m32rxf_engine_run_full;
  2905. #if WITH_FAST
  2906. CPU_FAST_ENGINE_FN (cpu) = m32rxf_engine_run_fast;
  2907. #else
  2908. CPU_FAST_ENGINE_FN (cpu) = m32rxf_engine_run_full;
  2909. #endif
  2910. }
  2911. const MACH m32rx_mach =
  2912. {
  2913. "m32rx", "m32rx", MACH_M32RX,
  2914. 32, 32, & m32rx_models[0], & m32rxf_imp_properties,
  2915. m32rx_init_cpu,
  2916. m32rxf_prepare_run
  2917. };