model.c 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. /* Simulator model support for lm32bf.
  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 lm32bf
  17. #define WANT_CPU_LM32BF
  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_lm32_add (SIM_CPU *current_cpu, void *sem_arg)
  25. {
  26. #define FLD(f) abuf->fields.sfmt_user.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. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  34. }
  35. return cycles;
  36. #undef FLD
  37. }
  38. static int
  39. model_lm32_addi (SIM_CPU *current_cpu, void *sem_arg)
  40. {
  41. #define FLD(f) abuf->fields.sfmt_addi.f
  42. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  43. const IDESC * UNUSED idesc = abuf->idesc;
  44. int cycles = 0;
  45. {
  46. int referenced = 0;
  47. int UNUSED insn_referenced = abuf->written;
  48. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  49. }
  50. return cycles;
  51. #undef FLD
  52. }
  53. static int
  54. model_lm32_and (SIM_CPU *current_cpu, void *sem_arg)
  55. {
  56. #define FLD(f) abuf->fields.sfmt_user.f
  57. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  58. const IDESC * UNUSED idesc = abuf->idesc;
  59. int cycles = 0;
  60. {
  61. int referenced = 0;
  62. int UNUSED insn_referenced = abuf->written;
  63. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  64. }
  65. return cycles;
  66. #undef FLD
  67. }
  68. static int
  69. model_lm32_andi (SIM_CPU *current_cpu, void *sem_arg)
  70. {
  71. #define FLD(f) abuf->fields.sfmt_andi.f
  72. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  73. const IDESC * UNUSED idesc = abuf->idesc;
  74. int cycles = 0;
  75. {
  76. int referenced = 0;
  77. int UNUSED insn_referenced = abuf->written;
  78. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  79. }
  80. return cycles;
  81. #undef FLD
  82. }
  83. static int
  84. model_lm32_andhii (SIM_CPU *current_cpu, void *sem_arg)
  85. {
  86. #define FLD(f) abuf->fields.sfmt_andi.f
  87. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  88. const IDESC * UNUSED idesc = abuf->idesc;
  89. int cycles = 0;
  90. {
  91. int referenced = 0;
  92. int UNUSED insn_referenced = abuf->written;
  93. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  94. }
  95. return cycles;
  96. #undef FLD
  97. }
  98. static int
  99. model_lm32_b (SIM_CPU *current_cpu, void *sem_arg)
  100. {
  101. #define FLD(f) abuf->fields.sfmt_be.f
  102. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  103. const IDESC * UNUSED idesc = abuf->idesc;
  104. int cycles = 0;
  105. {
  106. int referenced = 0;
  107. int UNUSED insn_referenced = abuf->written;
  108. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  109. }
  110. return cycles;
  111. #undef FLD
  112. }
  113. static int
  114. model_lm32_bi (SIM_CPU *current_cpu, void *sem_arg)
  115. {
  116. #define FLD(f) abuf->fields.sfmt_bi.f
  117. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  118. const IDESC * UNUSED idesc = abuf->idesc;
  119. int cycles = 0;
  120. {
  121. int referenced = 0;
  122. int UNUSED insn_referenced = abuf->written;
  123. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  124. }
  125. return cycles;
  126. #undef FLD
  127. }
  128. static int
  129. model_lm32_be (SIM_CPU *current_cpu, void *sem_arg)
  130. {
  131. #define FLD(f) abuf->fields.sfmt_be.f
  132. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  133. const IDESC * UNUSED idesc = abuf->idesc;
  134. int cycles = 0;
  135. {
  136. int referenced = 0;
  137. int UNUSED insn_referenced = abuf->written;
  138. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  139. }
  140. return cycles;
  141. #undef FLD
  142. }
  143. static int
  144. model_lm32_bg (SIM_CPU *current_cpu, void *sem_arg)
  145. {
  146. #define FLD(f) abuf->fields.sfmt_be.f
  147. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  148. const IDESC * UNUSED idesc = abuf->idesc;
  149. int cycles = 0;
  150. {
  151. int referenced = 0;
  152. int UNUSED insn_referenced = abuf->written;
  153. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  154. }
  155. return cycles;
  156. #undef FLD
  157. }
  158. static int
  159. model_lm32_bge (SIM_CPU *current_cpu, void *sem_arg)
  160. {
  161. #define FLD(f) abuf->fields.sfmt_be.f
  162. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  163. const IDESC * UNUSED idesc = abuf->idesc;
  164. int cycles = 0;
  165. {
  166. int referenced = 0;
  167. int UNUSED insn_referenced = abuf->written;
  168. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  169. }
  170. return cycles;
  171. #undef FLD
  172. }
  173. static int
  174. model_lm32_bgeu (SIM_CPU *current_cpu, void *sem_arg)
  175. {
  176. #define FLD(f) abuf->fields.sfmt_be.f
  177. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  178. const IDESC * UNUSED idesc = abuf->idesc;
  179. int cycles = 0;
  180. {
  181. int referenced = 0;
  182. int UNUSED insn_referenced = abuf->written;
  183. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  184. }
  185. return cycles;
  186. #undef FLD
  187. }
  188. static int
  189. model_lm32_bgu (SIM_CPU *current_cpu, void *sem_arg)
  190. {
  191. #define FLD(f) abuf->fields.sfmt_be.f
  192. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  193. const IDESC * UNUSED idesc = abuf->idesc;
  194. int cycles = 0;
  195. {
  196. int referenced = 0;
  197. int UNUSED insn_referenced = abuf->written;
  198. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  199. }
  200. return cycles;
  201. #undef FLD
  202. }
  203. static int
  204. model_lm32_bne (SIM_CPU *current_cpu, void *sem_arg)
  205. {
  206. #define FLD(f) abuf->fields.sfmt_be.f
  207. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  208. const IDESC * UNUSED idesc = abuf->idesc;
  209. int cycles = 0;
  210. {
  211. int referenced = 0;
  212. int UNUSED insn_referenced = abuf->written;
  213. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  214. }
  215. return cycles;
  216. #undef FLD
  217. }
  218. static int
  219. model_lm32_call (SIM_CPU *current_cpu, void *sem_arg)
  220. {
  221. #define FLD(f) abuf->fields.sfmt_be.f
  222. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  223. const IDESC * UNUSED idesc = abuf->idesc;
  224. int cycles = 0;
  225. {
  226. int referenced = 0;
  227. int UNUSED insn_referenced = abuf->written;
  228. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  229. }
  230. return cycles;
  231. #undef FLD
  232. }
  233. static int
  234. model_lm32_calli (SIM_CPU *current_cpu, void *sem_arg)
  235. {
  236. #define FLD(f) abuf->fields.sfmt_bi.f
  237. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  238. const IDESC * UNUSED idesc = abuf->idesc;
  239. int cycles = 0;
  240. {
  241. int referenced = 0;
  242. int UNUSED insn_referenced = abuf->written;
  243. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  244. }
  245. return cycles;
  246. #undef FLD
  247. }
  248. static int
  249. model_lm32_cmpe (SIM_CPU *current_cpu, void *sem_arg)
  250. {
  251. #define FLD(f) abuf->fields.sfmt_user.f
  252. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  253. const IDESC * UNUSED idesc = abuf->idesc;
  254. int cycles = 0;
  255. {
  256. int referenced = 0;
  257. int UNUSED insn_referenced = abuf->written;
  258. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  259. }
  260. return cycles;
  261. #undef FLD
  262. }
  263. static int
  264. model_lm32_cmpei (SIM_CPU *current_cpu, void *sem_arg)
  265. {
  266. #define FLD(f) abuf->fields.sfmt_addi.f
  267. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  268. const IDESC * UNUSED idesc = abuf->idesc;
  269. int cycles = 0;
  270. {
  271. int referenced = 0;
  272. int UNUSED insn_referenced = abuf->written;
  273. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  274. }
  275. return cycles;
  276. #undef FLD
  277. }
  278. static int
  279. model_lm32_cmpg (SIM_CPU *current_cpu, void *sem_arg)
  280. {
  281. #define FLD(f) abuf->fields.sfmt_user.f
  282. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  283. const IDESC * UNUSED idesc = abuf->idesc;
  284. int cycles = 0;
  285. {
  286. int referenced = 0;
  287. int UNUSED insn_referenced = abuf->written;
  288. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  289. }
  290. return cycles;
  291. #undef FLD
  292. }
  293. static int
  294. model_lm32_cmpgi (SIM_CPU *current_cpu, void *sem_arg)
  295. {
  296. #define FLD(f) abuf->fields.sfmt_addi.f
  297. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  298. const IDESC * UNUSED idesc = abuf->idesc;
  299. int cycles = 0;
  300. {
  301. int referenced = 0;
  302. int UNUSED insn_referenced = abuf->written;
  303. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  304. }
  305. return cycles;
  306. #undef FLD
  307. }
  308. static int
  309. model_lm32_cmpge (SIM_CPU *current_cpu, void *sem_arg)
  310. {
  311. #define FLD(f) abuf->fields.sfmt_user.f
  312. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  313. const IDESC * UNUSED idesc = abuf->idesc;
  314. int cycles = 0;
  315. {
  316. int referenced = 0;
  317. int UNUSED insn_referenced = abuf->written;
  318. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  319. }
  320. return cycles;
  321. #undef FLD
  322. }
  323. static int
  324. model_lm32_cmpgei (SIM_CPU *current_cpu, void *sem_arg)
  325. {
  326. #define FLD(f) abuf->fields.sfmt_addi.f
  327. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  328. const IDESC * UNUSED idesc = abuf->idesc;
  329. int cycles = 0;
  330. {
  331. int referenced = 0;
  332. int UNUSED insn_referenced = abuf->written;
  333. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  334. }
  335. return cycles;
  336. #undef FLD
  337. }
  338. static int
  339. model_lm32_cmpgeu (SIM_CPU *current_cpu, void *sem_arg)
  340. {
  341. #define FLD(f) abuf->fields.sfmt_user.f
  342. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  343. const IDESC * UNUSED idesc = abuf->idesc;
  344. int cycles = 0;
  345. {
  346. int referenced = 0;
  347. int UNUSED insn_referenced = abuf->written;
  348. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  349. }
  350. return cycles;
  351. #undef FLD
  352. }
  353. static int
  354. model_lm32_cmpgeui (SIM_CPU *current_cpu, void *sem_arg)
  355. {
  356. #define FLD(f) abuf->fields.sfmt_andi.f
  357. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  358. const IDESC * UNUSED idesc = abuf->idesc;
  359. int cycles = 0;
  360. {
  361. int referenced = 0;
  362. int UNUSED insn_referenced = abuf->written;
  363. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  364. }
  365. return cycles;
  366. #undef FLD
  367. }
  368. static int
  369. model_lm32_cmpgu (SIM_CPU *current_cpu, void *sem_arg)
  370. {
  371. #define FLD(f) abuf->fields.sfmt_user.f
  372. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  373. const IDESC * UNUSED idesc = abuf->idesc;
  374. int cycles = 0;
  375. {
  376. int referenced = 0;
  377. int UNUSED insn_referenced = abuf->written;
  378. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  379. }
  380. return cycles;
  381. #undef FLD
  382. }
  383. static int
  384. model_lm32_cmpgui (SIM_CPU *current_cpu, void *sem_arg)
  385. {
  386. #define FLD(f) abuf->fields.sfmt_andi.f
  387. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  388. const IDESC * UNUSED idesc = abuf->idesc;
  389. int cycles = 0;
  390. {
  391. int referenced = 0;
  392. int UNUSED insn_referenced = abuf->written;
  393. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  394. }
  395. return cycles;
  396. #undef FLD
  397. }
  398. static int
  399. model_lm32_cmpne (SIM_CPU *current_cpu, void *sem_arg)
  400. {
  401. #define FLD(f) abuf->fields.sfmt_user.f
  402. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  403. const IDESC * UNUSED idesc = abuf->idesc;
  404. int cycles = 0;
  405. {
  406. int referenced = 0;
  407. int UNUSED insn_referenced = abuf->written;
  408. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  409. }
  410. return cycles;
  411. #undef FLD
  412. }
  413. static int
  414. model_lm32_cmpnei (SIM_CPU *current_cpu, void *sem_arg)
  415. {
  416. #define FLD(f) abuf->fields.sfmt_addi.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. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  424. }
  425. return cycles;
  426. #undef FLD
  427. }
  428. static int
  429. model_lm32_divu (SIM_CPU *current_cpu, void *sem_arg)
  430. {
  431. #define FLD(f) abuf->fields.sfmt_user.f
  432. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  433. const IDESC * UNUSED idesc = abuf->idesc;
  434. int cycles = 0;
  435. {
  436. int referenced = 0;
  437. int UNUSED insn_referenced = abuf->written;
  438. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  439. }
  440. return cycles;
  441. #undef FLD
  442. }
  443. static int
  444. model_lm32_lb (SIM_CPU *current_cpu, void *sem_arg)
  445. {
  446. #define FLD(f) abuf->fields.sfmt_addi.f
  447. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  448. const IDESC * UNUSED idesc = abuf->idesc;
  449. int cycles = 0;
  450. {
  451. int referenced = 0;
  452. int UNUSED insn_referenced = abuf->written;
  453. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  454. }
  455. return cycles;
  456. #undef FLD
  457. }
  458. static int
  459. model_lm32_lbu (SIM_CPU *current_cpu, void *sem_arg)
  460. {
  461. #define FLD(f) abuf->fields.sfmt_addi.f
  462. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  463. const IDESC * UNUSED idesc = abuf->idesc;
  464. int cycles = 0;
  465. {
  466. int referenced = 0;
  467. int UNUSED insn_referenced = abuf->written;
  468. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  469. }
  470. return cycles;
  471. #undef FLD
  472. }
  473. static int
  474. model_lm32_lh (SIM_CPU *current_cpu, void *sem_arg)
  475. {
  476. #define FLD(f) abuf->fields.sfmt_addi.f
  477. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  478. const IDESC * UNUSED idesc = abuf->idesc;
  479. int cycles = 0;
  480. {
  481. int referenced = 0;
  482. int UNUSED insn_referenced = abuf->written;
  483. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  484. }
  485. return cycles;
  486. #undef FLD
  487. }
  488. static int
  489. model_lm32_lhu (SIM_CPU *current_cpu, void *sem_arg)
  490. {
  491. #define FLD(f) abuf->fields.sfmt_addi.f
  492. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  493. const IDESC * UNUSED idesc = abuf->idesc;
  494. int cycles = 0;
  495. {
  496. int referenced = 0;
  497. int UNUSED insn_referenced = abuf->written;
  498. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  499. }
  500. return cycles;
  501. #undef FLD
  502. }
  503. static int
  504. model_lm32_lw (SIM_CPU *current_cpu, void *sem_arg)
  505. {
  506. #define FLD(f) abuf->fields.sfmt_addi.f
  507. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  508. const IDESC * UNUSED idesc = abuf->idesc;
  509. int cycles = 0;
  510. {
  511. int referenced = 0;
  512. int UNUSED insn_referenced = abuf->written;
  513. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  514. }
  515. return cycles;
  516. #undef FLD
  517. }
  518. static int
  519. model_lm32_modu (SIM_CPU *current_cpu, void *sem_arg)
  520. {
  521. #define FLD(f) abuf->fields.sfmt_user.f
  522. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  523. const IDESC * UNUSED idesc = abuf->idesc;
  524. int cycles = 0;
  525. {
  526. int referenced = 0;
  527. int UNUSED insn_referenced = abuf->written;
  528. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  529. }
  530. return cycles;
  531. #undef FLD
  532. }
  533. static int
  534. model_lm32_mul (SIM_CPU *current_cpu, void *sem_arg)
  535. {
  536. #define FLD(f) abuf->fields.sfmt_user.f
  537. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  538. const IDESC * UNUSED idesc = abuf->idesc;
  539. int cycles = 0;
  540. {
  541. int referenced = 0;
  542. int UNUSED insn_referenced = abuf->written;
  543. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  544. }
  545. return cycles;
  546. #undef FLD
  547. }
  548. static int
  549. model_lm32_muli (SIM_CPU *current_cpu, void *sem_arg)
  550. {
  551. #define FLD(f) abuf->fields.sfmt_addi.f
  552. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  553. const IDESC * UNUSED idesc = abuf->idesc;
  554. int cycles = 0;
  555. {
  556. int referenced = 0;
  557. int UNUSED insn_referenced = abuf->written;
  558. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  559. }
  560. return cycles;
  561. #undef FLD
  562. }
  563. static int
  564. model_lm32_nor (SIM_CPU *current_cpu, void *sem_arg)
  565. {
  566. #define FLD(f) abuf->fields.sfmt_user.f
  567. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  568. const IDESC * UNUSED idesc = abuf->idesc;
  569. int cycles = 0;
  570. {
  571. int referenced = 0;
  572. int UNUSED insn_referenced = abuf->written;
  573. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  574. }
  575. return cycles;
  576. #undef FLD
  577. }
  578. static int
  579. model_lm32_nori (SIM_CPU *current_cpu, void *sem_arg)
  580. {
  581. #define FLD(f) abuf->fields.sfmt_andi.f
  582. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  583. const IDESC * UNUSED idesc = abuf->idesc;
  584. int cycles = 0;
  585. {
  586. int referenced = 0;
  587. int UNUSED insn_referenced = abuf->written;
  588. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  589. }
  590. return cycles;
  591. #undef FLD
  592. }
  593. static int
  594. model_lm32_or (SIM_CPU *current_cpu, void *sem_arg)
  595. {
  596. #define FLD(f) abuf->fields.sfmt_user.f
  597. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  598. const IDESC * UNUSED idesc = abuf->idesc;
  599. int cycles = 0;
  600. {
  601. int referenced = 0;
  602. int UNUSED insn_referenced = abuf->written;
  603. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  604. }
  605. return cycles;
  606. #undef FLD
  607. }
  608. static int
  609. model_lm32_ori (SIM_CPU *current_cpu, void *sem_arg)
  610. {
  611. #define FLD(f) abuf->fields.sfmt_andi.f
  612. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  613. const IDESC * UNUSED idesc = abuf->idesc;
  614. int cycles = 0;
  615. {
  616. int referenced = 0;
  617. int UNUSED insn_referenced = abuf->written;
  618. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  619. }
  620. return cycles;
  621. #undef FLD
  622. }
  623. static int
  624. model_lm32_orhii (SIM_CPU *current_cpu, void *sem_arg)
  625. {
  626. #define FLD(f) abuf->fields.sfmt_andi.f
  627. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  628. const IDESC * UNUSED idesc = abuf->idesc;
  629. int cycles = 0;
  630. {
  631. int referenced = 0;
  632. int UNUSED insn_referenced = abuf->written;
  633. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  634. }
  635. return cycles;
  636. #undef FLD
  637. }
  638. static int
  639. model_lm32_rcsr (SIM_CPU *current_cpu, void *sem_arg)
  640. {
  641. #define FLD(f) abuf->fields.sfmt_rcsr.f
  642. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  643. const IDESC * UNUSED idesc = abuf->idesc;
  644. int cycles = 0;
  645. {
  646. int referenced = 0;
  647. int UNUSED insn_referenced = abuf->written;
  648. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  649. }
  650. return cycles;
  651. #undef FLD
  652. }
  653. static int
  654. model_lm32_sb (SIM_CPU *current_cpu, void *sem_arg)
  655. {
  656. #define FLD(f) abuf->fields.sfmt_addi.f
  657. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  658. const IDESC * UNUSED idesc = abuf->idesc;
  659. int cycles = 0;
  660. {
  661. int referenced = 0;
  662. int UNUSED insn_referenced = abuf->written;
  663. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  664. }
  665. return cycles;
  666. #undef FLD
  667. }
  668. static int
  669. model_lm32_sextb (SIM_CPU *current_cpu, void *sem_arg)
  670. {
  671. #define FLD(f) abuf->fields.sfmt_user.f
  672. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  673. const IDESC * UNUSED idesc = abuf->idesc;
  674. int cycles = 0;
  675. {
  676. int referenced = 0;
  677. int UNUSED insn_referenced = abuf->written;
  678. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  679. }
  680. return cycles;
  681. #undef FLD
  682. }
  683. static int
  684. model_lm32_sexth (SIM_CPU *current_cpu, void *sem_arg)
  685. {
  686. #define FLD(f) abuf->fields.sfmt_user.f
  687. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  688. const IDESC * UNUSED idesc = abuf->idesc;
  689. int cycles = 0;
  690. {
  691. int referenced = 0;
  692. int UNUSED insn_referenced = abuf->written;
  693. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  694. }
  695. return cycles;
  696. #undef FLD
  697. }
  698. static int
  699. model_lm32_sh (SIM_CPU *current_cpu, void *sem_arg)
  700. {
  701. #define FLD(f) abuf->fields.sfmt_addi.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. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  709. }
  710. return cycles;
  711. #undef FLD
  712. }
  713. static int
  714. model_lm32_sl (SIM_CPU *current_cpu, void *sem_arg)
  715. {
  716. #define FLD(f) abuf->fields.sfmt_user.f
  717. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  718. const IDESC * UNUSED idesc = abuf->idesc;
  719. int cycles = 0;
  720. {
  721. int referenced = 0;
  722. int UNUSED insn_referenced = abuf->written;
  723. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  724. }
  725. return cycles;
  726. #undef FLD
  727. }
  728. static int
  729. model_lm32_sli (SIM_CPU *current_cpu, void *sem_arg)
  730. {
  731. #define FLD(f) abuf->fields.sfmt_addi.f
  732. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  733. const IDESC * UNUSED idesc = abuf->idesc;
  734. int cycles = 0;
  735. {
  736. int referenced = 0;
  737. int UNUSED insn_referenced = abuf->written;
  738. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  739. }
  740. return cycles;
  741. #undef FLD
  742. }
  743. static int
  744. model_lm32_sr (SIM_CPU *current_cpu, void *sem_arg)
  745. {
  746. #define FLD(f) abuf->fields.sfmt_user.f
  747. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  748. const IDESC * UNUSED idesc = abuf->idesc;
  749. int cycles = 0;
  750. {
  751. int referenced = 0;
  752. int UNUSED insn_referenced = abuf->written;
  753. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  754. }
  755. return cycles;
  756. #undef FLD
  757. }
  758. static int
  759. model_lm32_sri (SIM_CPU *current_cpu, void *sem_arg)
  760. {
  761. #define FLD(f) abuf->fields.sfmt_addi.f
  762. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  763. const IDESC * UNUSED idesc = abuf->idesc;
  764. int cycles = 0;
  765. {
  766. int referenced = 0;
  767. int UNUSED insn_referenced = abuf->written;
  768. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  769. }
  770. return cycles;
  771. #undef FLD
  772. }
  773. static int
  774. model_lm32_sru (SIM_CPU *current_cpu, void *sem_arg)
  775. {
  776. #define FLD(f) abuf->fields.sfmt_user.f
  777. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  778. const IDESC * UNUSED idesc = abuf->idesc;
  779. int cycles = 0;
  780. {
  781. int referenced = 0;
  782. int UNUSED insn_referenced = abuf->written;
  783. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  784. }
  785. return cycles;
  786. #undef FLD
  787. }
  788. static int
  789. model_lm32_srui (SIM_CPU *current_cpu, void *sem_arg)
  790. {
  791. #define FLD(f) abuf->fields.sfmt_addi.f
  792. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  793. const IDESC * UNUSED idesc = abuf->idesc;
  794. int cycles = 0;
  795. {
  796. int referenced = 0;
  797. int UNUSED insn_referenced = abuf->written;
  798. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  799. }
  800. return cycles;
  801. #undef FLD
  802. }
  803. static int
  804. model_lm32_sub (SIM_CPU *current_cpu, void *sem_arg)
  805. {
  806. #define FLD(f) abuf->fields.sfmt_user.f
  807. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  808. const IDESC * UNUSED idesc = abuf->idesc;
  809. int cycles = 0;
  810. {
  811. int referenced = 0;
  812. int UNUSED insn_referenced = abuf->written;
  813. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  814. }
  815. return cycles;
  816. #undef FLD
  817. }
  818. static int
  819. model_lm32_sw (SIM_CPU *current_cpu, void *sem_arg)
  820. {
  821. #define FLD(f) abuf->fields.sfmt_addi.f
  822. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  823. const IDESC * UNUSED idesc = abuf->idesc;
  824. int cycles = 0;
  825. {
  826. int referenced = 0;
  827. int UNUSED insn_referenced = abuf->written;
  828. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  829. }
  830. return cycles;
  831. #undef FLD
  832. }
  833. static int
  834. model_lm32_user (SIM_CPU *current_cpu, void *sem_arg)
  835. {
  836. #define FLD(f) abuf->fields.sfmt_user.f
  837. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  838. const IDESC * UNUSED idesc = abuf->idesc;
  839. int cycles = 0;
  840. {
  841. int referenced = 0;
  842. int UNUSED insn_referenced = abuf->written;
  843. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  844. }
  845. return cycles;
  846. #undef FLD
  847. }
  848. static int
  849. model_lm32_wcsr (SIM_CPU *current_cpu, void *sem_arg)
  850. {
  851. #define FLD(f) abuf->fields.sfmt_wcsr.f
  852. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  853. const IDESC * UNUSED idesc = abuf->idesc;
  854. int cycles = 0;
  855. {
  856. int referenced = 0;
  857. int UNUSED insn_referenced = abuf->written;
  858. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  859. }
  860. return cycles;
  861. #undef FLD
  862. }
  863. static int
  864. model_lm32_xor (SIM_CPU *current_cpu, void *sem_arg)
  865. {
  866. #define FLD(f) abuf->fields.sfmt_user.f
  867. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  868. const IDESC * UNUSED idesc = abuf->idesc;
  869. int cycles = 0;
  870. {
  871. int referenced = 0;
  872. int UNUSED insn_referenced = abuf->written;
  873. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  874. }
  875. return cycles;
  876. #undef FLD
  877. }
  878. static int
  879. model_lm32_xori (SIM_CPU *current_cpu, void *sem_arg)
  880. {
  881. #define FLD(f) abuf->fields.sfmt_andi.f
  882. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  883. const IDESC * UNUSED idesc = abuf->idesc;
  884. int cycles = 0;
  885. {
  886. int referenced = 0;
  887. int UNUSED insn_referenced = abuf->written;
  888. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  889. }
  890. return cycles;
  891. #undef FLD
  892. }
  893. static int
  894. model_lm32_xnor (SIM_CPU *current_cpu, void *sem_arg)
  895. {
  896. #define FLD(f) abuf->fields.sfmt_user.f
  897. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  898. const IDESC * UNUSED idesc = abuf->idesc;
  899. int cycles = 0;
  900. {
  901. int referenced = 0;
  902. int UNUSED insn_referenced = abuf->written;
  903. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  904. }
  905. return cycles;
  906. #undef FLD
  907. }
  908. static int
  909. model_lm32_xnori (SIM_CPU *current_cpu, void *sem_arg)
  910. {
  911. #define FLD(f) abuf->fields.sfmt_andi.f
  912. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  913. const IDESC * UNUSED idesc = abuf->idesc;
  914. int cycles = 0;
  915. {
  916. int referenced = 0;
  917. int UNUSED insn_referenced = abuf->written;
  918. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  919. }
  920. return cycles;
  921. #undef FLD
  922. }
  923. static int
  924. model_lm32_break (SIM_CPU *current_cpu, void *sem_arg)
  925. {
  926. #define FLD(f) abuf->fields.sfmt_empty.f
  927. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  928. const IDESC * UNUSED idesc = abuf->idesc;
  929. int cycles = 0;
  930. {
  931. int referenced = 0;
  932. int UNUSED insn_referenced = abuf->written;
  933. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  934. }
  935. return cycles;
  936. #undef FLD
  937. }
  938. static int
  939. model_lm32_scall (SIM_CPU *current_cpu, void *sem_arg)
  940. {
  941. #define FLD(f) abuf->fields.sfmt_empty.f
  942. const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
  943. const IDESC * UNUSED idesc = abuf->idesc;
  944. int cycles = 0;
  945. {
  946. int referenced = 0;
  947. int UNUSED insn_referenced = abuf->written;
  948. cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
  949. }
  950. return cycles;
  951. #undef FLD
  952. }
  953. /* We assume UNIT_NONE == 0 because the tables don't always terminate
  954. entries with it. */
  955. /* Model timing data for `lm32'. */
  956. static const INSN_TIMING lm32_timing[] = {
  957. { LM32BF_INSN_X_INVALID, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  958. { LM32BF_INSN_X_AFTER, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  959. { LM32BF_INSN_X_BEFORE, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  960. { LM32BF_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  961. { LM32BF_INSN_X_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  962. { LM32BF_INSN_X_BEGIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  963. { LM32BF_INSN_ADD, model_lm32_add, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  964. { LM32BF_INSN_ADDI, model_lm32_addi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  965. { LM32BF_INSN_AND, model_lm32_and, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  966. { LM32BF_INSN_ANDI, model_lm32_andi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  967. { LM32BF_INSN_ANDHII, model_lm32_andhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  968. { LM32BF_INSN_B, model_lm32_b, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  969. { LM32BF_INSN_BI, model_lm32_bi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  970. { LM32BF_INSN_BE, model_lm32_be, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  971. { LM32BF_INSN_BG, model_lm32_bg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  972. { LM32BF_INSN_BGE, model_lm32_bge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  973. { LM32BF_INSN_BGEU, model_lm32_bgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  974. { LM32BF_INSN_BGU, model_lm32_bgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  975. { LM32BF_INSN_BNE, model_lm32_bne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  976. { LM32BF_INSN_CALL, model_lm32_call, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  977. { LM32BF_INSN_CALLI, model_lm32_calli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  978. { LM32BF_INSN_CMPE, model_lm32_cmpe, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  979. { LM32BF_INSN_CMPEI, model_lm32_cmpei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  980. { LM32BF_INSN_CMPG, model_lm32_cmpg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  981. { LM32BF_INSN_CMPGI, model_lm32_cmpgi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  982. { LM32BF_INSN_CMPGE, model_lm32_cmpge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  983. { LM32BF_INSN_CMPGEI, model_lm32_cmpgei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  984. { LM32BF_INSN_CMPGEU, model_lm32_cmpgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  985. { LM32BF_INSN_CMPGEUI, model_lm32_cmpgeui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  986. { LM32BF_INSN_CMPGU, model_lm32_cmpgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  987. { LM32BF_INSN_CMPGUI, model_lm32_cmpgui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  988. { LM32BF_INSN_CMPNE, model_lm32_cmpne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  989. { LM32BF_INSN_CMPNEI, model_lm32_cmpnei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  990. { LM32BF_INSN_DIVU, model_lm32_divu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  991. { LM32BF_INSN_LB, model_lm32_lb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  992. { LM32BF_INSN_LBU, model_lm32_lbu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  993. { LM32BF_INSN_LH, model_lm32_lh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  994. { LM32BF_INSN_LHU, model_lm32_lhu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  995. { LM32BF_INSN_LW, model_lm32_lw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  996. { LM32BF_INSN_MODU, model_lm32_modu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  997. { LM32BF_INSN_MUL, model_lm32_mul, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  998. { LM32BF_INSN_MULI, model_lm32_muli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  999. { LM32BF_INSN_NOR, model_lm32_nor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1000. { LM32BF_INSN_NORI, model_lm32_nori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1001. { LM32BF_INSN_OR, model_lm32_or, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1002. { LM32BF_INSN_ORI, model_lm32_ori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1003. { LM32BF_INSN_ORHII, model_lm32_orhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1004. { LM32BF_INSN_RCSR, model_lm32_rcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1005. { LM32BF_INSN_SB, model_lm32_sb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1006. { LM32BF_INSN_SEXTB, model_lm32_sextb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1007. { LM32BF_INSN_SEXTH, model_lm32_sexth, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1008. { LM32BF_INSN_SH, model_lm32_sh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1009. { LM32BF_INSN_SL, model_lm32_sl, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1010. { LM32BF_INSN_SLI, model_lm32_sli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1011. { LM32BF_INSN_SR, model_lm32_sr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1012. { LM32BF_INSN_SRI, model_lm32_sri, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1013. { LM32BF_INSN_SRU, model_lm32_sru, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1014. { LM32BF_INSN_SRUI, model_lm32_srui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1015. { LM32BF_INSN_SUB, model_lm32_sub, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1016. { LM32BF_INSN_SW, model_lm32_sw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1017. { LM32BF_INSN_USER, model_lm32_user, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1018. { LM32BF_INSN_WCSR, model_lm32_wcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1019. { LM32BF_INSN_XOR, model_lm32_xor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1020. { LM32BF_INSN_XORI, model_lm32_xori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1021. { LM32BF_INSN_XNOR, model_lm32_xnor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1022. { LM32BF_INSN_XNORI, model_lm32_xnori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1023. { LM32BF_INSN_BREAK, model_lm32_break, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1024. { LM32BF_INSN_SCALL, model_lm32_scall, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
  1025. };
  1026. #endif /* WITH_PROFILE_MODEL_P */
  1027. static void
  1028. lm32_model_init (SIM_CPU *cpu)
  1029. {
  1030. CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_LM32_DATA));
  1031. }
  1032. #if WITH_PROFILE_MODEL_P
  1033. #define TIMING_DATA(td) td
  1034. #else
  1035. #define TIMING_DATA(td) 0
  1036. #endif
  1037. static const MODEL lm32_models[] =
  1038. {
  1039. { "lm32", & lm32_mach, MODEL_LM32, TIMING_DATA (& lm32_timing[0]), lm32_model_init },
  1040. { 0 }
  1041. };
  1042. /* The properties of this cpu's implementation. */
  1043. static const MACH_IMP_PROPERTIES lm32bf_imp_properties =
  1044. {
  1045. sizeof (SIM_CPU),
  1046. #if WITH_SCACHE
  1047. sizeof (SCACHE)
  1048. #else
  1049. 0
  1050. #endif
  1051. };
  1052. static void
  1053. lm32bf_prepare_run (SIM_CPU *cpu)
  1054. {
  1055. if (CPU_IDESC (cpu) == NULL)
  1056. lm32bf_init_idesc_table (cpu);
  1057. }
  1058. static const CGEN_INSN *
  1059. lm32bf_get_idata (SIM_CPU *cpu, int inum)
  1060. {
  1061. return CPU_IDESC (cpu) [inum].idata;
  1062. }
  1063. static void
  1064. lm32_init_cpu (SIM_CPU *cpu)
  1065. {
  1066. CPU_REG_FETCH (cpu) = lm32bf_fetch_register;
  1067. CPU_REG_STORE (cpu) = lm32bf_store_register;
  1068. CPU_PC_FETCH (cpu) = lm32bf_h_pc_get;
  1069. CPU_PC_STORE (cpu) = lm32bf_h_pc_set;
  1070. CPU_GET_IDATA (cpu) = lm32bf_get_idata;
  1071. CPU_MAX_INSNS (cpu) = LM32BF_INSN__MAX;
  1072. CPU_INSN_NAME (cpu) = cgen_insn_name;
  1073. CPU_FULL_ENGINE_FN (cpu) = lm32bf_engine_run_full;
  1074. #if WITH_FAST
  1075. CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_fast;
  1076. #else
  1077. CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_full;
  1078. #endif
  1079. }
  1080. const MACH lm32_mach =
  1081. {
  1082. "lm32", "lm32", MACH_LM32,
  1083. 32, 32, & lm32_models[0], & lm32bf_imp_properties,
  1084. lm32_init_cpu,
  1085. lm32bf_prepare_run
  1086. };