aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/cil32/cil32.md
blob: 6b6587ff76ba6cfbed0195fe191192b27c26c37f (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
;; GCC machine description for cil32.
;;
;;    Copyright (C) 2006 Free Software Foundation, Inc.
;;
;; 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 2, 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 COPYING.  If not, write to the Free
;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
;; 02110-1301, USA.
;;
;; Authors:
;;    Andrea Bona
;;    Andrea Ornstein
;;    Erven Rohou
;;    Roberto Costa
;;
;; Contact information at STMicroelectronics:
;; Roberto Costa <roberto.costa@st.com>

;; See files "md.texi" and "rtl.def" for documentation on define_insn,
;; match_*, et. al.

;; Register numbers.
(define_constants
  [(CIL32_FAKE_REG 0)]
)


(define_mode_macro ALLMODES [SI HI QI DI SF DF])
(define_mode_macro ALLEVALMODES [SI DI SF DF])
(define_mode_macro ALLINTEVALMODES [SI DI])

(define_mode_macro VECMODES [V8QI V4HI V2SI V4QI V2HI])


;; Jump and branch insns.

(define_insn "jump"
  [(set (pc)
	(label_ref (match_operand 0 "" "")))]
  "1"
  ""
  [])

(define_insn "indirect_jump"
  [(set (pc) (match_operand:SI 0 "nonimmediate_operand" "rm"))]
  ""
  "")

;; Move insns.

(define_insn "mov<mode>"
  [(set (match_operand:ALLMODES 0 "nonimmediate_operand" "")
	(match_operand:ALLMODES 1 "general_operand" ""))]
  ""
  "")

;; Move for vectors
(define_insn "mov<mode>"
  [(set (match_operand:VECMODES 0 "nonimmediate_operand" "")
	(match_operand:VECMODES 1 "general_operand" ""))]
  ""
  "")


;; Add insns.

(define_insn "add<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(plus:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "add")

(define_insn "sub<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(minus:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "sub")

(define_insn "mul<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(mult:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "mul")

(define_insn "div<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(div:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "div")

(define_insn "udiv<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(udiv:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "div.un")

(define_insn "mod<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(mod:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "rem")

(define_insn "umod<mode>3"
  [(set (match_operand:ALLEVALMODES 0 "nonimmediate_operand"  "")
	(umod:ALLEVALMODES
	 (match_operand:ALLEVALMODES 1 "general_operand" "")
	 (match_operand:ALLEVALMODES 2 "general_operand" "")))]
  ""
  "rem.un")

(define_insn "and<mode>3"
  [(set (match_operand:ALLINTEVALMODES 0 "nonimmediate_operand"  "")
	(and:ALLINTEVALMODES
	 (match_operand:ALLINTEVALMODES 1 "general_operand" "")
	 (match_operand:ALLINTEVALMODES 2 "general_operand" "")))]
  ""
  "and")

;; and works in SIMD mode
(define_insn "and<mode>3"
  [(set (match_operand:VECMODES 0 "nonimmediate_operand"  "")
	(and:VECMODES
	 (match_operand:VECMODES 1 "general_operand" "")
	 (match_operand:VECMODES 2 "general_operand" "")))]
  ""
  "and")

(define_insn "ior<mode>3"
  [(set (match_operand:ALLINTEVALMODES 0 "nonimmediate_operand"  "")
	(ior:ALLINTEVALMODES
	 (match_operand:ALLINTEVALMODES 1 "general_operand" "")
	 (match_operand:ALLINTEVALMODES 2 "general_operand" "")))]
  ""
  "or")

;; or works in SIMD mode
(define_insn "ior<mode>3"
  [(set (match_operand:VECMODES 0 "nonimmediate_operand"  "")
	(ior:VECMODES
	 (match_operand:VECMODES 1 "general_operand" "")
	 (match_operand:VECMODES 2 "general_operand" "")))]
  ""
  "or")

(define_insn "xor<mode>3"
  [(set (match_operand:ALLINTEVALMODES 0 "nonimmediate_operand"  "")
	(xor:ALLINTEVALMODES
	 (match_operand:ALLINTEVALMODES 1 "general_operand" "")
	 (match_operand:ALLINTEVALMODES 2 "general_operand" "")))]
  ""
  "xor")

;; xor works in SIMD mode
(define_insn "xor<mode>3"
  [(set (match_operand:VECMODES 0 "nonimmediate_operand"  "")
	(xor:VECMODES
	 (match_operand:VECMODES 1 "general_operand" "")
	 (match_operand:VECMODES 2 "general_operand" "")))]
  ""
  "xor")


;; Call insns.

(define_insn "call"
  [(call (match_operand 0 "general_operand" "")
         (match_operand 1 "general_operand" ""))]
  ""
  "")

(define_insn "call_value"
  [(set (match_operand 0 "" "")
        (call (match_operand 1 "general_operand" "")
              (match_operand 2 "general_operand" "")))]
  ""
  "")

;; Local variables:
;; mode:emacs-lisp
;; comment-start: ";; "
;; eval: (set-syntax-table (copy-sequence (syntax-table)))
;; eval: (modify-syntax-entry ?[ "(]")
;; eval: (modify-syntax-entry ?] ")[")
;; eval: (modify-syntax-entry ?{ "(}")
;; eval: (modify-syntax-entry ?} "){")
;; eval: (setq indent-tabs-mode t)
;; End: