summaryrefslogtreecommitdiff
path: root/gcc/config/mips/xlr.md
blob: 7b6e55b7e31ae1ef8434f03f422c23568885c8c2 (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
94
;; DFA-based pipeline description for the XLR.
;;   Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
;;
;; xlr.md   Machine Description for the RMI XLR Microprocessor
;; 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 "xlr_main,xlr_muldiv")

;; Definitions for xlr_main automaton.
(define_cpu_unit "xlr_main_pipe" "xlr_main")

(define_insn_reservation "ir_xlr_alu_slt" 2
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "slt"))
  "xlr_main_pipe")

(define_insn_reservation "ir_xlr_alu_clz" 2
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "clz"))
  "xlr_main_pipe")

;; Integer arithmetic instructions.
(define_insn_reservation "ir_xlr_alu" 1
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "move,arith,shift,logical,signext,const,unknown,multi,nop,trap,atomic,syncloop"))
  "xlr_main_pipe")

;; Integer arithmetic instructions.
(define_insn_reservation "ir_xlr_condmove" 2
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "condmove"))
  "xlr_main_pipe")

;; Load/store instructions.
(define_insn_reservation "ir_xlr_load" 4
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "load"))
  "xlr_main_pipe")

(define_insn_reservation "ir_xlr_store" 1
  (and  (eq_attr "cpu" "xlr") 
        (eq_attr "type" "store"))
  "xlr_main_pipe")

(define_insn_reservation "ir_xlr_prefetch_x" 1
  (and (eq_attr "cpu" "xlr")
       (eq_attr "type" "prefetch,prefetchx"))
  "xlr_main_pipe")

;; Branch instructions - use branch misprediction latency.
(define_insn_reservation "ir_xlr_branch" 1
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "branch,jump,call"))
  "xlr_main_pipe")

;; Coprocessor move instructions.
(define_insn_reservation "ir_xlr_xfer" 2
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "mtc,mfc"))
  "xlr_main_pipe")

(define_bypass 5 "ir_xlr_xfer" "ir_xlr_xfer")

;; Definitions for the xlr_muldiv automaton.
(define_cpu_unit "xlr_imuldiv_nopipe" "xlr_muldiv")

(define_insn_reservation "ir_xlr_imul" 8
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "imul,imul3,imadd"))
  "xlr_main_pipe,xlr_imuldiv_nopipe*6")

(define_insn_reservation "ir_xlr_div" 68
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "idiv"))
  "xlr_main_pipe,xlr_imuldiv_nopipe*67")

(define_insn_reservation "xlr_hilo" 2
  (and (eq_attr "cpu" "xlr") 
       (eq_attr "type" "mfhi,mflo,mthi,mtlo"))
  "xlr_imuldiv_nopipe")