1 ;;- Machine description for the pdp11 for GNU C compiler
2 ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2004, 2005
3 ;; 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 2, 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 COPYING. If not, write to
20 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 ;; Boston, MA 02110-1301, USA.
27 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
29 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
30 ;;- updates for most instructions.
32 ;;- Operand classes for the register allocator:
34 ;; Compare instructions.
36 ;; currently we only support df floats, which saves us quite some
37 ;; hassle switching the FP mode!
38 ;; we assume that CPU is always in long float mode, and
39 ;; 16 bit integer mode - currently, the prologue for main does this,
40 ;; but maybe we should just set up a NEW crt0 properly,
41 ;; -- and what about signal handling code?
42 ;; (we don't even let sf floats in the register file, so
43 ;; we only should have to worry about truncating and widening
44 ;; when going to memory)
46 ;; abort() call by g++ - must define libfunc for cmp_optab
47 ;; and ucmp_optab for mode SImode, because we don't have that!!!
48 ;; - yet since no libfunc is there, we abort ()
50 ;; The only thing that remains to be done then is output
51 ;; the floats in a way the assembler can handle it (and
52 ;; if you're really into it, use a PDP11 float emulation
53 ;; library to do floating point constant folding - but
54 ;; I guess you'll get reasonable results even when not
56 ;; the last thing to do is fix the UPDATE_CC macro to check
57 ;; for floating point condition codes, and set cc_status
58 ;; properly, also setting the CC_IN_FCCR flag.
61 ;; currently type is only fpu or arith or unknown, maybe branch later ?
63 (define_attr "type" "unknown,arith,fp" (const_string "arith"))
65 ;; length default is 1 word each
66 (define_attr "length" "" (const_int 1))
68 ;; a user's asm statement
69 (define_asm_attributes
70 [(set_attr "type" "unknown")
71 ; all bets are off how long it is - make it 256, forces long jumps
72 ; whenever jumping around it !!!
73 (set_attr "length" "256")])
75 ;; define function units
77 ;; arithmetic - values here immediately when next insn issued
78 ;; or does it mean the number of cycles after this insn was issued?
79 ;; how do I say that fpu insns use cpu also? (pre-interaction phase)
81 ;(define_function_unit "cpu" 1 1 (eq_attr "type" "arith") 0 0)
82 ;(define_function_unit "fpu" 1 1 (eq_attr "type" "fp") 0 0)
87 (compare (match_operand:DF 0 "general_operand" "fR,Q,F")
88 (match_operand:DF 1 "register_operand" "a,a,a")))]
92 cc_status.flags = CC_IN_FPU;
93 return \"{cmpd|cmpf} %0, %1\;cfcc\";
95 [(set_attr "length" "2,3,6")])
97 ;; a bit of brain damage, maybe inline later -
98 ;; problem is - gcc seems to NEED SImode because
99 ;; of the cmp weirdness - maybe change gcc to handle this?
101 (define_expand "cmpsi"
103 (match_operand:SI 0 "general_operand" "g"))
105 (match_operand:SI 1 "general_operand" "g"))
106 (parallel [(set (cc0)
109 (clobber (reg:SI 0))])]
110 "0" ;; disable for test
113 ;; check for next insn for branch code - does this still
120 (clobber (reg:SI 0))]
124 rtx br_insn = NEXT_INSN (insn);
127 gcc_assert (GET_CODE (br_insn) == JUMP_INSN);
128 br_code = GET_CODE (XEXP (XEXP (PATTERN (br_insn), 1), 0));
137 return \"jsr pc, ___ucmpsi\;cmp $1,r0\";
146 return \"jsr pc, ___cmpsi\;tst r0\";
153 [(set_attr "length" "4")])
158 (compare (match_operand:HI 0 "general_operand" "rR,rR,Qi,Qi")
159 (match_operand:HI 1 "general_operand" "rR,Qi,rR,Qi")))]
162 [(set_attr "length" "1,2,2,3")])
166 (compare (match_operand:QI 0 "general_operand" "rR,rR,Qi,Qi")
167 (match_operand:QI 1 "general_operand" "rR,Qi,rR,Qi")))]
170 [(set_attr "length" "1,2,2,3")])
173 ;; We have to have this because cse can optimize the previous pattern
178 (match_operand:DF 0 "general_operand" "fR,Q"))]
182 cc_status.flags = CC_IN_FPU;
183 return \"{tstd|tstf} %0\;cfcc\";
185 [(set_attr "length" "2,3")])
188 (define_expand "tstsi"
190 (match_operand:SI 0 "general_operand" "g"))
191 (parallel [(set (cc0)
193 (clobber (reg:SI 0))])]
194 "0" ;; disable for test
200 (clobber (reg:SI 0))]
202 "jsr pc, ___tstsi\;tst r0"
203 [(set_attr "length" "3")])
208 (match_operand:HI 0 "general_operand" "rR,Q"))]
211 [(set_attr "length" "1,2")])
215 (match_operand:QI 0 "general_operand" "rR,Q"))]
218 [(set_attr "length" "1,2")])
220 ;; sob instruction - we need an assembler which can make this instruction
221 ;; valid under _all_ circumstances!
226 (ne (plus:HI (match_operand:HI 0 "register_operand" "+r")
229 (label_ref (match_operand 1 "" ""))
232 (plus:HI (match_dup 0)
237 static int labelcount = 0;
238 static char buf[1000];
240 if (get_attr_length (insn) == 1)
241 return \"sob %0, %l1\";
244 output_asm_insn (\"dec %0\", operands);
246 sprintf (buf, \"bge LONG_SOB%d\", labelcount);
247 output_asm_insn (buf, NULL);
249 output_asm_insn (\"jmp %l1\", operands);
251 sprintf (buf, \"LONG_SOB%d:\", labelcount++);
252 output_asm_insn (buf, NULL);
256 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
259 (ge (minus (match_dup 0)
265 ;; These control RTL generation for conditional jump insns
266 ;; and match them for register allocation.
268 ;; problem with too short jump distance! we need an assembler which can
269 ;; make this valid for all jump distances!
272 ;; these must be changed to check for CC_IN_FCCR if float is to be
277 (if_then_else (eq (cc0)
279 (label_ref (match_operand 0 "" ""))
282 "* return output_jump(\"beq\", \"bne\", get_attr_length(insn));"
283 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
286 (ge (minus (match_dup 0)
295 (if_then_else (ne (cc0)
297 (label_ref (match_operand 0 "" ""))
300 "* return output_jump(\"bne\", \"beq\", get_attr_length(insn));"
301 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
304 (ge (minus (match_dup 0)
312 (if_then_else (gt (cc0)
314 (label_ref (match_operand 0 "" ""))
317 "* return output_jump(\"bgt\", \"ble\", get_attr_length(insn));"
318 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
321 (ge (minus (match_dup 0)
329 (if_then_else (gtu (cc0)
331 (label_ref (match_operand 0 "" ""))
334 "* return output_jump(\"bhi\", \"blos\", get_attr_length(insn));"
335 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
338 (ge (minus (match_dup 0)
346 (if_then_else (lt (cc0)
348 (label_ref (match_operand 0 "" ""))
351 "* return output_jump(\"blt\", \"bge\", get_attr_length(insn));"
352 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
355 (ge (minus (match_dup 0)
364 (if_then_else (ltu (cc0)
366 (label_ref (match_operand 0 "" ""))
369 "* return output_jump(\"blo\", \"bhis\", get_attr_length(insn));"
370 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
373 (ge (minus (match_dup 0)
381 (if_then_else (ge (cc0)
383 (label_ref (match_operand 0 "" ""))
386 "* return output_jump(\"bge\", \"blt\", get_attr_length(insn));"
387 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
390 (ge (minus (match_dup 0)
398 (if_then_else (geu (cc0)
400 (label_ref (match_operand 0 "" ""))
403 "* return output_jump(\"bhis\", \"blo\", get_attr_length(insn));"
404 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
407 (ge (minus (match_dup 0)
415 (if_then_else (le (cc0)
417 (label_ref (match_operand 0 "" ""))
420 "* return output_jump(\"ble\", \"bgt\", get_attr_length(insn));"
421 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
424 (ge (minus (match_dup 0)
432 (if_then_else (leu (cc0)
434 (label_ref (match_operand 0 "" ""))
437 "* return output_jump(\"blos\", \"bhi\", get_attr_length(insn));"
438 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
441 (ge (minus (match_dup 0)
448 ;; These match inverted jump insns for register allocation.
452 (if_then_else (eq (cc0)
455 (label_ref (match_operand 0 "" ""))))]
457 "* return output_jump(\"bne\", \"beq\", get_attr_length(insn));"
458 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
461 (ge (minus (match_dup 0)
469 (if_then_else (ne (cc0)
472 (label_ref (match_operand 0 "" ""))))]
474 "* return output_jump(\"beq\", \"bne\", get_attr_length(insn));"
475 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
478 (ge (minus (match_dup 0)
486 (if_then_else (gt (cc0)
489 (label_ref (match_operand 0 "" ""))))]
491 "* return output_jump(\"ble\", \"bgt\", get_attr_length(insn));"
492 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
495 (ge (minus (match_dup 0)
503 (if_then_else (gtu (cc0)
506 (label_ref (match_operand 0 "" ""))))]
508 "* return output_jump(\"blos\", \"bhi\", get_attr_length(insn));"
509 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
512 (ge (minus (match_dup 0)
520 (if_then_else (lt (cc0)
523 (label_ref (match_operand 0 "" ""))))]
525 "* return output_jump(\"bge\", \"blt\", get_attr_length(insn));"
526 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
529 (ge (minus (match_dup 0)
537 (if_then_else (ltu (cc0)
540 (label_ref (match_operand 0 "" ""))))]
542 "* return output_jump(\"bhis\", \"blo\", get_attr_length(insn));"
543 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
546 (ge (minus (match_dup 0)
554 (if_then_else (ge (cc0)
557 (label_ref (match_operand 0 "" ""))))]
559 "* return output_jump(\"blt\", \"bge\", get_attr_length(insn));"
560 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
563 (ge (minus (match_dup 0)
571 (if_then_else (geu (cc0)
574 (label_ref (match_operand 0 "" ""))))]
576 "* return output_jump(\"blo\", \"bhis\", get_attr_length(insn));"
577 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
580 (ge (minus (match_dup 0)
588 (if_then_else (le (cc0)
591 (label_ref (match_operand 0 "" ""))))]
593 "* return output_jump(\"bgt\", \"ble\", get_attr_length(insn));"
594 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
597 (ge (minus (match_dup 0)
605 (if_then_else (leu (cc0)
608 (label_ref (match_operand 0 "" ""))))]
610 "* return output_jump(\"bhi\", \"blos\", get_attr_length(insn));"
611 [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0)
614 (ge (minus (match_dup 0)
623 [(set (match_operand:DI 0 "general_operand" "=g,rm,o")
624 (match_operand:DI 1 "general_operand" "m,r,a"))]
626 "* return output_move_quad (operands);"
627 ;; what's the mose expensive code - say twice movsi = 16
628 [(set_attr "length" "16,16,16")])
631 [(set (match_operand:SI 0 "general_operand" "=r,r,r,rm,m")
632 (match_operand:SI 1 "general_operand" "rN,IJ,K,m,r"))]
634 "* return output_move_double (operands);"
635 ;; what's the most expensive code ? - I think 8!
636 ;; we could split it up and make several sub-cases...
637 [(set_attr "length" "2,3,4,8,8")])
640 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
641 (match_operand:HI 1 "general_operand" "rRN,Qi,rRN,Qi"))]
645 if (operands[1] == const0_rtx)
648 return \"mov %1, %0\";
650 [(set_attr "length" "1,2,2,3")])
653 [(set (match_operand:QI 0 "nonimmediate_operand" "=g")
654 (match_operand:QI 1 "general_operand" "g"))]
658 if (operands[1] == const0_rtx)
661 return \"movb %1, %0\";
663 [(set_attr "length" "1")])
665 ;; do we have to supply all these moves? e.g. to
666 ;; NO_LOAD_FPU_REGs ?
668 [(set (match_operand:DF 0 "general_operand" "=a,fR,a,Q,m")
669 (match_operand:DF 1 "general_operand" "fFR,a,Q,a,m"))]
671 "* if (which_alternative ==0)
672 return \"ldd %1, %0\";
673 else if (which_alternative == 1)
674 return \"std %1, %0\";
676 return output_move_quad (operands); "
678 [(set_attr "length" "1,1,5,5,16")])
681 [(set (match_operand:SF 0 "general_operand" "=g,r,g")
682 (match_operand:SF 1 "general_operand" "r,rmF,g"))]
684 "* return output_move_double (operands);"
685 [(set_attr "length" "8,8,8")])
687 ;; maybe fiddle a bit with move_ratio, then
688 ;; let constraints only accept a register ...
690 (define_expand "movmemhi"
691 [(parallel [(set (match_operand:BLK 0 "general_operand" "=g,g")
692 (match_operand:BLK 1 "general_operand" "g,g"))
693 (use (match_operand:HI 2 "arith_operand" "n,&mr"))
694 (use (match_operand:HI 3 "immediate_operand" "i,i"))
695 (clobber (match_scratch:HI 4 "=&r,X"))
696 (clobber (match_dup 5))
697 (clobber (match_dup 6))
698 (clobber (match_dup 2))])]
699 "(TARGET_BCOPY_BUILTIN)"
703 = replace_equiv_address (operands[0],
704 copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
706 = replace_equiv_address (operands[1],
707 copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
709 operands[5] = XEXP (operands[0], 0);
710 operands[6] = XEXP (operands[1], 0);
714 (define_insn "" ; "movmemhi"
715 [(set (mem:BLK (match_operand:HI 0 "general_operand" "=r,r"))
716 (mem:BLK (match_operand:HI 1 "general_operand" "r,r")))
717 (use (match_operand:HI 2 "arith_operand" "n,&r"))
718 (use (match_operand:HI 3 "immediate_operand" "i,i"))
719 (clobber (match_scratch:HI 4 "=&r,X"))
720 (clobber (match_dup 0))
721 (clobber (match_dup 1))
722 (clobber (match_dup 2))]
723 "(TARGET_BCOPY_BUILTIN)"
724 "* return output_block_move (operands);"
726 [(set_attr "length" "40")])
730 ;;- truncation instructions
732 (define_insn "truncdfsf2"
733 [(set (match_operand:SF 0 "general_operand" "=r,R,Q")
734 (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a,a")))]
736 "* if (which_alternative ==0)
738 output_asm_insn(\"{stcdf|movfo} %1, -(sp)\", operands);
739 output_asm_insn(\"mov (sp)+, %0\", operands);
740 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+1);
741 output_asm_insn(\"mov (sp)+, %0\", operands);
744 else if (which_alternative == 1)
745 return \"{stcdf|movfo} %1, %0\";
747 return \"{stcdf|movfo} %1, %0\";
749 [(set_attr "length" "3,1,2")])
752 (define_expand "truncsihi2"
753 [(set (match_operand:HI 0 "general_operand" "=g")
755 (match_operand:SI 1 "general_operand" "or")
761 ;;- zero extension instructions
763 (define_insn "zero_extendqihi2"
764 [(set (match_operand:HI 0 "general_operand" "=r")
765 (zero_extend:HI (match_operand:QI 1 "general_operand" "0")))]
768 [(set_attr "length" "2")])
770 (define_expand "zero_extendhisi2"
774 (match_operand:HI 1 "register_operand" "r"))
776 (match_operand:SI 0 "register_operand" "=r")
780 "/* operands[1] = make_safe_from (operands[1], operands[0]); */")
783 ;;- sign extension instructions
785 (define_insn "extendsfdf2"
786 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
787 (float_extend:DF (match_operand:SF 1 "general_operand" "r,R,Q")))]
790 mov %1, -(sp)\;{ldcfd|movof} (sp)+,%0
792 {ldcfd|movof} %1, %0"
793 [(set_attr "length" "2,1,2")])
795 ;; does movb sign extend in register-to-register move?
796 (define_insn "extendqihi2"
797 [(set (match_operand:HI 0 "register_operand" "=r,r")
798 (sign_extend:HI (match_operand:QI 1 "general_operand" "rR,Q")))]
801 [(set_attr "length" "1,2")])
803 (define_insn "extendqisi2"
804 [(set (match_operand:SI 0 "register_operand" "=r,r")
805 (sign_extend:SI (match_operand:QI 1 "general_operand" "rR,Q")))]
811 /* make register pair available */
812 latehalf[0] = operands[0];
813 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+ 1);
815 output_asm_insn(\"movb %1, %0\", operands);
816 output_asm_insn(\"sxt %0\", latehalf);
820 [(set_attr "length" "2,3")])
822 ;; maybe we have to use define_expand to say that we have the instruction,
823 ;; unconditionally, and then match dependent on CPU type:
825 (define_expand "extendhisi2"
826 [(set (match_operand:SI 0 "general_operand" "=g")
827 (sign_extend:SI (match_operand:HI 1 "general_operand" "g")))]
831 (define_insn "" ; "extendhisi2"
832 [(set (match_operand:SI 0 "general_operand" "=o,<,r")
833 (sign_extend:SI (match_operand:HI 1 "general_operand" "g,g,g")))]
839 /* we don't want to mess with auto increment */
841 switch (which_alternative)
845 latehalf[0] = operands[0];
846 operands[0] = adjust_address(operands[0], HImode, 2);
848 output_asm_insn(\"mov %1, %0\", operands);
849 output_asm_insn(\"sxt %0\", latehalf);
855 /* - auto-decrement - right direction ;-) */
856 output_asm_insn(\"mov %1, %0\", operands);
857 output_asm_insn(\"sxt %0\", operands);
863 /* make register pair available */
864 latehalf[0] = operands[0];
865 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
867 output_asm_insn(\"mov %1, %0\", operands);
868 output_asm_insn(\"sxt %0\", latehalf);
877 [(set_attr "length" "5,3,3")])
881 [(set (match_operand:SI 0 "register_operand" "=r")
882 (sign_extend:SI (match_operand:HI 1 "general_operand" "0")))]
886 static int count = 0;
890 lateoperands[0] = operands[0];
891 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
893 output_asm_insn(\"tst %0\", operands);
894 sprintf(buf, \"bge extendhisi%d\", count);
895 output_asm_insn(buf, NULL);
896 output_asm_insn(\"mov -1, %0\", lateoperands);
897 sprintf(buf, \"bne extendhisi%d\", count+1);
898 output_asm_insn(buf, NULL);
899 sprintf(buf, \"\\nextendhisi%d:\", count);
900 output_asm_insn(buf, NULL);
901 output_asm_insn(\"clr %0\", lateoperands);
902 sprintf(buf, \"\\nextendhisi%d:\", count+1);
903 output_asm_insn(buf, NULL);
909 [(set_attr "length" "6")])
911 ;; make float to int and vice versa
912 ;; using the cc_status.flag field we could probably cut down
914 ;; assume that we are normally in double and integer mode -
915 ;; what do pdp library routines do to fpu mode ?
917 (define_insn "floatsidf2"
918 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
919 (float:DF (match_operand:SI 1 "general_operand" "r,R,Q")))]
921 "* if (which_alternative ==0)
926 latehalf[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
927 output_asm_insn(\"mov %1, -(sp)\", latehalf);
928 output_asm_insn(\"mov %1, -(sp)\", operands);
930 output_asm_insn(\"setl\", operands);
931 output_asm_insn(\"{ldcld|movif} (sp)+, %0\", operands);
932 output_asm_insn(\"seti\", operands);
935 else if (which_alternative == 1)
936 return \"setl\;{ldcld|movif} %1, %0\;seti\";
938 return \"setl\;{ldcld|movif} %1, %0\;seti\";
940 [(set_attr "length" "5,3,4")])
942 (define_insn "floathidf2"
943 [(set (match_operand:DF 0 "register_operand" "=a,a")
944 (float:DF (match_operand:HI 1 "general_operand" "rR,Qi")))]
946 "{ldcid|movif} %1, %0"
947 [(set_attr "length" "1,2")])
950 (define_insn "fix_truncdfsi2"
951 [(set (match_operand:SI 0 "general_operand" "=r,R,Q")
952 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a,a"))))]
954 "* if (which_alternative ==0)
956 output_asm_insn(\"setl\", operands);
957 output_asm_insn(\"{stcdl|movfi} %1, -(sp)\", operands);
958 output_asm_insn(\"seti\", operands);
959 output_asm_insn(\"mov (sp)+, %0\", operands);
960 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
961 output_asm_insn(\"mov (sp)+, %0\", operands);
964 else if (which_alternative == 1)
965 return \"setl\;{stcdl|movfi} %1, %0\;seti\";
967 return \"setl\;{stcdl|movfi} %1, %0\;seti\";
969 [(set_attr "length" "5,3,4")])
971 (define_insn "fix_truncdfhi2"
972 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
973 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "a,a"))))]
975 "{stcdi|movfi} %1, %0"
976 [(set_attr "length" "1,2")])
979 ;;- arithmetic instructions
982 (define_insn "adddf3"
983 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
984 (plus:DF (match_operand:DF 1 "register_operand" "%0,0,0")
985 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
988 [(set_attr "length" "1,2,5")])
990 (define_insn "addsi3"
991 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
992 (plus:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
993 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
996 { /* Here we trust that operands don't overlap
998 or is lateoperands the low word?? - looks like it! */
1000 rtx lateoperands[3];
1002 lateoperands[0] = operands[0];
1004 if (REG_P (operands[0]))
1005 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1007 operands[0] = adjust_address (operands[0], HImode, 2);
1009 if (! CONSTANT_P(operands[2]))
1011 lateoperands[2] = operands[2];
1013 if (REG_P (operands[2]))
1014 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1016 operands[2] = adjust_address (operands[2], HImode, 2);
1018 output_asm_insn (\"add %2, %0\", operands);
1019 output_asm_insn (\"adc %0\", lateoperands);
1020 output_asm_insn (\"add %2, %0\", lateoperands);
1024 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1025 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1027 if (INTVAL(operands[2]))
1029 output_asm_insn (\"add %2, %0\", operands);
1030 output_asm_insn (\"adc %0\", lateoperands);
1033 if (INTVAL(lateoperands[2]))
1034 output_asm_insn (\"add %2, %0\", lateoperands);
1038 [(set_attr "length" "3,5,6,8,3,1,5,5,3,8")])
1040 (define_insn "addhi3"
1041 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1042 (plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1043 (match_operand:HI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1047 if (GET_CODE (operands[2]) == CONST_INT)
1049 if (INTVAL(operands[2]) == 1)
1051 else if (INTVAL(operands[2]) == -1)
1055 return \"add %2, %0\";
1057 [(set_attr "length" "1,2,2,3")])
1059 (define_insn "addqi3"
1060 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1061 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1062 (match_operand:QI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1066 if (GET_CODE (operands[2]) == CONST_INT)
1068 if (INTVAL(operands[2]) == 1)
1070 else if (INTVAL(operands[2]) == -1)
1074 return \"add %2, %0\";
1076 [(set_attr "length" "1,2,2,3")])
1079 ;;- subtract instructions
1080 ;; we don't have to care for constant second
1081 ;; args, since they are canonical plus:xx now!
1082 ;; also for minus:DF ??
1084 (define_insn "subdf3"
1085 [(set (match_operand:DF 0 "register_operand" "=a,a")
1086 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
1087 (match_operand:DF 2 "general_operand" "fR,Q")))]
1089 "{subd|subf} %2, %0"
1090 [(set_attr "length" "1,2")])
1092 (define_insn "subsi3"
1093 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o")
1094 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
1095 (match_operand:SI 2 "general_operand" "r,o,r,o")))]
1098 { /* Here we trust that operands don't overlap
1100 or is lateoperands the low word?? - looks like it! */
1102 rtx lateoperands[3];
1104 lateoperands[0] = operands[0];
1106 if (REG_P (operands[0]))
1107 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1109 operands[0] = adjust_address (operands[0], HImode, 2);
1111 lateoperands[2] = operands[2];
1113 if (REG_P (operands[2]))
1114 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1116 operands[2] = adjust_address (operands[2], HImode, 2);
1118 output_asm_insn (\"sub %2, %0\", operands);
1119 output_asm_insn (\"sbc %0\", lateoperands);
1120 output_asm_insn (\"sub %2, %0\", lateoperands);
1123 ;; offsettable memory addresses always are expensive!!!
1124 [(set_attr "length" "3,5,6,8")])
1126 (define_insn "subhi3"
1127 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1128 (minus:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1129 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1133 gcc_assert (GET_CODE (operands[2]) != CONST_INT);
1135 return \"sub %2, %0\";
1137 [(set_attr "length" "1,2,2,3")])
1139 (define_insn "subqi3"
1140 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1141 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1142 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1146 gcc_assert (GET_CODE (operands[2]) != CONST_INT);
1148 return \"sub %2, %0\";
1150 [(set_attr "length" "1,2,2,3")])
1152 ;;;;- and instructions
1153 ;; Bit-and on the pdp (like on the VAX) is done with a clear-bits insn.
1155 (define_insn "andsi3"
1156 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1157 (and:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1158 (not:SI (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K"))))]
1161 { /* Here we trust that operands don't overlap
1163 or is lateoperands the low word?? - looks like it! */
1165 rtx lateoperands[3];
1167 lateoperands[0] = operands[0];
1169 if (REG_P (operands[0]))
1170 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1172 operands[0] = adjust_address (operands[0], HImode, 2);
1174 if (! CONSTANT_P(operands[2]))
1176 lateoperands[2] = operands[2];
1178 if (REG_P (operands[2]))
1179 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1181 operands[2] = adjust_address (operands[2], HImode, 2);
1183 output_asm_insn (\"bic %2, %0\", operands);
1184 output_asm_insn (\"bic %2, %0\", lateoperands);
1188 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1189 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1191 /* these have different lengths, so we should have
1192 different constraints! */
1193 if (INTVAL(operands[2]))
1194 output_asm_insn (\"bic %2, %0\", operands);
1196 if (INTVAL(lateoperands[2]))
1197 output_asm_insn (\"bic %2, %0\", lateoperands);
1201 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1203 (define_insn "andhi3"
1204 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1205 (and:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1206 (not:HI (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1209 [(set_attr "length" "1,2,2,3")])
1211 (define_insn "andqi3"
1212 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1213 (and:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1214 (not:QI (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1217 [(set_attr "length" "1,2,2,3")])
1219 ;;- Bit set (inclusive or) instructions
1220 (define_insn "iorsi3"
1221 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1222 (ior:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1223 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
1226 { /* Here we trust that operands don't overlap
1228 or is lateoperands the low word?? - looks like it! */
1230 rtx lateoperands[3];
1232 lateoperands[0] = operands[0];
1234 if (REG_P (operands[0]))
1235 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1237 operands[0] = adjust_address (operands[0], HImode, 2);
1239 if (! CONSTANT_P(operands[2]))
1241 lateoperands[2] = operands[2];
1243 if (REG_P (operands[2]))
1244 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1246 operands[2] = adjust_address (operands[2], HImode, 2);
1248 output_asm_insn (\"bis %2, %0\", operands);
1249 output_asm_insn (\"bis %2, %0\", lateoperands);
1253 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1254 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1256 /* these have different lengths, so we should have
1257 different constraints! */
1258 if (INTVAL(operands[2]))
1259 output_asm_insn (\"bis %2, %0\", operands);
1261 if (INTVAL(lateoperands[2]))
1262 output_asm_insn (\"bis %2, %0\", lateoperands);
1266 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1268 (define_insn "iorhi3"
1269 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1270 (ior:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1271 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1274 [(set_attr "length" "1,2,2,3")])
1276 (define_insn "iorqi3"
1277 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1278 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1279 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1283 ;;- xor instructions
1284 (define_insn "xorsi3"
1285 [(set (match_operand:SI 0 "register_operand" "=r")
1286 (xor:SI (match_operand:SI 1 "register_operand" "%0")
1287 (match_operand:SI 2 "arith_operand" "r")))]
1290 { /* Here we trust that operands don't overlap */
1292 rtx lateoperands[3];
1294 lateoperands[0] = operands[0];
1295 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1297 if (REG_P(operands[2]))
1299 lateoperands[2] = operands[2];
1300 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1302 output_asm_insn (\"xor %2, %0\", operands);
1303 output_asm_insn (\"xor %2, %0\", lateoperands);
1309 [(set_attr "length" "2")])
1311 (define_insn "xorhi3"
1312 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1313 (xor:HI (match_operand:HI 1 "general_operand" "%0,0")
1314 (match_operand:HI 2 "register_operand" "r,r")))]
1317 [(set_attr "length" "1,2")])
1319 ;;- one complement instructions
1321 (define_insn "one_cmplhi2"
1322 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1323 (not:HI (match_operand:HI 1 "general_operand" "0,0")))]
1326 [(set_attr "length" "1,2")])
1328 (define_insn "one_cmplqi2"
1329 [(set (match_operand:QI 0 "general_operand" "=rR,rR")
1330 (not:QI (match_operand:QI 1 "general_operand" "0,g")))]
1334 movb %1, %0\; comb %0"
1335 [(set_attr "length" "1,2")])
1337 ;;- arithmetic shift instructions
1338 (define_insn "ashlsi3"
1339 [(set (match_operand:SI 0 "register_operand" "=r,r")
1340 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
1341 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1344 [(set_attr "length" "1,2")])
1346 ;; Arithmetic right shift on the pdp works by negating the shift count.
1347 (define_expand "ashrsi3"
1348 [(set (match_operand:SI 0 "register_operand" "=r")
1349 (ashift:SI (match_operand:SI 1 "register_operand" "0")
1350 (match_operand:HI 2 "general_operand" "g")))]
1354 operands[2] = negate_rtx (HImode, operands[2]);
1357 ;; define asl aslb asr asrb - ashc missing!
1361 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1362 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1366 [(set_attr "length" "1,2")])
1368 ;; and another possibility for asr is << -1
1369 ;; might cause problems since -1 can also be encoded as 65535!
1374 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1375 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1379 [(set_attr "length" "1,2")])
1383 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1384 (lshiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
1388 [(set_attr "length" "1,2")])
1390 (define_insn "lshrsi3"
1391 [(set (match_operand:SI 0 "register_operand" "=r")
1392 (lshiftrt:SI (match_operand:SI 1 "general_operand" "0")
1397 rtx lateoperands[2];
1399 lateoperands[0] = operands[0];
1400 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1402 lateoperands[1] = operands[1];
1403 operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
1405 output_asm_insn (\"clc\", operands);
1406 output_asm_insn (\"ror %0\", lateoperands);
1407 output_asm_insn (\"ror %0\", operands);
1411 [(set_attr "length" "5")])
1413 ;; shift is by arbitrary count is expensive,
1414 ;; shift by one cheap - so let's do that, if
1415 ;; space doesn't matter
1417 [(set (match_operand:HI 0 "general_operand" "=r")
1418 (ashift:HI (match_operand:HI 1 "general_operand" "0")
1419 (match_operand:HI 2 "expand_shift_operand" "O")))]
1425 for (i = 1; i <= abs(INTVAL(operands[2])); i++)
1426 if (INTVAL(operands[2]) < 0)
1427 output_asm_insn(\"asr %0\", operands);
1429 output_asm_insn(\"asl %0\", operands);
1434 [(set (attr "length") (const_int 4))])
1438 [(set (match_operand:QI 0 "general_operand" "=r,o")
1439 (ashift:QI (match_operand:QI 1 "general_operand" "0,0")
1440 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1443 { /* allowing predec or post_inc is possible, but hairy! */
1446 cnt = INTVAL(operands[2]) & 0x0007;
1448 for (i=0 ; i < cnt ; i++)
1449 output_asm_insn(\"aslb %0\", operands);
1453 ;; set attribute length ( match_dup 2 & 7 ) *(1 or 2) !!!
1454 [(set_attr_alternative "length"
1460 ; [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1461 ; (ashiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
1465 ; [(set_attr "length" "1,2")])
1469 [(set (match_operand:QI 0 "general_operand" "=r,o")
1470 (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0")
1471 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1474 { /* allowing predec or post_inc is possible, but hairy! */
1477 cnt = INTVAL(operands[2]) & 0x0007;
1479 for (i=0 ; i < cnt ; i++)
1480 output_asm_insn(\"asrb %0\", operands);
1484 [(set_attr_alternative "length"
1488 ;; the following is invalid - too complex!!! - just say 14 !!!
1489 ; [(set (attr "length") (plus (and (match_dup 2)
1491 ; (and (match_dup 2)
1492 ; (const_int 7))))])
1496 ;; can we get +-1 in the next pattern? should
1497 ;; have been caught by previous patterns!
1499 (define_insn "ashlhi3"
1500 [(set (match_operand:HI 0 "register_operand" "=r,r")
1501 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
1502 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1506 if (GET_CODE(operands[2]) == CONST_INT)
1508 if (INTVAL(operands[2]) == 1)
1510 else if (INTVAL(operands[2]) == -1)
1514 return \"ash %2,%0\";
1516 [(set_attr "length" "1,2")])
1518 ;; Arithmetic right shift on the pdp works by negating the shift count.
1519 (define_expand "ashrhi3"
1520 [(set (match_operand:HI 0 "register_operand" "=r")
1521 (ashift:HI (match_operand:HI 1 "register_operand" "0")
1522 (match_operand:HI 2 "general_operand" "g")))]
1526 operands[2] = negate_rtx (HImode, operands[2]);
1529 ;;;;- logical shift instructions
1530 ;;(define_insn "lshrsi3"
1531 ;; [(set (match_operand:HI 0 "register_operand" "=r")
1532 ;; (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
1533 ;; (match_operand:HI 2 "arith_operand" "rI")))]
1539 (define_insn "absdf2"
1540 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1541 (abs:DF (match_operand:DF 1 "general_operand" "0,0")))]
1544 [(set_attr "length" "1,2")])
1546 (define_insn "abshi2"
1547 [(set (match_operand:HI 0 "general_operand" "=r,o")
1548 (abs:HI (match_operand:HI 1 "general_operand" "0,0")))]
1549 "TARGET_ABSHI_BUILTIN"
1552 static int count = 0;
1555 output_asm_insn(\"tst %0\", operands);
1556 sprintf(buf, \"bge abshi%d\", count);
1557 output_asm_insn(buf, NULL);
1558 output_asm_insn(\"neg %0\", operands);
1559 sprintf(buf, \"\\nabshi%d:\", count++);
1560 output_asm_insn(buf, NULL);
1564 [(set_attr "length" "3,5")])
1567 ;; define expand abshi - is much better !!! - but
1568 ;; will it be optimized into an abshi2 ?
1569 ;; it will leave better code, because the tsthi might be
1571 ; -- just a thought - don't have time to check
1573 ;(define_expand "abshi2"
1574 ; [(match_operand:HI 0 "general_operand" "")
1575 ; (match_operand:HI 1 "general_operand" "")]
1579 ; rtx label = gen_label_rtx ();
1581 ; /* do I need this? */
1582 ; do_pending_stack_adjust ();
1584 ; emit_move_insn (operands[0], operands[1]);
1586 ; emit_insn (gen_tsthi (operands[0]));
1587 ; emit_insn (gen_bge (label1));
1589 ; emit_insn (gen_neghi(operands[0], operands[0])
1593 ; emit_label (label);
1595 ; /* allow REG_NOTES to be set on last insn (labels don't have enough
1596 ; fields, and can't be used for REG_NOTES anyway). */
1597 ; emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
1603 (define_insn "negdf2"
1604 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1605 (neg:DF (match_operand:DF 1 "register_operand" "0,0")))]
1608 [(set_attr "length" "1,2")])
1610 (define_insn "negsi2"
1611 [(set (match_operand:SI 0 "register_operand" "=r")
1612 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
1616 rtx lateoperands[2];
1618 lateoperands[0] = operands[0];
1619 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1621 lateoperands[1] = operands[1];
1622 operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
1624 output_asm_insn (\"com %0\", operands);
1625 output_asm_insn (\"com %0\", lateoperands);
1626 output_asm_insn (\"inc %0\", operands);
1627 output_asm_insn (\"adc %0\", lateoperands);
1631 [(set_attr "length" "5")])
1633 (define_insn "neghi2"
1634 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1635 (neg:HI (match_operand:HI 1 "general_operand" "0,0")))]
1638 [(set_attr "length" "1,2")])
1640 (define_insn "negqi2"
1641 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1642 (neg:QI (match_operand:QI 1 "general_operand" "0,0")))]
1645 [(set_attr "length" "1,2")])
1648 ;; Unconditional and other jump instructions
1651 (label_ref (match_operand 0 "" "")))]
1654 [(set_attr "length" "2")])
1658 (label_ref (match_operand 0 "" "")))
1659 (clobber (const_int 1))]
1662 [(set_attr "length" "2")])
1664 (define_insn "tablejump"
1665 [(set (pc) (match_operand:HI 0 "general_operand" "rR,Q"))
1666 (use (label_ref (match_operand 1 "" "")))]
1669 [(set_attr "length" "1,2")])
1671 ;; indirect jump - let's be conservative!
1672 ;; allow only register_operand, even though we could also
1673 ;; allow labels etc.
1675 (define_insn "indirect_jump"
1676 [(set (pc) (match_operand:HI 0 "register_operand" "r"))]
1680 ;;- jump to subroutine
1683 [(call (match_operand:HI 0 "general_operand" "rR,Q")
1684 (match_operand:HI 1 "general_operand" "g,g"))
1685 ;; (use (reg:HI 0)) what was that ???
1687 ;;- Don't use operand 1 for most machines.
1690 [(set_attr "length" "1,2")])
1692 ;;- jump to subroutine
1693 (define_insn "call_value"
1694 [(set (match_operand 0 "" "")
1695 (call (match_operand:HI 1 "general_operand" "rR,Q")
1696 (match_operand:HI 2 "general_operand" "g,g")))
1697 ;; (use (reg:HI 0)) - what was that ????
1699 ;;- Don't use operand 2 for most machines.
1702 [(set_attr "length" "1,2")])
1713 (define_insn "muldf3"
1714 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1715 (mult:DF (match_operand:DF 1 "register_operand" "%0,0,0")
1716 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1718 "{muld|mulf} %2, %0"
1719 [(set_attr "length" "1,2,5")])
1721 ;; 16 bit result multiply:
1722 ;; currently we multiply only into odd registers, so we don't use two
1723 ;; registers - but this is a bit inefficient at times. If we define
1724 ;; a register class for each register, then we can specify properly
1725 ;; which register need which scratch register ....
1727 (define_insn "mulhi3"
1728 [(set (match_operand:HI 0 "register_operand" "=d,d") ; multiply regs
1729 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
1730 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1733 [(set_attr "length" "1,2")])
1736 (define_expand "mulhisi3"
1738 (match_operand:HI 1 "general_operand" "g,g"))
1739 (set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1740 (mult:SI (truncate:HI
1742 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1744 "operands[3] = gen_lowpart(HImode, operands[1]);")
1747 [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1748 (mult:SI (truncate:HI
1749 (match_operand:SI 1 "register_operand" "%0,0"))
1750 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1753 [(set_attr "length" "1,2")])
1755 ;(define_insn "mulhisi3"
1756 ; [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1757 ; (mult:SI (truncate:HI
1758 ; (match_operand:SI 1 "register_operand" "%0,0"))
1759 ; (match_operand:HI 2 "general_operand" "rR,Qi")))]
1762 ; [(set_attr "length" "1,2")])
1765 (define_insn "divdf3"
1766 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1767 (div:DF (match_operand:DF 1 "register_operand" "0,0,0")
1768 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1770 "{divd|divf} %2, %0"
1771 [(set_attr "length" "1,2,5")])
1774 (define_expand "divhi3"
1775 [(set (subreg:HI (match_dup 1) 0)
1776 (div:HI (match_operand:SI 1 "general_operand" "0")
1777 (match_operand:HI 2 "general_operand" "g")))
1778 (set (match_operand:HI 0 "general_operand" "=r")
1779 (subreg:HI (match_dup 1) 0))]
1784 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1785 (div:HI (match_operand:SI 1 "general_operand" "0")
1786 (match_operand:HI 2 "general_operand" "g")))]
1789 [(set_attr "length" "2")])
1791 (define_expand "modhi3"
1792 [(set (subreg:HI (match_dup 1) 2)
1793 (mod:HI (match_operand:SI 1 "general_operand" "0")
1794 (match_operand:HI 2 "general_operand" "g")))
1795 (set (match_operand:HI 0 "general_operand" "=r")
1796 (subreg:HI (match_dup 1) 2))]
1801 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 2)
1802 (mod:HI (match_operand:SI 1 "general_operand" "0")
1803 (match_operand:HI 2 "general_operand" "g")))]
1806 [(set_attr "length" "2")])
1808 ;(define_expand "divmodhi4"
1809 ; [(parallel [(set (subreg:HI (match_dup 1) 0)
1810 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1811 ; (match_operand:HI 2 "general_operand" "g")))
1812 ; (set (subreg:HI (match_dup 1) 2)
1813 ; (mod:HI (match_dup 1)
1815 ; (set (match_operand:HI 3 "general_operand" "=r")
1816 ; (subreg:HI (match_dup 1) 2))
1817 ; (set (match_operand:HI 0 "general_operand" "=r")
1818 ; (subreg:HI (match_dup 1) 0))]
1823 ; [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1824 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1825 ; (match_operand:HI 2 "general_operand" "g")))
1826 ; (set (subreg:HI (match_dup 0) 2)
1827 ; (mod:HI (match_dup 1)
1833 ;; is rotate doing the right thing to be included here ????