1 ;; -*- buffer-read-only: t -*-
2 ;; Generated automatically from c6x-mult.md.in by genmult.sh
3 ;; Multiplication patterns for TI C6X.
4 ;; This file is processed by genmult.sh to produce two variants of each
5 ;; pattern, a normal one and a real_mult variant for modulo scheduling.
6 ;; Copyright (C) 2010-2018 Free Software Foundation, Inc.
7 ;; Contributed by Bernd Schmidt <bernds@codesourcery.com>
8 ;; Contributed by CodeSourcery.
10 ;; This file is part of GCC.
12 ;; GCC is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
17 ;; GCC is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GCC; see the file COPYING3. If not see
24 ;; <http://www.gnu.org/licenses/>.
26 ;; -------------------------------------------------------------------------
27 ;; Miscellaneous insns that execute on the M units
28 ;; -------------------------------------------------------------------------
30 (define_insn "rotlsi3"
31 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
32 (rotate:SI (match_operand:SI 1 "register_operand" "a,b,?b,?a")
33 (match_operand:SI 2 "reg_or_ucst5_operand" "aIu5,bIu5,aIu5,bIu5")))]
35 "%|%.\\trotl\\t%$\\t%1, %2, %0"
36 [(set_attr "units" "m")
37 (set_attr "type" "mpy2")
38 (set_attr "cross" "n,n,y,y")])
40 (define_insn "bitrevsi2"
41 [(set (match_operand:SI 0 "register_operand" "=a,a,b,b")
42 (unspec:SI [(match_operand:SI 1 "register_operand" "a,?b,b,?a")]
45 "%|%.\\tbitr\\t%$\\t%1, %0"
46 [(set_attr "units" "m")
47 (set_attr "type" "mpy2")
48 (set_attr "cross" "n,y,n,y")])
52 (define_insn "avgv2hi3"
53 [(set (match_operand:V2HI 0 "register_operand" "=a,b,a,b")
54 (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "a,b,?b,?a")
55 (match_operand:V2HI 2 "register_operand" "a,b,a,b")] UNSPEC_AVG))]
57 "%|%.\\tavg2\\t%$\\t%1, %2, %0"
58 [(set_attr "units" "m")
59 (set_attr "type" "mpy2")
60 (set_attr "cross" "n,n,y,y")])
62 (define_insn "uavgv4qi3"
63 [(set (match_operand:V4QI 0 "register_operand" "=a,b,a,b")
64 (unspec:V4QI [(match_operand:V4QI 1 "register_operand" "a,b,?b,?a")
65 (match_operand:V4QI 2 "register_operand" "a,b,a,b")] UNSPEC_AVG))]
67 "%|%.\\tavgu4\\t%$\\t%1, %2, %0"
68 [(set_attr "units" "m")
69 (set_attr "type" "mpy2")
70 (set_attr "cross" "n,n,y,y")])
72 ;; -------------------------------------------------------------------------
74 ;; -------------------------------------------------------------------------
77 [(set (match_operand:HI 0 "register_operand" "=a,b,a,b")
78 (mult:HI (match_operand:HI 1 "register_operand" "a,b,?b,?a")
79 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,aIs5,bIs5")))]
81 "%|%.\\tmpy\\t%$\\t%2, %1, %0"
82 [(set_attr "type" "mpy2")
83 (set_attr "units" "m")
84 (set_attr "op_pattern" "sxs")
85 (set_attr "cross" "n,n,y,y")])
87 (define_insn "mulhisi3_const"
88 [(set (match_operand:SI 0 "register_operand" "=a,b,ab")
89 (mult:SI (sign_extend:SI
90 (match_operand:HI 1 "register_operand" "a,b,?ab"))
91 (match_operand:HI 2 "scst5_operand" "Is5,Is5,Is5")))]
93 "%|%.\\tmpy\\t%$\\t%2, %1, %0"
94 [(set_attr "type" "mpy2")
95 (set_attr "units" "m")
96 (set_attr "cross" "n,n,y")])
98 (define_insn "*mulhisi3_insn"
99 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
100 (mult:SI (sign_extend:SI
101 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
103 (match_operand:HI 2 "reg_or_scst5_operand" "a,b,b,a"))))]
105 "%|%.\\tmpy\\t%$\\t%1, %2, %0"
106 [(set_attr "type" "mpy2")
107 (set_attr "units" "m")
108 (set_attr "op_pattern" "ssx")
109 (set_attr "cross" "n,n,y,y")])
111 (define_insn "mulhisi3_lh"
112 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
113 (mult:SI (sign_extend:SI
114 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
116 (match_operand:SI 2 "register_operand" "a,b,b,a")
119 "%|%.\\tmpylh\\t%$\\t%1, %2, %0"
120 [(set_attr "type" "mpy2")
121 (set_attr "units" "m")
122 (set_attr "cross" "n,n,y,y")])
124 (define_insn "mulhisi3_hl"
125 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
126 (mult:SI (ashiftrt:SI
127 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
130 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
132 "%|%.\\tmpyhl\\t%$\\t%1, %2, %0"
133 [(set_attr "type" "mpy2")
134 (set_attr "units" "m")
135 (set_attr "cross" "n,n,y,y")])
137 (define_insn "mulhisi3_hh"
138 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
139 (mult:SI (ashiftrt:SI
140 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
143 (match_operand:SI 2 "register_operand" "a,b,b,a")
146 "%|%.\\tmpyh\\t%$\\t%1, %2, %0"
147 [(set_attr "type" "mpy2")
148 (set_attr "units" "m")
149 (set_attr "cross" "n,n,y,y")])
151 (define_insn "umulhisi3"
152 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
153 (mult:SI (zero_extend:SI
154 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
156 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
158 "%|%.\\tmpyu\\t%$\\t%1, %2, %0"
159 [(set_attr "type" "mpy2")
160 (set_attr "units" "m")
161 (set_attr "cross" "n,n,y,y")])
163 (define_insn "umulhisi3_lh"
164 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
165 (mult:SI (zero_extend:SI
166 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
168 (match_operand:SI 2 "register_operand" "a,b,b,a")
171 "%|%.\\tmpylhu\\t%$\\t%1, %2, %0"
172 [(set_attr "type" "mpy2")
173 (set_attr "units" "m")
174 (set_attr "cross" "n,n,y,y")])
176 (define_insn "umulhisi3_hl"
177 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
178 (mult:SI (lshiftrt:SI
179 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
182 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
184 "%|%.\\tmpyhlu\\t%$\\t%1, %2, %0"
185 [(set_attr "type" "mpy2")
186 (set_attr "units" "m")
187 (set_attr "cross" "n,n,y,y")])
189 (define_insn "umulhisi3_hh"
190 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
191 (mult:SI (lshiftrt:SI
192 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
195 (match_operand:SI 2 "register_operand" "a,b,b,a")
198 "%|%.\\tmpyhu\\t%$\\t%1, %2, %0"
199 [(set_attr "type" "mpy2")
200 (set_attr "units" "m")
201 (set_attr "cross" "n,n,y,y")])
203 (define_insn "usmulhisi3_const"
204 [(set (match_operand:SI 0 "register_operand" "=a,b,ab")
205 (mult:SI (zero_extend:SI
206 (match_operand:HI 1 "register_operand" "a,b,?ab"))
207 (match_operand:SI 2 "scst5_operand" "Is5,Is5,Is5")))]
209 "%|%.\\tmpysu\\t%$\\t%2, %1, %0"
210 [(set_attr "type" "mpy2")
211 (set_attr "units" "m")
212 (set_attr "cross" "n,n,y")])
214 (define_insn "*usmulhisi3_insn"
215 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
216 (mult:SI (zero_extend:SI
217 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
219 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,bIs5,aIs5"))))]
221 "%|%.\\tmpyus\\t%$\\t%1, %2, %0"
222 [(set_attr "type" "mpy2")
223 (set_attr "units" "m")
224 (set_attr "cross" "n,n,y,y")])
226 (define_insn "usmulhisi3_lh"
227 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
228 (mult:SI (zero_extend:SI
229 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
231 (match_operand:SI 2 "register_operand" "a,b,b,a")
234 "%|%.\\tmpyluhs\\t%$\\t%1, %2, %0"
235 [(set_attr "type" "mpy2")
236 (set_attr "units" "m")
237 (set_attr "cross" "n,n,y,y")])
239 (define_insn "usmulhisi3_hl"
240 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
241 (mult:SI (lshiftrt:SI
242 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
245 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
247 "%|%.\\tmpyhuls\\t%$\\t%1, %2, %0"
248 [(set_attr "type" "mpy2")
249 (set_attr "units" "m")
250 (set_attr "cross" "n,n,y,y")])
252 (define_insn "usmulhisi3_hh"
253 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
254 (mult:SI (lshiftrt:SI
255 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
258 (match_operand:SI 2 "register_operand" "a,b,b,a")
261 "%|%.\\tmpyhus\\t%$\\t%1, %2, %0"
262 [(set_attr "type" "mpy2")
263 (set_attr "units" "m")
264 (set_attr "cross" "n,n,y,y")])
266 (define_insn "mulsi3_insn"
267 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
268 (mult:SI (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
269 (match_operand:SI 2 "register_operand" "a,b,b,a")))]
271 "%|%.\\tmpy32\\t%$\\t%1, %2, %0"
272 [(set_attr "type" "mpy4")
273 (set_attr "units" "m")
274 (set_attr "cross" "n,n,y,y")])
276 (define_insn "<u>mulsidi3"
277 [(set (match_operand:DI 0 "register_operand" "=a,b,a,b")
279 (match_operand:SI 1 "register_operand" "%a,b,?a,?b"))
281 (match_operand:SI 2 "register_operand" "a,b,b,a"))))]
283 "%|%.\\tmpy32<u>\\t%$\\t%1, %2, %0"
284 [(set_attr "type" "mpy4")
285 (set_attr "units" "m")
286 (set_attr "cross" "n,n,y,y")])
288 (define_insn "usmulsidi3"
289 [(set (match_operand:DI 0 "register_operand" "=a,b,a,b")
290 (mult:DI (zero_extend:DI
291 (match_operand:SI 1 "register_operand" "a,b,?a,?b"))
293 (match_operand:SI 2 "register_operand" "a,b,b,a"))))]
295 "%|%.\\tmpy32us\\t%$\\t%1, %2, %0"
296 [(set_attr "type" "mpy4")
297 (set_attr "units" "m")
298 (set_attr "cross" "n,n,y,y")])
300 ;; Widening vector multiply and dot product
302 (define_insn "mulv2hiv2si3"
303 [(set (match_operand:V2SI 0 "register_operand" "=a,b,a,b")
305 (sign_extend:V2SI (match_operand:V2HI 1 "register_operand" "a,b,a,b"))
306 (sign_extend:V2SI (match_operand:V2HI 2 "register_operand" "a,b,?b,?a"))))]
308 "%|%.\\tmpy2\\t%$\\t%1, %2, %0"
309 [(set_attr "type" "mpy4")
310 (set_attr "units" "m")
311 (set_attr "cross" "n,n,y,y")])
313 (define_insn "umulv4qiv4hi3"
314 [(set (match_operand:V4HI 0 "register_operand" "=a,b,a,b")
316 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,a,b"))
317 (zero_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,?b,?a"))))]
319 "%|%.\\tmpyu4\\t%$\\t%1, %2, %0"
320 [(set_attr "type" "mpy4")
321 (set_attr "units" "m")
322 (set_attr "cross" "n,n,y,y")])
324 (define_insn "usmulv4qiv4hi3"
325 [(set (match_operand:V4HI 0 "register_operand" "=a,b,a,b")
327 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,?b,?a"))
328 (sign_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,a,b"))))]
330 "%|%.\\tmpyus4\\t%$\\t%1, %2, %0"
331 [(set_attr "type" "mpy4")
332 (set_attr "units" "m")
333 (set_attr "cross" "n,n,y,y")])
335 (define_insn "dotv2hi"
336 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
341 (match_operand:V2HI 1 "register_operand" "a,b,a,b")
342 (parallel [(const_int 0)])))
345 (match_operand:V2HI 2 "register_operand" "a,b,?b,?a")
346 (parallel [(const_int 0)]))))
349 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
351 (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))))))]
353 "%|%.\\tdotp2\\t%$\\t%1, %2, %0"
354 [(set_attr "type" "mpy4")
355 (set_attr "units" "m")
356 (set_attr "cross" "n,n,y,y")])
358 ;; Fractional multiply
360 (define_insn "mulv2hqv2sq3"
361 [(set (match_operand:V2SQ 0 "register_operand" "=a,b,a,b")
364 (match_operand:V2HQ 1 "register_operand" "%a,b,?a,?b"))
366 (match_operand:V2HQ 2 "register_operand" "a,b,b,a"))))]
368 "%|%.\\tsmpy2\\t%$\\t%1, %2, %0"
369 [(set_attr "type" "mpy4")
370 (set_attr "units" "m")
371 (set_attr "cross" "n,n,y,y")])
373 (define_insn "mulhqsq3"
374 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
377 (match_operand:HQ 1 "register_operand" "%a,b,?a,?b"))
379 (match_operand:HQ 2 "register_operand" "a,b,b,a"))))]
381 "%|%.\\tsmpy\\t%$\\t%1, %2, %0"
382 [(set_attr "type" "mpy2")
383 (set_attr "units" "m")
384 (set_attr "cross" "n,n,y,y")])
386 (define_insn "mulhqsq3_lh"
387 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
390 (match_operand:HQ 1 "register_operand" "a,b,?a,?b"))
392 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a")))))]
394 "%|%.\\tsmpylh\\t%$\\t%1, %2, %0"
395 [(set_attr "type" "mpy2")
396 (set_attr "units" "m")
397 (set_attr "cross" "n,n,y,y")])
399 (define_insn "mulhqsq3_hl"
400 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
403 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
405 (match_operand:HQ 2 "register_operand" "a,b,b,a"))))]
407 "%|%.\\tsmpyhl\\t%$\\t%1, %2, %0"
408 [(set_attr "type" "mpy2")
409 (set_attr "units" "m")
410 (set_attr "cross" "n,n,y,y")])
412 (define_insn "mulhqsq3_hh"
413 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
416 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
418 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a")))))]
420 "%|%.\\tsmpyh\\t%$\\t%1, %2, %0"
421 [(set_attr "type" "mpy2")
422 (set_attr "units" "m")
423 (set_attr "cross" "n,n,y,y")])
424 ;; Multiplication patterns for TI C6X.
425 ;; This file is processed by genmult.sh to produce two variants of each
426 ;; pattern, a normal one and a real_mult variant for modulo scheduling.
427 ;; Copyright (C) 2010-2018 Free Software Foundation, Inc.
428 ;; Contributed by Bernd Schmidt <bernds@codesourcery.com>
429 ;; Contributed by CodeSourcery.
431 ;; This file is part of GCC.
433 ;; GCC is free software; you can redistribute it and/or modify
434 ;; it under the terms of the GNU General Public License as published by
435 ;; the Free Software Foundation; either version 3, or (at your option)
436 ;; any later version.
438 ;; GCC is distributed in the hope that it will be useful,
439 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
440 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
441 ;; GNU General Public License for more details.
443 ;; You should have received a copy of the GNU General Public License
444 ;; along with GCC; see the file COPYING3. If not see
445 ;; <http://www.gnu.org/licenses/>.
447 ;; -------------------------------------------------------------------------
448 ;; Miscellaneous insns that execute on the M units
449 ;; -------------------------------------------------------------------------
451 (define_insn "rotlsi3_real"
452 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
453 (rotate:SI (match_operand:SI 1 "register_operand" "a,b,?b,?a")
454 (match_operand:SI 2 "reg_or_ucst5_operand" "aIu5,bIu5,aIu5,bIu5"))] UNSPEC_REAL_MULT)]
456 "%|%.\\trotl\\t%$\\t%1, %2, %k0"
457 [(set_attr "units" "m")
458 (set_attr "type" "mpy2")
459 (set_attr "cross" "n,n,y,y")])
461 (define_insn "bitrevsi2_real"
462 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JA,JB,JB")
463 (unspec:SI [(match_operand:SI 1 "register_operand" "a,?b,b,?a")]
464 UNSPEC_BITREV)] UNSPEC_REAL_MULT)]
466 "%|%.\\tbitr\\t%$\\t%1, %k0"
467 [(set_attr "units" "m")
468 (set_attr "type" "mpy2")
469 (set_attr "cross" "n,y,n,y")])
473 (define_insn "avgv2hi3_real"
474 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
475 (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "a,b,?b,?a")
476 (match_operand:V2HI 2 "register_operand" "a,b,a,b")] UNSPEC_AVG)] UNSPEC_REAL_MULT)]
478 "%|%.\\tavg2\\t%$\\t%1, %2, %k0"
479 [(set_attr "units" "m")
480 (set_attr "type" "mpy2")
481 (set_attr "cross" "n,n,y,y")])
483 (define_insn "uavgv4qi3_real"
484 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
485 (unspec:V4QI [(match_operand:V4QI 1 "register_operand" "a,b,?b,?a")
486 (match_operand:V4QI 2 "register_operand" "a,b,a,b")] UNSPEC_AVG)] UNSPEC_REAL_MULT)]
488 "%|%.\\tavgu4\\t%$\\t%1, %2, %k0"
489 [(set_attr "units" "m")
490 (set_attr "type" "mpy2")
491 (set_attr "cross" "n,n,y,y")])
493 ;; -------------------------------------------------------------------------
495 ;; -------------------------------------------------------------------------
497 (define_insn "mulhi3_real"
498 [(unspec [(match_operand:HI 0 "const_int_operand" "=JA,JB,JA,JB")
499 (mult:HI (match_operand:HI 1 "register_operand" "a,b,?b,?a")
500 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,aIs5,bIs5"))] UNSPEC_REAL_MULT)]
502 "%|%.\\tmpy\\t%$\\t%2, %1, %k0"
503 [(set_attr "type" "mpy2")
504 (set_attr "units" "m")
505 (set_attr "op_pattern" "sxs")
506 (set_attr "cross" "n,n,y,y")])
508 (define_insn "mulhisi3_const_real"
509 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JAJB")
510 (mult:SI (sign_extend:SI
511 (match_operand:HI 1 "register_operand" "a,b,?ab"))
512 (match_operand:HI 2 "scst5_operand" "Is5,Is5,Is5"))] UNSPEC_REAL_MULT)]
514 "%|%.\\tmpy\\t%$\\t%2, %1, %k0"
515 [(set_attr "type" "mpy2")
516 (set_attr "units" "m")
517 (set_attr "cross" "n,n,y")])
519 (define_insn "*mulhisi3_insn_real"
520 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
521 (mult:SI (sign_extend:SI
522 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
524 (match_operand:HI 2 "reg_or_scst5_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
526 "%|%.\\tmpy\\t%$\\t%1, %2, %k0"
527 [(set_attr "type" "mpy2")
528 (set_attr "units" "m")
529 (set_attr "op_pattern" "ssx")
530 (set_attr "cross" "n,n,y,y")])
532 (define_insn "mulhisi3_lh_real"
533 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
534 (mult:SI (sign_extend:SI
535 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
537 (match_operand:SI 2 "register_operand" "a,b,b,a")
538 (const_int 16)))] UNSPEC_REAL_MULT)]
540 "%|%.\\tmpylh\\t%$\\t%1, %2, %k0"
541 [(set_attr "type" "mpy2")
542 (set_attr "units" "m")
543 (set_attr "cross" "n,n,y,y")])
545 (define_insn "mulhisi3_hl_real"
546 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
547 (mult:SI (ashiftrt:SI
548 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
551 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
553 "%|%.\\tmpyhl\\t%$\\t%1, %2, %k0"
554 [(set_attr "type" "mpy2")
555 (set_attr "units" "m")
556 (set_attr "cross" "n,n,y,y")])
558 (define_insn "mulhisi3_hh_real"
559 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
560 (mult:SI (ashiftrt:SI
561 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
564 (match_operand:SI 2 "register_operand" "a,b,b,a")
565 (const_int 16)))] UNSPEC_REAL_MULT)]
567 "%|%.\\tmpyh\\t%$\\t%1, %2, %k0"
568 [(set_attr "type" "mpy2")
569 (set_attr "units" "m")
570 (set_attr "cross" "n,n,y,y")])
572 (define_insn "umulhisi3_real"
573 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
574 (mult:SI (zero_extend:SI
575 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
577 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
579 "%|%.\\tmpyu\\t%$\\t%1, %2, %k0"
580 [(set_attr "type" "mpy2")
581 (set_attr "units" "m")
582 (set_attr "cross" "n,n,y,y")])
584 (define_insn "umulhisi3_lh_real"
585 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
586 (mult:SI (zero_extend:SI
587 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
589 (match_operand:SI 2 "register_operand" "a,b,b,a")
590 (const_int 16)))] UNSPEC_REAL_MULT)]
592 "%|%.\\tmpylhu\\t%$\\t%1, %2, %k0"
593 [(set_attr "type" "mpy2")
594 (set_attr "units" "m")
595 (set_attr "cross" "n,n,y,y")])
597 (define_insn "umulhisi3_hl_real"
598 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
599 (mult:SI (lshiftrt:SI
600 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
603 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
605 "%|%.\\tmpyhlu\\t%$\\t%1, %2, %k0"
606 [(set_attr "type" "mpy2")
607 (set_attr "units" "m")
608 (set_attr "cross" "n,n,y,y")])
610 (define_insn "umulhisi3_hh_real"
611 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
612 (mult:SI (lshiftrt:SI
613 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
616 (match_operand:SI 2 "register_operand" "a,b,b,a")
617 (const_int 16)))] UNSPEC_REAL_MULT)]
619 "%|%.\\tmpyhu\\t%$\\t%1, %2, %k0"
620 [(set_attr "type" "mpy2")
621 (set_attr "units" "m")
622 (set_attr "cross" "n,n,y,y")])
624 (define_insn "usmulhisi3_const_real"
625 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JAJB")
626 (mult:SI (zero_extend:SI
627 (match_operand:HI 1 "register_operand" "a,b,?ab"))
628 (match_operand:SI 2 "scst5_operand" "Is5,Is5,Is5"))] UNSPEC_REAL_MULT)]
630 "%|%.\\tmpysu\\t%$\\t%2, %1, %k0"
631 [(set_attr "type" "mpy2")
632 (set_attr "units" "m")
633 (set_attr "cross" "n,n,y")])
635 (define_insn "*usmulhisi3_insn_real"
636 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
637 (mult:SI (zero_extend:SI
638 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
640 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,bIs5,aIs5")))] UNSPEC_REAL_MULT)]
642 "%|%.\\tmpyus\\t%$\\t%1, %2, %k0"
643 [(set_attr "type" "mpy2")
644 (set_attr "units" "m")
645 (set_attr "cross" "n,n,y,y")])
647 (define_insn "usmulhisi3_lh_real"
648 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
649 (mult:SI (zero_extend:SI
650 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
652 (match_operand:SI 2 "register_operand" "a,b,b,a")
653 (const_int 16)))] UNSPEC_REAL_MULT)]
655 "%|%.\\tmpyluhs\\t%$\\t%1, %2, %k0"
656 [(set_attr "type" "mpy2")
657 (set_attr "units" "m")
658 (set_attr "cross" "n,n,y,y")])
660 (define_insn "usmulhisi3_hl_real"
661 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
662 (mult:SI (lshiftrt:SI
663 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
666 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
668 "%|%.\\tmpyhuls\\t%$\\t%1, %2, %k0"
669 [(set_attr "type" "mpy2")
670 (set_attr "units" "m")
671 (set_attr "cross" "n,n,y,y")])
673 (define_insn "usmulhisi3_hh_real"
674 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
675 (mult:SI (lshiftrt:SI
676 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
679 (match_operand:SI 2 "register_operand" "a,b,b,a")
680 (const_int 16)))] UNSPEC_REAL_MULT)]
682 "%|%.\\tmpyhus\\t%$\\t%1, %2, %k0"
683 [(set_attr "type" "mpy2")
684 (set_attr "units" "m")
685 (set_attr "cross" "n,n,y,y")])
687 (define_insn "mulsi3_insn_real"
688 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
689 (mult:SI (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
690 (match_operand:SI 2 "register_operand" "a,b,b,a"))] UNSPEC_REAL_MULT)]
692 "%|%.\\tmpy32\\t%$\\t%1, %2, %k0"
693 [(set_attr "type" "mpy4")
694 (set_attr "units" "m")
695 (set_attr "cross" "n,n,y,y")])
697 (define_insn "<u>mulsidi3_real"
698 [(unspec [(match_operand:DI 0 "const_int_operand" "=JA,JB,JA,JB")
700 (match_operand:SI 1 "register_operand" "%a,b,?a,?b"))
702 (match_operand:SI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
704 "%|%.\\tmpy32<u>\\t%$\\t%1, %2, %K0"
705 [(set_attr "type" "mpy4")
706 (set_attr "units" "m")
707 (set_attr "cross" "n,n,y,y")])
709 (define_insn "usmulsidi3_real"
710 [(unspec [(match_operand:DI 0 "const_int_operand" "=JA,JB,JA,JB")
711 (mult:DI (zero_extend:DI
712 (match_operand:SI 1 "register_operand" "a,b,?a,?b"))
714 (match_operand:SI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
716 "%|%.\\tmpy32us\\t%$\\t%1, %2, %K0"
717 [(set_attr "type" "mpy4")
718 (set_attr "units" "m")
719 (set_attr "cross" "n,n,y,y")])
721 ;; Widening vector multiply and dot product
723 (define_insn "mulv2hiv2si3_real"
724 [(unspec [(match_operand:V2SI 0 "const_int_operand" "=JA,JB,JA,JB")
726 (sign_extend:V2SI (match_operand:V2HI 1 "register_operand" "a,b,a,b"))
727 (sign_extend:V2SI (match_operand:V2HI 2 "register_operand" "a,b,?b,?a")))] UNSPEC_REAL_MULT)]
729 "%|%.\\tmpy2\\t%$\\t%1, %2, %k0"
730 [(set_attr "type" "mpy4")
731 (set_attr "units" "m")
732 (set_attr "cross" "n,n,y,y")])
734 (define_insn "umulv4qiv4hi3_real"
735 [(unspec [(match_operand:V4HI 0 "const_int_operand" "=JA,JB,JA,JB")
737 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,a,b"))
738 (zero_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,?b,?a")))] UNSPEC_REAL_MULT)]
740 "%|%.\\tmpyu4\\t%$\\t%1, %2, %k0"
741 [(set_attr "type" "mpy4")
742 (set_attr "units" "m")
743 (set_attr "cross" "n,n,y,y")])
745 (define_insn "usmulv4qiv4hi3_real"
746 [(unspec [(match_operand:V4HI 0 "const_int_operand" "=JA,JB,JA,JB")
748 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,?b,?a"))
749 (sign_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,a,b")))] UNSPEC_REAL_MULT)]
751 "%|%.\\tmpyus4\\t%$\\t%1, %2, %k0"
752 [(set_attr "type" "mpy4")
753 (set_attr "units" "m")
754 (set_attr "cross" "n,n,y,y")])
756 (define_insn "dotv2hi_real"
757 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
762 (match_operand:V2HI 1 "register_operand" "a,b,a,b")
763 (parallel [(const_int 0)])))
766 (match_operand:V2HI 2 "register_operand" "a,b,?b,?a")
767 (parallel [(const_int 0)]))))
770 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
772 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))] UNSPEC_REAL_MULT)]
774 "%|%.\\tdotp2\\t%$\\t%1, %2, %k0"
775 [(set_attr "type" "mpy4")
776 (set_attr "units" "m")
777 (set_attr "cross" "n,n,y,y")])
779 ;; Fractional multiply
781 (define_insn "mulv2hqv2sq3_real"
782 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
785 (match_operand:V2HQ 1 "register_operand" "%a,b,?a,?b"))
787 (match_operand:V2HQ 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
789 "%|%.\\tsmpy2\\t%$\\t%1, %2, %k0"
790 [(set_attr "type" "mpy4")
791 (set_attr "units" "m")
792 (set_attr "cross" "n,n,y,y")])
794 (define_insn "mulhqsq3_real"
795 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
798 (match_operand:HQ 1 "register_operand" "%a,b,?a,?b"))
800 (match_operand:HQ 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
802 "%|%.\\tsmpy\\t%$\\t%1, %2, %k0"
803 [(set_attr "type" "mpy2")
804 (set_attr "units" "m")
805 (set_attr "cross" "n,n,y,y")])
807 (define_insn "mulhqsq3_lh_real"
808 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
811 (match_operand:HQ 1 "register_operand" "a,b,?a,?b"))
813 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a"))))] UNSPEC_REAL_MULT)]
815 "%|%.\\tsmpylh\\t%$\\t%1, %2, %k0"
816 [(set_attr "type" "mpy2")
817 (set_attr "units" "m")
818 (set_attr "cross" "n,n,y,y")])
820 (define_insn "mulhqsq3_hl_real"
821 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
824 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
826 (match_operand:HQ 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
828 "%|%.\\tsmpyhl\\t%$\\t%1, %2, %k0"
829 [(set_attr "type" "mpy2")
830 (set_attr "units" "m")
831 (set_attr "cross" "n,n,y,y")])
833 (define_insn "mulhqsq3_hh_real"
834 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
837 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
839 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a"))))] UNSPEC_REAL_MULT)]
841 "%|%.\\tsmpyh\\t%$\\t%1, %2, %k0"
842 [(set_attr "type" "mpy2")
843 (set_attr "units" "m")
844 (set_attr "cross" "n,n,y,y")])