xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/riscv/generic.md (revision 6cd39ddb8550f6fa1bff3fed32053d7f19fd0453)
1;; Generic DFA-based pipeline description for RISC-V targets.
2;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
3;; Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley.
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;; This file is derived from the old define_function_unit description.
24;; Each reservation can be overridden on a processor-by-processor basis.
25
26(define_insn_reservation "generic_alu" 1
27  (eq_attr "type" "unknown,const,arith,shift,slt,multi,nop,logical,move")
28  "alu")
29
30(define_insn_reservation "generic_load" 3
31  (eq_attr "type" "load,fpload,fpidxload")
32  "alu")
33
34(define_insn_reservation "generic_store" 1
35  (eq_attr "type" "store,fpstore,fpidxstore")
36  "alu")
37
38(define_insn_reservation "generic_xfer" 2
39  (eq_attr "type" "mfc,mtc")
40  "alu")
41
42(define_insn_reservation "generic_branch" 1
43  (eq_attr "type" "branch,jump,call")
44  "alu")
45
46(define_insn_reservation "generic_imul" 17
47  (eq_attr "type" "imul")
48  "imuldiv*17")
49
50(define_insn_reservation "generic_idiv" 38
51  (eq_attr "type" "idiv")
52  "imuldiv*38")
53
54(define_insn_reservation "generic_fcvt" 1
55  (eq_attr "type" "fcvt")
56  "alu")
57
58(define_insn_reservation "generic_fmove" 2
59  (eq_attr "type" "fmove")
60  "alu")
61
62(define_insn_reservation "generic_fcmp" 3
63  (eq_attr "type" "fcmp")
64  "alu")
65
66(define_insn_reservation "generic_fadd" 4
67  (eq_attr "type" "fadd")
68  "alu")
69
70(define_insn_reservation "generic_fmul_single" 7
71  (and (eq_attr "type" "fmul,fmadd")
72       (eq_attr "mode" "SF"))
73  "alu")
74
75(define_insn_reservation "generic_fmul_double" 8
76  (and (eq_attr "type" "fmul,fmadd")
77       (eq_attr "mode" "DF"))
78  "alu")
79
80(define_insn_reservation "generic_fdiv_single" 23
81  (and (eq_attr "type" "fdiv")
82       (eq_attr "mode" "SF"))
83  "alu")
84
85(define_insn_reservation "generic_fdiv_double" 36
86  (and (eq_attr "type" "fdiv")
87       (eq_attr "mode" "DF"))
88  "alu")
89
90(define_insn_reservation "generic_fsqrt_single" 54
91  (and (eq_attr "type" "fsqrt")
92       (eq_attr "mode" "SF"))
93  "alu")
94
95(define_insn_reservation "generic_fsqrt_double" 112
96  (and (eq_attr "type" "fsqrt")
97       (eq_attr "mode" "DF"))
98  "alu")
99