|
| 1 | +;; DFA scheduling description of the Synopsys RHX-100 cpu |
| 2 | +;; for GNU C compiler |
| 3 | +;; Copyright (C) 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 |
| 8 | +;; it under the terms of the GNU General Public License as published by |
| 9 | +;; the Free Software Foundation; either version 3, or (at your option) |
| 10 | +;; any later version. |
| 11 | + |
| 12 | +;; GCC is distributed in the hope that it will be useful, |
| 13 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +;; GNU General Public 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 | +(define_automaton "arcv_rhx100") |
| 22 | + |
| 23 | +(define_cpu_unit "arcv_rhx100_ALU_A_fuse0_early" "arcv_rhx100") |
| 24 | +(define_cpu_unit "arcv_rhx100_ALU_A_fuse1_early" "arcv_rhx100") |
| 25 | +(define_cpu_unit "arcv_rhx100_ALU_B_fuse0_early" "arcv_rhx100") |
| 26 | +(define_cpu_unit "arcv_rhx100_ALU_B_fuse1_early" "arcv_rhx100") |
| 27 | +(define_cpu_unit "arcv_rhx100_MPY32" "arcv_rhx100") |
| 28 | +(define_cpu_unit "arcv_rhx100_DIV" "arcv_rhx100") |
| 29 | +(define_cpu_unit "arcv_rhx100_DMP_fuse0" "arcv_rhx100") |
| 30 | +(define_cpu_unit "arcv_rhx100_DMP_fuse1" "arcv_rhx100") |
| 31 | +(define_cpu_unit "arcv_rhx100_fdivsqrt" "arcv_rhx100") |
| 32 | +(define_cpu_unit "arcv_rhx100_issueA_fuse0" "arcv_rhx100") |
| 33 | +(define_cpu_unit "arcv_rhx100_issueA_fuse1" "arcv_rhx100") |
| 34 | +(define_cpu_unit "arcv_rhx100_issueB_fuse0" "arcv_rhx100") |
| 35 | +(define_cpu_unit "arcv_rhx100_issueB_fuse1" "arcv_rhx100") |
| 36 | + |
| 37 | +;; Instruction reservation for arithmetic instructions (pipe A, pipe B). |
| 38 | +(define_insn_reservation "arcv_rhx100_alu_early_arith" 1 |
| 39 | + (and (eq_attr "tune" "arcv_rhx100") |
| 40 | + (eq_attr "type" "unknown,move,const,arith,shift,slt,multi,auipc,nop,logical,\ |
| 41 | + bitmanip,min,max,minu,maxu,clz,ctz,atomic,\ |
| 42 | + condmove,mvpair,zicond,cpop,clmul")) |
| 43 | + "((arcv_rhx100_issueA_fuse0 + arcv_rhx100_ALU_A_fuse0_early) | (arcv_rhx100_issueA_fuse1 + arcv_rhx100_ALU_A_fuse1_early)) | ((arcv_rhx100_issueB_fuse0 + arcv_rhx100_ALU_B_fuse0_early) | (arcv_rhx100_issueB_fuse1 + arcv_rhx100_ALU_B_fuse1_early))") |
| 44 | + |
| 45 | +(define_insn_reservation "arcv_rhx100_jmp_insn" 1 |
| 46 | + (and (eq_attr "tune" "arcv_rhx100") |
| 47 | + (eq_attr "type" "branch,jump,call,jalr,ret,trap")) |
| 48 | + "arcv_rhx100_issueA_fuse0 | arcv_rhx100_issueA_fuse1") |
| 49 | + |
| 50 | +(define_insn_reservation "arcv_rhx100_div_insn" 12 |
| 51 | + (and (eq_attr "tune" "arcv_rhx100") |
| 52 | + (eq_attr "type" "idiv")) |
| 53 | + "arcv_rhx100_issueA_fuse0 + arcv_rhx100_DIV, nothing*11") |
| 54 | + |
| 55 | +(define_insn_reservation "arcv_rhx100_mpy32_insn" 4 |
| 56 | + (and (eq_attr "tune" "arcv_rhx100") |
| 57 | + (eq_attr "type" "imul")) |
| 58 | + "arcv_rhx100_issueA_fuse0 + arcv_rhx100_MPY32, nothing*3") |
| 59 | + |
| 60 | +(define_insn_reservation "arcv_rhx100_load_insn" 3 |
| 61 | + (and (eq_attr "tune" "arcv_rhx100") |
| 62 | + (eq_attr "type" "load,fpload")) |
| 63 | + "(arcv_rhx100_issueB_fuse0 + arcv_rhx100_DMP_fuse0) | (arcv_rhx100_issueB_fuse1 + arcv_rhx100_DMP_fuse1)") |
| 64 | + |
| 65 | +(define_insn_reservation "arcv_rhx100_store_insn" 1 |
| 66 | + (and (eq_attr "tune" "arcv_rhx100") |
| 67 | + (eq_attr "type" "store,fpstore")) |
| 68 | + "(arcv_rhx100_issueB_fuse0 + arcv_rhx100_DMP_fuse0) | (arcv_rhx100_issueB_fuse1 + arcv_rhx100_DMP_fuse1)") |
| 69 | + |
| 70 | +;; (soft) floating points |
| 71 | +(define_insn_reservation "arcv_rhx100_xfer" 3 |
| 72 | + (and (eq_attr "tune" "arcv_rhx100") |
| 73 | + (eq_attr "type" "mfc,mtc,fcvt,fcvt_i2f,fcvt_f2i,fmove,fcmp")) |
| 74 | + "(arcv_rhx100_ALU_A_fuse0_early | arcv_rhx100_ALU_B_fuse0_early), nothing*2") |
| 75 | + |
| 76 | +(define_insn_reservation "arcv_rhx100_fmul" 5 |
| 77 | + (and (eq_attr "tune" "arcv_rhx100") |
| 78 | + (eq_attr "type" "fadd,fmul,fmadd")) |
| 79 | + "(arcv_rhx100_ALU_A_fuse0_early | arcv_rhx100_ALU_B_fuse0_early)") |
| 80 | + |
| 81 | +(define_insn_reservation "arcv_rhx100_fdiv" 20 |
| 82 | + (and (eq_attr "tune" "arcv_rhx100") |
| 83 | + (eq_attr "type" "fdiv,fsqrt")) |
| 84 | + "arcv_rhx100_fdivsqrt*20") |
| 85 | + |
| 86 | +;(final_presence_set "arcv_rhx100_issueA_fuse1" "arcv_rhx100_issueA_fuse0") |
| 87 | +;(final_presence_set "arcv_rhx100_issueB_fuse1" "arcv_rhx100_issueB_fuse0") |
| 88 | +;(final_presence_set "arcv_rhx100_ALU_A_fuse1_early" "arcv_rhx100_ALU_A_fuse0_early") |
| 89 | +;(final_presence_set "arcv_rhx100_ALU_B_fuse1_early" "arcv_rhx100_ALU_B_fuse0_early") |
| 90 | + |
| 91 | +;; Bypasses |
| 92 | +;(define_bypass 0 "arcv_rhx100_alu_early_arith" "arcv_rhx100_store_insn" "riscv_store_data_bypass_p") |
| 93 | +(define_bypass 1 "arcv_rhx100_alu_early_arith" "arcv_rhx100_store_insn" "riscv_store_data_bypass_p") |
| 94 | + |
| 95 | +;(define_bypass 0 "arcv_rhx100_load_insn" "arcv_rhx100_store_insn" "riscv_store_data_bypass_p") |
| 96 | +(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_store_insn" "riscv_store_data_bypass_p") |
| 97 | +(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_alu_early_arith") |
| 98 | +(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_mpy*_insn") |
| 99 | +(define_bypass 2 "arcv_rhx100_load_insn" "arcv_rhx100_load_insn") |
| 100 | +(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_div_insn") |
| 101 | + |
| 102 | +(define_bypass 3 "arcv_rhx100_mpy32_insn" "arcv_rhx100_mpy*_insn") |
| 103 | +(define_bypass 3 "arcv_rhx100_mpy32_insn" "arcv_rhx100_div_insn") |
0 commit comments