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, 2011 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 "cross" "n,n,y,y")])
86 (define_insn "mulhisi3_const"
87 [(set (match_operand:SI 0 "register_operand" "=a,b,ab")
88 (mult:SI (sign_extend:SI
89 (match_operand:HI 1 "register_operand" "a,b,?ab"))
90 (match_operand:HI 2 "scst5_operand" "Is5,Is5,Is5")))]
92 "%|%.\\tmpy\\t%$\\t%2, %1, %0"
93 [(set_attr "type" "mpy2")
94 (set_attr "units" "m")
95 (set_attr "cross" "n,n,y")])
97 (define_insn "*mulhisi3_insn"
98 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
99 (mult:SI (sign_extend:SI
100 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
102 (match_operand:HI 2 "reg_or_scst5_operand" "a,b,b,a"))))]
104 "%|%.\\tmpy\\t%$\\t%1, %2, %0"
105 [(set_attr "type" "mpy2")
106 (set_attr "units" "m")
107 (set_attr "cross" "n,n,y,y")])
109 (define_insn "mulhisi3_lh"
110 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
111 (mult:SI (sign_extend:SI
112 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
114 (match_operand:SI 2 "register_operand" "a,b,b,a")
117 "%|%.\\tmpylh\\t%$\\t%1, %2, %0"
118 [(set_attr "type" "mpy2")
119 (set_attr "units" "m")
120 (set_attr "cross" "n,n,y,y")])
122 (define_insn "mulhisi3_hl"
123 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
124 (mult:SI (ashiftrt:SI
125 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
128 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
130 "%|%.\\tmpyhl\\t%$\\t%1, %2, %0"
131 [(set_attr "type" "mpy2")
132 (set_attr "units" "m")
133 (set_attr "cross" "n,n,y,y")])
135 (define_insn "mulhisi3_hh"
136 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
137 (mult:SI (ashiftrt:SI
138 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
141 (match_operand:SI 2 "register_operand" "a,b,b,a")
144 "%|%.\\tmpyh\\t%$\\t%1, %2, %0"
145 [(set_attr "type" "mpy2")
146 (set_attr "units" "m")
147 (set_attr "cross" "n,n,y,y")])
149 (define_insn "umulhisi3"
150 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
151 (mult:SI (zero_extend:SI
152 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
154 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
156 "%|%.\\tmpyu\\t%$\\t%1, %2, %0"
157 [(set_attr "type" "mpy2")
158 (set_attr "units" "m")
159 (set_attr "cross" "n,n,y,y")])
161 (define_insn "umulhisi3_lh"
162 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
163 (mult:SI (zero_extend:SI
164 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
166 (match_operand:SI 2 "register_operand" "a,b,b,a")
169 "%|%.\\tmpylhu\\t%$\\t%1, %2, %0"
170 [(set_attr "type" "mpy2")
171 (set_attr "units" "m")
172 (set_attr "cross" "n,n,y,y")])
174 (define_insn "umulhisi3_hl"
175 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
176 (mult:SI (lshiftrt:SI
177 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
180 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
182 "%|%.\\tmpyhlu\\t%$\\t%1, %2, %0"
183 [(set_attr "type" "mpy2")
184 (set_attr "units" "m")
185 (set_attr "cross" "n,n,y,y")])
187 (define_insn "umulhisi3_hh"
188 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
189 (mult:SI (lshiftrt:SI
190 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
193 (match_operand:SI 2 "register_operand" "a,b,b,a")
196 "%|%.\\tmpyhu\\t%$\\t%1, %2, %0"
197 [(set_attr "type" "mpy2")
198 (set_attr "units" "m")
199 (set_attr "cross" "n,n,y,y")])
201 (define_insn "usmulhisi3_const"
202 [(set (match_operand:SI 0 "register_operand" "=a,b,ab")
203 (mult:SI (zero_extend:SI
204 (match_operand:HI 1 "register_operand" "a,b,?ab"))
205 (match_operand:SI 2 "scst5_operand" "Is5,Is5,Is5")))]
207 "%|%.\\tmpysu\\t%$\\t%2, %1, %0"
208 [(set_attr "type" "mpy2")
209 (set_attr "units" "m")
210 (set_attr "cross" "n,n,y")])
212 (define_insn "*usmulhisi3_insn"
213 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
214 (mult:SI (zero_extend:SI
215 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
217 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,bIs5,aIs5"))))]
219 "%|%.\\tmpyus\\t%$\\t%1, %2, %0"
220 [(set_attr "type" "mpy2")
221 (set_attr "units" "m")
222 (set_attr "cross" "n,n,y,y")])
224 (define_insn "usmulhisi3_lh"
225 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
226 (mult:SI (zero_extend:SI
227 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
229 (match_operand:SI 2 "register_operand" "a,b,b,a")
232 "%|%.\\tmpyluhs\\t%$\\t%1, %2, %0"
233 [(set_attr "type" "mpy2")
234 (set_attr "units" "m")
235 (set_attr "cross" "n,n,y,y")])
237 (define_insn "usmulhisi3_hl"
238 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
239 (mult:SI (lshiftrt:SI
240 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
243 (match_operand:HI 2 "register_operand" "a,b,b,a"))))]
245 "%|%.\\tmpyhuls\\t%$\\t%1, %2, %0"
246 [(set_attr "type" "mpy2")
247 (set_attr "units" "m")
248 (set_attr "cross" "n,n,y,y")])
250 (define_insn "usmulhisi3_hh"
251 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
252 (mult:SI (lshiftrt:SI
253 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
256 (match_operand:SI 2 "register_operand" "a,b,b,a")
259 "%|%.\\tmpyhus\\t%$\\t%1, %2, %0"
260 [(set_attr "type" "mpy2")
261 (set_attr "units" "m")
262 (set_attr "cross" "n,n,y,y")])
264 (define_insn "mulsi3_insn"
265 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
266 (mult:SI (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
267 (match_operand:SI 2 "register_operand" "a,b,b,a")))]
269 "%|%.\\tmpy32\\t%$\\t%1, %2, %0"
270 [(set_attr "type" "mpy4")
271 (set_attr "units" "m")
272 (set_attr "cross" "n,n,y,y")])
274 (define_insn "<u>mulsidi3"
275 [(set (match_operand:DI 0 "register_operand" "=a,b,a,b")
277 (match_operand:SI 1 "register_operand" "%a,b,?a,?b"))
279 (match_operand:SI 2 "register_operand" "a,b,b,a"))))]
281 "%|%.\\tmpy32<u>\\t%$\\t%1, %2, %0"
282 [(set_attr "type" "mpy4")
283 (set_attr "units" "m")
284 (set_attr "cross" "n,n,y,y")])
286 (define_insn "usmulsidi3"
287 [(set (match_operand:DI 0 "register_operand" "=a,b,a,b")
288 (mult:DI (zero_extend:DI
289 (match_operand:SI 1 "register_operand" "a,b,?a,?b"))
291 (match_operand:SI 2 "register_operand" "a,b,b,a"))))]
293 "%|%.\\tmpy32us\\t%$\\t%1, %2, %0"
294 [(set_attr "type" "mpy4")
295 (set_attr "units" "m")
296 (set_attr "cross" "n,n,y,y")])
298 ;; Widening vector multiply and dot product
300 (define_insn "mulv2hiv2si3"
301 [(set (match_operand:V2SI 0 "register_operand" "=a,b,a,b")
303 (sign_extend:V2SI (match_operand:V2HI 1 "register_operand" "a,b,a,b"))
304 (sign_extend:V2SI (match_operand:V2HI 2 "register_operand" "a,b,?b,?a"))))]
306 "%|%.\\tmpy2\\t%$\\t%1, %2, %0"
307 [(set_attr "type" "mpy4")
308 (set_attr "units" "m")
309 (set_attr "cross" "n,n,y,y")])
311 (define_insn "umulv4qiv4hi3"
312 [(set (match_operand:V4HI 0 "register_operand" "=a,b,a,b")
314 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,a,b"))
315 (zero_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,?b,?a"))))]
317 "%|%.\\tmpyu4\\t%$\\t%1, %2, %0"
318 [(set_attr "type" "mpy4")
319 (set_attr "units" "m")
320 (set_attr "cross" "n,n,y,y")])
322 (define_insn "usmulv4qiv4hi3"
323 [(set (match_operand:V4HI 0 "register_operand" "=a,b,a,b")
325 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,?b,?a"))
326 (sign_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,a,b"))))]
328 "%|%.\\tmpyus4\\t%$\\t%1, %2, %0"
329 [(set_attr "type" "mpy4")
330 (set_attr "units" "m")
331 (set_attr "cross" "n,n,y,y")])
333 (define_insn "dotv2hi"
334 [(set (match_operand:SI 0 "register_operand" "=a,b,a,b")
339 (match_operand:V2HI 1 "register_operand" "a,b,a,b")
340 (parallel [(const_int 0)])))
343 (match_operand:V2HI 2 "register_operand" "a,b,?b,?a")
344 (parallel [(const_int 0)]))))
347 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
349 (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))))))]
351 "%|%.\\tdotp2\\t%$\\t%1, %2, %0"
352 [(set_attr "type" "mpy4")
353 (set_attr "units" "m")
354 (set_attr "cross" "n,n,y,y")])
356 ;; Fractional multiply
358 (define_insn "mulv2hqv2sq3"
359 [(set (match_operand:V2SQ 0 "register_operand" "=a,b,a,b")
362 (match_operand:V2HQ 1 "register_operand" "%a,b,?a,?b"))
364 (match_operand:V2HQ 2 "register_operand" "a,b,b,a"))))]
366 "%|%.\\tsmpy2\\t%$\\t%1, %2, %0"
367 [(set_attr "type" "mpy4")
368 (set_attr "units" "m")
369 (set_attr "cross" "n,n,y,y")])
371 (define_insn "mulhqsq3"
372 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
375 (match_operand:HQ 1 "register_operand" "%a,b,?a,?b"))
377 (match_operand:HQ 2 "register_operand" "a,b,b,a"))))]
379 "%|%.\\tsmpy\\t%$\\t%1, %2, %0"
380 [(set_attr "type" "mpy2")
381 (set_attr "units" "m")
382 (set_attr "cross" "n,n,y,y")])
384 (define_insn "mulhqsq3_lh"
385 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
388 (match_operand:HQ 1 "register_operand" "a,b,?a,?b"))
390 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a")))))]
392 "%|%.\\tsmpylh\\t%$\\t%1, %2, %0"
393 [(set_attr "type" "mpy2")
394 (set_attr "units" "m")
395 (set_attr "cross" "n,n,y,y")])
397 (define_insn "mulhqsq3_hl"
398 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
401 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
403 (match_operand:HQ 2 "register_operand" "a,b,b,a"))))]
405 "%|%.\\tsmpyhl\\t%$\\t%1, %2, %0"
406 [(set_attr "type" "mpy2")
407 (set_attr "units" "m")
408 (set_attr "cross" "n,n,y,y")])
410 (define_insn "mulhqsq3_hh"
411 [(set (match_operand:SQ 0 "register_operand" "=a,b,a,b")
414 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
416 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a")))))]
418 "%|%.\\tsmpyh\\t%$\\t%1, %2, %0"
419 [(set_attr "type" "mpy2")
420 (set_attr "units" "m")
421 (set_attr "cross" "n,n,y,y")])
422 ;; Multiplication patterns for TI C6X.
423 ;; This file is processed by genmult.sh to produce two variants of each
424 ;; pattern, a normal one and a real_mult variant for modulo scheduling.
425 ;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
426 ;; Contributed by Bernd Schmidt <bernds@codesourcery.com>
427 ;; Contributed by CodeSourcery.
429 ;; This file is part of GCC.
431 ;; GCC is free software; you can redistribute it and/or modify
432 ;; it under the terms of the GNU General Public License as published by
433 ;; the Free Software Foundation; either version 3, or (at your option)
434 ;; any later version.
436 ;; GCC is distributed in the hope that it will be useful,
437 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
438 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
439 ;; GNU General Public License for more details.
441 ;; You should have received a copy of the GNU General Public License
442 ;; along with GCC; see the file COPYING3. If not see
443 ;; <http://www.gnu.org/licenses/>.
445 ;; -------------------------------------------------------------------------
446 ;; Miscellaneous insns that execute on the M units
447 ;; -------------------------------------------------------------------------
449 (define_insn "rotlsi3_real"
450 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
451 (rotate:SI (match_operand:SI 1 "register_operand" "a,b,?b,?a")
452 (match_operand:SI 2 "reg_or_ucst5_operand" "aIu5,bIu5,aIu5,bIu5"))] UNSPEC_REAL_MULT)]
454 "%|%.\\trotl\\t%$\\t%1, %2, %k0"
455 [(set_attr "units" "m")
456 (set_attr "type" "mpy2")
457 (set_attr "cross" "n,n,y,y")])
459 (define_insn "bitrevsi2_real"
460 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JA,JB,JB")
461 (unspec:SI [(match_operand:SI 1 "register_operand" "a,?b,b,?a")]
462 UNSPEC_BITREV)] UNSPEC_REAL_MULT)]
464 "%|%.\\tbitr\\t%$\\t%1, %k0"
465 [(set_attr "units" "m")
466 (set_attr "type" "mpy2")
467 (set_attr "cross" "n,y,n,y")])
471 (define_insn "avgv2hi3_real"
472 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
473 (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "a,b,?b,?a")
474 (match_operand:V2HI 2 "register_operand" "a,b,a,b")] UNSPEC_AVG)] UNSPEC_REAL_MULT)]
476 "%|%.\\tavg2\\t%$\\t%1, %2, %k0"
477 [(set_attr "units" "m")
478 (set_attr "type" "mpy2")
479 (set_attr "cross" "n,n,y,y")])
481 (define_insn "uavgv4qi3_real"
482 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
483 (unspec:V4QI [(match_operand:V4QI 1 "register_operand" "a,b,?b,?a")
484 (match_operand:V4QI 2 "register_operand" "a,b,a,b")] UNSPEC_AVG)] UNSPEC_REAL_MULT)]
486 "%|%.\\tavgu4\\t%$\\t%1, %2, %k0"
487 [(set_attr "units" "m")
488 (set_attr "type" "mpy2")
489 (set_attr "cross" "n,n,y,y")])
491 ;; -------------------------------------------------------------------------
493 ;; -------------------------------------------------------------------------
495 (define_insn "mulhi3_real"
496 [(unspec [(match_operand:HI 0 "const_int_operand" "=JA,JB,JA,JB")
497 (mult:HI (match_operand:HI 1 "register_operand" "a,b,?b,?a")
498 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,aIs5,bIs5"))] UNSPEC_REAL_MULT)]
500 "%|%.\\tmpy\\t%$\\t%2, %1, %k0"
501 [(set_attr "type" "mpy2")
502 (set_attr "units" "m")
503 (set_attr "cross" "n,n,y,y")])
505 (define_insn "mulhisi3_const_real"
506 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JAJB")
507 (mult:SI (sign_extend:SI
508 (match_operand:HI 1 "register_operand" "a,b,?ab"))
509 (match_operand:HI 2 "scst5_operand" "Is5,Is5,Is5"))] UNSPEC_REAL_MULT)]
511 "%|%.\\tmpy\\t%$\\t%2, %1, %k0"
512 [(set_attr "type" "mpy2")
513 (set_attr "units" "m")
514 (set_attr "cross" "n,n,y")])
516 (define_insn "*mulhisi3_insn_real"
517 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
518 (mult:SI (sign_extend:SI
519 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
521 (match_operand:HI 2 "reg_or_scst5_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
523 "%|%.\\tmpy\\t%$\\t%1, %2, %k0"
524 [(set_attr "type" "mpy2")
525 (set_attr "units" "m")
526 (set_attr "cross" "n,n,y,y")])
528 (define_insn "mulhisi3_lh_real"
529 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
530 (mult:SI (sign_extend:SI
531 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
533 (match_operand:SI 2 "register_operand" "a,b,b,a")
534 (const_int 16)))] UNSPEC_REAL_MULT)]
536 "%|%.\\tmpylh\\t%$\\t%1, %2, %k0"
537 [(set_attr "type" "mpy2")
538 (set_attr "units" "m")
539 (set_attr "cross" "n,n,y,y")])
541 (define_insn "mulhisi3_hl_real"
542 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
543 (mult:SI (ashiftrt:SI
544 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
547 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
549 "%|%.\\tmpyhl\\t%$\\t%1, %2, %k0"
550 [(set_attr "type" "mpy2")
551 (set_attr "units" "m")
552 (set_attr "cross" "n,n,y,y")])
554 (define_insn "mulhisi3_hh_real"
555 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
556 (mult:SI (ashiftrt:SI
557 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
560 (match_operand:SI 2 "register_operand" "a,b,b,a")
561 (const_int 16)))] UNSPEC_REAL_MULT)]
563 "%|%.\\tmpyh\\t%$\\t%1, %2, %k0"
564 [(set_attr "type" "mpy2")
565 (set_attr "units" "m")
566 (set_attr "cross" "n,n,y,y")])
568 (define_insn "umulhisi3_real"
569 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
570 (mult:SI (zero_extend:SI
571 (match_operand:HI 1 "register_operand" "%a,b,?a,?b"))
573 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
575 "%|%.\\tmpyu\\t%$\\t%1, %2, %k0"
576 [(set_attr "type" "mpy2")
577 (set_attr "units" "m")
578 (set_attr "cross" "n,n,y,y")])
580 (define_insn "umulhisi3_lh_real"
581 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
582 (mult:SI (zero_extend:SI
583 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
585 (match_operand:SI 2 "register_operand" "a,b,b,a")
586 (const_int 16)))] UNSPEC_REAL_MULT)]
588 "%|%.\\tmpylhu\\t%$\\t%1, %2, %k0"
589 [(set_attr "type" "mpy2")
590 (set_attr "units" "m")
591 (set_attr "cross" "n,n,y,y")])
593 (define_insn "umulhisi3_hl_real"
594 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
595 (mult:SI (lshiftrt:SI
596 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
599 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
601 "%|%.\\tmpyhlu\\t%$\\t%1, %2, %k0"
602 [(set_attr "type" "mpy2")
603 (set_attr "units" "m")
604 (set_attr "cross" "n,n,y,y")])
606 (define_insn "umulhisi3_hh_real"
607 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
608 (mult:SI (lshiftrt:SI
609 (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
612 (match_operand:SI 2 "register_operand" "a,b,b,a")
613 (const_int 16)))] UNSPEC_REAL_MULT)]
615 "%|%.\\tmpyhu\\t%$\\t%1, %2, %k0"
616 [(set_attr "type" "mpy2")
617 (set_attr "units" "m")
618 (set_attr "cross" "n,n,y,y")])
620 (define_insn "usmulhisi3_const_real"
621 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JAJB")
622 (mult:SI (zero_extend:SI
623 (match_operand:HI 1 "register_operand" "a,b,?ab"))
624 (match_operand:SI 2 "scst5_operand" "Is5,Is5,Is5"))] UNSPEC_REAL_MULT)]
626 "%|%.\\tmpysu\\t%$\\t%2, %1, %k0"
627 [(set_attr "type" "mpy2")
628 (set_attr "units" "m")
629 (set_attr "cross" "n,n,y")])
631 (define_insn "*usmulhisi3_insn_real"
632 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
633 (mult:SI (zero_extend:SI
634 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
636 (match_operand:HI 2 "reg_or_scst5_operand" "aIs5,bIs5,bIs5,aIs5")))] UNSPEC_REAL_MULT)]
638 "%|%.\\tmpyus\\t%$\\t%1, %2, %k0"
639 [(set_attr "type" "mpy2")
640 (set_attr "units" "m")
641 (set_attr "cross" "n,n,y,y")])
643 (define_insn "usmulhisi3_lh_real"
644 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
645 (mult:SI (zero_extend:SI
646 (match_operand:HI 1 "register_operand" "a,b,?a,?b"))
648 (match_operand:SI 2 "register_operand" "a,b,b,a")
649 (const_int 16)))] UNSPEC_REAL_MULT)]
651 "%|%.\\tmpyluhs\\t%$\\t%1, %2, %k0"
652 [(set_attr "type" "mpy2")
653 (set_attr "units" "m")
654 (set_attr "cross" "n,n,y,y")])
656 (define_insn "usmulhisi3_hl_real"
657 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
658 (mult:SI (lshiftrt:SI
659 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
662 (match_operand:HI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
664 "%|%.\\tmpyhuls\\t%$\\t%1, %2, %k0"
665 [(set_attr "type" "mpy2")
666 (set_attr "units" "m")
667 (set_attr "cross" "n,n,y,y")])
669 (define_insn "usmulhisi3_hh_real"
670 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
671 (mult:SI (lshiftrt:SI
672 (match_operand:SI 1 "register_operand" "a,b,?a,?b")
675 (match_operand:SI 2 "register_operand" "a,b,b,a")
676 (const_int 16)))] UNSPEC_REAL_MULT)]
678 "%|%.\\tmpyhus\\t%$\\t%1, %2, %k0"
679 [(set_attr "type" "mpy2")
680 (set_attr "units" "m")
681 (set_attr "cross" "n,n,y,y")])
683 (define_insn "mulsi3_insn_real"
684 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
685 (mult:SI (match_operand:SI 1 "register_operand" "%a,b,?a,?b")
686 (match_operand:SI 2 "register_operand" "a,b,b,a"))] UNSPEC_REAL_MULT)]
688 "%|%.\\tmpy32\\t%$\\t%1, %2, %k0"
689 [(set_attr "type" "mpy4")
690 (set_attr "units" "m")
691 (set_attr "cross" "n,n,y,y")])
693 (define_insn "<u>mulsidi3_real"
694 [(unspec [(match_operand:DI 0 "const_int_operand" "=JA,JB,JA,JB")
696 (match_operand:SI 1 "register_operand" "%a,b,?a,?b"))
698 (match_operand:SI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
700 "%|%.\\tmpy32<u>\\t%$\\t%1, %2, %K0"
701 [(set_attr "type" "mpy4")
702 (set_attr "units" "m")
703 (set_attr "cross" "n,n,y,y")])
705 (define_insn "usmulsidi3_real"
706 [(unspec [(match_operand:DI 0 "const_int_operand" "=JA,JB,JA,JB")
707 (mult:DI (zero_extend:DI
708 (match_operand:SI 1 "register_operand" "a,b,?a,?b"))
710 (match_operand:SI 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
712 "%|%.\\tmpy32us\\t%$\\t%1, %2, %K0"
713 [(set_attr "type" "mpy4")
714 (set_attr "units" "m")
715 (set_attr "cross" "n,n,y,y")])
717 ;; Widening vector multiply and dot product
719 (define_insn "mulv2hiv2si3_real"
720 [(unspec [(match_operand:V2SI 0 "const_int_operand" "=JA,JB,JA,JB")
722 (sign_extend:V2SI (match_operand:V2HI 1 "register_operand" "a,b,a,b"))
723 (sign_extend:V2SI (match_operand:V2HI 2 "register_operand" "a,b,?b,?a")))] UNSPEC_REAL_MULT)]
725 "%|%.\\tmpy2\\t%$\\t%1, %2, %k0"
726 [(set_attr "type" "mpy4")
727 (set_attr "units" "m")
728 (set_attr "cross" "n,n,y,y")])
730 (define_insn "umulv4qiv4hi3_real"
731 [(unspec [(match_operand:V4HI 0 "const_int_operand" "=JA,JB,JA,JB")
733 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,a,b"))
734 (zero_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,?b,?a")))] UNSPEC_REAL_MULT)]
736 "%|%.\\tmpyu4\\t%$\\t%1, %2, %k0"
737 [(set_attr "type" "mpy4")
738 (set_attr "units" "m")
739 (set_attr "cross" "n,n,y,y")])
741 (define_insn "usmulv4qiv4hi3_real"
742 [(unspec [(match_operand:V4HI 0 "const_int_operand" "=JA,JB,JA,JB")
744 (zero_extend:V4HI (match_operand:V4QI 1 "register_operand" "a,b,?b,?a"))
745 (sign_extend:V4HI (match_operand:V4QI 2 "register_operand" "a,b,a,b")))] UNSPEC_REAL_MULT)]
747 "%|%.\\tmpyus4\\t%$\\t%1, %2, %k0"
748 [(set_attr "type" "mpy4")
749 (set_attr "units" "m")
750 (set_attr "cross" "n,n,y,y")])
752 (define_insn "dotv2hi_real"
753 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
758 (match_operand:V2HI 1 "register_operand" "a,b,a,b")
759 (parallel [(const_int 0)])))
762 (match_operand:V2HI 2 "register_operand" "a,b,?b,?a")
763 (parallel [(const_int 0)]))))
766 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
768 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))] UNSPEC_REAL_MULT)]
770 "%|%.\\tdotp2\\t%$\\t%1, %2, %k0"
771 [(set_attr "type" "mpy4")
772 (set_attr "units" "m")
773 (set_attr "cross" "n,n,y,y")])
775 ;; Fractional multiply
777 (define_insn "mulv2hqv2sq3_real"
778 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
781 (match_operand:V2HQ 1 "register_operand" "%a,b,?a,?b"))
783 (match_operand:V2HQ 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
785 "%|%.\\tsmpy2\\t%$\\t%1, %2, %k0"
786 [(set_attr "type" "mpy4")
787 (set_attr "units" "m")
788 (set_attr "cross" "n,n,y,y")])
790 (define_insn "mulhqsq3_real"
791 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
794 (match_operand:HQ 1 "register_operand" "%a,b,?a,?b"))
796 (match_operand:HQ 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
798 "%|%.\\tsmpy\\t%$\\t%1, %2, %k0"
799 [(set_attr "type" "mpy2")
800 (set_attr "units" "m")
801 (set_attr "cross" "n,n,y,y")])
803 (define_insn "mulhqsq3_lh_real"
804 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
807 (match_operand:HQ 1 "register_operand" "a,b,?a,?b"))
809 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a"))))] UNSPEC_REAL_MULT)]
811 "%|%.\\tsmpylh\\t%$\\t%1, %2, %k0"
812 [(set_attr "type" "mpy2")
813 (set_attr "units" "m")
814 (set_attr "cross" "n,n,y,y")])
816 (define_insn "mulhqsq3_hl_real"
817 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
820 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
822 (match_operand:HQ 2 "register_operand" "a,b,b,a")))] UNSPEC_REAL_MULT)]
824 "%|%.\\tsmpyhl\\t%$\\t%1, %2, %k0"
825 [(set_attr "type" "mpy2")
826 (set_attr "units" "m")
827 (set_attr "cross" "n,n,y,y")])
829 (define_insn "mulhqsq3_hh_real"
830 [(unspec [(match_operand:SI 0 "const_int_operand" "=JA,JB,JA,JB")
833 (truncate:HQ (match_operand:SQ 1 "register_operand" "a,b,b,a")))
835 (truncate:HQ (match_operand:SQ 2 "register_operand" "a,b,b,a"))))] UNSPEC_REAL_MULT)]
837 "%|%.\\tsmpyh\\t%$\\t%1, %2, %k0"
838 [(set_attr "type" "mpy2")
839 (set_attr "units" "m")
840 (set_attr "cross" "n,n,y,y")])