summaryrefslogtreecommitdiff
path: root/gcc/config/arm/vfp11.md
blob: 9fac4ce2cf6606d9b771f331f1f61b6ee59ebbe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
;; ARM VFP11 pipeline description
;; Copyright (C) 2003-2016 Free Software Foundation, Inc.
;; Written by CodeSourcery.
;;
;; 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/>.

(define_automaton "vfp11")

;; There are 3 pipelines in the VFP11 unit.
;;
;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from
;;   fourth stage for simple operations.
;;
;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns.
;;   These insns also uses first execute stage of FMAC pipeline.
;;
;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from
;;   second memory stage for loads.

;; We do not model Write-After-Read hazards.
;; We do not do write scheduling with the arm core, so it is only necessary
;; to model the first stage of each pipeline
;; ??? Need to model LS pipeline properly for load/store multiple?
;; We do not model fmstat properly.  This could be done by modeling pipelines
;; properly and defining an absence set between a dummy fmstat unit and all
;; other vfp units.

(define_cpu_unit "fmac" "vfp11")

(define_cpu_unit "ds" "vfp11")

(define_cpu_unit "vfp_ls" "vfp11")

(define_cpu_unit "fmstat" "vfp11")

(exclusion_set "fmac,ds" "fmstat")

(define_insn_reservation "vfp_ffarith" 4
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "fmov,ffariths,ffarithd,fcmps,fcmpd"))
 "fmac")

(define_insn_reservation "vfp_farith" 8
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "fadds,faddd,fconsts,fconstd,f_cvt,f_cvtf2i,f_cvti2f,\
                       fmuls,fmacs,ffmas"))
 "fmac")

(define_insn_reservation "vfp_fmul" 9
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "fmuld,fmacd,ffmad"))
 "fmac*2")

(define_insn_reservation "vfp_fdivs" 19
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "fdivs, fsqrts"))
 "ds*15")

(define_insn_reservation "vfp_fdivd" 33
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "fdivd, fsqrtd"))
 "fmac+ds*29")

;; Moves to/from arm regs also use the load/store pipeline.
(define_insn_reservation "vfp_fload" 4
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "f_loads,f_loadd,f_mcr,f_mcrr"))
 "vfp_ls")

(define_insn_reservation "vfp_fstore" 4
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "f_stores,f_stored,f_mrc,f_mrrc"))
 "vfp_ls")

(define_insn_reservation "vfp_to_cpsr" 4
 (and (eq_attr "generic_vfp" "yes")
      (eq_attr "type" "f_flag"))
 "fmstat,vfp_ls*3")