1 ;; Generic DFA-based pipeline description for RISC-V targets.
2 ;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
3 ;; Contributed by Andrew Waterman (andrew@sifive.com).
4 ;; Based on MIPS target for GNU compiler.
6 ;; This file is part of GCC.
8 ;; GCC is free software; you can redistribute it and/or modify it
9 ;; under the terms of the GNU General Public License as published
10 ;; by the Free Software Foundation; either version 3, or (at your
11 ;; option) any later version.
13 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
14 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 ;; License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>.
23 (define_automaton "pipe0")
24 (define_cpu_unit "alu" "pipe0")
25 (define_cpu_unit "imuldiv" "pipe0")
26 (define_cpu_unit "fdivsqrt" "pipe0")
28 (define_insn_reservation "generic_alu" 1
29 (eq_attr "type" "unknown,const,arith,shift,slt,multi,nop,logical,move")
32 (define_insn_reservation "generic_load" 3
33 (eq_attr "type" "load,fpload")
36 (define_insn_reservation "generic_store" 1
37 (eq_attr "type" "store,fpstore")
40 (define_insn_reservation "generic_xfer" 3
41 (eq_attr "type" "mfc,mtc,fcvt,fmove,fcmp")
44 (define_insn_reservation "generic_branch" 1
45 (eq_attr "type" "branch,jump,call")
48 (define_insn_reservation "generic_imul" 10
49 (eq_attr "type" "imul")
52 (define_insn_reservation "generic_idivsi" 34
53 (and (eq_attr "type" "idiv")
54 (eq_attr "mode" "SI"))
57 (define_insn_reservation "generic_idivdi" 66
58 (and (eq_attr "type" "idiv")
59 (eq_attr "mode" "DI"))
62 (define_insn_reservation "generic_fmul_single" 5
63 (and (eq_attr "type" "fadd,fmul,fmadd")
64 (eq_attr "mode" "SF"))
67 (define_insn_reservation "generic_fmul_double" 7
68 (and (eq_attr "type" "fadd,fmul,fmadd")
69 (eq_attr "mode" "DF"))
72 (define_insn_reservation "generic_fdiv" 20
73 (eq_attr "type" "fdiv")
76 (define_insn_reservation "generic_fsqrt" 25
77 (eq_attr "type" "fsqrt")