5400.md 5.49 KB
Newer Older
1
;; Copyright (C) 2002-2018 Free Software Foundation, Inc.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
;;
;; This file is part of GCC.
;;
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3.  If not see
;; <http://www.gnu.org/licenses/>.
;;
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
;; DFA-based pipeline description for 5400
(define_automaton "vr54")
(define_cpu_unit "vr54_dp0"     "vr54")
(define_cpu_unit "vr54_dp1"     "vr54")
(define_cpu_unit "vr54_mem"     "vr54")
(define_cpu_unit "vr54_mac"     "vr54")

;;
;; The ordering of the instruction-execution-path/resource-usage
;; descriptions (also known as reservation RTL) is roughly ordered
;; based on the define attribute RTL for the "type" classification.
;; When modifying, remember that the first test that matches is the
;; reservation used!
;;

(define_insn_reservation "ir_vr54_unknown" 1
  (and (eq_attr "cpu" "r5400")
36
       (eq_attr "type" "unknown,atomic,syncloop"))
37 38 39 40 41 42 43 44 45 46
  "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac")

;; Assume prediction fails.
(define_insn_reservation "ir_vr54_branch" 3
  (and (eq_attr "cpu" "r5400")
       (eq_attr "type" "branch,jump,call"))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_load" 2
  (and (eq_attr "cpu" "r5400")
47
       (eq_attr "type" "load,fpload,fpidxload"))
48 49 50 51
  "vr54_mem")

(define_insn_reservation "ir_vr54_store" 1
  (and (eq_attr "cpu" "r5400")
52
       (eq_attr "type" "store"))
53 54 55 56
  "vr54_mem")

(define_insn_reservation "ir_vr54_fstore" 1
  (and (eq_attr "cpu" "r5400")
57
       (eq_attr "type" "fpstore,fpidxstore"))
58 59 60 61
  "vr54_mem")


;; This reservation is for conditional move based on integer
62 63
;; or floating point CC.
(define_insn_reservation "ir_vr54_condmove" 4
64
  (and (eq_attr "cpu" "r5400")
65
       (eq_attr "type" "condmove"))
66 67 68 69 70
  "vr54_dp0|vr54_dp1")

;; Move to/from FPU registers
(define_insn_reservation "ir_vr54_xfer" 2
  (and (eq_attr "cpu" "r5400")
71
       (eq_attr "type" "mfc,mtc"))
72 73 74 75
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_hilo" 1
  (and (eq_attr "cpu" "r5400")
76
       (eq_attr "type" "mthi,mtlo,mfhi,mflo"))
77 78 79 80
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_arith" 1
  (and (eq_attr "cpu" "r5400")
81
       (eq_attr "type" "arith,shift,signext,slt,clz,const,logical,move,nop,trap"))
82 83 84 85
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_imul_si" 3
  (and (eq_attr "cpu" "r5400")
David Ung committed
86
       (and (eq_attr "type" "imul,imul3")
87 88 89 90 91
            (eq_attr "mode" "SI")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_imul_di" 4
  (and (eq_attr "cpu" "r5400")
David Ung committed
92
       (and (eq_attr "type" "imul,imul3")
93 94 95 96 97
            (eq_attr "mode" "DI")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_imadd_si" 3
  (and (eq_attr "cpu" "r5400")
David Ung committed
98
       (eq_attr "type" "imul,imul3"))
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
  "vr54_mac")

(define_insn_reservation "ir_vr54_idiv_si" 42
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "idiv")
            (eq_attr "mode" "SI")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_idiv_di" 74
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "idiv")
            (eq_attr "mode" "DI")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fadd" 4
  (and (eq_attr "cpu" "r5400")
       (eq_attr "type" "fadd"))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fmul_sf" 5
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "fmul")
            (eq_attr "mode" "SF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fmul_df" 6
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "fmul")
            (eq_attr "mode" "DF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fmadd_sf" 9
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "fmadd")
            (eq_attr "mode" "SF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fmadd_df" 10
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "fmadd")
            (eq_attr "mode" "DF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fdiv_sf" 42
  (and (eq_attr "cpu" "r5400")
144
       (and (eq_attr "type" "fdiv,frdiv,fsqrt")
145 146 147 148 149
            (eq_attr "mode" "SF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fdiv_df" 72
  (and (eq_attr "cpu" "r5400")
150
       (and (eq_attr "type" "fdiv,frdiv,fsqrt")
151 152 153 154 155
            (eq_attr "mode" "DF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fabs" 2
  (and (eq_attr "cpu" "r5400")
156
       (eq_attr "type" "fabs,fneg,fmove"))
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fcmp" 2
  (and (eq_attr "cpu" "r5400")
       (eq_attr "type" "fcmp"))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_fcvt" 6
  (and (eq_attr "cpu" "r5400")
       (eq_attr "type" "fcvt"))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_frsqrt_sf" 61
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "frsqrt")
            (eq_attr "mode" "SF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_frsqrt_df" 121
  (and (eq_attr "cpu" "r5400")
       (and (eq_attr "type" "frsqrt")
            (eq_attr "mode" "DF")))
  "vr54_dp0|vr54_dp1")

(define_insn_reservation "ir_vr54_multi" 1
  (and (eq_attr "cpu" "r5400")
       (eq_attr "type" "multi"))
  "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac")