1 1.1 mrg ;; Pipeline model for LoongArch LA464 cores. 2 1.1 mrg 3 1.1 mrg ;; Copyright (C) 2021-2022 Free Software Foundation, Inc. 4 1.1 mrg ;; Contributed by Loongson Ltd. 5 1.1 mrg 6 1.1 mrg ;; This file is part of GCC. 7 1.1 mrg ;; 8 1.1 mrg ;; GCC is free software; you can redistribute it and/or modify it 9 1.1 mrg ;; under the terms of the GNU General Public License as published 10 1.1 mrg ;; by the Free Software Foundation; either version 3, or (at your 11 1.1 mrg ;; option) any later version. 12 1.1 mrg ;; 13 1.1 mrg ;; GCC is distributed in the hope that it will be useful, but WITHOUT 14 1.1 mrg ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 1.1 mrg ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 1.1 mrg ;; License for more details. 17 1.1 mrg ;; 18 1.1 mrg ;; You should have received a copy of the GNU General Public License 19 1.1 mrg ;; along with GCC; see the file COPYING3. If not see 20 1.1 mrg ;; <http://www.gnu.org/licenses/>. 21 1.1 mrg 22 1.1 mrg ;; Uncomment the following line to output automata for debugging. 23 1.1 mrg ;; (automata_option "v") 24 1.1 mrg 25 1.1 mrg ;; Automaton for integer instructions. 26 1.1 mrg (define_automaton "la464_a_alu") 27 1.1 mrg 28 1.1 mrg ;; Automaton for floating-point instructions. 29 1.1 mrg (define_automaton "la464_a_falu") 30 1.1 mrg 31 1.1 mrg ;; Automaton for memory operations. 32 1.1 mrg (define_automaton "la464_a_mem") 33 1.1 mrg 34 1.1 mrg ;; Describe the resources. 35 1.1 mrg 36 1.1 mrg (define_cpu_unit "la464_alu1" "la464_a_alu") 37 1.1 mrg (define_cpu_unit "la464_alu2" "la464_a_alu") 38 1.1 mrg (define_cpu_unit "la464_mem1" "la464_a_mem") 39 1.1 mrg (define_cpu_unit "la464_mem2" "la464_a_mem") 40 1.1 mrg (define_cpu_unit "la464_falu1" "la464_a_falu") 41 1.1 mrg (define_cpu_unit "la464_falu2" "la464_a_falu") 42 1.1 mrg 43 1.1 mrg ;; Describe instruction reservations. 44 1.1 mrg 45 1.1 mrg (define_insn_reservation "la464_arith" 1 46 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 47 1.1 mrg (eq_attr "type" "arith,clz,const,logical, 48 1.1 mrg move,nop,shift,signext,slt")) 49 1.1 mrg "la464_alu1 | la464_alu2") 50 1.1 mrg 51 1.1 mrg (define_insn_reservation "la464_branch" 1 52 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 53 1.1 mrg (eq_attr "type" "branch,jump,call,condmove,trap")) 54 1.1 mrg "la464_alu1 | la464_alu2") 55 1.1 mrg 56 1.1 mrg (define_insn_reservation "la464_imul" 7 57 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 58 1.1 mrg (eq_attr "type" "imul")) 59 1.1 mrg "la464_alu1 | la464_alu2") 60 1.1 mrg 61 1.1 mrg (define_insn_reservation "la464_idiv_si" 12 62 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 63 1.1 mrg (and (eq_attr "type" "idiv") 64 1.1 mrg (eq_attr "mode" "SI"))) 65 1.1 mrg "la464_alu1 | la464_alu2") 66 1.1 mrg 67 1.1 mrg (define_insn_reservation "la464_idiv_di" 25 68 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 69 1.1 mrg (and (eq_attr "type" "idiv") 70 1.1 mrg (eq_attr "mode" "DI"))) 71 1.1 mrg "la464_alu1 | la464_alu2") 72 1.1 mrg 73 1.1 mrg (define_insn_reservation "la464_load" 4 74 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 75 1.1 mrg (eq_attr "type" "load")) 76 1.1 mrg "la464_mem1 | la464_mem2") 77 1.1 mrg 78 1.1 mrg (define_insn_reservation "la464_gpr_fp" 16 79 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 80 1.1 mrg (eq_attr "type" "mftg,mgtf")) 81 1.1 mrg "la464_mem1") 82 1.1 mrg 83 1.1 mrg (define_insn_reservation "la464_fpload" 4 84 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 85 1.1 mrg (eq_attr "type" "fpload")) 86 1.1 mrg "la464_mem1 | la464_mem2") 87 1.1 mrg 88 1.1 mrg (define_insn_reservation "la464_prefetch" 0 89 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 90 1.1 mrg (eq_attr "type" "prefetch,prefetchx")) 91 1.1 mrg "la464_mem1 | la464_mem2") 92 1.1 mrg 93 1.1 mrg (define_insn_reservation "la464_store" 0 94 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 95 1.1 mrg (eq_attr "type" "store,fpstore,fpidxstore")) 96 1.1 mrg "la464_mem1 | la464_mem2") 97 1.1 mrg 98 1.1 mrg (define_insn_reservation "la464_fadd" 4 99 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 100 1.1 mrg (eq_attr "type" "fadd,fmul,fmadd")) 101 1.1 mrg "la464_falu1 | la464_falu2") 102 1.1 mrg 103 1.1 mrg (define_insn_reservation "la464_fcmp" 2 104 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 105 1.1 mrg (eq_attr "type" "fabs,fcmp,fmove,fneg")) 106 1.1 mrg "la464_falu1 | la464_falu2") 107 1.1 mrg 108 1.1 mrg (define_insn_reservation "la464_fcvt" 4 109 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 110 1.1 mrg (eq_attr "type" "fcvt")) 111 1.1 mrg "la464_falu1 | la464_falu2") 112 1.1 mrg 113 1.1 mrg (define_insn_reservation "la464_fdiv_sf" 12 114 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 115 1.1 mrg (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") 116 1.1 mrg (eq_attr "mode" "SF"))) 117 1.1 mrg "la464_falu1 | la464_falu2") 118 1.1 mrg 119 1.1 mrg (define_insn_reservation "la464_fdiv_df" 19 120 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 121 1.1 mrg (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") 122 1.1 mrg (eq_attr "mode" "DF"))) 123 1.1 mrg "la464_falu1 | la464_falu2") 124 1.1 mrg 125 1.1 mrg ;; Force single-dispatch for unknown or multi. 126 1.1 mrg (define_insn_reservation "la464_unknown" 1 127 1.1 mrg (and (match_test "TARGET_TUNE_LA464") 128 1.1 mrg (eq_attr "type" "unknown,multi,atomic,syncloop")) 129 1.1 mrg "la464_alu1 + la464_alu2 + la464_falu1 130 1.1 mrg + la464_falu2 + la464_mem1 + la464_mem2") 131 1.1 mrg 132 1.1 mrg ;; End of DFA-based pipeline description for la464 133