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, 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
24 ;;- instruction definitions
26 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
28 ;;- When naming insn's (operand 0 of define_insn) be careful about using
29 ;;- names from other targets machine descriptions.
31 ;; MIL-STD-1750 specific remarks:
33 ;; 1) BITS_PER_UNIT = 16
35 ;; 2) GCC to MIL-STD-1750 data type mappings:
36 ;; QImode => single integer (16 bits or 1 reg).
37 ;; HImode => double integer (32 bits or 2 regs).
38 ;; HFmode => single precision float (32 bits or 2 regs).
39 ;; TQFmode => extended precision float (48 bits or 3 regs).
41 ;; 3) Immediate integer operands Constraints:
46 ;; 'M' -32768 .. 32767
47 ;; 'O' => 0 (for optimizations and GCC quirks)
50 ;;- Assembly output ending in ".M" are macros in file M1750.INC
55 [(set (match_operand:QI 0 "push_operand" "=<")
56 (match_operand:QI 1 "general_operand" "r"))]
61 [(set (match_operand:HI 0 "push_operand" "=<")
62 (match_operand:HI 1 "general_operand" "r"))]
67 new_operands[0] = operands[1];
68 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[1])+1);
72 [(set (match_operand:HF 0 "push_operand" "=<")
73 (match_operand:HF 1 "general_operand" "r"))]
78 new_operands[0] = operands[1];
79 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[1])+1);
80 output_asm_insn(\"pshm r%0,r%1\",new_operands);
85 [(set (match_operand:TQF 0 "push_operand" "=<")
86 (match_operand:TQF 1 "general_operand" "r"))]
91 new_operands[0] = operands[1];
92 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[1])+2);
93 output_asm_insn(\"pshm r%0,r%1\",new_operands);
99 [(set (match_operand:QI 0 "general_operand" "=r")
100 (match_operand:QI 1 "push_operand" ">"))]
105 [(set (match_operand:HI 0 "general_operand" "=r")
106 (match_operand:HI 1 "push_operand" ">"))]
111 new_operands[0] = operands[0];
112 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[0])+1);
113 output_asm_insn(\"popm r%0,r%1\",new_operands);
118 [(set (match_operand:HF 0 "general_operand" "=r")
119 (match_operand:HF 1 "push_operand" ">"))]
124 new_operands[0] = operands[0];
125 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[0])+1);
126 output_asm_insn(\"popm r%0,r%1\",new_operands);
131 [(set (match_operand:TQF 0 "general_operand" "=r")
132 (match_operand:TQF 1 "push_operand" ">"))]
137 new_operands[0] = operands[0];
138 new_operands[1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[0])+2);
139 output_asm_insn(\"popm r%0,r%1\",new_operands);
143 ;; Test operations. These shouldn't really occur for 1750:
144 ;; all important instructions set the cc's (see NOTICE_UPDATE_CC)
148 (match_operand:QI 0 "register_operand" "r"))]
150 "lr r%0,r%0 ; from tstqi")
154 (match_operand:HI 0 "register_operand" "r"))]
156 "dlr r%0,r%0 ; from tsthi")
160 (match_operand:HF 0 "register_operand" "r"))]
162 "dlr r%0,r%0 ; from tsthf")
164 ;; This one is happy with "roughly zero" :-) (should be improved)
165 (define_insn "tsttqf"
167 (match_operand:TQF 0 "register_operand" "r"))]
169 "dlr r%0,r%0 ; from tsttqf")
174 ; there is a problem with this insn in gcc-2.2.3
175 ; (clobber (match_dup 2)) does not prevent use of this operand later
177 (define_insn "movstrqi"
178 [(set (mem:BLK (match_operand:QI 0 "register_operand" "r"))
179 (mem:BLK (match_operand:QI 1 "register_operand" "r")))
180 (use (match_operand:QI 2 "register_operand" "r"))
181 (use (match_operand:QI 3 "immediate_operand" ""))
182 (clobber (match_dup 0))
183 (clobber (match_dup 1))
184 (clobber (match_dup 2))]
186 "* return (char *)movcnt_regno_adjust(operands); ")
189 ;; compare instructions.
193 (compare (match_operand:QI 0 "register_operand" "r,r,r,r,r")
194 (match_operand:QI 1 "general_operand" "I,J,i,r,m")))]
205 (compare (match_operand:HI 0 "general_operand" "r,r")
206 (match_operand:HI 1 "general_operand" "r,m")))]
214 (compare (match_operand:HF 0 "general_operand" "r,r")
215 (match_operand:HF 1 "general_operand" "r,m")))]
221 (define_insn "cmptqf"
223 (compare (match_operand:TQF 0 "general_operand" "r,r")
224 (match_operand:TQF 1 "general_operand" "r,m")))]
231 ;; truncation instructions
232 ;;- 1750: any needed?
234 (define_insn "trunchiqi2"
235 [(set (match_operand:QI 0 "register_operand" "=r")
237 (match_operand:HI 1 "register_operand" "r")))]
241 REGNO(operands[1]) += 1;
242 return \"lr r%0,r%1 ;trunchiqi2\";
245 ;; zero extension instructions
247 (define_insn "zero_extendqihi2"
248 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
249 (zero_extend:HI (match_operand:QI 1 "general_operand" "r,m,i")))]
253 output_asm_insn(\"xorr r%0,r%0 ;zero_extendqihi2\",operands);
254 REGNO(operands[0]) += 1;
255 switch (which_alternative)
258 return \"lr r%0,r%1\";
262 return \"lim r%0,%1\";
266 ;; sign extension instructions
268 (define_insn "extendqihi2"
269 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
270 (sign_extend:HI (match_operand:QI 1 "general_operand" "r,m,i")) )]
273 lr r%0,r%1 ;extendqihi2\;dsra r%0,16
274 l r%0,%1 ;extendqihi2\;dsra r%0,16
275 lim r%0,%1 ;extendqihi2\;dsra r%0,16 ")
278 ;; Conversions between float and double.
280 ; 1750 HF-to-TQF extend: just append 16 bits (least signif.) with all bits zero
281 (define_insn "extendhftqf2"
282 [(set (match_operand:TQF 0 "register_operand" "=r,r")
284 (match_operand:HF 1 "general_operand" "r,m")))]
288 REGNO(operands[0]) += 2;
289 output_asm_insn(\"xorr r%0,r%0 ;extendhftqf2\",operands);
290 REGNO(operands[0]) -= 2;
291 if (which_alternative == 0)
292 return \"dlr r%0,r%1\";
294 return \"dl r%0,%1\";
297 ; 1750 TQF-to-HF truncate is a no-op: just leave away the least signif. 16 bits
298 (define_insn "trunctqfhf2"
299 [(set (match_operand:HF 0 "register_operand" "=r,r")
301 (match_operand:TQF 1 "general_operand" "r,m")))]
304 dlr r%0,r%1 ;trunctqfhf2
305 dl r%0,%1 ;trunctqfhf2 ")
308 ;; Conversion between fixed point and floating point.
310 (define_insn "floatqihf2"
311 [(set (match_operand:HF 0 "register_operand" "=r")
312 (float:HF (match_operand:QI 1 "register_operand" "r")))]
316 (define_insn "floathitqf2"
317 [(set (match_operand:TQF 0 "register_operand" "=r")
318 (float:TQF (match_operand:HI 1 "register_operand" "r")))]
323 ;; Convert floats to ints
325 (define_insn "fix_trunchfqi2"
326 [(set (match_operand:QI 0 "register_operand" "=r")
327 (fix:QI (fix:HF (match_operand:HF 1 "register_operand" "r"))))]
331 (define_insn "fix_trunctqfhi2"
332 [(set (match_operand:HI 0 "register_operand" "=r")
333 (fix:HI (fix:TQF (match_operand:TQF 1 "register_operand" "r"))))]
340 ;; We can't deal with normal byte-size characters, only with WIDE characters!
341 ;; This may appear as a serious restriction, but it also opens the doors
347 [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,r,r,m,m")
348 (match_operand:QI 1 "general_operand" "O,I,J,M,i,r,m,r,K"))]
354 lim r%0,%1 ; 'M' constraint
355 lim r%0,%1 ; 'i' constraint
363 ;; Set HIreg to constant
365 [(set (match_operand:HI 0 "register_operand" "=r")
366 (match_operand 1 "immediate_operand" "i"))]
369 if (GET_CODE(operands[1]) == CONST_INT)
371 int val = INTVAL(operands[1]);
376 output_asm_insn(\"xorr r%0,r%0 ;movhi cst->reg\",operands);
377 operands[0] = gen_rtx(REG,QImode,REGNO(operands[0]) + 1);
379 return \"xorr r%0,r%0\";
381 return \"lisp r%0,%1\";
383 return \"lim r%0,%1\";
387 return \"lisn r%0,%J1\;dsra r%0,16 ;movhi cst\";
388 INTVAL(operands[1]) >>= 16;
389 output_asm_insn(\"lim r%0,%1 ;movhi cst->reg\",operands);
390 REGNO(operands[0]) += 1;
391 INTVAL(operands[1]) = val & 0xFFFF;
392 return \"lim r%0,%1\";
394 return \"lim r%0,%1\;dsra r%0,16 ;movhi cst\";
398 [(set (match_operand:HI 0 "general_operand" "=r,r,m")
399 (match_operand:HI 1 "general_operand" "r,m,r"))]
407 ;; Single-Float moves are *same* as HImode moves:
409 ;(define_insn "movhf"
410 ; [(set (match_operand:HF 0 "general_operand" "=r,r,r,m")
411 ; (match_operand:HF 1 "general_operand" "F,r,m,r"))]
420 [(set (match_operand:HF 0 "general_operand" "=r,r,m")
421 (match_operand:HF 1 "general_operand" "r,m,r"))]
431 ;(define_insn "movtqf"
432 ; [(set (match_operand:TQF 0 "general_operand" "=r,r,r,m")
433 ; (match_operand:TQF 1 "general_operand" "F,r,m,r"))]
441 (define_insn "movtqf"
442 [(set (match_operand:TQF 0 "general_operand" "=r,r,m")
443 (match_operand:TQF 1 "general_operand" "r,m,r"))]
455 ;; Use "LIM Ra,sym,Rb" for adding a symbol value to a register and
456 ;; transferring the result to a different register.
458 ; [(set (match_operand:QI 0 "register_operand" "=r")
459 ; (plus:QI (match_operand:QI 1 "register_operand" "b")
460 ; (match_operand:QI 2 "immediate_operand" "i")))]
461 ; "REGNO(operands[0]) != REGNO(operands[1])"
462 ; "lim r%0,%2,r%1 ;md special addqi")
464 (define_insn "addqi3"
465 [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,m,m")
466 (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0,0")
467 (match_operand:QI 2 "general_operand" "I,J,i,r,m,I,J")))]
470 switch (which_alternative)
473 return \"aisp r%0,%2\";
475 return \"sisp r%0,%J2\";
477 if (INTVAL(operands[2]) < 0)
478 return \"sim r%0,%J2\";
480 return \"aim r%0,%2\";
482 return \"ar r%0,r%2\";
486 return \"incm %2,%0\";
488 return \"decm %J2,%0\";
492 (define_insn "addhi3"
493 [(set (match_operand:HI 0 "register_operand" "=r,r")
494 (plus:HI (match_operand:HI 1 "register_operand" "%0,0")
495 (match_operand:HI 2 "general_operand" "r,m")))]
501 (define_insn "addhf3"
502 [(set (match_operand:HF 0 "register_operand" "=r,r")
503 (plus:HF (match_operand:HF 1 "register_operand" "%0,0")
504 (match_operand:HF 2 "general_operand" "m,r")))]
510 (define_insn "addtqf3"
511 [(set (match_operand:TQF 0 "register_operand" "=r,r")
512 (plus:TQF (match_operand:TQF 1 "register_operand" "%0,0")
513 (match_operand:TQF 2 "general_operand" "m,r")))]
520 ;; subtract instructions
523 (define_insn "subqi3"
524 [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,m")
525 (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0,0")
526 (match_operand:QI 2 "general_operand" "I,i,r,m,I")))]
536 (define_insn "subhi3"
537 [(set (match_operand:HI 0 "register_operand" "=r,r")
538 (minus:HI (match_operand:HI 1 "register_operand" "0,0")
539 (match_operand:HI 2 "general_operand" "r,m")))]
545 (define_insn "subhf3"
546 [(set (match_operand:HF 0 "register_operand" "=r,r")
547 (minus:HF (match_operand:HF 1 "register_operand" "0,0")
548 (match_operand:HF 2 "general_operand" "r,m")))]
554 (define_insn "subtqf3"
555 [(set (match_operand:TQF 0 "register_operand" "=r,r")
556 (minus:TQF (match_operand:TQF 1 "register_operand" "0,0")
557 (match_operand:TQF 2 "general_operand" "r,m")))]
564 ;; multiply instructions
566 (define_insn "mulqi3"
567 [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
568 (mult:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0")
569 (match_operand:QI 2 "general_operand" "I,J,M,r,m")))]
580 (define_insn "mulqihi3"
581 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
582 (mult:HI (match_operand:QI 1 "register_operand" "%0,0,0")
583 (match_operand:QI 2 "general_operand" "M,r,m")))]
590 (define_insn "mulhi3"
591 [(set (match_operand:HI 0 "register_operand" "=r,r")
592 (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
593 (match_operand:HI 2 "general_operand" "r,m")))]
599 ; not available on 1750: "umulhi3","umulhisi3","umulsi3" (unsigned multiply's)
601 (define_insn "mulhf3"
602 [(set (match_operand:HF 0 "register_operand" "=r,r")
603 (mult:HF (match_operand:HF 1 "register_operand" "%0,0")
604 (match_operand:HF 2 "general_operand" "r,m")))]
610 (define_insn "multqf3"
611 [(set (match_operand:TQF 0 "register_operand" "=r,r")
612 (mult:TQF (match_operand:TQF 1 "register_operand" "%0,0")
613 (match_operand:TQF 2 "general_operand" "r,m")))]
620 ;; divide instructions
621 ;; The 1750 16bit integer division instructions deliver a 16-bit
622 ;; quotient and a 16-bit remainder, where the remainder is in the next higher
623 ;; register number above the quotient. For now, we haven't found a way
624 ;; to give the reload pass knowledge of this property. So we make do with
625 ;; whatever registers the allocator wants, and willy-nilly output a pair of
626 ;; register-copy ops when needed. (See mod_regno_adjust() in file aux-output.c)
627 ;; A comment in the description of `divmodM4' suggests that one leave the divM3
628 ;; undefined when there is a divmodM4 available.
630 (define_insn "divmodqi4"
631 [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
632 (div:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0")
633 (match_operand:QI 2 "general_operand" "I,J,M,r,m")))
634 (set (match_operand:QI 3 "register_operand" "=r,r,r,r,r")
635 (mod:QI (match_dup 1) (match_dup 2)))]
640 switch(which_alternative)
646 INTVAL(operands[2]) = - INTVAL(operands[2]); /* to be corrected */
659 return (char *)mod_regno_adjust(istr,operands);
662 ;; Division for other types is straightforward.
664 (define_insn "divhi3"
665 [(set (match_operand:HI 0 "register_operand" "=r,r")
666 (div:HI (match_operand:HI 1 "register_operand" "0,0")
667 (match_operand:HI 2 "general_operand" "r,m")))]
673 (define_insn "divhf3"
674 [(set (match_operand:HF 0 "register_operand" "=r,r")
675 (div:HF (match_operand:HF 1 "register_operand" "0,0")
676 (match_operand:HF 2 "general_operand" "r,m")))]
682 (define_insn "divtqf3"
683 [(set (match_operand:TQF 0 "register_operand" "=r,r")
684 (div:TQF (match_operand:TQF 1 "register_operand" "0,0")
685 (match_operand:TQF 2 "general_operand" "r,m")))]
692 ;; Other arithmetic instructions:
696 (define_insn "absqi2"
697 [(set (match_operand:QI 0 "register_operand" "=r")
698 (abs:QI (match_operand:QI 1 "register_operand" "r")))]
702 (define_insn "abshi2"
703 [(set (match_operand:HI 0 "register_operand" "=r")
704 (abs:HI (match_operand:HI 1 "register_operand" "r")))]
708 (define_insn "abshf2"
709 [(set (match_operand:HF 0 "register_operand" "=r")
710 (abs:HF (match_operand:HF 1 "register_operand" "r")))]
717 (define_insn "negqi2"
718 [(set (match_operand:QI 0 "register_operand" "=r")
719 (neg:QI (match_operand:QI 1 "register_operand" "r")))]
723 (define_insn "neghi2"
724 [(set (match_operand:HI 0 "register_operand" "=r")
725 (neg:HI (match_operand:HI 1 "register_operand" "r")))]
729 (define_insn "neghf2"
730 [(set (match_operand:HF 0 "register_operand" "=r")
731 (neg:HF (match_operand:HF 1 "register_operand" "r")))]
735 ; The 1750A does not have an extended float negate instruction, so simulate.
736 (define_expand "negtqf2"
737 [(set (match_operand:TQF 0 "register_operand" "=&r")
738 (neg:TQF (match_operand:TQF 1 "register_operand" "r")))]
741 emit_insn(gen_rtx(SET,VOIDmode,operands[0],CONST0_RTX(TQFmode)));
742 emit_insn(gen_rtx(SET,VOIDmode,operands[0],
743 gen_rtx(MINUS,TQFmode,operands[0],operands[1])));
748 ;; bit-logical instructions
752 (define_insn "andqi3"
753 [(set (match_operand:QI 0 "general_operand" "=r,r,r")
754 (and:QI (match_operand:QI 1 "general_operand" "%0,0,0")
755 (match_operand:QI 2 "general_operand" "M,r,m")))]
762 ; This sets incorrect condition codes. See notice_update_cc()
763 (define_insn "andhi3"
764 [(set (match_operand:HI 0 "register_operand" "=r")
765 (and:HI (match_operand:HI 1 "register_operand" "%0")
766 (match_operand:HI 2 "register_operand" "r")))]
772 (define_insn "iorqi3"
773 [(set (match_operand:QI 0 "general_operand" "=r,r,r")
774 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0")
775 (match_operand:QI 2 "general_operand" "M,r,m")))]
782 ; This sets incorrect condition codes. See notice_update_cc()
783 (define_insn "iorhi3"
784 [(set (match_operand:HI 0 "register_operand" "=r")
785 (ior:HI (match_operand:HI 1 "register_operand" "%0")
786 (match_operand:HI 2 "register_operand" "r")))]
792 (define_insn "xorqi3"
793 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
794 (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0")
795 (match_operand:QI 2 "general_operand" "M,r,m")))]
802 ; This sets incorrect condition codes. See notice_update_cc()
803 (define_insn "xorhi3"
804 [(set (match_operand:HI 0 "register_operand" "=r")
805 (xor:HI (match_operand:HI 1 "register_operand" "%0")
806 (match_operand:HI 2 "register_operand" "r")))]
813 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
814 (ior:QI (not:QI (match_operand:QI 1 "register_operand" "%0,0,0"))
815 (not:QI (match_operand:QI 2 "general_operand" "M,r,m"))))]
822 ; This sets incorrect condition codes. See notice_update_cc()
824 [(set (match_operand:HI 0 "register_operand" "=r")
825 (ior:HI (not:HI (match_operand:HI 1 "register_operand" "%0"))
826 (not:HI (match_operand:HI 2 "register_operand" "r"))))]
832 (define_insn "one_cmplqi2"
833 [(set (match_operand:QI 0 "register_operand" "=r")
834 (not:QI (match_operand:QI 1 "register_operand" "0")))]
838 ; This sets incorrect condition codes. See notice_update_cc()
839 (define_insn "one_cmplhi2"
840 [(set (match_operand:HI 0 "register_operand" "=r")
841 (not:HI (match_operand:HI 1 "register_operand" "0")))]
846 ;; Shift instructions
848 ; (What to the 1750 is logical-shift-left, GCC likes to call "arithmetic")
849 (define_insn "ashlqi3"
850 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
851 (ashift:QI (match_operand:QI 1 "register_operand" "0,0,0")
852 (match_operand:QI 2 "general_operand" "O,I,r")))]
855 ; optimized away an SLL r%0,0
859 (define_insn "ashlhi3"
860 [(set (match_operand:HI 0 "register_operand" "=r,r")
861 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
862 (match_operand:QI 2 "general_operand" "L,r")))]
863 "" ; the 'L' constraint is a slight imprecise...
868 (define_insn "lshrqi3"
869 [(set (match_operand:QI 0 "register_operand" "=r,r")
870 (lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0")
871 (match_operand:QI 2 "general_operand" "I,r")))]
875 neg r%2,r%2\;slr r%0,r%2 ")
877 (define_insn "lshrhi3"
878 [(set (match_operand:HI 0 "register_operand" "=r,r")
879 (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
880 (match_operand:QI 2 "general_operand" "L,r")))]
881 "" ; the 'L' constraint is a slight imprecise...
884 neg r%2,r%2\;dslr r%0,r%2 ")
886 (define_insn "ashrqi3"
887 [(set (match_operand:QI 0 "register_operand" "=r,r")
888 (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0")
889 (match_operand:QI 2 "general_operand" "I,r")))]
893 neg r%2,r%2\;sar r%0,r%2 ")
895 (define_insn "ashrhi3"
896 [(set (match_operand:HI 0 "register_operand" "=r,r")
897 (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
898 (match_operand:QI 2 "general_operand" "I,r")))]
902 neg r%2,r%2\;dsar r%0,r%2 ")
905 ;; rotate instructions
907 (define_insn "rotlqi3"
908 [(set (match_operand:QI 0 "register_operand" "=r,r")
909 (rotate:QI (match_operand:QI 1 "register_operand" "0,0")
910 (match_operand:QI 2 "general_operand" "I,r")))]
916 (define_insn "rotlhi3"
917 [(set (match_operand:HI 0 "register_operand" "=r,r")
918 (rotate:HI (match_operand:HI 1 "register_operand" "0,0")
919 (match_operand:QI 2 "general_operand" "I,r")))]
925 (define_insn "rotrqi3"
926 [(set (match_operand:QI 0 "register_operand" "=r,r")
927 (rotatert:QI (match_operand:QI 1 "register_operand" "0,0")
928 (match_operand:QI 2 "general_operand" "I,r")))]
932 neg r%2,r%2\;scr r%0,r%2 ")
934 (define_insn "rotrhi3"
935 [(set (match_operand:HI 0 "register_operand" "=r,r")
936 (rotatert:HI (match_operand:HI 1 "register_operand" "0,0")
937 (match_operand:QI 2 "general_operand" "I,r")))]
941 neg r%2,r%2\;dscr r%0,r%2 ")
945 ;; Special cases of bit-field insns which we should
946 ;; recognize in preference to the general case.
947 ;; These handle aligned 8-bit and 16-bit fields,
948 ;; which can usually be done with move instructions.
950 ;********************
952 ;; Bit field instructions, general cases.
953 ;; "o,d" constraint causes a nonoffsettable memref to match the "o"
954 ;; so that its address is reloaded.
956 ;; (define_insn "extv" ...
958 ;; (define_insn "extzv" ...
960 ;; (define_insn "insv" ...
962 ;; Now recognize bit field insns that operate on registers
963 ;; (or at least were intended to do so).
966 ;; Special patterns for optimizing bit-field instructions.
967 ;**************************************
969 ; cc status test ops n.a. on 1750 ......... e.g. "sleu" on 68k:
970 ; [(set (match_operand:QI 0 "general_operand" "=d")
971 ; (leu (cc0) (const_int 0)))]
973 ; "* cc_status = cc_prev_status;
974 ; return \"sls %0\"; ")
977 ;; Basic conditional jump instructions.
981 (if_then_else (eq (cc0)
983 (label_ref (match_operand 0 "" ""))
986 "* return (char *)branch_or_jump(\"ez\",CODE_LABEL_NUMBER(operands[0]));
991 (if_then_else (ne (cc0)
993 (label_ref (match_operand 0 "" ""))
996 "* return (char *)branch_or_jump(\"nz\",CODE_LABEL_NUMBER(operands[0]));
1001 (if_then_else (gt (cc0)
1003 (label_ref (match_operand 0 "" ""))
1006 "* return (char *)branch_or_jump(\"gt\",CODE_LABEL_NUMBER(operands[0]));
1011 (if_then_else (lt (cc0)
1013 (label_ref (match_operand 0 "" ""))
1016 "* return (char *)branch_or_jump(\"lt\",CODE_LABEL_NUMBER(operands[0]));
1021 (if_then_else (ge (cc0)
1023 (label_ref (match_operand 0 "" ""))
1026 "* return (char *)branch_or_jump(\"ge\",CODE_LABEL_NUMBER(operands[0]));
1031 (if_then_else (le (cc0)
1033 (label_ref (match_operand 0 "" ""))
1036 "* return (char *)branch_or_jump(\"le\",CODE_LABEL_NUMBER(operands[0]));
1040 ; no unsigned branches available on 1750. But GCC still needs them, so faking:
1044 (if_then_else (gtu (cc0)
1046 (label_ref (match_operand 0 "" ""))
1049 "jc gt,%l0 ; Warning: this should be an *unsigned* test!")
1053 (if_then_else (ltu (cc0)
1055 (label_ref (match_operand 0 "" ""))
1058 "jc lt,%l0 ; Warning: this should be an *unsigned* test!")
1062 (if_then_else (geu (cc0)
1064 (label_ref (match_operand 0 "" ""))
1067 "jc ge,%l0 ; Warning: this should be an *unsigned* test!")
1071 (if_then_else (leu (cc0)
1073 (label_ref (match_operand 0 "" ""))
1076 "jc le,%l0 ; Warning: this should be an *unsigned* test!")
1079 ;; Negated conditional jump instructions.
1083 (if_then_else (eq (cc0)
1086 (label_ref (match_operand 0 "" ""))))]
1088 "* return (char *)branch_or_jump(\"nz\",CODE_LABEL_NUMBER(operands[0]));
1093 (if_then_else (ne (cc0)
1096 (label_ref (match_operand 0 "" ""))))]
1098 "* return (char *)branch_or_jump(\"ez\",CODE_LABEL_NUMBER(operands[0]));
1103 (if_then_else (gt (cc0)
1106 (label_ref (match_operand 0 "" ""))))]
1108 "* return (char *)branch_or_jump(\"le\",CODE_LABEL_NUMBER(operands[0]));
1113 (if_then_else (lt (cc0)
1116 (label_ref (match_operand 0 "" ""))))]
1118 "* return (char *)branch_or_jump(\"ge\",CODE_LABEL_NUMBER(operands[0]));
1123 (if_then_else (ge (cc0)
1126 (label_ref (match_operand 0 "" ""))))]
1128 "* return (char *)branch_or_jump(\"lt\",CODE_LABEL_NUMBER(operands[0]));
1133 (if_then_else (le (cc0)
1136 (label_ref (match_operand 0 "" ""))))]
1138 "* return (char *)branch_or_jump(\"gt\",CODE_LABEL_NUMBER(operands[0]));
1142 ;; Negated unsigned conditional jump instructions (faked for 1750).
1146 (if_then_else (gtu (cc0)
1149 (label_ref (match_operand 0 "" ""))))]
1151 "jc le,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1155 (if_then_else (ltu (cc0)
1158 (label_ref (match_operand 0 "" ""))))]
1160 "jc ge,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1164 (if_then_else (geu (cc0)
1167 (label_ref (match_operand 0 "" ""))))]
1169 "jc lt,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1173 (if_then_else (leu (cc0)
1176 (label_ref (match_operand 0 "" ""))))]
1178 "jc gt,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1181 ;; 1750 note: CASE_VECTOR_PC_RELATIVE is not defined
1182 (define_insn "tablejump"
1184 (match_operand:QI 0 "register_operand" "b"))
1185 (use (label_ref (match_operand 1 "" "")))]
1187 "jc 15,0,r%0 ; tablejump label_ref=%1")
1190 ;; Unconditional jump
1193 (label_ref (match_operand 0 "" "")))]
1197 ;; Call subroutine, returning value in operand 0
1198 ;; (which must be a hard register).
1199 (define_insn "call_value"
1200 [(set (match_operand 0 "register_operand" "r")
1201 (call (match_operand:QI 1 "memory_operand" "m")
1202 (match_operand:QI 2 "general_operand" "g")))]
1203 ;; Operand 2 not really used for 1750.
1205 "sjs r15,%1 ; return value in R0")
1207 ;; Call subroutine with no return value.
1209 ;; Operand 1 not really used in MIL-STD-1750.
1211 [(call (match_operand:QI 0 "memory_operand" "mp")
1212 (match_operand:QI 1 "general_operand" ""))]
1214 "sjs r15,%0 ; no return value")
1216 ;;;;;;;;;;;; 1750: NOT READY YET.
1218 [(call (match_operand:QI 0 "" "")
1219 (match_operand:QI 1 "" ""))]
1224 ; (define_insn "return"
1229 ; rtx oprnd = gen_rtx(CONST_INT,VOIDmode,get_frame_size());
1230 ; output_asm_insn(\"ret.m %0\",&oprnd);
1234 (define_insn "indirect_jump"
1235 [(set (pc) (match_operand:QI 0 "address_operand" "p"))]
1245 ;; Subtract One and Jump (if non-zero)
1247 [(set (match_operand:QI 0 "register_operand" "=r")
1248 (plus:QI (match_operand:QI 1 "register_operand" "%0")
1249 (match_operand:QI 2 "immediate_operand" "J")))
1250 (set (cc0) (match_dup 0))
1252 (if_then_else (ne (cc0) (const_int 0))
1253 (label_ref (match_operand 3 "" ""))
1256 "INTVAL(operands[2]) == -1"