1 ;;- Machine description for GNU compiler, ns32000 Version
2 ;; Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc.
3 ;; Contributed by Michael Tiemann (tiemann@cygnus.com)
5 ;; This file is part of GNU CC.
7 ;; GNU CC is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; GNU CC is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU CC; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
20 ;; Boston, MA 02111-1307, USA.
24 ;; Insert no-op between an insn with memory read-write operands
25 ;; following by a scale-indexing operation.
26 ;; The Sequent assembler does not allow addresses to be used
27 ;; except in insns which explicitly compute an effective address.
28 ;; I.e., one cannot say "cmpd _p,@_x"
29 ;; Implement unsigned multiplication??
31 ;;- Instruction patterns. When multiple patterns apply,
32 ;;- the first one in the file is chosen.
34 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
36 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
37 ;;- updates for most instructions.
39 ;; We don't want to allow a constant operand for test insns because
40 ;; (set (cc0) (const_int foo)) has no mode information. Such insns will
41 ;; be folded while optimizing anyway.
45 (match_operand:SI 0 "nonimmediate_operand" "rm"))]
48 { cc_status.flags |= CC_REVERSED;
49 operands[1] = const0_rtx;
50 return \"cmpqd %1,%0\"; }")
54 (match_operand:HI 0 "nonimmediate_operand" "g"))]
57 { cc_status.flags |= CC_REVERSED;
58 operands[1] = const0_rtx;
59 return \"cmpqw %1,%0\"; }")
63 (match_operand:QI 0 "nonimmediate_operand" "g"))]
66 { cc_status.flags |= CC_REVERSED;
67 operands[1] = const0_rtx;
68 return \"cmpqb %1,%0\"; }")
72 (match_operand:DF 0 "general_operand" "fmF"))]
75 { cc_status.flags |= CC_REVERSED;
76 operands[1] = CONST0_RTX (DFmode);
77 return \"cmpl %1,%0\"; }")
81 (match_operand:SF 0 "general_operand" "fmF"))]
84 { cc_status.flags |= CC_REVERSED;
85 operands[1] = CONST0_RTX (SFmode);
86 return \"cmpf %1,%0\"; }")
90 (compare (match_operand:SI 0 "nonimmediate_operand" "rmn")
91 (match_operand:SI 1 "general_operand" "rmn")))]
95 if (GET_CODE (operands[1]) == CONST_INT)
97 int i = INTVAL (operands[1]);
98 if (i <= 7 && i >= -8)
100 cc_status.flags |= CC_REVERSED;
101 return \"cmpqd %1,%0\";
104 cc_status.flags &= ~CC_REVERSED;
105 if (GET_CODE (operands[0]) == CONST_INT)
107 int i = INTVAL (operands[0]);
108 if (i <= 7 && i >= -8)
109 return \"cmpqd %0,%1\";
111 return \"cmpd %0,%1\";
116 (compare (match_operand:HI 0 "nonimmediate_operand" "g")
117 (match_operand:HI 1 "general_operand" "g")))]
121 if (GET_CODE (operands[1]) == CONST_INT)
123 short i = INTVAL (operands[1]);
124 if (i <= 7 && i >= -8)
126 cc_status.flags |= CC_REVERSED;
127 if (INTVAL (operands[1]) > 7)
128 operands[1] = gen_rtx(CONST_INT, VOIDmode, i);
129 return \"cmpqw %1,%0\";
132 cc_status.flags &= ~CC_REVERSED;
133 if (GET_CODE (operands[0]) == CONST_INT)
135 short i = INTVAL (operands[0]);
136 if (i <= 7 && i >= -8)
138 if (INTVAL (operands[0]) > 7)
139 operands[0] = gen_rtx(CONST_INT, VOIDmode, i);
140 return \"cmpqw %0,%1\";
143 return \"cmpw %0,%1\";
148 (compare (match_operand:QI 0 "nonimmediate_operand" "g")
149 (match_operand:QI 1 "general_operand" "g")))]
153 if (GET_CODE (operands[1]) == CONST_INT)
155 char i = INTVAL (operands[1]);
156 if (i <= 7 && i >= -8)
158 cc_status.flags |= CC_REVERSED;
159 if (INTVAL (operands[1]) > 7)
160 operands[1] = gen_rtx(CONST_INT, VOIDmode, i);
161 return \"cmpqb %1,%0\";
164 cc_status.flags &= ~CC_REVERSED;
165 if (GET_CODE (operands[0]) == CONST_INT)
167 char i = INTVAL (operands[0]);
168 if (i <= 7 && i >= -8)
170 if (INTVAL (operands[0]) > 7)
171 operands[0] = gen_rtx(CONST_INT, VOIDmode, i);
172 return \"cmpqb %0,%1\";
175 return \"cmpb %0,%1\";
180 (compare (match_operand:DF 0 "general_operand" "fmF")
181 (match_operand:DF 1 "general_operand" "fmF")))]
187 (compare (match_operand:SF 0 "general_operand" "fmF")
188 (match_operand:SF 1 "general_operand" "fmF")))]
193 [(set (match_operand:DF 0 "general_operand" "=fg<")
194 (match_operand:DF 1 "general_operand" "fFg"))]
198 if (FP_REG_P (operands[0]))
200 if (FP_REG_P (operands[1]) || GET_CODE (operands[1]) == CONST_DOUBLE)
201 return \"movl %1,%0\";
202 if (REG_P (operands[1]))
205 xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
206 output_asm_insn (\"movd %1,tos\", xoperands);
207 output_asm_insn (\"movd %1,tos\", operands);
208 return \"movl tos,%0\";
210 return \"movl %1,%0\";
212 else if (FP_REG_P (operands[1]))
214 if (REG_P (operands[0]))
216 output_asm_insn (\"movl %1,tos\;movd tos,%0\", operands);
217 operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
218 return \"movd tos,%0\";
221 return \"movl %1,%0\";
223 return output_move_double (operands);
227 [(set (match_operand:SF 0 "general_operand" "=fg<")
228 (match_operand:SF 1 "general_operand" "fFg"))]
232 if (FP_REG_P (operands[0]))
234 if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 8)
235 return \"movd %1,tos\;movf tos,%0\";
237 return \"movf %1,%0\";
239 else if (FP_REG_P (operands[1]))
241 if (REG_P (operands[0]))
242 return \"movf %1,tos\;movd tos,%0\";
243 return \"movf %1,%0\";
245 #if 0 /* Someone suggested this for the Sequent. Is it needed? */
246 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
247 return \"movf %1,%0\";
249 /* There was a #if 0 around this, but that was erroneous
250 for many machines -- rms. */
251 #ifndef MOVD_FLOAT_OK
252 /* GAS understands floating constants in ordinary movd instructions
253 but other assemblers might object. */
254 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
256 union {int i[2]; float f; double d;} convrt;
257 convrt.i[0] = CONST_DOUBLE_LOW (operands[1]);
258 convrt.i[1] = CONST_DOUBLE_HIGH (operands[1]);
261 /* Is there a better machine-independent way to to this? */
262 operands[1] = gen_rtx (CONST_INT, VOIDmode, convrt.i[0]);
263 return \"movd %1,%0\";
266 else return \"movd %1,%0\";
270 [(set (match_operand:TI 0 "memory_operand" "=m")
271 (match_operand:TI 1 "memory_operand" "m"))]
276 [(set (match_operand:DI 0 "general_operand" "=g<,*f,g")
277 (match_operand:DI 1 "general_operand" "gF,g,*f"))]
281 if (FP_REG_P (operands[0]))
283 if (FP_REG_P (operands[1]) || GET_CODE (operands[1]) == CONST_DOUBLE)
284 return \"movl %1,%0\";
285 if (REG_P (operands[1]))
288 xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
289 output_asm_insn (\"movd %1,tos\", xoperands);
290 output_asm_insn (\"movd %1,tos\", operands);
291 return \"movl tos,%0\";
293 return \"movl %1,%0\";
295 else if (FP_REG_P (operands[1]))
297 if (REG_P (operands[0]))
299 output_asm_insn (\"movl %1,tos\;movd tos,%0\", operands);
300 operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
301 return \"movd tos,%0\";
304 return \"movl %1,%0\";
306 return output_move_double (operands);
309 ;; This special case must precede movsi.
312 (match_operand:SI 0 "general_operand" "rmn"))]
317 [(set (match_operand:SI 0 "general_operand" "=g<,g<,*f,g,x")
318 (match_operand:SI 1 "general_operand" "g,?xy,g,*f,rmn"))]
322 extern int flag_pic; \
324 if (FP_REG_P (operands[0]))
326 if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 8)
327 return \"movd %1,tos\;movf tos,%0\";
329 return \"movf %1,%0\";
331 else if (FP_REG_P (operands[1]))
333 if (REG_P (operands[0]))
334 return \"movf %1,tos\;movd tos,%0\";
335 return \"movf %1,%0\";
337 if (GET_CODE (operands[0]) == REG
338 && REGNO (operands[0]) == FRAME_POINTER_REGNUM)
339 return \"lprd fp,%1\";
340 if (GET_CODE (operands[1]) == CONST_DOUBLE)
342 = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (operands[1]));
343 if (GET_CODE (operands[1]) == CONST_INT)
345 int i = INTVAL (operands[1]);
348 if (i <= 7 && i >= -8)
349 return \"movqd %1,%0\";
350 if (i <= 0x1fffffff && i >= -0x20000000)
351 #if defined (GNX_V3) || defined (UTEK_ASM)
352 return \"addr %c1,%0\";
354 return \"addr @%c1,%0\";
356 return \"movd %$%1,%0\";
359 return output_move_dconst(i, \"%$%1,%0\");
361 else if (GET_CODE (operands[1]) == CONST && ! flag_pic)
363 /* Must contain symbols so we don`t know how big it is. In
364 * that case addr might lead to overflow. For PIC symbolic
365 * address loads always have to be done with addr.
367 return \"movd %$%1,%0\";
369 else if (GET_CODE (operands[1]) == REG)
371 if (REGNO (operands[1]) < 16)
372 return \"movd %1,%0\";
373 else if (REGNO (operands[1]) == FRAME_POINTER_REGNUM)
375 if (GET_CODE(operands[0]) == REG)
376 return \"sprd fp,%0\";
378 return \"addr 0(fp),%0\" ;
380 else if (REGNO (operands[1]) == STACK_POINTER_REGNUM)
382 if (GET_CODE(operands[0]) == REG)
383 return \"sprd sp,%0\";
385 return \"addr 0(sp),%0\" ;
389 else if (GET_CODE (operands[1]) == MEM)
390 return \"movd %1,%0\";
392 /* Check if this effective address can be
393 calculated faster by pulling it apart. */
394 if (REG_P (operands[0])
395 && GET_CODE (operands[1]) == MULT
396 && GET_CODE (XEXP (operands[1], 1)) == CONST_INT
397 && (INTVAL (XEXP (operands[1], 1)) == 2
398 || INTVAL (XEXP (operands[1], 1)) == 4))
401 xoperands[0] = operands[0];
402 xoperands[1] = XEXP (operands[1], 0);
403 xoperands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (XEXP (operands[1], 1)) >> 1);
404 return output_shift_insn (xoperands);
406 return \"addr %a1,%0\";
410 [(set (match_operand:HI 0 "general_operand" "=g<,*f,g")
411 (match_operand:HI 1 "general_operand" "g,g,*f"))]
415 if (GET_CODE (operands[1]) == CONST_INT)
417 short i = INTVAL (operands[1]);
418 if (i <= 7 && i >= -8)
420 if (INTVAL (operands[1]) > 7)
422 gen_rtx (CONST_INT, VOIDmode, i);
423 return \"movqw %1,%0\";
425 return \"movw %1,%0\";
427 else if (FP_REG_P (operands[0]))
429 if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 8)
430 return \"movwf %1,tos\;movf tos,%0\";
432 return \"movwf %1,%0\";
434 else if (FP_REG_P (operands[1]))
436 if (REG_P (operands[0]))
437 return \"movf %1,tos\;movd tos,%0\";
438 return \"movf %1,%0\";
441 return \"movw %1,%0\";
444 (define_insn "movstricthi"
445 [(set (strict_low_part (match_operand:HI 0 "general_operand" "+r"))
446 (match_operand:HI 1 "general_operand" "g"))]
450 if (GET_CODE (operands[1]) == CONST_INT
451 && INTVAL(operands[1]) <= 7 && INTVAL(operands[1]) >= -8)
452 return \"movqw %1,%0\";
453 return \"movw %1,%0\";
457 [(set (match_operand:QI 0 "general_operand" "=g<,*f,g")
458 (match_operand:QI 1 "general_operand" "g,g,*f"))]
461 { if (GET_CODE (operands[1]) == CONST_INT)
463 char char_val = (char)INTVAL (operands[1]);
464 if (char_val <= 7 && char_val >= -8)
466 if (INTVAL (operands[1]) > 7)
468 gen_rtx (CONST_INT, VOIDmode, char_val);
469 return \"movqb %1,%0\";
471 return \"movb %1,%0\";
473 else if (FP_REG_P (operands[0]))
475 if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 8)
476 return \"movbf %1,tos\;movf tos,%0\";
478 return \"movbf %1,%0\";
480 else if (FP_REG_P (operands[1]))
482 if (REG_P (operands[0]))
483 return \"movf %1,tos\;movd tos,%0\";
484 return \"movf %1,%0\";
487 return \"movb %1,%0\";
490 (define_insn "movstrictqi"
491 [(set (strict_low_part (match_operand:QI 0 "general_operand" "+r"))
492 (match_operand:QI 1 "general_operand" "g"))]
496 if (GET_CODE (operands[1]) == CONST_INT
497 && INTVAL(operands[1]) < 8 && INTVAL(operands[1]) > -9)
498 return \"movqb %1,%0\";
499 return \"movb %1,%0\";
502 ;; This is here to accept 4 arguments and pass the first 3 along
503 ;; to the movstrsi1 pattern that really does the work.
504 (define_expand "movstrsi"
505 [(set (match_operand:BLK 0 "general_operand" "=g")
506 (match_operand:BLK 1 "general_operand" "g"))
507 (use (match_operand:SI 2 "general_operand" "rmn"))
508 (match_operand 3 "" "")]
511 emit_insn (gen_movstrsi1 (operands[0], operands[1], operands[2]));
515 ;; The definition of this insn does not really explain what it does,
516 ;; but it should suffice
517 ;; that anything generated as this insn will be recognized as one
518 ;; and that it won't successfully combine with anything.
519 (define_insn "movstrsi1"
520 [(set (match_operand:BLK 0 "general_operand" "=g")
521 (match_operand:BLK 1 "general_operand" "g"))
522 (use (match_operand:SI 2 "general_operand" "rmn"))
525 (clobber (reg:SI 2))]
529 if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
531 operands[0] = XEXP (operands[0], 0);
532 operands[1] = XEXP (operands[1], 0);
533 if (GET_CODE (operands[0]) == MEM)
534 if (GET_CODE (operands[1]) == MEM)
535 output_asm_insn (\"movd %0,r2\;movd %1,r1\", operands);
537 output_asm_insn (\"movd %0,r2\;addr %a1,r1\", operands);
538 else if (GET_CODE (operands[1]) == MEM)
539 output_asm_insn (\"addr %a0,r2\;movd %1,r1\", operands);
541 output_asm_insn (\"addr %a0,r2\;addr %a1,r1\", operands);
544 if (GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) & 0x3) == 0)
546 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) >> 2);
547 if ((unsigned) INTVAL (operands[2]) <= 7)
548 return \"movqd %2,r0\;movsd $0\";
550 return \"movd %2,r0\;movsd $0\";
554 return \"movd %2,r0\;movsb $0\";
557 if (GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) & 0x3) == 0)
559 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) >> 2);
560 if ((unsigned) INTVAL (operands[2]) <= 7)
561 return \"movqd %2,r0\;movsd\";
563 return \"movd %2,r0\;movsd\";
567 return \"movd %2,r0\;movsb\";
572 ;; Extension and truncation insns.
573 ;; Those for integer source operand
574 ;; are ordered widest source type first.
576 (define_insn "truncsiqi2"
577 [(set (match_operand:QI 0 "general_operand" "=g<")
578 (truncate:QI (match_operand:SI 1 "nonimmediate_operand" "rmn")))]
582 (define_insn "truncsihi2"
583 [(set (match_operand:HI 0 "general_operand" "=g<")
584 (truncate:HI (match_operand:SI 1 "nonimmediate_operand" "rmn")))]
588 (define_insn "trunchiqi2"
589 [(set (match_operand:QI 0 "general_operand" "=g<")
590 (truncate:QI (match_operand:HI 1 "nonimmediate_operand" "g")))]
594 (define_insn "extendhisi2"
595 [(set (match_operand:SI 0 "general_operand" "=g<")
596 (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))]
600 (define_insn "extendqihi2"
601 [(set (match_operand:HI 0 "general_operand" "=g<")
602 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))]
606 (define_insn "extendqisi2"
607 [(set (match_operand:SI 0 "general_operand" "=g<")
608 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))]
612 (define_insn "extendsfdf2"
613 [(set (match_operand:DF 0 "general_operand" "=fm<")
614 (float_extend:DF (match_operand:SF 1 "general_operand" "fmF")))]
618 (define_insn "truncdfsf2"
619 [(set (match_operand:SF 0 "general_operand" "=fm<")
620 (float_truncate:SF (match_operand:DF 1 "general_operand" "fmF")))]
624 (define_insn "zero_extendhisi2"
625 [(set (match_operand:SI 0 "general_operand" "=g<")
626 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))]
630 (define_insn "zero_extendqihi2"
631 [(set (match_operand:HI 0 "general_operand" "=g<")
632 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))]
636 (define_insn "zero_extendqisi2"
637 [(set (match_operand:SI 0 "general_operand" "=g<")
638 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))]
642 ;; Fix-to-float conversion insns.
643 ;; Note that the ones that start with SImode come first.
644 ;; That is so that an operand that is a CONST_INT
645 ;; (and therefore lacks a specific machine mode).
646 ;; will be recognized as SImode (which is always valid)
647 ;; rather than as QImode or HImode.
649 ;; Rumor has it that the National part does not correctly convert
650 ;; constant ints to floats. This conversion is therefore disabled.
651 ;; A register must be used to perform the conversion.
653 (define_insn "floatsisf2"
654 [(set (match_operand:SF 0 "general_operand" "=fm<")
655 (float:SF (match_operand:SI 1 "general_operand" "rm")))]
659 (define_insn "floatsidf2"
660 [(set (match_operand:DF 0 "general_operand" "=fm<")
661 (float:DF (match_operand:SI 1 "general_operand" "rm")))]
665 (define_insn "floathisf2"
666 [(set (match_operand:SF 0 "general_operand" "=fm<")
667 (float:SF (match_operand:HI 1 "general_operand" "rm")))]
671 (define_insn "floathidf2"
672 [(set (match_operand:DF 0 "general_operand" "=fm<")
673 (float:DF (match_operand:HI 1 "general_operand" "rm")))]
677 (define_insn "floatqisf2"
678 [(set (match_operand:SF 0 "general_operand" "=fm<")
679 (float:SF (match_operand:QI 1 "general_operand" "rm")))]
683 ; Some assemblers warn that this insn doesn't work.
684 ; Maybe they know something we don't.
685 ;(define_insn "floatqidf2"
686 ; [(set (match_operand:DF 0 "general_operand" "=fm<")
687 ; (float:DF (match_operand:QI 1 "general_operand" "rm")))]
691 ;; Float-to-fix conversion insns.
692 ;; The sequent compiler always generates "trunc" insns.
694 (define_insn "fixsfqi2"
695 [(set (match_operand:QI 0 "general_operand" "=g<")
696 (fix:QI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))]
700 (define_insn "fixsfhi2"
701 [(set (match_operand:HI 0 "general_operand" "=g<")
702 (fix:HI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))]
706 (define_insn "fixsfsi2"
707 [(set (match_operand:SI 0 "general_operand" "=g<")
708 (fix:SI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))]
712 (define_insn "fixdfqi2"
713 [(set (match_operand:QI 0 "general_operand" "=g<")
714 (fix:QI (fix:DF (match_operand:DF 1 "general_operand" "fm"))))]
718 (define_insn "fixdfhi2"
719 [(set (match_operand:HI 0 "general_operand" "=g<")
720 (fix:HI (fix:DF (match_operand:DF 1 "general_operand" "fm"))))]
724 (define_insn "fixdfsi2"
725 [(set (match_operand:SI 0 "general_operand" "=g<")
726 (fix:SI (fix:DF (match_operand:DF 1 "general_operand" "fm"))))]
732 (define_insn "fixunssfqi2"
733 [(set (match_operand:QI 0 "general_operand" "=g<")
734 (unsigned_fix:QI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))]
738 (define_insn "fixunssfhi2"
739 [(set (match_operand:HI 0 "general_operand" "=g<")
740 (unsigned_fix:HI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))]
744 (define_insn "fixunssfsi2"
745 [(set (match_operand:SI 0 "general_operand" "=g<")
746 (unsigned_fix:SI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))]
750 (define_insn "fixunsdfqi2"
751 [(set (match_operand:QI 0 "general_operand" "=g<")
752 (unsigned_fix:QI (fix:DF (match_operand:DF 1 "general_operand" "fm"))))]
756 (define_insn "fixunsdfhi2"
757 [(set (match_operand:HI 0 "general_operand" "=g<")
758 (unsigned_fix:HI (fix:DF (match_operand:DF 1 "general_operand" "fm"))))]
762 (define_insn "fixunsdfsi2"
763 [(set (match_operand:SI 0 "general_operand" "=g<")
764 (unsigned_fix:SI (fix:DF (match_operand:DF 1 "general_operand" "fm"))))]
768 ;;; These are not yet used by GCC
769 (define_insn "fix_truncsfqi2"
770 [(set (match_operand:QI 0 "general_operand" "=g<")
771 (fix:QI (match_operand:SF 1 "general_operand" "fm")))]
775 (define_insn "fix_truncsfhi2"
776 [(set (match_operand:HI 0 "general_operand" "=g<")
777 (fix:HI (match_operand:SF 1 "general_operand" "fm")))]
781 (define_insn "fix_truncsfsi2"
782 [(set (match_operand:SI 0 "general_operand" "=g<")
783 (fix:SI (match_operand:SF 1 "general_operand" "fm")))]
787 (define_insn "fix_truncdfqi2"
788 [(set (match_operand:QI 0 "general_operand" "=g<")
789 (fix:QI (match_operand:DF 1 "general_operand" "fm")))]
793 (define_insn "fix_truncdfhi2"
794 [(set (match_operand:HI 0 "general_operand" "=g<")
795 (fix:HI (match_operand:DF 1 "general_operand" "fm")))]
799 (define_insn "fix_truncdfsi2"
800 [(set (match_operand:SI 0 "general_operand" "=g<")
801 (fix:SI (match_operand:DF 1 "general_operand" "fm")))]
805 ;;- All kinds of add instructions.
807 (define_insn "adddf3"
808 [(set (match_operand:DF 0 "general_operand" "=fm")
809 (plus:DF (match_operand:DF 1 "general_operand" "%0")
810 (match_operand:DF 2 "general_operand" "fmF")))]
815 (define_insn "addsf3"
816 [(set (match_operand:SF 0 "general_operand" "=fm")
817 (plus:SF (match_operand:SF 1 "general_operand" "%0")
818 (match_operand:SF 2 "general_operand" "fmF")))]
825 (match_operand:SI 0 "immediate_operand" "i")))]
826 "GET_CODE (operands[0]) == CONST_INT"
829 #ifndef SEQUENT_ADJUST_STACK
831 if (INTVAL (operands[0]) == 8)
832 return \"cmpd tos,tos\";
833 if (TARGET_32532 || TARGET_32332)
834 if (INTVAL (operands[0]) == 4)
835 return \"cmpqd %$0,tos\";
839 if (INTVAL (operands[0]) < 64 && INTVAL (operands[0]) > -64)
840 return \"adjspb %$%n0\";
841 else if (INTVAL (operands[0]) < 8192 && INTVAL (operands[0]) >= -8192)
842 return \"adjspw %$%n0\";
844 return \"adjspd %$%n0\";
848 [(set (match_operand:SI 0 "general_operand" "=g<")
850 (match_operand:SI 1 "immediate_operand" "i")))]
851 "GET_CODE (operands[1]) == CONST_INT"
855 [(set (match_operand:SI 0 "general_operand" "=g<")
857 (match_operand:SI 1 "immediate_operand" "i")))]
858 "GET_CODE (operands[1]) == CONST_INT"
861 (define_insn "adddi3"
862 [(set (match_operand:DI 0 "general_operand" "=ro")
863 (plus:DI (match_operand:DI 1 "general_operand" "%0")
864 (match_operand:DI 2 "general_operand" "ron")))]
868 rtx low[3], high[3], xops[4];
869 split_di (operands, 3, low, high);
875 if (GET_CODE (xops[2]) == CONST_INT)
877 int i = INTVAL (xops[2]);
879 if (i <= 7 && i >= -8)
883 i = INTVAL (xops[3]);
884 if (i <= 7 && i >= -8)
885 output_asm_insn (\"addqd %$%3,%1\", xops);
887 output_asm_insn (\"addd %$%3,%1\", xops);
891 output_asm_insn (\"addqd %$%2,%0\", xops);
892 output_asm_insn (\"addcd %$%3,%1\", xops);
897 output_asm_insn (\"addd %2,%0\", xops);
898 output_asm_insn (\"addcd %3,%1\", xops);
902 (define_insn "addsi3"
903 [(set (match_operand:SI 0 "general_operand" "=g,=g&<")
904 (plus:SI (match_operand:SI 1 "general_operand" "%0,r")
905 (match_operand:SI 2 "general_operand" "rmn,n")))]
909 if (which_alternative == 1)
911 int i = INTVAL (operands[2]);
912 if (NS32K_DISPLACEMENT_P (i))
913 return \"addr %c2(%1),%0\";
915 return \"movd %1,%0\;addd %2,%0\";
917 if (GET_CODE (operands[2]) == CONST_INT)
919 int i = INTVAL (operands[2]);
921 if (i <= 7 && i >= -8)
922 return \"addqd %2,%0\";
923 else if (! TARGET_32532 && GET_CODE (operands[0]) == REG
924 && i <= 0x1fffffff && i >= -0x20000000)
925 return \"addr %c2(%0),%0\";
927 return \"addd %2,%0\";
930 (define_insn "addhi3"
931 [(set (match_operand:HI 0 "general_operand" "=g")
932 (plus:HI (match_operand:HI 1 "general_operand" "%0")
933 (match_operand:HI 2 "general_operand" "g")))]
936 { if (GET_CODE (operands[2]) == CONST_INT)
938 int i = INTVAL (operands[2]);
939 if (i <= 7 && i >= -8)
940 return \"addqw %2,%0\";
942 return \"addw %2,%0\";
946 [(set (strict_low_part (match_operand:HI 0 "general_operand" "=r"))
947 (plus:HI (match_operand:HI 1 "general_operand" "0")
948 (match_operand:HI 2 "general_operand" "g")))]
952 if (GET_CODE (operands[1]) == CONST_INT
953 && INTVAL (operands[1]) >-9 && INTVAL(operands[1]) < 8)
954 return \"addqw %2,%0\";
955 return \"addw %2,%0\";
958 (define_insn "addqi3"
959 [(set (match_operand:QI 0 "general_operand" "=g")
960 (plus:QI (match_operand:QI 1 "general_operand" "%0")
961 (match_operand:QI 2 "general_operand" "g")))]
964 { if (GET_CODE (operands[2]) == CONST_INT)
966 int i = INTVAL (operands[2]);
967 if (i <= 7 && i >= -8)
968 return \"addqb %2,%0\";
970 return \"addb %2,%0\";
974 [(set (strict_low_part (match_operand:QI 0 "general_operand" "=r"))
975 (plus:QI (match_operand:QI 1 "general_operand" "0")
976 (match_operand:QI 2 "general_operand" "g")))]
980 if (GET_CODE (operands[1]) == CONST_INT
981 && INTVAL (operands[1]) >-9 && INTVAL(operands[1]) < 8)
982 return \"addqb %2,%0\";
983 return \"addb %2,%0\";
986 ;;- All kinds of subtract instructions.
988 (define_insn "subdf3"
989 [(set (match_operand:DF 0 "general_operand" "=fm")
990 (minus:DF (match_operand:DF 1 "general_operand" "0")
991 (match_operand:DF 2 "general_operand" "fmF")))]
995 (define_insn "subsf3"
996 [(set (match_operand:SF 0 "general_operand" "=fm")
997 (minus:SF (match_operand:SF 1 "general_operand" "0")
998 (match_operand:SF 2 "general_operand" "fmF")))]
1004 (minus:SI (reg:SI 17)
1005 (match_operand:SI 0 "immediate_operand" "i")))]
1006 "GET_CODE (operands[0]) == CONST_INT"
1009 if (! TARGET_32532 && GET_CODE(operands[0]) == CONST_INT
1010 && INTVAL(operands[0]) < 64 && INTVAL(operands[0]) > -64)
1011 return \"adjspb %$%0\";
1012 return \"adjspd %$%0\";
1015 (define_insn "subdi3"
1016 [(set (match_operand:DI 0 "general_operand" "=ro")
1017 (minus:DI (match_operand:DI 1 "general_operand" "0")
1018 (match_operand:DI 2 "general_operand" "ron")))]
1022 rtx low[3], high[3], xops[4];
1023 split_di (operands, 3, low, high);
1029 if (GET_CODE (xops[2]) == CONST_INT)
1031 int i = INTVAL (xops[2]);
1033 if (i <= 8 && i >= -7)
1037 i = INTVAL (xops[3]);
1038 if (i <= 8 && i >= -7)
1039 output_asm_insn (\"addqd %$%n3,%1\", xops);
1041 output_asm_insn (\"subd %$%3,%1\", xops);
1045 output_asm_insn (\"addqd %$%n2,%0\", xops);
1046 output_asm_insn (\"subcd %$%3,%1\", xops);
1051 output_asm_insn (\"subd %2,%0\", xops);
1052 output_asm_insn (\"subcd %3,%1\", xops);
1056 (define_insn "subsi3"
1057 [(set (match_operand:SI 0 "general_operand" "=g")
1058 (minus:SI (match_operand:SI 1 "general_operand" "0")
1059 (match_operand:SI 2 "general_operand" "rmn")))]
1062 { if (GET_CODE (operands[2]) == CONST_INT)
1064 int i = INTVAL (operands[2]);
1066 if (i <= 8 && i >= -7)
1067 return \"addqd %$%n2,%0\";
1069 return \"subd %2,%0\";
1072 (define_insn "subhi3"
1073 [(set (match_operand:HI 0 "general_operand" "=g")
1074 (minus:HI (match_operand:HI 1 "general_operand" "0")
1075 (match_operand:HI 2 "general_operand" "g")))]
1078 { if (GET_CODE (operands[2]) == CONST_INT)
1080 int i = INTVAL (operands[2]);
1082 if (i <= 8 && i >= -7)
1083 return \"addqw %$%n2,%0\";
1085 return \"subw %2,%0\";
1089 [(set (strict_low_part (match_operand:HI 0 "general_operand" "=r"))
1090 (minus:HI (match_operand:HI 1 "general_operand" "0")
1091 (match_operand:HI 2 "general_operand" "g")))]
1095 if (GET_CODE (operands[1]) == CONST_INT
1096 && INTVAL (operands[1]) >-8 && INTVAL(operands[1]) < 9)
1097 return \"addqw %$%n2,%0\";
1098 return \"subw %2,%0\";
1101 (define_insn "subqi3"
1102 [(set (match_operand:QI 0 "general_operand" "=g")
1103 (minus:QI (match_operand:QI 1 "general_operand" "0")
1104 (match_operand:QI 2 "general_operand" "g")))]
1107 { if (GET_CODE (operands[2]) == CONST_INT)
1109 int i = INTVAL (operands[2]);
1111 if (i <= 8 && i >= -7)
1112 return \"addqb %$%n2,%0\";
1114 return \"subb %2,%0\";
1118 [(set (strict_low_part (match_operand:QI 0 "general_operand" "=r"))
1119 (minus:QI (match_operand:QI 1 "general_operand" "0")
1120 (match_operand:QI 2 "general_operand" "g")))]
1124 if (GET_CODE (operands[1]) == CONST_INT
1125 && INTVAL (operands[1]) >-8 && INTVAL(operands[1]) < 9)
1126 return \"addqb %$%n2,%0\";
1127 return \"subb %2,%0\";
1130 ;;- Multiply instructions.
1132 (define_insn "muldf3"
1133 [(set (match_operand:DF 0 "general_operand" "=fm")
1134 (mult:DF (match_operand:DF 1 "general_operand" "%0")
1135 (match_operand:DF 2 "general_operand" "fmF")))]
1139 (define_insn "mulsf3"
1140 [(set (match_operand:SF 0 "general_operand" "=fm")
1141 (mult:SF (match_operand:SF 1 "general_operand" "%0")
1142 (match_operand:SF 2 "general_operand" "fmF")))]
1146 (define_insn "mulsi3"
1147 [(set (match_operand:SI 0 "general_operand" "=g")
1148 (mult:SI (match_operand:SI 1 "general_operand" "%0")
1149 (match_operand:SI 2 "general_operand" "rmn")))]
1153 (define_insn "mulhi3"
1154 [(set (match_operand:HI 0 "general_operand" "=g")
1155 (mult:HI (match_operand:HI 1 "general_operand" "%0")
1156 (match_operand:HI 2 "general_operand" "g")))]
1160 (define_insn "mulqi3"
1161 [(set (match_operand:QI 0 "general_operand" "=g")
1162 (mult:QI (match_operand:QI 1 "general_operand" "%0")
1163 (match_operand:QI 2 "general_operand" "g")))]
1167 (define_insn "umulsidi3"
1168 [(set (match_operand:DI 0 "general_operand" "=g")
1169 (mult:DI (zero_extend:DI
1170 (match_operand:SI 1 "nonimmediate_operand" "0"))
1172 (match_operand:SI 2 "nonimmediate_operand" "rmn"))))]
1176 ;;- Divide instructions.
1178 (define_insn "divdf3"
1179 [(set (match_operand:DF 0 "general_operand" "=fm")
1180 (div:DF (match_operand:DF 1 "general_operand" "0")
1181 (match_operand:DF 2 "general_operand" "fmF")))]
1185 (define_insn "divsf3"
1186 [(set (match_operand:SF 0 "general_operand" "=fm")
1187 (div:SF (match_operand:SF 1 "general_operand" "0")
1188 (match_operand:SF 2 "general_operand" "fmF")))]
1192 (define_insn "divsi3"
1193 [(set (match_operand:SI 0 "general_operand" "=g")
1194 (div:SI (match_operand:SI 1 "general_operand" "0")
1195 (match_operand:SI 2 "general_operand" "rmn")))]
1199 (define_insn "divhi3"
1200 [(set (match_operand:HI 0 "general_operand" "=g")
1201 (div:HI (match_operand:HI 1 "general_operand" "0")
1202 (match_operand:HI 2 "general_operand" "g")))]
1206 (define_insn "divqi3"
1207 [(set (match_operand:QI 0 "general_operand" "=g")
1208 (div:QI (match_operand:QI 1 "general_operand" "0")
1209 (match_operand:QI 2 "general_operand" "g")))]
1213 (define_insn "udivsi3"
1214 [(set (match_operand:SI 0 "register_operand" "=r")
1215 (udiv:SI (subreg:SI (match_operand:DI 1 "reg_or_mem_operand" "0") 0)
1216 (match_operand:SI 2 "general_operand" "rmn")))]
1220 operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
1221 return \"deid %2,%0\;movd %1,%0\";
1224 (define_insn "udivhi3"
1225 [(set (match_operand:HI 0 "register_operand" "=r")
1226 (udiv:HI (subreg:HI (match_operand:DI 1 "reg_or_mem_operand" "0") 0)
1227 (match_operand:HI 2 "general_operand" "g")))]
1231 operands[1] = gen_rtx (REG, HImode, REGNO (operands[0]) + 1);
1232 return \"deiw %2,%0\;movw %1,%0\";
1235 (define_insn "udivqi3"
1236 [(set (match_operand:QI 0 "register_operand" "=r")
1237 (udiv:QI (subreg:QI (match_operand:DI 1 "reg_or_mem_operand" "0") 0)
1238 (match_operand:QI 2 "general_operand" "g")))]
1242 operands[1] = gen_rtx (REG, QImode, REGNO (operands[0]) + 1);
1243 return \"deib %2,%0\;movb %1,%0\";
1246 ;; Remainder instructions.
1248 (define_insn "modsi3"
1249 [(set (match_operand:SI 0 "general_operand" "=g")
1250 (mod:SI (match_operand:SI 1 "general_operand" "0")
1251 (match_operand:SI 2 "general_operand" "rmn")))]
1255 (define_insn "modhi3"
1256 [(set (match_operand:HI 0 "general_operand" "=g")
1257 (mod:HI (match_operand:HI 1 "general_operand" "0")
1258 (match_operand:HI 2 "general_operand" "g")))]
1262 (define_insn "modqi3"
1263 [(set (match_operand:QI 0 "general_operand" "=g")
1264 (mod:QI (match_operand:QI 1 "general_operand" "0")
1265 (match_operand:QI 2 "general_operand" "g")))]
1269 (define_insn "umodsi3"
1270 [(set (match_operand:SI 0 "register_operand" "=r")
1271 (umod:SI (subreg:SI (match_operand:DI 1 "reg_or_mem_operand" "0") 0)
1272 (match_operand:SI 2 "general_operand" "rmn")))]
1276 (define_insn "umodhi3"
1277 [(set (match_operand:HI 0 "register_operand" "=r")
1278 (umod:HI (subreg:HI (match_operand:DI 1 "reg_or_mem_operand" "0") 0)
1279 (match_operand:HI 2 "general_operand" "g")))]
1283 (define_insn "umodqi3"
1284 [(set (match_operand:QI 0 "register_operand" "=r")
1285 (umod:QI (subreg:QI (match_operand:DI 1 "reg_or_mem_operand" "0") 0)
1286 (match_operand:QI 2 "general_operand" "g")))]
1290 ; This isn't be usable in its current form.
1291 ;(define_insn "udivmoddisi4"
1292 ; [(set (subreg:SI (match_operand:DI 0 "general_operand" "=r") 1)
1293 ; (udiv:SI (match_operand:DI 1 "general_operand" "0")
1294 ; (match_operand:SI 2 "general_operand" "rmn")))
1295 ; (set (subreg:SI (match_dup 0) 0)
1296 ; (umod:SI (match_dup 1) (match_dup 2)))]
1300 ;;- Logical Instructions: AND
1302 (define_insn "andsi3"
1303 [(set (match_operand:SI 0 "general_operand" "=g")
1304 (and:SI (match_operand:SI 1 "general_operand" "%0")
1305 (match_operand:SI 2 "general_operand" "rmn")))]
1309 if (GET_CODE (operands[2]) == CONST_INT)
1311 if ((INTVAL (operands[2]) | 0xff) == 0xffffffff)
1313 if (INTVAL (operands[2]) == 0xffffff00)
1314 return \"movqb %$0,%0\";
1317 operands[2] = gen_rtx (CONST_INT, VOIDmode,
1318 INTVAL (operands[2]) & 0xff);
1319 return \"andb %2,%0\";
1322 if ((INTVAL (operands[2]) | 0xffff) == 0xffffffff)
1324 if (INTVAL (operands[2]) == 0xffff0000)
1325 return \"movqw %$0,%0\";
1328 operands[2] = gen_rtx (CONST_INT, VOIDmode,
1329 INTVAL (operands[2]) & 0xffff);
1330 return \"andw %2,%0\";
1334 return \"andd %2,%0\";
1337 (define_insn "andhi3"
1338 [(set (match_operand:HI 0 "general_operand" "=g")
1339 (and:HI (match_operand:HI 1 "general_operand" "%0")
1340 (match_operand:HI 2 "general_operand" "g")))]
1344 if (GET_CODE (operands[2]) == CONST_INT
1345 && (INTVAL (operands[2]) | 0xff) == 0xffffffff)
1347 if (INTVAL (operands[2]) == 0xffffff00)
1348 return \"movqb %$0,%0\";
1351 operands[2] = gen_rtx (CONST_INT, VOIDmode,
1352 INTVAL (operands[2]) & 0xff);
1353 return \"andb %2,%0\";
1356 return \"andw %2,%0\";
1359 (define_insn "andqi3"
1360 [(set (match_operand:QI 0 "general_operand" "=g")
1361 (and:QI (match_operand:QI 1 "general_operand" "%0")
1362 (match_operand:QI 2 "general_operand" "g")))]
1367 [(set (match_operand:SI 0 "general_operand" "=g")
1368 (and:SI (not:SI (match_operand:SI 1 "general_operand" "rmn"))
1369 (match_operand:SI 2 "general_operand" "0")))]
1374 [(set (match_operand:HI 0 "general_operand" "=g")
1375 (and:HI (not:HI (match_operand:HI 1 "general_operand" "g"))
1376 (match_operand:HI 2 "general_operand" "0")))]
1381 [(set (match_operand:QI 0 "general_operand" "=g")
1382 (and:QI (not:QI (match_operand:QI 1 "general_operand" "g"))
1383 (match_operand:QI 2 "general_operand" "0")))]
1387 ;;- Bit set instructions.
1389 (define_insn "iorsi3"
1390 [(set (match_operand:SI 0 "general_operand" "=g")
1391 (ior:SI (match_operand:SI 1 "general_operand" "%0")
1392 (match_operand:SI 2 "general_operand" "rmn")))]
1396 if (GET_CODE (operands[2]) == CONST_INT) {
1397 if ((INTVAL (operands[2]) & 0xffffff00) == 0)
1398 return \"orb %2,%0\";
1399 if ((INTVAL (operands[2]) & 0xffff0000) == 0)
1400 return \"orw %2,%0\";
1402 return \"ord %2,%0\";
1405 (define_insn "iorhi3"
1406 [(set (match_operand:HI 0 "general_operand" "=g")
1407 (ior:HI (match_operand:HI 1 "general_operand" "%0")
1408 (match_operand:HI 2 "general_operand" "g")))]
1412 if (GET_CODE(operands[2]) == CONST_INT &&
1413 (INTVAL(operands[2]) & 0xffffff00) == 0)
1414 return \"orb %2,%0\";
1415 return \"orw %2,%0\";
1418 (define_insn "iorqi3"
1419 [(set (match_operand:QI 0 "general_operand" "=g")
1420 (ior:QI (match_operand:QI 1 "general_operand" "%0")
1421 (match_operand:QI 2 "general_operand" "g")))]
1425 ;;- xor instructions.
1427 (define_insn "xorsi3"
1428 [(set (match_operand:SI 0 "general_operand" "=g")
1429 (xor:SI (match_operand:SI 1 "general_operand" "%0")
1430 (match_operand:SI 2 "general_operand" "rmn")))]
1434 if (GET_CODE (operands[2]) == CONST_INT) {
1435 if ((INTVAL (operands[2]) & 0xffffff00) == 0)
1436 return \"xorb %2,%0\";
1437 if ((INTVAL (operands[2]) & 0xffff0000) == 0)
1438 return \"xorw %2,%0\";
1440 return \"xord %2,%0\";
1443 (define_insn "xorhi3"
1444 [(set (match_operand:HI 0 "general_operand" "=g")
1445 (xor:HI (match_operand:HI 1 "general_operand" "%0")
1446 (match_operand:HI 2 "general_operand" "g")))]
1450 if (GET_CODE(operands[2]) == CONST_INT &&
1451 (INTVAL(operands[2]) & 0xffffff00) == 0)
1452 return \"xorb %2,%0\";
1453 return \"xorw %2,%0\";
1456 (define_insn "xorqi3"
1457 [(set (match_operand:QI 0 "general_operand" "=g")
1458 (xor:QI (match_operand:QI 1 "general_operand" "%0")
1459 (match_operand:QI 2 "general_operand" "g")))]
1463 (define_insn "negdf2"
1464 [(set (match_operand:DF 0 "general_operand" "=fm<")
1465 (neg:DF (match_operand:DF 1 "general_operand" "fmF")))]
1469 (define_insn "negsf2"
1470 [(set (match_operand:SF 0 "general_operand" "=fm<")
1471 (neg:SF (match_operand:SF 1 "general_operand" "fmF")))]
1475 (define_insn "negdi2"
1476 [(set (match_operand:DI 0 "general_operand" "=ro")
1477 (neg:DI (match_operand:DI 1 "general_operand" "ro")))]
1481 rtx low[2], high[2], xops[4];
1482 split_di (operands, 2, low, high);
1488 if (rtx_equal_p (operands[0], operands[1]))
1490 output_asm_insn (\"negd %3,%1\", xops);
1491 output_asm_insn (\"negd %2,%0\", xops);
1492 output_asm_insn (\"subcd %$0,%1\", xops);
1496 output_asm_insn (\"negd %2,%0\", xops);
1497 output_asm_insn (\"movqd %$0,%1\", xops);
1498 output_asm_insn (\"subcd %3,%1\", xops);
1503 (define_insn "negsi2"
1504 [(set (match_operand:SI 0 "general_operand" "=g<")
1505 (neg:SI (match_operand:SI 1 "general_operand" "rmn")))]
1509 (define_insn "neghi2"
1510 [(set (match_operand:HI 0 "general_operand" "=g<")
1511 (neg:HI (match_operand:HI 1 "general_operand" "g")))]
1515 (define_insn "negqi2"
1516 [(set (match_operand:QI 0 "general_operand" "=g<")
1517 (neg:QI (match_operand:QI 1 "general_operand" "g")))]
1521 (define_insn "one_cmplsi2"
1522 [(set (match_operand:SI 0 "general_operand" "=g<")
1523 (not:SI (match_operand:SI 1 "general_operand" "rmn")))]
1527 (define_insn "one_cmplhi2"
1528 [(set (match_operand:HI 0 "general_operand" "=g<")
1529 (not:HI (match_operand:HI 1 "general_operand" "g")))]
1533 (define_insn "one_cmplqi2"
1534 [(set (match_operand:QI 0 "general_operand" "=g<")
1535 (not:QI (match_operand:QI 1 "general_operand" "g")))]
1539 ;; arithmetic left and right shift operations
1540 ;; on the 32532 we will always use lshd for arithmetic left shifts,
1541 ;; because it is three times faster. Broken programs which
1542 ;; use negative shift counts are probably broken differently
1545 ;; alternative 0 never matches on the 32532
1546 (define_insn "ashlsi3"
1547 [(set (match_operand:SI 0 "general_operand" "=g,g")
1548 (ashift:SI (match_operand:SI 1 "general_operand" "r,0")
1549 (match_operand:SI 2 "general_operand" "I,rmn")))]
1553 return \"lshd %2,%0\";
1555 return output_shift_insn (operands);
1558 (define_insn "ashlhi3"
1559 [(set (match_operand:HI 0 "general_operand" "=g")
1560 (ashift:HI (match_operand:HI 1 "general_operand" "0")
1561 (match_operand:SI 2 "general_operand" "rmn")))]
1564 { if (GET_CODE (operands[2]) == CONST_INT)
1566 if (INTVAL (operands[2]) == 1)
1567 return \"addw %0,%0\";
1568 else if (! TARGET_32532 && INTVAL (operands[2]) == 2)
1569 return \"addw %0,%0\;addw %0,%0\";
1572 return \"lshw %2,%0\";
1574 return \"ashw %2,%0\";
1577 (define_insn "ashlqi3"
1578 [(set (match_operand:QI 0 "general_operand" "=g")
1579 (ashift:QI (match_operand:QI 1 "general_operand" "0")
1580 (match_operand:SI 2 "general_operand" "rmn")))]
1583 { if (GET_CODE (operands[2]) == CONST_INT)
1585 if (INTVAL (operands[2]) == 1)
1586 return \"addb %0,%0\";
1587 else if (! TARGET_32532 && INTVAL (operands[2]) == 2)
1588 return \"addb %0,%0\;addb %0,%0\";
1591 return \"lshb %2,%0\";
1593 return \"ashb %2,%0\";
1596 ;; Arithmetic right shift on the 32k works by negating the shift count.
1597 (define_expand "ashrsi3"
1598 [(set (match_operand:SI 0 "general_operand" "=g")
1599 (ashiftrt:SI (match_operand:SI 1 "general_operand" "g")
1600 (match_operand:SI 2 "general_operand" "g")))]
1604 if (GET_CODE (operands[2]) != CONST_INT)
1605 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1609 [(set (match_operand:SI 0 "general_operand" "=g")
1610 (ashiftrt:SI (match_operand:SI 1 "general_operand" "0")
1611 (match_operand:SI 2 "immediate_operand" "i")))]
1616 [(set (match_operand:SI 0 "general_operand" "=g")
1617 (ashiftrt:SI (match_operand:SI 1 "general_operand" "0")
1618 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1622 (define_expand "ashrhi3"
1623 [(set (match_operand:HI 0 "general_operand" "=g")
1624 (ashiftrt:HI (match_operand:HI 1 "general_operand" "g")
1625 (match_operand:SI 2 "general_operand" "g")))]
1629 if (GET_CODE (operands[2]) != CONST_INT)
1630 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1634 [(set (match_operand:HI 0 "general_operand" "=g")
1635 (ashiftrt:HI (match_operand:HI 1 "general_operand" "0")
1636 (match_operand:SI 2 "immediate_operand" "i")))]
1641 [(set (match_operand:HI 0 "general_operand" "=g")
1642 (ashiftrt:HI (match_operand:HI 1 "general_operand" "0")
1643 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1647 (define_expand "ashrqi3"
1648 [(set (match_operand:QI 0 "general_operand" "=g")
1649 (ashiftrt:QI (match_operand:QI 1 "general_operand" "g")
1650 (match_operand:SI 2 "general_operand" "g")))]
1654 if (GET_CODE (operands[2]) != CONST_INT)
1655 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1659 [(set (match_operand:QI 0 "general_operand" "=g")
1660 (ashiftrt:QI (match_operand:QI 1 "general_operand" "0")
1661 (match_operand:SI 2 "immediate_operand" "i")))]
1666 [(set (match_operand:QI 0 "general_operand" "=g")
1667 (ashiftrt:QI (match_operand:QI 1 "general_operand" "0")
1668 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1672 ;; logical shift instructions
1674 ;; Logical right shift on the 32k works by negating the shift count.
1675 (define_expand "lshrsi3"
1676 [(set (match_operand:SI 0 "general_operand" "=g")
1677 (lshiftrt:SI (match_operand:SI 1 "general_operand" "g")
1678 (match_operand:SI 2 "general_operand" "g")))]
1682 if (GET_CODE (operands[2]) != CONST_INT)
1683 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1687 [(set (match_operand:SI 0 "general_operand" "=g")
1688 (lshiftrt:SI (match_operand:SI 1 "general_operand" "0")
1689 (match_operand:SI 2 "immediate_operand" "i")))]
1694 [(set (match_operand:SI 0 "general_operand" "=g")
1695 (lshiftrt:SI (match_operand:SI 1 "general_operand" "0")
1696 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1700 (define_expand "lshrhi3"
1701 [(set (match_operand:HI 0 "general_operand" "=g")
1702 (lshiftrt:HI (match_operand:HI 1 "general_operand" "g")
1703 (match_operand:SI 2 "general_operand" "g")))]
1707 if (GET_CODE (operands[2]) != CONST_INT)
1708 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1712 [(set (match_operand:HI 0 "general_operand" "=g")
1713 (lshiftrt:HI (match_operand:HI 1 "general_operand" "0")
1714 (match_operand:SI 2 "immediate_operand" "i")))]
1719 [(set (match_operand:HI 0 "general_operand" "=g")
1720 (lshiftrt:HI (match_operand:HI 1 "general_operand" "0")
1721 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1725 (define_expand "lshrqi3"
1726 [(set (match_operand:QI 0 "general_operand" "=g")
1727 (lshiftrt:QI (match_operand:QI 1 "general_operand" "g")
1728 (match_operand:SI 2 "general_operand" "g")))]
1732 if (GET_CODE (operands[2]) != CONST_INT)
1733 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1737 [(set (match_operand:QI 0 "general_operand" "=g")
1738 (lshiftrt:QI (match_operand:QI 1 "general_operand" "0")
1739 (match_operand:SI 2 "immediate_operand" "i")))]
1744 [(set (match_operand:QI 0 "general_operand" "=g")
1745 (lshiftrt:QI (match_operand:QI 1 "general_operand" "0")
1746 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1750 ;; Rotate instructions
1752 (define_insn "rotlsi3"
1753 [(set (match_operand:SI 0 "general_operand" "=g")
1754 (rotate:SI (match_operand:SI 1 "general_operand" "0")
1755 (match_operand:SI 2 "general_operand" "rmn")))]
1759 (define_insn "rotlhi3"
1760 [(set (match_operand:HI 0 "general_operand" "=g")
1761 (rotate:HI (match_operand:HI 1 "general_operand" "0")
1762 (match_operand:SI 2 "general_operand" "rmn")))]
1766 (define_insn "rotlqi3"
1767 [(set (match_operand:QI 0 "general_operand" "=g")
1768 (rotate:QI (match_operand:QI 1 "general_operand" "0")
1769 (match_operand:SI 2 "general_operand" "rmn")))]
1773 ;; Right rotate on the 32k works by negating the shift count.
1774 (define_expand "rotrsi3"
1775 [(set (match_operand:SI 0 "general_operand" "=g")
1776 (rotatert:SI (match_operand:SI 1 "general_operand" "g")
1777 (match_operand:SI 2 "general_operand" "g")))]
1781 if (GET_CODE (operands[2]) != CONST_INT)
1782 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1786 [(set (match_operand:SI 0 "general_operand" "=g")
1787 (rotatert:SI (match_operand:SI 1 "general_operand" "0")
1788 (match_operand:SI 2 "immediate_operand" "i")))]
1793 [(set (match_operand:SI 0 "general_operand" "=g")
1794 (rotatert:SI (match_operand:SI 1 "general_operand" "0")
1795 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1799 (define_expand "rotrhi3"
1800 [(set (match_operand:HI 0 "general_operand" "=g")
1801 (rotatert:HI (match_operand:HI 1 "general_operand" "g")
1802 (match_operand:SI 2 "general_operand" "g")))]
1806 if (GET_CODE (operands[2]) != CONST_INT)
1807 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1811 [(set (match_operand:HI 0 "general_operand" "=g")
1812 (rotatert:HI (match_operand:HI 1 "general_operand" "0")
1813 (match_operand:SI 2 "immediate_operand" "i")))]
1818 [(set (match_operand:HI 0 "general_operand" "=g")
1819 (rotatert:HI (match_operand:HI 1 "general_operand" "0")
1820 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1824 (define_expand "rotrqi3"
1825 [(set (match_operand:QI 0 "general_operand" "=g")
1826 (rotatert:QI (match_operand:QI 1 "general_operand" "g")
1827 (match_operand:SI 2 "general_operand" "g")))]
1831 if (GET_CODE (operands[2]) != CONST_INT)
1832 operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2]));
1836 [(set (match_operand:QI 0 "general_operand" "=g")
1837 (rotatert:QI (match_operand:QI 1 "general_operand" "0")
1838 (match_operand:SI 2 "immediate_operand" "i")))]
1843 [(set (match_operand:QI 0 "general_operand" "=g")
1844 (rotatert:QI (match_operand:QI 1 "general_operand" "0")
1845 (neg:SI (match_operand:SI 2 "general_operand" "r"))))]
1849 ;;- load or push effective address
1850 ;; These come after the move, add, and multiply patterns
1851 ;; because we don't want pushl $1 turned into pushad 1.
1854 [(set (match_operand:SI 0 "general_operand" "=g<")
1855 (match_operand:QI 1 "address_operand" "p"))]
1859 if (REG_P (operands[0])
1860 && GET_CODE (operands[1]) == MULT
1861 && GET_CODE (XEXP (operands[1], 1)) == CONST_INT
1862 && (INTVAL (XEXP (operands[1], 1)) == 2
1863 || INTVAL (XEXP (operands[1], 1)) == 4))
1866 xoperands[0] = operands[0];
1867 xoperands[1] = XEXP (operands[1], 0);
1868 xoperands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (XEXP (operands[1], 1)) >> 1);
1869 return output_shift_insn (xoperands);
1871 return \"addr %a1,%0\";
1874 ;;; Index insns. These are about the same speed as multiply-add counterparts.
1875 ;;; but slower then using power-of-2 shifts if we can use them
1878 ; [(set (match_operand:SI 0 "register_operand" "=r")
1879 ; (plus:SI (match_operand:SI 1 "general_operand" "rmn")
1880 ; (mult:SI (match_operand:SI 2 "register_operand" "0")
1881 ; (plus:SI (match_operand:SI 3 "general_operand" "rmn") (const_int 1)))))]
1882 ; "GET_CODE (operands[3]) != CONST_INT || INTVAL (operands[3]) > 8"
1883 ; "indexd %0,%3,%1")
1886 ; [(set (match_operand:SI 0 "register_operand" "=r")
1887 ; (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "0")
1888 ; (plus:SI (match_operand:SI 2 "general_operand" "rmn") (const_int 1)))
1889 ; (match_operand:SI 3 "general_operand" "rmn")))]
1890 ; "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) > 8"
1891 ; "indexd %0,%2,%3")
1893 ;; Set, Clear, and Invert bit
1896 [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "+g")
1898 (match_operand:SI 1 "general_operand" "rmn"))
1904 [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "+g")
1906 (match_operand:SI 1 "general_operand" "rmn"))
1912 [(set (match_operand:SI 0 "general_operand" "+g")
1913 (xor:SI (ashift:SI (const_int 1)
1914 (match_operand:SI 1 "general_operand" "rmn"))
1920 [(set (match_operand:QI 0 "general_operand" "=g")
1922 (ashift:SI (const_int 1)
1923 (match_operand:QI 1 "general_operand" "rmn")) 0)
1928 ;; Recognize jbs and jbc instructions.
1932 (zero_extract (match_operand:SI 0 "general_operand" "rm")
1934 (match_operand:SI 1 "general_operand" "g")))]
1937 { cc_status.flags = CC_Z_IN_F;
1938 return \"tbitd %1,%0\";
1941 ;; extract(base, width, offset)
1942 ;; Signed bitfield extraction is not supported in hardware on the
1943 ;; NS 32032. It is therefore better to let GCC figure out a
1944 ;; good strategy for generating the proper instruction sequence
1945 ;; and represent it as rtl.
1947 ;; Optimize the case of extracting a byte or word from a register.
1948 ;; Otherwise we must load a register with the offset of the
1949 ;; chunk we want, and perform an extract insn (each of which
1950 ;; is very expensive). Since we use the stack to do our bit-twiddling
1951 ;; we cannot use it for a destination. Perhaps things are fast
1952 ;; enough on the 32532 that such hacks are not needed.
1955 [(set (match_operand:SI 0 "general_operand" "=ro")
1956 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
1957 (match_operand:SI 2 "const_int_operand" "i")
1958 (match_operand:SI 3 "const_int_operand" "i")))]
1959 "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
1960 && (INTVAL (operands[3]) == 8 || INTVAL (operands[3]) == 16 || INTVAL (operands[3]) == 24)"
1963 output_asm_insn (\"movd %1,tos\", operands);
1964 if (INTVAL (operands[2]) == 16)
1966 if (INTVAL (operands[3]) == 8)
1967 output_asm_insn (\"movzwd 1(sp),%0\", operands);
1969 output_asm_insn (\"movzwd 2(sp),%0\", operands);
1973 if (INTVAL (operands[3]) == 8)
1974 output_asm_insn (\"movzbd 1(sp),%0\", operands);
1975 else if (INTVAL (operands[3]) == 16)
1976 output_asm_insn (\"movzbd 2(sp),%0\", operands);
1978 output_asm_insn (\"movzbd 3(sp),%0\", operands);
1980 if (TARGET_32532 || TARGET_32332)
1981 return \"cmpqd %$0,tos\";
1983 return \"adjspb %$-4\";
1986 ;; The exts/ext instructions have the problem that they always access
1987 ;; 32 bits even if the bitfield is smaller. For example the instruction
1988 ;; extsd 7(r1),r0,2,5
1989 ;; would read not only at address 7(r1) but also at 8(r1) to 10(r1).
1990 ;; If these addresses are in a different (unmapped) page a memory fault
1993 ;; Timing considerations:
1994 ;; movd 0(r1),r0 3 bytes
1997 ;; takes about 13 cycles on the 532 while
1998 ;; extsd 7(r1),r0,2,5 5 bytes
1999 ;; takes about 21 cycles.
2001 ;; The inss/ins instructions suffer from the same problem.
2003 ;; A machine specific option (-mbitfield/-mnobitfield) is used
2004 ;; to allow/disallow the use of these instructions.
2007 [(set (match_operand:SI 0 "general_operand" "=g<")
2008 (zero_extract:SI (match_operand:SI 1 "register_operand" "g")
2009 (match_operand:SI 2 "const_int_operand" "i")
2010 (match_operand:SI 3 "general_operand" "rK")))]
2013 { if (GET_CODE (operands[3]) == CONST_INT)
2014 return \"extsd %1,%0,%3,%2\";
2015 else return \"extd %3,%1,%0,%2\";
2018 (define_insn "extzv"
2019 [(set (match_operand:SI 0 "general_operand" "=g<")
2020 (zero_extract:SI (match_operand:QI 1 "general_operand" "g")
2021 (match_operand:SI 2 "const_int_operand" "i")
2022 (match_operand:SI 3 "general_operand" "rK")))]
2025 { if (GET_CODE (operands[3]) == CONST_INT)
2026 return \"extsd %1,%0,%3,%2\";
2027 else return \"extd %3,%1,%0,%2\";
2031 [(set (zero_extract:SI (match_operand:SI 0 "memory_operand" "+o")
2032 (match_operand:SI 1 "const_int_operand" "i")
2033 (match_operand:SI 2 "general_operand" "rn"))
2034 (match_operand:SI 3 "general_operand" "rm"))]
2037 { if (GET_CODE (operands[2]) == CONST_INT)
2039 if (INTVAL (operands[2]) >= 8)
2041 operands[0] = adj_offsettable_operand (operands[0],
2042 INTVAL (operands[2]) / 8);
2043 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) % 8);
2045 if (INTVAL (operands[1]) <= 8)
2046 return \"inssb %3,%0,%2,%1\";
2047 else if (INTVAL (operands[1]) <= 16)
2048 return \"inssw %3,%0,%2,%1\";
2050 return \"inssd %3,%0,%2,%1\";
2052 return \"insd %2,%3,%0,%1\";
2056 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
2057 (match_operand:SI 1 "const_int_operand" "i")
2058 (match_operand:SI 2 "general_operand" "rK"))
2059 (match_operand:SI 3 "general_operand" "rm"))]
2062 { if (GET_CODE (operands[2]) == CONST_INT)
2063 if (INTVAL (operands[1]) <= 8)
2064 return \"inssb %3,%0,%2,%1\";
2065 else if (INTVAL (operands[1]) <= 16)
2066 return \"inssw %3,%0,%2,%1\";
2068 return \"inssd %3,%0,%2,%1\";
2069 return \"insd %2,%3,%0,%1\";
2073 [(set (zero_extract:SI (match_operand:QI 0 "general_operand" "+g")
2074 (match_operand:SI 1 "const_int_operand" "i")
2075 (match_operand:SI 2 "general_operand" "rK"))
2076 (match_operand:SI 3 "general_operand" "rm"))]
2079 { if (GET_CODE (operands[2]) == CONST_INT)
2080 if (INTVAL (operands[1]) <= 8)
2081 return \"inssb %3,%0,%2,%1\";
2082 else if (INTVAL (operands[1]) <= 16)
2083 return \"inssw %3,%0,%2,%1\";
2085 return \"inssd %3,%0,%2,%1\";
2086 return \"insd %2,%3,%0,%1\";
2092 (label_ref (match_operand 0 "" "")))]
2098 (if_then_else (eq (cc0)
2100 (label_ref (match_operand 0 "" ""))
2104 { if (cc_prev_status.flags & CC_Z_IN_F)
2106 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2108 else return \"beq %l0\";
2113 (if_then_else (ne (cc0)
2115 (label_ref (match_operand 0 "" ""))
2119 { if (cc_prev_status.flags & CC_Z_IN_F)
2121 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2123 else return \"bne %l0\";
2128 (if_then_else (gt (cc0)
2130 (label_ref (match_operand 0 "" ""))
2137 (if_then_else (gtu (cc0)
2139 (label_ref (match_operand 0 "" ""))
2146 (if_then_else (lt (cc0)
2148 (label_ref (match_operand 0 "" ""))
2155 (if_then_else (ltu (cc0)
2157 (label_ref (match_operand 0 "" ""))
2164 (if_then_else (ge (cc0)
2166 (label_ref (match_operand 0 "" ""))
2173 (if_then_else (geu (cc0)
2175 (label_ref (match_operand 0 "" ""))
2182 (if_then_else (le (cc0)
2184 (label_ref (match_operand 0 "" ""))
2191 (if_then_else (leu (cc0)
2193 (label_ref (match_operand 0 "" ""))
2200 (if_then_else (eq (cc0)
2203 (label_ref (match_operand 0 "" ""))))]
2206 { if (cc_prev_status.flags & CC_Z_IN_F)
2208 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2210 else return \"bne %l0\";
2215 (if_then_else (ne (cc0)
2218 (label_ref (match_operand 0 "" ""))))]
2221 { if (cc_prev_status.flags & CC_Z_IN_F)
2223 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2225 else return \"beq %l0\";
2230 (if_then_else (gt (cc0)
2233 (label_ref (match_operand 0 "" ""))))]
2239 (if_then_else (gtu (cc0)
2242 (label_ref (match_operand 0 "" ""))))]
2248 (if_then_else (lt (cc0)
2251 (label_ref (match_operand 0 "" ""))))]
2257 (if_then_else (ltu (cc0)
2260 (label_ref (match_operand 0 "" ""))))]
2266 (if_then_else (ge (cc0)
2269 (label_ref (match_operand 0 "" ""))))]
2275 (if_then_else (geu (cc0)
2278 (label_ref (match_operand 0 "" ""))))]
2284 (if_then_else (le (cc0)
2287 (label_ref (match_operand 0 "" ""))))]
2293 (if_then_else (leu (cc0)
2296 (label_ref (match_operand 0 "" ""))))]
2300 ;; Subtract-and-jump and Add-and-jump insns.
2301 ;; These can actually be used for adding numbers in the range -8 to 7
2306 (ne (match_operand:SI 0 "general_operand" "+g")
2307 (match_operand:SI 1 "const_int_operand" "i"))
2308 (label_ref (match_operand 2 "" ""))
2311 (minus:SI (match_dup 0)
2313 "INTVAL (operands[1]) > -8 && INTVAL (operands[1]) <= 8"
2314 "acbd %$%n1,%0,%l2")
2319 (ne (match_operand:SI 0 "general_operand" "+g")
2320 (match_operand:SI 1 "const_int_operand" "i"))
2321 (label_ref (match_operand 2 "" ""))
2324 (plus:SI (match_dup 0)
2325 (match_operand:SI 3 "const_int_operand" "i")))]
2326 "INTVAL (operands[1]) == - INTVAL (operands[3])
2327 && INTVAL (operands[3]) >= -8 && INTVAL (operands[3]) < 8"
2331 [(call (match_operand:QI 0 "memory_operand" "m")
2332 (match_operand:QI 1 "general_operand" "g"))]
2337 if (GET_CODE (operands[0]) == MEM)
2339 rtx temp = XEXP (operands[0], 0);
2340 if (CONSTANT_ADDRESS_P (temp))
2343 return \"bsr %?%0\";
2345 #ifdef CALL_MEMREF_IMPLICIT
2352 return \"bsr %?%a0\";
2357 if (GET_CODE (XEXP (operands[0], 0)) == REG)
2358 #if defined (GNX_V3) || defined (CALL_MEMREF_IMPLICIT)
2364 #endif /* not JSR_ALWAYS */
2368 (define_insn "call_value"
2369 [(set (match_operand 0 "" "=rf")
2370 (call (match_operand:QI 1 "memory_operand" "m")
2371 (match_operand:QI 2 "general_operand" "g")))]
2376 if (GET_CODE (operands[1]) == MEM)
2378 rtx temp = XEXP (operands[1], 0);
2379 if (CONSTANT_ADDRESS_P (temp))
2382 return \"bsr %?%1\";
2384 #ifdef CALL_MEMREF_IMPLICIT
2391 return \"bsr %?%a1\";
2396 if (GET_CODE (XEXP (operands[1], 0)) == REG)
2397 #if defined (GNX_V3) || defined (CALL_MEMREF_IMPLICIT)
2403 #endif /* not JSR_ALWAYS */
2407 ;; Call subroutine returning any type.
2409 (define_expand "untyped_call"
2410 [(parallel [(call (match_operand 0 "" "")
2412 (match_operand 1 "" "")
2413 (match_operand 2 "" "")])]
2419 emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx));
2421 for (i = 0; i < XVECLEN (operands[2], 0); i++)
2423 rtx set = XVECEXP (operands[2], 0, i);
2424 emit_move_insn (SET_DEST (set), SET_SRC (set));
2427 /* The optimizer does not know that the call sets the function value
2428 registers we stored in the result block. We avoid problems by
2429 claiming that all hard registers are used and clobbered at this
2431 emit_insn (gen_blockage ());
2436 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
2437 ;; all of memory. This blocks insns from being moved across this point.
2439 (define_insn "blockage"
2440 [(unspec_volatile [(const_int 0)] 0)]
2444 (define_insn "return"
2449 (define_insn "abssf2"
2450 [(set (match_operand:SF 0 "general_operand" "=fm<")
2451 (abs:SF (match_operand:SF 1 "general_operand" "fmF")))]
2455 (define_insn "absdf2"
2456 [(set (match_operand:DF 0 "general_operand" "=fm<")
2457 (abs:DF (match_operand:DF 1 "general_operand" "fmF")))]
2461 (define_insn "abssi2"
2462 [(set (match_operand:SI 0 "general_operand" "=g<")
2463 (abs:SI (match_operand:SI 1 "general_operand" "rmn")))]
2467 (define_insn "abshi2"
2468 [(set (match_operand:HI 0 "general_operand" "=g<")
2469 (abs:HI (match_operand:HI 1 "general_operand" "g")))]
2473 (define_insn "absqi2"
2474 [(set (match_operand:QI 0 "general_operand" "=g<")
2475 (abs:QI (match_operand:QI 1 "general_operand" "g")))]
2484 (define_insn "indirect_jump"
2485 [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
2489 (define_insn "tablejump"
2491 (plus:SI (pc) (match_operand:SI 0 "general_operand" "g")))
2492 (use (label_ref (match_operand 1 "" "")))]
2496 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LI\",
2497 CODE_LABEL_NUMBER (operands[1]));
2498 return \"cased %0\";
2501 ;; Scondi instructions
2503 [(set (match_operand:SI 0 "general_operand" "=g<")
2504 (eq:SI (cc0) (const_int 0)))]
2507 { if (cc_prev_status.flags & CC_Z_IN_F)
2509 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2511 else return \"seqd %0\";
2515 [(set (match_operand:HI 0 "general_operand" "=g<")
2516 (eq:HI (cc0) (const_int 0)))]
2519 { if (cc_prev_status.flags & CC_Z_IN_F)
2521 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2523 else return \"seqw %0\";
2527 [(set (match_operand:QI 0 "general_operand" "=g<")
2528 (eq:QI (cc0) (const_int 0)))]
2531 { if (cc_prev_status.flags & CC_Z_IN_F)
2533 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2535 else return \"seqb %0\";
2539 [(set (match_operand:SI 0 "general_operand" "=g<")
2540 (ne:SI (cc0) (const_int 0)))]
2543 { if (cc_prev_status.flags & CC_Z_IN_F)
2545 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2547 else return \"sned %0\";
2551 [(set (match_operand:HI 0 "general_operand" "=g<")
2552 (ne:HI (cc0) (const_int 0)))]
2555 { if (cc_prev_status.flags & CC_Z_IN_F)
2557 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2559 else return \"snew %0\";
2563 [(set (match_operand:QI 0 "general_operand" "=g<")
2564 (ne:QI (cc0) (const_int 0)))]
2567 { if (cc_prev_status.flags & CC_Z_IN_F)
2569 else if (cc_prev_status.flags & CC_Z_IN_NOT_F)
2571 else return \"sneb %0\";
2575 [(set (match_operand:SI 0 "general_operand" "=g<")
2576 (gt:SI (cc0) (const_int 0)))]
2581 [(set (match_operand:HI 0 "general_operand" "=g<")
2582 (gt:HI (cc0) (const_int 0)))]
2587 [(set (match_operand:QI 0 "general_operand" "=g<")
2588 (gt:QI (cc0) (const_int 0)))]
2593 [(set (match_operand:SI 0 "general_operand" "=g<")
2594 (gtu:SI (cc0) (const_int 0)))]
2599 [(set (match_operand:HI 0 "general_operand" "=g<")
2600 (gtu:HI (cc0) (const_int 0)))]
2605 [(set (match_operand:QI 0 "general_operand" "=g<")
2606 (gtu:QI (cc0) (const_int 0)))]
2611 [(set (match_operand:SI 0 "general_operand" "=g<")
2612 (lt:SI (cc0) (const_int 0)))]
2617 [(set (match_operand:HI 0 "general_operand" "=g<")
2618 (lt:HI (cc0) (const_int 0)))]
2623 [(set (match_operand:QI 0 "general_operand" "=g<")
2624 (lt:QI (cc0) (const_int 0)))]
2629 [(set (match_operand:SI 0 "general_operand" "=g<")
2630 (ltu:SI (cc0) (const_int 0)))]
2635 [(set (match_operand:HI 0 "general_operand" "=g<")
2636 (ltu:HI (cc0) (const_int 0)))]
2641 [(set (match_operand:QI 0 "general_operand" "=g<")
2642 (ltu:QI (cc0) (const_int 0)))]
2647 [(set (match_operand:SI 0 "general_operand" "=g<")
2648 (ge:SI (cc0) (const_int 0)))]
2653 [(set (match_operand:HI 0 "general_operand" "=g<")
2654 (ge:HI (cc0) (const_int 0)))]
2659 [(set (match_operand:QI 0 "general_operand" "=g<")
2660 (ge:QI (cc0) (const_int 0)))]
2665 [(set (match_operand:SI 0 "general_operand" "=g<")
2666 (geu:SI (cc0) (const_int 0)))]
2671 [(set (match_operand:HI 0 "general_operand" "=g<")
2672 (geu:HI (cc0) (const_int 0)))]
2677 [(set (match_operand:QI 0 "general_operand" "=g<")
2678 (geu:QI (cc0) (const_int 0)))]
2683 [(set (match_operand:SI 0 "general_operand" "=g<")
2684 (le:SI (cc0) (const_int 0)))]
2689 [(set (match_operand:HI 0 "general_operand" "=g<")
2690 (le:HI (cc0) (const_int 0)))]
2695 [(set (match_operand:QI 0 "general_operand" "=g<")
2696 (le:QI (cc0) (const_int 0)))]
2701 [(set (match_operand:SI 0 "general_operand" "=g<")
2702 (leu:SI (cc0) (const_int 0)))]
2707 [(set (match_operand:HI 0 "general_operand" "=g<")
2708 (leu:HI (cc0) (const_int 0)))]
2713 [(set (match_operand:QI 0 "general_operand" "=g<")
2714 (leu:QI (cc0) (const_int 0)))]
2721 [(set (match_operand:SI 0 "general_operand" "ro")
2723 (plus:SI (ffs:SI (zero_extract:SI
2724 (match_operand:SI 1 "general_operand" "g")
2725 (minus:SI (const_int 32) (match_dup 0))
2730 "ffsd %1,%0; bfc 1f; addqd %$-1,%0; 1:")
2732 (define_expand "ffssi2"
2733 [(set (match_operand:SI 0 "general_operand" "=g") (const_int 0))
2736 (plus:SI (ffs:SI (zero_extract:SI
2737 (match_operand:SI 1 "general_operand" "g")
2738 (minus:SI (const_int 32) (match_dup 0))
2743 (plus:SI (match_dup 0)
2746 "operands[1] = make_safe_from(operands[1], operands[0]);")
2748 ;; Speed up stack adjust followed by a HI fixedpoint push.
2751 [(set (reg:SI 17) (plus:SI (reg:SI 17) (const_int -2)))
2752 (set (match_operand:HI 0 "push_operand" "=m")
2753 (match_operand:HI 1 "general_operand" "g"))]
2754 "! reg_mentioned_p (stack_pointer_rtx, operands[1])"
2757 if (GET_CODE (operands[1]) == CONST_INT)
2758 output_asm_insn (output_move_dconst (INTVAL (operands[1]), \"%$%1,tos\"),
2761 output_asm_insn (\"movzwd %1,tos\", operands);
2765 ;; Speed up stack adjust followed by a zero_extend:HI(QI) fixedpoint push.
2768 [(set (reg:SI 17) (plus:SI (reg:SI 17) (const_int -2)))
2769 (set (match_operand:HI 0 "push_operand" "=m")
2770 (zero_extend:HI (match_operand:QI 1 "general_operand" "g")))]
2771 "! reg_mentioned_p (stack_pointer_rtx, operands[1])"
2774 if (GET_CODE (operands[1]) == CONST_INT)
2775 output_asm_insn (output_move_dconst (INTVAL (operands[1]), \"%$%1,tos\"),
2778 output_asm_insn (\"movzbd %1,tos\", operands);
2782 ;; Speed up stack adjust followed by a sign_extend:HI(QI) fixedpoint push.
2785 [(set (reg:SI 17) (plus:SI (reg:SI 17) (const_int -2)))
2786 (set (match_operand:HI 0 "push_operand" "=m")
2787 (sign_extend:HI (match_operand:QI 1 "general_operand" "g")))]
2788 "! reg_mentioned_p (stack_pointer_rtx, operands[1])"
2791 if (GET_CODE (operands[1]) == CONST_INT)
2792 output_asm_insn (output_move_dconst (INTVAL (operands[1]), \"%$%1,tos\"),
2795 output_asm_insn (\"movxbd %1,tos\", operands);
2799 ;; Speed up stack adjust followed by a QI fixedpoint push.
2802 [(set (reg:SI 17) (plus:SI (reg:SI 17) (const_int -3)))
2803 (set (match_operand:QI 0 "push_operand" "=m")
2804 (match_operand:QI 1 "general_operand" "g"))]
2805 "! reg_mentioned_p (stack_pointer_rtx, operands[1])"
2808 if (GET_CODE (operands[1]) == CONST_INT)
2809 output_asm_insn (output_move_dconst (INTVAL (operands[1]), \"%$%1,tos\"),
2812 output_asm_insn (\"movzbd %1,tos\", operands);
2816 ;; Speed up stack adjust followed by a SI fixedpoint push.
2819 [(set (reg:SI 17) (plus:SI (reg:SI 17) (const_int 4)))
2820 (set (match_operand:SI 0 "push_operand" "=m")
2821 (match_operand:SI 1 "general_operand" "g"))]
2822 "! reg_mentioned_p (stack_pointer_rtx, operands[1])"
2825 if (GET_CODE (operands[1]) == CONST_INT)
2826 output_asm_insn (output_move_dconst (INTVAL (operands[1]), \"%$%1,0(sp)\"),
2828 else if (GET_CODE (operands[1]) != REG
2829 && GET_CODE (operands[1]) != MEM
2830 && address_operand (operands[1], SImode))
2831 output_asm_insn (\"addr %a1,0(sp)\", operands);
2833 output_asm_insn (\"movd %1,0(sp)\", operands);
2837 ;; Speed up stack adjust followed by two fullword fixedpoint pushes.
2840 [(set (reg:SI 17) (plus:SI (reg:SI 17) (const_int 8)))
2841 (set (match_operand:SI 0 "push_operand" "=m")
2842 (match_operand:SI 1 "general_operand" "g"))
2843 (set (match_operand:SI 2 "push_operand" "=m")
2844 (match_operand:SI 3 "general_operand" "g"))]
2845 "! reg_mentioned_p (stack_pointer_rtx, operands[1])
2846 && ! reg_mentioned_p (stack_pointer_rtx, operands[3])"
2849 if (GET_CODE (operands[1]) == CONST_INT)
2850 output_asm_insn (output_move_dconst (INTVAL (operands[1]), \"%$%1,4(sp)\"),
2852 else if (GET_CODE (operands[1]) != REG
2853 && GET_CODE (operands[1]) != MEM
2854 && address_operand (operands[1], SImode))
2855 output_asm_insn (\"addr %a1,4(sp)\", operands);
2857 output_asm_insn (\"movd %1,4(sp)\", operands);
2859 if (GET_CODE (operands[3]) == CONST_INT)
2860 output_asm_insn (output_move_dconst (INTVAL (operands[3]), \"%$%3,0(sp)\"),
2862 else if (GET_CODE (operands[3]) != REG
2863 && GET_CODE (operands[3]) != MEM
2864 && address_operand (operands[3], SImode))
2865 output_asm_insn (\"addr %a3,0(sp)\", operands);
2867 output_asm_insn (\"movd %3,0(sp)\", operands);