(root)/
gcc-13.2.0/
gcc/
config/
aarch64/
aarch64-cost-tables.h
       1  /* RTX cost tables for AArch64.
       2  
       3     Copyright (C) 2014-2023 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      COSTS_N_INSNS (4),  /* mult.  */
     128      COSTS_N_INSNS (1),  /* movi.  */
     129      COSTS_N_INSNS (2),  /* dup.  */
     130      COSTS_N_INSNS (2)   /* extract.  */
     131    }
     132  };
     133  
     134  /* ThunderX does not implement AArch32.  */
     135  const struct cpu_cost_table thunderx_extra_costs =
     136  {
     137    /* ALU */
     138    {
     139      0,			/* Arith.  */
     140      0,			/* Logical.  */
     141      0,			/* Shift.  */
     142      0,			/* Shift_reg.  */
     143      COSTS_N_INSNS (1)+1,	/* Arith_shift.  */
     144      COSTS_N_INSNS (1)+1,	/* Arith_shift_reg.  */
     145      COSTS_N_INSNS (1),	/* UNUSED: Log_shift.  */
     146      COSTS_N_INSNS (1),	/* UNUSED: Log_shift_reg.  */
     147      0,			/* Extend.  */
     148      COSTS_N_INSNS (1),	/* Extend_arith.  */
     149      0,			/* Bfi.  */
     150      0,			/* Bfx.  */
     151      COSTS_N_INSNS (5),	/* Clz.  */
     152      0,			/* rev.  */
     153      0,			/* UNUSED: non_exec.  */
     154      false		/* UNUSED: non_exec_costs_exec.  */
     155    },
     156    {
     157      /* MULT SImode */
     158      {
     159        COSTS_N_INSNS (3),	/* Simple.  */
     160        0,			/* Flag_setting.  */
     161        0,			/* Extend.  */
     162        0,			/* Add.  */
     163        COSTS_N_INSNS (1),	/* Extend_add.  */
     164        COSTS_N_INSNS (21)	/* Idiv.  */
     165      },
     166      /* MULT DImode */
     167      {
     168        COSTS_N_INSNS (3),	/* Simple.  */
     169        0,			/* Flag_setting.  */
     170        0,			/* Extend.  */
     171        0,			/* Add.  */
     172        COSTS_N_INSNS (1),	/* Extend_add.  */
     173        COSTS_N_INSNS (37)	/* Idiv.  */
     174      },
     175    },
     176    /* LD/ST */
     177    {
     178      COSTS_N_INSNS (2),	/* Load.  */
     179      COSTS_N_INSNS (2),	/* Load_sign_extend.  */
     180      COSTS_N_INSNS (2),	/* Ldrd.  */
     181      0,			/* N/A: Ldm_1st.  */
     182      0,			/* N/A: Ldm_regs_per_insn_1st.  */
     183      0,			/* N/A: Ldm_regs_per_insn_subsequent.  */
     184      COSTS_N_INSNS (3),	/* Loadf.  */
     185      COSTS_N_INSNS (3),	/* Loadd.  */
     186      0,  		/* N/A: Load_unaligned.  */
     187      0,			/* Store.  */
     188      0,			/* Strd.  */
     189      0,			/* N/A: Stm_1st.  */
     190      0,			/* N/A: Stm_regs_per_insn_1st.  */
     191      0,			/* N/A: Stm_regs_per_insn_subsequent.  */
     192      0,			/* Storef.  */
     193      0,			/* Stored.  */
     194      COSTS_N_INSNS (1),	/* Store_unaligned.  */
     195      COSTS_N_INSNS (1),	/* Loadv.  */
     196      COSTS_N_INSNS (1)	/* Storev.  */
     197    },
     198    {
     199      /* FP SFmode */
     200      {
     201        COSTS_N_INSNS (11),	/* Div.  */
     202        COSTS_N_INSNS (5),	/* Mult.  */
     203        COSTS_N_INSNS (5),	/* Mult_addsub.  */
     204        COSTS_N_INSNS (5),	/* Fma.  */
     205        COSTS_N_INSNS (3),	/* Addsub.  */
     206        0,			/* Fpconst.  */
     207        COSTS_N_INSNS (1),	/* Neg.  */
     208        0,			/* Compare.  */
     209        COSTS_N_INSNS (5),	/* Widen.  */
     210        COSTS_N_INSNS (5),	/* Narrow.  */
     211        COSTS_N_INSNS (5),	/* Toint.  */
     212        COSTS_N_INSNS (5),	/* Fromint.  */
     213        COSTS_N_INSNS (1)		/* Roundint.  */
     214      },
     215      /* FP DFmode */
     216      {
     217        COSTS_N_INSNS (21),	/* Div.  */
     218        COSTS_N_INSNS (5),	/* Mult.  */
     219        COSTS_N_INSNS (5),	/* Mult_addsub.  */
     220        COSTS_N_INSNS (5),	/* Fma.  */
     221        COSTS_N_INSNS (3),	/* Addsub.  */
     222        0,			/* Fpconst.  */
     223        COSTS_N_INSNS (1),	/* Neg.  */
     224        0,			/* Compare.  */
     225        COSTS_N_INSNS (5),	/* Widen.  */
     226        COSTS_N_INSNS (5),	/* Narrow.  */
     227        COSTS_N_INSNS (5),	/* Toint.  */
     228        COSTS_N_INSNS (5),	/* Fromint.  */
     229        COSTS_N_INSNS (1)		/* Roundint.  */
     230      }
     231    },
     232    /* Vector */
     233    {
     234      COSTS_N_INSNS (1),	/* Alu.  */
     235      COSTS_N_INSNS (4),	/* mult.  */
     236      COSTS_N_INSNS (1),	/* movi.  */
     237      COSTS_N_INSNS (2),	/* dup.  */
     238      COSTS_N_INSNS (2)	/* extract.  */
     239    }
     240  };
     241  
     242  const struct cpu_cost_table thunderx2t99_extra_costs =
     243  {
     244    /* ALU */
     245    {
     246      0,			/* Arith.  */
     247      0,			/* Logical.  */
     248      0,			/* Shift.  */
     249      0,			/* Shift_reg.  */
     250      COSTS_N_INSNS (1),	/* Arith_shift.  */
     251      COSTS_N_INSNS (1),	/* Arith_shift_reg.  */
     252      COSTS_N_INSNS (1),	/* Log_shift.  */
     253      COSTS_N_INSNS (1),	/* Log_shift_reg.  */
     254      0,			/* Extend.  */
     255      COSTS_N_INSNS (1),	/* Extend_arith.  */
     256      0,			/* Bfi.  */
     257      0,			/* Bfx.  */
     258      COSTS_N_INSNS (3),	/* Clz.  */
     259      0,			/* Rev.  */
     260      0,			/* Non_exec.  */
     261      true		/* Non_exec_costs_exec.  */
     262    },
     263    {
     264      /* MULT SImode */
     265      {
     266        COSTS_N_INSNS (4),	/* Simple.  */
     267        COSTS_N_INSNS (4),	/* Flag_setting.  */
     268        COSTS_N_INSNS (4),	/* Extend.  */
     269        COSTS_N_INSNS (5),	/* Add.  */
     270        COSTS_N_INSNS (5),	/* Extend_add.  */
     271        COSTS_N_INSNS (18)	/* Idiv.  */
     272      },
     273      /* MULT DImode */
     274      {
     275        COSTS_N_INSNS (4),       /* Simple.  */
     276        0,                       /* Flag_setting.  */
     277        COSTS_N_INSNS (4),       /* Extend.  */
     278        COSTS_N_INSNS (5),       /* Add.  */
     279        COSTS_N_INSNS (5),       /* Extend_add.  */
     280        COSTS_N_INSNS (26)       /* Idiv.  */
     281      }
     282    },
     283    /* LD/ST */
     284    {
     285      COSTS_N_INSNS (4),	/* Load.  */
     286      COSTS_N_INSNS (4),	/* Load_sign_extend.  */
     287      COSTS_N_INSNS (5),	/* Ldrd.  */
     288      COSTS_N_INSNS (4),	/* Ldm_1st.  */
     289      1,			/* Ldm_regs_per_insn_1st.  */
     290      1,			/* Ldm_regs_per_insn_subsequent.  */
     291      COSTS_N_INSNS (4),	/* Loadf.  */
     292      COSTS_N_INSNS (4),	/* Loadd.  */
     293      COSTS_N_INSNS (4),	/* Load_unaligned.  */
     294      0,			/* Store.  */
     295      0,			/* Strd.  */
     296      0,			/* Stm_1st.  */
     297      1,			/* Stm_regs_per_insn_1st.  */
     298      1,			/* Stm_regs_per_insn_subsequent.  */
     299      0,			/* Storef.  */
     300      0,			/* Stored.  */
     301      0,			/* Store_unaligned.  */
     302      COSTS_N_INSNS (1),	/* Loadv.  */
     303      COSTS_N_INSNS (1)	/* Storev.  */
     304    },
     305    {
     306      /* FP SFmode */
     307      {
     308        COSTS_N_INSNS (4),	/* Div.  */
     309        COSTS_N_INSNS (1),	/* Mult.  */
     310        COSTS_N_INSNS (1),	/* Mult_addsub. */
     311        COSTS_N_INSNS (1),	/* Fma.  */
     312        COSTS_N_INSNS (1),	/* Addsub.  */
     313        COSTS_N_INSNS (1),	/* Fpconst. */
     314        COSTS_N_INSNS (1),	/* Neg.  */
     315        COSTS_N_INSNS (1),	/* Compare.  */
     316        COSTS_N_INSNS (2),	/* Widen.  */
     317        COSTS_N_INSNS (2),	/* Narrow.  */
     318        COSTS_N_INSNS (2),	/* Toint.  */
     319        COSTS_N_INSNS (2),	/* Fromint.  */
     320        COSTS_N_INSNS (2) 	/* Roundint.  */
     321      },
     322      /* FP DFmode */
     323      {
     324        COSTS_N_INSNS (6),	/* Div.  */
     325        COSTS_N_INSNS (1),	/* Mult.  */
     326        COSTS_N_INSNS (1),	/* Mult_addsub.  */
     327        COSTS_N_INSNS (1),	/* Fma.  */
     328        COSTS_N_INSNS (1),	/* Addsub.  */
     329        COSTS_N_INSNS (1),	/* Fpconst.  */
     330        COSTS_N_INSNS (1),	/* Neg.  */
     331        COSTS_N_INSNS (1),	/* Compare.  */
     332        COSTS_N_INSNS (2),	/* Widen.  */
     333        COSTS_N_INSNS (2),	/* Narrow.  */
     334        COSTS_N_INSNS (2),	/* Toint.  */
     335        COSTS_N_INSNS (2),	/* Fromint.  */
     336        COSTS_N_INSNS (2) 	/* Roundint.  */
     337      }
     338    },
     339    /* Vector */
     340    {
     341      COSTS_N_INSNS (1),	/* Alu.  */
     342      COSTS_N_INSNS (4),	/* Mult.  */
     343      COSTS_N_INSNS (1),	/* movi.  */
     344      COSTS_N_INSNS (2),	/* dup.  */
     345      COSTS_N_INSNS (2)	/* extract.  */
     346    }
     347  };
     348  
     349  const struct cpu_cost_table thunderx3t110_extra_costs = 
     350  {
     351    /* ALU */
     352    {
     353      0,			/* Arith.  */
     354      0,			/* Logical.  */
     355      0,			/* Shift.  */
     356      0,			/* Shift_reg.  */
     357      COSTS_N_INSNS (1),	/* Arith_shift.  */
     358      COSTS_N_INSNS (1),	/* Arith_shift_reg.  */
     359      COSTS_N_INSNS (1),	/* Log_shift.  */
     360      COSTS_N_INSNS (1),	/* Log_shift_reg.  */
     361      0,			/* Extend.  */
     362      COSTS_N_INSNS (1),	/* Extend_arith.  */
     363      0,			/* Bfi.  */
     364      0,			/* Bfx.  */
     365      COSTS_N_INSNS (3),	/* Clz.  */
     366      0,			/* Rev.  */
     367      0,			/* Non_exec.  */
     368      true		/* Non_exec_costs_exec.  */
     369    },
     370    {
     371      /* MULT SImode */
     372      {
     373        COSTS_N_INSNS (4),	/* Simple.  */
     374        COSTS_N_INSNS (4),	/* Flag_setting.  */
     375        COSTS_N_INSNS (4),	/* Extend.  */
     376        COSTS_N_INSNS (5),	/* Add.  */
     377        COSTS_N_INSNS (5),	/* Extend_add.  */
     378        COSTS_N_INSNS (18)	/* Idiv.  */
     379      },
     380      /* MULT DImode */
     381      {
     382        COSTS_N_INSNS (4),       /* Simple.  */
     383        0,                       /* Flag_setting.  */
     384        COSTS_N_INSNS (4),       /* Extend.  */
     385        COSTS_N_INSNS (5),       /* Add.  */
     386        COSTS_N_INSNS (5),       /* Extend_add.  */
     387        COSTS_N_INSNS (26)       /* Idiv.  */
     388      }
     389    },
     390    /* LD/ST */
     391    {
     392      COSTS_N_INSNS (4),	/* Load.  */
     393      COSTS_N_INSNS (4),	/* Load_sign_extend.  */
     394      COSTS_N_INSNS (5),	/* Ldrd.  */
     395      COSTS_N_INSNS (4),	/* Ldm_1st.  */
     396      1,			/* Ldm_regs_per_insn_1st.  */
     397      1,			/* Ldm_regs_per_insn_subsequent.  */
     398      COSTS_N_INSNS (4),	/* Loadf.  */
     399      COSTS_N_INSNS (4),	/* Loadd.  */
     400      COSTS_N_INSNS (4),	/* Load_unaligned.  */
     401      0,			/* Store.  */
     402      0,			/* Strd.  */
     403      0,			/* Stm_1st.  */
     404      1,			/* Stm_regs_per_insn_1st.  */
     405      1,			/* Stm_regs_per_insn_subsequent.  */
     406      0,			/* Storef.  */
     407      0,			/* Stored.  */
     408      0,			/* Store_unaligned.  */
     409      COSTS_N_INSNS (1),	/* Loadv.  */
     410      COSTS_N_INSNS (1)	/* Storev.  */
     411    },
     412    {
     413      /* FP SFmode */
     414      {
     415        COSTS_N_INSNS (4),	/* Div.  */
     416        COSTS_N_INSNS (1),	/* Mult.  */
     417        COSTS_N_INSNS (1),	/* Mult_addsub. */
     418        COSTS_N_INSNS (1),	/* Fma.  */
     419        COSTS_N_INSNS (1),	/* Addsub.  */
     420        COSTS_N_INSNS (1),	/* Fpconst. */
     421        COSTS_N_INSNS (1),	/* Neg.  */
     422        COSTS_N_INSNS (1),	/* Compare.  */
     423        COSTS_N_INSNS (2),	/* Widen.  */
     424        COSTS_N_INSNS (2),	/* Narrow.  */
     425        COSTS_N_INSNS (2),	/* Toint.  */
     426        COSTS_N_INSNS (2),	/* Fromint.  */
     427        COSTS_N_INSNS (2) 	/* Roundint.  */
     428      },
     429      /* FP DFmode */
     430      {
     431        COSTS_N_INSNS (6),	/* Div.  */
     432        COSTS_N_INSNS (1),	/* Mult.  */
     433        COSTS_N_INSNS (1),	/* Mult_addsub.  */
     434        COSTS_N_INSNS (1),	/* Fma.  */
     435        COSTS_N_INSNS (1),	/* Addsub.  */
     436        COSTS_N_INSNS (1),	/* Fpconst.  */
     437        COSTS_N_INSNS (1),	/* Neg.  */
     438        COSTS_N_INSNS (1),	/* Compare.  */
     439        COSTS_N_INSNS (2),	/* Widen.  */
     440        COSTS_N_INSNS (2),	/* Narrow.  */
     441        COSTS_N_INSNS (2),	/* Toint.  */
     442        COSTS_N_INSNS (2),	/* Fromint.  */
     443        COSTS_N_INSNS (2) 	/* Roundint.  */
     444      }
     445    },
     446    /* Vector */
     447    {
     448      COSTS_N_INSNS (1),	/* Alu.  */
     449      COSTS_N_INSNS (4),	/* Mult.  */
     450      COSTS_N_INSNS (1),	/* movi.  */
     451      COSTS_N_INSNS (2),	/* dup.  */
     452      COSTS_N_INSNS (2)	/* extract.  */
     453    }
     454  };
     455  
     456  const struct cpu_cost_table tsv110_extra_costs =
     457  {
     458    /* ALU */
     459    {
     460      0,                 /* arith.  */
     461      0,                 /* logical.  */
     462      0,                 /* shift.  */
     463      0,                 /* shift_reg.  */
     464      COSTS_N_INSNS (1), /* arith_shift.  */
     465      COSTS_N_INSNS (1), /* arith_shift_reg.  */
     466      COSTS_N_INSNS (1), /* log_shift.  */
     467      COSTS_N_INSNS (1), /* log_shift_reg.  */
     468      0,                 /* extend.  */
     469      COSTS_N_INSNS (1), /* extend_arith.  */
     470      0,                 /* bfi.  */
     471      0,                 /* bfx.  */
     472      0,                 /* clz.  */
     473      0,                 /* rev.  */
     474      0,                 /* non_exec.  */
     475      true               /* non_exec_costs_exec.  */
     476    },
     477  
     478    {
     479      /* MULT SImode */
     480      {
     481        COSTS_N_INSNS (2),       /* simple.  */
     482        COSTS_N_INSNS (2),       /* flag_setting.  */
     483        COSTS_N_INSNS (2),       /* extend.  */
     484        COSTS_N_INSNS (2),       /* add.  */
     485        COSTS_N_INSNS (2),       /* extend_add.  */
     486        COSTS_N_INSNS (11)       /* idiv.  */
     487      },
     488      /* MULT DImode */
     489      {
     490        COSTS_N_INSNS (3),       /* simple.  */
     491        0,                       /* flag_setting (N/A).  */
     492        COSTS_N_INSNS (3),       /* extend.  */
     493        COSTS_N_INSNS (3),       /* add.  */
     494        COSTS_N_INSNS (3),       /* extend_add.  */
     495        COSTS_N_INSNS (19)       /* idiv.  */
     496      }
     497    },
     498    /* LD/ST */
     499    {
     500      COSTS_N_INSNS (3),         /* load.  */
     501      COSTS_N_INSNS (4),         /* load_sign_extend.  */
     502      COSTS_N_INSNS (3),         /* ldrd.  */
     503      COSTS_N_INSNS (3),         /* ldm_1st.  */
     504      1,                         /* ldm_regs_per_insn_1st.  */
     505      2,                         /* ldm_regs_per_insn_subsequent.  */
     506      COSTS_N_INSNS (4),         /* loadf.  */
     507      COSTS_N_INSNS (4),         /* loadd.  */
     508      COSTS_N_INSNS (4),         /* load_unaligned.  */
     509      0,                         /* store.  */
     510      0,                         /* strd.  */
     511      0,                         /* stm_1st.  */
     512      1,                         /* stm_regs_per_insn_1st.  */
     513      2,                         /* stm_regs_per_insn_subsequent.  */
     514      0,                         /* storef.  */
     515      0,                         /* stored.  */
     516      COSTS_N_INSNS (1),         /* store_unaligned.  */
     517      COSTS_N_INSNS (4),         /* loadv.  */
     518      COSTS_N_INSNS (4)          /* storev.  */
     519    },
     520    {
     521      /* FP SFmode */
     522      {
     523        COSTS_N_INSNS (10),      /* div.  */
     524        COSTS_N_INSNS (4),       /* mult.  */
     525        COSTS_N_INSNS (4),       /* mult_addsub.  */
     526        COSTS_N_INSNS (4),       /* fma.  */
     527        COSTS_N_INSNS (4),       /* 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      /* FP DFmode */
     538      {
     539        COSTS_N_INSNS (17),      /* div.  */
     540        COSTS_N_INSNS (4),       /* mult.  */
     541        COSTS_N_INSNS (6),       /* mult_addsub.  */
     542        COSTS_N_INSNS (6),       /* fma.  */
     543        COSTS_N_INSNS (3),       /* addsub.  */
     544        COSTS_N_INSNS (1),       /* fpconst.  */
     545        COSTS_N_INSNS (1),       /* neg.  */
     546        COSTS_N_INSNS (1),       /* compare.  */
     547        COSTS_N_INSNS (2),       /* widen.  */
     548        COSTS_N_INSNS (2),       /* narrow.  */
     549        COSTS_N_INSNS (2),       /* toint.  */
     550        COSTS_N_INSNS (1),       /* fromint.  */
     551        COSTS_N_INSNS (2)        /* roundint.  */
     552      }
     553    },
     554    /* Vector */
     555    {
     556      COSTS_N_INSNS (1),  /* alu.  */
     557      COSTS_N_INSNS (4),  /* mult.  */
     558      COSTS_N_INSNS (1),  /* movi.  */
     559      COSTS_N_INSNS (2),  /* dup.  */
     560      COSTS_N_INSNS (2)   /* extract.  */
     561    }
     562  };
     563  
     564  const struct cpu_cost_table a64fx_extra_costs =
     565  {
     566    /* ALU */
     567    {
     568      0,                 /* arith.  */
     569      0,                 /* logical.  */
     570      0,                 /* shift.  */
     571      0,                 /* shift_reg.  */
     572      COSTS_N_INSNS (1), /* arith_shift.  */
     573      COSTS_N_INSNS (1), /* arith_shift_reg.  */
     574      COSTS_N_INSNS (1), /* log_shift.  */
     575      COSTS_N_INSNS (1), /* log_shift_reg.  */
     576      0,                 /* extend.  */
     577      COSTS_N_INSNS (1), /* extend_arith.  */
     578      0,                 /* bfi.  */
     579      0,                 /* bfx.  */
     580      0,                 /* clz.  */
     581      0,                 /* rev.  */
     582      0,                 /* non_exec.  */
     583      true               /* non_exec_costs_exec.  */
     584    },
     585    {
     586      /* MULT SImode */
     587      {
     588        COSTS_N_INSNS (4),       /* simple.  */
     589        COSTS_N_INSNS (4),       /* flag_setting.  */
     590        COSTS_N_INSNS (4),       /* extend.  */
     591        COSTS_N_INSNS (5),       /* add.  */
     592        COSTS_N_INSNS (5),       /* extend_add.  */
     593        COSTS_N_INSNS (18)       /* idiv.  */
     594      },
     595      /* MULT DImode */
     596      {
     597        COSTS_N_INSNS (4),       /* simple.  */
     598        0,                       /* flag_setting (N/A).  */
     599        COSTS_N_INSNS (4),       /* extend.  */
     600        COSTS_N_INSNS (5),       /* add.  */
     601        COSTS_N_INSNS (5),       /* extend_add.  */
     602        COSTS_N_INSNS (26)       /* idiv.  */
     603      }
     604    },
     605    /* LD/ST */
     606    {
     607      COSTS_N_INSNS (4),         /* load.  */
     608      COSTS_N_INSNS (4),         /* load_sign_extend.  */
     609      COSTS_N_INSNS (5),         /* ldrd.  */
     610      COSTS_N_INSNS (4),         /* ldm_1st.  */
     611      1,                         /* ldm_regs_per_insn_1st.  */
     612      2,                         /* ldm_regs_per_insn_subsequent.  */
     613      COSTS_N_INSNS (4),         /* loadf.  */
     614      COSTS_N_INSNS (4),         /* loadd.  */
     615      COSTS_N_INSNS (5),         /* load_unaligned.  */
     616      0,                         /* store.  */
     617      0,                         /* strd.  */
     618      0,                         /* stm_1st.  */
     619      1,                         /* stm_regs_per_insn_1st.  */
     620      2,                         /* stm_regs_per_insn_subsequent.  */
     621      0,                         /* storef.  */
     622      0,                         /* stored.  */
     623      0,                         /* store_unaligned.  */
     624      COSTS_N_INSNS (1),         /* loadv.  */
     625      COSTS_N_INSNS (1)          /* storev.  */
     626    },
     627    {
     628      /* FP SFmode */
     629      {
     630        COSTS_N_INSNS (6),      /* div.  */
     631        COSTS_N_INSNS (1),       /* mult.  */
     632        COSTS_N_INSNS (1),       /* mult_addsub.  */
     633        COSTS_N_INSNS (2),       /* fma.  */
     634        COSTS_N_INSNS (1),       /* addsub.  */
     635        COSTS_N_INSNS (1),       /* fpconst.  */
     636        COSTS_N_INSNS (1),       /* neg.  */
     637        COSTS_N_INSNS (1),       /* compare.  */
     638        COSTS_N_INSNS (2),       /* widen.  */
     639        COSTS_N_INSNS (2),       /* narrow.  */
     640        COSTS_N_INSNS (2),       /* toint.  */
     641        COSTS_N_INSNS (2),       /* fromint.  */
     642        COSTS_N_INSNS (2)        /* roundint.  */
     643      },
     644      /* FP DFmode */
     645      {
     646        COSTS_N_INSNS (11),      /* div.  */
     647        COSTS_N_INSNS (1),       /* mult.  */
     648        COSTS_N_INSNS (1),       /* mult_addsub.  */
     649        COSTS_N_INSNS (2),       /* fma.  */
     650        COSTS_N_INSNS (1),       /* addsub.  */
     651        COSTS_N_INSNS (1),       /* fpconst.  */
     652        COSTS_N_INSNS (1),       /* neg.  */
     653        COSTS_N_INSNS (1),       /* compare.  */
     654        COSTS_N_INSNS (2),       /* widen.  */
     655        COSTS_N_INSNS (2),       /* narrow.  */
     656        COSTS_N_INSNS (2),       /* toint.  */
     657        COSTS_N_INSNS (2),       /* fromint.  */
     658        COSTS_N_INSNS (2)        /* roundint.  */
     659      }
     660    },
     661    /* Vector */
     662    {
     663      COSTS_N_INSNS (1),  /* alu.  */
     664      COSTS_N_INSNS (4),  /* mult.  */
     665      COSTS_N_INSNS (1),  /* movi.  */
     666      COSTS_N_INSNS (2),  /* dup.  */
     667      COSTS_N_INSNS (2)   /* extract.  */
     668    }
     669  };
     670  
     671  const struct cpu_cost_table ampere1_extra_costs =
     672  {
     673    /* ALU */
     674    {
     675      0,                 /* arith.  */
     676      0,                 /* logical.  */
     677      0,                 /* shift.  */
     678      COSTS_N_INSNS (1), /* shift_reg.  */
     679      0,                 /* arith_shift.  */
     680      COSTS_N_INSNS (1), /* arith_shift_reg.  */
     681      0,                 /* log_shift.  */
     682      COSTS_N_INSNS (1), /* log_shift_reg.  */
     683      0,                 /* extend.  */
     684      COSTS_N_INSNS (1), /* extend_arith.  */
     685      0,                 /* bfi.  */
     686      0,                 /* bfx.  */
     687      0,                 /* clz.  */
     688      0,                 /* rev.  */
     689      0,                 /* non_exec.  */
     690      true               /* non_exec_costs_exec.  */
     691    },
     692    {
     693      /* MULT SImode */
     694      {
     695        COSTS_N_INSNS (3),       /* simple.  */
     696        COSTS_N_INSNS (3),       /* flag_setting.  */
     697        COSTS_N_INSNS (3),       /* extend.  */
     698        COSTS_N_INSNS (4),       /* add.  */
     699        COSTS_N_INSNS (4),       /* extend_add.  */
     700        COSTS_N_INSNS (18)       /* idiv.  */
     701      },
     702      /* MULT DImode */
     703      {
     704        COSTS_N_INSNS (3),       /* simple.  */
     705        0,                       /* flag_setting (N/A).  */
     706        COSTS_N_INSNS (3),       /* extend.  */
     707        COSTS_N_INSNS (4),       /* add.  */
     708        COSTS_N_INSNS (4),       /* extend_add.  */
     709        COSTS_N_INSNS (34)       /* idiv.  */
     710      }
     711    },
     712    /* LD/ST */
     713    {
     714      COSTS_N_INSNS (4),         /* load.  */
     715      COSTS_N_INSNS (4),         /* load_sign_extend.  */
     716      0,                         /* ldrd (n/a).  */
     717      0,                         /* ldm_1st.  */
     718      0,                         /* ldm_regs_per_insn_1st.  */
     719      0,                         /* ldm_regs_per_insn_subsequent.  */
     720      COSTS_N_INSNS (5),         /* loadf.  */
     721      COSTS_N_INSNS (5),         /* loadd.  */
     722      COSTS_N_INSNS (5),         /* load_unaligned.  */
     723      0,                         /* store.  */
     724      0,                         /* strd.  */
     725      0,                         /* stm_1st.  */
     726      0,                         /* stm_regs_per_insn_1st.  */
     727      0,                         /* stm_regs_per_insn_subsequent.  */
     728      COSTS_N_INSNS (2),         /* storef.  */
     729      COSTS_N_INSNS (2),         /* stored.  */
     730      COSTS_N_INSNS (2),         /* store_unaligned.  */
     731      COSTS_N_INSNS (3),         /* loadv.  */
     732      COSTS_N_INSNS (3)          /* storev.  */
     733    },
     734    {
     735      /* FP SFmode */
     736      {
     737        COSTS_N_INSNS (25),      /* div.  */
     738        COSTS_N_INSNS (4),       /* mult.  */
     739        COSTS_N_INSNS (4),       /* mult_addsub.  */
     740        COSTS_N_INSNS (4),       /* fma.  */
     741        COSTS_N_INSNS (4),       /* addsub.  */
     742        COSTS_N_INSNS (2),       /* fpconst.  */
     743        COSTS_N_INSNS (4),       /* neg.  */
     744        COSTS_N_INSNS (4),       /* compare.  */
     745        COSTS_N_INSNS (4),       /* widen.  */
     746        COSTS_N_INSNS (4),       /* narrow.  */
     747        COSTS_N_INSNS (4),       /* toint.  */
     748        COSTS_N_INSNS (4),       /* fromint.  */
     749        COSTS_N_INSNS (4)        /* roundint.  */
     750      },
     751      /* FP DFmode */
     752      {
     753        COSTS_N_INSNS (34),      /* div.  */
     754        COSTS_N_INSNS (5),       /* mult.  */
     755        COSTS_N_INSNS (5),       /* mult_addsub.  */
     756        COSTS_N_INSNS (5),       /* fma.  */
     757        COSTS_N_INSNS (5),       /* addsub.  */
     758        COSTS_N_INSNS (2),       /* fpconst.  */
     759        COSTS_N_INSNS (5),       /* neg.  */
     760        COSTS_N_INSNS (5),       /* compare.  */
     761        COSTS_N_INSNS (5),       /* widen.  */
     762        COSTS_N_INSNS (5),       /* narrow.  */
     763        COSTS_N_INSNS (6),       /* toint.  */
     764        COSTS_N_INSNS (6),       /* fromint.  */
     765        COSTS_N_INSNS (5)        /* roundint.  */
     766      }
     767    },
     768    /* Vector */
     769    {
     770      COSTS_N_INSNS (3),  /* alu.  */
     771      COSTS_N_INSNS (3),  /* mult.  */
     772      COSTS_N_INSNS (2),  /* movi.  */
     773      COSTS_N_INSNS (2),  /* dup.  */
     774      COSTS_N_INSNS (2)   /* extract.  */
     775    }
     776  };
     777  
     778  const struct cpu_cost_table ampere1a_extra_costs =
     779  {
     780    /* ALU */
     781    {
     782      0,                 /* arith.  */
     783      0,                 /* logical.  */
     784      0,                 /* shift.  */
     785      COSTS_N_INSNS (1), /* shift_reg.  */
     786      0,                 /* arith_shift.  */
     787      COSTS_N_INSNS (1), /* arith_shift_reg.  */
     788      0,                 /* log_shift.  */
     789      COSTS_N_INSNS (1), /* log_shift_reg.  */
     790      0,                 /* extend.  */
     791      COSTS_N_INSNS (1), /* extend_arith.  */
     792      0,                 /* bfi.  */
     793      0,                 /* bfx.  */
     794      0,                 /* clz.  */
     795      0,                 /* rev.  */
     796      0,                 /* non_exec.  */
     797      true               /* non_exec_costs_exec.  */
     798    },
     799    {
     800      /* MULT SImode */
     801      {
     802        COSTS_N_INSNS (3),       /* simple.  */
     803        COSTS_N_INSNS (3),       /* flag_setting.  */
     804        COSTS_N_INSNS (3),       /* extend.  */
     805        COSTS_N_INSNS (4),       /* add.  */
     806        COSTS_N_INSNS (4),       /* extend_add.  */
     807        COSTS_N_INSNS (19)       /* idiv.  */
     808      },
     809      /* MULT DImode */
     810      {
     811        COSTS_N_INSNS (3),       /* simple.  */
     812        0,                       /* flag_setting (N/A).  */
     813        COSTS_N_INSNS (3),       /* extend.  */
     814        COSTS_N_INSNS (4),       /* add.  */
     815        COSTS_N_INSNS (4),       /* extend_add.  */
     816        COSTS_N_INSNS (35)       /* idiv.  */
     817      }
     818    },
     819    /* LD/ST */
     820    {
     821      COSTS_N_INSNS (4),         /* load.  */
     822      COSTS_N_INSNS (4),         /* load_sign_extend.  */
     823      0,                         /* ldrd (n/a).  */
     824      0,                         /* ldm_1st.  */
     825      0,                         /* ldm_regs_per_insn_1st.  */
     826      0,                         /* ldm_regs_per_insn_subsequent.  */
     827      COSTS_N_INSNS (5),         /* loadf.  */
     828      COSTS_N_INSNS (5),         /* loadd.  */
     829      COSTS_N_INSNS (5),         /* load_unaligned.  */
     830      0,                         /* store.  */
     831      0,                         /* strd.  */
     832      0,                         /* stm_1st.  */
     833      0,                         /* stm_regs_per_insn_1st.  */
     834      0,                         /* stm_regs_per_insn_subsequent.  */
     835      COSTS_N_INSNS (2),         /* storef.  */
     836      COSTS_N_INSNS (2),         /* stored.  */
     837      COSTS_N_INSNS (2),         /* store_unaligned.  */
     838      COSTS_N_INSNS (3),         /* loadv.  */
     839      COSTS_N_INSNS (3)          /* storev.  */
     840    },
     841    {
     842      /* FP SFmode */
     843      {
     844        COSTS_N_INSNS (25),      /* div.  */
     845        COSTS_N_INSNS (4),       /* mult.  */
     846        COSTS_N_INSNS (4),       /* mult_addsub.  */
     847        COSTS_N_INSNS (4),       /* fma.  */
     848        COSTS_N_INSNS (4),       /* addsub.  */
     849        COSTS_N_INSNS (2),       /* fpconst.  */
     850        COSTS_N_INSNS (4),       /* neg.  */
     851        COSTS_N_INSNS (4),       /* compare.  */
     852        COSTS_N_INSNS (4),       /* widen.  */
     853        COSTS_N_INSNS (4),       /* narrow.  */
     854        COSTS_N_INSNS (4),       /* toint.  */
     855        COSTS_N_INSNS (4),       /* fromint.  */
     856        COSTS_N_INSNS (4)        /* roundint.  */
     857      },
     858      /* FP DFmode */
     859      {
     860        COSTS_N_INSNS (34),      /* div.  */
     861        COSTS_N_INSNS (5),       /* mult.  */
     862        COSTS_N_INSNS (5),       /* mult_addsub.  */
     863        COSTS_N_INSNS (5),       /* fma.  */
     864        COSTS_N_INSNS (5),       /* addsub.  */
     865        COSTS_N_INSNS (2),       /* fpconst.  */
     866        COSTS_N_INSNS (5),       /* neg.  */
     867        COSTS_N_INSNS (5),       /* compare.  */
     868        COSTS_N_INSNS (5),       /* widen.  */
     869        COSTS_N_INSNS (5),       /* narrow.  */
     870        COSTS_N_INSNS (6),       /* toint.  */
     871        COSTS_N_INSNS (6),       /* fromint.  */
     872        COSTS_N_INSNS (5)        /* roundint.  */
     873      }
     874    },
     875    /* Vector */
     876    {
     877      COSTS_N_INSNS (3),  /* alu.  */
     878      COSTS_N_INSNS (3),  /* mult.  */
     879      COSTS_N_INSNS (2),  /* movi.  */
     880      COSTS_N_INSNS (2),  /* dup.  */
     881      COSTS_N_INSNS (2)   /* extract.  */
     882    }
     883  };
     884  
     885  #endif