]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/riscv/generic.md
Update copyright years.
[thirdparty/gcc.git] / gcc / config / riscv / generic.md
CommitLineData
09cae750 1;; Generic DFA-based pipeline description for RISC-V targets.
8d9254fc 2;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
09cae750
PD
3;; Contributed by Andrew Waterman (andrew@sifive.com).
4;; Based on MIPS target for GNU compiler.
5
6;; This file is part of GCC.
7
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.
12
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.
17
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/>.
21
22
23(define_automaton "pipe0")
24(define_cpu_unit "alu" "pipe0")
25(define_cpu_unit "imuldiv" "pipe0")
26(define_cpu_unit "fdivsqrt" "pipe0")
27
28(define_insn_reservation "generic_alu" 1
88108b27
AW
29 (and (eq_attr "tune" "generic")
30 (eq_attr "type" "unknown,const,arith,shift,slt,multi,auipc,nop,logical,move"))
09cae750
PD
31 "alu")
32
33(define_insn_reservation "generic_load" 3
88108b27
AW
34 (and (eq_attr "tune" "generic")
35 (eq_attr "type" "load,fpload"))
09cae750
PD
36 "alu")
37
38(define_insn_reservation "generic_store" 1
88108b27
AW
39 (and (eq_attr "tune" "generic")
40 (eq_attr "type" "store,fpstore"))
09cae750
PD
41 "alu")
42
43(define_insn_reservation "generic_xfer" 3
88108b27
AW
44 (and (eq_attr "tune" "generic")
45 (eq_attr "type" "mfc,mtc,fcvt,fmove,fcmp"))
09cae750
PD
46 "alu")
47
48(define_insn_reservation "generic_branch" 1
88108b27
AW
49 (and (eq_attr "tune" "generic")
50 (eq_attr "type" "branch,jump,call"))
09cae750
PD
51 "alu")
52
53(define_insn_reservation "generic_imul" 10
88108b27
AW
54 (and (eq_attr "tune" "generic")
55 (eq_attr "type" "imul"))
09cae750
PD
56 "imuldiv*10")
57
58(define_insn_reservation "generic_idivsi" 34
88108b27
AW
59 (and (eq_attr "tune" "generic")
60 (and (eq_attr "type" "idiv")
61 (eq_attr "mode" "SI")))
09cae750
PD
62 "imuldiv*34")
63
64(define_insn_reservation "generic_idivdi" 66
88108b27
AW
65 (and (eq_attr "tune" "generic")
66 (and (eq_attr "type" "idiv")
67 (eq_attr "mode" "DI")))
09cae750
PD
68 "imuldiv*66")
69
70(define_insn_reservation "generic_fmul_single" 5
88108b27
AW
71 (and (eq_attr "tune" "generic")
72 (and (eq_attr "type" "fadd,fmul,fmadd")
73 (eq_attr "mode" "SF")))
09cae750
PD
74 "alu")
75
76(define_insn_reservation "generic_fmul_double" 7
88108b27
AW
77 (and (eq_attr "tune" "generic")
78 (and (eq_attr "type" "fadd,fmul,fmadd")
79 (eq_attr "mode" "DF")))
09cae750
PD
80 "alu")
81
82(define_insn_reservation "generic_fdiv" 20
88108b27
AW
83 (and (eq_attr "tune" "generic")
84 (eq_attr "type" "fdiv"))
09cae750
PD
85 "fdivsqrt*20")
86
87(define_insn_reservation "generic_fsqrt" 25
88108b27
AW
88 (and (eq_attr "tune" "generic")
89 (eq_attr "type" "fsqrt"))
09cae750 90 "fdivsqrt*25")