1 ;;- Machine description for the pdp11 for GNU C compiler
2 ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2004, 2005
3 ;; 2007 Free Software Foundation, Inc.
4 ;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
6 ;; This file is part of GCC.
8 ;; GCC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 3, or (at your option)
13 ;; GCC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>.
26 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
28 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
29 ;;- updates for most instructions.
31 ;;- Operand classes for the register allocator:
33 ;; Compare instructions.
35 ;; currently we only support df floats, which saves us quite some
36 ;; hassle switching the FP mode!
37 ;; we assume that CPU is always in long float mode, and
38 ;; 16 bit integer mode - currently, the prologue for main does this,
39 ;; but maybe we should just set up a NEW crt0 properly,
40 ;; -- and what about signal handling code?
41 ;; (we don't even let sf floats in the register file, so
42 ;; we only should have to worry about truncating and widening
43 ;; when going to memory)
45 ;; abort() call by g++ - must define libfunc for cmp_optab
46 ;; and ucmp_optab for mode SImode, because we don't have that!!!
47 ;; - yet since no libfunc is there, we abort ()
49 ;; The only thing that remains to be done then is output
50 ;; the floats in a way the assembler can handle it (and
51 ;; if you're really into it, use a PDP11 float emulation
52 ;; library to do floating point constant folding - but
53 ;; I guess you'll get reasonable results even when not
55 ;; the last thing to do is fix the UPDATE_CC macro to check
56 ;; for floating point condition codes, and set cc_status
57 ;; properly, also setting the CC_IN_FCCR flag.
60 ;; currently type is only fpu or arith or unknown, maybe branch later ?
62 (define_attr "type" "unknown,arith,fp" (const_string "arith"))
64 ;; length default is 1 word each
65 (define_attr "length" "" (const_int 1))
67 ;; a user's asm statement
68 (define_asm_attributes
69 [(set_attr "type" "unknown")
70 ; all bets are off how long it is - make it 256, forces long jumps
71 ; whenever jumping around it !!!
72 (set_attr "length" "256")])
74 ;; define function units
76 ;; arithmetic - values here immediately when next insn issued
77 ;; or does it mean the number of cycles after this insn was issued?
78 ;; how do I say that fpu insns use cpu also? (pre-interaction phase)
80 ;(define_function_unit "cpu" 1 1 (eq_attr "type" "arith") 0 0)
81 ;(define_function_unit "fpu" 1 1 (eq_attr "type" "fp") 0 0)
86 (compare (match_operand:DF 0 "general_operand" "fR,Q,F")
87 (match_operand:DF 1 "register_operand" "a,a,a")))]
91 cc_status.flags = CC_IN_FPU;
92 return \"{cmpd|cmpf} %0, %1\;cfcc\";
94 [(set_attr "length" "2,3,6")])
96 ;; a bit of brain damage, maybe inline later -
97 ;; problem is - gcc seems to NEED SImode because
98 ;; of the cmp weirdness - maybe change gcc to handle this?
100 (define_expand "cmpsi"
102 (match_operand:SI 0 "general_operand" "g"))
104 (match_operand:SI 1 "general_operand" "g"))
105 (parallel [(set (cc0)
108 (clobber (reg:SI 0))])]
109 "0" ;; disable for test
112 ;; check for next insn for branch code - does this still
119 (clobber (reg:SI 0))]
123 rtx br_insn = NEXT_INSN (insn);
126 gcc_assert (GET_CODE (br_insn) == JUMP_INSN);
127 br_code = GET_CODE (XEXP (XEXP (PATTERN (br_insn), 1), 0));
136 return \"jsr pc, ___ucmpsi\;cmp $1,r0\";
145 return \"jsr pc, ___cmpsi\;tst r0\";
152 [(set_attr "length" "4")])
157 (compare (match_operand:HI 0 "general_operand" "rR,rR,Qi,Qi")
158 (match_operand:HI 1 "general_operand" "rR,Qi,rR,Qi")))]
161 [(set_attr "length" "1,2,2,3")])
165 (compare (match_operand:QI 0 "general_operand" "rR,rR,Qi,Qi")
166 (match_operand:QI 1 "general_operand" "rR,Qi,rR,Qi")))]
169 [(set_attr "length" "1,2,2,3")])
172 ;; We have to have this because cse can optimize the previous pattern
177 (match_operand:DF 0 "general_operand" "fR,Q"))]
181 cc_status.flags = CC_IN_FPU;
182 return \"{tstd|tstf} %0\;cfcc\";
184 [(set_attr "length" "2,3")])
187 (define_expand "tstsi"
189 (match_operand:SI 0 "general_operand" "g"))
190 (parallel [(set (cc0)
192 (clobber (reg:SI 0))])]
193 "0" ;; disable for test
199 (clobber (reg:SI 0))]
201 "jsr pc, ___tstsi\;tst r0"
202 [(set_attr "length" "3")])
207 (match_operand:HI 0 "general_operand" "rR,Q"))]
210 [(set_attr "length" "1,2")])
214 (match_operand:QI 0 "general_operand" "rR,Q"))]
217 [(set_attr "length" "1,2")])
219 ;; sob instruction - we need an assembler which can make this instruction
220 ;; valid under _all_ circumstances!
225 (ne (plus:HI (match_operand:HI 0 "register_operand" "+r")
228 (label_ref (match_operand 1 "" ""))
231 (plus:HI (match_dup 0)
236 static int labelcount = 0;
237 static char buf[1000];
239 if (get_attr_length (insn) == 1)
240 return \"sob %0, %l1\";
243 output_asm_insn (\"dec %0\", operands);
245 sprintf (buf, \"bge LONG_SOB%d\", labelcount);
246 output_asm_insn (buf, NULL);
248 output_asm_insn (\"jmp %l1\", operands);
250 sprintf (buf, \"LONG_SOB%d:\", labelcount++);
251 output_asm_insn (buf, NULL);
255 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
258 (ge (minus (match_dup 0)
264 ;; These control RTL generation for conditional jump insns
265 ;; and match them for register allocation.
267 ;; problem with too short jump distance! we need an assembler which can
268 ;; make this valid for all jump distances!
271 ;; these must be changed to check for CC_IN_FCCR if float is to be
276 (if_then_else (eq (cc0)
278 (label_ref (match_operand 0 "" ""))
281 "* return output_jump(\"beq\", \"bne\", get_attr_length(insn));"
282 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
285 (ge (minus (match_dup 0)
294 (if_then_else (ne (cc0)
296 (label_ref (match_operand 0 "" ""))
299 "* return output_jump(\"bne\", \"beq\", get_attr_length(insn));"
300 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
303 (ge (minus (match_dup 0)
311 (if_then_else (gt (cc0)
313 (label_ref (match_operand 0 "" ""))
316 "* return output_jump(\"bgt\", \"ble\", get_attr_length(insn));"
317 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
320 (ge (minus (match_dup 0)
328 (if_then_else (gtu (cc0)
330 (label_ref (match_operand 0 "" ""))
333 "* return output_jump(\"bhi\", \"blos\", get_attr_length(insn));"
334 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
337 (ge (minus (match_dup 0)
345 (if_then_else (lt (cc0)
347 (label_ref (match_operand 0 "" ""))
350 "* return output_jump(\"blt\", \"bge\", get_attr_length(insn));"
351 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
354 (ge (minus (match_dup 0)
363 (if_then_else (ltu (cc0)
365 (label_ref (match_operand 0 "" ""))
368 "* return output_jump(\"blo\", \"bhis\", get_attr_length(insn));"
369 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
372 (ge (minus (match_dup 0)
380 (if_then_else (ge (cc0)
382 (label_ref (match_operand 0 "" ""))
385 "* return output_jump(\"bge\", \"blt\", get_attr_length(insn));"
386 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
389 (ge (minus (match_dup 0)
397 (if_then_else (geu (cc0)
399 (label_ref (match_operand 0 "" ""))
402 "* return output_jump(\"bhis\", \"blo\", get_attr_length(insn));"
403 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
406 (ge (minus (match_dup 0)
414 (if_then_else (le (cc0)
416 (label_ref (match_operand 0 "" ""))
419 "* return output_jump(\"ble\", \"bgt\", get_attr_length(insn));"
420 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
423 (ge (minus (match_dup 0)
431 (if_then_else (leu (cc0)
433 (label_ref (match_operand 0 "" ""))
436 "* return output_jump(\"blos\", \"bhi\", get_attr_length(insn));"
437 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
440 (ge (minus (match_dup 0)
447 ;; These match inverted jump insns for register allocation.
451 (if_then_else (eq (cc0)
454 (label_ref (match_operand 0 "" ""))))]
456 "* return output_jump(\"bne\", \"beq\", get_attr_length(insn));"
457 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
460 (ge (minus (match_dup 0)
468 (if_then_else (ne (cc0)
471 (label_ref (match_operand 0 "" ""))))]
473 "* return output_jump(\"beq\", \"bne\", get_attr_length(insn));"
474 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
477 (ge (minus (match_dup 0)
485 (if_then_else (gt (cc0)
488 (label_ref (match_operand 0 "" ""))))]
490 "* return output_jump(\"ble\", \"bgt\", get_attr_length(insn));"
491 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
494 (ge (minus (match_dup 0)
502 (if_then_else (gtu (cc0)
505 (label_ref (match_operand 0 "" ""))))]
507 "* return output_jump(\"blos\", \"bhi\", get_attr_length(insn));"
508 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
511 (ge (minus (match_dup 0)
519 (if_then_else (lt (cc0)
522 (label_ref (match_operand 0 "" ""))))]
524 "* return output_jump(\"bge\", \"blt\", get_attr_length(insn));"
525 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
528 (ge (minus (match_dup 0)
536 (if_then_else (ltu (cc0)
539 (label_ref (match_operand 0 "" ""))))]
541 "* return output_jump(\"bhis\", \"blo\", get_attr_length(insn));"
542 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
545 (ge (minus (match_dup 0)
553 (if_then_else (ge (cc0)
556 (label_ref (match_operand 0 "" ""))))]
558 "* return output_jump(\"blt\", \"bge\", get_attr_length(insn));"
559 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
562 (ge (minus (match_dup 0)
570 (if_then_else (geu (cc0)
573 (label_ref (match_operand 0 "" ""))))]
575 "* return output_jump(\"blo\", \"bhis\", get_attr_length(insn));"
576 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
579 (ge (minus (match_dup 0)
587 (if_then_else (le (cc0)
590 (label_ref (match_operand 0 "" ""))))]
592 "* return output_jump(\"bgt\", \"ble\", get_attr_length(insn));"
593 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
596 (ge (minus (match_dup 0)
604 (if_then_else (leu (cc0)
607 (label_ref (match_operand 0 "" ""))))]
609 "* return output_jump(\"bhi\", \"blos\", get_attr_length(insn));"
610 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
613 (ge (minus (match_dup 0)
622 [(set (match_operand:DI 0 "general_operand" "=g,rm,o")
623 (match_operand:DI 1 "general_operand" "m,r,a"))]
625 "* return output_move_quad (operands);"
626 ;; what's the mose expensive code - say twice movsi = 16
627 [(set_attr "length" "16,16,16")])
630 [(set (match_operand:SI 0 "general_operand" "=r,r,r,rm,m")
631 (match_operand:SI 1 "general_operand" "rN,IJ,K,m,r"))]
633 "* return output_move_double (operands);"
634 ;; what's the most expensive code ? - I think 8!
635 ;; we could split it up and make several sub-cases...
636 [(set_attr "length" "2,3,4,8,8")])
639 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
640 (match_operand:HI 1 "general_operand" "rRN,Qi,rRN,Qi"))]
644 if (operands[1] == const0_rtx)
647 return \"mov %1, %0\";
649 [(set_attr "length" "1,2,2,3")])
652 [(set (match_operand:QI 0 "nonimmediate_operand" "=g")
653 (match_operand:QI 1 "general_operand" "g"))]
657 if (operands[1] == const0_rtx)
660 return \"movb %1, %0\";
662 [(set_attr "length" "1")])
664 ;; do we have to supply all these moves? e.g. to
665 ;; NO_LOAD_FPU_REGs ?
667 [(set (match_operand:DF 0 "general_operand" "=a,fR,a,Q,m")
668 (match_operand:DF 1 "general_operand" "fFR,a,Q,a,m"))]
670 "* if (which_alternative ==0)
671 return \"ldd %1, %0\";
672 else if (which_alternative == 1)
673 return \"std %1, %0\";
675 return output_move_quad (operands); "
677 [(set_attr "length" "1,1,5,5,16")])
680 [(set (match_operand:SF 0 "general_operand" "=g,r,g")
681 (match_operand:SF 1 "general_operand" "r,rmF,g"))]
683 "* return output_move_double (operands);"
684 [(set_attr "length" "8,8,8")])
686 ;; maybe fiddle a bit with move_ratio, then
687 ;; let constraints only accept a register ...
689 (define_expand "movmemhi"
690 [(parallel [(set (match_operand:BLK 0 "general_operand" "=g,g")
691 (match_operand:BLK 1 "general_operand" "g,g"))
692 (use (match_operand:HI 2 "arith_operand" "n,&mr"))
693 (use (match_operand:HI 3 "immediate_operand" "i,i"))
694 (clobber (match_scratch:HI 4 "=&r,X"))
695 (clobber (match_dup 5))
696 (clobber (match_dup 6))
697 (clobber (match_dup 2))])]
698 "(TARGET_BCOPY_BUILTIN)"
702 = replace_equiv_address (operands[0],
703 copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
705 = replace_equiv_address (operands[1],
706 copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
708 operands[5] = XEXP (operands[0], 0);
709 operands[6] = XEXP (operands[1], 0);
713 (define_insn "" ; "movmemhi"
714 [(set (mem:BLK (match_operand:HI 0 "general_operand" "=r,r"))
715 (mem:BLK (match_operand:HI 1 "general_operand" "r,r")))
716 (use (match_operand:HI 2 "arith_operand" "n,&r"))
717 (use (match_operand:HI 3 "immediate_operand" "i,i"))
718 (clobber (match_scratch:HI 4 "=&r,X"))
719 (clobber (match_dup 0))
720 (clobber (match_dup 1))
721 (clobber (match_dup 2))]
722 "(TARGET_BCOPY_BUILTIN)"
723 "* return output_block_move (operands);"
725 [(set_attr "length" "40")])
729 ;;- truncation instructions
731 (define_insn "truncdfsf2"
732 [(set (match_operand:SF 0 "general_operand" "=r,R,Q")
733 (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a,a")))]
735 "* if (which_alternative ==0)
737 output_asm_insn(\"{stcdf|movfo} %1, -(sp)\", operands);
738 output_asm_insn(\"mov (sp)+, %0\", operands);
739 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+1);
740 output_asm_insn(\"mov (sp)+, %0\", operands);
743 else if (which_alternative == 1)
744 return \"{stcdf|movfo} %1, %0\";
746 return \"{stcdf|movfo} %1, %0\";
748 [(set_attr "length" "3,1,2")])
751 (define_expand "truncsihi2"
752 [(set (match_operand:HI 0 "general_operand" "=g")
754 (match_operand:SI 1 "general_operand" "or")
760 ;;- zero extension instructions
762 (define_insn "zero_extendqihi2"
763 [(set (match_operand:HI 0 "general_operand" "=r")
764 (zero_extend:HI (match_operand:QI 1 "general_operand" "0")))]
767 [(set_attr "length" "2")])
769 (define_expand "zero_extendhisi2"
773 (match_operand:HI 1 "register_operand" "r"))
775 (match_operand:SI 0 "register_operand" "=r")
779 "/* operands[1] = make_safe_from (operands[1], operands[0]); */")
782 ;;- sign extension instructions
784 (define_insn "extendsfdf2"
785 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
786 (float_extend:DF (match_operand:SF 1 "general_operand" "r,R,Q")))]
789 mov %1, -(sp)\;{ldcfd|movof} (sp)+,%0
791 {ldcfd|movof} %1, %0"
792 [(set_attr "length" "2,1,2")])
794 ;; does movb sign extend in register-to-register move?
795 (define_insn "extendqihi2"
796 [(set (match_operand:HI 0 "register_operand" "=r,r")
797 (sign_extend:HI (match_operand:QI 1 "general_operand" "rR,Q")))]
800 [(set_attr "length" "1,2")])
802 (define_insn "extendqisi2"
803 [(set (match_operand:SI 0 "register_operand" "=r,r")
804 (sign_extend:SI (match_operand:QI 1 "general_operand" "rR,Q")))]
810 /* make register pair available */
811 latehalf[0] = operands[0];
812 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+ 1);
814 output_asm_insn(\"movb %1, %0\", operands);
815 output_asm_insn(\"sxt %0\", latehalf);
819 [(set_attr "length" "2,3")])
821 ;; maybe we have to use define_expand to say that we have the instruction,
822 ;; unconditionally, and then match dependent on CPU type:
824 (define_expand "extendhisi2"
825 [(set (match_operand:SI 0 "general_operand" "=g")
826 (sign_extend:SI (match_operand:HI 1 "general_operand" "g")))]
830 (define_insn "" ; "extendhisi2"
831 [(set (match_operand:SI 0 "general_operand" "=o,<,r")
832 (sign_extend:SI (match_operand:HI 1 "general_operand" "g,g,g")))]
838 /* we don't want to mess with auto increment */
840 switch (which_alternative)
844 latehalf[0] = operands[0];
845 operands[0] = adjust_address(operands[0], HImode, 2);
847 output_asm_insn(\"mov %1, %0\", operands);
848 output_asm_insn(\"sxt %0\", latehalf);
854 /* - auto-decrement - right direction ;-) */
855 output_asm_insn(\"mov %1, %0\", operands);
856 output_asm_insn(\"sxt %0\", operands);
862 /* make register pair available */
863 latehalf[0] = operands[0];
864 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
866 output_asm_insn(\"mov %1, %0\", operands);
867 output_asm_insn(\"sxt %0\", latehalf);
876 [(set_attr "length" "5,3,3")])
880 [(set (match_operand:SI 0 "register_operand" "=r")
881 (sign_extend:SI (match_operand:HI 1 "general_operand" "0")))]
885 static int count = 0;
889 lateoperands[0] = operands[0];
890 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
892 output_asm_insn(\"tst %0\", operands);
893 sprintf(buf, \"bge extendhisi%d\", count);
894 output_asm_insn(buf, NULL);
895 output_asm_insn(\"mov -1, %0\", lateoperands);
896 sprintf(buf, \"bne extendhisi%d\", count+1);
897 output_asm_insn(buf, NULL);
898 sprintf(buf, \"\\nextendhisi%d:\", count);
899 output_asm_insn(buf, NULL);
900 output_asm_insn(\"clr %0\", lateoperands);
901 sprintf(buf, \"\\nextendhisi%d:\", count+1);
902 output_asm_insn(buf, NULL);
908 [(set_attr "length" "6")])
910 ;; make float to int and vice versa
911 ;; using the cc_status.flag field we could probably cut down
913 ;; assume that we are normally in double and integer mode -
914 ;; what do pdp library routines do to fpu mode ?
916 (define_insn "floatsidf2"
917 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
918 (float:DF (match_operand:SI 1 "general_operand" "r,R,Q")))]
920 "* if (which_alternative ==0)
925 latehalf[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
926 output_asm_insn(\"mov %1, -(sp)\", latehalf);
927 output_asm_insn(\"mov %1, -(sp)\", operands);
929 output_asm_insn(\"setl\", operands);
930 output_asm_insn(\"{ldcld|movif} (sp)+, %0\", operands);
931 output_asm_insn(\"seti\", operands);
934 else if (which_alternative == 1)
935 return \"setl\;{ldcld|movif} %1, %0\;seti\";
937 return \"setl\;{ldcld|movif} %1, %0\;seti\";
939 [(set_attr "length" "5,3,4")])
941 (define_insn "floathidf2"
942 [(set (match_operand:DF 0 "register_operand" "=a,a")
943 (float:DF (match_operand:HI 1 "general_operand" "rR,Qi")))]
945 "{ldcid|movif} %1, %0"
946 [(set_attr "length" "1,2")])
949 (define_insn "fix_truncdfsi2"
950 [(set (match_operand:SI 0 "general_operand" "=r,R,Q")
951 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a,a"))))]
953 "* if (which_alternative ==0)
955 output_asm_insn(\"setl\", operands);
956 output_asm_insn(\"{stcdl|movfi} %1, -(sp)\", operands);
957 output_asm_insn(\"seti\", operands);
958 output_asm_insn(\"mov (sp)+, %0\", operands);
959 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
960 output_asm_insn(\"mov (sp)+, %0\", operands);
963 else if (which_alternative == 1)
964 return \"setl\;{stcdl|movfi} %1, %0\;seti\";
966 return \"setl\;{stcdl|movfi} %1, %0\;seti\";
968 [(set_attr "length" "5,3,4")])
970 (define_insn "fix_truncdfhi2"
971 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
972 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "a,a"))))]
974 "{stcdi|movfi} %1, %0"
975 [(set_attr "length" "1,2")])
978 ;;- arithmetic instructions
981 (define_insn "adddf3"
982 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
983 (plus:DF (match_operand:DF 1 "register_operand" "%0,0,0")
984 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
987 [(set_attr "length" "1,2,5")])
989 (define_insn "addsi3"
990 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
991 (plus:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
992 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
995 { /* Here we trust that operands don't overlap
997 or is lateoperands the low word?? - looks like it! */
1001 lateoperands[0] = operands[0];
1003 if (REG_P (operands[0]))
1004 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1006 operands[0] = adjust_address (operands[0], HImode, 2);
1008 if (! CONSTANT_P(operands[2]))
1010 lateoperands[2] = operands[2];
1012 if (REG_P (operands[2]))
1013 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1015 operands[2] = adjust_address (operands[2], HImode, 2);
1017 output_asm_insn (\"add %2, %0\", operands);
1018 output_asm_insn (\"adc %0\", lateoperands);
1019 output_asm_insn (\"add %2, %0\", lateoperands);
1023 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1024 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1026 if (INTVAL(operands[2]))
1028 output_asm_insn (\"add %2, %0\", operands);
1029 output_asm_insn (\"adc %0\", lateoperands);
1032 if (INTVAL(lateoperands[2]))
1033 output_asm_insn (\"add %2, %0\", lateoperands);
1037 [(set_attr "length" "3,5,6,8,3,1,5,5,3,8")])
1039 (define_insn "addhi3"
1040 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1041 (plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1042 (match_operand:HI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1046 if (GET_CODE (operands[2]) == CONST_INT)
1048 if (INTVAL(operands[2]) == 1)
1050 else if (INTVAL(operands[2]) == -1)
1054 return \"add %2, %0\";
1056 [(set_attr "length" "1,2,2,3")])
1058 (define_insn "addqi3"
1059 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1060 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1061 (match_operand:QI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1065 if (GET_CODE (operands[2]) == CONST_INT)
1067 if (INTVAL(operands[2]) == 1)
1069 else if (INTVAL(operands[2]) == -1)
1073 return \"add %2, %0\";
1075 [(set_attr "length" "1,2,2,3")])
1078 ;;- subtract instructions
1079 ;; we don't have to care for constant second
1080 ;; args, since they are canonical plus:xx now!
1081 ;; also for minus:DF ??
1083 (define_insn "subdf3"
1084 [(set (match_operand:DF 0 "register_operand" "=a,a")
1085 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
1086 (match_operand:DF 2 "general_operand" "fR,Q")))]
1088 "{subd|subf} %2, %0"
1089 [(set_attr "length" "1,2")])
1091 (define_insn "subsi3"
1092 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o")
1093 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
1094 (match_operand:SI 2 "general_operand" "r,o,r,o")))]
1097 { /* Here we trust that operands don't overlap
1099 or is lateoperands the low word?? - looks like it! */
1101 rtx lateoperands[3];
1103 lateoperands[0] = operands[0];
1105 if (REG_P (operands[0]))
1106 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1108 operands[0] = adjust_address (operands[0], HImode, 2);
1110 lateoperands[2] = operands[2];
1112 if (REG_P (operands[2]))
1113 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1115 operands[2] = adjust_address (operands[2], HImode, 2);
1117 output_asm_insn (\"sub %2, %0\", operands);
1118 output_asm_insn (\"sbc %0\", lateoperands);
1119 output_asm_insn (\"sub %2, %0\", lateoperands);
1122 ;; offsettable memory addresses always are expensive!!!
1123 [(set_attr "length" "3,5,6,8")])
1125 (define_insn "subhi3"
1126 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1127 (minus:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1128 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1132 gcc_assert (GET_CODE (operands[2]) != CONST_INT);
1134 return \"sub %2, %0\";
1136 [(set_attr "length" "1,2,2,3")])
1138 (define_insn "subqi3"
1139 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1140 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1141 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1145 gcc_assert (GET_CODE (operands[2]) != CONST_INT);
1147 return \"sub %2, %0\";
1149 [(set_attr "length" "1,2,2,3")])
1151 ;;;;- and instructions
1152 ;; Bit-and on the pdp (like on the VAX) is done with a clear-bits insn.
1154 (define_insn "andsi3"
1155 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1156 (and:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1157 (not:SI (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K"))))]
1160 { /* Here we trust that operands don't overlap
1162 or is lateoperands the low word?? - looks like it! */
1164 rtx lateoperands[3];
1166 lateoperands[0] = operands[0];
1168 if (REG_P (operands[0]))
1169 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1171 operands[0] = adjust_address (operands[0], HImode, 2);
1173 if (! CONSTANT_P(operands[2]))
1175 lateoperands[2] = operands[2];
1177 if (REG_P (operands[2]))
1178 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1180 operands[2] = adjust_address (operands[2], HImode, 2);
1182 output_asm_insn (\"bic %2, %0\", operands);
1183 output_asm_insn (\"bic %2, %0\", lateoperands);
1187 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1188 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1190 /* these have different lengths, so we should have
1191 different constraints! */
1192 if (INTVAL(operands[2]))
1193 output_asm_insn (\"bic %2, %0\", operands);
1195 if (INTVAL(lateoperands[2]))
1196 output_asm_insn (\"bic %2, %0\", lateoperands);
1200 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1202 (define_insn "andhi3"
1203 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1204 (and:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1205 (not:HI (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1208 [(set_attr "length" "1,2,2,3")])
1210 (define_insn "andqi3"
1211 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1212 (and:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1213 (not:QI (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1216 [(set_attr "length" "1,2,2,3")])
1218 ;;- Bit set (inclusive or) instructions
1219 (define_insn "iorsi3"
1220 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1221 (ior:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1222 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
1225 { /* Here we trust that operands don't overlap
1227 or is lateoperands the low word?? - looks like it! */
1229 rtx lateoperands[3];
1231 lateoperands[0] = operands[0];
1233 if (REG_P (operands[0]))
1234 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1236 operands[0] = adjust_address (operands[0], HImode, 2);
1238 if (! CONSTANT_P(operands[2]))
1240 lateoperands[2] = operands[2];
1242 if (REG_P (operands[2]))
1243 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1245 operands[2] = adjust_address (operands[2], HImode, 2);
1247 output_asm_insn (\"bis %2, %0\", operands);
1248 output_asm_insn (\"bis %2, %0\", lateoperands);
1252 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1253 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1255 /* these have different lengths, so we should have
1256 different constraints! */
1257 if (INTVAL(operands[2]))
1258 output_asm_insn (\"bis %2, %0\", operands);
1260 if (INTVAL(lateoperands[2]))
1261 output_asm_insn (\"bis %2, %0\", lateoperands);
1265 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1267 (define_insn "iorhi3"
1268 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1269 (ior:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1270 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1273 [(set_attr "length" "1,2,2,3")])
1275 (define_insn "iorqi3"
1276 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1277 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1278 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1282 ;;- xor instructions
1283 (define_insn "xorsi3"
1284 [(set (match_operand:SI 0 "register_operand" "=r")
1285 (xor:SI (match_operand:SI 1 "register_operand" "%0")
1286 (match_operand:SI 2 "arith_operand" "r")))]
1289 { /* Here we trust that operands don't overlap */
1291 rtx lateoperands[3];
1293 lateoperands[0] = operands[0];
1294 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1296 if (REG_P(operands[2]))
1298 lateoperands[2] = operands[2];
1299 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1301 output_asm_insn (\"xor %2, %0\", operands);
1302 output_asm_insn (\"xor %2, %0\", lateoperands);
1308 [(set_attr "length" "2")])
1310 (define_insn "xorhi3"
1311 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1312 (xor:HI (match_operand:HI 1 "general_operand" "%0,0")
1313 (match_operand:HI 2 "register_operand" "r,r")))]
1316 [(set_attr "length" "1,2")])
1318 ;;- one complement instructions
1320 (define_insn "one_cmplhi2"
1321 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1322 (not:HI (match_operand:HI 1 "general_operand" "0,0")))]
1325 [(set_attr "length" "1,2")])
1327 (define_insn "one_cmplqi2"
1328 [(set (match_operand:QI 0 "general_operand" "=rR,rR")
1329 (not:QI (match_operand:QI 1 "general_operand" "0,g")))]
1333 movb %1, %0\; comb %0"
1334 [(set_attr "length" "1,2")])
1336 ;;- arithmetic shift instructions
1337 (define_insn "ashlsi3"
1338 [(set (match_operand:SI 0 "register_operand" "=r,r")
1339 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
1340 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1343 [(set_attr "length" "1,2")])
1345 ;; Arithmetic right shift on the pdp works by negating the shift count.
1346 (define_expand "ashrsi3"
1347 [(set (match_operand:SI 0 "register_operand" "=r")
1348 (ashift:SI (match_operand:SI 1 "register_operand" "0")
1349 (match_operand:HI 2 "general_operand" "g")))]
1353 operands[2] = negate_rtx (HImode, operands[2]);
1356 ;; define asl aslb asr asrb - ashc missing!
1360 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1361 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1365 [(set_attr "length" "1,2")])
1367 ;; and another possibility for asr is << -1
1368 ;; might cause problems since -1 can also be encoded as 65535!
1373 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1374 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1378 [(set_attr "length" "1,2")])
1382 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1383 (lshiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
1387 [(set_attr "length" "1,2")])
1389 (define_insn "lshrsi3"
1390 [(set (match_operand:SI 0 "register_operand" "=r")
1391 (lshiftrt:SI (match_operand:SI 1 "general_operand" "0")
1396 rtx lateoperands[2];
1398 lateoperands[0] = operands[0];
1399 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1401 lateoperands[1] = operands[1];
1402 operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
1404 output_asm_insn (\"clc\", operands);
1405 output_asm_insn (\"ror %0\", lateoperands);
1406 output_asm_insn (\"ror %0\", operands);
1410 [(set_attr "length" "5")])
1412 ;; shift is by arbitrary count is expensive,
1413 ;; shift by one cheap - so let's do that, if
1414 ;; space doesn't matter
1416 [(set (match_operand:HI 0 "general_operand" "=r")
1417 (ashift:HI (match_operand:HI 1 "general_operand" "0")
1418 (match_operand:HI 2 "expand_shift_operand" "O")))]
1424 for (i = 1; i <= abs(INTVAL(operands[2])); i++)
1425 if (INTVAL(operands[2]) < 0)
1426 output_asm_insn(\"asr %0\", operands);
1428 output_asm_insn(\"asl %0\", operands);
1433 [(set (attr "length") (const_int 4))])
1437 [(set (match_operand:QI 0 "general_operand" "=r,o")
1438 (ashift:QI (match_operand:QI 1 "general_operand" "0,0")
1439 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1442 { /* allowing predec or post_inc is possible, but hairy! */
1445 cnt = INTVAL(operands[2]) & 0x0007;
1447 for (i=0 ; i < cnt ; i++)
1448 output_asm_insn(\"aslb %0\", operands);
1452 ;; set attribute length ( match_dup 2 & 7 ) *(1 or 2) !!!
1453 [(set_attr_alternative "length"
1459 ; [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1460 ; (ashiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
1464 ; [(set_attr "length" "1,2")])
1468 [(set (match_operand:QI 0 "general_operand" "=r,o")
1469 (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0")
1470 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1473 { /* allowing predec or post_inc is possible, but hairy! */
1476 cnt = INTVAL(operands[2]) & 0x0007;
1478 for (i=0 ; i < cnt ; i++)
1479 output_asm_insn(\"asrb %0\", operands);
1483 [(set_attr_alternative "length"
1487 ;; the following is invalid - too complex!!! - just say 14 !!!
1488 ; [(set (attr "length") (plus (and (match_dup 2)
1490 ; (and (match_dup 2)
1491 ; (const_int 7))))])
1495 ;; can we get +-1 in the next pattern? should
1496 ;; have been caught by previous patterns!
1498 (define_insn "ashlhi3"
1499 [(set (match_operand:HI 0 "register_operand" "=r,r")
1500 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
1501 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1505 if (GET_CODE(operands[2]) == CONST_INT)
1507 if (INTVAL(operands[2]) == 1)
1509 else if (INTVAL(operands[2]) == -1)
1513 return \"ash %2,%0\";
1515 [(set_attr "length" "1,2")])
1517 ;; Arithmetic right shift on the pdp works by negating the shift count.
1518 (define_expand "ashrhi3"
1519 [(set (match_operand:HI 0 "register_operand" "=r")
1520 (ashift:HI (match_operand:HI 1 "register_operand" "0")
1521 (match_operand:HI 2 "general_operand" "g")))]
1525 operands[2] = negate_rtx (HImode, operands[2]);
1528 ;;;;- logical shift instructions
1529 ;;(define_insn "lshrsi3"
1530 ;; [(set (match_operand:HI 0 "register_operand" "=r")
1531 ;; (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
1532 ;; (match_operand:HI 2 "arith_operand" "rI")))]
1538 (define_insn "absdf2"
1539 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1540 (abs:DF (match_operand:DF 1 "general_operand" "0,0")))]
1543 [(set_attr "length" "1,2")])
1545 (define_insn "abshi2"
1546 [(set (match_operand:HI 0 "general_operand" "=r,o")
1547 (abs:HI (match_operand:HI 1 "general_operand" "0,0")))]
1548 "TARGET_ABSHI_BUILTIN"
1551 static int count = 0;
1554 output_asm_insn(\"tst %0\", operands);
1555 sprintf(buf, \"bge abshi%d\", count);
1556 output_asm_insn(buf, NULL);
1557 output_asm_insn(\"neg %0\", operands);
1558 sprintf(buf, \"\\nabshi%d:\", count++);
1559 output_asm_insn(buf, NULL);
1563 [(set_attr "length" "3,5")])
1566 ;; define expand abshi - is much better !!! - but
1567 ;; will it be optimized into an abshi2 ?
1568 ;; it will leave better code, because the tsthi might be
1570 ; -- just a thought - don't have time to check
1572 ;(define_expand "abshi2"
1573 ; [(match_operand:HI 0 "general_operand" "")
1574 ; (match_operand:HI 1 "general_operand" "")]
1578 ; rtx label = gen_label_rtx ();
1580 ; /* do I need this? */
1581 ; do_pending_stack_adjust ();
1583 ; emit_move_insn (operands[0], operands[1]);
1585 ; emit_insn (gen_tsthi (operands[0]));
1586 ; emit_insn (gen_bge (label1));
1588 ; emit_insn (gen_neghi(operands[0], operands[0])
1592 ; emit_label (label);
1594 ; /* allow REG_NOTES to be set on last insn (labels don't have enough
1595 ; fields, and can't be used for REG_NOTES anyway). */
1596 ; emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
1602 (define_insn "negdf2"
1603 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1604 (neg:DF (match_operand:DF 1 "register_operand" "0,0")))]
1607 [(set_attr "length" "1,2")])
1609 (define_insn "negsi2"
1610 [(set (match_operand:SI 0 "register_operand" "=r")
1611 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
1615 rtx lateoperands[2];
1617 lateoperands[0] = operands[0];
1618 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1620 lateoperands[1] = operands[1];
1621 operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
1623 output_asm_insn (\"com %0\", operands);
1624 output_asm_insn (\"com %0\", lateoperands);
1625 output_asm_insn (\"inc %0\", operands);
1626 output_asm_insn (\"adc %0\", lateoperands);
1630 [(set_attr "length" "5")])
1632 (define_insn "neghi2"
1633 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1634 (neg:HI (match_operand:HI 1 "general_operand" "0,0")))]
1637 [(set_attr "length" "1,2")])
1639 (define_insn "negqi2"
1640 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1641 (neg:QI (match_operand:QI 1 "general_operand" "0,0")))]
1644 [(set_attr "length" "1,2")])
1647 ;; Unconditional and other jump instructions
1650 (label_ref (match_operand 0 "" "")))]
1653 [(set_attr "length" "2")])
1657 (label_ref (match_operand 0 "" "")))
1658 (clobber (const_int 1))]
1661 [(set_attr "length" "2")])
1663 (define_insn "tablejump"
1664 [(set (pc) (match_operand:HI 0 "general_operand" "rR,Q"))
1665 (use (label_ref (match_operand 1 "" "")))]
1668 [(set_attr "length" "1,2")])
1670 ;; indirect jump - let's be conservative!
1671 ;; allow only register_operand, even though we could also
1672 ;; allow labels etc.
1674 (define_insn "indirect_jump"
1675 [(set (pc) (match_operand:HI 0 "register_operand" "r"))]
1679 ;;- jump to subroutine
1682 [(call (match_operand:HI 0 "general_operand" "rR,Q")
1683 (match_operand:HI 1 "general_operand" "g,g"))
1684 ;; (use (reg:HI 0)) what was that ???
1686 ;;- Don't use operand 1 for most machines.
1689 [(set_attr "length" "1,2")])
1691 ;;- jump to subroutine
1692 (define_insn "call_value"
1693 [(set (match_operand 0 "" "")
1694 (call (match_operand:HI 1 "general_operand" "rR,Q")
1695 (match_operand:HI 2 "general_operand" "g,g")))
1696 ;; (use (reg:HI 0)) - what was that ????
1698 ;;- Don't use operand 2 for most machines.
1701 [(set_attr "length" "1,2")])
1712 (define_insn "muldf3"
1713 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1714 (mult:DF (match_operand:DF 1 "register_operand" "%0,0,0")
1715 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1717 "{muld|mulf} %2, %0"
1718 [(set_attr "length" "1,2,5")])
1720 ;; 16 bit result multiply:
1721 ;; currently we multiply only into odd registers, so we don't use two
1722 ;; registers - but this is a bit inefficient at times. If we define
1723 ;; a register class for each register, then we can specify properly
1724 ;; which register need which scratch register ....
1726 (define_insn "mulhi3"
1727 [(set (match_operand:HI 0 "register_operand" "=d,d") ; multiply regs
1728 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
1729 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1732 [(set_attr "length" "1,2")])
1735 (define_expand "mulhisi3"
1737 (match_operand:HI 1 "general_operand" "g,g"))
1738 (set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1739 (mult:SI (truncate:HI
1741 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1743 "operands[3] = gen_lowpart(HImode, operands[1]);")
1746 [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1747 (mult:SI (truncate:HI
1748 (match_operand:SI 1 "register_operand" "%0,0"))
1749 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1752 [(set_attr "length" "1,2")])
1754 ;(define_insn "mulhisi3"
1755 ; [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1756 ; (mult:SI (truncate:HI
1757 ; (match_operand:SI 1 "register_operand" "%0,0"))
1758 ; (match_operand:HI 2 "general_operand" "rR,Qi")))]
1761 ; [(set_attr "length" "1,2")])
1764 (define_insn "divdf3"
1765 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1766 (div:DF (match_operand:DF 1 "register_operand" "0,0,0")
1767 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1769 "{divd|divf} %2, %0"
1770 [(set_attr "length" "1,2,5")])
1773 (define_expand "divhi3"
1774 [(set (subreg:HI (match_dup 1) 0)
1775 (div:HI (match_operand:SI 1 "general_operand" "0")
1776 (match_operand:HI 2 "general_operand" "g")))
1777 (set (match_operand:HI 0 "general_operand" "=r")
1778 (subreg:HI (match_dup 1) 0))]
1783 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1784 (div:HI (match_operand:SI 1 "general_operand" "0")
1785 (match_operand:HI 2 "general_operand" "g")))]
1788 [(set_attr "length" "2")])
1790 (define_expand "modhi3"
1791 [(set (subreg:HI (match_dup 1) 2)
1792 (mod:HI (match_operand:SI 1 "general_operand" "0")
1793 (match_operand:HI 2 "general_operand" "g")))
1794 (set (match_operand:HI 0 "general_operand" "=r")
1795 (subreg:HI (match_dup 1) 2))]
1800 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 2)
1801 (mod:HI (match_operand:SI 1 "general_operand" "0")
1802 (match_operand:HI 2 "general_operand" "g")))]
1805 [(set_attr "length" "2")])
1807 ;(define_expand "divmodhi4"
1808 ; [(parallel [(set (subreg:HI (match_dup 1) 0)
1809 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1810 ; (match_operand:HI 2 "general_operand" "g")))
1811 ; (set (subreg:HI (match_dup 1) 2)
1812 ; (mod:HI (match_dup 1)
1814 ; (set (match_operand:HI 3 "general_operand" "=r")
1815 ; (subreg:HI (match_dup 1) 2))
1816 ; (set (match_operand:HI 0 "general_operand" "=r")
1817 ; (subreg:HI (match_dup 1) 0))]
1822 ; [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1823 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1824 ; (match_operand:HI 2 "general_operand" "g")))
1825 ; (set (subreg:HI (match_dup 0) 2)
1826 ; (mod:HI (match_dup 1)
1832 ;; is rotate doing the right thing to be included here ????