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