1 ;;- Machine description for GNU compiler
2 ;;- MIL-STD-1750A version.
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
4 ;; Contributed by O.M.Kellogg, DASA (okellogg@salyko.cube.net).
6 ;; This file is part of GNU CC.
8 ;; GNU CC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 1, or (at your option)
13 ;; GNU CC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU CC; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 ;;- instruction definitions
25 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
27 ;;- When naming insn's (operand 0 of define_insn) be careful about using
28 ;;- names from other targets machine descriptions.
30 ;; MIL-STD-1750 specific remarks:
32 ;; 1) BITS_PER_UNIT = 16
34 ;; 2) GCC to MIL-STD-1750 data type mappings:
35 ;; QImode => single integer (16 bits or 1 reg).
36 ;; HImode => double integer (32 bits or 2 regs).
37 ;; HFmode => single precision float (32 bits or 2 regs).
38 ;; TQFmode => extended precision float (48 bits or 3 regs).
40 ;; 3) Immediate integer operands Constraints:
45 ;; 'M' -32768 .. 32767
46 ;; 'O' => 0 (for optimizations and GCC quirks)
49 ;;- Assembly output ending in ".M" are macros in file M1750.INC
54 [(set (match_operand:QI 0 "push_operand" "=<")
55 (match_operand:QI 1 "general_operand" "r"))]
60 [(set (match_operand:HI 0 "push_operand" "=<")
61 (match_operand:HI 1 "general_operand" "r"))]
66 new_operands[0] = operands[1];
67 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[1])+1);
71 [(set (match_operand:HF 0 "push_operand" "=<")
72 (match_operand:HF 1 "general_operand" "r"))]
77 new_operands[0] = operands[1];
78 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[1])+1);
79 output_asm_insn(\"pshm r%0,r%1\",new_operands);
84 [(set (match_operand:TQF 0 "push_operand" "=<")
85 (match_operand:TQF 1 "general_operand" "r"))]
90 new_operands[0] = operands[1];
91 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[1])+2);
92 output_asm_insn(\"pshm r%0,r%1\",new_operands);
98 [(set (match_operand:QI 0 "general_operand" "=r")
99 (match_operand:QI 1 "push_operand" ">"))]
104 [(set (match_operand:HI 0 "general_operand" "=r")
105 (match_operand:HI 1 "push_operand" ">"))]
110 new_operands[0] = operands[0];
111 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[0])+1);
112 output_asm_insn(\"popm r%0,r%1\",new_operands);
117 [(set (match_operand:HF 0 "general_operand" "=r")
118 (match_operand:HF 1 "push_operand" ">"))]
123 new_operands[0] = operands[0];
124 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[0])+1);
125 output_asm_insn(\"popm r%0,r%1\",new_operands);
130 [(set (match_operand:TQF 0 "general_operand" "=r")
131 (match_operand:TQF 1 "push_operand" ">"))]
136 new_operands[0] = operands[0];
137 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[0])+2);
138 output_asm_insn(\"popm r%0,r%1\",new_operands);
142 ;; Test operations. These shouldn't really occur for 1750:
143 ;; all important instructions set the cc's (see NOTICE_UPDATE_CC)
147 (match_operand:QI 0 "register_operand" "r"))]
149 "lr r%0,r%0 ; from tstqi")
153 (match_operand:HI 0 "register_operand" "r"))]
155 "dlr r%0,r%0 ; from tsthi")
159 (match_operand:HF 0 "register_operand" "r"))]
161 "dlr r%0,r%0 ; from tsthf")
163 ;; This one is happy with "roughly zero" :-) (should be improved)
164 (define_insn "tsttqf"
166 (match_operand:TQF 0 "register_operand" "r"))]
168 "dlr r%0,r%0 ; from tsttqf")
173 ; there is a problem with this insn in gcc-2.2.3
174 ; (clobber (match_dup 2)) does not prevent use of this operand later
176 (define_insn "movstrqi"
177 [(set (mem:BLK (match_operand:QI 0 "register_operand" "r"))
178 (mem:BLK (match_operand:QI 1 "register_operand" "r")))
179 (use (match_operand:QI 2 "register_operand" "r"))
180 (use (match_operand:QI 3 "immediate_operand" ""))
181 (clobber (match_dup 0))
182 (clobber (match_dup 1))
183 (clobber (match_dup 2))]
185 "* return (char *)movcnt_regno_adjust(operands); ")
188 ;; compare instructions.
192 (compare (match_operand:QI 0 "register_operand" "r,r,r,r,r")
193 (match_operand:QI 1 "general_operand" "I,J,i,r,m")))]
204 (compare (match_operand:HI 0 "general_operand" "r,r")
205 (match_operand:HI 1 "general_operand" "r,m")))]
213 (compare (match_operand:HF 0 "general_operand" "r,r")
214 (match_operand:HF 1 "general_operand" "r,m")))]
220 (define_insn "cmptqf"
222 (compare (match_operand:TQF 0 "general_operand" "r,r")
223 (match_operand:TQF 1 "general_operand" "r,m")))]
230 ;; truncation instructions
231 ;;- 1750: any needed?
233 (define_insn "trunchiqi2"
234 [(set (match_operand:QI 0 "register_operand" "=r")
236 (match_operand:HI 1 "register_operand" "r")))]
240 REGNO(operands[1]) += 1;
241 return \"lr r%0,r%1 ;trunchiqi2\";
244 ;; zero extension instructions
246 (define_insn "zero_extendqihi2"
247 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
248 (zero_extend:HI (match_operand:QI 1 "general_operand" "r,m,i")))]
252 output_asm_insn(\"xorr r%0,r%0 ;zero_extendqihi2\",operands);
253 REGNO(operands[0]) += 1;
254 switch (which_alternative)
257 return \"lr r%0,r%1\";
261 return \"lim r%0,%1\";
265 ;; sign extension instructions
267 (define_insn "extendqihi2"
268 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
269 (sign_extend:HI (match_operand:QI 1 "general_operand" "r,m,i")) )]
272 lr r%0,r%1 ;extendqihi2\;dsra r%0,16
273 l r%0,%1 ;extendqihi2\;dsra r%0,16
274 lim r%0,%1 ;extendqihi2\;dsra r%0,16 ")
277 ;; Conversions between float and double.
279 ; 1750 HF-to-TQF extend: just append 16 bits (least signif.) with all bits zero
280 (define_insn "extendhftqf2"
281 [(set (match_operand:TQF 0 "register_operand" "=r,r")
283 (match_operand:HF 1 "general_operand" "r,m")))]
287 REGNO(operands[0]) += 2;
288 output_asm_insn(\"xorr r%0,r%0 ;extendhftqf2\",operands);
289 REGNO(operands[0]) -= 2;
290 if (which_alternative == 0)
291 return \"dlr r%0,r%1\";
293 return \"dl r%0,%1\";
296 ; 1750 TQF-to-HF truncate is a no-op: just leave away the least signif. 16 bits
297 (define_insn "trunctqfhf2"
298 [(set (match_operand:HF 0 "register_operand" "=r,r")
300 (match_operand:TQF 1 "general_operand" "r,m")))]
303 dlr r%0,r%1 ;trunctqfhf2
304 dl r%0,%1 ;trunctqfhf2 ")
307 ;; Conversion between fixed point and floating point.
309 (define_insn "floatqihf2"
310 [(set (match_operand:HF 0 "register_operand" "=r")
311 (float:HF (match_operand:QI 1 "register_operand" "r")))]
315 (define_insn "floathitqf2"
316 [(set (match_operand:TQF 0 "register_operand" "=r")
317 (float:TQF (match_operand:HI 1 "register_operand" "r")))]
322 ;; Convert floats to ints
324 (define_insn "fix_trunchfqi2"
325 [(set (match_operand:QI 0 "register_operand" "=r")
326 (fix:QI (fix:HF (match_operand:HF 1 "register_operand" "r"))))]
330 (define_insn "fix_trunctqfhi2"
331 [(set (match_operand:HI 0 "register_operand" "=r")
332 (fix:HI (fix:TQF (match_operand:TQF 1 "register_operand" "r"))))]
339 ;; We can't deal with normal byte-size characters, only with WIDE characters!
340 ;; This may appear as a serious restriction, but it also opens the doors
346 [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,r,r,m,m")
347 (match_operand:QI 1 "general_operand" "O,I,J,M,i,r,m,r,K"))]
353 lim r%0,%1 ; 'M' constraint
354 lim r%0,%1 ; 'i' constraint
362 ;; Set HIreg to constant
364 [(set (match_operand:HI 0 "register_operand" "=r")
365 (match_operand 1 "immediate_operand" "i"))]
368 if (GET_CODE(operands[1]) == CONST_INT)
370 int val = INTVAL(operands[1]);
375 output_asm_insn(\"xorr r%0,r%0 ;movhi cst->reg\",operands);
376 operands[0] = gen_rtx(REG,QImode,REGNO(operands[0]) + 1);
378 return \"xorr r%0,r%0\";
380 return \"lisp r%0,%1\";
382 return \"lim r%0,%1\";
386 return \"lisn r%0,%J1\;dsra r%0,16 ;movhi cst\";
387 INTVAL(operands[1]) >>= 16;
388 output_asm_insn(\"lim r%0,%1 ;movhi cst->reg\",operands);
389 REGNO(operands[0]) += 1;
390 INTVAL(operands[1]) = val & 0xFFFF;
391 return \"lim r%0,%1\";
393 return \"lim r%0,%1\;dsra r%0,16 ;movhi cst\";
397 [(set (match_operand:HI 0 "general_operand" "=r,r,m")
398 (match_operand:HI 1 "general_operand" "r,m,r"))]
406 ;; Single-Float moves are *same* as HImode moves:
408 ;(define_insn "movhf"
409 ; [(set (match_operand:HF 0 "general_operand" "=r,r,r,m")
410 ; (match_operand:HF 1 "general_operand" "F,r,m,r"))]
419 [(set (match_operand:HF 0 "general_operand" "=r,r,m")
420 (match_operand:HF 1 "general_operand" "r,m,r"))]
430 ;(define_insn "movtqf"
431 ; [(set (match_operand:TQF 0 "general_operand" "=r,r,r,m")
432 ; (match_operand:TQF 1 "general_operand" "F,r,m,r"))]
440 (define_insn "movtqf"
441 [(set (match_operand:TQF 0 "general_operand" "=r,r,m")
442 (match_operand:TQF 1 "general_operand" "r,m,r"))]
454 ;; Use "LIM Ra,sym,Rb" for adding a symbol value to a register and
455 ;; transferring the result to a different register.
457 ; [(set (match_operand:QI 0 "register_operand" "=r")
458 ; (plus:QI (match_operand:QI 1 "register_operand" "b")
459 ; (match_operand:QI 2 "immediate_operand" "i")))]
460 ; "REGNO(operands[0]) != REGNO(operands[1])"
461 ; "lim r%0,%2,r%1 ;md special addqi")
463 (define_insn "addqi3"
464 [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,m,m")
465 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0,0")
466 (match_operand:QI 2 "general_operand" "I,J,i,r,m,I,J")))]
469 switch (which_alternative)
472 return \"aisp r%0,%2\";
474 return \"sisp r%0,%J2\";
476 if (INTVAL(operands[2]) < 0)
477 return \"sim r%0,%J2\";
479 return \"aim r%0,%2\";
481 return \"ar r%0,r%2\";
485 return \"incm %2,%0\";
487 return \"decm %J2,%0\";
491 (define_insn "addhi3"
492 [(set (match_operand:HI 0 "register_operand" "=r,r")
493 (plus:HI (match_operand:HI 1 "register_operand" "%0,0")
494 (match_operand:HI 2 "general_operand" "r,m")))]
500 (define_insn "addhf3"
501 [(set (match_operand:HF 0 "register_operand" "=r,r")
502 (plus:HF (match_operand:HF 1 "register_operand" "%0,0")
503 (match_operand:HF 2 "general_operand" "m,r")))]
509 (define_insn "addtqf3"
510 [(set (match_operand:TQF 0 "register_operand" "=r,r")
511 (plus:TQF (match_operand:TQF 1 "register_operand" "%0,0")
512 (match_operand:TQF 2 "general_operand" "m,r")))]
519 ;; subtract instructions
522 (define_insn "subqi3"
523 [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,m")
524 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0,0")
525 (match_operand:QI 2 "general_operand" "I,i,r,m,I")))]
535 (define_insn "subhi3"
536 [(set (match_operand:HI 0 "register_operand" "=r,r")
537 (minus:HI (match_operand:HI 1 "register_operand" "0,0")
538 (match_operand:HI 2 "general_operand" "r,m")))]
544 (define_insn "subhf3"
545 [(set (match_operand:HF 0 "register_operand" "=r,r")
546 (minus:HF (match_operand:HF 1 "register_operand" "0,0")
547 (match_operand:HF 2 "general_operand" "r,m")))]
553 (define_insn "subtqf3"
554 [(set (match_operand:TQF 0 "register_operand" "=r,r")
555 (minus:TQF (match_operand:TQF 1 "register_operand" "0,0")
556 (match_operand:TQF 2 "general_operand" "r,m")))]
563 ;; multiply instructions
565 (define_insn "mulqi3"
566 [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
567 (mult:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0")
568 (match_operand:QI 2 "general_operand" "I,J,M,r,m")))]
579 (define_insn "mulqihi3"
580 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
581 (mult:HI (match_operand:QI 1 "register_operand" "%0,0,0")
582 (match_operand:QI 2 "general_operand" "M,r,m")))]
589 (define_insn "mulhi3"
590 [(set (match_operand:HI 0 "register_operand" "=r,r")
591 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
592 (match_operand:HI 2 "general_operand" "r,m")))]
598 ; not available on 1750: "umulhi3","umulhisi3","umulsi3" (unsigned multiply's)
600 (define_insn "mulhf3"
601 [(set (match_operand:HF 0 "register_operand" "=r,r")
602 (mult:HF (match_operand:HF 1 "register_operand" "%0,0")
603 (match_operand:HF 2 "general_operand" "r,m")))]
609 (define_insn "multqf3"
610 [(set (match_operand:TQF 0 "register_operand" "=r,r")
611 (mult:TQF (match_operand:TQF 1 "register_operand" "%0,0")
612 (match_operand:TQF 2 "general_operand" "r,m")))]
619 ;; divide instructions
620 ;; The 1750 16bit integer division instructions deliver a 16-bit
621 ;; quotient and a 16-bit remainder, where the remainder is in the next higher
622 ;; register number above the quotient. For now, we haven't found a way
623 ;; to give the reload pass knowledge of this property. So we make do with
624 ;; whatever registers the allocator wants, and willy-nilly output a pair of
625 ;; register-copy ops when needed. (See mod_regno_adjust() in file aux-output.c)
626 ;; A comment in the description of `divmodM4' suggests that one leave the divM3
627 ;; undefined when there is a divmodM4 available.
629 (define_insn "divmodqi4"
630 [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
631 (div:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0")
632 (match_operand:QI 2 "general_operand" "I,J,M,r,m")))
633 (set (match_operand:QI 3 "register_operand" "=r,r,r,r,r")
634 (mod:QI (match_dup 1) (match_dup 2)))]
639 switch(which_alternative)
645 INTVAL(operands[2]) = - INTVAL(operands[2]); /* to be corrected */
658 return (char *)mod_regno_adjust(istr,operands);
661 ;; Division for other types is straightforward.
663 (define_insn "divhi3"
664 [(set (match_operand:HI 0 "register_operand" "=r,r")
665 (div:HI (match_operand:HI 1 "register_operand" "0,0")
666 (match_operand:HI 2 "general_operand" "r,m")))]
672 (define_insn "divhf3"
673 [(set (match_operand:HF 0 "register_operand" "=r,r")
674 (div:HF (match_operand:HF 1 "register_operand" "0,0")
675 (match_operand:HF 2 "general_operand" "r,m")))]
681 (define_insn "divtqf3"
682 [(set (match_operand:TQF 0 "register_operand" "=r,r")
683 (div:TQF (match_operand:TQF 1 "register_operand" "0,0")
684 (match_operand:TQF 2 "general_operand" "r,m")))]
691 ;; Other arithmetic instructions:
695 (define_insn "absqi2"
696 [(set (match_operand:QI 0 "register_operand" "=r")
697 (abs:QI (match_operand:QI 1 "register_operand" "r")))]
701 (define_insn "abshi2"
702 [(set (match_operand:HI 0 "register_operand" "=r")
703 (abs:HI (match_operand:HI 1 "register_operand" "r")))]
707 (define_insn "abshf2"
708 [(set (match_operand:HF 0 "register_operand" "=r")
709 (abs:HF (match_operand:HF 1 "register_operand" "r")))]
716 (define_insn "negqi2"
717 [(set (match_operand:QI 0 "register_operand" "=r")
718 (neg:QI (match_operand:QI 1 "register_operand" "r")))]
722 (define_insn "neghi2"
723 [(set (match_operand:HI 0 "register_operand" "=r")
724 (neg:HI (match_operand:HI 1 "register_operand" "r")))]
728 (define_insn "neghf2"
729 [(set (match_operand:HF 0 "register_operand" "=r")
730 (neg:HF (match_operand:HF 1 "register_operand" "r")))]
734 ; The 1750A does not have an extended float negate instruction, so simulate.
735 (define_expand "negtqf2"
736 [(set (match_operand:TQF 0 "register_operand" "=&r")
737 (neg:TQF (match_operand:TQF 1 "register_operand" "r")))]
740 emit_insn(gen_rtx(SET,VOIDmode,operands[0],CONST0_RTX(TQFmode)));
741 emit_insn(gen_rtx(SET,VOIDmode,operands[0],
742 gen_rtx(MINUS,TQFmode,operands[0],operands[1])));
747 ;; bit-logical instructions
751 (define_insn "andqi3"
752 [(set (match_operand:QI 0 "general_operand" "=r,r,r")
753 (and:QI (match_operand:QI 1 "general_operand" "%0,0,0")
754 (match_operand:QI 2 "general_operand" "M,r,m")))]
761 ; This sets incorrect condition codes. See notice_update_cc()
762 (define_insn "andhi3"
763 [(set (match_operand:HI 0 "register_operand" "=r")
764 (and:HI (match_operand:HI 1 "register_operand" "%0")
765 (match_operand:HI 2 "register_operand" "r")))]
771 (define_insn "iorqi3"
772 [(set (match_operand:QI 0 "general_operand" "=r,r,r")
773 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0")
774 (match_operand:QI 2 "general_operand" "M,r,m")))]
781 ; This sets incorrect condition codes. See notice_update_cc()
782 (define_insn "iorhi3"
783 [(set (match_operand:HI 0 "register_operand" "=r")
784 (ior:HI (match_operand:HI 1 "register_operand" "%0")
785 (match_operand:HI 2 "register_operand" "r")))]
791 (define_insn "xorqi3"
792 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
793 (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0")
794 (match_operand:QI 2 "general_operand" "M,r,m")))]
801 ; This sets incorrect condition codes. See notice_update_cc()
802 (define_insn "xorhi3"
803 [(set (match_operand:HI 0 "register_operand" "=r")
804 (xor:HI (match_operand:HI 1 "register_operand" "%0")
805 (match_operand:HI 2 "register_operand" "r")))]
812 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
813 (ior:QI (not:QI (match_operand:QI 1 "register_operand" "%0,0,0"))
814 (not:QI (match_operand:QI 2 "general_operand" "M,r,m"))))]
821 ; This sets incorrect condition codes. See notice_update_cc()
823 [(set (match_operand:HI 0 "register_operand" "=r")
824 (ior:HI (not:HI (match_operand:HI 1 "register_operand" "%0"))
825 (not:HI (match_operand:HI 2 "register_operand" "r"))))]
831 (define_insn "one_cmplqi2"
832 [(set (match_operand:QI 0 "register_operand" "=r")
833 (not:QI (match_operand:QI 1 "register_operand" "0")))]
837 ; This sets incorrect condition codes. See notice_update_cc()
838 (define_insn "one_cmplhi2"
839 [(set (match_operand:HI 0 "register_operand" "=r")
840 (not:HI (match_operand:HI 1 "register_operand" "0")))]
845 ;; Shift instructions
847 ; (What to the 1750 is logical-shift-left, GCC likes to call "arithmetic")
848 (define_insn "ashlqi3"
849 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
850 (ashift:QI (match_operand:QI 1 "register_operand" "0,0,0")
851 (match_operand:QI 2 "general_operand" "O,I,r")))]
854 ; optimized away an SLL r%0,0
858 (define_insn "ashlhi3"
859 [(set (match_operand:HI 0 "register_operand" "=r,r")
860 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
861 (match_operand:QI 2 "general_operand" "L,r")))]
862 "" ; the 'L' constraint is a slight imprecise...
867 (define_insn "lshrqi3"
868 [(set (match_operand:QI 0 "register_operand" "=r,r")
869 (lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0")
870 (match_operand:QI 2 "general_operand" "I,r")))]
874 neg r%2,r%2\;slr r%0,r%2 ")
876 (define_insn "lshrhi3"
877 [(set (match_operand:HI 0 "register_operand" "=r,r")
878 (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
879 (match_operand:QI 2 "general_operand" "L,r")))]
880 "" ; the 'L' constraint is a slight imprecise...
883 neg r%2,r%2\;dslr r%0,r%2 ")
885 (define_insn "ashrqi3"
886 [(set (match_operand:QI 0 "register_operand" "=r,r")
887 (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0")
888 (match_operand:QI 2 "general_operand" "I,r")))]
892 neg r%2,r%2\;sar r%0,r%2 ")
894 (define_insn "ashrhi3"
895 [(set (match_operand:HI 0 "register_operand" "=r,r")
896 (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
897 (match_operand:QI 2 "general_operand" "I,r")))]
901 neg r%2,r%2\;dsar r%0,r%2 ")
904 ;; rotate instructions
906 (define_insn "rotlqi3"
907 [(set (match_operand:QI 0 "register_operand" "=r,r")
908 (rotate:QI (match_operand:QI 1 "register_operand" "0,0")
909 (match_operand:QI 2 "general_operand" "I,r")))]
915 (define_insn "rotlhi3"
916 [(set (match_operand:HI 0 "register_operand" "=r,r")
917 (rotate:HI (match_operand:HI 1 "register_operand" "0,0")
918 (match_operand:QI 2 "general_operand" "I,r")))]
924 (define_insn "rotrqi3"
925 [(set (match_operand:QI 0 "register_operand" "=r,r")
926 (rotatert:QI (match_operand:QI 1 "register_operand" "0,0")
927 (match_operand:QI 2 "general_operand" "I,r")))]
931 neg r%2,r%2\;scr r%0,r%2 ")
933 (define_insn "rotrhi3"
934 [(set (match_operand:HI 0 "register_operand" "=r,r")
935 (rotatert:HI (match_operand:HI 1 "register_operand" "0,0")
936 (match_operand:QI 2 "general_operand" "I,r")))]
940 neg r%2,r%2\;dscr r%0,r%2 ")
944 ;; Special cases of bit-field insns which we should
945 ;; recognize in preference to the general case.
946 ;; These handle aligned 8-bit and 16-bit fields,
947 ;; which can usually be done with move instructions.
949 ;********************
951 ;; Bit field instructions, general cases.
952 ;; "o,d" constraint causes a nonoffsetable memref to match the "o"
953 ;; so that its address is reloaded.
955 ;; (define_insn "extv" ...
957 ;; (define_insn "extzv" ...
959 ;; (define_insn "insv" ...
961 ;; Now recognize bit field insns that operate on registers
962 ;; (or at least were intended to do so).
965 ;; Special patterns for optimizing bit-field instructions.
966 ;**************************************
968 ; cc status test ops n.a. on 1750 ......... e.g. "sleu" on 68k:
969 ; [(set (match_operand:QI 0 "general_operand" "=d")
970 ; (leu (cc0) (const_int 0)))]
972 ; "* cc_status = cc_prev_status;
973 ; return \"sls %0\"; ")
976 ;; Basic conditional jump instructions.
980 (if_then_else (eq (cc0)
982 (label_ref (match_operand 0 "" ""))
985 "* return (char *)branch_or_jump(\"ez\",CODE_LABEL_NUMBER(operands[0]));
990 (if_then_else (ne (cc0)
992 (label_ref (match_operand 0 "" ""))
995 "* return (char *)branch_or_jump(\"nz\",CODE_LABEL_NUMBER(operands[0]));
1000 (if_then_else (gt (cc0)
1002 (label_ref (match_operand 0 "" ""))
1005 "* return (char *)branch_or_jump(\"gt\",CODE_LABEL_NUMBER(operands[0]));
1010 (if_then_else (lt (cc0)
1012 (label_ref (match_operand 0 "" ""))
1015 "* return (char *)branch_or_jump(\"lt\",CODE_LABEL_NUMBER(operands[0]));
1020 (if_then_else (ge (cc0)
1022 (label_ref (match_operand 0 "" ""))
1025 "* return (char *)branch_or_jump(\"ge\",CODE_LABEL_NUMBER(operands[0]));
1030 (if_then_else (le (cc0)
1032 (label_ref (match_operand 0 "" ""))
1035 "* return (char *)branch_or_jump(\"le\",CODE_LABEL_NUMBER(operands[0]));
1039 ; no unsigned branches available on 1750. But GCC still needs them, so faking:
1043 (if_then_else (gtu (cc0)
1045 (label_ref (match_operand 0 "" ""))
1048 "jc gt,%l0 ; Warning: this should be an *unsigned* test!")
1052 (if_then_else (ltu (cc0)
1054 (label_ref (match_operand 0 "" ""))
1057 "jc lt,%l0 ; Warning: this should be an *unsigned* test!")
1061 (if_then_else (geu (cc0)
1063 (label_ref (match_operand 0 "" ""))
1066 "jc ge,%l0 ; Warning: this should be an *unsigned* test!")
1070 (if_then_else (leu (cc0)
1072 (label_ref (match_operand 0 "" ""))
1075 "jc le,%l0 ; Warning: this should be an *unsigned* test!")
1078 ;; Negated conditional jump instructions.
1082 (if_then_else (eq (cc0)
1085 (label_ref (match_operand 0 "" ""))))]
1087 "* return (char *)branch_or_jump(\"nz\",CODE_LABEL_NUMBER(operands[0]));
1092 (if_then_else (ne (cc0)
1095 (label_ref (match_operand 0 "" ""))))]
1097 "* return (char *)branch_or_jump(\"ez\",CODE_LABEL_NUMBER(operands[0]));
1102 (if_then_else (gt (cc0)
1105 (label_ref (match_operand 0 "" ""))))]
1107 "* return (char *)branch_or_jump(\"le\",CODE_LABEL_NUMBER(operands[0]));
1112 (if_then_else (lt (cc0)
1115 (label_ref (match_operand 0 "" ""))))]
1117 "* return (char *)branch_or_jump(\"ge\",CODE_LABEL_NUMBER(operands[0]));
1122 (if_then_else (ge (cc0)
1125 (label_ref (match_operand 0 "" ""))))]
1127 "* return (char *)branch_or_jump(\"lt\",CODE_LABEL_NUMBER(operands[0]));
1132 (if_then_else (le (cc0)
1135 (label_ref (match_operand 0 "" ""))))]
1137 "* return (char *)branch_or_jump(\"gt\",CODE_LABEL_NUMBER(operands[0]));
1141 ;; Negated unsigned conditional jump instructions (faked for 1750).
1145 (if_then_else (gtu (cc0)
1148 (label_ref (match_operand 0 "" ""))))]
1150 "jc le,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1154 (if_then_else (ltu (cc0)
1157 (label_ref (match_operand 0 "" ""))))]
1159 "jc ge,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1163 (if_then_else (geu (cc0)
1166 (label_ref (match_operand 0 "" ""))))]
1168 "jc lt,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1172 (if_then_else (leu (cc0)
1175 (label_ref (match_operand 0 "" ""))))]
1177 "jc gt,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1180 ;; 1750 note: CASE_VECTOR_PC_RELATIVE is not defined
1181 (define_insn "tablejump"
1183 (match_operand:QI 0 "register_operand" "b"))
1184 (use (label_ref (match_operand 1 "" "")))]
1186 "jc 15,0,r%0 ; tablejump label_ref=%1")
1189 ;; Unconditional jump
1192 (label_ref (match_operand 0 "" "")))]
1196 ;; Call subroutine, returning value in operand 0
1197 ;; (which must be a hard register).
1198 (define_insn "call_value"
1199 [(set (match_operand 0 "register_operand" "r")
1200 (call (match_operand:QI 1 "memory_operand" "m")
1201 (match_operand:QI 2 "general_operand" "g")))]
1202 ;; Operand 2 not really used for 1750.
1204 "sjs r15,%1 ; return value in R0")
1206 ;; Call subroutine with no return value.
1208 ;; Operand 1 not really used in MIL-STD-1750.
1210 [(call (match_operand:QI 0 "memory_operand" "mp")
1211 (match_operand:QI 1 "general_operand" ""))]
1213 "sjs r15,%0 ; no return value")
1215 ;;;;;;;;;;;; 1750: NOT READY YET.
1217 [(call (match_operand:QI 0 "" "")
1218 (match_operand:QI 1 "" ""))]
1223 ; (define_insn "return"
1228 ; rtx oprnd = gen_rtx(CONST_INT,VOIDmode,get_frame_size());
1229 ; output_asm_insn(\"ret.m %0\",&oprnd);
1233 (define_insn "indirect_jump"
1234 [(set (pc) (match_operand:QI 0 "address_operand" "p"))]
1244 ;; Subtract One and Jump (if non-zero)
1246 [(set (match_operand:QI 0 "register_operand" "=r")
1247 (plus:QI (match_operand:QI 1 "register_operand" "%0")
1248 (match_operand:QI 2 "immediate_operand" "J")))
1249 (set (cc0) (match_dup 0))
1251 (if_then_else (ne (cc0) (const_int 0))
1252 (label_ref (match_operand 3 "" ""))
1255 "INTVAL(operands[2]) == -1"