1 ;;- Machine description for Blackfin for GNU compiler
2 ;; Copyright 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
3 ;; Contributed by Analog Devices.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 ;; License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>.
21 ; operand punctuation marks:
23 ; X -- integer value printed as log2
24 ; Y -- integer value printed as log2(~value) - for bitclear
25 ; h -- print half word register, low part
26 ; d -- print half word register, high part
27 ; D -- print operand as dregs pairs
28 ; w -- print operand as accumulator register word (a0w, a1w)
29 ; H -- high part of double mode operand
30 ; T -- byte register representation Oct. 02 2001
32 ; constant operand classes
34 ; J 2**N 5bit imm scaled
35 ; Ks7 -64 .. 63 signed 7bit imm
36 ; Ku5 0..31 unsigned 5bit imm
37 ; Ks4 -8 .. 7 signed 4bit imm
38 ; Ks3 -4 .. 3 signed 3bit imm
39 ; Ku3 0 .. 7 unsigned 3bit imm
40 ; Pn 0, 1, 2 constants 0, 1 or 2, corresponding to n
49 ; c (i0..i3,m0..m3) CIRCREGS
56 ;; Define constants for hard registers.
123 ;; Constants used in UNSPECs and UNSPEC_VOLATILEs.
126 [(UNSPEC_CBRANCH_TAKEN 0)
127 (UNSPEC_CBRANCH_NOPS 1)
130 (UNSPEC_LIBRARY_OFFSET 4)
131 (UNSPEC_PUSH_MULTIPLE 5)
132 ;; Multiply or MAC with extra CONST_INT operand specifying the macflag
133 (UNSPEC_MUL_WITH_FLAG 6)
134 (UNSPEC_MAC_WITH_FLAG 7)
135 (UNSPEC_MOVE_FDPIC 8)
136 (UNSPEC_FUNCDESC_GOT17M4 9)
137 (UNSPEC_LSETUP_END 10)
138 ;; Distinguish a 32-bit version of an insn from a 16-bit version.
145 [(UNSPEC_VOLATILE_CSYNC 1)
146 (UNSPEC_VOLATILE_SSYNC 2)
147 (UNSPEC_VOLATILE_LOAD_FUNCDESC 3)
148 (UNSPEC_VOLATILE_STORE_EH_HANDLER 4)
149 (UNSPEC_VOLATILE_DUMMY 5)
150 (UNSPEC_VOLATILE_STALL 6)])
167 "move,movcc,mvi,mcld,mcst,dsp32,dsp32shiftimm,mult,alu0,shft,brcc,br,call,misc,sync,compare,dummy,stall"
168 (const_string "misc"))
170 (define_attr "addrtype" "32bit,preg,spreg,ireg"
171 (cond [(and (eq_attr "type" "mcld")
172 (and (match_operand 0 "dp_register_operand" "")
173 (match_operand 1 "mem_p_address_operand" "")))
174 (const_string "preg")
175 (and (eq_attr "type" "mcld")
176 (and (match_operand 0 "dp_register_operand" "")
177 (match_operand 1 "mem_spfp_address_operand" "")))
178 (const_string "spreg")
179 (and (eq_attr "type" "mcld")
180 (and (match_operand 0 "dp_register_operand" "")
181 (match_operand 1 "mem_i_address_operand" "")))
182 (const_string "ireg")
183 (and (eq_attr "type" "mcst")
184 (and (match_operand 1 "dp_register_operand" "")
185 (match_operand 0 "mem_p_address_operand" "")))
186 (const_string "preg")
187 (and (eq_attr "type" "mcst")
188 (and (match_operand 1 "dp_register_operand" "")
189 (match_operand 0 "mem_spfp_address_operand" "")))
190 (const_string "spreg")
191 (and (eq_attr "type" "mcst")
192 (and (match_operand 1 "dp_register_operand" "")
193 (match_operand 0 "mem_i_address_operand" "")))
194 (const_string "ireg")]
195 (const_string "32bit")))
197 (define_attr "storereg" "preg,other"
198 (cond [(and (eq_attr "type" "mcst")
199 (match_operand 1 "p_register_operand" ""))
200 (const_string "preg")]
201 (const_string "other")))
203 ;; Scheduling definitions
205 (define_automaton "bfin")
207 (define_cpu_unit "slot0" "bfin")
208 (define_cpu_unit "slot1" "bfin")
209 (define_cpu_unit "slot2" "bfin")
211 ;; Three units used to enforce parallel issue restrictions:
212 ;; only one of the 16-bit slots can use a P register in an address,
213 ;; and only one them can be a store.
214 (define_cpu_unit "store" "bfin")
215 (define_cpu_unit "pregs" "bfin")
217 ;; A dummy unit used to delay scheduling of loads after a conditional
219 (define_cpu_unit "load" "bfin")
221 ;; A logical unit used to work around anomaly 05000074.
222 (define_cpu_unit "anomaly_05000074" "bfin")
224 (define_reservation "core" "slot0+slot1+slot2")
226 (define_insn_reservation "alu" 1
227 (eq_attr "type" "move,movcc,mvi,alu0,shft,brcc,br,call,misc,sync,compare")
230 (define_insn_reservation "imul" 3
231 (eq_attr "type" "mult")
234 (define_insn_reservation "dsp32" 1
235 (eq_attr "type" "dsp32")
238 (define_insn_reservation "dsp32shiftimm" 1
239 (and (eq_attr "type" "dsp32shiftimm")
240 (not (match_test "ENABLE_WA_05000074")))
243 (define_insn_reservation "dsp32shiftimm_anomaly_05000074" 1
244 (and (eq_attr "type" "dsp32shiftimm")
245 (match_test "ENABLE_WA_05000074"))
246 "slot0+anomaly_05000074")
248 (define_insn_reservation "load32" 1
249 (and (not (eq_attr "seq_insns" "multi"))
250 (and (eq_attr "type" "mcld") (eq_attr "addrtype" "32bit")))
253 (define_insn_reservation "loadp" 1
254 (and (not (eq_attr "seq_insns" "multi"))
255 (and (eq_attr "type" "mcld") (eq_attr "addrtype" "preg")))
258 (define_insn_reservation "loadsp" 1
259 (and (not (eq_attr "seq_insns" "multi"))
260 (and (eq_attr "type" "mcld") (eq_attr "addrtype" "spreg")))
263 (define_insn_reservation "loadi" 1
264 (and (not (eq_attr "seq_insns" "multi"))
265 (and (eq_attr "type" "mcld") (eq_attr "addrtype" "ireg")))
266 "(slot1|slot2)+load")
268 (define_insn_reservation "store32" 1
269 (and (not (eq_attr "seq_insns" "multi"))
270 (and (eq_attr "type" "mcst") (eq_attr "addrtype" "32bit")))
273 (define_insn_reservation "storep" 1
274 (and (and (not (eq_attr "seq_insns" "multi"))
275 (and (eq_attr "type" "mcst")
276 (ior (eq_attr "addrtype" "preg")
277 (eq_attr "addrtype" "spreg"))))
278 (ior (not (match_test "ENABLE_WA_05000074"))
279 (eq_attr "storereg" "other")))
282 (define_insn_reservation "storep_anomaly_05000074" 1
283 (and (and (not (eq_attr "seq_insns" "multi"))
284 (and (eq_attr "type" "mcst")
285 (ior (eq_attr "addrtype" "preg")
286 (eq_attr "addrtype" "spreg"))))
287 (and (match_test "ENABLE_WA_05000074")
288 (eq_attr "storereg" "preg")))
289 "slot1+anomaly_05000074+pregs+store")
291 (define_insn_reservation "storei" 1
292 (and (and (not (eq_attr "seq_insns" "multi"))
293 (and (eq_attr "type" "mcst") (eq_attr "addrtype" "ireg")))
294 (ior (not (match_test "ENABLE_WA_05000074"))
295 (eq_attr "storereg" "other")))
296 "(slot1|slot2)+store")
298 (define_insn_reservation "storei_anomaly_05000074" 1
299 (and (and (not (eq_attr "seq_insns" "multi"))
300 (and (eq_attr "type" "mcst") (eq_attr "addrtype" "ireg")))
301 (and (match_test "ENABLE_WA_05000074")
302 (eq_attr "storereg" "preg")))
303 "((slot1+anomaly_05000074)|slot2)+store")
305 (define_insn_reservation "multi" 2
306 (eq_attr "seq_insns" "multi")
309 (define_insn_reservation "load_stall1" 1
310 (and (eq_attr "type" "stall")
311 (match_operand 0 "const1_operand" ""))
314 (define_insn_reservation "load_stall3" 1
315 (and (eq_attr "type" "stall")
316 (match_operand 0 "const3_operand" ""))
319 (absence_set "slot0" "slot1,slot2")
320 (absence_set "slot1" "slot2")
322 ;; Make sure genautomata knows about the maximum latency that can be produced
323 ;; by the adjust_cost function.
324 (define_insn_reservation "dummy" 5
325 (eq_attr "type" "dummy")
328 ;; Operand and operator predicates
330 (include "predicates.md")
331 (include "constraints.md")
333 ;;; FRIO branches have been optimized for code density
334 ;;; this comes at a slight cost of complexity when
335 ;;; a compiler needs to generate branches in the general
336 ;;; case. In order to generate the correct branching
337 ;;; mechanisms the compiler needs keep track of instruction
338 ;;; lengths. The follow table describes how to count instructions
339 ;;; for the FRIO architecture.
341 ;;; unconditional br are 12-bit imm pcrelative branches *2
342 ;;; conditional br are 10-bit imm pcrelative branches *2
344 ;;; 1024 10-bit imm *2 is 2048 (-1024..1022)
346 ;;; 4096 12-bit imm *2 is 8192 (-4096..4094)
347 ;;; NOTE : For brcc we generate instructions such as
348 ;;; if cc jmp; jump.[sl] offset
349 ;;; offset of jump.[sl] is from the jump instruction but
350 ;;; gcc calculates length from the if cc jmp instruction
351 ;;; furthermore gcc takes the end address of the branch instruction
352 ;;; as (pc) for a forward branch
353 ;;; hence our range is (-4094, 4092) instead of (-4096, 4094) for a br
355 ;;; The way the (pc) rtx works in these calculations is somewhat odd;
356 ;;; for backward branches it's the address of the current instruction,
357 ;;; for forward branches it's the previously known address of the following
358 ;;; instruction - we have to take this into account by reducing the range
359 ;;; for a forward branch.
361 ;; Lengths for type "mvi" insns are always defined by the instructions
363 (define_attr "length" ""
364 (cond [(eq_attr "type" "mcld")
365 (if_then_else (match_operand 1 "effective_address_32bit_p" "")
366 (const_int 4) (const_int 2))
368 (eq_attr "type" "mcst")
369 (if_then_else (match_operand 0 "effective_address_32bit_p" "")
370 (const_int 4) (const_int 2))
372 (eq_attr "type" "move") (const_int 2)
374 (eq_attr "type" "dsp32") (const_int 4)
375 (eq_attr "type" "dsp32shiftimm") (const_int 4)
376 (eq_attr "type" "call") (const_int 4)
378 (eq_attr "type" "br")
380 (le (minus (match_dup 0) (pc)) (const_int 4092))
381 (ge (minus (match_dup 0) (pc)) (const_int -4096)))
385 (eq_attr "type" "brcc")
387 (le (minus (match_dup 3) (pc)) (const_int 1020))
388 (ge (minus (match_dup 3) (pc)) (const_int -1024)))
391 (le (minus (match_dup 3) (pc)) (const_int 4092))
392 (ge (minus (match_dup 3) (pc)) (const_int -4094)))
399 ;; Classify the insns into those that are one instruction and those that
400 ;; are more than one in sequence.
401 (define_attr "seq_insns" "single,multi"
402 (const_string "single"))
404 ;; Describe a user's asm statement.
405 (define_asm_attributes
406 [(set_attr "type" "misc")
407 (set_attr "seq_insns" "multi")
408 (set_attr "length" "4")])
412 (define_mode_iterator CCMOV [QI HI SI])
414 (define_expand "mov<mode>cc"
415 [(set (match_operand:CCMOV 0 "register_operand" "")
416 (if_then_else:CCMOV (match_operand 1 "comparison_operator" "")
417 (match_operand:CCMOV 2 "register_operand" "")
418 (match_operand:CCMOV 3 "register_operand" "")))]
421 operands[1] = bfin_gen_compare (operands[1], <MODE>mode);
424 (define_insn "*mov<mode>cc_insn1"
425 [(set (match_operand:CCMOV 0 "register_operand" "=da,da,da")
427 (eq:BI (match_operand:BI 3 "register_operand" "C,C,C")
429 (match_operand:CCMOV 1 "register_operand" "da,0,da")
430 (match_operand:CCMOV 2 "register_operand" "0,da,da")))]
435 if !cc %0 = %1; if cc %0 = %2;"
436 [(set_attr "length" "2,2,4")
437 (set_attr "type" "movcc")
438 (set_attr "seq_insns" "*,*,multi")])
440 (define_insn "*mov<mode>cc_insn2"
441 [(set (match_operand:CCMOV 0 "register_operand" "=da,da,da")
443 (ne:BI (match_operand:BI 3 "register_operand" "C,C,C")
445 (match_operand:CCMOV 1 "register_operand" "0,da,da")
446 (match_operand:CCMOV 2 "register_operand" "da,0,da")))]
451 if cc %0 = %1; if !cc %0 = %2;"
452 [(set_attr "length" "2,2,4")
453 (set_attr "type" "movcc")
454 (set_attr "seq_insns" "*,*,multi")])
456 ;; Insns to load HIGH and LO_SUM
458 (define_insn "movsi_high"
459 [(set (match_operand:SI 0 "register_operand" "=x")
460 (high:SI (match_operand:SI 1 "immediate_operand" "i")))]
463 [(set_attr "type" "mvi")
464 (set_attr "length" "4")])
466 (define_insn "movstricthi_high"
467 [(set (match_operand:SI 0 "register_operand" "+x")
468 (ior:SI (and:SI (match_dup 0) (const_int 65535))
469 (match_operand:SI 1 "immediate_operand" "i")))]
472 [(set_attr "type" "mvi")
473 (set_attr "length" "4")])
475 (define_insn "movsi_low"
476 [(set (match_operand:SI 0 "register_operand" "=x")
477 (lo_sum:SI (match_operand:SI 1 "register_operand" "0")
478 (match_operand:SI 2 "immediate_operand" "i")))]
481 [(set_attr "type" "mvi")
482 (set_attr "length" "4")])
484 (define_insn "movsi_high_pic"
485 [(set (match_operand:SI 0 "register_operand" "=x")
486 (high:SI (unspec:SI [(match_operand:SI 1 "" "")]
490 [(set_attr "type" "mvi")
491 (set_attr "length" "4")])
493 (define_insn "movsi_low_pic"
494 [(set (match_operand:SI 0 "register_operand" "=x")
495 (lo_sum:SI (match_operand:SI 1 "register_operand" "0")
496 (unspec:SI [(match_operand:SI 2 "" "")]
499 "%h0 = %h2@GOT_HIGH;"
500 [(set_attr "type" "mvi")
501 (set_attr "length" "4")])
503 ;;; Move instructions
505 (define_insn_and_split "movdi_insn"
506 [(set (match_operand:DI 0 "nonimmediate_operand" "=x,mx,r")
507 (match_operand:DI 1 "general_operand" "iFx,r,mx"))]
508 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
511 [(set (match_dup 2) (match_dup 3))
512 (set (match_dup 4) (match_dup 5))]
514 rtx lo_half[2], hi_half[2];
515 split_di (operands, 2, lo_half, hi_half);
517 if (reg_overlap_mentioned_p (lo_half[0], hi_half[1]))
519 operands[2] = hi_half[0];
520 operands[3] = hi_half[1];
521 operands[4] = lo_half[0];
522 operands[5] = lo_half[1];
526 operands[2] = lo_half[0];
527 operands[3] = lo_half[1];
528 operands[4] = hi_half[0];
529 operands[5] = hi_half[1];
534 [(set (match_operand:BI 0 "nonimmediate_operand" "=x,x,d,md,C,d,C,P1")
535 (match_operand:BI 1 "general_operand" "x,xKs3,md,d,d,C,P0,P1"))]
547 [(set_attr "type" "move,mvi,mcld,mcst,compare,compare,compare,compare")
548 (set_attr "length" "2,2,*,*,2,2,2,2")
549 (set_attr "seq_insns" "*,*,*,*,*,*,*,*")])
551 (define_insn "movpdi"
552 [(set (match_operand:PDI 0 "nonimmediate_operand" "=e,<,e")
553 (match_operand:PDI 1 "general_operand" " e,e,>"))]
559 [(set_attr "type" "move,mcst,mcld")
560 (set_attr "seq_insns" "*,multi,multi")])
562 (define_insn "load_accumulator"
563 [(set (match_operand:PDI 0 "register_operand" "=e")
564 (sign_extend:PDI (match_operand:SI 1 "register_operand" "d")))]
567 [(set_attr "type" "move")])
569 (define_insn_and_split "load_accumulator_pair"
570 [(set (match_operand:V2PDI 0 "register_operand" "=e")
571 (sign_extend:V2PDI (vec_concat:V2SI
572 (match_operand:SI 1 "register_operand" "d")
573 (match_operand:SI 2 "register_operand" "d"))))]
577 [(set (match_dup 3) (sign_extend:PDI (match_dup 1)))
578 (set (match_dup 4) (sign_extend:PDI (match_dup 2)))]
580 operands[3] = gen_rtx_REG (PDImode, REGNO (operands[0]));
581 operands[4] = gen_rtx_REG (PDImode, REGNO (operands[0]) + 1);
584 (define_insn "*pushsi_insn"
585 [(set (mem:SI (pre_dec:SI (reg:SI REG_SP)))
586 (match_operand:SI 0 "register_operand" "xy"))]
589 [(set_attr "type" "mcst")
590 (set_attr "addrtype" "32bit")
591 (set_attr "length" "2")])
593 (define_insn "*popsi_insn"
594 [(set (match_operand:SI 0 "register_operand" "=d,xy")
595 (mem:SI (post_inc:SI (reg:SI REG_SP))))]
598 [(set_attr "type" "mcld")
599 (set_attr "addrtype" "preg,32bit")
600 (set_attr "length" "2")])
602 ;; The first alternative is used to make reload choose a limited register
603 ;; class when faced with a movsi_insn that had its input operand replaced
604 ;; with a PLUS. We generally require fewer secondary reloads this way.
606 (define_insn "*movsi_insn"
607 [(set (match_operand:SI 0 "nonimmediate_operand" "=da,x,da,y,da,x,x,x,da,mr")
608 (match_operand:SI 1 "general_operand" "da,x,y,da,xKs7,xKsh,xKuh,ix,mr,da"))]
609 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
621 [(set_attr "type" "move,move,move,move,mvi,mvi,mvi,*,mcld,mcst")
622 (set_attr "length" "2,2,2,2,2,4,4,*,*,*")])
624 (define_insn "*movsi_insn32"
625 [(set (match_operand:SI 0 "register_operand" "=d,d")
626 (unspec:SI [(match_operand:SI 1 "nonmemory_operand" "d,P0")] UNSPEC_32BIT))]
631 [(set_attr "type" "dsp32shiftimm,dsp32")])
634 [(set (match_operand:SI 0 "d_register_operand" "")
636 "splitting_for_sched && !optimize_size"
637 [(set (match_dup 0) (unspec:SI [(const_int 0)] UNSPEC_32BIT))])
640 [(set (match_operand:SI 0 "d_register_operand" "")
641 (match_operand:SI 1 "d_register_operand" ""))]
642 "splitting_for_sched && !optimize_size"
643 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_32BIT))])
645 (define_insn_and_split "*movv2hi_insn"
646 [(set (match_operand:V2HI 0 "nonimmediate_operand" "=da,da,d,dm")
647 (match_operand:V2HI 1 "general_operand" "i,di,md,d"))]
649 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
655 "reload_completed && GET_CODE (operands[1]) == CONST_VECTOR"
656 [(set (match_dup 0) (high:SI (match_dup 2)))
657 (set (match_dup 0) (lo_sum:SI (match_dup 0) (match_dup 3)))]
659 HOST_WIDE_INT intval = INTVAL (XVECEXP (operands[1], 0, 1)) << 16;
660 intval |= INTVAL (XVECEXP (operands[1], 0, 0)) & 0xFFFF;
662 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));
663 operands[2] = operands[3] = GEN_INT (trunc_int_for_mode (intval, SImode));
665 [(set_attr "type" "move,move,mcld,mcst")
666 (set_attr "length" "2,2,*,*")])
668 (define_insn "*movhi_insn"
669 [(set (match_operand:HI 0 "nonimmediate_operand" "=x,da,x,d,mr")
670 (match_operand:HI 1 "general_operand" "x,xKs7,xKsh,mr,d"))]
671 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
673 static const char *templates[] = {
682 int alt = which_alternative;
683 rtx mem = (MEM_P (operands[0]) ? operands[0]
684 : MEM_P (operands[1]) ? operands[1] : NULL_RTX);
685 if (mem && bfin_dsp_memref_p (mem))
687 return templates[alt];
689 [(set_attr "type" "move,mvi,mvi,mcld,mcst")
690 (set_attr "length" "2,2,4,*,*")])
692 (define_insn "*movqi_insn"
693 [(set (match_operand:QI 0 "nonimmediate_operand" "=x,da,x,d,mr")
694 (match_operand:QI 1 "general_operand" "x,xKs7,xKsh,mr,d"))]
695 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
702 [(set_attr "type" "move,mvi,mvi,mcld,mcst")
703 (set_attr "length" "2,2,4,*,*")])
705 (define_insn "*movsf_insn"
706 [(set (match_operand:SF 0 "nonimmediate_operand" "=x,x,da,mr")
707 (match_operand:SF 1 "general_operand" "x,Fx,mr,da"))]
708 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
714 [(set_attr "type" "move,*,mcld,mcst")])
716 (define_insn_and_split "movdf_insn"
717 [(set (match_operand:DF 0 "nonimmediate_operand" "=x,mx,r")
718 (match_operand:DF 1 "general_operand" "iFx,r,mx"))]
719 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
722 [(set (match_dup 2) (match_dup 3))
723 (set (match_dup 4) (match_dup 5))]
725 rtx lo_half[2], hi_half[2];
726 split_di (operands, 2, lo_half, hi_half);
728 if (reg_overlap_mentioned_p (lo_half[0], hi_half[1]))
730 operands[2] = hi_half[0];
731 operands[3] = hi_half[1];
732 operands[4] = lo_half[0];
733 operands[5] = lo_half[1];
737 operands[2] = lo_half[0];
738 operands[3] = lo_half[1];
739 operands[4] = hi_half[0];
740 operands[5] = hi_half[1];
744 ;; Storing halfwords.
745 (define_insn "*movsi_insv"
746 [(set (zero_extract:SI (match_operand 0 "register_operand" "+d,x")
749 (match_operand:SI 1 "nonmemory_operand" "d,n"))]
754 [(set_attr "type" "dsp32shiftimm,mvi")])
756 (define_expand "insv"
757 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "")
758 (match_operand:SI 1 "immediate_operand" "")
759 (match_operand:SI 2 "immediate_operand" ""))
760 (match_operand:SI 3 "nonmemory_operand" ""))]
763 if (INTVAL (operands[1]) != 16 || INTVAL (operands[2]) != 16)
766 /* From mips.md: insert_bit_field doesn't verify that our source
767 matches the predicate, so check it again here. */
768 if (! register_operand (operands[0], VOIDmode))
772 ;; This is the main "hook" for PIC code. When generating
773 ;; PIC, movsi is responsible for determining when the source address
774 ;; needs PIC relocation and appropriately calling legitimize_pic_address
775 ;; to perform the actual relocation.
777 (define_expand "movsi"
778 [(set (match_operand:SI 0 "nonimmediate_operand" "")
779 (match_operand:SI 1 "general_operand" ""))]
782 if (expand_move (operands, SImode))
786 (define_expand "movv2hi"
787 [(set (match_operand:V2HI 0 "nonimmediate_operand" "")
788 (match_operand:V2HI 1 "general_operand" ""))]
790 "expand_move (operands, V2HImode);")
792 (define_expand "movdi"
793 [(set (match_operand:DI 0 "nonimmediate_operand" "")
794 (match_operand:DI 1 "general_operand" ""))]
796 "expand_move (operands, DImode);")
798 (define_expand "movsf"
799 [(set (match_operand:SF 0 "nonimmediate_operand" "")
800 (match_operand:SF 1 "general_operand" ""))]
802 "expand_move (operands, SFmode);")
804 (define_expand "movdf"
805 [(set (match_operand:DF 0 "nonimmediate_operand" "")
806 (match_operand:DF 1 "general_operand" ""))]
808 "expand_move (operands, DFmode);")
810 (define_expand "movhi"
811 [(set (match_operand:HI 0 "nonimmediate_operand" "")
812 (match_operand:HI 1 "general_operand" ""))]
814 "expand_move (operands, HImode);")
816 (define_expand "movqi"
817 [(set (match_operand:QI 0 "nonimmediate_operand" "")
818 (match_operand:QI 1 "general_operand" ""))]
820 " expand_move (operands, QImode); ")
822 ;; Some define_splits to break up SI/SFmode loads of immediate constants.
825 [(set (match_operand:SI 0 "register_operand" "")
826 (match_operand:SI 1 "symbolic_or_const_operand" ""))]
828 /* Always split symbolic operands; split integer constants that are
829 too large for a single instruction. */
830 && (GET_CODE (operands[1]) != CONST_INT
831 || (INTVAL (operands[1]) < -32768
832 || INTVAL (operands[1]) >= 65536
833 || (INTVAL (operands[1]) >= 32768 && PREG_P (operands[0]))))"
834 [(set (match_dup 0) (high:SI (match_dup 1)))
835 (set (match_dup 0) (lo_sum:SI (match_dup 0) (match_dup 1)))]
837 if (GET_CODE (operands[1]) == CONST_INT
838 && split_load_immediate (operands))
840 /* ??? Do something about TARGET_LOW_64K. */
844 [(set (match_operand:SF 0 "register_operand" "")
845 (match_operand:SF 1 "immediate_operand" ""))]
847 [(set (match_dup 2) (high:SI (match_dup 3)))
848 (set (match_dup 2) (lo_sum:SI (match_dup 2) (match_dup 3)))]
851 REAL_VALUE_TYPE value;
853 gcc_assert (GET_CODE (operands[1]) == CONST_DOUBLE);
855 REAL_VALUE_FROM_CONST_DOUBLE (value, operands[1]);
856 REAL_VALUE_TO_TARGET_SINGLE (value, values);
858 operands[2] = gen_rtx_REG (SImode, true_regnum (operands[0]));
859 operands[3] = GEN_INT (trunc_int_for_mode (values, SImode));
860 if (values >= -32768 && values < 65536)
862 emit_move_insn (operands[2], operands[3]);
865 if (split_load_immediate (operands + 2))
869 ;; Sadly, this can't be a proper named movstrict pattern, since the compiler
870 ;; expects to be able to use registers for operand 1.
871 ;; Note that the asm instruction is defined by the manual to take an unsigned
872 ;; constant, but it doesn't matter to the assembler, and the compiler only
873 ;; deals with sign-extended constants. Hence "Ksh".
874 (define_insn "movstricthi_1"
875 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+x"))
876 (match_operand:HI 1 "immediate_operand" "Ksh"))]
879 [(set_attr "type" "mvi")
880 (set_attr "length" "4")])
882 ;; Sign and zero extensions
884 (define_insn_and_split "extendhisi2"
885 [(set (match_operand:SI 0 "register_operand" "=d, d")
886 (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d, m")))]
891 "reload_completed && bfin_dsp_memref_p (operands[1])"
892 [(set (match_dup 2) (match_dup 1))
893 (set (match_dup 0) (sign_extend:SI (match_dup 2)))]
895 operands[2] = gen_lowpart (HImode, operands[0]);
897 [(set_attr "type" "alu0,mcld")])
899 (define_insn_and_split "zero_extendhisi2"
900 [(set (match_operand:SI 0 "register_operand" "=d, d")
901 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d, m")))]
906 "reload_completed && bfin_dsp_memref_p (operands[1])"
907 [(set (match_dup 2) (match_dup 1))
908 (set (match_dup 0) (zero_extend:SI (match_dup 2)))]
910 operands[2] = gen_lowpart (HImode, operands[0]);
912 [(set_attr "type" "alu0,mcld")])
914 (define_insn "zero_extendbisi2"
915 [(set (match_operand:SI 0 "register_operand" "=d")
916 (zero_extend:SI (match_operand:BI 1 "nonimmediate_operand" "C")))]
919 [(set_attr "type" "compare")])
921 (define_insn "extendqihi2"
922 [(set (match_operand:HI 0 "register_operand" "=d, d")
923 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "m, d")))]
928 [(set_attr "type" "mcld,alu0")])
930 (define_insn "extendqisi2"
931 [(set (match_operand:SI 0 "register_operand" "=d, d")
932 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "m, d")))]
937 [(set_attr "type" "mcld,alu0")])
940 (define_insn "zero_extendqihi2"
941 [(set (match_operand:HI 0 "register_operand" "=d, d")
942 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "m, d")))]
947 [(set_attr "type" "mcld,alu0")])
950 (define_insn "zero_extendqisi2"
951 [(set (match_operand:SI 0 "register_operand" "=d, d")
952 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "m, d")))]
957 [(set_attr "type" "mcld,alu0")])
959 ;; DImode logical operations
961 (define_code_iterator any_logical [and ior xor])
962 (define_code_attr optab [(and "and")
965 (define_code_attr op [(and "&")
968 (define_code_attr high_result [(and "0")
972 ;; Keep this pattern around to avoid generating NO_CONFLICT blocks.
973 (define_expand "<optab>di3"
974 [(set (match_operand:DI 0 "register_operand" "=d")
975 (any_logical:DI (match_operand:DI 1 "register_operand" "0")
976 (match_operand:DI 2 "general_operand" "d")))]
979 rtx hi_half[3], lo_half[3];
980 enum insn_code icode = CODE_FOR_<optab>si3;
981 if (!reg_overlap_mentioned_p (operands[0], operands[1])
982 && !reg_overlap_mentioned_p (operands[0], operands[2]))
983 emit_clobber (operands[0]);
984 split_di (operands, 3, lo_half, hi_half);
985 if (!(*insn_data[icode].operand[2].predicate) (lo_half[2], SImode))
986 lo_half[2] = force_reg (SImode, lo_half[2]);
987 emit_insn (GEN_FCN (icode) (lo_half[0], lo_half[1], lo_half[2]));
988 if (!(*insn_data[icode].operand[2].predicate) (hi_half[2], SImode))
989 hi_half[2] = force_reg (SImode, hi_half[2]);
990 emit_insn (GEN_FCN (icode) (hi_half[0], hi_half[1], hi_half[2]));
994 (define_insn "zero_extendqidi2"
995 [(set (match_operand:DI 0 "register_operand" "=d")
996 (zero_extend:DI (match_operand:QI 1 "register_operand" "d")))]
998 "%0 = %T1 (Z);\\n\\t%H0 = 0;"
999 [(set_attr "length" "4")
1000 (set_attr "seq_insns" "multi")])
1002 (define_insn "zero_extendhidi2"
1003 [(set (match_operand:DI 0 "register_operand" "=d")
1004 (zero_extend:DI (match_operand:HI 1 "register_operand" "d")))]
1006 "%0 = %h1 (Z);\\n\\t%H0 = 0;"
1007 [(set_attr "length" "4")
1008 (set_attr "seq_insns" "multi")])
1010 (define_insn_and_split "extendsidi2"
1011 [(set (match_operand:DI 0 "register_operand" "=d")
1012 (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))]
1016 [(set (match_dup 3) (match_dup 1))
1017 (set (match_dup 3) (ashiftrt:SI (match_dup 3) (const_int 31)))]
1019 split_di (operands, 1, operands + 2, operands + 3);
1020 if (REGNO (operands[0]) != REGNO (operands[1]))
1021 emit_move_insn (operands[2], operands[1]);
1024 (define_insn_and_split "extendqidi2"
1025 [(set (match_operand:DI 0 "register_operand" "=d")
1026 (sign_extend:DI (match_operand:QI 1 "register_operand" "d")))]
1030 [(set (match_dup 2) (sign_extend:SI (match_dup 1)))
1031 (set (match_dup 3) (sign_extend:SI (match_dup 1)))
1032 (set (match_dup 3) (ashiftrt:SI (match_dup 3) (const_int 31)))]
1034 split_di (operands, 1, operands + 2, operands + 3);
1037 (define_insn_and_split "extendhidi2"
1038 [(set (match_operand:DI 0 "register_operand" "=d")
1039 (sign_extend:DI (match_operand:HI 1 "register_operand" "d")))]
1043 [(set (match_dup 2) (sign_extend:SI (match_dup 1)))
1044 (set (match_dup 3) (sign_extend:SI (match_dup 1)))
1045 (set (match_dup 3) (ashiftrt:SI (match_dup 3) (const_int 31)))]
1047 split_di (operands, 1, operands + 2, operands + 3);
1050 ;; DImode arithmetic operations
1052 (define_insn "add_with_carry"
1053 [(set (match_operand:SI 0 "register_operand" "=d,d")
1054 (plus:SI (match_operand:SI 1 "register_operand" "%0,d")
1055 (match_operand:SI 2 "nonmemory_operand" "Ks7,d")))
1056 (set (match_operand:BI 3 "register_operand" "=C,C")
1057 (ltu:BI (not:SI (match_dup 1)) (match_dup 2)))]
1061 %0 = %1 + %2; cc = ac0;"
1062 [(set_attr "type" "alu0")
1063 (set_attr "length" "4")
1064 (set_attr "seq_insns" "multi")])
1066 (define_insn "sub_with_carry"
1067 [(set (match_operand:SI 0 "register_operand" "=d")
1068 (minus:SI (match_operand:SI 1 "register_operand" "%d")
1069 (match_operand:SI 2 "nonmemory_operand" "d")))
1070 (set (match_operand:BI 3 "register_operand" "=C")
1071 (leu:BI (match_dup 2) (match_dup 1)))]
1073 "%0 = %1 - %2; cc = ac0;"
1074 [(set_attr "type" "alu0")
1075 (set_attr "length" "4")
1076 (set_attr "seq_insns" "multi")])
1078 (define_expand "adddi3"
1079 [(set (match_operand:DI 0 "register_operand" "")
1080 (plus:DI (match_operand:DI 1 "register_operand" "")
1081 (match_operand:DI 2 "nonmemory_operand" "")))
1082 (clobber (match_scratch:SI 3 ""))
1083 (clobber (reg:CC 34))]
1087 xops[0] = gen_lowpart (SImode, operands[0]);
1088 xops[1] = simplify_gen_subreg (SImode, operands[0], DImode, 4);
1089 xops[2] = gen_lowpart (SImode, operands[1]);
1090 xops[3] = simplify_gen_subreg (SImode, operands[1], DImode, 4);
1091 xops[4] = gen_lowpart (SImode, operands[2]);
1092 xops[5] = simplify_gen_subreg (SImode, operands[2], DImode, 4);
1093 xops[6] = gen_reg_rtx (SImode);
1094 xops[7] = gen_rtx_REG (BImode, REG_CC);
1095 if (!register_operand (xops[4], SImode)
1096 && (GET_CODE (xops[4]) != CONST_INT
1097 || !satisfies_constraint_Ks7 (xops[4])))
1098 xops[4] = force_reg (SImode, xops[4]);
1099 if (!reg_overlap_mentioned_p (operands[0], operands[1])
1100 && !reg_overlap_mentioned_p (operands[0], operands[2]))
1101 emit_clobber (operands[0]);
1102 emit_insn (gen_add_with_carry (xops[0], xops[2], xops[4], xops[7]));
1103 emit_insn (gen_movbisi (xops[6], xops[7]));
1104 if (!register_operand (xops[5], SImode)
1105 && (GET_CODE (xops[5]) != CONST_INT
1106 || !satisfies_constraint_Ks7 (xops[5])))
1107 xops[5] = force_reg (SImode, xops[5]);
1108 if (xops[5] != const0_rtx)
1109 emit_insn (gen_addsi3 (xops[1], xops[3], xops[5]));
1111 emit_move_insn (xops[1], xops[3]);
1112 emit_insn (gen_addsi3 (xops[1], xops[1], xops[6]));
1116 (define_expand "subdi3"
1117 [(set (match_operand:DI 0 "register_operand" "")
1118 (minus:DI (match_operand:DI 1 "register_operand" "")
1119 (match_operand:DI 2 "register_operand" "")))
1120 (clobber (reg:CC 34))]
1124 xops[0] = gen_lowpart (SImode, operands[0]);
1125 xops[1] = simplify_gen_subreg (SImode, operands[0], DImode, 4);
1126 xops[2] = gen_lowpart (SImode, operands[1]);
1127 xops[3] = simplify_gen_subreg (SImode, operands[1], DImode, 4);
1128 xops[4] = gen_lowpart (SImode, operands[2]);
1129 xops[5] = simplify_gen_subreg (SImode, operands[2], DImode, 4);
1130 xops[6] = gen_reg_rtx (SImode);
1131 xops[7] = gen_rtx_REG (BImode, REG_CC);
1132 if (!reg_overlap_mentioned_p (operands[0], operands[1])
1133 && !reg_overlap_mentioned_p (operands[0], operands[2]))
1134 emit_clobber (operands[0]);
1135 emit_insn (gen_sub_with_carry (xops[0], xops[2], xops[4], xops[7]));
1136 emit_insn (gen_notbi (xops[7], xops[7]));
1137 emit_insn (gen_movbisi (xops[6], xops[7]));
1138 emit_insn (gen_subsi3 (xops[1], xops[3], xops[5]));
1139 emit_insn (gen_subsi3 (xops[1], xops[1], xops[6]));
1143 ;; Combined shift/add instructions
1146 [(set (match_operand:SI 0 "register_operand" "=a,d")
1147 (ashift:SI (plus:SI (match_operand:SI 1 "register_operand" "%0,0")
1148 (match_operand:SI 2 "register_operand" "a,d"))
1149 (match_operand:SI 3 "pos_scale_operand" "P1P2,P1P2")))]
1151 "%0 = (%0 + %2) << %3;" /* "shadd %0,%2,%3;" */
1152 [(set_attr "type" "alu0")])
1155 [(set (match_operand:SI 0 "register_operand" "=a")
1156 (plus:SI (match_operand:SI 1 "register_operand" "a")
1157 (mult:SI (match_operand:SI 2 "register_operand" "a")
1158 (match_operand:SI 3 "scale_by_operand" "i"))))]
1160 "%0 = %1 + (%2 << %X3);"
1161 [(set_attr "type" "alu0")])
1164 [(set (match_operand:SI 0 "register_operand" "=a")
1165 (plus:SI (match_operand:SI 1 "register_operand" "a")
1166 (ashift:SI (match_operand:SI 2 "register_operand" "a")
1167 (match_operand:SI 3 "pos_scale_operand" "i"))))]
1169 "%0 = %1 + (%2 << %3);"
1170 [(set_attr "type" "alu0")])
1173 [(set (match_operand:SI 0 "register_operand" "=a")
1174 (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "a")
1175 (match_operand:SI 2 "scale_by_operand" "i"))
1176 (match_operand:SI 3 "register_operand" "a")))]
1178 "%0 = %3 + (%1 << %X2);"
1179 [(set_attr "type" "alu0")])
1182 [(set (match_operand:SI 0 "register_operand" "=a")
1183 (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "a")
1184 (match_operand:SI 2 "pos_scale_operand" "i"))
1185 (match_operand:SI 3 "register_operand" "a")))]
1187 "%0 = %3 + (%1 << %2);"
1188 [(set_attr "type" "alu0")])
1190 (define_insn "mulhisi3"
1191 [(set (match_operand:SI 0 "register_operand" "=d")
1192 (mult:SI (sign_extend:SI (match_operand:HI 1 "register_operand" "%d"))
1193 (sign_extend:SI (match_operand:HI 2 "register_operand" "d"))))]
1195 "%0 = %h1 * %h2 (IS)%!"
1196 [(set_attr "type" "dsp32")])
1198 (define_insn "umulhisi3"
1199 [(set (match_operand:SI 0 "register_operand" "=d")
1200 (mult:SI (zero_extend:SI (match_operand:HI 1 "register_operand" "%d"))
1201 (zero_extend:SI (match_operand:HI 2 "register_operand" "d"))))]
1203 "%0 = %h1 * %h2 (FU)%!"
1204 [(set_attr "type" "dsp32")])
1206 (define_insn "usmulhisi3"
1207 [(set (match_operand:SI 0 "register_operand" "=W")
1208 (mult:SI (zero_extend:SI (match_operand:HI 1 "register_operand" "W"))
1209 (sign_extend:SI (match_operand:HI 2 "register_operand" "W"))))]
1211 "%0 = %h2 * %h1 (IS,M)%!"
1212 [(set_attr "type" "dsp32")])
1214 ;; The alternative involving IREGS requires that the corresponding L register
1217 (define_insn "addsi3"
1218 [(set (match_operand:SI 0 "register_operand" "=ad,a,d,b")
1219 (plus:SI (match_operand:SI 1 "register_operand" "%0, a,d,0")
1220 (match_operand:SI 2 "reg_or_7bit_operand" "Ks7, a,d,fP2P4")))]
1227 [(set_attr "type" "alu0")
1228 (set_attr "length" "2,2,2,2")])
1230 (define_insn "ssaddsi3"
1231 [(set (match_operand:SI 0 "register_operand" "=d")
1232 (ss_plus:SI (match_operand:SI 1 "register_operand" "d")
1233 (match_operand:SI 2 "register_operand" "d")))]
1235 "%0 = %1 + %2 (S)%!"
1236 [(set_attr "type" "dsp32")])
1238 (define_insn "subsi3"
1239 [(set (match_operand:SI 0 "register_operand" "=da,d,a")
1240 (minus:SI (match_operand:SI 1 "register_operand" "0,d,0")
1241 (match_operand:SI 2 "reg_or_neg7bit_operand" "KN7,d,a")))]
1244 static const char *const strings_subsi3[] = {
1250 if (CONSTANT_P (operands[2]) && INTVAL (operands[2]) < 0) {
1251 rtx tmp_op = operands[2];
1252 operands[2] = GEN_INT (-INTVAL (operands[2]));
1253 output_asm_insn ("%0 += %2;", operands);
1254 operands[2] = tmp_op;
1258 return strings_subsi3[which_alternative];
1260 [(set_attr "type" "alu0")])
1262 (define_insn "sssubsi3"
1263 [(set (match_operand:SI 0 "register_operand" "=d")
1264 (ss_minus:SI (match_operand:SI 1 "register_operand" "d")
1265 (match_operand:SI 2 "register_operand" "d")))]
1267 "%0 = %1 - %2 (S)%!"
1268 [(set_attr "type" "dsp32")])
1270 ;; Accumulator addition
1272 (define_insn "addpdi3"
1273 [(set (match_operand:PDI 0 "register_operand" "=A")
1274 (ss_plus:PDI (match_operand:PDI 1 "register_operand" "%0")
1275 (match_operand:PDI 2 "nonmemory_operand" "B")))]
1278 [(set_attr "type" "dsp32")])
1280 (define_insn "sum_of_accumulators"
1281 [(set (match_operand:SI 0 "register_operand" "=d")
1283 (ss_plus:PDI (match_operand:PDI 2 "register_operand" "1")
1284 (match_operand:PDI 3 "register_operand" "B"))))
1285 (set (match_operand:PDI 1 "register_operand" "=A")
1286 (ss_plus:PDI (match_dup 2) (match_dup 3)))]
1289 [(set_attr "type" "dsp32")])
1291 (define_insn "us_truncpdisi2"
1292 [(set (match_operand:SI 0 "register_operand" "=D,W")
1293 (us_truncate:SI (match_operand:PDI 1 "register_operand" "A,B")))]
1296 [(set_attr "type" "dsp32")])
1298 ;; Bit test instructions
1300 (define_insn "*not_bittst"
1301 [(set (match_operand:BI 0 "register_operand" "=C")
1302 (eq:BI (zero_extract:SI (match_operand:SI 1 "register_operand" "d")
1304 (match_operand:SI 2 "immediate_operand" "Ku5"))
1307 "cc = !BITTST (%1,%2);"
1308 [(set_attr "type" "alu0")])
1310 (define_insn "*bittst"
1311 [(set (match_operand:BI 0 "register_operand" "=C")
1312 (ne:BI (zero_extract:SI (match_operand:SI 1 "register_operand" "d")
1314 (match_operand:SI 2 "immediate_operand" "Ku5"))
1317 "cc = BITTST (%1,%2);"
1318 [(set_attr "type" "alu0")])
1320 (define_insn_and_split "*bit_extract"
1321 [(set (match_operand:SI 0 "register_operand" "=d")
1322 (zero_extract:SI (match_operand:SI 1 "register_operand" "d")
1324 (match_operand:SI 2 "immediate_operand" "Ku5")))
1325 (clobber (reg:BI REG_CC))]
1329 [(set (reg:BI REG_CC)
1330 (ne:BI (zero_extract:SI (match_dup 1) (const_int 1) (match_dup 2))
1333 (ne:SI (reg:BI REG_CC) (const_int 0)))])
1335 (define_insn_and_split "*not_bit_extract"
1336 [(set (match_operand:SI 0 "register_operand" "=d")
1337 (zero_extract:SI (not:SI (match_operand:SI 1 "register_operand" "d"))
1339 (match_operand:SI 2 "immediate_operand" "Ku5")))
1340 (clobber (reg:BI REG_CC))]
1344 [(set (reg:BI REG_CC)
1345 (eq:BI (zero_extract:SI (match_dup 1) (const_int 1) (match_dup 2))
1348 (ne:SI (reg:BI REG_CC) (const_int 0)))])
1350 (define_insn "*andsi_insn"
1351 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
1352 (and:SI (match_operand:SI 1 "register_operand" "%0,d,d,d")
1353 (match_operand:SI 2 "rhs_andsi3_operand" "L,M1,M2,d")))]
1360 [(set_attr "type" "alu0")])
1362 (define_expand "andsi3"
1363 [(set (match_operand:SI 0 "register_operand" "")
1364 (and:SI (match_operand:SI 1 "register_operand" "")
1365 (match_operand:SI 2 "general_operand" "")))]
1368 if (highbits_operand (operands[2], SImode))
1370 operands[2] = GEN_INT (exact_log2 (-INTVAL (operands[2])));
1371 emit_insn (gen_ashrsi3 (operands[0], operands[1], operands[2]));
1372 emit_insn (gen_ashlsi3 (operands[0], operands[0], operands[2]));
1375 if (! rhs_andsi3_operand (operands[2], SImode))
1376 operands[2] = force_reg (SImode, operands[2]);
1379 (define_insn "iorsi3"
1380 [(set (match_operand:SI 0 "register_operand" "=d,d")
1381 (ior:SI (match_operand:SI 1 "register_operand" "%0,d")
1382 (match_operand:SI 2 "regorlog2_operand" "J,d")))]
1387 [(set_attr "type" "alu0")])
1389 (define_insn "xorsi3"
1390 [(set (match_operand:SI 0 "register_operand" "=d,d")
1391 (xor:SI (match_operand:SI 1 "register_operand" "%0,d")
1392 (match_operand:SI 2 "regorlog2_operand" "J,d")))]
1397 [(set_attr "type" "alu0")])
1400 [(set (match_operand:HI 0 "register_operand" "=d")
1401 (unspec:HI [(match_operand:SI 1 "register_operand" "d")]
1405 [(set_attr "type" "alu0")])
1407 (define_insn "smaxsi3"
1408 [(set (match_operand:SI 0 "register_operand" "=d")
1409 (smax:SI (match_operand:SI 1 "register_operand" "d")
1410 (match_operand:SI 2 "register_operand" "d")))]
1413 [(set_attr "type" "dsp32")])
1415 (define_insn "sminsi3"
1416 [(set (match_operand:SI 0 "register_operand" "=d")
1417 (smin:SI (match_operand:SI 1 "register_operand" "d")
1418 (match_operand:SI 2 "register_operand" "d")))]
1421 [(set_attr "type" "dsp32")])
1423 (define_insn "abssi2"
1424 [(set (match_operand:SI 0 "register_operand" "=d")
1425 (abs:SI (match_operand:SI 1 "register_operand" "d")))]
1428 [(set_attr "type" "dsp32")])
1430 (define_insn "ssabssi2"
1431 [(set (match_operand:SI 0 "register_operand" "=d")
1432 (ss_abs:SI (match_operand:SI 1 "register_operand" "d")))]
1435 [(set_attr "type" "dsp32")])
1437 (define_insn "negsi2"
1438 [(set (match_operand:SI 0 "register_operand" "=d")
1439 (neg:SI (match_operand:SI 1 "register_operand" "d")))]
1442 [(set_attr "type" "alu0")])
1444 (define_insn "ssnegsi2"
1445 [(set (match_operand:SI 0 "register_operand" "=d")
1446 (ss_neg:SI (match_operand:SI 1 "register_operand" "d")))]
1449 [(set_attr "type" "dsp32")])
1451 (define_insn "one_cmplsi2"
1452 [(set (match_operand:SI 0 "register_operand" "=d")
1453 (not:SI (match_operand:SI 1 "register_operand" "d")))]
1456 [(set_attr "type" "alu0")])
1458 (define_expand "clrsbsi2"
1460 (truncate:HI (clrsb:SI (match_operand:SI 1 "register_operand" "d"))))
1461 (set (match_operand:SI 0 "register_operand")
1462 (zero_extend:SI (match_dup 2)))]
1465 operands[2] = gen_reg_rtx (HImode);
1468 (define_insn "signbitssi2"
1469 [(set (match_operand:HI 0 "register_operand" "=d")
1470 (truncate:HI (clrsb:SI (match_operand:SI 1 "register_operand" "d"))))]
1472 "%h0 = signbits %1%!"
1473 [(set_attr "type" "dsp32")])
1475 (define_insn "ssroundsi2"
1476 [(set (match_operand:HI 0 "register_operand" "=d")
1478 (lshiftrt:SI (ss_plus:SI (match_operand:SI 1 "register_operand" "d")
1483 [(set_attr "type" "dsp32")])
1485 (define_insn "smaxhi3"
1486 [(set (match_operand:HI 0 "register_operand" "=d")
1487 (smax:HI (match_operand:HI 1 "register_operand" "d")
1488 (match_operand:HI 2 "register_operand" "d")))]
1490 "%0 = max(%1,%2) (V)%!"
1491 [(set_attr "type" "dsp32")])
1493 (define_insn "sminhi3"
1494 [(set (match_operand:HI 0 "register_operand" "=d")
1495 (smin:HI (match_operand:HI 1 "register_operand" "d")
1496 (match_operand:HI 2 "register_operand" "d")))]
1498 "%0 = min(%1,%2) (V)%!"
1499 [(set_attr "type" "dsp32")])
1501 (define_insn "abshi2"
1502 [(set (match_operand:HI 0 "register_operand" "=d")
1503 (abs:HI (match_operand:HI 1 "register_operand" "d")))]
1506 [(set_attr "type" "dsp32")])
1508 (define_insn "neghi2"
1509 [(set (match_operand:HI 0 "register_operand" "=d")
1510 (neg:HI (match_operand:HI 1 "register_operand" "d")))]
1513 [(set_attr "type" "alu0")])
1515 (define_insn "ssneghi2"
1516 [(set (match_operand:HI 0 "register_operand" "=d")
1517 (ss_neg:HI (match_operand:HI 1 "register_operand" "d")))]
1520 [(set_attr "type" "dsp32")])
1522 (define_insn "clrsbhi2"
1523 [(set (match_operand:HI 0 "register_operand" "=d")
1524 (clrsb:HI (match_operand:HI 1 "register_operand" "d")))]
1526 "%h0 = signbits %h1%!"
1527 [(set_attr "type" "dsp32")])
1529 (define_insn "mulsi3"
1530 [(set (match_operand:SI 0 "register_operand" "=d")
1531 (mult:SI (match_operand:SI 1 "register_operand" "%0")
1532 (match_operand:SI 2 "register_operand" "d")))]
1535 [(set_attr "type" "mult")])
1537 (define_expand "umulsi3_highpart"
1539 [(set (match_operand:SI 0 "register_operand" "")
1542 (mult:DI (zero_extend:DI
1543 (match_operand:SI 1 "nonimmediate_operand" ""))
1545 (match_operand:SI 2 "register_operand" "")))
1547 (clobber (reg:PDI REG_A0))
1548 (clobber (reg:PDI REG_A1))])]
1553 rtx a1reg = gen_rtx_REG (PDImode, REG_A1);
1554 rtx a0reg = gen_rtx_REG (PDImode, REG_A0);
1555 emit_insn (gen_flag_macinit1hi (a1reg,
1556 gen_lowpart (HImode, operands[1]),
1557 gen_lowpart (HImode, operands[2]),
1558 GEN_INT (MACFLAG_FU)));
1559 emit_insn (gen_lshrpdi3 (a1reg, a1reg, GEN_INT (16)));
1560 emit_insn (gen_flag_mul_macv2hi_parts_acconly (a0reg, a1reg,
1561 gen_lowpart (V2HImode, operands[1]),
1562 gen_lowpart (V2HImode, operands[2]),
1563 const1_rtx, const1_rtx,
1564 const1_rtx, const0_rtx, a1reg,
1565 const0_rtx, GEN_INT (MACFLAG_FU),
1566 GEN_INT (MACFLAG_FU)));
1567 emit_insn (gen_flag_machi_parts_acconly (a1reg,
1568 gen_lowpart (V2HImode, operands[2]),
1569 gen_lowpart (V2HImode, operands[1]),
1570 const1_rtx, const0_rtx,
1571 a1reg, const0_rtx, GEN_INT (MACFLAG_FU)));
1572 emit_insn (gen_lshrpdi3 (a1reg, a1reg, GEN_INT (16)));
1573 emit_insn (gen_addpdi3 (a0reg, a0reg, a1reg));
1574 emit_insn (gen_us_truncpdisi2 (operands[0], a0reg));
1578 rtx umulsi3_highpart_libfunc
1579 = init_one_libfunc ("__umulsi3_highpart");
1581 emit_library_call_value (umulsi3_highpart_libfunc,
1582 operands[0], LCT_NORMAL, SImode,
1583 2, operands[1], SImode, operands[2], SImode);
1588 (define_expand "smulsi3_highpart"
1590 [(set (match_operand:SI 0 "register_operand" "")
1593 (mult:DI (sign_extend:DI
1594 (match_operand:SI 1 "nonimmediate_operand" ""))
1596 (match_operand:SI 2 "register_operand" "")))
1598 (clobber (reg:PDI REG_A0))
1599 (clobber (reg:PDI REG_A1))])]
1604 rtx a1reg = gen_rtx_REG (PDImode, REG_A1);
1605 rtx a0reg = gen_rtx_REG (PDImode, REG_A0);
1606 emit_insn (gen_flag_macinit1hi (a1reg,
1607 gen_lowpart (HImode, operands[1]),
1608 gen_lowpart (HImode, operands[2]),
1609 GEN_INT (MACFLAG_FU)));
1610 emit_insn (gen_lshrpdi3 (a1reg, a1reg, GEN_INT (16)));
1611 emit_insn (gen_flag_mul_macv2hi_parts_acconly (a0reg, a1reg,
1612 gen_lowpart (V2HImode, operands[1]),
1613 gen_lowpart (V2HImode, operands[2]),
1614 const1_rtx, const1_rtx,
1615 const1_rtx, const0_rtx, a1reg,
1616 const0_rtx, GEN_INT (MACFLAG_IS),
1617 GEN_INT (MACFLAG_IS_M)));
1618 emit_insn (gen_flag_machi_parts_acconly (a1reg,
1619 gen_lowpart (V2HImode, operands[2]),
1620 gen_lowpart (V2HImode, operands[1]),
1621 const1_rtx, const0_rtx,
1622 a1reg, const0_rtx, GEN_INT (MACFLAG_IS_M)));
1623 emit_insn (gen_ashrpdi3 (a1reg, a1reg, GEN_INT (16)));
1624 emit_insn (gen_sum_of_accumulators (operands[0], a0reg, a0reg, a1reg));
1628 rtx smulsi3_highpart_libfunc
1629 = init_one_libfunc ("__smulsi3_highpart");
1631 emit_library_call_value (smulsi3_highpart_libfunc,
1632 operands[0], LCT_NORMAL, SImode,
1633 2, operands[1], SImode, operands[2], SImode);
1638 (define_expand "ashlsi3"
1639 [(set (match_operand:SI 0 "register_operand" "")
1640 (ashift:SI (match_operand:SI 1 "register_operand" "")
1641 (match_operand:SI 2 "nonmemory_operand" "")))]
1644 if (GET_CODE (operands[2]) == CONST_INT
1645 && ((unsigned HOST_WIDE_INT) INTVAL (operands[2])) > 31)
1647 emit_insn (gen_movsi (operands[0], const0_rtx));
1652 (define_insn_and_split "*ashlsi3_insn"
1653 [(set (match_operand:SI 0 "register_operand" "=d,d,a,a,a")
1654 (ashift:SI (match_operand:SI 1 "register_operand" "0,d,a,a,a")
1655 (match_operand:SI 2 "nonmemory_operand" "dKu5,Ku5,P1,P2,?P3P4")))]
1663 "PREG_P (operands[0]) && INTVAL (operands[2]) > 2"
1664 [(set (match_dup 0) (ashift:SI (match_dup 1) (const_int 2)))
1665 (set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 3)))]
1666 "operands[3] = GEN_INT (INTVAL (operands[2]) - 2);"
1667 [(set_attr "type" "shft,dsp32shiftimm,shft,shft,*")])
1669 (define_insn "ashrsi3"
1670 [(set (match_operand:SI 0 "register_operand" "=d,d")
1671 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,d")
1672 (match_operand:SI 2 "nonmemory_operand" "dKu5,Ku5")))]
1677 [(set_attr "type" "shft,dsp32shiftimm")])
1679 (define_insn "rotl16"
1680 [(set (match_operand:SI 0 "register_operand" "=d")
1681 (rotate:SI (match_operand:SI 1 "register_operand" "d")
1684 "%0 = PACK (%h1, %d1)%!"
1685 [(set_attr "type" "dsp32")])
1687 (define_expand "rotlsi3"
1688 [(set (match_operand:SI 0 "register_operand" "")
1689 (rotate:SI (match_operand:SI 1 "register_operand" "")
1690 (match_operand:SI 2 "const_int_operand" "")))]
1693 if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 16)
1697 (define_expand "rotrsi3"
1698 [(set (match_operand:SI 0 "register_operand" "")
1699 (rotatert:SI (match_operand:SI 1 "register_operand" "")
1700 (match_operand:SI 2 "const_int_operand" "")))]
1703 if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 16)
1705 emit_insn (gen_rotl16 (operands[0], operands[1]));
1710 (define_insn "ror_one"
1711 [(set (match_operand:SI 0 "register_operand" "=d")
1712 (ior:SI (lshiftrt:SI (match_operand:SI 1 "register_operand" "d") (const_int 1))
1713 (ashift:SI (zero_extend:SI (reg:BI REG_CC)) (const_int 31))))
1714 (set (reg:BI REG_CC)
1715 (zero_extract:BI (match_dup 1) (const_int 1) (const_int 0)))]
1717 "%0 = ROT %1 BY -1%!"
1718 [(set_attr "type" "dsp32shiftimm")])
1720 (define_insn "rol_one"
1721 [(set (match_operand:SI 0 "register_operand" "+d")
1722 (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d") (const_int 1))
1723 (zero_extend:SI (reg:BI REG_CC))))
1724 (set (reg:BI REG_CC)
1725 (zero_extract:BI (match_dup 1) (const_int 31) (const_int 0)))]
1727 "%0 = ROT %1 BY 1%!"
1728 [(set_attr "type" "dsp32shiftimm")])
1730 (define_expand "lshrdi3"
1731 [(set (match_operand:DI 0 "register_operand" "")
1732 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
1733 (match_operand:DI 2 "general_operand" "")))]
1736 rtx lo_half[2], hi_half[2];
1738 if (operands[2] != const1_rtx)
1740 if (! rtx_equal_p (operands[0], operands[1]))
1741 emit_move_insn (operands[0], operands[1]);
1743 split_di (operands, 2, lo_half, hi_half);
1745 emit_move_insn (bfin_cc_rtx, const0_rtx);
1746 emit_insn (gen_ror_one (hi_half[0], hi_half[0]));
1747 emit_insn (gen_ror_one (lo_half[0], lo_half[0]));
1751 (define_expand "ashrdi3"
1752 [(set (match_operand:DI 0 "register_operand" "")
1753 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
1754 (match_operand:DI 2 "general_operand" "")))]
1757 rtx lo_half[2], hi_half[2];
1759 if (operands[2] != const1_rtx)
1761 if (! rtx_equal_p (operands[0], operands[1]))
1762 emit_move_insn (operands[0], operands[1]);
1764 split_di (operands, 2, lo_half, hi_half);
1766 emit_insn (gen_compare_lt (gen_rtx_REG (BImode, REG_CC),
1767 hi_half[1], const0_rtx));
1768 emit_insn (gen_ror_one (hi_half[0], hi_half[0]));
1769 emit_insn (gen_ror_one (lo_half[0], lo_half[0]));
1773 (define_expand "ashldi3"
1774 [(set (match_operand:DI 0 "register_operand" "")
1775 (ashift:DI (match_operand:DI 1 "register_operand" "")
1776 (match_operand:DI 2 "general_operand" "")))]
1779 rtx lo_half[2], hi_half[2];
1781 if (operands[2] != const1_rtx)
1783 if (! rtx_equal_p (operands[0], operands[1]))
1784 emit_move_insn (operands[0], operands[1]);
1786 split_di (operands, 2, lo_half, hi_half);
1788 emit_move_insn (bfin_cc_rtx, const0_rtx);
1789 emit_insn (gen_rol_one (lo_half[0], lo_half[0]));
1790 emit_insn (gen_rol_one (hi_half[0], hi_half[0]));
1794 (define_insn "lshrsi3"
1795 [(set (match_operand:SI 0 "register_operand" "=d,d,a")
1796 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,d,a")
1797 (match_operand:SI 2 "nonmemory_operand" "dKu5,Ku5,P1P2")))]
1803 [(set_attr "type" "shft,dsp32shiftimm,shft")])
1805 (define_insn "lshrpdi3"
1806 [(set (match_operand:PDI 0 "register_operand" "=e")
1807 (lshiftrt:PDI (match_operand:PDI 1 "register_operand" "0")
1808 (match_operand:SI 2 "nonmemory_operand" "Ku5")))]
1811 [(set_attr "type" "dsp32shiftimm")])
1813 (define_insn "ashrpdi3"
1814 [(set (match_operand:PDI 0 "register_operand" "=e")
1815 (ashiftrt:PDI (match_operand:PDI 1 "register_operand" "0")
1816 (match_operand:SI 2 "nonmemory_operand" "Ku5")))]
1819 [(set_attr "type" "dsp32shiftimm")])
1821 ;; A pattern to reload the equivalent of
1822 ;; (set (Dreg) (plus (FP) (large_constant)))
1824 ;; (set (dagreg) (plus (FP) (arbitrary_constant)))
1825 ;; using a scratch register
1826 (define_expand "reload_insi"
1827 [(parallel [(set (match_operand:SI 0 "register_operand" "=w")
1828 (match_operand:SI 1 "fp_plus_const_operand" ""))
1829 (clobber (match_operand:SI 2 "register_operand" "=&a"))])]
1832 rtx fp_op = XEXP (operands[1], 0);
1833 rtx const_op = XEXP (operands[1], 1);
1834 rtx primary = operands[0];
1835 rtx scratch = operands[2];
1837 emit_move_insn (scratch, const_op);
1838 emit_insn (gen_addsi3 (scratch, scratch, fp_op));
1839 emit_move_insn (primary, scratch);
1843 (define_mode_iterator AREG [PDI V2PDI])
1845 (define_insn "reload_in<mode>"
1846 [(set (match_operand:AREG 0 "register_operand" "=e")
1847 (match_operand:AREG 1 "memory_operand" "m"))
1848 (clobber (match_operand:SI 2 "register_operand" "=d"))]
1852 xops[0] = operands[0];
1853 xops[1] = operands[2];
1854 split_di (operands + 1, 1, xops + 2, xops + 3);
1855 output_asm_insn ("%1 = %2;", xops);
1856 output_asm_insn ("%w0 = %1;", xops);
1857 output_asm_insn ("%1 = %3;", xops);
1858 output_asm_insn ("%x0 = %1;", xops);
1861 [(set_attr "seq_insns" "multi")
1862 (set_attr "type" "mcld")
1863 (set_attr "length" "12")])
1865 (define_insn "reload_out<mode>"
1866 [(set (match_operand:AREG 0 "memory_operand" "=m")
1867 (match_operand:AREG 1 "register_operand" "e"))
1868 (clobber (match_operand:SI 2 "register_operand" "=d"))]
1872 xops[0] = operands[1];
1873 xops[1] = operands[2];
1874 split_di (operands, 1, xops + 2, xops + 3);
1875 output_asm_insn ("%1 = %w0;", xops);
1876 output_asm_insn ("%2 = %1;", xops);
1877 output_asm_insn ("%1 = %x0;", xops);
1878 output_asm_insn ("%3 = %1;", xops);
1881 [(set_attr "seq_insns" "multi")
1882 (set_attr "type" "mcld")
1883 (set_attr "length" "12")])
1885 ;; Jump instructions
1889 (label_ref (match_operand 0 "" "")))]
1892 if (get_attr_length (insn) == 2)
1893 return "jump.s %0;";
1895 return "jump.l %0;";
1897 [(set_attr "type" "br")])
1899 (define_insn "indirect_jump"
1901 (match_operand:SI 0 "register_operand" "a"))]
1904 [(set_attr "type" "misc")])
1906 (define_expand "tablejump"
1907 [(parallel [(set (pc) (match_operand:SI 0 "register_operand" "a"))
1908 (use (label_ref (match_operand 1 "" "")))])]
1911 /* In PIC mode, the table entries are stored PC relative.
1912 Convert the relative address to an absolute address. */
1915 rtx op1 = gen_rtx_LABEL_REF (Pmode, operands[1]);
1917 operands[0] = expand_simple_binop (Pmode, PLUS, operands[0],
1918 op1, NULL_RTX, 0, OPTAB_DIRECT);
1922 (define_insn "*tablejump_internal"
1923 [(set (pc) (match_operand:SI 0 "register_operand" "a"))
1924 (use (label_ref (match_operand 1 "" "")))]
1927 [(set_attr "type" "misc")])
1931 ; operand 0 is the loop count pseudo register
1932 ; operand 1 is the number of loop iterations or 0 if it is unknown
1933 ; operand 2 is the maximum number of loop iterations
1934 ; operand 3 is the number of levels of enclosed loops
1935 ; operand 4 is the label to jump to at the top of the loop
1936 (define_expand "doloop_end"
1937 [(parallel [(set (pc) (if_then_else
1938 (ne (match_operand:SI 0 "" "")
1940 (label_ref (match_operand 4 "" ""))
1943 (plus:SI (match_dup 0)
1945 (unspec [(const_int 0)] UNSPEC_LSETUP_END)
1946 (clobber (match_scratch:SI 5 ""))])]
1949 /* The loop optimizer doesn't check the predicates... */
1950 if (GET_MODE (operands[0]) != SImode)
1952 /* Due to limitations in the hardware (an initial loop count of 0
1953 does not loop 2^32 times) we must avoid to generate a hardware
1954 loops when we cannot rule out this case. */
1955 if (!flag_unsafe_loop_optimizations
1956 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) >= 0xFFFFFFFF)
1958 bfin_hardware_loop ();
1961 (define_insn "loop_end"
1963 (if_then_else (ne (match_operand:SI 2 "nonimmediate_operand" "0,0,0")
1965 (label_ref (match_operand 1 "" ""))
1967 (set (match_operand:SI 0 "nonimmediate_operand" "=a*d,*b*v*f,m")
1970 (unspec [(const_int 0)] UNSPEC_LSETUP_END)
1971 (clobber (match_scratch:SI 3 "=X,&r,&r"))]
1974 /* loop end %0 %l1 */
1977 [(set_attr "length" "6,10,14")])
1981 (if_then_else (ne (match_operand:SI 0 "nondp_reg_or_memory_operand" "")
1983 (label_ref (match_operand 1 "" ""))
1988 (unspec [(const_int 0)] UNSPEC_LSETUP_END)
1989 (clobber (match_scratch:SI 2 "=&r"))]
1990 "memory_operand (operands[0], SImode) || splitting_loops"
1991 [(set (match_dup 2) (match_dup 0))
1992 (set (match_dup 2) (plus:SI (match_dup 2) (const_int -1)))
1993 (set (match_dup 0) (match_dup 2))
1994 (set (reg:BI REG_CC) (eq:BI (match_dup 2) (const_int 0)))
1996 (if_then_else (eq (reg:BI REG_CC)
1998 (label_ref (match_dup 1))
2002 (define_insn "lsetup_with_autoinit"
2003 [(set (match_operand:SI 0 "lt_register_operand" "=t")
2004 (label_ref (match_operand 1 "" "")))
2005 (set (match_operand:SI 2 "lb_register_operand" "=u")
2006 (label_ref (match_operand 3 "" "")))
2007 (set (match_operand:SI 4 "lc_register_operand" "=k")
2008 (match_operand:SI 5 "register_operand" "a"))]
2010 "LSETUP (%1, %3) %4 = %5;"
2011 [(set_attr "length" "4")])
2013 (define_insn "lsetup_without_autoinit"
2014 [(set (match_operand:SI 0 "lt_register_operand" "=t")
2015 (label_ref (match_operand 1 "" "")))
2016 (set (match_operand:SI 2 "lb_register_operand" "=u")
2017 (label_ref (match_operand 3 "" "")))
2018 (use (match_operand:SI 4 "lc_register_operand" "k"))]
2020 "LSETUP (%1, %3) %4;"
2021 [(set_attr "length" "4")])
2023 ;; Call instructions..
2025 ;; The explicit MEM inside the UNSPEC prevents the compiler from moving
2026 ;; the load before a branch after a NULL test, or before a store that
2027 ;; initializes a function descriptor.
2029 (define_insn_and_split "load_funcdescsi"
2030 [(set (match_operand:SI 0 "register_operand" "=a")
2031 (unspec_volatile:SI [(mem:SI (match_operand:SI 1 "address_operand" "p"))]
2032 UNSPEC_VOLATILE_LOAD_FUNCDESC))]
2036 [(set (match_dup 0) (mem:SI (match_dup 1)))])
2038 (define_expand "call"
2039 [(parallel [(call (match_operand:SI 0 "" "")
2040 (match_operand 1 "" ""))
2041 (use (match_operand 2 "" ""))])]
2044 bfin_expand_call (NULL_RTX, operands[0], operands[1], operands[2], 0);
2048 (define_expand "sibcall"
2049 [(parallel [(call (match_operand:SI 0 "" "")
2050 (match_operand 1 "" ""))
2051 (use (match_operand 2 "" ""))
2055 bfin_expand_call (NULL_RTX, operands[0], operands[1], operands[2], 1);
2059 (define_expand "call_value"
2060 [(parallel [(set (match_operand 0 "register_operand" "")
2061 (call (match_operand:SI 1 "" "")
2062 (match_operand 2 "" "")))
2063 (use (match_operand 3 "" ""))])]
2066 bfin_expand_call (operands[0], operands[1], operands[2], operands[3], 0);
2070 (define_expand "sibcall_value"
2071 [(parallel [(set (match_operand 0 "register_operand" "")
2072 (call (match_operand:SI 1 "" "")
2073 (match_operand 2 "" "")))
2074 (use (match_operand 3 "" ""))
2078 bfin_expand_call (operands[0], operands[1], operands[2], operands[3], 1);
2082 (define_insn "*call_symbol_fdpic"
2083 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "Q"))
2084 (match_operand 1 "general_operand" "g"))
2085 (use (match_operand:SI 2 "register_operand" "Z"))
2086 (use (match_operand 3 "" ""))
2087 (clobber (reg:SI REG_RETS))]
2088 "! SIBLING_CALL_P (insn)
2089 && GET_CODE (operands[0]) == SYMBOL_REF
2090 && !bfin_longcall_p (operands[0], INTVAL (operands[3]))"
2092 [(set_attr "type" "call")
2093 (set_attr "length" "4")])
2095 (define_insn "*sibcall_symbol_fdpic"
2096 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "Q"))
2097 (match_operand 1 "general_operand" "g"))
2098 (use (match_operand:SI 2 "register_operand" "Z"))
2099 (use (match_operand 3 "" ""))
2101 "SIBLING_CALL_P (insn)
2102 && GET_CODE (operands[0]) == SYMBOL_REF
2103 && !bfin_longcall_p (operands[0], INTVAL (operands[3]))"
2105 [(set_attr "type" "br")
2106 (set_attr "length" "4")])
2108 (define_insn "*call_value_symbol_fdpic"
2109 [(set (match_operand 0 "register_operand" "=d")
2110 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "Q"))
2111 (match_operand 2 "general_operand" "g")))
2112 (use (match_operand:SI 3 "register_operand" "Z"))
2113 (use (match_operand 4 "" ""))
2114 (clobber (reg:SI REG_RETS))]
2115 "! SIBLING_CALL_P (insn)
2116 && GET_CODE (operands[1]) == SYMBOL_REF
2117 && !bfin_longcall_p (operands[1], INTVAL (operands[4]))"
2119 [(set_attr "type" "call")
2120 (set_attr "length" "4")])
2122 (define_insn "*sibcall_value_symbol_fdpic"
2123 [(set (match_operand 0 "register_operand" "=d")
2124 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "Q"))
2125 (match_operand 2 "general_operand" "g")))
2126 (use (match_operand:SI 3 "register_operand" "Z"))
2127 (use (match_operand 4 "" ""))
2129 "SIBLING_CALL_P (insn)
2130 && GET_CODE (operands[1]) == SYMBOL_REF
2131 && !bfin_longcall_p (operands[1], INTVAL (operands[4]))"
2133 [(set_attr "type" "br")
2134 (set_attr "length" "4")])
2136 (define_insn "*call_insn_fdpic"
2137 [(call (mem:SI (match_operand:SI 0 "register_no_elim_operand" "Y"))
2138 (match_operand 1 "general_operand" "g"))
2139 (use (match_operand:SI 2 "register_operand" "Z"))
2140 (use (match_operand 3 "" ""))
2141 (clobber (reg:SI REG_RETS))]
2142 "! SIBLING_CALL_P (insn)"
2144 [(set_attr "type" "call")
2145 (set_attr "length" "2")])
2147 (define_insn "*sibcall_insn_fdpic"
2148 [(call (mem:SI (match_operand:SI 0 "register_no_elim_operand" "Y"))
2149 (match_operand 1 "general_operand" "g"))
2150 (use (match_operand:SI 2 "register_operand" "Z"))
2151 (use (match_operand 3 "" ""))
2153 "SIBLING_CALL_P (insn)"
2155 [(set_attr "type" "br")
2156 (set_attr "length" "2")])
2158 (define_insn "*call_value_insn_fdpic"
2159 [(set (match_operand 0 "register_operand" "=d")
2160 (call (mem:SI (match_operand:SI 1 "register_no_elim_operand" "Y"))
2161 (match_operand 2 "general_operand" "g")))
2162 (use (match_operand:SI 3 "register_operand" "Z"))
2163 (use (match_operand 4 "" ""))
2164 (clobber (reg:SI REG_RETS))]
2165 "! SIBLING_CALL_P (insn)"
2167 [(set_attr "type" "call")
2168 (set_attr "length" "2")])
2170 (define_insn "*sibcall_value_insn_fdpic"
2171 [(set (match_operand 0 "register_operand" "=d")
2172 (call (mem:SI (match_operand:SI 1 "register_no_elim_operand" "Y"))
2173 (match_operand 2 "general_operand" "g")))
2174 (use (match_operand:SI 3 "register_operand" "Z"))
2175 (use (match_operand 4 "" ""))
2177 "SIBLING_CALL_P (insn)"
2179 [(set_attr "type" "br")
2180 (set_attr "length" "2")])
2182 (define_insn "*call_symbol"
2183 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "Q"))
2184 (match_operand 1 "general_operand" "g"))
2185 (use (match_operand 2 "" ""))
2186 (clobber (reg:SI REG_RETS))]
2187 "! SIBLING_CALL_P (insn)
2188 && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
2189 && GET_CODE (operands[0]) == SYMBOL_REF
2190 && !bfin_longcall_p (operands[0], INTVAL (operands[2]))"
2192 [(set_attr "type" "call")
2193 (set_attr "length" "4")])
2195 (define_insn "*sibcall_symbol"
2196 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "Q"))
2197 (match_operand 1 "general_operand" "g"))
2198 (use (match_operand 2 "" ""))
2200 "SIBLING_CALL_P (insn)
2201 && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
2202 && GET_CODE (operands[0]) == SYMBOL_REF
2203 && !bfin_longcall_p (operands[0], INTVAL (operands[2]))"
2205 [(set_attr "type" "br")
2206 (set_attr "length" "4")])
2208 (define_insn "*call_value_symbol"
2209 [(set (match_operand 0 "register_operand" "=d")
2210 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "Q"))
2211 (match_operand 2 "general_operand" "g")))
2212 (use (match_operand 3 "" ""))
2213 (clobber (reg:SI REG_RETS))]
2214 "! SIBLING_CALL_P (insn)
2215 && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
2216 && GET_CODE (operands[1]) == SYMBOL_REF
2217 && !bfin_longcall_p (operands[1], INTVAL (operands[3]))"
2219 [(set_attr "type" "call")
2220 (set_attr "length" "4")])
2222 (define_insn "*sibcall_value_symbol"
2223 [(set (match_operand 0 "register_operand" "=d")
2224 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "Q"))
2225 (match_operand 2 "general_operand" "g")))
2226 (use (match_operand 3 "" ""))
2228 "SIBLING_CALL_P (insn)
2229 && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
2230 && GET_CODE (operands[1]) == SYMBOL_REF
2231 && !bfin_longcall_p (operands[1], INTVAL (operands[3]))"
2233 [(set_attr "type" "br")
2234 (set_attr "length" "4")])
2236 (define_insn "*call_insn"
2237 [(call (mem:SI (match_operand:SI 0 "register_no_elim_operand" "a"))
2238 (match_operand 1 "general_operand" "g"))
2239 (use (match_operand 2 "" ""))
2240 (clobber (reg:SI REG_RETS))]
2241 "! SIBLING_CALL_P (insn)"
2243 [(set_attr "type" "call")
2244 (set_attr "length" "2")])
2246 (define_insn "*sibcall_insn"
2247 [(call (mem:SI (match_operand:SI 0 "register_no_elim_operand" "z"))
2248 (match_operand 1 "general_operand" "g"))
2249 (use (match_operand 2 "" ""))
2251 "SIBLING_CALL_P (insn)"
2253 [(set_attr "type" "br")
2254 (set_attr "length" "2")])
2256 (define_insn "*call_value_insn"
2257 [(set (match_operand 0 "register_operand" "=d")
2258 (call (mem:SI (match_operand:SI 1 "register_no_elim_operand" "a"))
2259 (match_operand 2 "general_operand" "g")))
2260 (use (match_operand 3 "" ""))
2261 (clobber (reg:SI REG_RETS))]
2262 "! SIBLING_CALL_P (insn)"
2264 [(set_attr "type" "call")
2265 (set_attr "length" "2")])
2267 (define_insn "*sibcall_value_insn"
2268 [(set (match_operand 0 "register_operand" "=d")
2269 (call (mem:SI (match_operand:SI 1 "register_no_elim_operand" "z"))
2270 (match_operand 2 "general_operand" "g")))
2271 (use (match_operand 3 "" ""))
2273 "SIBLING_CALL_P (insn)"
2275 [(set_attr "type" "br")
2276 (set_attr "length" "2")])
2278 ;; Block move patterns
2280 ;; We cheat. This copies one more word than operand 2 indicates.
2282 (define_insn "rep_movsi"
2283 [(set (match_operand:SI 0 "register_operand" "=&a")
2284 (plus:SI (plus:SI (match_operand:SI 3 "register_operand" "0")
2285 (ashift:SI (match_operand:SI 2 "register_operand" "a")
2288 (set (match_operand:SI 1 "register_operand" "=&b")
2289 (plus:SI (plus:SI (match_operand:SI 4 "register_operand" "1")
2290 (ashift:SI (match_dup 2) (const_int 2)))
2292 (set (mem:BLK (match_dup 3))
2293 (mem:BLK (match_dup 4)))
2295 (clobber (match_scratch:HI 5 "=&d"))
2296 (clobber (reg:SI REG_LT1))
2297 (clobber (reg:SI REG_LC1))
2298 (clobber (reg:SI REG_LB1))]
2300 "%5 = [%4++]; lsetup (1f, 1f) LC1 = %2; 1: MNOP || [%3++] = %5 || %5 = [%4++]; [%3++] = %5;"
2301 [(set_attr "type" "misc")
2302 (set_attr "length" "16")
2303 (set_attr "seq_insns" "multi")])
2305 (define_insn "rep_movhi"
2306 [(set (match_operand:SI 0 "register_operand" "=&a")
2307 (plus:SI (plus:SI (match_operand:SI 3 "register_operand" "0")
2308 (ashift:SI (match_operand:SI 2 "register_operand" "a")
2311 (set (match_operand:SI 1 "register_operand" "=&b")
2312 (plus:SI (plus:SI (match_operand:SI 4 "register_operand" "1")
2313 (ashift:SI (match_dup 2) (const_int 1)))
2315 (set (mem:BLK (match_dup 3))
2316 (mem:BLK (match_dup 4)))
2318 (clobber (match_scratch:HI 5 "=&d"))
2319 (clobber (reg:SI REG_LT1))
2320 (clobber (reg:SI REG_LC1))
2321 (clobber (reg:SI REG_LB1))]
2323 "%h5 = W[%4++]; lsetup (1f, 1f) LC1 = %2; 1: MNOP || W [%3++] = %5 || %h5 = W [%4++]; W [%3++] = %5;"
2324 [(set_attr "type" "misc")
2325 (set_attr "length" "16")
2326 (set_attr "seq_insns" "multi")])
2328 (define_expand "movmemsi"
2329 [(match_operand:BLK 0 "general_operand" "")
2330 (match_operand:BLK 1 "general_operand" "")
2331 (match_operand:SI 2 "const_int_operand" "")
2332 (match_operand:SI 3 "const_int_operand" "")]
2335 if (bfin_expand_movmem (operands[0], operands[1], operands[2], operands[3]))
2340 ;; Conditional branch patterns
2341 ;; The Blackfin has only few condition codes: eq, lt, lte, ltu, leu
2343 (define_insn "compare_eq"
2344 [(set (match_operand:BI 0 "register_operand" "=C,C")
2345 (eq:BI (match_operand:SI 1 "register_operand" "d,a")
2346 (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
2349 [(set_attr "type" "compare")])
2351 (define_insn "compare_ne"
2352 [(set (match_operand:BI 0 "register_operand" "=C,C")
2353 (ne:BI (match_operand:SI 1 "register_operand" "d,a")
2354 (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
2357 [(set_attr "type" "compare")])
2359 (define_insn "compare_lt"
2360 [(set (match_operand:BI 0 "register_operand" "=C,C")
2361 (lt:BI (match_operand:SI 1 "register_operand" "d,a")
2362 (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
2365 [(set_attr "type" "compare")])
2367 (define_insn "compare_le"
2368 [(set (match_operand:BI 0 "register_operand" "=C,C")
2369 (le:BI (match_operand:SI 1 "register_operand" "d,a")
2370 (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
2373 [(set_attr "type" "compare")])
2375 (define_insn "compare_leu"
2376 [(set (match_operand:BI 0 "register_operand" "=C,C")
2377 (leu:BI (match_operand:SI 1 "register_operand" "d,a")
2378 (match_operand:SI 2 "reg_or_const_int_operand" "dKu3,aKu3")))]
2381 [(set_attr "type" "compare")])
2383 (define_insn "compare_ltu"
2384 [(set (match_operand:BI 0 "register_operand" "=C,C")
2385 (ltu:BI (match_operand:SI 1 "register_operand" "d,a")
2386 (match_operand:SI 2 "reg_or_const_int_operand" "dKu3,aKu3")))]
2389 [(set_attr "type" "compare")])
2391 ;; Same as above, but and CC with the overflow bit generated by the first
2393 (define_insn "flag_mul_macv2hi_parts_acconly_andcc0"
2394 [(set (match_operand:PDI 0 "register_operand" "=B,e,e")
2395 (unspec:PDI [(vec_select:HI
2396 (match_operand:V2HI 2 "register_operand" "d,d,d")
2397 (parallel [(match_operand 4 "const01_operand" "P0P1,P0P1,P0P1")]))
2399 (match_operand:V2HI 3 "register_operand" "d,d,d")
2400 (parallel [(match_operand 6 "const01_operand" "P0P1,P0P1,P0P1")]))
2401 (match_operand 10 "const_int_operand" "PB,PA,PA")]
2402 UNSPEC_MUL_WITH_FLAG))
2403 (set (match_operand:PDI 1 "register_operand" "=B,e,e")
2404 (unspec:PDI [(vec_select:HI
2406 (parallel [(match_operand 5 "const01_operand" "P0P1,P0P1,P0P1")]))
2409 (parallel [(match_operand 7 "const01_operand" "P0P1,P0P1,P0P1")]))
2410 (match_operand:PDI 8 "register_operand" "1,1,1")
2411 (match_operand 9 "const01_operand" "P0P1,P0P1,P0P1")
2412 (match_operand 11 "const_int_operand" "PA,PB,PA")]
2413 UNSPEC_MAC_WITH_FLAG))
2414 (set (reg:BI REG_CC)
2415 (and:BI (reg:BI REG_CC)
2416 (unspec:BI [(vec_select:HI (match_dup 2) (parallel [(match_dup 4)]))
2417 (vec_select:HI (match_dup 3) (parallel [(match_dup 6)]))
2419 UNSPEC_MUL_WITH_FLAG)))]
2420 "MACFLAGS_MATCH_P (INTVAL (operands[10]), INTVAL (operands[11]))"
2423 const char *templates[] = {
2424 "%0 = %h2 * %h3, %1 %b4 %h2 * %h3 %M5;\n\tCC &= %v0;",
2425 "%0 = %d2 * %h3, %1 %b4 %h2 * %h3 %M5;\n\tCC &= %v0;",
2426 "%0 = %h2 * %h3, %1 %b4 %d2 * %h3 %M5;\n\tCC &= %v0;",
2427 "%0 = %d2 * %h3, %1 %b4 %d2 * %h3 %M5;\n\tCC &= %v0;",
2428 "%0 = %h2 * %d3, %1 %b4 %h2 * %h3 %M5;\n\tCC &= %v0;",
2429 "%0 = %d2 * %d3, %1 %b4 %h2 * %h3 %M5;\n\tCC &= %v0;",
2430 "%0 = %h2 * %d3, %1 %b4 %d2 * %h3 %M5;\n\tCC &= %v0;",
2431 "%0 = %d2 * %d3, %1 %b4 %d2 * %h3 %M5;\n\tCC &= %v0;",
2432 "%0 = %h2 * %h3, %1 %b4 %h2 * %d3 %M5;\n\tCC &= %v0;",
2433 "%0 = %d2 * %h3, %1 %b4 %h2 * %d3 %M5;\n\tCC &= %v0;",
2434 "%0 = %h2 * %h3, %1 %b4 %d2 * %d3 %M5;\n\tCC &= %v0;",
2435 "%0 = %d2 * %h3, %1 %b4 %d2 * %d3 %M5;\n\tCC &= %v0;",
2436 "%0 = %h2 * %d3, %1 %b4 %h2 * %d3 %M5;\n\tCC &= %v0;",
2437 "%0 = %d2 * %d3, %1 %b4 %h2 * %d3 %M5;\n\tCC &= %v0;",
2438 "%0 = %h2 * %d3, %1 %b4 %d2 * %d3 %M5;\n\tCC &= %v0;",
2439 "%0 = %d2 * %d3, %1 %b4 %d2 * %d3 %M5;\n\tCC &= %v0;" };
2440 int alt = (INTVAL (operands[4]) + (INTVAL (operands[5]) << 1)
2441 + (INTVAL (operands[6]) << 2) + (INTVAL (operands[7]) << 3));
2442 xops[0] = operands[0];
2443 xops[1] = operands[1];
2444 xops[2] = operands[2];
2445 xops[3] = operands[3];
2446 xops[4] = operands[9];
2447 xops[5] = which_alternative == 0 ? operands[10] : operands[11];
2448 output_asm_insn (templates[alt], xops);
2451 [(set_attr "type" "misc")
2452 (set_attr "length" "6")
2453 (set_attr "seq_insns" "multi")])
2455 (define_expand "cbranchsi4"
2457 (if_then_else (match_operator 0 "ordered_comparison_operator"
2458 [(match_operand:SI 1 "register_operand" "")
2459 (match_operand:SI 2 "reg_or_const_int_operand" "")])
2460 (label_ref (match_operand 3 "" ""))
2464 rtx bi_compare = bfin_gen_compare (operands[0], SImode);
2465 emit_jump_insn (gen_cbranchbi4 (bi_compare, bfin_cc_rtx, CONST0_RTX (BImode),
2470 (define_insn "cbranchbi4"
2473 (match_operator 0 "bfin_bimode_comparison_operator"
2474 [(match_operand:BI 1 "register_operand" "C")
2475 (match_operand:BI 2 "immediate_operand" "P0")])
2476 (label_ref (match_operand 3 "" ""))
2480 asm_conditional_branch (insn, operands, 0, 0);
2483 [(set_attr "type" "brcc")])
2485 ;; Special cbranch patterns to deal with the speculative load problem - see
2486 ;; bfin_reorg for details.
2488 (define_insn "cbranch_predicted_taken"
2491 (match_operator 0 "bfin_bimode_comparison_operator"
2492 [(match_operand:BI 1 "register_operand" "C")
2493 (match_operand:BI 2 "immediate_operand" "P0")])
2494 (label_ref (match_operand 3 "" ""))
2496 (unspec [(const_int 0)] UNSPEC_CBRANCH_TAKEN)]
2499 asm_conditional_branch (insn, operands, 0, 1);
2502 [(set_attr "type" "brcc")])
2504 (define_insn "cbranch_with_nops"
2507 (match_operator 0 "bfin_bimode_comparison_operator"
2508 [(match_operand:BI 1 "register_operand" "C")
2509 (match_operand:BI 2 "immediate_operand" "P0")])
2510 (label_ref (match_operand 3 "" ""))
2512 (unspec [(match_operand 4 "immediate_operand" "")] UNSPEC_CBRANCH_NOPS)]
2515 asm_conditional_branch (insn, operands, INTVAL (operands[4]), 0);
2518 [(set_attr "type" "brcc")
2519 (set_attr "length" "8")])
2523 (define_expand "cstorebi4"
2525 (match_operator:BI 1 "bfin_bimode_comparison_operator"
2526 [(match_operand:BI 2 "register_operand" "")
2527 (match_operand:BI 3 "reg_or_const_int_operand" "")]))
2528 (set (match_operand:SI 0 "register_operand" "")
2529 (ne:SI (match_dup 4) (const_int 0)))]
2532 /* It could be expanded as a movbisi instruction, but the portable
2533 alternative produces better code. */
2534 if (GET_CODE (operands[1]) == NE)
2537 operands[4] = bfin_cc_rtx;
2540 (define_expand "cstoresi4"
2541 [(set (match_operand:SI 0 "register_operand")
2542 (match_operator:SI 1 "ordered_comparison_operator"
2543 [(match_operand:SI 2 "register_operand" "")
2544 (match_operand:SI 3 "reg_or_const_int_operand" "")]))]
2547 rtx bi_compare, test;
2549 if (!bfin_direct_comparison_operator (operands[1], SImode))
2551 if (!register_operand (operands[3], SImode)
2552 || GET_CODE (operands[1]) == NE)
2554 test = gen_rtx_fmt_ee (swap_condition (GET_CODE (operands[1])),
2555 SImode, operands[3], operands[2]);
2560 bi_compare = bfin_gen_compare (test, SImode);
2561 gcc_assert (GET_CODE (bi_compare) == NE);
2562 emit_insn (gen_movbisi (operands[0], bfin_cc_rtx));
2571 ;; A nop which stays there when emitted.
2572 (define_insn "forced_nop"
2573 [(unspec [(const_int 0)] UNSPEC_NOP)]
2578 [(unspec [(const_int 0)] UNSPEC_32BIT)]
2581 [(set_attr "type" "dsp32")])
2583 ;;;;;;;;;;;;;;;;;;;; CC2dreg ;;;;;;;;;;;;;;;;;;;;;;;;;
2584 (define_insn "movsibi"
2585 [(set (match_operand:BI 0 "register_operand" "=C")
2586 (ne:BI (match_operand:SI 1 "register_operand" "d")
2590 [(set_attr "length" "2")])
2592 (define_insn_and_split "movbisi"
2593 [(set (match_operand:SI 0 "register_operand" "=d")
2594 (ne:SI (match_operand:BI 1 "register_operand" "C")
2599 [(set (match_operand:SI 0 "register_operand" "")
2600 (zero_extend:SI (match_operand:BI 1 "register_operand" "")))]
2603 (define_insn "notbi"
2604 [(set (match_operand:BI 0 "register_operand" "=C")
2605 (eq:BI (match_operand:BI 1 "register_operand" " 0")
2608 "%0 = ! %0;" /* NOT CC;" */
2609 [(set_attr "type" "compare")])
2611 ;; Vector and DSP insns
2614 [(set (match_operand:SI 0 "register_operand" "=d")
2615 (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d")
2617 (lshiftrt:SI (match_operand:SI 2 "register_operand" "d")
2620 "%0 = ALIGN8(%1, %2)%!"
2621 [(set_attr "type" "dsp32")])
2624 [(set (match_operand:SI 0 "register_operand" "=d")
2625 (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d")
2627 (lshiftrt:SI (match_operand:SI 2 "register_operand" "d")
2630 "%0 = ALIGN16(%1, %2)%!"
2631 [(set_attr "type" "dsp32")])
2634 [(set (match_operand:SI 0 "register_operand" "=d")
2635 (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d")
2637 (lshiftrt:SI (match_operand:SI 2 "register_operand" "d")
2640 "%0 = ALIGN24(%1, %2)%!"
2641 [(set_attr "type" "dsp32")])
2643 ;; Prologue and epilogue.
2645 (define_expand "prologue"
2648 "bfin_expand_prologue (); DONE;")
2650 (define_expand "epilogue"
2653 "bfin_expand_epilogue (1, 0, 0); DONE;")
2655 (define_expand "sibcall_epilogue"
2658 "bfin_expand_epilogue (0, 0, 1); DONE;")
2660 (define_expand "eh_return"
2661 [(use (match_operand:SI 0 "register_operand" ""))]
2664 emit_insn (gen_eh_store_handler (EH_RETURN_HANDLER_RTX, operands[0]));
2665 emit_jump_insn (gen_eh_return_internal ());
2670 (define_insn "eh_store_handler"
2671 [(unspec_volatile [(match_operand:SI 1 "register_operand" "da")]
2672 UNSPEC_VOLATILE_STORE_EH_HANDLER)
2673 (clobber (match_operand:SI 0 "memory_operand" "=m"))]
2676 [(set_attr "type" "mcst")])
2678 (define_insn_and_split "eh_return_internal"
2682 "epilogue_completed"
2684 "bfin_expand_epilogue (1, 1, 0); DONE;")
2687 [(set (mem:SI (plus:SI (reg:SI REG_SP) (const_int -4))) (reg:SI REG_RETS))
2688 (set (mem:SI (plus:SI (reg:SI REG_SP) (const_int -8))) (reg:SI REG_FP))
2689 (set (reg:SI REG_FP)
2690 (plus:SI (reg:SI REG_SP) (const_int -8)))
2691 (set (reg:SI REG_SP)
2692 (plus:SI (reg:SI REG_SP) (match_operand:SI 0 "immediate_operand" "i")))]
2695 [(set_attr "length" "4")])
2697 (define_insn "unlink"
2698 [(set (reg:SI REG_FP) (mem:SI (reg:SI REG_FP)))
2699 (set (reg:SI REG_RETS) (mem:SI (plus:SI (reg:SI REG_FP) (const_int 4))))
2700 (set (reg:SI REG_SP) (plus:SI (reg:SI REG_FP) (const_int 8)))]
2703 [(set_attr "length" "4")])
2705 ;; This pattern is slightly clumsy. The stack adjust must be the final SET in
2706 ;; the pattern, otherwise dwarf2out becomes very confused about which reg goes
2707 ;; where on the stack, since it goes through all elements of the parallel in
2709 (define_insn "push_multiple"
2710 [(match_parallel 0 "push_multiple_operation"
2711 [(unspec [(match_operand:SI 1 "immediate_operand" "i")] UNSPEC_PUSH_MULTIPLE)])]
2714 output_push_multiple (insn, operands);
2718 (define_insn "pop_multiple"
2719 [(match_parallel 0 "pop_multiple_operation"
2720 [(set (reg:SI REG_SP)
2721 (plus:SI (reg:SI REG_SP) (match_operand:SI 1 "immediate_operand" "i")))])]
2724 output_pop_multiple (insn, operands);
2728 (define_insn "return_internal"
2730 (use (match_operand 0 "register_operand" ""))]
2733 switch (REGNO (operands[0]))
2747 ;; When used at a location where CC contains 1, causes a speculative load
2748 ;; that is later cancelled. This is used for certain workarounds in
2749 ;; interrupt handler prologues.
2750 (define_insn "dummy_load"
2751 [(unspec_volatile [(match_operand 0 "register_operand" "a")
2752 (match_operand 1 "register_operand" "C")]
2753 UNSPEC_VOLATILE_DUMMY)]
2755 "if cc jump 4;\n\tr7 = [%0];"
2756 [(set_attr "type" "misc")
2757 (set_attr "length" "4")
2758 (set_attr "seq_insns" "multi")])
2760 ;; A placeholder insn inserted before the final scheduling pass. It is used
2761 ;; to improve scheduling of loads when workarounds for speculative loads are
2762 ;; needed, by not placing them in the first few cycles after a conditional
2764 (define_insn "stall"
2765 [(unspec_volatile [(match_operand 0 "const_int_operand" "P1P3")]
2766 UNSPEC_VOLATILE_STALL)]
2769 [(set_attr "type" "stall")])
2771 (define_insn "csync"
2772 [(unspec_volatile [(const_int 0)] UNSPEC_VOLATILE_CSYNC)]
2775 [(set_attr "type" "sync")])
2777 (define_insn "ssync"
2778 [(unspec_volatile [(const_int 0)] UNSPEC_VOLATILE_SSYNC)]
2781 [(set_attr "type" "sync")])
2784 [(trap_if (const_int 1) (const_int 3))]
2787 [(set_attr "type" "misc")
2788 (set_attr "length" "2")])
2790 (define_insn "trapifcc"
2791 [(trap_if (reg:BI REG_CC) (const_int 3))]
2793 "if !cc jump 4 (bp); excpt 3;"
2794 [(set_attr "type" "misc")
2795 (set_attr "length" "4")
2796 (set_attr "seq_insns" "multi")])
2798 ;;; Vector instructions
2800 ;; First, all sorts of move variants
2802 (define_insn "movhiv2hi_low"
2803 [(set (match_operand:V2HI 0 "register_operand" "=d")
2805 (match_operand:HI 2 "register_operand" "d")
2806 (vec_select:HI (match_operand:V2HI 1 "register_operand" "0")
2807 (parallel [(const_int 1)]))))]
2810 [(set_attr "type" "dsp32shiftimm")])
2812 (define_insn "movhiv2hi_high"
2813 [(set (match_operand:V2HI 0 "register_operand" "=d")
2815 (vec_select:HI (match_operand:V2HI 1 "register_operand" "0")
2816 (parallel [(const_int 0)]))
2817 (match_operand:HI 2 "register_operand" "d")))]
2820 [(set_attr "type" "dsp32shiftimm")])
2822 ;; No earlyclobber on alternative two since our sequence ought to be safe.
2823 ;; The order of operands is intentional to match the VDSP builtin (high word
2824 ;; is passed first).
2825 (define_insn_and_split "composev2hi"
2826 [(set (match_operand:V2HI 0 "register_operand" "=d,d")
2827 (vec_concat:V2HI (match_operand:HI 2 "register_operand" "0,d")
2828 (match_operand:HI 1 "register_operand" "d,d")))]
2836 (vec_select:HI (match_dup 0) (parallel [(const_int 0)]))
2841 (vec_select:HI (match_dup 0) (parallel [(const_int 1)]))))]
2843 [(set_attr "type" "dsp32shiftimm")])
2845 ; Like composev2hi, but operating on elements of V2HI vectors.
2846 ; Useful on its own, and as a combiner bridge for the multiply and
2848 (define_insn "packv2hi"
2849 [(set (match_operand:V2HI 0 "register_operand" "=d,d,d,d,d,d,d,d")
2850 (vec_concat:V2HI (vec_select:HI
2851 (match_operand:V2HI 1 "register_operand" "0,0,d,d,d,d,d,d")
2852 (parallel [(match_operand 3 "const01_operand" "P0,P0,P0,P1,P0,P1,P0,P1")]))
2854 (match_operand:V2HI 2 "register_operand" "d,d,0,0,d,d,d,d")
2855 (parallel [(match_operand 4 "const01_operand" "P0,P1,P1,P1,P0,P0,P1,P1")]))))]
2862 %0 = PACK (%h2,%h1)%!
2863 %0 = PACK (%h2,%d1)%!
2864 %0 = PACK (%d2,%h1)%!
2865 %0 = PACK (%d2,%d1)%!"
2866 [(set_attr "type" "dsp32shiftimm,dsp32shiftimm,dsp32shiftimm,dsp32shiftimm,dsp32,dsp32,dsp32,dsp32")])
2868 (define_insn "movv2hi_hi"
2869 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
2870 (vec_select:HI (match_operand:V2HI 1 "register_operand" "0,d,d")
2871 (parallel [(match_operand 2 "const01_operand" "P0,P0,P1")])))]
2877 [(set_attr "type" "dsp32shiftimm")])
2879 (define_expand "movv2hi_hi_low"
2880 [(set (match_operand:HI 0 "register_operand" "")
2881 (vec_select:HI (match_operand:V2HI 1 "register_operand" "")
2882 (parallel [(const_int 0)])))]
2886 (define_expand "movv2hi_hi_high"
2887 [(set (match_operand:HI 0 "register_operand" "")
2888 (vec_select:HI (match_operand:V2HI 1 "register_operand" "")
2889 (parallel [(const_int 1)])))]
2893 ;; Unusual arithmetic operations on 16-bit registers.
2895 (define_code_iterator sp_or_sm [ss_plus ss_minus])
2896 (define_code_attr spm_string [(ss_plus "+") (ss_minus "-")])
2897 (define_code_attr spm_name [(ss_plus "add") (ss_minus "sub")])
2899 (define_insn "ss<spm_name>hi3"
2900 [(set (match_operand:HI 0 "register_operand" "=d")
2901 (sp_or_sm:HI (match_operand:HI 1 "register_operand" "d")
2902 (match_operand:HI 2 "register_operand" "d")))]
2904 "%h0 = %h1 <spm_string> %h2 (S)%!"
2905 [(set_attr "type" "dsp32")])
2907 (define_insn "ss<spm_name>hi3_parts"
2908 [(set (match_operand:HI 0 "register_operand" "=d")
2909 (sp_or_sm:HI (vec_select:HI
2910 (match_operand:V2HI 1 "register_operand" "d")
2911 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
2913 (match_operand:V2HI 2 "register_operand" "d")
2914 (parallel [(match_operand 4 "const01_operand" "P0P1")]))))]
2917 const char *templates[] = {
2918 "%h0 = %h1 <spm_string> %h2 (S)%!",
2919 "%h0 = %d1 <spm_string> %h2 (S)%!",
2920 "%h0 = %h1 <spm_string> %d2 (S)%!",
2921 "%h0 = %d1 <spm_string> %d2 (S)%!" };
2922 int alt = INTVAL (operands[3]) + (INTVAL (operands[4]) << 1);
2923 return templates[alt];
2925 [(set_attr "type" "dsp32")])
2927 (define_insn "ss<spm_name>hi3_low_parts"
2928 [(set (match_operand:V2HI 0 "register_operand" "=d")
2930 (vec_select:HI (match_operand:V2HI 1 "register_operand" "0")
2931 (parallel [(const_int 0)]))
2932 (sp_or_sm:HI (vec_select:HI
2933 (match_operand:V2HI 2 "register_operand" "d")
2934 (parallel [(match_operand 4 "const01_operand" "P0P1")]))
2936 (match_operand:V2HI 3 "register_operand" "d")
2937 (parallel [(match_operand 5 "const01_operand" "P0P1")])))))]
2940 const char *templates[] = {
2941 "%h0 = %h2 <spm_string> %h3 (S)%!",
2942 "%h0 = %d2 <spm_string> %h3 (S)%!",
2943 "%h0 = %h2 <spm_string> %d3 (S)%!",
2944 "%h0 = %d2 <spm_string> %d3 (S)%!" };
2945 int alt = INTVAL (operands[4]) + (INTVAL (operands[5]) << 1);
2946 return templates[alt];
2948 [(set_attr "type" "dsp32")])
2950 (define_insn "ss<spm_name>hi3_high_parts"
2951 [(set (match_operand:V2HI 0 "register_operand" "=d")
2953 (sp_or_sm:HI (vec_select:HI
2954 (match_operand:V2HI 2 "register_operand" "d")
2955 (parallel [(match_operand 4 "const01_operand" "P0P1")]))
2957 (match_operand:V2HI 3 "register_operand" "d")
2958 (parallel [(match_operand 5 "const01_operand" "P0P1")])))
2959 (vec_select:HI (match_operand:V2HI 1 "register_operand" "0")
2960 (parallel [(const_int 1)]))))]
2963 const char *templates[] = {
2964 "%d0 = %h2 <spm_string> %h3 (S)%!",
2965 "%d0 = %d2 <spm_string> %h3 (S)%!",
2966 "%d0 = %h2 <spm_string> %d3 (S)%!",
2967 "%d0 = %d2 <spm_string> %d3 (S)%!" };
2968 int alt = INTVAL (operands[4]) + (INTVAL (operands[5]) << 1);
2969 return templates[alt];
2971 [(set_attr "type" "dsp32")])
2973 ;; V2HI vector insns
2975 (define_insn "addv2hi3"
2976 [(set (match_operand:V2HI 0 "register_operand" "=d")
2977 (plus:V2HI (match_operand:V2HI 1 "register_operand" "d")
2978 (match_operand:V2HI 2 "register_operand" "d")))]
2981 [(set_attr "type" "dsp32")])
2983 (define_insn "ssaddv2hi3"
2984 [(set (match_operand:V2HI 0 "register_operand" "=d")
2985 (ss_plus:V2HI (match_operand:V2HI 1 "register_operand" "d")
2986 (match_operand:V2HI 2 "register_operand" "d")))]
2988 "%0 = %1 +|+ %2 (S)%!"
2989 [(set_attr "type" "dsp32")])
2991 (define_insn "subv2hi3"
2992 [(set (match_operand:V2HI 0 "register_operand" "=d")
2993 (minus:V2HI (match_operand:V2HI 1 "register_operand" "d")
2994 (match_operand:V2HI 2 "register_operand" "d")))]
2997 [(set_attr "type" "dsp32")])
2999 (define_insn "sssubv2hi3"
3000 [(set (match_operand:V2HI 0 "register_operand" "=d")
3001 (ss_minus:V2HI (match_operand:V2HI 1 "register_operand" "d")
3002 (match_operand:V2HI 2 "register_operand" "d")))]
3004 "%0 = %1 -|- %2 (S)%!"
3005 [(set_attr "type" "dsp32")])
3007 (define_insn "addsubv2hi3"
3008 [(set (match_operand:V2HI 0 "register_operand" "=d")
3010 (plus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3011 (parallel [(const_int 0)]))
3012 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3013 (parallel [(const_int 0)])))
3014 (minus:HI (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))
3015 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3018 [(set_attr "type" "dsp32")])
3020 (define_insn "subaddv2hi3"
3021 [(set (match_operand:V2HI 0 "register_operand" "=d")
3023 (minus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3024 (parallel [(const_int 0)]))
3025 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3026 (parallel [(const_int 0)])))
3027 (plus:HI (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))
3028 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3031 [(set_attr "type" "dsp32")])
3033 (define_insn "ssaddsubv2hi3"
3034 [(set (match_operand:V2HI 0 "register_operand" "=d")
3036 (ss_plus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3037 (parallel [(const_int 0)]))
3038 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3039 (parallel [(const_int 0)])))
3040 (ss_minus:HI (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))
3041 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3043 "%0 = %1 +|- %2 (S)%!"
3044 [(set_attr "type" "dsp32")])
3046 (define_insn "sssubaddv2hi3"
3047 [(set (match_operand:V2HI 0 "register_operand" "=d")
3049 (ss_minus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3050 (parallel [(const_int 0)]))
3051 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3052 (parallel [(const_int 0)])))
3053 (ss_plus:HI (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))
3054 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3056 "%0 = %1 -|+ %2 (S)%!"
3057 [(set_attr "type" "dsp32")])
3059 (define_insn "sublohiv2hi3"
3060 [(set (match_operand:HI 0 "register_operand" "=d")
3061 (minus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3062 (parallel [(const_int 1)]))
3063 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3064 (parallel [(const_int 0)]))))]
3067 [(set_attr "type" "dsp32")])
3069 (define_insn "subhilov2hi3"
3070 [(set (match_operand:HI 0 "register_operand" "=d")
3071 (minus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3072 (parallel [(const_int 0)]))
3073 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3074 (parallel [(const_int 1)]))))]
3077 [(set_attr "type" "dsp32")])
3079 (define_insn "sssublohiv2hi3"
3080 [(set (match_operand:HI 0 "register_operand" "=d")
3081 (ss_minus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3082 (parallel [(const_int 1)]))
3083 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3084 (parallel [(const_int 0)]))))]
3086 "%h0 = %d1 - %h2 (S)%!"
3087 [(set_attr "type" "dsp32")])
3089 (define_insn "sssubhilov2hi3"
3090 [(set (match_operand:HI 0 "register_operand" "=d")
3091 (ss_minus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3092 (parallel [(const_int 0)]))
3093 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3094 (parallel [(const_int 1)]))))]
3096 "%h0 = %h1 - %d2 (S)%!"
3097 [(set_attr "type" "dsp32")])
3099 (define_insn "addlohiv2hi3"
3100 [(set (match_operand:HI 0 "register_operand" "=d")
3101 (plus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3102 (parallel [(const_int 1)]))
3103 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3104 (parallel [(const_int 0)]))))]
3107 [(set_attr "type" "dsp32")])
3109 (define_insn "addhilov2hi3"
3110 [(set (match_operand:HI 0 "register_operand" "=d")
3111 (plus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3112 (parallel [(const_int 0)]))
3113 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3114 (parallel [(const_int 1)]))))]
3117 [(set_attr "type" "dsp32")])
3119 (define_insn "ssaddlohiv2hi3"
3120 [(set (match_operand:HI 0 "register_operand" "=d")
3121 (ss_plus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3122 (parallel [(const_int 1)]))
3123 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3124 (parallel [(const_int 0)]))))]
3126 "%h0 = %d1 + %h2 (S)%!"
3127 [(set_attr "type" "dsp32")])
3129 (define_insn "ssaddhilov2hi3"
3130 [(set (match_operand:HI 0 "register_operand" "=d")
3131 (ss_plus:HI (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3132 (parallel [(const_int 0)]))
3133 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3134 (parallel [(const_int 1)]))))]
3136 "%h0 = %h1 + %d2 (S)%!"
3137 [(set_attr "type" "dsp32")])
3139 (define_insn "sminv2hi3"
3140 [(set (match_operand:V2HI 0 "register_operand" "=d")
3141 (smin:V2HI (match_operand:V2HI 1 "register_operand" "d")
3142 (match_operand:V2HI 2 "register_operand" "d")))]
3144 "%0 = MIN (%1, %2) (V)%!"
3145 [(set_attr "type" "dsp32")])
3147 (define_insn "smaxv2hi3"
3148 [(set (match_operand:V2HI 0 "register_operand" "=d")
3149 (smax:V2HI (match_operand:V2HI 1 "register_operand" "d")
3150 (match_operand:V2HI 2 "register_operand" "d")))]
3152 "%0 = MAX (%1, %2) (V)%!"
3153 [(set_attr "type" "dsp32")])
3157 ;; The Blackfin allows a lot of different options, and we need many patterns to
3158 ;; cover most of the hardware's abilities.
3159 ;; There are a few simple patterns using MULT rtx codes, but most of them use
3160 ;; an unspec with a const_int operand that determines which flag to use in the
3162 ;; There are variants for single and parallel multiplications.
3163 ;; There are variants which just use 16-bit lowparts as inputs, and variants
3164 ;; which allow the user to choose just which halves to use as input values.
3165 ;; There are variants which set D registers, variants which set accumulators,
3166 ;; variants which set both, some of them optionally using the accumulators as
3167 ;; inputs for multiply-accumulate operations.
3169 (define_insn "flag_mulhi"
3170 [(set (match_operand:HI 0 "register_operand" "=d")
3171 (unspec:HI [(match_operand:HI 1 "register_operand" "d")
3172 (match_operand:HI 2 "register_operand" "d")
3173 (match_operand 3 "const_int_operand" "n")]
3174 UNSPEC_MUL_WITH_FLAG))]
3176 "%h0 = %h1 * %h2 %M3%!"
3177 [(set_attr "type" "dsp32")])
3179 (define_insn "flag_mulhi_parts"
3180 [(set (match_operand:HI 0 "register_operand" "=d")
3181 (unspec:HI [(vec_select:HI
3182 (match_operand:V2HI 1 "register_operand" "d")
3183 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3185 (match_operand:V2HI 2 "register_operand" "d")
3186 (parallel [(match_operand 4 "const01_operand" "P0P1")]))
3187 (match_operand 5 "const_int_operand" "n")]
3188 UNSPEC_MUL_WITH_FLAG))]
3191 const char *templates[] = {
3192 "%h0 = %h1 * %h2 %M5%!",
3193 "%h0 = %d1 * %h2 %M5%!",
3194 "%h0 = %h1 * %d2 %M5%!",
3195 "%h0 = %d1 * %d2 %M5%!" };
3196 int alt = INTVAL (operands[3]) + (INTVAL (operands[4]) << 1);
3197 return templates[alt];
3199 [(set_attr "type" "dsp32")])
3201 (define_insn "flag_mulhisi"
3202 [(set (match_operand:SI 0 "register_operand" "=d")
3203 (unspec:SI [(match_operand:HI 1 "register_operand" "d")
3204 (match_operand:HI 2 "register_operand" "d")
3205 (match_operand 3 "const_int_operand" "n")]
3206 UNSPEC_MUL_WITH_FLAG))]
3208 "%0 = %h1 * %h2 %M3%!"
3209 [(set_attr "type" "dsp32")])
3211 (define_insn "flag_mulhisi_parts"
3212 [(set (match_operand:SI 0 "register_operand" "=d")
3213 (unspec:SI [(vec_select:HI
3214 (match_operand:V2HI 1 "register_operand" "d")
3215 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3217 (match_operand:V2HI 2 "register_operand" "d")
3218 (parallel [(match_operand 4 "const01_operand" "P0P1")]))
3219 (match_operand 5 "const_int_operand" "n")]
3220 UNSPEC_MUL_WITH_FLAG))]
3223 const char *templates[] = {
3224 "%0 = %h1 * %h2 %M5%!",
3225 "%0 = %d1 * %h2 %M5%!",
3226 "%0 = %h1 * %d2 %M5%!",
3227 "%0 = %d1 * %d2 %M5%!" };
3228 int alt = INTVAL (operands[3]) + (INTVAL (operands[4]) << 1);
3229 return templates[alt];
3231 [(set_attr "type" "dsp32")])
3233 ;; Three alternatives here to cover all possible allocations:
3234 ;; 0. mac flag is usable only for accumulator 1 - use A1 and odd DREG
3235 ;; 1. mac flag is usable for accumulator 0 - use A0 and even DREG
3236 ;; 2. mac flag is usable in any accumulator - use A1 and odd DREG
3237 ;; Other patterns which don't have a DREG destination can collapse cases
3238 ;; 1 and 2 into one.
3239 (define_insn "flag_machi"
3240 [(set (match_operand:HI 0 "register_operand" "=W,D,W")
3241 (unspec:HI [(match_operand:HI 2 "register_operand" "d,d,d")
3242 (match_operand:HI 3 "register_operand" "d,d,d")
3243 (match_operand 4 "register_operand" "1,1,1")
3244 (match_operand 5 "const01_operand" "P0P1,P0P1,P0P1")
3245 (match_operand 6 "const_int_operand" "PB,PA,PA")]
3246 UNSPEC_MAC_WITH_FLAG))
3247 (set (match_operand:PDI 1 "register_operand" "=B,A,B")
3248 (unspec:PDI [(match_dup 1) (match_dup 2) (match_dup 3)
3249 (match_dup 4) (match_dup 5)]
3250 UNSPEC_MAC_WITH_FLAG))]
3252 "%h0 = (%1 %b5 %h2 * %h3) %M6%!"
3253 [(set_attr "type" "dsp32")])
3255 (define_insn "flag_machi_acconly"
3256 [(set (match_operand:PDI 0 "register_operand" "=B,e")
3257 (unspec:PDI [(match_operand:HI 1 "register_operand" "d,d")
3258 (match_operand:HI 2 "register_operand" "d,d")
3259 (match_operand 3 "register_operand" "0,0")
3260 (match_operand 4 "const01_operand" "P0P1,P0P1")
3261 (match_operand 5 "const_int_operand" "PB,PA")]
3262 UNSPEC_MAC_WITH_FLAG))]
3264 "%0 %b4 %h1 * %h2 %M5%!"
3265 [(set_attr "type" "dsp32")])
3267 (define_insn "flag_machi_parts_acconly"
3268 [(set (match_operand:PDI 0 "register_operand" "=B,e")
3269 (unspec:PDI [(vec_select:HI
3270 (match_operand:V2HI 1 "register_operand" "d,d")
3271 (parallel [(match_operand 3 "const01_operand" "P0P1,P0P1")]))
3273 (match_operand:V2HI 2 "register_operand" "d,d")
3274 (parallel [(match_operand 4 "const01_operand" "P0P1,P0P1")]))
3275 (match_operand:PDI 5 "register_operand" "0,0")
3276 (match_operand 6 "const01_operand" "P0P1,P0P1")
3277 (match_operand 7 "const_int_operand" "PB,PA")]
3278 UNSPEC_MAC_WITH_FLAG))]
3281 const char *templates[] = {
3282 "%0 %b6 %h1 * %h2 %M7%!",
3283 "%0 %b6 %d1 * %h2 %M7%!",
3284 "%0 %b6 %h1 * %d2 %M7%!",
3285 "%0 %b6 %d1 * %d2 %M7%!"
3287 int alt = INTVAL (operands[3]) + (INTVAL (operands[4]) << 1);
3288 return templates[alt];
3290 [(set_attr "type" "dsp32")])
3292 (define_insn "flag_macinithi"
3293 [(set (match_operand:HI 0 "register_operand" "=W,D,W")
3294 (unspec:HI [(match_operand:HI 1 "register_operand" "d,d,d")
3295 (match_operand:HI 2 "register_operand" "d,d,d")
3296 (match_operand 3 "const_int_operand" "PB,PA,PA")]
3297 UNSPEC_MAC_WITH_FLAG))
3298 (set (match_operand:PDI 4 "register_operand" "=B,A,B")
3299 (unspec:PDI [(match_dup 1) (match_dup 2) (match_dup 3)]
3300 UNSPEC_MAC_WITH_FLAG))]
3302 "%h0 = (%4 = %h1 * %h2) %M3%!"
3303 [(set_attr "type" "dsp32")])
3305 (define_insn "flag_macinit1hi"
3306 [(set (match_operand:PDI 0 "register_operand" "=B,e")
3307 (unspec:PDI [(match_operand:HI 1 "register_operand" "d,d")
3308 (match_operand:HI 2 "register_operand" "d,d")
3309 (match_operand 3 "const_int_operand" "PB,PA")]
3310 UNSPEC_MAC_WITH_FLAG))]
3312 "%0 = %h1 * %h2 %M3%!"
3313 [(set_attr "type" "dsp32")])
3315 (define_insn "mulv2hi3"
3316 [(set (match_operand:V2HI 0 "register_operand" "=d")
3317 (mult:V2HI (match_operand:V2HI 1 "register_operand" "d")
3318 (match_operand:V2HI 2 "register_operand" "d")))]
3320 "%h0 = %h1 * %h2, %d0 = %d1 * %d2 (IS)%!"
3321 [(set_attr "type" "dsp32")])
3323 (define_insn "flag_mulv2hi"
3324 [(set (match_operand:V2HI 0 "register_operand" "=d")
3325 (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "d")
3326 (match_operand:V2HI 2 "register_operand" "d")
3327 (match_operand 3 "const_int_operand" "n")]
3328 UNSPEC_MUL_WITH_FLAG))]
3330 "%h0 = %h1 * %h2, %d0 = %d1 * %d2 %M3%!"
3331 [(set_attr "type" "dsp32")])
3333 (define_insn "flag_mulv2hi_parts"
3334 [(set (match_operand:V2HI 0 "register_operand" "=d")
3335 (unspec:V2HI [(vec_concat:V2HI
3337 (match_operand:V2HI 1 "register_operand" "d")
3338 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3341 (parallel [(match_operand 4 "const01_operand" "P0P1")])))
3343 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3344 (parallel [(match_operand 5 "const01_operand" "P0P1")]))
3345 (vec_select:HI (match_dup 2)
3346 (parallel [(match_operand 6 "const01_operand" "P0P1")])))
3347 (match_operand 7 "const_int_operand" "n")]
3348 UNSPEC_MUL_WITH_FLAG))]
3351 const char *templates[] = {
3352 "%h0 = %h1 * %h2, %d0 = %h1 * %h2 %M7%!",
3353 "%h0 = %d1 * %h2, %d0 = %h1 * %h2 %M7%!",
3354 "%h0 = %h1 * %h2, %d0 = %d1 * %h2 %M7%!",
3355 "%h0 = %d1 * %h2, %d0 = %d1 * %h2 %M7%!",
3356 "%h0 = %h1 * %d2, %d0 = %h1 * %h2 %M7%!",
3357 "%h0 = %d1 * %d2, %d0 = %h1 * %h2 %M7%!",
3358 "%h0 = %h1 * %d2, %d0 = %d1 * %h2 %M7%!",
3359 "%h0 = %d1 * %d2, %d0 = %d1 * %h2 %M7%!",
3360 "%h0 = %h1 * %h2, %d0 = %h1 * %d2 %M7%!",
3361 "%h0 = %d1 * %h2, %d0 = %h1 * %d2 %M7%!",
3362 "%h0 = %h1 * %h2, %d0 = %d1 * %d2 %M7%!",
3363 "%h0 = %d1 * %h2, %d0 = %d1 * %d2 %M7%!",
3364 "%h0 = %h1 * %d2, %d0 = %h1 * %d2 %M7%!",
3365 "%h0 = %d1 * %d2, %d0 = %h1 * %d2 %M7%!",
3366 "%h0 = %h1 * %d2, %d0 = %d1 * %d2 %M7%!",
3367 "%h0 = %d1 * %d2, %d0 = %d1 * %d2 %M7%!" };
3368 int alt = (INTVAL (operands[3]) + (INTVAL (operands[4]) << 1)
3369 + (INTVAL (operands[5]) << 2) + (INTVAL (operands[6]) << 3));
3370 return templates[alt];
3372 [(set_attr "type" "dsp32")])
3374 ;; A slightly complicated pattern.
3375 ;; Operand 0 is the halfword output; operand 11 is the accumulator output
3376 ;; Halfword inputs are operands 1 and 2; operands 3, 4, 5 and 6 specify which
3377 ;; parts of these 2x16 bit registers to use.
3378 ;; Operand 7 is the accumulator input.
3379 ;; Operands 8/9 specify whether low/high parts are mac (0) or msu (1)
3380 ;; Operand 10 is the macflag to be used.
3381 (define_insn "flag_macv2hi_parts"
3382 [(set (match_operand:V2HI 0 "register_operand" "=d")
3383 (unspec:V2HI [(vec_concat:V2HI
3385 (match_operand:V2HI 1 "register_operand" "d")
3386 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3389 (parallel [(match_operand 4 "const01_operand" "P0P1")])))
3391 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3392 (parallel [(match_operand 5 "const01_operand" "P0P1")]))
3393 (vec_select:HI (match_dup 2)
3394 (parallel [(match_operand 6 "const01_operand" "P0P1")])))
3395 (match_operand:V2PDI 7 "register_operand" "e")
3396 (match_operand 8 "const01_operand" "P0P1")
3397 (match_operand 9 "const01_operand" "P0P1")
3398 (match_operand 10 "const_int_operand" "n")]
3399 UNSPEC_MAC_WITH_FLAG))
3400 (set (match_operand:V2PDI 11 "register_operand" "=e")
3401 (unspec:V2PDI [(vec_concat:V2HI
3402 (vec_select:HI (match_dup 1) (parallel [(match_dup 3)]))
3403 (vec_select:HI (match_dup 1) (parallel [(match_dup 4)])))
3405 (vec_select:HI (match_dup 2) (parallel [(match_dup 5)]))
3406 (vec_select:HI (match_dup 2) (parallel [(match_dup 5)])))
3407 (match_dup 7) (match_dup 8) (match_dup 9) (match_dup 10)]
3408 UNSPEC_MAC_WITH_FLAG))]
3411 const char *templates[] = {
3412 "%h0 = (A0 %b8 %h1 * %h2), %d0 = (A1 %b9 %h1 * %h2) %M10%!",
3413 "%h0 = (A0 %b8 %d1 * %h2), %d0 = (A1 %b9 %h1 * %h2) %M10%!",
3414 "%h0 = (A0 %b8 %h1 * %h2), %d0 = (A1 %b9 %d1 * %h2) %M10%!",
3415 "%h0 = (A0 %b8 %d1 * %h2), %d0 = (A1 %b9 %d1 * %h2) %M10%!",
3416 "%h0 = (A0 %b8 %h1 * %d2), %d0 = (A1 %b9 %h1 * %h2) %M10%!",
3417 "%h0 = (A0 %b8 %d1 * %d2), %d0 = (A1 %b9 %h1 * %h2) %M10%!",
3418 "%h0 = (A0 %b8 %h1 * %d2), %d0 = (A1 %b9 %d1 * %h2) %M10%!",
3419 "%h0 = (A0 %b8 %d1 * %d2), %d0 = (A1 %b9 %d1 * %h2) %M10%!",
3420 "%h0 = (A0 %b8 %h1 * %h2), %d0 = (A1 %b9 %h1 * %d2) %M10%!",
3421 "%h0 = (A0 %b8 %d1 * %h2), %d0 = (A1 %b9 %h1 * %d2) %M10%!",
3422 "%h0 = (A0 %b8 %h1 * %h2), %d0 = (A1 %b9 %d1 * %d2) %M10%!",
3423 "%h0 = (A0 %b8 %d1 * %h2), %d0 = (A1 %b9 %d1 * %d2) %M10%!",
3424 "%h0 = (A0 %b8 %h1 * %d2), %d0 = (A1 %b9 %h1 * %d2) %M10%!",
3425 "%h0 = (A0 %b8 %d1 * %d2), %d0 = (A1 %b9 %h1 * %d2) %M10%!",
3426 "%h0 = (A0 %b8 %h1 * %d2), %d0 = (A1 %b9 %d1 * %d2) %M10%!",
3427 "%h0 = (A0 %b8 %d1 * %d2), %d0 = (A1 %b9 %d1 * %d2) %M10%!" };
3428 int alt = (INTVAL (operands[3]) + (INTVAL (operands[4]) << 1)
3429 + (INTVAL (operands[5]) << 2) + (INTVAL (operands[6]) << 3));
3430 return templates[alt];
3432 [(set_attr "type" "dsp32")])
3434 (define_insn "flag_macv2hi_parts_acconly"
3435 [(set (match_operand:V2PDI 0 "register_operand" "=e")
3436 (unspec:V2PDI [(vec_concat:V2HI
3438 (match_operand:V2HI 1 "register_operand" "d")
3439 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3442 (parallel [(match_operand 4 "const01_operand" "P0P1")])))
3444 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3445 (parallel [(match_operand 5 "const01_operand" "P0P1")]))
3446 (vec_select:HI (match_dup 2)
3447 (parallel [(match_operand 6 "const01_operand" "P0P1")])))
3448 (match_operand:V2PDI 7 "register_operand" "e")
3449 (match_operand 8 "const01_operand" "P0P1")
3450 (match_operand 9 "const01_operand" "P0P1")
3451 (match_operand 10 "const_int_operand" "n")]
3452 UNSPEC_MAC_WITH_FLAG))]
3455 const char *templates[] = {
3456 "A0 %b8 %h1 * %h2, A1 %b9 %h1 * %h2 %M10%!",
3457 "A0 %b8 %d1 * %h2, A1 %b9 %h1 * %h2 %M10%!",
3458 "A0 %b8 %h1 * %h2, A1 %b9 %d1 * %h2 %M10%!",
3459 "A0 %b8 %d1 * %h2, A1 %b9 %d1 * %h2 %M10%!",
3460 "A0 %b8 %h1 * %d2, A1 %b9 %h1 * %h2 %M10%!",
3461 "A0 %b8 %d1 * %d2, A1 %b9 %h1 * %h2 %M10%!",
3462 "A0 %b8 %h1 * %d2, A1 %b9 %d1 * %h2 %M10%!",
3463 "A0 %b8 %d1 * %d2, A1 %b9 %d1 * %h2 %M10%!",
3464 "A0 %b8 %h1 * %h2, A1 %b9 %h1 * %d2 %M10%!",
3465 "A0 %b8 %d1 * %h2, A1 %b9 %h1 * %d2 %M10%!",
3466 "A0 %b8 %h1 * %h2, A1 %b9 %d1 * %d2 %M10%!",
3467 "A0 %b8 %d1 * %h2, A1 %b9 %d1 * %d2 %M10%!",
3468 "A0 %b8 %h1 * %d2, A1 %b9 %h1 * %d2 %M10%!",
3469 "A0 %b8 %d1 * %d2, A1 %b9 %h1 * %d2 %M10%!",
3470 "A0 %b8 %h1 * %d2, A1 %b9 %d1 * %d2 %M10%!",
3471 "A0 %b8 %d1 * %d2, A1 %b9 %d1 * %d2 %M10%!" };
3472 int alt = (INTVAL (operands[3]) + (INTVAL (operands[4]) << 1)
3473 + (INTVAL (operands[5]) << 2) + (INTVAL (operands[6]) << 3));
3474 return templates[alt];
3476 [(set_attr "type" "dsp32")])
3478 ;; Same as above, but initializing the accumulators and therefore a couple fewer
3479 ;; necessary operands.
3480 (define_insn "flag_macinitv2hi_parts"
3481 [(set (match_operand:V2HI 0 "register_operand" "=d")
3482 (unspec:V2HI [(vec_concat:V2HI
3484 (match_operand:V2HI 1 "register_operand" "d")
3485 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3488 (parallel [(match_operand 4 "const01_operand" "P0P1")])))
3490 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3491 (parallel [(match_operand 5 "const01_operand" "P0P1")]))
3492 (vec_select:HI (match_dup 2)
3493 (parallel [(match_operand 6 "const01_operand" "P0P1")])))
3494 (match_operand 7 "const_int_operand" "n")]
3495 UNSPEC_MAC_WITH_FLAG))
3496 (set (match_operand:V2PDI 8 "register_operand" "=e")
3497 (unspec:V2PDI [(vec_concat:V2HI
3498 (vec_select:HI (match_dup 1) (parallel [(match_dup 3)]))
3499 (vec_select:HI (match_dup 1) (parallel [(match_dup 4)])))
3501 (vec_select:HI (match_dup 2) (parallel [(match_dup 5)]))
3502 (vec_select:HI (match_dup 2) (parallel [(match_dup 5)])))
3504 UNSPEC_MAC_WITH_FLAG))]
3507 const char *templates[] = {
3508 "%h0 = (A0 = %h1 * %h2), %d0 = (A1 = %h1 * %h2) %M7%!",
3509 "%h0 = (A0 = %d1 * %h2), %d0 = (A1 = %h1 * %h2) %M7%!",
3510 "%h0 = (A0 = %h1 * %h2), %d0 = (A1 = %d1 * %h2) %M7%!",
3511 "%h0 = (A0 = %d1 * %h2), %d0 = (A1 = %d1 * %h2) %M7%!",
3512 "%h0 = (A0 = %h1 * %d2), %d0 = (A1 = %h1 * %h2) %M7%!",
3513 "%h0 = (A0 = %d1 * %d2), %d0 = (A1 = %h1 * %h2) %M7%!",
3514 "%h0 = (A0 = %h1 * %d2), %d0 = (A1 = %d1 * %h2) %M7%!",
3515 "%h0 = (A0 = %d1 * %d2), %d0 = (A1 = %d1 * %h2) %M7%!",
3516 "%h0 = (A0 = %h1 * %h2), %d0 = (A1 = %h1 * %d2) %M7%!",
3517 "%h0 = (A0 = %d1 * %h2), %d0 = (A1 = %h1 * %d2) %M7%!",
3518 "%h0 = (A0 = %h1 * %h2), %d0 = (A1 = %d1 * %d2) %M7%!",
3519 "%h0 = (A0 = %d1 * %h2), %d0 = (A1 = %d1 * %d2) %M7%!",
3520 "%h0 = (A0 = %h1 * %d2), %d0 = (A1 = %h1 * %d2) %M7%!",
3521 "%h0 = (A0 = %d1 * %d2), %d0 = (A1 = %h1 * %d2) %M7%!",
3522 "%h0 = (A0 = %h1 * %d2), %d0 = (A1 = %d1 * %d2) %M7%!",
3523 "%h0 = (A0 = %d1 * %d2), %d0 = (A1 = %d1 * %d2) %M7%!" };
3524 int alt = (INTVAL (operands[3]) + (INTVAL (operands[4]) << 1)
3525 + (INTVAL (operands[5]) << 2) + (INTVAL (operands[6]) << 3));
3526 return templates[alt];
3528 [(set_attr "type" "dsp32")])
3530 (define_insn "flag_macinit1v2hi_parts"
3531 [(set (match_operand:V2PDI 0 "register_operand" "=e")
3532 (unspec:V2PDI [(vec_concat:V2HI
3534 (match_operand:V2HI 1 "register_operand" "d")
3535 (parallel [(match_operand 3 "const01_operand" "P0P1")]))
3538 (parallel [(match_operand 4 "const01_operand" "P0P1")])))
3540 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3541 (parallel [(match_operand 5 "const01_operand" "P0P1")]))
3542 (vec_select:HI (match_dup 2)
3543 (parallel [(match_operand 6 "const01_operand" "P0P1")])))
3544 (match_operand 7 "const_int_operand" "n")]
3545 UNSPEC_MAC_WITH_FLAG))]
3548 const char *templates[] = {
3549 "A0 = %h1 * %h2, A1 = %h1 * %h2 %M7%!",
3550 "A0 = %d1 * %h2, A1 = %h1 * %h2 %M7%!",
3551 "A0 = %h1 * %h2, A1 = %d1 * %h2 %M7%!",
3552 "A0 = %d1 * %h2, A1 = %d1 * %h2 %M7%!",
3553 "A0 = %h1 * %d2, A1 = %h1 * %h2 %M7%!",
3554 "A0 = %d1 * %d2, A1 = %h1 * %h2 %M7%!",
3555 "A0 = %h1 * %d2, A1 = %d1 * %h2 %M7%!",
3556 "A0 = %d1 * %d2, A1 = %d1 * %h2 %M7%!",
3557 "A0 = %h1 * %h2, A1 = %h1 * %d2 %M7%!",
3558 "A0 = %d1 * %h2, A1 = %h1 * %d2 %M7%!",
3559 "A0 = %h1 * %h2, A1 = %d1 * %d2 %M7%!",
3560 "A0 = %d1 * %h2, A1 = %d1 * %d2 %M7%!",
3561 "A0 = %h1 * %d2, A1 = %h1 * %d2 %M7%!",
3562 "A0 = %d1 * %d2, A1 = %h1 * %d2 %M7%!",
3563 "A0 = %h1 * %d2, A1 = %d1 * %d2 %M7%!",
3564 "A0 = %d1 * %d2, A1 = %d1 * %d2 %M7%!" };
3565 int alt = (INTVAL (operands[3]) + (INTVAL (operands[4]) << 1)
3566 + (INTVAL (operands[5]) << 2) + (INTVAL (operands[6]) << 3));
3567 return templates[alt];
3569 [(set_attr "type" "dsp32")])
3571 ;; A mixture of multiply and multiply-accumulate for when we only want to
3572 ;; initialize one part.
3573 (define_insn "flag_mul_macv2hi_parts_acconly"
3574 [(set (match_operand:PDI 0 "register_operand" "=B,e,e")
3575 (unspec:PDI [(vec_select:HI
3576 (match_operand:V2HI 2 "register_operand" "d,d,d")
3577 (parallel [(match_operand 4 "const01_operand" "P0P1,P0P1,P0P1")]))
3579 (match_operand:V2HI 3 "register_operand" "d,d,d")
3580 (parallel [(match_operand 6 "const01_operand" "P0P1,P0P1,P0P1")]))
3581 (match_operand 10 "const_int_operand" "PB,PA,PA")]
3582 UNSPEC_MUL_WITH_FLAG))
3583 (set (match_operand:PDI 1 "register_operand" "=B,e,e")
3584 (unspec:PDI [(vec_select:HI
3586 (parallel [(match_operand 5 "const01_operand" "P0P1,P0P1,P0P1")]))
3589 (parallel [(match_operand 7 "const01_operand" "P0P1,P0P1,P0P1")]))
3590 (match_operand:PDI 8 "register_operand" "1,1,1")
3591 (match_operand 9 "const01_operand" "P0P1,P0P1,P0P1")
3592 (match_operand 11 "const_int_operand" "PA,PB,PA")]
3593 UNSPEC_MAC_WITH_FLAG))]
3594 "MACFLAGS_MATCH_P (INTVAL (operands[10]), INTVAL (operands[11]))"
3597 const char *templates[] = {
3598 "%0 = %h2 * %h3, %1 %b4 %h2 * %h3 %M5%!",
3599 "%0 = %d2 * %h3, %1 %b4 %h2 * %h3 %M5%!",
3600 "%0 = %h2 * %h3, %1 %b4 %d2 * %h3 %M5%!",
3601 "%0 = %d2 * %h3, %1 %b4 %d2 * %h3 %M5%!",
3602 "%0 = %h2 * %d3, %1 %b4 %h2 * %h3 %M5%!",
3603 "%0 = %d2 * %d3, %1 %b4 %h2 * %h3 %M5%!",
3604 "%0 = %h2 * %d3, %1 %b4 %d2 * %h3 %M5%!",
3605 "%0 = %d2 * %d3, %1 %b4 %d2 * %h3 %M5%!",
3606 "%0 = %h2 * %h3, %1 %b4 %h2 * %d3 %M5%!",
3607 "%0 = %d2 * %h3, %1 %b4 %h2 * %d3 %M5%!",
3608 "%0 = %h2 * %h3, %1 %b4 %d2 * %d3 %M5%!",
3609 "%0 = %d2 * %h3, %1 %b4 %d2 * %d3 %M5%!",
3610 "%0 = %h2 * %d3, %1 %b4 %h2 * %d3 %M5%!",
3611 "%0 = %d2 * %d3, %1 %b4 %h2 * %d3 %M5%!",
3612 "%0 = %h2 * %d3, %1 %b4 %d2 * %d3 %M5%!",
3613 "%0 = %d2 * %d3, %1 %b4 %d2 * %d3 %M5%!" };
3614 int alt = (INTVAL (operands[4]) + (INTVAL (operands[5]) << 1)
3615 + (INTVAL (operands[6]) << 2) + (INTVAL (operands[7]) << 3));
3616 xops[0] = operands[0];
3617 xops[1] = operands[1];
3618 xops[2] = operands[2];
3619 xops[3] = operands[3];
3620 xops[4] = operands[9];
3621 xops[5] = which_alternative == 0 ? operands[10] : operands[11];
3622 output_asm_insn (templates[alt], xops);
3625 [(set_attr "type" "dsp32")])
3628 (define_code_iterator s_or_u [sign_extend zero_extend])
3629 (define_code_attr su_optab [(sign_extend "mul")
3630 (zero_extend "umul")])
3631 (define_code_attr su_modifier [(sign_extend "IS")
3632 (zero_extend "FU")])
3634 (define_insn "<su_optab>hisi_ll"
3635 [(set (match_operand:SI 0 "register_operand" "=d")
3637 (vec_select:HI (match_operand:V2HI 1 "register_operand" "%d")
3638 (parallel [(const_int 0)])))
3640 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3641 (parallel [(const_int 0)])))))]
3643 "%0 = %h1 * %h2 (<su_modifier>)%!"
3644 [(set_attr "type" "dsp32")])
3646 (define_insn "<su_optab>hisi_lh"
3647 [(set (match_operand:SI 0 "register_operand" "=d")
3649 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3650 (parallel [(const_int 0)])))
3652 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3653 (parallel [(const_int 1)])))))]
3655 "%0 = %h1 * %d2 (<su_modifier>)%!"
3656 [(set_attr "type" "dsp32")])
3658 (define_insn "<su_optab>hisi_hl"
3659 [(set (match_operand:SI 0 "register_operand" "=d")
3661 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3662 (parallel [(const_int 1)])))
3664 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3665 (parallel [(const_int 0)])))))]
3667 "%0 = %d1 * %h2 (<su_modifier>)%!"
3668 [(set_attr "type" "dsp32")])
3670 (define_insn "<su_optab>hisi_hh"
3671 [(set (match_operand:SI 0 "register_operand" "=d")
3673 (vec_select:HI (match_operand:V2HI 1 "register_operand" "%d")
3674 (parallel [(const_int 1)])))
3676 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3677 (parallel [(const_int 1)])))))]
3679 "%0 = %d1 * %d2 (<su_modifier>)%!"
3680 [(set_attr "type" "dsp32")])
3682 ;; Additional variants for signed * unsigned multiply.
3684 (define_insn "usmulhisi_ull"
3685 [(set (match_operand:SI 0 "register_operand" "=W")
3686 (mult:SI (zero_extend:SI
3687 (vec_select:HI (match_operand:V2HI 1 "register_operand" "%d")
3688 (parallel [(const_int 0)])))
3690 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3691 (parallel [(const_int 0)])))))]
3693 "%0 = %h2 * %h1 (IS,M)%!"
3694 [(set_attr "type" "dsp32")])
3696 (define_insn "usmulhisi_ulh"
3697 [(set (match_operand:SI 0 "register_operand" "=W")
3698 (mult:SI (zero_extend:SI
3699 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3700 (parallel [(const_int 0)])))
3702 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3703 (parallel [(const_int 1)])))))]
3705 "%0 = %d2 * %h1 (IS,M)%!"
3706 [(set_attr "type" "dsp32")])
3708 (define_insn "usmulhisi_uhl"
3709 [(set (match_operand:SI 0 "register_operand" "=W")
3710 (mult:SI (zero_extend:SI
3711 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d")
3712 (parallel [(const_int 1)])))
3714 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3715 (parallel [(const_int 0)])))))]
3717 "%0 = %h2 * %d1 (IS,M)%!"
3718 [(set_attr "type" "dsp32")])
3720 (define_insn "usmulhisi_uhh"
3721 [(set (match_operand:SI 0 "register_operand" "=W")
3722 (mult:SI (zero_extend:SI
3723 (vec_select:HI (match_operand:V2HI 1 "register_operand" "%d")
3724 (parallel [(const_int 1)])))
3726 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d")
3727 (parallel [(const_int 1)])))))]
3729 "%0 = %d2 * %d1 (IS,M)%!"
3730 [(set_attr "type" "dsp32")])
3732 ;; Parallel versions of these operations. First, normal signed or unsigned
3735 (define_insn "<su_optab>hisi_ll_lh"
3736 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3738 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3739 (parallel [(const_int 0)])))
3741 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3742 (parallel [(const_int 0)])))))
3743 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3745 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
3747 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3749 "%0 = %h1 * %h2, %3 = %h1 * %d2 (<su_modifier>)%!"
3750 [(set_attr "type" "dsp32")])
3752 (define_insn "<su_optab>hisi_ll_hl"
3753 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3755 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3756 (parallel [(const_int 0)])))
3758 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3759 (parallel [(const_int 0)])))))
3760 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3762 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3764 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3766 "%0 = %h1 * %h2, %3 = %d1 * %h2 (<su_modifier>)%!"
3767 [(set_attr "type" "dsp32")])
3769 (define_insn "<su_optab>hisi_ll_hh"
3770 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3772 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3773 (parallel [(const_int 0)])))
3775 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3776 (parallel [(const_int 0)])))))
3777 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3779 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3781 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3783 "%0 = %h1 * %h2, %3 = %d1 * %d2 (<su_modifier>)%!"
3784 [(set_attr "type" "dsp32")])
3786 (define_insn "<su_optab>hisi_lh_hl"
3787 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3789 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3790 (parallel [(const_int 0)])))
3792 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3793 (parallel [(const_int 1)])))))
3794 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3796 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3798 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3800 "%0 = %h1 * %d2, %3 = %d1 * %h2 (<su_modifier>)%!"
3801 [(set_attr "type" "dsp32")])
3803 (define_insn "<su_optab>hisi_lh_hh"
3804 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3806 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3807 (parallel [(const_int 0)])))
3809 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3810 (parallel [(const_int 1)])))))
3811 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3813 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3815 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3817 "%0 = %h1 * %d2, %3 = %d1 * %d2 (<su_modifier>)%!"
3818 [(set_attr "type" "dsp32")])
3820 (define_insn "<su_optab>hisi_hl_hh"
3821 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3823 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3824 (parallel [(const_int 1)])))
3826 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3827 (parallel [(const_int 0)])))))
3828 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3830 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3832 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3834 "%0 = %d1 * %h2, %3 = %d1 * %d2 (<su_modifier>)%!"
3835 [(set_attr "type" "dsp32")])
3837 ;; Special signed * unsigned variants.
3839 (define_insn "usmulhisi_ll_lul"
3840 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3841 (mult:SI (sign_extend:SI
3842 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3843 (parallel [(const_int 0)])))
3845 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3846 (parallel [(const_int 0)])))))
3847 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3848 (mult:SI (sign_extend:SI
3849 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
3851 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3853 "%0 = %h1 * %h2, %3 = %h1 * %h2 (IS,M)%!"
3854 [(set_attr "type" "dsp32")])
3856 (define_insn "usmulhisi_ll_luh"
3857 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3858 (mult:SI (sign_extend:SI
3859 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3860 (parallel [(const_int 0)])))
3862 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3863 (parallel [(const_int 0)])))))
3864 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3865 (mult:SI (sign_extend:SI
3866 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
3868 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3870 "%0 = %h1 * %h2, %3 = %h1 * %d2 (IS,M)%!"
3871 [(set_attr "type" "dsp32")])
3873 (define_insn "usmulhisi_ll_hul"
3874 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3875 (mult:SI (sign_extend:SI
3876 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3877 (parallel [(const_int 0)])))
3879 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3880 (parallel [(const_int 0)])))))
3881 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3882 (mult:SI (sign_extend:SI
3883 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3885 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3887 "%0 = %h1 * %h2, %3 = %d1 * %h2 (IS,M)%!"
3888 [(set_attr "type" "dsp32")])
3890 (define_insn "usmulhisi_ll_huh"
3891 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3892 (mult:SI (sign_extend:SI
3893 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3894 (parallel [(const_int 0)])))
3896 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3897 (parallel [(const_int 0)])))))
3898 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3899 (mult:SI (sign_extend:SI
3900 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3902 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3904 "%0 = %h1 * %h2, %3 = %d1 * %d2 (IS,M)%!"
3905 [(set_attr "type" "dsp32")])
3907 (define_insn "usmulhisi_lh_lul"
3908 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3909 (mult:SI (sign_extend:SI
3910 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3911 (parallel [(const_int 0)])))
3913 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3914 (parallel [(const_int 1)])))))
3915 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3916 (mult:SI (sign_extend:SI
3917 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
3919 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3921 "%0 = %h1 * %d2, %3 = %h1 * %h2 (IS,M)%!"
3922 [(set_attr "type" "dsp32")])
3924 (define_insn "usmulhisi_lh_luh"
3925 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3926 (mult:SI (sign_extend:SI
3927 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3928 (parallel [(const_int 0)])))
3930 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3931 (parallel [(const_int 1)])))))
3932 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3933 (mult:SI (sign_extend:SI
3934 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
3936 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3938 "%0 = %h1 * %d2, %3 = %h1 * %d2 (IS,M)%!"
3939 [(set_attr "type" "dsp32")])
3941 (define_insn "usmulhisi_lh_hul"
3942 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3943 (mult:SI (sign_extend:SI
3944 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3945 (parallel [(const_int 0)])))
3947 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3948 (parallel [(const_int 1)])))))
3949 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3950 (mult:SI (sign_extend:SI
3951 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3953 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3955 "%0 = %h1 * %d2, %3 = %d1 * %h2 (IS,M)%!"
3956 [(set_attr "type" "dsp32")])
3958 (define_insn "usmulhisi_lh_huh"
3959 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3960 (mult:SI (sign_extend:SI
3961 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3962 (parallel [(const_int 0)])))
3964 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3965 (parallel [(const_int 1)])))))
3966 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3967 (mult:SI (sign_extend:SI
3968 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
3970 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
3972 "%0 = %h1 * %d2, %3 = %d1 * %d2 (IS,M)%!"
3973 [(set_attr "type" "dsp32")])
3975 (define_insn "usmulhisi_hl_lul"
3976 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3977 (mult:SI (sign_extend:SI
3978 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3979 (parallel [(const_int 1)])))
3981 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3982 (parallel [(const_int 0)])))))
3983 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
3984 (mult:SI (sign_extend:SI
3985 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
3987 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
3989 "%0 = %d1 * %h2, %3 = %h1 * %h2 (IS,M)%!"
3990 [(set_attr "type" "dsp32")])
3992 (define_insn "usmulhisi_hl_luh"
3993 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
3994 (mult:SI (sign_extend:SI
3995 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
3996 (parallel [(const_int 1)])))
3998 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
3999 (parallel [(const_int 0)])))))
4000 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4001 (mult:SI (sign_extend:SI
4002 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
4004 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
4006 "%0 = %d1 * %h2, %3 = %h1 * %d2 (IS,M)%!"
4007 [(set_attr "type" "dsp32")])
4009 (define_insn "usmulhisi_hl_hul"
4010 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
4011 (mult:SI (sign_extend:SI
4012 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
4013 (parallel [(const_int 1)])))
4015 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
4016 (parallel [(const_int 0)])))))
4017 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4018 (mult:SI (sign_extend:SI
4019 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
4021 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
4023 "%0 = %d1 * %h2, %3 = %d1 * %h2 (IS,M)%!"
4024 [(set_attr "type" "dsp32")])
4026 (define_insn "usmulhisi_hl_huh"
4027 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
4028 (mult:SI (sign_extend:SI
4029 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
4030 (parallel [(const_int 1)])))
4032 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
4033 (parallel [(const_int 0)])))))
4034 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4035 (mult:SI (sign_extend:SI
4036 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
4038 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
4040 "%0 = %d1 * %h2, %3 = %d1 * %d2 (IS,M)%!"
4041 [(set_attr "type" "dsp32")])
4043 (define_insn "usmulhisi_hh_lul"
4044 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
4045 (mult:SI (sign_extend:SI
4046 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
4047 (parallel [(const_int 1)])))
4049 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
4050 (parallel [(const_int 1)])))))
4051 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4052 (mult:SI (sign_extend:SI
4053 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
4055 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
4057 "%0 = %d1 * %d2, %3 = %h1 * %h2 (IS,M)%!"
4058 [(set_attr "type" "dsp32")])
4060 (define_insn "usmulhisi_hh_luh"
4061 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
4062 (mult:SI (sign_extend:SI
4063 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
4064 (parallel [(const_int 1)])))
4066 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
4067 (parallel [(const_int 1)])))))
4068 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4069 (mult:SI (sign_extend:SI
4070 (vec_select:HI (match_dup 1) (parallel [(const_int 0)])))
4072 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
4074 "%0 = %d1 * %d2, %3 = %h1 * %d2 (IS,M)%!"
4075 [(set_attr "type" "dsp32")])
4077 (define_insn "usmulhisi_hh_hul"
4078 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
4079 (mult:SI (sign_extend:SI
4080 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
4081 (parallel [(const_int 1)])))
4083 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
4084 (parallel [(const_int 1)])))))
4085 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4086 (mult:SI (sign_extend:SI
4087 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
4089 (vec_select:HI (match_dup 2) (parallel [(const_int 0)])))))]
4091 "%0 = %d1 * %d2, %3 = %d1 * %h2 (IS,M)%!"
4092 [(set_attr "type" "dsp32")])
4094 (define_insn "usmulhisi_hh_huh"
4095 [(set (match_operand:SI 0 "register_operand" "=q0,q2,q4,q6")
4096 (mult:SI (sign_extend:SI
4097 (vec_select:HI (match_operand:V2HI 1 "register_operand" "d,d,d,d")
4098 (parallel [(const_int 1)])))
4100 (vec_select:HI (match_operand:V2HI 2 "register_operand" "d,d,d,d")
4101 (parallel [(const_int 1)])))))
4102 (set (match_operand:SI 3 "register_operand" "=q1,q3,q5,q7")
4103 (mult:SI (sign_extend:SI
4104 (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
4106 (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))))]
4108 "%0 = %d1 * %d2, %3 = %d1 * %d2 (IS,M)%!"
4109 [(set_attr "type" "dsp32")])
4113 (define_insn "ssnegv2hi2"
4114 [(set (match_operand:V2HI 0 "register_operand" "=d")
4115 (ss_neg:V2HI (match_operand:V2HI 1 "register_operand" "d")))]
4118 [(set_attr "type" "dsp32")])
4120 (define_insn "ssabsv2hi2"
4121 [(set (match_operand:V2HI 0 "register_operand" "=d")
4122 (ss_abs:V2HI (match_operand:V2HI 1 "register_operand" "d")))]
4125 [(set_attr "type" "dsp32")])
4129 (define_insn "ssashiftv2hi3"
4130 [(set (match_operand:V2HI 0 "register_operand" "=d,d,d")
4132 (lt (match_operand:HI 2 "vec_shift_operand" "d,Ku4,Ks4") (const_int 0))
4133 (ashiftrt:V2HI (match_operand:V2HI 1 "register_operand" "d,d,d")
4135 (ss_ashift:V2HI (match_dup 1) (match_dup 2))))]
4138 %0 = ASHIFT %1 BY %h2 (V, S)%!
4139 %0 = %1 << %2 (V,S)%!
4140 %0 = %1 >>> %N2 (V,S)%!"
4141 [(set_attr "type" "dsp32,dsp32shiftimm,dsp32shiftimm")])
4143 (define_insn "ssashifthi3"
4144 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
4146 (lt (match_operand:HI 2 "vec_shift_operand" "d,Ku4,Ks4") (const_int 0))
4147 (ashiftrt:HI (match_operand:HI 1 "register_operand" "d,d,d")
4149 (ss_ashift:HI (match_dup 1) (match_dup 2))))]
4152 %0 = ASHIFT %1 BY %h2 (V, S)%!
4153 %0 = %1 << %2 (V,S)%!
4154 %0 = %1 >>> %N2 (V,S)%!"
4155 [(set_attr "type" "dsp32,dsp32shiftimm,dsp32shiftimm")])
4157 (define_insn "ssashiftsi3"
4158 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4160 (lt (match_operand:HI 2 "reg_or_const_int_operand" "d,Ku5,Ks5") (const_int 0))
4161 (ashiftrt:SI (match_operand:HI 1 "register_operand" "d,d,d")
4163 (ss_ashift:SI (match_dup 1) (match_dup 2))))]
4166 %0 = ASHIFT %1 BY %h2 (S)%!
4168 %0 = %1 >>> %N2 (S)%!"
4169 [(set_attr "type" "dsp32,dsp32shiftimm,dsp32shiftimm")])
4171 (define_insn "lshiftv2hi3"
4172 [(set (match_operand:V2HI 0 "register_operand" "=d,d,d")
4174 (lt (match_operand:HI 2 "vec_shift_operand" "d,Ku4,Ks4") (const_int 0))
4175 (lshiftrt:V2HI (match_operand:V2HI 1 "register_operand" "d,d,d")
4177 (ashift:V2HI (match_dup 1) (match_dup 2))))]
4180 %0 = LSHIFT %1 BY %h2 (V)%!
4182 %0 = %1 >> %N2 (V)%!"
4183 [(set_attr "type" "dsp32,dsp32shiftimm,dsp32shiftimm")])
4185 (define_insn "lshifthi3"
4186 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
4188 (lt (match_operand:HI 2 "vec_shift_operand" "d,Ku4,Ks4") (const_int 0))
4189 (lshiftrt:HI (match_operand:HI 1 "register_operand" "d,d,d")
4191 (ashift:HI (match_dup 1) (match_dup 2))))]
4194 %0 = LSHIFT %1 BY %h2 (V)%!
4196 %0 = %1 >> %N2 (V)%!"
4197 [(set_attr "type" "dsp32,dsp32shiftimm,dsp32shiftimm")])
4199 ;; Load without alignment exception (masking off low bits)
4201 (define_insn "loadbytes"
4202 [(set (match_operand:SI 0 "register_operand" "=d")
4203 (mem:SI (and:SI (match_operand:SI 1 "register_operand" "b")
4206 "DISALGNEXCPT || %0 = [%1];"
4207 [(set_attr "type" "mcld")
4208 (set_attr "length" "8")])