1 /* RTX cost tables for AArch64. 2 3 Copyright (C) 2014-2020 Free Software Foundation, Inc. 4 5 This file is part of GCC. 6 7 GCC is free software; you can redistribute it and/or modify it 8 under the terms of the GNU General Public License as published 9 by the Free Software Foundation; either version 3, or (at your 10 option) any later version. 11 12 GCC is distributed in the hope that it will be useful, but WITHOUT 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with GCC; see the file COPYING3. If not see 19 <http://www.gnu.org/licenses/>. */ 20 21 #ifndef GCC_AARCH64_COST_TABLES_H 22 #define GCC_AARCH64_COST_TABLES_H 23 24 #include "config/arm/aarch-cost-tables.h" 25 26 /* QDF24xx does not implement AArch32. */ 27 const struct cpu_cost_table qdf24xx_extra_costs = 28 { 29 /* ALU */ 30 { 31 0, /* arith. */ 32 0, /* logical. */ 33 0, /* shift. */ 34 0, /* shift_reg. */ 35 COSTS_N_INSNS (1), /* arith_shift. */ 36 COSTS_N_INSNS (1), /* arith_shift_reg. */ 37 0, /* log_shift. */ 38 0, /* log_shift_reg. */ 39 0, /* extend. */ 40 0, /* extend_arith. */ 41 0, /* bfi. */ 42 0, /* bfx. */ 43 0, /* clz. */ 44 0, /* rev. */ 45 0, /* non_exec. */ 46 true /* non_exec_costs_exec. */ 47 }, 48 { 49 /* MULT SImode */ 50 { 51 COSTS_N_INSNS (2), /* simple. */ 52 COSTS_N_INSNS (2), /* flag_setting. */ 53 COSTS_N_INSNS (2), /* extend. */ 54 COSTS_N_INSNS (2), /* add. */ 55 COSTS_N_INSNS (2), /* extend_add. */ 56 COSTS_N_INSNS (4) /* idiv. */ 57 }, 58 /* MULT DImode */ 59 { 60 COSTS_N_INSNS (3), /* simple. */ 61 0, /* flag_setting (N/A). */ 62 COSTS_N_INSNS (3), /* extend. */ 63 COSTS_N_INSNS (3), /* add. */ 64 COSTS_N_INSNS (3), /* extend_add. */ 65 COSTS_N_INSNS (9) /* idiv. */ 66 } 67 }, 68 /* LD/ST */ 69 { 70 COSTS_N_INSNS (2), /* load. */ 71 COSTS_N_INSNS (2), /* load_sign_extend. */ 72 COSTS_N_INSNS (2), /* ldrd. */ 73 COSTS_N_INSNS (2), /* ldm_1st. */ 74 1, /* ldm_regs_per_insn_1st. */ 75 2, /* ldm_regs_per_insn_subsequent. */ 76 COSTS_N_INSNS (2), /* loadf. */ 77 COSTS_N_INSNS (2), /* loadd. */ 78 COSTS_N_INSNS (3), /* load_unaligned. */ 79 0, /* store. */ 80 0, /* strd. */ 81 0, /* stm_1st. */ 82 1, /* stm_regs_per_insn_1st. */ 83 2, /* stm_regs_per_insn_subsequent. */ 84 0, /* storef. */ 85 0, /* stored. */ 86 COSTS_N_INSNS (1), /* store_unaligned. */ 87 COSTS_N_INSNS (1), /* loadv. */ 88 COSTS_N_INSNS (1) /* storev. */ 89 }, 90 { 91 /* FP SFmode */ 92 { 93 COSTS_N_INSNS (6), /* div. */ 94 COSTS_N_INSNS (5), /* mult. */ 95 COSTS_N_INSNS (5), /* mult_addsub. */ 96 COSTS_N_INSNS (5), /* fma. */ 97 COSTS_N_INSNS (3), /* addsub. */ 98 COSTS_N_INSNS (1), /* fpconst. */ 99 COSTS_N_INSNS (1), /* neg. */ 100 COSTS_N_INSNS (2), /* compare. */ 101 COSTS_N_INSNS (4), /* widen. */ 102 COSTS_N_INSNS (4), /* narrow. */ 103 COSTS_N_INSNS (4), /* toint. */ 104 COSTS_N_INSNS (4), /* fromint. */ 105 COSTS_N_INSNS (2) /* roundint. */ 106 }, 107 /* FP DFmode */ 108 { 109 COSTS_N_INSNS (11), /* div. */ 110 COSTS_N_INSNS (6), /* mult. */ 111 COSTS_N_INSNS (6), /* mult_addsub. */ 112 COSTS_N_INSNS (6), /* fma. */ 113 COSTS_N_INSNS (3), /* addsub. */ 114 COSTS_N_INSNS (1), /* fpconst. */ 115 COSTS_N_INSNS (1), /* neg. */ 116 COSTS_N_INSNS (2), /* compare. */ 117 COSTS_N_INSNS (4), /* widen. */ 118 COSTS_N_INSNS (4), /* narrow. */ 119 COSTS_N_INSNS (4), /* toint. */ 120 COSTS_N_INSNS (4), /* fromint. */ 121 COSTS_N_INSNS (2) /* roundint. */ 122 } 123 }, 124 /* Vector */ 125 { 126 COSTS_N_INSNS (1) /* alu. */ 127 } 128 }; 129 130 /* ThunderX does not implement AArch32. */ 131 const struct cpu_cost_table thunderx_extra_costs = 132 { 133 /* ALU */ 134 { 135 0, /* Arith. */ 136 0, /* Logical. */ 137 0, /* Shift. */ 138 0, /* Shift_reg. */ 139 COSTS_N_INSNS (1)+1, /* Arith_shift. */ 140 COSTS_N_INSNS (1)+1, /* Arith_shift_reg. */ 141 COSTS_N_INSNS (1), /* UNUSED: Log_shift. */ 142 COSTS_N_INSNS (1), /* UNUSED: Log_shift_reg. */ 143 0, /* Extend. */ 144 COSTS_N_INSNS (1), /* Extend_arith. */ 145 0, /* Bfi. */ 146 0, /* Bfx. */ 147 COSTS_N_INSNS (5), /* Clz. */ 148 0, /* rev. */ 149 0, /* UNUSED: non_exec. */ 150 false /* UNUSED: non_exec_costs_exec. */ 151 }, 152 { 153 /* MULT SImode */ 154 { 155 COSTS_N_INSNS (3), /* Simple. */ 156 0, /* Flag_setting. */ 157 0, /* Extend. */ 158 0, /* Add. */ 159 COSTS_N_INSNS (1), /* Extend_add. */ 160 COSTS_N_INSNS (21) /* Idiv. */ 161 }, 162 /* MULT DImode */ 163 { 164 COSTS_N_INSNS (3), /* Simple. */ 165 0, /* Flag_setting. */ 166 0, /* Extend. */ 167 0, /* Add. */ 168 COSTS_N_INSNS (1), /* Extend_add. */ 169 COSTS_N_INSNS (37) /* Idiv. */ 170 }, 171 }, 172 /* LD/ST */ 173 { 174 COSTS_N_INSNS (2), /* Load. */ 175 COSTS_N_INSNS (2), /* Load_sign_extend. */ 176 COSTS_N_INSNS (2), /* Ldrd. */ 177 0, /* N/A: Ldm_1st. */ 178 0, /* N/A: Ldm_regs_per_insn_1st. */ 179 0, /* N/A: Ldm_regs_per_insn_subsequent. */ 180 COSTS_N_INSNS (3), /* Loadf. */ 181 COSTS_N_INSNS (3), /* Loadd. */ 182 0, /* N/A: Load_unaligned. */ 183 0, /* Store. */ 184 0, /* Strd. */ 185 0, /* N/A: Stm_1st. */ 186 0, /* N/A: Stm_regs_per_insn_1st. */ 187 0, /* N/A: Stm_regs_per_insn_subsequent. */ 188 0, /* Storef. */ 189 0, /* Stored. */ 190 COSTS_N_INSNS (1), /* Store_unaligned. */ 191 COSTS_N_INSNS (1), /* Loadv. */ 192 COSTS_N_INSNS (1) /* Storev. */ 193 }, 194 { 195 /* FP SFmode */ 196 { 197 COSTS_N_INSNS (11), /* Div. */ 198 COSTS_N_INSNS (5), /* Mult. */ 199 COSTS_N_INSNS (5), /* Mult_addsub. */ 200 COSTS_N_INSNS (5), /* Fma. */ 201 COSTS_N_INSNS (3), /* Addsub. */ 202 0, /* Fpconst. */ 203 COSTS_N_INSNS (1), /* Neg. */ 204 0, /* Compare. */ 205 COSTS_N_INSNS (5), /* Widen. */ 206 COSTS_N_INSNS (5), /* Narrow. */ 207 COSTS_N_INSNS (5), /* Toint. */ 208 COSTS_N_INSNS (5), /* Fromint. */ 209 COSTS_N_INSNS (1) /* Roundint. */ 210 }, 211 /* FP DFmode */ 212 { 213 COSTS_N_INSNS (21), /* Div. */ 214 COSTS_N_INSNS (5), /* Mult. */ 215 COSTS_N_INSNS (5), /* Mult_addsub. */ 216 COSTS_N_INSNS (5), /* Fma. */ 217 COSTS_N_INSNS (3), /* Addsub. */ 218 0, /* Fpconst. */ 219 COSTS_N_INSNS (1), /* Neg. */ 220 0, /* Compare. */ 221 COSTS_N_INSNS (5), /* Widen. */ 222 COSTS_N_INSNS (5), /* Narrow. */ 223 COSTS_N_INSNS (5), /* Toint. */ 224 COSTS_N_INSNS (5), /* Fromint. */ 225 COSTS_N_INSNS (1) /* Roundint. */ 226 } 227 }, 228 /* Vector */ 229 { 230 COSTS_N_INSNS (1) /* Alu. */ 231 } 232 }; 233 234 const struct cpu_cost_table thunderx2t99_extra_costs = 235 { 236 /* ALU */ 237 { 238 0, /* Arith. */ 239 0, /* Logical. */ 240 0, /* Shift. */ 241 0, /* Shift_reg. */ 242 COSTS_N_INSNS (1), /* Arith_shift. */ 243 COSTS_N_INSNS (1), /* Arith_shift_reg. */ 244 COSTS_N_INSNS (1), /* Log_shift. */ 245 COSTS_N_INSNS (1), /* Log_shift_reg. */ 246 0, /* Extend. */ 247 COSTS_N_INSNS (1), /* Extend_arith. */ 248 0, /* Bfi. */ 249 0, /* Bfx. */ 250 COSTS_N_INSNS (3), /* Clz. */ 251 0, /* Rev. */ 252 0, /* Non_exec. */ 253 true /* Non_exec_costs_exec. */ 254 }, 255 { 256 /* MULT SImode */ 257 { 258 COSTS_N_INSNS (4), /* Simple. */ 259 COSTS_N_INSNS (4), /* Flag_setting. */ 260 COSTS_N_INSNS (4), /* Extend. */ 261 COSTS_N_INSNS (5), /* Add. */ 262 COSTS_N_INSNS (5), /* Extend_add. */ 263 COSTS_N_INSNS (18) /* Idiv. */ 264 }, 265 /* MULT DImode */ 266 { 267 COSTS_N_INSNS (4), /* Simple. */ 268 0, /* Flag_setting. */ 269 COSTS_N_INSNS (4), /* Extend. */ 270 COSTS_N_INSNS (5), /* Add. */ 271 COSTS_N_INSNS (5), /* Extend_add. */ 272 COSTS_N_INSNS (26) /* Idiv. */ 273 } 274 }, 275 /* LD/ST */ 276 { 277 COSTS_N_INSNS (4), /* Load. */ 278 COSTS_N_INSNS (4), /* Load_sign_extend. */ 279 COSTS_N_INSNS (5), /* Ldrd. */ 280 COSTS_N_INSNS (4), /* Ldm_1st. */ 281 1, /* Ldm_regs_per_insn_1st. */ 282 1, /* Ldm_regs_per_insn_subsequent. */ 283 COSTS_N_INSNS (4), /* Loadf. */ 284 COSTS_N_INSNS (4), /* Loadd. */ 285 COSTS_N_INSNS (4), /* Load_unaligned. */ 286 0, /* Store. */ 287 0, /* Strd. */ 288 0, /* Stm_1st. */ 289 1, /* Stm_regs_per_insn_1st. */ 290 1, /* Stm_regs_per_insn_subsequent. */ 291 0, /* Storef. */ 292 0, /* Stored. */ 293 0, /* Store_unaligned. */ 294 COSTS_N_INSNS (1), /* Loadv. */ 295 COSTS_N_INSNS (1) /* Storev. */ 296 }, 297 { 298 /* FP SFmode */ 299 { 300 COSTS_N_INSNS (4), /* Div. */ 301 COSTS_N_INSNS (1), /* Mult. */ 302 COSTS_N_INSNS (1), /* Mult_addsub. */ 303 COSTS_N_INSNS (1), /* Fma. */ 304 COSTS_N_INSNS (1), /* Addsub. */ 305 COSTS_N_INSNS (1), /* Fpconst. */ 306 COSTS_N_INSNS (1), /* Neg. */ 307 COSTS_N_INSNS (1), /* Compare. */ 308 COSTS_N_INSNS (2), /* Widen. */ 309 COSTS_N_INSNS (2), /* Narrow. */ 310 COSTS_N_INSNS (2), /* Toint. */ 311 COSTS_N_INSNS (2), /* Fromint. */ 312 COSTS_N_INSNS (2) /* Roundint. */ 313 }, 314 /* FP DFmode */ 315 { 316 COSTS_N_INSNS (6), /* Div. */ 317 COSTS_N_INSNS (1), /* Mult. */ 318 COSTS_N_INSNS (1), /* Mult_addsub. */ 319 COSTS_N_INSNS (1), /* Fma. */ 320 COSTS_N_INSNS (1), /* Addsub. */ 321 COSTS_N_INSNS (1), /* Fpconst. */ 322 COSTS_N_INSNS (1), /* Neg. */ 323 COSTS_N_INSNS (1), /* Compare. */ 324 COSTS_N_INSNS (2), /* Widen. */ 325 COSTS_N_INSNS (2), /* Narrow. */ 326 COSTS_N_INSNS (2), /* Toint. */ 327 COSTS_N_INSNS (2), /* Fromint. */ 328 COSTS_N_INSNS (2) /* Roundint. */ 329 } 330 }, 331 /* Vector */ 332 { 333 COSTS_N_INSNS (1) /* Alu. */ 334 } 335 }; 336 337 const struct cpu_cost_table thunderx3t110_extra_costs = 338 { 339 /* ALU */ 340 { 341 0, /* Arith. */ 342 0, /* Logical. */ 343 0, /* Shift. */ 344 0, /* Shift_reg. */ 345 COSTS_N_INSNS (1), /* Arith_shift. */ 346 COSTS_N_INSNS (1), /* Arith_shift_reg. */ 347 COSTS_N_INSNS (1), /* Log_shift. */ 348 COSTS_N_INSNS (1), /* Log_shift_reg. */ 349 0, /* Extend. */ 350 COSTS_N_INSNS (1), /* Extend_arith. */ 351 0, /* Bfi. */ 352 0, /* Bfx. */ 353 COSTS_N_INSNS (3), /* Clz. */ 354 0, /* Rev. */ 355 0, /* Non_exec. */ 356 true /* Non_exec_costs_exec. */ 357 }, 358 { 359 /* MULT SImode */ 360 { 361 COSTS_N_INSNS (4), /* Simple. */ 362 COSTS_N_INSNS (4), /* Flag_setting. */ 363 COSTS_N_INSNS (4), /* Extend. */ 364 COSTS_N_INSNS (5), /* Add. */ 365 COSTS_N_INSNS (5), /* Extend_add. */ 366 COSTS_N_INSNS (18) /* Idiv. */ 367 }, 368 /* MULT DImode */ 369 { 370 COSTS_N_INSNS (4), /* Simple. */ 371 0, /* Flag_setting. */ 372 COSTS_N_INSNS (4), /* Extend. */ 373 COSTS_N_INSNS (5), /* Add. */ 374 COSTS_N_INSNS (5), /* Extend_add. */ 375 COSTS_N_INSNS (26) /* Idiv. */ 376 } 377 }, 378 /* LD/ST */ 379 { 380 COSTS_N_INSNS (4), /* Load. */ 381 COSTS_N_INSNS (4), /* Load_sign_extend. */ 382 COSTS_N_INSNS (5), /* Ldrd. */ 383 COSTS_N_INSNS (4), /* Ldm_1st. */ 384 1, /* Ldm_regs_per_insn_1st. */ 385 1, /* Ldm_regs_per_insn_subsequent. */ 386 COSTS_N_INSNS (4), /* Loadf. */ 387 COSTS_N_INSNS (4), /* Loadd. */ 388 COSTS_N_INSNS (4), /* Load_unaligned. */ 389 0, /* Store. */ 390 0, /* Strd. */ 391 0, /* Stm_1st. */ 392 1, /* Stm_regs_per_insn_1st. */ 393 1, /* Stm_regs_per_insn_subsequent. */ 394 0, /* Storef. */ 395 0, /* Stored. */ 396 0, /* Store_unaligned. */ 397 COSTS_N_INSNS (1), /* Loadv. */ 398 COSTS_N_INSNS (1) /* Storev. */ 399 }, 400 { 401 /* FP SFmode */ 402 { 403 COSTS_N_INSNS (4), /* Div. */ 404 COSTS_N_INSNS (1), /* Mult. */ 405 COSTS_N_INSNS (1), /* Mult_addsub. */ 406 COSTS_N_INSNS (1), /* Fma. */ 407 COSTS_N_INSNS (1), /* Addsub. */ 408 COSTS_N_INSNS (1), /* Fpconst. */ 409 COSTS_N_INSNS (1), /* Neg. */ 410 COSTS_N_INSNS (1), /* Compare. */ 411 COSTS_N_INSNS (2), /* Widen. */ 412 COSTS_N_INSNS (2), /* Narrow. */ 413 COSTS_N_INSNS (2), /* Toint. */ 414 COSTS_N_INSNS (2), /* Fromint. */ 415 COSTS_N_INSNS (2) /* Roundint. */ 416 }, 417 /* FP DFmode */ 418 { 419 COSTS_N_INSNS (6), /* Div. */ 420 COSTS_N_INSNS (1), /* Mult. */ 421 COSTS_N_INSNS (1), /* Mult_addsub. */ 422 COSTS_N_INSNS (1), /* Fma. */ 423 COSTS_N_INSNS (1), /* Addsub. */ 424 COSTS_N_INSNS (1), /* Fpconst. */ 425 COSTS_N_INSNS (1), /* Neg. */ 426 COSTS_N_INSNS (1), /* Compare. */ 427 COSTS_N_INSNS (2), /* Widen. */ 428 COSTS_N_INSNS (2), /* Narrow. */ 429 COSTS_N_INSNS (2), /* Toint. */ 430 COSTS_N_INSNS (2), /* Fromint. */ 431 COSTS_N_INSNS (2) /* Roundint. */ 432 } 433 }, 434 /* Vector */ 435 { 436 COSTS_N_INSNS (1) /* Alu. */ 437 } 438 }; 439 440 const struct cpu_cost_table tsv110_extra_costs = 441 { 442 /* ALU */ 443 { 444 0, /* arith. */ 445 0, /* logical. */ 446 0, /* shift. */ 447 0, /* shift_reg. */ 448 COSTS_N_INSNS (1), /* arith_shift. */ 449 COSTS_N_INSNS (1), /* arith_shift_reg. */ 450 COSTS_N_INSNS (1), /* log_shift. */ 451 COSTS_N_INSNS (1), /* log_shift_reg. */ 452 0, /* extend. */ 453 COSTS_N_INSNS (1), /* extend_arith. */ 454 0, /* bfi. */ 455 0, /* bfx. */ 456 0, /* clz. */ 457 0, /* rev. */ 458 0, /* non_exec. */ 459 true /* non_exec_costs_exec. */ 460 }, 461 462 { 463 /* MULT SImode */ 464 { 465 COSTS_N_INSNS (2), /* simple. */ 466 COSTS_N_INSNS (2), /* flag_setting. */ 467 COSTS_N_INSNS (2), /* extend. */ 468 COSTS_N_INSNS (2), /* add. */ 469 COSTS_N_INSNS (2), /* extend_add. */ 470 COSTS_N_INSNS (11) /* idiv. */ 471 }, 472 /* MULT DImode */ 473 { 474 COSTS_N_INSNS (3), /* simple. */ 475 0, /* flag_setting (N/A). */ 476 COSTS_N_INSNS (3), /* extend. */ 477 COSTS_N_INSNS (3), /* add. */ 478 COSTS_N_INSNS (3), /* extend_add. */ 479 COSTS_N_INSNS (19) /* idiv. */ 480 } 481 }, 482 /* LD/ST */ 483 { 484 COSTS_N_INSNS (3), /* load. */ 485 COSTS_N_INSNS (4), /* load_sign_extend. */ 486 COSTS_N_INSNS (3), /* ldrd. */ 487 COSTS_N_INSNS (3), /* ldm_1st. */ 488 1, /* ldm_regs_per_insn_1st. */ 489 2, /* ldm_regs_per_insn_subsequent. */ 490 COSTS_N_INSNS (4), /* loadf. */ 491 COSTS_N_INSNS (4), /* loadd. */ 492 COSTS_N_INSNS (4), /* load_unaligned. */ 493 0, /* store. */ 494 0, /* strd. */ 495 0, /* stm_1st. */ 496 1, /* stm_regs_per_insn_1st. */ 497 2, /* stm_regs_per_insn_subsequent. */ 498 0, /* storef. */ 499 0, /* stored. */ 500 COSTS_N_INSNS (1), /* store_unaligned. */ 501 COSTS_N_INSNS (4), /* loadv. */ 502 COSTS_N_INSNS (4) /* storev. */ 503 }, 504 { 505 /* FP SFmode */ 506 { 507 COSTS_N_INSNS (10), /* div. */ 508 COSTS_N_INSNS (4), /* mult. */ 509 COSTS_N_INSNS (4), /* mult_addsub. */ 510 COSTS_N_INSNS (4), /* fma. */ 511 COSTS_N_INSNS (4), /* addsub. */ 512 COSTS_N_INSNS (1), /* fpconst. */ 513 COSTS_N_INSNS (1), /* neg. */ 514 COSTS_N_INSNS (1), /* compare. */ 515 COSTS_N_INSNS (2), /* widen. */ 516 COSTS_N_INSNS (2), /* narrow. */ 517 COSTS_N_INSNS (2), /* toint. */ 518 COSTS_N_INSNS (1), /* fromint. */ 519 COSTS_N_INSNS (2) /* roundint. */ 520 }, 521 /* FP DFmode */ 522 { 523 COSTS_N_INSNS (17), /* div. */ 524 COSTS_N_INSNS (4), /* mult. */ 525 COSTS_N_INSNS (6), /* mult_addsub. */ 526 COSTS_N_INSNS (6), /* fma. */ 527 COSTS_N_INSNS (3), /* addsub. */ 528 COSTS_N_INSNS (1), /* fpconst. */ 529 COSTS_N_INSNS (1), /* neg. */ 530 COSTS_N_INSNS (1), /* compare. */ 531 COSTS_N_INSNS (2), /* widen. */ 532 COSTS_N_INSNS (2), /* narrow. */ 533 COSTS_N_INSNS (2), /* toint. */ 534 COSTS_N_INSNS (1), /* fromint. */ 535 COSTS_N_INSNS (2) /* roundint. */ 536 } 537 }, 538 /* Vector */ 539 { 540 COSTS_N_INSNS (1) /* alu. */ 541 } 542 }; 543 544 const struct cpu_cost_table a64fx_extra_costs = 545 { 546 /* ALU */ 547 { 548 0, /* arith. */ 549 0, /* logical. */ 550 0, /* shift. */ 551 0, /* shift_reg. */ 552 COSTS_N_INSNS (1), /* arith_shift. */ 553 COSTS_N_INSNS (1), /* arith_shift_reg. */ 554 COSTS_N_INSNS (1), /* log_shift. */ 555 COSTS_N_INSNS (1), /* log_shift_reg. */ 556 0, /* extend. */ 557 COSTS_N_INSNS (1), /* extend_arith. */ 558 0, /* bfi. */ 559 0, /* bfx. */ 560 0, /* clz. */ 561 0, /* rev. */ 562 0, /* non_exec. */ 563 true /* non_exec_costs_exec. */ 564 }, 565 { 566 /* MULT SImode */ 567 { 568 COSTS_N_INSNS (4), /* simple. */ 569 COSTS_N_INSNS (4), /* flag_setting. */ 570 COSTS_N_INSNS (4), /* extend. */ 571 COSTS_N_INSNS (5), /* add. */ 572 COSTS_N_INSNS (5), /* extend_add. */ 573 COSTS_N_INSNS (18) /* idiv. */ 574 }, 575 /* MULT DImode */ 576 { 577 COSTS_N_INSNS (4), /* simple. */ 578 0, /* flag_setting (N/A). */ 579 COSTS_N_INSNS (4), /* extend. */ 580 COSTS_N_INSNS (5), /* add. */ 581 COSTS_N_INSNS (5), /* extend_add. */ 582 COSTS_N_INSNS (26) /* idiv. */ 583 } 584 }, 585 /* LD/ST */ 586 { 587 COSTS_N_INSNS (4), /* load. */ 588 COSTS_N_INSNS (4), /* load_sign_extend. */ 589 COSTS_N_INSNS (5), /* ldrd. */ 590 COSTS_N_INSNS (4), /* ldm_1st. */ 591 1, /* ldm_regs_per_insn_1st. */ 592 2, /* ldm_regs_per_insn_subsequent. */ 593 COSTS_N_INSNS (4), /* loadf. */ 594 COSTS_N_INSNS (4), /* loadd. */ 595 COSTS_N_INSNS (5), /* load_unaligned. */ 596 0, /* store. */ 597 0, /* strd. */ 598 0, /* stm_1st. */ 599 1, /* stm_regs_per_insn_1st. */ 600 2, /* stm_regs_per_insn_subsequent. */ 601 0, /* storef. */ 602 0, /* stored. */ 603 0, /* store_unaligned. */ 604 COSTS_N_INSNS (1), /* loadv. */ 605 COSTS_N_INSNS (1) /* storev. */ 606 }, 607 { 608 /* FP SFmode */ 609 { 610 COSTS_N_INSNS (6), /* div. */ 611 COSTS_N_INSNS (1), /* mult. */ 612 COSTS_N_INSNS (1), /* mult_addsub. */ 613 COSTS_N_INSNS (2), /* fma. */ 614 COSTS_N_INSNS (1), /* addsub. */ 615 COSTS_N_INSNS (1), /* fpconst. */ 616 COSTS_N_INSNS (1), /* neg. */ 617 COSTS_N_INSNS (1), /* compare. */ 618 COSTS_N_INSNS (2), /* widen. */ 619 COSTS_N_INSNS (2), /* narrow. */ 620 COSTS_N_INSNS (2), /* toint. */ 621 COSTS_N_INSNS (2), /* fromint. */ 622 COSTS_N_INSNS (2) /* roundint. */ 623 }, 624 /* FP DFmode */ 625 { 626 COSTS_N_INSNS (11), /* div. */ 627 COSTS_N_INSNS (1), /* mult. */ 628 COSTS_N_INSNS (1), /* mult_addsub. */ 629 COSTS_N_INSNS (2), /* fma. */ 630 COSTS_N_INSNS (1), /* addsub. */ 631 COSTS_N_INSNS (1), /* fpconst. */ 632 COSTS_N_INSNS (1), /* neg. */ 633 COSTS_N_INSNS (1), /* compare. */ 634 COSTS_N_INSNS (2), /* widen. */ 635 COSTS_N_INSNS (2), /* narrow. */ 636 COSTS_N_INSNS (2), /* toint. */ 637 COSTS_N_INSNS (2), /* fromint. */ 638 COSTS_N_INSNS (2) /* roundint. */ 639 } 640 }, 641 /* Vector */ 642 { 643 COSTS_N_INSNS (1) /* alu. */ 644 } 645 }; 646 647 const struct cpu_cost_table ampere1_extra_costs = 648 { 649 /* ALU */ 650 { 651 0, /* arith. */ 652 0, /* logical. */ 653 0, /* shift. */ 654 COSTS_N_INSNS (1), /* shift_reg. */ 655 0, /* arith_shift. */ 656 COSTS_N_INSNS (1), /* arith_shift_reg. */ 657 0, /* log_shift. */ 658 COSTS_N_INSNS (1), /* log_shift_reg. */ 659 0, /* extend. */ 660 COSTS_N_INSNS (1), /* extend_arith. */ 661 0, /* bfi. */ 662 0, /* bfx. */ 663 0, /* clz. */ 664 0, /* rev. */ 665 0, /* non_exec. */ 666 true /* non_exec_costs_exec. */ 667 }, 668 { 669 /* MULT SImode */ 670 { 671 COSTS_N_INSNS (3), /* simple. */ 672 COSTS_N_INSNS (3), /* flag_setting. */ 673 COSTS_N_INSNS (3), /* extend. */ 674 COSTS_N_INSNS (4), /* add. */ 675 COSTS_N_INSNS (4), /* extend_add. */ 676 COSTS_N_INSNS (18) /* idiv. */ 677 }, 678 /* MULT DImode */ 679 { 680 COSTS_N_INSNS (3), /* simple. */ 681 0, /* flag_setting (N/A). */ 682 COSTS_N_INSNS (3), /* extend. */ 683 COSTS_N_INSNS (4), /* add. */ 684 COSTS_N_INSNS (4), /* extend_add. */ 685 COSTS_N_INSNS (34) /* idiv. */ 686 } 687 }, 688 /* LD/ST */ 689 { 690 COSTS_N_INSNS (4), /* load. */ 691 COSTS_N_INSNS (4), /* load_sign_extend. */ 692 0, /* ldrd (n/a). */ 693 0, /* ldm_1st. */ 694 0, /* ldm_regs_per_insn_1st. */ 695 0, /* ldm_regs_per_insn_subsequent. */ 696 COSTS_N_INSNS (5), /* loadf. */ 697 COSTS_N_INSNS (5), /* loadd. */ 698 COSTS_N_INSNS (5), /* load_unaligned. */ 699 0, /* store. */ 700 0, /* strd. */ 701 0, /* stm_1st. */ 702 0, /* stm_regs_per_insn_1st. */ 703 0, /* stm_regs_per_insn_subsequent. */ 704 COSTS_N_INSNS (2), /* storef. */ 705 COSTS_N_INSNS (2), /* stored. */ 706 COSTS_N_INSNS (2), /* store_unaligned. */ 707 COSTS_N_INSNS (3), /* loadv. */ 708 COSTS_N_INSNS (3) /* storev. */ 709 }, 710 { 711 /* FP SFmode */ 712 { 713 COSTS_N_INSNS (25), /* div. */ 714 COSTS_N_INSNS (4), /* mult. */ 715 COSTS_N_INSNS (4), /* mult_addsub. */ 716 COSTS_N_INSNS (4), /* fma. */ 717 COSTS_N_INSNS (4), /* addsub. */ 718 COSTS_N_INSNS (2), /* fpconst. */ 719 COSTS_N_INSNS (4), /* neg. */ 720 COSTS_N_INSNS (4), /* compare. */ 721 COSTS_N_INSNS (4), /* widen. */ 722 COSTS_N_INSNS (4), /* narrow. */ 723 COSTS_N_INSNS (4), /* toint. */ 724 COSTS_N_INSNS (4), /* fromint. */ 725 COSTS_N_INSNS (4) /* roundint. */ 726 }, 727 /* FP DFmode */ 728 { 729 COSTS_N_INSNS (34), /* div. */ 730 COSTS_N_INSNS (5), /* mult. */ 731 COSTS_N_INSNS (5), /* mult_addsub. */ 732 COSTS_N_INSNS (5), /* fma. */ 733 COSTS_N_INSNS (5), /* addsub. */ 734 COSTS_N_INSNS (2), /* fpconst. */ 735 COSTS_N_INSNS (5), /* neg. */ 736 COSTS_N_INSNS (5), /* compare. */ 737 COSTS_N_INSNS (5), /* widen. */ 738 COSTS_N_INSNS (5), /* narrow. */ 739 COSTS_N_INSNS (6), /* toint. */ 740 COSTS_N_INSNS (6), /* fromint. */ 741 COSTS_N_INSNS (5) /* roundint. */ 742 } 743 }, 744 /* Vector */ 745 { 746 COSTS_N_INSNS (3), /* alu. */ 747 } 748 }; 749 750 const struct cpu_cost_table ampere1a_extra_costs = 751 { 752 /* ALU */ 753 { 754 0, /* arith. */ 755 0, /* logical. */ 756 0, /* shift. */ 757 COSTS_N_INSNS (1), /* shift_reg. */ 758 0, /* arith_shift. */ 759 COSTS_N_INSNS (1), /* arith_shift_reg. */ 760 0, /* log_shift. */ 761 COSTS_N_INSNS (1), /* log_shift_reg. */ 762 0, /* extend. */ 763 COSTS_N_INSNS (1), /* extend_arith. */ 764 0, /* bfi. */ 765 0, /* bfx. */ 766 0, /* clz. */ 767 0, /* rev. */ 768 0, /* non_exec. */ 769 true /* non_exec_costs_exec. */ 770 }, 771 { 772 /* MULT SImode */ 773 { 774 COSTS_N_INSNS (3), /* simple. */ 775 COSTS_N_INSNS (3), /* flag_setting. */ 776 COSTS_N_INSNS (3), /* extend. */ 777 COSTS_N_INSNS (4), /* add. */ 778 COSTS_N_INSNS (4), /* extend_add. */ 779 COSTS_N_INSNS (19) /* idiv. */ 780 }, 781 /* MULT DImode */ 782 { 783 COSTS_N_INSNS (3), /* simple. */ 784 0, /* flag_setting (N/A). */ 785 COSTS_N_INSNS (3), /* extend. */ 786 COSTS_N_INSNS (4), /* add. */ 787 COSTS_N_INSNS (4), /* extend_add. */ 788 COSTS_N_INSNS (35) /* idiv. */ 789 } 790 }, 791 /* LD/ST */ 792 { 793 COSTS_N_INSNS (4), /* load. */ 794 COSTS_N_INSNS (4), /* load_sign_extend. */ 795 0, /* ldrd (n/a). */ 796 0, /* ldm_1st. */ 797 0, /* ldm_regs_per_insn_1st. */ 798 0, /* ldm_regs_per_insn_subsequent. */ 799 COSTS_N_INSNS (5), /* loadf. */ 800 COSTS_N_INSNS (5), /* loadd. */ 801 COSTS_N_INSNS (5), /* load_unaligned. */ 802 0, /* store. */ 803 0, /* strd. */ 804 0, /* stm_1st. */ 805 0, /* stm_regs_per_insn_1st. */ 806 0, /* stm_regs_per_insn_subsequent. */ 807 COSTS_N_INSNS (2), /* storef. */ 808 COSTS_N_INSNS (2), /* stored. */ 809 COSTS_N_INSNS (2), /* store_unaligned. */ 810 COSTS_N_INSNS (3), /* loadv. */ 811 COSTS_N_INSNS (3) /* storev. */ 812 }, 813 { 814 /* FP SFmode */ 815 { 816 COSTS_N_INSNS (25), /* div. */ 817 COSTS_N_INSNS (4), /* mult. */ 818 COSTS_N_INSNS (4), /* mult_addsub. */ 819 COSTS_N_INSNS (4), /* fma. */ 820 COSTS_N_INSNS (4), /* addsub. */ 821 COSTS_N_INSNS (2), /* fpconst. */ 822 COSTS_N_INSNS (4), /* neg. */ 823 COSTS_N_INSNS (4), /* compare. */ 824 COSTS_N_INSNS (4), /* widen. */ 825 COSTS_N_INSNS (4), /* narrow. */ 826 COSTS_N_INSNS (4), /* toint. */ 827 COSTS_N_INSNS (4), /* fromint. */ 828 COSTS_N_INSNS (4) /* roundint. */ 829 }, 830 /* FP DFmode */ 831 { 832 COSTS_N_INSNS (34), /* div. */ 833 COSTS_N_INSNS (5), /* mult. */ 834 COSTS_N_INSNS (5), /* mult_addsub. */ 835 COSTS_N_INSNS (5), /* fma. */ 836 COSTS_N_INSNS (5), /* addsub. */ 837 COSTS_N_INSNS (2), /* fpconst. */ 838 COSTS_N_INSNS (5), /* neg. */ 839 COSTS_N_INSNS (5), /* compare. */ 840 COSTS_N_INSNS (5), /* widen. */ 841 COSTS_N_INSNS (5), /* narrow. */ 842 COSTS_N_INSNS (6), /* toint. */ 843 COSTS_N_INSNS (6), /* fromint. */ 844 COSTS_N_INSNS (5) /* roundint. */ 845 } 846 }, 847 /* Vector */ 848 { 849 COSTS_N_INSNS (3), /* alu. */ 850 } 851 }; 852 853 #endif 854