1 ;;- Machine description for the pdp11 for GNU C compiler
2 ;; Copyright (C) 1994, 1995, 1997 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 ;; library 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 (match_operand:BLK 0 "general_operand" "=g,g")
686 (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 5))
691 (clobber (match_dup 6))
692 (clobber (match_dup 2))])]
693 "(TARGET_BCOPY_BUILTIN)"
697 = change_address (operands[0], VOIDmode,
698 copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
700 = change_address (operands[1], VOIDmode,
701 copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
703 operands[5] = XEXP (operands[0], 0);
704 operands[6] = XEXP (operands[1], 0);
708 (define_insn "" ; "movstrhi"
709 [(set (mem:BLK (match_operand:HI 0 "general_operand" "=r,r"))
710 (mem:BLK (match_operand:HI 1 "general_operand" "r,r")))
711 (use (match_operand:HI 2 "arith_operand" "n,&r"))
712 (use (match_operand:HI 3 "immediate_operand" "i,i"))
713 (clobber (match_scratch:HI 4 "=&r,X"))
714 (clobber (match_dup 0))
715 (clobber (match_dup 1))
716 (clobber (match_dup 2))]
717 "(TARGET_BCOPY_BUILTIN)"
718 "* return output_block_move (operands);"
720 [(set_attr "length" "40")])
724 ;;- truncation instructions
726 (define_insn "truncdfsf2"
727 [(set (match_operand:SF 0 "general_operand" "=r,R,Q")
728 (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a,a")))]
730 "* if (which_alternative ==0)
732 output_asm_insn(\"stcdf %1, -(sp)\", operands);
733 output_asm_insn(\"mov (sp)+, %0\", operands);
734 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
735 output_asm_insn(\"mov (sp)+, %0\", operands);
738 else if (which_alternative == 1)
739 return \"stcdf %1, %0\";
741 return \"stcdf %1, %0\";
743 [(set_attr "length" "3,1,2")])
746 (define_expand "truncsihi2"
747 [(set (match_operand:HI 0 "general_operand" "=g")
749 (match_operand:SI 1 "general_operand" "or")
755 ;;- zero extension instructions
757 (define_insn "zero_extendqihi2"
758 [(set (match_operand:HI 0 "general_operand" "=r")
759 (zero_extend:HI (match_operand:QI 1 "general_operand" "0")))]
762 [(set_attr "length" "2")])
764 (define_expand "zero_extendhisi2"
768 (match_operand:HI 1 "register_operand" "r"))
770 (match_operand:SI 0 "register_operand" "=r")
774 "/* operands[1] = make_safe_from (operands[1], operands[0]); */")
777 ;;- sign extension instructions
779 (define_insn "extendsfdf2"
780 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
781 (float_extend:DF (match_operand:SF 1 "general_operand" "r,R,Q")))]
784 mov %1, -(sp)\;ldcfd (sp)+,%0
787 [(set_attr "length" "2,1,2")])
789 ;; does movb sign extend in register-to-register move?
790 (define_insn "extendqihi2"
791 [(set (match_operand:HI 0 "register_operand" "=r,r")
792 (sign_extend:HI (match_operand:QI 1 "general_operand" "rR,Q")))]
795 [(set_attr "length" "1,2")])
797 (define_insn "extendqisi2"
798 [(set (match_operand:SI 0 "register_operand" "=r,r")
799 (sign_extend:SI (match_operand:QI 1 "general_operand" "rR,Q")))]
805 /* make register pair available */
806 latehalf[0] = operands[0];
807 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
809 output_asm_insn(\"movb %1, %0\", operands);
810 output_asm_insn(\"sxt %0\", latehalf);
814 [(set_attr "length" "2,3")])
816 ;; maybe we have to use define_expand to say that we have the instruction,
817 ;; unconditionally, and then match dependent on CPU type:
819 (define_expand "extendhisi2"
820 [(set (match_operand:SI 0 "general_operand" "=g")
821 (sign_extend:SI (match_operand:HI 1 "general_operand" "g")))]
825 (define_insn "" ; "extendhisi2"
826 [(set (match_operand:SI 0 "general_operand" "=o,<,r")
827 (sign_extend:SI (match_operand:HI 1 "general_operand" "g,g,g")))]
833 /* we don't want to mess with auto increment */
835 switch(which_alternative)
839 latehalf[0] = operands[0];
840 operands[0] = adj_offsettable_operand(operands[0], 2);
842 output_asm_insn(\"mov %1, %0\", operands);
843 output_asm_insn(\"sxt %0\", latehalf);
849 /* - auto-decrement - right direction ;-) */
850 output_asm_insn(\"mov %1, %0\", operands);
851 output_asm_insn(\"sxt %0\", operands);
857 /* make register pair available */
858 latehalf[0] = operands[0];
859 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
861 output_asm_insn(\"mov %1, %0\", operands);
862 output_asm_insn(\"sxt %0\", latehalf);
871 [(set_attr "length" "5,3,3")])
875 [(set (match_operand:SI 0 "register_operand" "=r")
876 (sign_extend:SI (match_operand:HI 1 "general_operand" "0")))]
884 lateoperands[0] = operands[0];
885 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
887 output_asm_insn(\"tst %0\", operands);
888 sprintf(buf, \"bge extendhisi%d\", count);
889 output_asm_insn(buf, NULL);
890 output_asm_insn(\"mov -1, %0\", lateoperands);
891 sprintf(buf, \"bne extendhisi%d\", count+1);
892 output_asm_insn(buf, NULL);
893 sprintf(buf, \"\\nextendhisi%d:\", count);
894 output_asm_insn(buf, NULL);
895 output_asm_insn(\"clr %0\", lateoperands);
896 sprintf(buf, \"\\nextendhisi%d:\", count+1);
897 output_asm_insn(buf, NULL);
903 [(set_attr "length" "6")])
905 ;; make float to int and vice versa
906 ;; using the cc_status.flag field we could probably cut down
908 ;; assume that we are normally in double and integer mode -
909 ;; what do pdp library routines do to fpu mode ?
911 (define_insn "floatsidf2"
912 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
913 (float:DF (match_operand:SI 1 "general_operand" "r,R,Q")))]
915 "* if (which_alternative ==0)
920 latehalf[1] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
921 output_asm_insn(\"mov %1, -(sp)\", latehalf);
922 output_asm_insn(\"mov %1, -(sp)\", operands);
924 output_asm_insn(\"setl\", operands);
925 output_asm_insn(\"ldcld (sp)+, %0\", operands);
926 output_asm_insn(\"seti\", operands);
929 else if (which_alternative == 1)
930 return \"setl\;ldcld %1, %0\;seti\";
932 return \"setl\;ldcld %1, %0\;seti\";
934 [(set_attr "length" "5,3,4")])
936 (define_insn "floathidf2"
937 [(set (match_operand:DF 0 "register_operand" "=a,a")
938 (float:DF (match_operand:HI 1 "general_operand" "rR,Qi")))]
941 [(set_attr "length" "1,2")])
944 (define_insn "fix_truncdfsi2"
945 [(set (match_operand:SI 0 "general_operand" "=r,R,Q")
946 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a,a"))))]
948 "* if (which_alternative ==0)
950 output_asm_insn(\"setl\", operands);
951 output_asm_insn(\"stcdl %1, -(sp)\", operands);
952 output_asm_insn(\"seti\", operands);
953 output_asm_insn(\"mov (sp)+, %0\", operands);
954 operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
955 output_asm_insn(\"mov (sp)+, %0\", operands);
958 else if (which_alternative == 1)
959 return \"setl\;stcdl %1, %0\;seti\";
961 return \"setl\;stcdl %1, %0\;seti\";
963 [(set_attr "length" "5,3,4")])
965 (define_insn "fix_truncdfhi2"
966 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
967 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "a,a"))))]
970 [(set_attr "length" "1,2")])
973 ;;- arithmetic instructions
976 (define_insn "adddf3"
977 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
978 (plus:DF (match_operand:DF 1 "register_operand" "%0,0,0")
979 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
982 [(set_attr "length" "1,2,5")])
984 (define_insn "addsi3"
985 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
986 (plus:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
987 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
990 { /* Here we trust that operands don't overlap
992 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)
1043 if (INTVAL(operands[2]) == 1)
1045 else if (INTVAL(operands[2]) == -1)
1048 return \"add %2, %0\";
1050 [(set_attr "length" "1,2,2,3")])
1052 (define_insn "addqi3"
1053 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1054 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1055 (match_operand:QI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
1059 if (GET_CODE (operands[2]) == CONST_INT)
1060 if (INTVAL(operands[2]) == 1)
1062 else if (INTVAL(operands[2]) == -1)
1065 return \"addb %2, %0\";
1067 [(set_attr "length" "1,2,2,3")])
1070 ;;- subtract instructions
1071 ;; we don't have to care for constant second
1072 ;; args, since they are canonical plus:xx now!
1073 ;; also for minus:DF ??
1075 (define_insn "subdf3"
1076 [(set (match_operand:DF 0 "register_operand" "=a,a")
1077 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
1078 (match_operand:DF 2 "general_operand" "fR,Q")))]
1081 [(set_attr "length" "1,2")])
1083 (define_insn "subsi3"
1084 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o")
1085 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
1086 (match_operand:SI 2 "general_operand" "r,o,r,o")))]
1089 { /* Here we trust that operands don't overlap
1091 or is lateoperands the low word?? - looks like it! */
1094 rtx lateoperands[3];
1096 lateoperands[0] = operands[0];
1098 if (REG_P (operands[0]))
1099 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1101 operands[0] = adj_offsettable_operand (operands[0], 2);
1103 lateoperands[2] = operands[2];
1105 if (REG_P (operands[2]))
1106 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1108 operands[2] = adj_offsettable_operand(operands[2], 2);
1110 output_asm_insn (\"sub %2, %0\", operands);
1111 output_asm_insn (\"sbc %0\", lateoperands);
1112 output_asm_insn (\"sub %2, %0\", lateoperands);
1115 ;; offsettable memory addresses always are expensive!!!
1116 [(set_attr "length" "3,5,6,8")])
1118 (define_insn "subhi3"
1119 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1120 (minus:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1121 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1125 if (GET_CODE (operands[2]) == CONST_INT)
1128 return \"sub %2, %0\";
1130 [(set_attr "length" "1,2,2,3")])
1132 (define_insn "subqi3"
1133 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1134 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1135 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1139 if (GET_CODE (operands[2]) == CONST_INT)
1142 return \"subb %2, %0\";
1144 [(set_attr "length" "1,2,2,3")])
1146 ;;;;- and instructions
1147 ;; Bit-and on the pdp (like on the vax) is done with a clear-bits insn.
1148 (define_expand "andsi3"
1149 [(set (match_operand:SI 0 "general_operand" "=g")
1150 (and:SI (match_operand:SI 1 "general_operand" "0")
1151 (not:SI (match_operand:SI 2 "general_operand" "g"))))]
1155 extern rtx expand_unop ();
1156 if (GET_CODE (operands[2]) == CONST_INT)
1157 operands[2] = GEN_INT (~INTVAL (operands[2]));
1159 operands[2] = expand_unop (SImode, one_cmpl_optab, operands[2], 0, 1);
1162 (define_expand "andhi3"
1163 [(set (match_operand:HI 0 "general_operand" "=g")
1164 (and:HI (match_operand:HI 1 "general_operand" "0")
1165 (not:HI (match_operand:HI 2 "general_operand" "g"))))]
1169 extern rtx expand_unop ();
1170 if (GET_CODE (operands[2]) == CONST_INT)
1171 operands[2] = GEN_INT (~INTVAL (operands[2]));
1173 operands[2] = expand_unop (HImode, one_cmpl_optab, operands[2], 0, 1);
1176 (define_expand "andqi3"
1177 [(set (match_operand:QI 0 "general_operand" "=g")
1178 (and:QI (match_operand:QI 1 "general_operand" "0")
1179 (not:QI (match_operand:QI 2 "general_operand" "g"))))]
1183 extern rtx expand_unop ();
1184 rtx op = operands[2];
1185 if (GET_CODE (op) == CONST_INT)
1186 operands[2] = GEN_INT (((1 << 8) - 1) & ~INTVAL (op));
1188 operands[2] = expand_unop (QImode, one_cmpl_optab, op, 0, 1);
1191 (define_insn "andcbsi3"
1192 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1193 (and:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1194 (not:SI (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K"))))]
1197 { /* Here we trust that operands don't overlap
1199 or is lateoperands the low word?? - looks like it! */
1202 rtx lateoperands[3];
1204 lateoperands[0] = operands[0];
1206 if (REG_P (operands[0]))
1207 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1209 operands[0] = adj_offsettable_operand (operands[0], 2);
1211 if (! CONSTANT_P(operands[2]))
1213 lateoperands[2] = operands[2];
1215 if (REG_P (operands[2]))
1216 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1218 operands[2] = adj_offsettable_operand(operands[2], 2);
1220 output_asm_insn (\"bic %2, %0\", operands);
1221 output_asm_insn (\"bic %2, %0\", lateoperands);
1225 lateoperands[2] = GEN_INT ((INTVAL(operands[2]) >> 16) & 0xffff);
1226 operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff);
1228 /* these have different lengths, so we should have
1229 different constraints! */
1230 if (INTVAL(operands[2]))
1231 output_asm_insn (\"bic %2, %0\", operands);
1233 if (INTVAL(lateoperands[2]))
1234 output_asm_insn (\"bic %2, %0\", lateoperands);
1238 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1240 (define_insn "andcbhi3"
1241 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1242 (and:HI (match_operand:HI 1 "general_operand" "0,0,0,0")
1243 (not:HI (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1246 [(set_attr "length" "1,2,2,3")])
1248 (define_insn "andcbqi3"
1249 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1250 (and:QI (match_operand:QI 1 "general_operand" "0,0,0,0")
1251 (not:QI (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi"))))]
1254 [(set_attr "length" "1,2,2,3")])
1256 ;;- Bit set (inclusive or) instructions
1257 (define_insn "iorsi3"
1258 [(set (match_operand:SI 0 "general_operand" "=r,r,o,o,r,r,r,o,o,o")
1259 (ior:SI (match_operand:SI 1 "general_operand" "%0,0,0,0,0,0,0,0,0,0")
1260 (match_operand:SI 2 "general_operand" "r,o,r,o,I,J,K,I,J,K")))]
1263 { /* Here we trust that operands don't overlap
1265 or is lateoperands the low word?? - looks like it! */
1268 rtx lateoperands[3];
1270 lateoperands[0] = operands[0];
1272 if (REG_P (operands[0]))
1273 operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1);
1275 operands[0] = adj_offsettable_operand (operands[0], 2);
1277 if (! CONSTANT_P(operands[2]))
1279 lateoperands[2] = operands[2];
1281 if (REG_P (operands[2]))
1282 operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1);
1284 operands[2] = adj_offsettable_operand(operands[2], 2);
1286 output_asm_insn (\"bis %2, %0\", operands);
1287 output_asm_insn (\"bis %2, %0\", lateoperands);
1291 lateoperands[2] = GEN_INT ((INTVAL(operands[2]) >> 16) & 0xffff);
1292 operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff);
1294 /* these have different lengths, so we should have
1295 different constraints! */
1296 if (INTVAL(operands[2]))
1297 output_asm_insn (\"bis %2, %0\", operands);
1299 if (INTVAL(lateoperands[2]))
1300 output_asm_insn (\"bis %2, %0\", lateoperands);
1304 [(set_attr "length" "2,4,4,6,2,2,4,3,3,6")])
1306 (define_insn "iorhi3"
1307 [(set (match_operand:HI 0 "general_operand" "=rR,rR,Q,Q")
1308 (ior:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
1309 (match_operand:HI 2 "general_operand" "rR,Qi,rR,Qi")))]
1312 [(set_attr "length" "1,2,2,3")])
1314 (define_insn "iorqi3"
1315 [(set (match_operand:QI 0 "general_operand" "=rR,rR,Q,Q")
1316 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0")
1317 (match_operand:QI 2 "general_operand" "rR,Qi,rR,Qi")))]
1321 ;;- xor instructions
1322 (define_insn "xorsi3"
1323 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1324 (xor:SI (match_operand:SI 1 "register_operand" "%0,0,0,0")
1325 (match_operand:SI 2 "arith_operand" "r,I,J,K")))]
1328 { /* 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)
1522 if (INTVAL(operands[2]) == 1)
1524 else if (INTVAL(operands[2]) == -1)
1527 return \"ash %2,%0\";
1529 [(set_attr "length" "1,2")])
1531 ;; Arithmetic right shift on the pdp works by negating the shift count.
1532 (define_expand "ashrhi3"
1533 [(set (match_operand:HI 0 "register_operand" "=r")
1534 (ashift:HI (match_operand:HI 1 "register_operand" "0")
1535 (match_operand:HI 2 "general_operand" "g")))]
1539 operands[2] = negate_rtx (HImode, operands[2]);
1542 ;;;;- logical shift instructions
1543 ;;(define_insn "lshrsi3"
1544 ;; [(set (match_operand:HI 0 "register_operand" "=r")
1545 ;; (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
1546 ;; (match_operand:HI 2 "arith_operand" "rI")))]
1552 (define_insn "absdf2"
1553 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1554 (abs:DF (match_operand:DF 1 "general_operand" "0,0")))]
1557 [(set_attr "length" "1,2")])
1559 (define_insn "abshi2"
1560 [(set (match_operand:HI 0 "general_operand" "=r,o")
1561 (abs:HI (match_operand:HI 1 "general_operand" "0,0")))]
1562 "TARGET_ABSHI_BUILTIN"
1568 output_asm_insn(\"tst %0\", operands);
1569 sprintf(buf, \"bge abshi%d\", count);
1570 output_asm_insn(buf, NULL);
1571 output_asm_insn(\"neg %0\", operands);
1572 sprintf(buf, \"\\nabshi%d:\", count++);
1573 output_asm_insn(buf, NULL);
1577 [(set_attr "length" "3,5")])
1580 ;; define expand abshi - is much better !!! - but
1581 ;; will it be optimized into an abshi2 ?
1582 ;; it will leave better code, because the tsthi might be
1584 ; -- just a thought - don't have time to check
1586 ;(define_expand "abshi2"
1587 ; [(match_operand:HI 0 "general_operand" "")
1588 ; (match_operand:HI 1 "general_operand" "")]
1592 ; rtx label = gen_label_rtx ();
1594 ; /* do I need this? */
1595 ; do_pending_stack_adjust ();
1597 ; emit_move_insn (operands[0], operands[1]);
1599 ; emit_insn (gen_tsthi (operands[0]));
1600 ; emit_insn (gen_bge (label1));
1602 ; emit_insn (gen_neghi(operands[0], operands[0])
1606 ; emit_label (label);
1608 ; /* allow REG_NOTES to be set on last insn (labels don't have enough
1609 ; fields, and can't be used for REG_NOTES anyway). */
1610 ; emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
1616 (define_insn "negdf2"
1617 [(set (match_operand:DF 0 "general_operand" "=fR,Q")
1618 (neg:DF (match_operand:DF 1 "register_operand" "0,0")))]
1621 [(set_attr "length" "1,2")])
1623 (define_insn "neghi2"
1624 [(set (match_operand:HI 0 "general_operand" "=rR,Q")
1625 (neg:HI (match_operand:HI 1 "general_operand" "0,0")))]
1628 [(set_attr "length" "1,2")])
1630 (define_insn "negqi2"
1631 [(set (match_operand:QI 0 "general_operand" "=rR,Q")
1632 (neg:QI (match_operand:QI 1 "general_operand" "0,0")))]
1635 [(set_attr "length" "1,2")])
1638 ;; Unconditional and other jump instructions
1641 (label_ref (match_operand 0 "" "")))]
1644 [(set_attr "length" "2")])
1648 (label_ref (match_operand 0 "" "")))
1649 (clobber (const_int 1))]
1652 [(set_attr "length" "2")])
1654 (define_insn "tablejump"
1655 [(set (pc) (match_operand:HI 0 "general_operand" "rR,Q"))
1656 (use (label_ref (match_operand 1 "" "")))]
1659 [(set_attr "length" "1,2")])
1661 ;; indirect jump - let's be conservative!
1662 ;; allow only register_operand, even though we could also
1663 ;; allow labels etc.
1665 (define_insn "indirect_jump"
1666 [(set (pc) (match_operand:HI 0 "register_operand" "r"))]
1670 ;;- jump to subroutine
1673 [(call (match_operand:HI 0 "general_operand" "R,Q")
1674 (match_operand:HI 1 "general_operand" "g,g"))
1675 ;; (use (reg:HI 0)) what was that ???
1677 ;;- Don't use operand 1 for most machines.
1680 [(set_attr "length" "1,2")])
1682 ;;- jump to subroutine
1683 (define_insn "call_value"
1684 [(set (match_operand 0 "" "")
1685 (call (match_operand:HI 1 "general_operand" "R,Q")
1686 (match_operand:HI 2 "general_operand" "g,g")))
1687 ;; (use (reg:HI 0)) - what was that ????
1689 ;;- Don't use operand 2 for most machines.
1692 [(set_attr "length" "1,2")])
1703 (define_insn "muldf3"
1704 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1705 (mult:DF (match_operand:DF 1 "register_operand" "%0,0,0")
1706 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1709 [(set_attr "length" "1,2,5")])
1711 ;; 16 bit result multiply:
1712 ;; currently we multiply only into odd registers, so we don't use two
1713 ;; registers - but this is a bit inefficient at times. If we define
1714 ;; a register class for each register, then we can specify properly
1715 ;; which register need which scratch register ....
1717 (define_insn "mulhi3"
1718 [(set (match_operand:HI 0 "register_operand" "=d,d") ; multiply regs
1719 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
1720 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1723 [(set_attr "length" "1,2")])
1726 (define_expand "mulhisi3"
1728 (match_operand:HI 1 "general_operand" "g,g"))
1729 (set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1730 (mult:SI (truncate:HI
1732 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1734 "operands[3] = gen_lowpart(HImode, operands[1]);")
1737 [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1738 (mult:SI (truncate:HI
1739 (match_operand:SI 1 "register_operand" "%0,0"))
1740 (match_operand:HI 2 "general_operand" "rR,Qi")))]
1743 [(set_attr "length" "1,2")])
1745 ;(define_insn "mulhisi3"
1746 ; [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
1747 ; (mult:SI (truncate:HI
1748 ; (match_operand:SI 1 "register_operand" "%0,0"))
1749 ; (match_operand:HI 2 "general_operand" "rR,Qi")))]
1752 ; [(set_attr "length" "1,2")])
1755 (define_insn "divdf3"
1756 [(set (match_operand:DF 0 "register_operand" "=a,a,a")
1757 (div:DF (match_operand:DF 1 "register_operand" "0,0,0")
1758 (match_operand:DF 2 "general_operand" "fR,Q,F")))]
1761 [(set_attr "length" "1,2,5")])
1764 (define_expand "divhi3"
1765 [(set (subreg:HI (match_dup 1) 0)
1766 (div:HI (match_operand:SI 1 "general_operand" "0")
1767 (match_operand:HI 2 "general_operand" "g")))
1768 (set (match_operand:HI 0 "general_operand" "=r")
1769 (subreg:HI (match_dup 1) 0))]
1774 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1775 (div:HI (match_operand:SI 1 "general_operand" "0")
1776 (match_operand:HI 2 "general_operand" "g")))]
1779 [(set_attr "length" "2")])
1781 (define_expand "modhi3"
1782 [(set (subreg:HI (match_dup 1) 1)
1783 (mod:HI (match_operand:SI 1 "general_operand" "0")
1784 (match_operand:HI 2 "general_operand" "g")))
1785 (set (match_operand:HI 0 "general_operand" "=r")
1786 (subreg:HI (match_dup 1) 1))]
1791 [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 1)
1792 (mod:HI (match_operand:SI 1 "general_operand" "0")
1793 (match_operand:HI 2 "general_operand" "g")))]
1796 [(set_attr "length" "2")])
1798 ;(define_expand "divmodhi4"
1799 ; [(parallel [(set (subreg:HI (match_dup 1) 0)
1800 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1801 ; (match_operand:HI 2 "general_operand" "g")))
1802 ; (set (subreg:HI (match_dup 1) 1)
1803 ; (mod:HI (match_dup 1)
1805 ; (set (match_operand:HI 3 "general_operand" "=r")
1806 ; (subreg:HI (match_dup 1) 1))
1807 ; (set (match_operand:HI 0 "general_operand" "=r")
1808 ; (subreg:HI (match_dup 1) 0))]
1813 ; [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0)
1814 ; (div:HI (match_operand:SI 1 "general_operand" "0")
1815 ; (match_operand:HI 2 "general_operand" "g")))
1816 ; (set (subreg:HI (match_dup 0) 1)
1817 ; (mod:HI (match_dup 1)
1823 ;; is rotate doing the right thing to be included here ????