1 ;;- Machine description for the pdp11 for GNU C compiler
2 ;; Copyright (C) 1994, 95, 97-99, 2000 Free Software Foundation, Inc.
3 ;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
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 1, 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.
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 if (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")
624 (match_operand:DI 1 "general_operand" "g"))]
626 "* return output_move_quad (operands);"
627 ;; what's the mose expensive code - say twice movsi = 16
628 [(set_attr "length" "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 "general_operand" "=rR,rR,Q,Q")
654 (match_operand:QI 1 "general_operand" "rRN,Qi,rRN,Qi"))]
658 if (operands[1] == const0_rtx)
661 return \"movb %1, %0\";
663 [(set_attr "length" "1,2,2,3")])
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" "=f,R,f,Q,f,m")
669 (match_operand:DF 1 "general_operand" "fR,f,Q,f,F,m"))]
671 "* return output_move_quad (operands);"
673 [(set_attr "length" "1,1,2,2,5,16")])
676 [(set (match_operand:SF 0 "general_operand" "=g,r,g")
677 (match_operand:SF 1 "general_operand" "r,rmF,g"))]
679 "* return output_move_double (operands);"
680 [(set_attr "length" "8,8,8")])
682 ;; maybe fiddle a bit with move_ratio, then
683 ;; let constraints only accept a register ...
685 (define_expand "movstrhi"
686 [(parallel [(set (match_operand:BLK 0 "general_operand" "=g,g")
687 (match_operand:BLK 1 "general_operand" "g,g"))
688 (use (match_operand:HI 2 "arith_operand" "n,&mr"))
689 (use (match_operand:HI 3 "immediate_operand" "i,i"))
690 (clobber (match_scratch:HI 4 "=&r,X"))
691 (clobber (match_dup 5))
692 (clobber (match_dup 6))
693 (clobber (match_dup 2))])]
694 "(TARGET_BCOPY_BUILTIN)"
698 = change_address (operands[0], VOIDmode,
699 copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
701 = change_address (operands[1], VOIDmode,
702 copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
704 operands[5] = XEXP (operands[0], 0);
705 operands[6] = XEXP (operands[1], 0);
709 (define_insn "" ; "movstrhi"
710 [(set (mem:BLK (match_operand:HI 0 "general_operand" "=r,r"))
711 (mem:BLK (match_operand:HI 1 "general_operand" "r,r")))
712 (use (match_operand:HI 2 "arith_operand" "n,&r"))
713 (use (match_operand:HI 3 "immediate_operand" "i,i"))
714 (clobber (match_scratch:HI 4 "=&r,X"))
715 (clobber (match_dup 0))
716 (clobber (match_dup 1))
717 (clobber (match_dup 2))]
718 "(TARGET_BCOPY_BUILTIN)"
719 "* return output_block_move (operands);"
721 [(set_attr "length" "40")])
725 ;;- truncation instructions
727 (define_insn "truncdfsf2"
728 [(set (match_operand:SF 0 "general_operand" "=r,R,Q")
729 (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a,a")))]
731 "* if (which_alternative ==0)
733 output_asm_insn(\"{stcdf|movfo} %1, -(sp)\", operands);
734 output_asm_insn(\"mov (sp)+, %0\", operands);
735 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+1);
736 output_asm_insn(\"mov (sp)+, %0\", operands);
739 else if (which_alternative == 1)
740 return \"{stcdf|movfo} %1, %0\";
742 return \"{stcdf|movfo} %1, %0\";
744 [(set_attr "length" "3,1,2")])
747 (define_expand "truncsihi2"
748 [(set (match_operand:HI 0 "general_operand" "=g")
750 (match_operand:SI 1 "general_operand" "or")
756 ;;- zero extension instructions
758 (define_insn "zero_extendqihi2"
759 [(set (match_operand:HI 0 "general_operand" "=r")
760 (zero_extend:HI (match_operand:QI 1 "general_operand" "0")))]
763 [(set_attr "length" "2")])
765 (define_expand "zero_extendhisi2"
769 (match_operand:HI 1 "register_operand" "r"))
771 (match_operand:SI 0 "register_operand" "=r")
775 "/* operands[1] = make_safe_from (operands[1], operands[0]); */")
778 ;;- sign extension instructions
780 (define_insn "extendsfdf2"
781 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
782 (float_extend:DF (match_operand:SF 1 "general_operand" "r,R,Q")))]
785 mov %1, -(sp)\;{ldcfd|movof} (sp)+,%0
787 {ldcfd|movof} %1, %0"
788 [(set_attr "length" "2,1,2")])
790 ;; does movb sign extend in register-to-register move?
791 (define_insn "extendqihi2"
792 [(set (match_operand:HI 0 "register_operand" "=r,r")
793 (sign_extend:HI (match_operand:QI 1 "general_operand" "rR,Q")))]
796 [(set_attr "length" "1,2")])
798 (define_insn "extendqisi2"
799 [(set (match_operand:SI 0 "register_operand" "=r,r")
800 (sign_extend:SI (match_operand:QI 1 "general_operand" "rR,Q")))]
806 /* make register pair available */
807 latehalf[0] = operands[0];
808 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+ 1);
810 output_asm_insn(\"movb %1, %0\", operands);
811 output_asm_insn(\"sxt %0\", latehalf);
815 [(set_attr "length" "2,3")])
817 ;; maybe we have to use define_expand to say that we have the instruction,
818 ;; unconditionally, and then match dependent on CPU type:
820 (define_expand "extendhisi2"
821 [(set (match_operand:SI 0 "general_operand" "=g")
822 (sign_extend:SI (match_operand:HI 1 "general_operand" "g")))]
826 (define_insn "" ; "extendhisi2"
827 [(set (match_operand:SI 0 "general_operand" "=o,<,r")
828 (sign_extend:SI (match_operand:HI 1 "general_operand" "g,g,g")))]
834 /* we don't want to mess with auto increment */
836 switch(which_alternative)
840 latehalf[0] = operands[0];
841 operands[0] = adj_offsettable_operand(operands[0], 2);
843 output_asm_insn(\"mov %1, %0\", operands);
844 output_asm_insn(\"sxt %0\", latehalf);
850 /* - auto-decrement - right direction ;-) */
851 output_asm_insn(\"mov %1, %0\", operands);
852 output_asm_insn(\"sxt %0\", operands);
858 /* make register pair available */
859 latehalf[0] = operands[0];
860 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
862 output_asm_insn(\"mov %1, %0\", operands);
863 output_asm_insn(\"sxt %0\", latehalf);
872 [(set_attr "length" "5,3,3")])
876 [(set (match_operand:SI 0 "register_operand" "=r")
877 (sign_extend:SI (match_operand:HI 1 "general_operand" "0")))]
881 static int count = 0;
885 lateoperands[0] = operands[0];
886 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
888 output_asm_insn(\"tst %0\", operands);
889 sprintf(buf, \"bge extendhisi%d\", count);
890 output_asm_insn(buf, NULL);
891 output_asm_insn(\"mov -1, %0\", lateoperands);
892 sprintf(buf, \"bne extendhisi%d\", count+1);
893 output_asm_insn(buf, NULL);
894 sprintf(buf, \"\\nextendhisi%d:\", count);
895 output_asm_insn(buf, NULL);
896 output_asm_insn(\"clr %0\", lateoperands);
897 sprintf(buf, \"\\nextendhisi%d:\", count+1);
898 output_asm_insn(buf, NULL);
904 [(set_attr "length" "6")])
906 ;; make float to int and vice versa
907 ;; using the cc_status.flag field we could probably cut down
909 ;; assume that we are normally in double and integer mode -
910 ;; what do pdp library routines do to fpu mode ?
912 (define_insn "floatsidf2"
913 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
914 (float:DF (match_operand:SI 1 "general_operand" "r,R,Q")))]
916 "* if (which_alternative ==0)
921 latehalf[1] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
922 output_asm_insn(\"mov %1, -(sp)\", latehalf);
923 output_asm_insn(\"mov %1, -(sp)\", operands);
925 output_asm_insn(\"setl\", operands);
926 output_asm_insn(\"{ldcld|movif} (sp)+, %0\", operands);
927 output_asm_insn(\"seti\", operands);
930 else if (which_alternative == 1)
931 return \"setl\;{ldcld|movif} %1, %0\;seti\";
933 return \"setl\;{ldcld|movif} %1, %0\;seti\";
935 [(set_attr "length" "5,3,4")])
937 (define_insn "floathidf2"
938 [(set (match_operand:DF 0 "register_operand" "=a,a")
939 (float:DF (match_operand:HI 1 "general_operand" "rR,Qi")))]
941 "{ldcid|movif} %1, %0"
942 [(set_attr "length" "1,2")])
945 (define_insn "fix_truncdfsi2"
946 [(set (match_operand:SI 0 "general_operand" "=r,R,Q")
947 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a,a"))))]
949 "* if (which_alternative ==0)
951 output_asm_insn(\"setl\", operands);
952 output_asm_insn(\"{stcdl|movfi} %1, -(sp)\", operands);
953 output_asm_insn(\"seti\", operands);
954 output_asm_insn(\"mov (sp)+, %0\", operands);
955 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
956 output_asm_insn(\"mov (sp)+, %0\", operands);
959 else if (which_alternative == 1)
960 return \"setl\;{stcdl|movfi} %1, %0\;seti\";
962 return \"setl\;{stcdl|movfi} %1, %0\;seti\";
964 [(set_attr "length" "5,3,4")])
966 (define_insn "fix_truncdfhi2"
967 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
968 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "a,a"))))]
970 "{stcdi|movfi} %1, %0"
971 [(set_attr "length" "1,2")])
974 ;;- arithmetic instructions
977 (define_insn "adddf3"
978 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
979 (plus:DF (match_operand:DF 1 "register_operand" "%0,0,0")
980 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
983 [(set_attr "length" "1,2,5")])
985 (define_insn "addsi3"
986 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
987 (plus:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
988 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
991 { /* Here we trust that operands don't overlap
993 or is lateoperands the low word?? - looks like it! */
997 lateoperands[0] = operands[0];
999 if (REG_P (operands[0]))
1000 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1002 operands[0] = adj_offsettable_operand (operands[0], 2);
1004 if (! CONSTANT_P(operands[2]))
1006 lateoperands[2] = operands[2];
1008 if (REG_P (operands[2]))
1009 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1011 operands[2] = adj_offsettable_operand(operands[2], 2);
1013 output_asm_insn (\"add %2, %0\", operands);
1014 output_asm_insn (\"adc %0\", lateoperands);
1015 output_asm_insn (\"add %2, %0\", lateoperands);
1019 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1020 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1022 if (INTVAL(operands[2]))
1024 output_asm_insn (\"add %2, %0\", operands);
1025 output_asm_insn (\"adc %0\", lateoperands);
1028 if (INTVAL(lateoperands[2]))
1029 output_asm_insn (\"add %2, %0\", lateoperands);
1033 [(set_attr "length" "3,5,6,8,3,1,5,5,3,8")])
1035 (define_insn "addhi3"
1036 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1037 (plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1038 (match_operand:HI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1042 if (GET_CODE (operands[2]) == CONST_INT)
1044 if (INTVAL(operands[2]) == 1)
1046 else if (INTVAL(operands[2]) == -1)
1050 return \"add %2, %0\";
1052 [(set_attr "length" "1,2,2,3")])
1054 (define_insn "addqi3"
1055 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1056 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1057 (match_operand:QI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1061 if (GET_CODE (operands[2]) == CONST_INT)
1063 if (INTVAL(operands[2]) == 1)
1065 else if (INTVAL(operands[2]) == -1)
1069 return \"addb %2, %0\";
1071 [(set_attr "length" "1,2,2,3")])
1074 ;;- subtract instructions
1075 ;; we don't have to care for constant second
1076 ;; args, since they are canonical plus:xx now!
1077 ;; also for minus:DF ??
1079 (define_insn "subdf3"
1080 [(set (match_operand:DF 0 "register_operand" "=a,a")
1081 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
1082 (match_operand:DF 2 "general_operand" "fR,Q")))]
1084 "{subd|subf} %2, %0"
1085 [(set_attr "length" "1,2")])
1087 (define_insn "subsi3"
1088 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o")
1089 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
1090 (match_operand:SI 2 "general_operand" "r,o,r,o")))]
1093 { /* Here we trust that operands don't overlap
1095 or is lateoperands the low word?? - looks like it! */
1097 rtx lateoperands[3];
1099 lateoperands[0] = operands[0];
1101 if (REG_P (operands[0]))
1102 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1104 operands[0] = adj_offsettable_operand (operands[0], 2);
1106 lateoperands[2] = operands[2];
1108 if (REG_P (operands[2]))
1109 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1111 operands[2] = adj_offsettable_operand(operands[2], 2);
1113 output_asm_insn (\"sub %2, %0\", operands);
1114 output_asm_insn (\"sbc %0\", lateoperands);
1115 output_asm_insn (\"sub %2, %0\", lateoperands);
1118 ;; offsettable memory addresses always are expensive!!!
1119 [(set_attr "length" "3,5,6,8")])
1121 (define_insn "subhi3"
1122 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1123 (minus:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1124 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1128 if (GET_CODE (operands[2]) == CONST_INT)
1131 return \"sub %2, %0\";
1133 [(set_attr "length" "1,2,2,3")])
1135 (define_insn "subqi3"
1136 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1137 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1138 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1142 if (GET_CODE (operands[2]) == CONST_INT)
1145 return \"subb %2, %0\";
1147 [(set_attr "length" "1,2,2,3")])
1149 ;;;;- and instructions
1150 ;; Bit-and on the pdp (like on the vax) is done with a clear-bits insn.
1151 (define_expand "andsi3"
1152 [(set (match_operand:SI 0 "general_operand" "=g")
1153 (and:SI (match_operand:SI 1 "general_operand" "0")
1154 (not:SI (match_operand:SI 2 "general_operand" "g"))))]
1158 extern rtx expand_unop ();
1159 if (GET_CODE (operands[2]) == CONST_INT)
1160 operands[2] = GEN_INT (~INTVAL (operands[2]));
1162 operands[2] = expand_unop (SImode, one_cmpl_optab, operands[2], 0, 1);
1165 (define_expand "andhi3"
1166 [(set (match_operand:HI 0 "general_operand" "=g")
1167 (and:HI (match_operand:HI 1 "general_operand" "0")
1168 (not:HI (match_operand:HI 2 "general_operand" "g"))))]
1172 extern rtx expand_unop ();
1173 if (GET_CODE (operands[2]) == CONST_INT)
1174 operands[2] = GEN_INT (~INTVAL (operands[2]));
1176 operands[2] = expand_unop (HImode, one_cmpl_optab, operands[2], 0, 1);
1179 (define_expand "andqi3"
1180 [(set (match_operand:QI 0 "general_operand" "=g")
1181 (and:QI (match_operand:QI 1 "general_operand" "0")
1182 (not:QI (match_operand:QI 2 "general_operand" "g"))))]
1186 extern rtx expand_unop ();
1187 rtx op = operands[2];
1188 if (GET_CODE (op) == CONST_INT)
1189 operands[2] = GEN_INT (((1 << 8) - 1) & ~INTVAL (op));
1191 operands[2] = expand_unop (QImode, one_cmpl_optab, op, 0, 1);
1194 (define_insn "andcbsi3"
1195 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1196 (and:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1197 (not:SI (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K"))))]
1200 { /* Here we trust that operands don't overlap
1202 or is lateoperands the low word?? - looks like it! */
1204 rtx lateoperands[3];
1206 lateoperands[0] = operands[0];
1208 if (REG_P (operands[0]))
1209 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1211 operands[0] = adj_offsettable_operand (operands[0], 2);
1213 if (! CONSTANT_P(operands[2]))
1215 lateoperands[2] = operands[2];
1217 if (REG_P (operands[2]))
1218 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1220 operands[2] = adj_offsettable_operand(operands[2], 2);
1222 output_asm_insn (\"bic %2, %0\", operands);
1223 output_asm_insn (\"bic %2, %0\", lateoperands);
1227 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1228 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1230 /* these have different lengths, so we should have
1231 different constraints! */
1232 if (INTVAL(operands[2]))
1233 output_asm_insn (\"bic %2, %0\", operands);
1235 if (INTVAL(lateoperands[2]))
1236 output_asm_insn (\"bic %2, %0\", lateoperands);
1240 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1242 (define_insn "andcbhi3"
1243 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1244 (and:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1245 (not:HI (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1248 [(set_attr "length" "1,2,2,3")])
1250 (define_insn "andcbqi3"
1251 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1252 (and:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1253 (not:QI (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1256 [(set_attr "length" "1,2,2,3")])
1258 ;;- Bit set (inclusive or) instructions
1259 (define_insn "iorsi3"
1260 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1261 (ior:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1262 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
1265 { /* Here we trust that operands don't overlap
1267 or is lateoperands the low word?? - looks like it! */
1269 rtx lateoperands[3];
1271 lateoperands[0] = operands[0];
1273 if (REG_P (operands[0]))
1274 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1276 operands[0] = adj_offsettable_operand (operands[0], 2);
1278 if (! CONSTANT_P(operands[2]))
1280 lateoperands[2] = operands[2];
1282 if (REG_P (operands[2]))
1283 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1285 operands[2] = adj_offsettable_operand (operands[2], 2);
1287 output_asm_insn (\"bis %2, %0\", operands);
1288 output_asm_insn (\"bis %2, %0\", lateoperands);
1292 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1293 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
1295 /* these have different lengths, so we should have
1296 different constraints! */
1297 if (INTVAL(operands[2]))
1298 output_asm_insn (\"bis %2, %0\", operands);
1300 if (INTVAL(lateoperands[2]))
1301 output_asm_insn (\"bis %2, %0\", lateoperands);
1305 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1307 (define_insn "iorhi3"
1308 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1309 (ior:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1310 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1313 [(set_attr "length" "1,2,2,3")])
1315 (define_insn "iorqi3"
1316 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1317 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1318 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1322 ;;- xor instructions
1323 (define_insn "xorsi3"
1324 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1325 (xor:SI (match_operand:SI 1 "register_operand" "%0,0,0,0")
1326 (match_operand:SI 2 "arith_operand" "r,I,J,K")))]
1329 { /* Here we trust that operands don't overlap */
1331 rtx lateoperands[3];
1333 lateoperands[0] = operands[0];
1334 operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
1336 if (REG_P(operands[2]))
1338 lateoperands[2] = operands[2];
1339 operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1);
1341 output_asm_insn (\"xor %2, %0\", operands);
1342 output_asm_insn (\"xor %2, %0\", lateoperands);
1347 lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff);
1348 operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff);
1350 if (INTVAL (operands[2]))
1351 output_asm_insn (\"xor %2, %0\", operands);
1353 if (INTVAL (lateoperands[2]))
1354 output_asm_insn (\"xor %2, %0\", lateoperands);
1358 [(set_attr "length" "2,1,1,2")])
1360 (define_insn "xorhi3"
1361 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1362 (xor:HI (match_operand:HI 1 "general_operand" "%0,0")
1363 (match_operand:HI 2 "register_operand" "r,r")))]
1366 [(set_attr "length" "1,2")])
1368 ;;- one complement instructions
1370 (define_insn "one_cmplhi2"
1371 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1372 (not:HI (match_operand:HI 1 "general_operand" "0,0")))]
1375 [(set_attr "length" "1,2")])
1377 (define_insn "one_cmplqi2"
1378 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1379 (not:QI (match_operand:QI 1 "general_operand" "0,0")))]
1382 [(set_attr "length" "1,2")])
1384 ;;- arithmetic shift instructions
1385 (define_insn "ashlsi3"
1386 [(set (match_operand:SI 0 "register_operand" "=r,r")
1387 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
1388 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1391 [(set_attr "length" "1,2")])
1393 ;; Arithmetic right shift on the pdp works by negating the shift count.
1394 (define_expand "ashrsi3"
1395 [(set (match_operand:SI 0 "register_operand" "=r")
1396 (ashift:SI (match_operand:SI 1 "register_operand" "0")
1397 (match_operand:HI 2 "general_operand" "g")))]
1401 operands[2] = negate_rtx (HImode, operands[2]);
1404 ;; define asl aslb asr asrb - ashc missing!
1408 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1409 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1413 [(set_attr "length" "1,2")])
1415 ;; and another possibility for asr is << -1
1416 ;; might cause problems since -1 can also be encoded as 65535!
1421 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1422 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1426 [(set_attr "length" "1,2")])
1428 ;; shift is by arbitrary count is expensive,
1429 ;; shift by one cheap - so let's do that, if
1430 ;; space doesn't matter
1432 [(set (match_operand:HI 0 "general_operand" "=r")
1433 (ashift:HI (match_operand:HI 1 "general_operand" "0")
1434 (match_operand:HI 2 "expand_shift_operand" "O")))]
1440 for (i = 1; i <= abs(INTVAL(operands[2])); i++)
1441 if (INTVAL(operands[2]) < 0)
1442 output_asm_insn(\"asr %0\", operands);
1444 output_asm_insn(\"asl %0\", operands);
1449 [(set (attr "length") (const_int 4))])
1453 [(set (match_operand:QI 0 "general_operand" "=r,o")
1454 (ashift:QI (match_operand:QI 1 "general_operand" "0,0")
1455 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1458 { /* allowing predec or post_inc is possible, but hairy! */
1461 cnt = INTVAL(operands[2]) & 0x0007;
1463 for (i=0 ; i < cnt ; i++)
1464 output_asm_insn(\"aslb %0\", operands);
1468 ;; set attribute length ( match_dup 2 & 7 ) *(1 or 2) !!!
1469 [(set_attr_alternative "length"
1475 ; [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1476 ; (ashiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
1480 ; [(set_attr "length" "1,2")])
1484 [(set (match_operand:QI 0 "general_operand" "=r,o")
1485 (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0")
1486 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1489 { /* allowing predec or post_inc is possible, but hairy! */
1492 cnt = INTVAL(operands[2]) & 0x0007;
1494 for (i=0 ; i < cnt ; i++)
1495 output_asm_insn(\"asrb %0\", operands);
1499 [(set_attr_alternative "length"
1503 ;; the following is invalid - too complex!!! - just say 14 !!!
1504 ; [(set (attr "length") (plus (and (match_dup 2)
1506 ; (and (match_dup 2)
1507 ; (const_int 7))))])
1511 ;; can we get +-1 in the next pattern? should
1512 ;; have been caught by previous patterns!
1514 (define_insn "ashlhi3"
1515 [(set (match_operand:HI 0 "register_operand" "=r,r")
1516 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
1517 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1521 if (GET_CODE(operands[2]) == CONST_INT)
1523 if (INTVAL(operands[2]) == 1)
1525 else if (INTVAL(operands[2]) == -1)
1529 return \"ash %2,%0\";
1531 [(set_attr "length" "1,2")])
1533 ;; Arithmetic right shift on the pdp works by negating the shift count.
1534 (define_expand "ashrhi3"
1535 [(set (match_operand:HI 0 "register_operand" "=r")
1536 (ashift:HI (match_operand:HI 1 "register_operand" "0")
1537 (match_operand:HI 2 "general_operand" "g")))]
1541 operands[2] = negate_rtx (HImode, operands[2]);
1544 ;;;;- logical shift instructions
1545 ;;(define_insn "lshrsi3"
1546 ;; [(set (match_operand:HI 0 "register_operand" "=r")
1547 ;; (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
1548 ;; (match_operand:HI 2 "arith_operand" "rI")))]
1554 (define_insn "absdf2"
1555 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1556 (abs:DF (match_operand:DF 1 "general_operand" "0,0")))]
1559 [(set_attr "length" "1,2")])
1561 (define_insn "abshi2"
1562 [(set (match_operand:HI 0 "general_operand" "=r,o")
1563 (abs:HI (match_operand:HI 1 "general_operand" "0,0")))]
1564 "TARGET_ABSHI_BUILTIN"
1567 static int count = 0;
1570 output_asm_insn(\"tst %0\", operands);
1571 sprintf(buf, \"bge abshi%d\", count);
1572 output_asm_insn(buf, NULL);
1573 output_asm_insn(\"neg %0\", operands);
1574 sprintf(buf, \"\\nabshi%d:\", count++);
1575 output_asm_insn(buf, NULL);
1579 [(set_attr "length" "3,5")])
1582 ;; define expand abshi - is much better !!! - but
1583 ;; will it be optimized into an abshi2 ?
1584 ;; it will leave better code, because the tsthi might be
1586 ; -- just a thought - don't have time to check
1588 ;(define_expand "abshi2"
1589 ; [(match_operand:HI 0 "general_operand" "")
1590 ; (match_operand:HI 1 "general_operand" "")]
1594 ; rtx label = gen_label_rtx ();
1596 ; /* do I need this? */
1597 ; do_pending_stack_adjust ();
1599 ; emit_move_insn (operands[0], operands[1]);
1601 ; emit_insn (gen_tsthi (operands[0]));
1602 ; emit_insn (gen_bge (label1));
1604 ; emit_insn (gen_neghi(operands[0], operands[0])
1608 ; emit_label (label);
1610 ; /* allow REG_NOTES to be set on last insn (labels don't have enough
1611 ; fields, and can't be used for REG_NOTES anyway). */
1612 ; emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
1618 (define_insn "negdf2"
1619 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1620 (neg:DF (match_operand:DF 1 "register_operand" "0,0")))]
1623 [(set_attr "length" "1,2")])
1625 (define_insn "neghi2"
1626 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1627 (neg:HI (match_operand:HI 1 "general_operand" "0,0")))]
1630 [(set_attr "length" "1,2")])
1632 (define_insn "negqi2"
1633 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1634 (neg:QI (match_operand:QI 1 "general_operand" "0,0")))]
1637 [(set_attr "length" "1,2")])
1640 ;; Unconditional and other jump instructions
1643 (label_ref (match_operand 0 "" "")))]
1646 [(set_attr "length" "2")])
1650 (label_ref (match_operand 0 "" "")))
1651 (clobber (const_int 1))]
1654 [(set_attr "length" "2")])
1656 (define_insn "tablejump"
1657 [(set (pc) (match_operand:HI 0 "general_operand" "rR,Q"))
1658 (use (label_ref (match_operand 1 "" "")))]
1661 [(set_attr "length" "1,2")])
1663 ;; indirect jump - let's be conservative!
1664 ;; allow only register_operand, even though we could also
1665 ;; allow labels etc.
1667 (define_insn "indirect_jump"
1668 [(set (pc) (match_operand:HI 0 "register_operand" "r"))]
1672 ;;- jump to subroutine
1675 [(call (match_operand:HI 0 "general_operand" "R,Q")
1676 (match_operand:HI 1 "general_operand" "g,g"))
1677 ;; (use (reg:HI 0)) what was that ???
1679 ;;- Don't use operand 1 for most machines.
1682 [(set_attr "length" "1,2")])
1684 ;;- jump to subroutine
1685 (define_insn "call_value"
1686 [(set (match_operand 0 "" "")
1687 (call (match_operand:HI 1 "general_operand" "R,Q")
1688 (match_operand:HI 2 "general_operand" "g,g")))
1689 ;; (use (reg:HI 0)) - what was that ????
1691 ;;- Don't use operand 2 for most machines.
1694 [(set_attr "length" "1,2")])
1705 (define_insn "muldf3"
1706 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1707 (mult:DF (match_operand:DF 1 "register_operand" "%0,0,0")
1708 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1710 "{muld|mulf} %2, %0"
1711 [(set_attr "length" "1,2,5")])
1713 ;; 16 bit result multiply:
1714 ;; currently we multiply only into odd registers, so we don't use two
1715 ;; registers - but this is a bit inefficient at times. If we define
1716 ;; a register class for each register, then we can specify properly
1717 ;; which register need which scratch register ....
1719 (define_insn "mulhi3"
1720 [(set (match_operand:HI 0 "register_operand" "=d,d") ; multiply regs
1721 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
1722 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1725 [(set_attr "length" "1,2")])
1728 (define_expand "mulhisi3"
1730 (match_operand:HI 1 "general_operand" "g,g"))
1731 (set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1732 (mult:SI (truncate:HI
1734 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1736 "operands[3] = gen_lowpart(HImode, operands[1]);")
1739 [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1740 (mult:SI (truncate:HI
1741 (match_operand:SI 1 "register_operand" "%0,0"))
1742 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1745 [(set_attr "length" "1,2")])
1747 ;(define_insn "mulhisi3"
1748 ; [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1749 ; (mult:SI (truncate:HI
1750 ; (match_operand:SI 1 "register_operand" "%0,0"))
1751 ; (match_operand:HI 2 "general_operand" "rR,Qi")))]
1754 ; [(set_attr "length" "1,2")])
1757 (define_insn "divdf3"
1758 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1759 (div:DF (match_operand:DF 1 "register_operand" "0,0,0")
1760 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1762 "{divd|divf} %2, %0"
1763 [(set_attr "length" "1,2,5")])
1766 (define_expand "divhi3"
1767 [(set (subreg:HI (match_dup 1) 0)
1768 (div:HI (match_operand:SI 1 "general_operand" "0")
1769 (match_operand:HI 2 "general_operand" "g")))
1770 (set (match_operand:HI 0 "general_operand" "=r")
1771 (subreg:HI (match_dup 1) 0))]
1776 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1777 (div:HI (match_operand:SI 1 "general_operand" "0")
1778 (match_operand:HI 2 "general_operand" "g")))]
1781 [(set_attr "length" "2")])
1783 (define_expand "modhi3"
1784 [(set (subreg:HI (match_dup 1) 1)
1785 (mod:HI (match_operand:SI 1 "general_operand" "0")
1786 (match_operand:HI 2 "general_operand" "g")))
1787 (set (match_operand:HI 0 "general_operand" "=r")
1788 (subreg:HI (match_dup 1) 1))]
1793 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 1)
1794 (mod:HI (match_operand:SI 1 "general_operand" "0")
1795 (match_operand:HI 2 "general_operand" "g")))]
1798 [(set_attr "length" "2")])
1800 ;(define_expand "divmodhi4"
1801 ; [(parallel [(set (subreg:HI (match_dup 1) 0)
1802 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1803 ; (match_operand:HI 2 "general_operand" "g")))
1804 ; (set (subreg:HI (match_dup 1) 1)
1805 ; (mod:HI (match_dup 1)
1807 ; (set (match_operand:HI 3 "general_operand" "=r")
1808 ; (subreg:HI (match_dup 1) 1))
1809 ; (set (match_operand:HI 0 "general_operand" "=r")
1810 ; (subreg:HI (match_dup 1) 0))]
1815 ; [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1816 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1817 ; (match_operand:HI 2 "general_operand" "g")))
1818 ; (set (subreg:HI (match_dup 0) 1)
1819 ; (mod:HI (match_dup 1)
1825 ;; is rotate doing the right thing to be included here ????