1 ;;- Machine description for the pdp11 for GNU C compiler
2 ;; Copyright (C) 1994, 1995 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, 675 Mass Ave, Cambridge, MA 02139, USA.
25 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
27 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
28 ;;- updates for most instructions.
30 ;;- Operand classes for the register allocator:
32 ;; Compare instructions.
34 ;; currently we only support df floats, which saves us quite some
35 ;; hassle switching the FP mode!
36 ;; we assume that CPU is always in long float mode, and
37 ;; 16 bit integer mode - currently, the prologue for main does this,
38 ;; but maybe we should just set up a NEW crt0 properly,
39 ;; -- and what about signal handling code?
40 ;; (we don't even let sf floats in the register file, so
41 ;; we only should have to worry about truncating and widening
42 ;; when going to memory)
44 ;; abort() call by g++ - must define libfunc for cmp_optab
45 ;; and ucmp_optab for mode SImode, because we don't have that!!!
46 ;; - yet since no libfunc is there, we abort ()
48 ;; The only thing that remains to be done then is output
49 ;; the floats in a way the assembler can handle it (and
50 ;; if you're really into it, use a PDP11 float emulation
51 ;; libary to do floating point constant folding - but
52 ;; I guess you'll get reasonable results even when not
54 ;; the last thing to do is fix the UPDATE_CC macro to check
55 ;; for floating point condition codes, and set cc_status
56 ;; properly, also setting the CC_IN_FCCR flag.
59 ;; currently type is only fpu or arith or unknown, maybe branch later ?
61 (define_attr "type" "unknown,arith,fp" (const_string "arith"))
63 ;; length default is 1 word each
64 (define_attr "length" "" (const_int 1))
66 ;; a user's asm statement
67 (define_asm_attributes
68 [(set_attr "type" "unknown")
69 ; all bets are off how long it is - make it 256, forces long jumps
70 ; whenever jumping around it !!!
71 (set_attr "length" "256")])
73 ;; define function units
75 ;; arithmetic - values here immediately when next insn issued
76 ;; or does it mean the number of cycles after this insn was issued?
77 ;; how do I say that fpu insns use cpu also? (pre-interaction phase)
79 ;(define_function_unit "cpu" 1 1 (eq_attr "type" "arith") 0 0)
80 ;(define_function_unit "fpu" 1 1 (eq_attr "type" "fp") 0 0)
85 (compare (match_operand:DF 0 "general_operand" "fR,Q,F")
86 (match_operand:DF 1 "register_operand" "a,a,a")))]
90 cc_status.flags = CC_IN_FPU;
91 return \"cmpd %0, %1\;cfcc\";
93 [(set_attr "length" "2,3,6")])
95 ;; a bit of brain damage, maybe inline later -
96 ;; problem is - gcc seems to NEED SImode because
97 ;; of the cmp weirdness - maybe change gcc to handle this?
99 (define_expand "cmpsi"
101 (match_operand:SI 0 "general_operand" "g"))
103 (match_operand:SI 1 "general_operand" "g"))
104 (parallel [(set (cc0)
107 (clobber (reg:SI 0))])]
108 "0" ;; disable for test
111 ;; check for next insn for branch code - does this still
118 (clobber (reg:SI 0))]
122 rtx br_insn = NEXT_INSN (insn);
125 if (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 %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")
623 (match_operand:DI 1 "general_operand" "g"))]
625 "* return output_move_quad (operands);"
626 ;; what's the mose expensive code - say twice movsi = 16
627 [(set_attr "length" "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 "general_operand" "=rR,rR,Q,Q")
653 (match_operand:QI 1 "general_operand" "rRN,Qi,rRN,Qi"))]
657 if (operands[1] == const0_rtx)
660 return \"movb %1, %0\";
662 [(set_attr "length" "1,2,2,3")])
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" "=f,R,f,Q,f,m")
668 (match_operand:DF 1 "general_operand" "fR,f,Q,f,F,m"))]
670 "* return output_move_quad (operands);"
672 [(set_attr "length" "1,1,2,2,5,16")])
675 [(set (match_operand:SF 0 "general_operand" "=g,r,g")
676 (match_operand:SF 1 "general_operand" "r,rmF,g"))]
678 "* return output_move_double (operands);"
679 [(set_attr "length" "8,8,8")])
681 ;; maybe fiddle a bit with move_ratio, then
682 ;; let constraints only accept a register ...
684 (define_expand "movstrhi"
685 [(parallel [(set (mem:BLK (match_operand:BLK 0 "general_operand" "=g,g"))
686 (mem:BLK (match_operand:BLK 1 "general_operand" "g,g")))
687 (use (match_operand:HI 2 "arith_operand" "n,&mr"))
688 (use (match_operand:HI 3 "immediate_operand" "i,i"))
689 (clobber (match_scratch:HI 4 "=&r,X"))
690 (clobber (match_dup 0))
691 (clobber (match_dup 1))
692 (clobber (match_dup 2))])]
693 "(TARGET_BCOPY_BUILTIN)"
696 operands[0] = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
697 operands[1] = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
698 operands[2] = force_not_mem (operands[2]);
702 (define_insn "" ; "movstrhi"
703 [(set (mem:BLK (match_operand:HI 0 "general_operand" "=r,r"))
704 (mem:BLK (match_operand:HI 1 "general_operand" "r,r")))
705 (use (match_operand:HI 2 "arith_operand" "n,&r"))
706 (use (match_operand:HI 3 "immediate_operand" "i,i"))
707 (clobber (match_scratch:HI 4 "=&r,X"))
708 (clobber (match_dup 0))
709 (clobber (match_dup 1))
710 (clobber (match_dup 2))]
711 "(TARGET_BCOPY_BUILTIN)"
712 "* return output_block_move (operands);"
714 [(set_attr "length" "40")])
718 ;;- truncation instructions
720 (define_insn "truncdfsf2"
721 [(set (match_operand:SF 0 "general_operand" "=r,R,Q")
722 (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a,a")))]
724 "* if (which_alternative ==0)
726 output_asm_insn(\"stcdf %1, -(sp)\", operands);
727 output_asm_insn(\"mov (sp)+, %0\", operands);
728 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
729 output_asm_insn(\"mov (sp)+, %0\", operands);
732 else if (which_alternative == 1)
733 return \"stcdf %1, %0\";
735 return \"stcdf %1, %0\";
737 [(set_attr "length" "3,1,2")])
740 (define_expand "truncsihi2"
741 [(set (match_operand:HI 0 "general_operand" "=g")
743 (match_operand:SI 1 "general_operand" "or")
749 ;;- zero extension instructions
751 (define_insn "zero_extendqihi2"
752 [(set (match_operand:HI 0 "general_operand" "=r")
753 (zero_extend:HI (match_operand:QI 1 "general_operand" "0")))]
756 [(set_attr "length" "2")])
758 (define_expand "zero_extendhisi2"
762 (match_operand:HI 1 "register_operand" "r"))
764 (match_operand:SI 0 "register_operand" "=r")
768 "/* operands[1] = make_safe_from (operands[1], operands[0]); */")
771 ;;- sign extension instructions
773 (define_insn "extendsfdf2"
774 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
775 (float_extend:SF (match_operand:SF 1 "general_operand" "r,R,Q")))]
778 mov %1, -(sp)\;ldcfd (sp)+,%0
781 [(set_attr "length" "2,1,2")])
783 ;; does movb sign extend in register-to-register move?
784 (define_insn "extendqihi2"
785 [(set (match_operand:HI 0 "register_operand" "=r,r")
786 (sign_extend:HI (match_operand:QI 1 "general_operand" "rR,Q")))]
789 [(set_attr "length" "1,2")])
791 (define_insn "extendqisi2"
792 [(set (match_operand:SI 0 "register_operand" "=r,r")
793 (sign_extend:SI (match_operand:QI 1 "general_operand" "rR,Q")))]
799 /* make register pair available */
800 latehalf[0] = operands[0];
801 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
803 output_asm_insn(\"movb %1, %0\", operands);
804 output_asm_insn(\"sxt %0\", latehalf);
808 [(set_attr "length" "2,3")])
810 ;; maybe we have to use define_expand to say that we have the instruction,
811 ;; unconditionally, and then match dependent on CPU type:
813 (define_expand "extendhisi2"
814 [(set (match_operand:SI 0 "general_operand" "=g")
815 (sign_extend:SI (match_operand:HI 1 "general_operand" "g")))]
819 (define_insn "" ; "extendhisi2"
820 [(set (match_operand:SI 0 "general_operand" "=o,<,r")
821 (sign_extend:SI (match_operand:HI 1 "general_operand" "g,g,g")))]
827 /* we don't want to mess with auto increment */
829 switch(which_alternative)
833 latehalf[0] = operands[0];
834 operands[0] = adj_offsettable_operand(operands[0], 2);
836 output_asm_insn(\"mov %1, %0\", operands);
837 output_asm_insn(\"sxt %0\", latehalf);
843 /* - auto-decrement - right direction ;-) */
844 output_asm_insn(\"mov %1, %0\", operands);
845 output_asm_insn(\"sxt %0\", operands);
851 /* make register pair available */
852 latehalf[0] = operands[0];
853 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
855 output_asm_insn(\"mov %1, %0\", operands);
856 output_asm_insn(\"sxt %0\", latehalf);
865 [(set_attr "length" "5,3,3")])
869 [(set (match_operand:SI 0 "register_operand" "=r")
870 (sign_extend:SI (match_operand:HI 1 "general_operand" "0")))]
878 lateoperands[0] = operands[0];
879 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
881 output_asm_insn(\"tst %0\", operands);
882 sprintf(buf, \"bge extendhisi%d\", count);
883 output_asm_insn(buf, NULL);
884 output_asm_insn(\"mov -1, %0\", lateoperands);
885 sprintf(buf, \"bne extendhisi%d\", count+1);
886 output_asm_insn(buf, NULL);
887 sprintf(buf, \"\\nextendhisi%d:\", count);
888 output_asm_insn(buf, NULL);
889 output_asm_insn(\"clr %0\", lateoperands);
890 sprintf(buf, \"\\nextendhisi%d:\", count+1);
891 output_asm_insn(buf, NULL);
897 [(set_attr "length" "6")])
899 ;; make float to int and vice versa
900 ;; using the cc_status.flag field we could probably cut down
902 ;; assume that we are normally in double and integer mode -
903 ;; what do pdp library routines do to fpu mode ?
905 (define_insn "floatsidf2"
906 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
907 (float:DF (match_operand:SI 1 "general_operand" "r,R,Q")))]
909 "* if (which_alternative ==0)
914 latehalf[1] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
915 output_asm_insn(\"mov %1, -(sp)\", latehalf);
916 output_asm_insn(\"mov %1, -(sp)\", operands);
918 output_asm_insn(\"setl\", operands);
919 output_asm_insn(\"ldcld (sp)+, %0\", operands);
920 output_asm_insn(\"seti\", operands);
923 else if (which_alternative == 1)
924 return \"setl\;ldcld %1, %0\;seti\";
926 return \"setl\;ldcld %1, %0\;seti\";
928 [(set_attr "length" "5,3,4")])
930 (define_insn "floathidf2"
931 [(set (match_operand:DF 0 "register_operand" "=a,a")
932 (float:DF (match_operand:HI 1 "general_operand" "rR,Qi")))]
935 [(set_attr "length" "1,2")])
938 (define_insn "fix_truncdfsi2"
939 [(set (match_operand:SI 0 "general_operand" "=r,R,Q")
940 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a,a"))))]
942 "* if (which_alternative ==0)
944 output_asm_insn(\"setl\", operands);
945 output_asm_insn(\"stcdl %1, -(sp)\", operands);
946 output_asm_insn(\"seti\", operands);
947 output_asm_insn(\"mov (sp)+, %0\", operands);
948 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
949 output_asm_insn(\"mov (sp)+, %0\", operands);
952 else if (which_alternative == 1)
953 return \"setl\;stcdl %1, %0\;seti\";
955 return \"setl\;stcdl %1, %0\;seti\";
957 [(set_attr "length" "5,3,4")])
959 (define_insn "fix_truncdfhi2"
960 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
961 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "a,a"))))]
964 [(set_attr "length" "1,2")])
967 ;;- arithmetic instructions
970 (define_insn "adddf3"
971 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
972 (plus:DF (match_operand:DF 1 "register_operand" "%0,0,0")
973 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
976 [(set_attr "length" "1,2,5")])
978 (define_insn "addsi3"
979 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
980 (plus:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
981 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
984 { /* Here we trust that operands don't overlap
986 or is lateoperands the low word?? - looks like it! */
991 lateoperands[0] = operands[0];
993 if (REG_P (operands[0]))
994 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
996 operands[0] = adj_offsettable_operand (operands[0], 2);
998 if (! CONSTANT_P(operands[2]))
1000 lateoperands[2] = operands[2];
1002 if (REG_P (operands[2]))
1003 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1005 operands[2] = adj_offsettable_operand(operands[2], 2);
1007 output_asm_insn (\"add %2, %0\", operands);
1008 output_asm_insn (\"adc %0\", lateoperands);
1009 output_asm_insn (\"add %2, %0\", lateoperands);
1013 lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
1014 operands[2] = gen_rtx(CONST_INT, VOIDmode, INTVAL(operands[2]) & 0xffff);
1016 if (INTVAL(operands[2]))
1018 output_asm_insn (\"add %2, %0\", operands);
1019 output_asm_insn (\"adc %0\", lateoperands);
1022 if (INTVAL(lateoperands[2]))
1023 output_asm_insn (\"add %2, %0\", lateoperands);
1027 [(set_attr "length" "3,5,6,8,3,1,5,5,3,8")])
1029 (define_insn "addhi3"
1030 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1031 (plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1032 (match_operand:HI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1036 if (GET_CODE (operands[2]) == CONST_INT)
1037 if (INTVAL(operands[2]) == 1)
1039 else if (INTVAL(operands[2]) == -1)
1042 return \"add %2, %0\";
1044 [(set_attr "length" "1,2,2,3")])
1046 (define_insn "addqi3"
1047 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1048 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1049 (match_operand:QI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1053 if (GET_CODE (operands[2]) == CONST_INT)
1054 if (INTVAL(operands[2]) == 1)
1056 else if (INTVAL(operands[2]) == -1)
1059 return \"addb %2, %0\";
1061 [(set_attr "length" "1,2,2,3")])
1064 ;;- subtract instructions
1065 ;; we don't have to care for constant second
1066 ;; args, since they are canonical plus:xx now!
1067 ;; also for minus:DF ??
1069 (define_insn "subdf3"
1070 [(set (match_operand:DF 0 "register_operand" "=a,a")
1071 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
1072 (match_operand:DF 2 "general_operand" "fR,Q")))]
1075 [(set_attr "length" "1,2")])
1077 (define_insn "subsi3"
1078 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o")
1079 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
1080 (match_operand:SI 2 "general_operand" "r,o,r,o")))]
1083 { /* Here we trust that operands don't overlap
1085 or is lateoperands the low word?? - looks like it! */
1088 rtx lateoperands[3];
1090 lateoperands[0] = operands[0];
1092 if (REG_P (operands[0]))
1093 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1095 operands[0] = adj_offsettable_operand (operands[0], 2);
1097 lateoperands[2] = operands[2];
1099 if (REG_P (operands[2]))
1100 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1102 operands[2] = adj_offsettable_operand(operands[2], 2);
1104 output_asm_insn (\"sub %2, %0\", operands);
1105 output_asm_insn (\"sbc %0\", lateoperands);
1106 output_asm_insn (\"sub %2, %0\", lateoperands);
1109 ;; offsettable memory addresses always are expensive!!!
1110 [(set_attr "length" "3,5,6,8")])
1112 (define_insn "subhi3"
1113 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1114 (minus:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1115 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1119 if (GET_CODE (operands[2]) == CONST_INT)
1122 return \"sub %2, %0\";
1124 [(set_attr "length" "1,2,2,3")])
1126 (define_insn "subqi3"
1127 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1128 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1129 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1133 if (GET_CODE (operands[2]) == CONST_INT)
1136 return \"subb %2, %0\";
1138 [(set_attr "length" "1,2,2,3")])
1140 ;;;;- and instructions
1141 ;; Bit-and on the pdp (like on the vax) is done with a clear-bits insn.
1142 (define_expand "andsi3"
1143 [(set (match_operand:SI 0 "general_operand" "=g")
1144 (and:SI (match_operand:SI 1 "general_operand" "0")
1145 (not:SI (match_operand:SI 2 "general_operand" "g"))))]
1149 extern rtx expand_unop ();
1150 if (GET_CODE (operands[2]) == CONST_INT)
1151 operands[2] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));
1153 operands[2] = expand_unop (SImode, one_cmpl_optab, operands[2], 0, 1);
1156 (define_expand "andhi3"
1157 [(set (match_operand:HI 0 "general_operand" "=g")
1158 (and:HI (match_operand:HI 1 "general_operand" "0")
1159 (not:HI (match_operand:HI 2 "general_operand" "g"))))]
1163 extern rtx expand_unop ();
1164 if (GET_CODE (operands[2]) == CONST_INT)
1165 operands[2] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));
1167 operands[2] = expand_unop (HImode, one_cmpl_optab, operands[2], 0, 1);
1170 (define_expand "andqi3"
1171 [(set (match_operand:QI 0 "general_operand" "=g")
1172 (and:QI (match_operand:QI 1 "general_operand" "0")
1173 (not:QI (match_operand:QI 2 "general_operand" "g"))))]
1177 extern rtx expand_unop ();
1178 rtx op = operands[2];
1179 if (GET_CODE (op) == CONST_INT)
1180 operands[2] = gen_rtx (CONST_INT, VOIDmode,
1181 ((1 << 8) - 1) & ~INTVAL (op));
1183 operands[2] = expand_unop (QImode, one_cmpl_optab, op, 0, 1);
1186 (define_insn "andcbsi3"
1187 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1188 (and:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1189 (not:SI (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K"))))]
1192 { /* Here we trust that operands don't overlap
1194 or is lateoperands the low word?? - looks like it! */
1197 rtx lateoperands[3];
1199 lateoperands[0] = operands[0];
1201 if (REG_P (operands[0]))
1202 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1204 operands[0] = adj_offsettable_operand (operands[0], 2);
1206 if (! CONSTANT_P(operands[2]))
1208 lateoperands[2] = operands[2];
1210 if (REG_P (operands[2]))
1211 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1213 operands[2] = adj_offsettable_operand(operands[2], 2);
1215 output_asm_insn (\"bic %2, %0\", operands);
1216 output_asm_insn (\"bic %2, %0\", lateoperands);
1220 lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
1221 operands[2] = gen_rtx(CONST_INT, VOIDmode, INTVAL(operands[2]) & 0xffff);
1223 /* these have different lengths, so we should have
1224 different constraints! */
1225 if (INTVAL(operands[2]))
1226 output_asm_insn (\"bic %2, %0\", operands);
1228 if (INTVAL(lateoperands[2]))
1229 output_asm_insn (\"bic %2, %0\", lateoperands);
1233 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1235 (define_insn "andcbhi3"
1236 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1237 (and:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1238 (not:HI (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1241 [(set_attr "length" "1,2,2,3")])
1243 (define_insn "andcbqi3"
1244 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1245 (and:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1246 (not:QI (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1249 [(set_attr "length" "1,2,2,3")])
1251 ;;- Bit set (inclusive or) instructions
1252 (define_insn "iorsi3"
1253 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1254 (ior:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1255 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
1258 { /* Here we trust that operands don't overlap
1260 or is lateoperands the low word?? - looks like it! */
1263 rtx lateoperands[3];
1265 lateoperands[0] = operands[0];
1267 if (REG_P (operands[0]))
1268 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1270 operands[0] = adj_offsettable_operand (operands[0], 2);
1272 if (! CONSTANT_P(operands[2]))
1274 lateoperands[2] = operands[2];
1276 if (REG_P (operands[2]))
1277 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1279 operands[2] = adj_offsettable_operand(operands[2], 2);
1281 output_asm_insn (\"bis %2, %0\", operands);
1282 output_asm_insn (\"bis %2, %0\", lateoperands);
1286 lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
1287 operands[2] = gen_rtx(CONST_INT, VOIDmode, INTVAL(operands[2]) & 0xffff);
1289 /* these have different lengths, so we should have
1290 different constraints! */
1291 if (INTVAL(operands[2]))
1292 output_asm_insn (\"bis %2, %0\", operands);
1294 if (INTVAL(lateoperands[2]))
1295 output_asm_insn (\"bis %2, %0\", lateoperands);
1299 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1301 (define_insn "iorhi3"
1302 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1303 (ior:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1304 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1307 [(set_attr "length" "1,2,2,3")])
1309 (define_insn "iorqi3"
1310 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1311 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1312 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1316 ;;- xor instructions
1317 (define_insn "xorsi3"
1318 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1319 (xor:SI (match_operand:SI 1 "register_operand" "%0,0,0,0")
1320 (match_operand:SI 2 "arith_operand" "r,I,J,K")))]
1323 { /* Here we trust that operands don't overlap */
1326 rtx lateoperands[3];
1328 lateoperands[0] = operands[0];
1329 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1331 if (REG_P(operands[2]))
1333 lateoperands[2] = operands[2];
1334 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1336 output_asm_insn (\"xor %2, %0\", operands);
1337 output_asm_insn (\"xor %2, %0\", lateoperands);
1342 lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
1343 operands[2] = gen_rtx(CONST_INT, VOIDmode, INTVAL(operands[2]) & 0xffff);
1345 if (INTVAL(operands[2]))
1346 output_asm_insn (\"xor %2, %0\", operands);
1348 if (INTVAL(lateoperands[2]))
1349 output_asm_insn (\"xor %2, %0\", lateoperands);
1353 [(set_attr "length" "2,1,1,2")])
1355 (define_insn "xorhi3"
1356 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1357 (xor:HI (match_operand:HI 1 "general_operand" "%0,0")
1358 (match_operand:HI 2 "register_operand" "r,r")))]
1361 [(set_attr "length" "1,2")])
1363 ;;- one complement instructions
1365 (define_insn "one_cmplhi2"
1366 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1367 (not:HI (match_operand:HI 1 "general_operand" "0,0")))]
1370 [(set_attr "length" "1,2")])
1372 (define_insn "one_cmplqi2"
1373 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1374 (not:QI (match_operand:QI 1 "general_operand" "0,0")))]
1377 [(set_attr "length" "1,2")])
1379 ;;- arithmetic shift instructions
1380 (define_insn "ashlsi3"
1381 [(set (match_operand:SI 0 "register_operand" "=r,r")
1382 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
1383 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1386 [(set_attr "length" "1,2")])
1388 ;; Arithmetic right shift on the pdp works by negating the shift count.
1389 (define_expand "ashrsi3"
1390 [(set (match_operand:SI 0 "register_operand" "=r")
1391 (ashift:SI (match_operand:SI 1 "register_operand" "0")
1392 (match_operand:HI 2 "general_operand" "g")))]
1396 operands[2] = negate_rtx (HImode, operands[2]);
1399 ;; define asl aslb asr asrb - ashc missing!
1403 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1404 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1408 [(set_attr "length" "1,2")])
1410 ;; and another possibility for asr is << -1
1411 ;; might cause problems since -1 can also be encoded as 65535!
1416 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1417 (ashift:HI (match_operand:HI 1 "general_operand" "0,0")
1421 [(set_attr "length" "1,2")])
1423 ;; shift is by arbitrary count is expensive,
1424 ;; shift by one cheap - so let's do that, if
1425 ;; space doesn't matter
1427 [(set (match_operand:HI 0 "general_operand" "=r")
1428 (ashift:HI (match_operand:HI 1 "general_operand" "0")
1429 (match_operand:HI 2 "expand_shift_operand" "O")))]
1435 for (i = 1; i <= abs(INTVAL(operands[2])); i++)
1436 if (INTVAL(operands[2]) < 0)
1437 output_asm_insn(\"asr %0\", operands);
1439 output_asm_insn(\"asl %0\", operands);
1444 [(set (attr "length") (const_int 4))])
1448 [(set (match_operand:QI 0 "general_operand" "=r,o")
1449 (ashift:QI (match_operand:QI 1 "general_operand" "0,0")
1450 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1453 { /* allowing predec or post_inc is possible, but hairy! */
1456 cnt = INTVAL(operands[2]) & 0x0007;
1458 for (i=0 ; i < cnt ; i++)
1459 output_asm_insn(\"aslb %0\", operands);
1463 ;; set attribute length ( match_dup 2 & 7 ) *(1 or 2) !!!
1464 [(set_attr_alternative "length"
1470 ; [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1471 ; (ashiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
1475 ; [(set_attr "length" "1,2")])
1479 [(set (match_operand:QI 0 "general_operand" "=r,o")
1480 (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0")
1481 (match_operand:HI 2 "const_immediate_operand" "n,n")))]
1484 { /* allowing predec or post_inc is possible, but hairy! */
1487 cnt = INTVAL(operands[2]) & 0x0007;
1489 for (i=0 ; i < cnt ; i++)
1490 output_asm_insn(\"asrb %0\", operands);
1494 [(set_attr_alternative "length"
1498 ;; the following is invalid - too complex!!! - just say 14 !!!
1499 ; [(set (attr "length") (plus (and (match_dup 2)
1501 ; (and (match_dup 2)
1502 ; (const_int 7))))])
1506 ;; can we get +-1 in the next pattern? should
1507 ;; have been caught by previous patterns!
1509 (define_insn "ashlhi3"
1510 [(set (match_operand:HI 0 "register_operand" "=r,r")
1511 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
1512 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1516 if (GET_CODE(operands[2]) == CONST_INT)
1517 if (INTVAL(operands[2]) == 1)
1519 else if (INTVAL(operands[2]) == -1)
1522 return \"ash %2,%0\";
1524 [(set_attr "length" "1,2")])
1526 ;; Arithmetic right shift on the pdp works by negating the shift count.
1527 (define_expand "ashrhi3"
1528 [(set (match_operand:HI 0 "register_operand" "=r")
1529 (ashift:HI (match_operand:HI 1 "register_operand" "0")
1530 (match_operand:HI 2 "general_operand" "g")))]
1534 operands[2] = negate_rtx (HImode, operands[2]);
1537 ;;;;- logical shift instructions
1538 ;;(define_insn "lshrsi3"
1539 ;; [(set (match_operand:HI 0 "register_operand" "=r")
1540 ;; (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
1541 ;; (match_operand:HI 2 "arith_operand" "rI")))]
1547 (define_insn "absdf2"
1548 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1549 (abs:DF (match_operand:DF 1 "general_operand" "0,0")))]
1552 [(set_attr "length" "1,2")])
1554 (define_insn "abshi2"
1555 [(set (match_operand:HI 0 "general_operand" "=r,o")
1556 (abs:HI (match_operand:HI 1 "general_operand" "0,0")))]
1557 "TARGET_ABSHI_BUILTIN"
1563 output_asm_insn(\"tst %0\", operands);
1564 sprintf(buf, \"bge abshi%d\", count);
1565 output_asm_insn(buf, NULL);
1566 output_asm_insn(\"neg %0\", operands);
1567 sprintf(buf, \"\\nabshi%d:\", count++);
1568 output_asm_insn(buf, NULL);
1572 [(set_attr "length" "3,5")])
1575 ;; define expand abshi - is much better !!! - but
1576 ;; will it be optimized into an abshi2 ?
1577 ;; it will leave better code, because the tsthi might be
1579 ; -- just a thought - don't have time to check
1581 ;(define_expand "abshi2"
1582 ; [(match_operand:HI 0 "general_operand" "")
1583 ; (match_operand:HI 1 "general_operand" "")]
1587 ; rtx label = gen_label_rtx ();
1589 ; /* do I need this? */
1590 ; do_pending_stack_adjust ();
1592 ; emit_move_insn (operands[0], operands[1]);
1594 ; emit_insn (gen_tsthi (operands[0]));
1595 ; emit_insn (gen_bge (label1));
1597 ; emit_insn (gen_neghi(operands[0], operands[0])
1601 ; emit_label (label);
1603 ; /* allow REG_NOTES to be set on last insn (labels don't have enough
1604 ; fields, and can't be used for REG_NOTES anyway). */
1605 ; emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
1611 (define_insn "negdf2"
1612 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1613 (neg:DF (match_operand:DF 1 "register_operand" "0,0")))]
1616 [(set_attr "length" "1,2")])
1618 (define_insn "neghi2"
1619 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1620 (neg:HI (match_operand:HI 1 "general_operand" "0,0")))]
1623 [(set_attr "length" "1,2")])
1625 (define_insn "negqi2"
1626 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1627 (neg:QI (match_operand:QI 1 "general_operand" "0,0")))]
1630 [(set_attr "length" "1,2")])
1633 ;; Unconditional and other jump instructions
1636 (label_ref (match_operand 0 "" "")))]
1639 [(set_attr "length" "2")])
1643 (label_ref (match_operand 0 "" "")))
1644 (clobber (const_int 1))]
1647 [(set_attr "length" "2")])
1649 (define_insn "tablejump"
1650 [(set (pc) (match_operand:HI 0 "general_operand" "rR,Q"))
1651 (use (label_ref (match_operand 1 "" "")))]
1654 [(set_attr "length" "1,2")])
1656 ;; indirect jump - let's be conservative!
1657 ;; allow only register_operand, even though we could also
1658 ;; allow labels etc.
1660 (define_insn "indirect_jump"
1661 [(set (pc) (match_operand:HI 0 "register_operand" "r"))]
1665 ;;- jump to subroutine
1668 [(call (match_operand:HI 0 "general_operand" "R,Q")
1669 (match_operand:HI 1 "general_operand" "g,g"))
1670 ;; (use (reg:HI 0)) what was that ???
1672 ;;- Don't use operand 1 for most machines.
1675 [(set_attr "length" "1,2")])
1677 ;;- jump to subroutine
1678 (define_insn "call_value"
1679 [(set (match_operand 0 "" "")
1680 (call (match_operand:HI 1 "general_operand" "R,Q")
1681 (match_operand:HI 2 "general_operand" "g,g")))
1682 ;; (use (reg:HI 0)) - what was that ????
1684 ;;- Don't use operand 2 for most machines.
1687 [(set_attr "length" "1,2")])
1698 (define_insn "muldf3"
1699 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1700 (mult:DF (match_operand:DF 1 "register_operand" "%0,0,0")
1701 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1704 [(set_attr "length" "1,2,5")])
1706 ;; 16 bit result multiply:
1707 ;; currently we multiply only into odd registers, so we don't use two
1708 ;; registers - but this is a bit inefficient at times. If we define
1709 ;; a register class for each register, then we can specify properly
1710 ;; which register need which scratch register ....
1712 (define_insn "mulhi3"
1713 [(set (match_operand:HI 0 "register_operand" "=d,d") ; multiply regs
1714 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
1715 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1718 [(set_attr "length" "1,2")])
1721 (define_expand "mulhisi3"
1723 (match_operand:HI 1 "general_operand" "g,g"))
1724 (set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1725 (mult:SI (truncate:HI
1727 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1729 "operands[3] = gen_lowpart(HImode, operands[1]);")
1732 [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1733 (mult:SI (truncate:HI
1734 (match_operand:SI 1 "register_operand" "%0,0"))
1735 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1738 [(set_attr "length" "1,2")])
1740 ;(define_insn "mulhisi3"
1741 ; [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1742 ; (mult:SI (truncate:HI
1743 ; (match_operand:SI 1 "register_operand" "%0,0"))
1744 ; (match_operand:HI 2 "general_operand" "rR,Qi")))]
1747 ; [(set_attr "length" "1,2")])
1750 (define_insn "divdf3"
1751 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1752 (div:DF (match_operand:DF 1 "register_operand" "0,0,0")
1753 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1756 [(set_attr "length" "1,2,5")])
1759 (define_expand "divhi3"
1760 [(set (subreg:HI (match_dup 1) 0)
1761 (div:HI (match_operand:SI 1 "general_operand" "0")
1762 (match_operand:HI 2 "general_operand" "g")))
1763 (set (match_operand:HI 0 "general_operand" "=r")
1764 (subreg:HI (match_dup 1) 0))]
1769 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1770 (div:HI (match_operand:SI 1 "general_operand" "0")
1771 (match_operand:HI 2 "general_operand" "g")))]
1774 [(set_attr "length" "2")])
1776 (define_expand "modhi3"
1777 [(set (subreg:HI (match_dup 1) 1)
1778 (mod:HI (match_operand:SI 1 "general_operand" "0")
1779 (match_operand:HI 2 "general_operand" "g")))
1780 (set (match_operand:HI 0 "general_operand" "=r")
1781 (subreg:HI (match_dup 1) 1))]
1786 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 1)
1787 (mod:HI (match_operand:SI 1 "general_operand" "0")
1788 (match_operand:HI 2 "general_operand" "g")))]
1791 [(set_attr "length" "2")])
1793 ;(define_expand "divmodhi4"
1794 ; [(parallel [(set (subreg:HI (match_dup 1) 0)
1795 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1796 ; (match_operand:HI 2 "general_operand" "g")))
1797 ; (set (subreg:HI (match_dup 1) 1)
1798 ; (mod:HI (match_dup 1)
1800 ; (set (match_operand:HI 3 "general_operand" "=r")
1801 ; (subreg:HI (match_dup 1) 1))
1802 ; (set (match_operand:HI 0 "general_operand" "=r")
1803 ; (subreg:HI (match_dup 1) 0))]
1808 ; [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 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 0) 1)
1812 ; (mod:HI (match_dup 1)
1818 ;; is rotate doing the right thing to be included here ????