1 ;;- Machine description for GNU compiler, MIL-STD-
1750A version.
2 ;; Copyright (C)
1994 Free Software Foundation, Inc.
3 ;; Contributed by O.M.Kellogg, Deutsche Aerospace (okellogg@salyko.cube.net).
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.
22 ;;- instruction definitions
24 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
26 ;;- When naming insn's (operand
0 of define_insn) be careful about using
27 ;;- names from other targets machine descriptions.
29 ;; MIL-STD-
1750 specific remarks:
31 ;;
1) BITS_PER_UNIT =
16
33 ;;
2) GCC to MIL-STD-
1750 data type mappings:
34 ;; QImode => single integer (
16 bits or
1 reg).
35 ;; HImode => double integer (
32 bits or
2 regs).
36 ;; HFmode => single precision float (
32 bits or
2 regs).
37 ;; TQFmode => extended precision float (
48 bits or
3 regs).
39 ;;
3) Immediate integer operands Constraints:
44 ;; 'M' -
32768 ..
32767
45 ;; 'O' =>
0 (for optimizations and GCC quirks)
48 ;;- Assembly output ending in ".M" are macros in file M1750.INC
53 [(set (match_operand:QI
0 "push_operand" "=<")
54 (match_operand:QI
1 "general_operand" "r"))]
59 [(set (match_operand:HI
0 "push_operand" "=<")
60 (match_operand:HI
1 "general_operand" "r"))]
65 new_operands[
0] = operands[
1];
66 new_operands[
1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[
1])+
1);
70 [(set (match_operand:HF
0 "push_operand" "=<")
71 (match_operand:HF
1 "general_operand" "r"))]
76 new_operands[
0] = operands[
1];
77 new_operands[
1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[
1])+
1);
78 output_asm_insn(
\"PSHM R%
0,R%
1\",new_operands);
83 [(set (match_operand:TQF
0 "push_operand" "=<")
84 (match_operand:TQF
1 "general_operand" "r"))]
89 new_operands[
0] = operands[
1];
90 new_operands[
1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[
1])+
2);
91 output_asm_insn(
\"PSHM R%
0,R%
1\",new_operands);
97 [(set (match_operand:QI
0 "general_operand" "=r")
98 (match_operand:QI
1 "push_operand" ">"))]
103 [(set (match_operand:HI
0 "general_operand" "=r")
104 (match_operand:HI
1 "push_operand" ">"))]
109 new_operands[
0] = operands[
0];
110 new_operands[
1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[
0])+
1);
111 output_asm_insn(
\"POPM R%
0,R%
1\",new_operands);
116 [(set (match_operand:HF
0 "general_operand" "=r")
117 (match_operand:HF
1 "push_operand" ">"))]
122 new_operands[
0] = operands[
0];
123 new_operands[
1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[
0])+
1);
124 output_asm_insn(
\"POPM R%
0,R%
1\",new_operands);
129 [(set (match_operand:TQF
0 "general_operand" "=r")
130 (match_operand:TQF
1 "push_operand" ">"))]
135 new_operands[
0] = operands[
0];
136 new_operands[
1] = gen_rtx(CONST_INT,VOIDmode,REGNO(operands[
0])+
2);
137 output_asm_insn(
\"POPM R%
0,R%
1\",new_operands);
141 ;; Test operations. These shouldn't really occur for
1750:
142 ;; all important instructions set the cc's (see NOTICE_UPDATE_CC)
146 (match_operand:QI
0 "register_operand" "r"))]
148 "LR R%
0,R%
0 ; from tstqi")
152 (match_operand:HI
0 "register_operand" "r"))]
154 "DLR R%
0,R%
0 ; from tsthi")
158 (match_operand:HF
0 "register_operand" "r"))]
160 "DLR R%
0,R%
0 ; from tsthf")
162 ;; This one is happy with "roughly zero" :-) (should be improved)
163 (define_insn "tsttqf"
165 (match_operand:TQF
0 "register_operand" "r"))]
167 "DLR R%
0,R%
0 ; from tsttqf")
172 ; there is a problem with this insn in gcc-
2.2.3
173 ; (clobber (match_dup
2)) does not prevent use of this operand later
175 (define_insn "movstrqi"
176 [(set (mem:BLK (match_operand:QI
0 "register_operand" "r"))
177 (mem:BLK (match_operand:QI
1 "register_operand" "r")))
178 (use (match_operand:QI
2 "register_operand" "r"))
179 (use (match_operand:QI
3 "immediate_operand" ""))
180 (clobber (match_dup
0))
181 (clobber (match_dup
1))
182 (clobber (match_dup
2))]
184 "* return (char *)movcnt_regno_adjust(operands); ")
187 ;; compare instructions.
191 (compare (match_operand:QI
0 "register_operand" "r,r,r,r,r")
192 (match_operand:QI
1 "general_operand" "I,J,i,r,m")))]
203 (compare (match_operand:HI
0 "general_operand" "r,r")
204 (match_operand:HI
1 "general_operand" "r,m")))]
212 (compare (match_operand:HF
0 "general_operand" "r,r")
213 (match_operand:HF
1 "general_operand" "r,m")))]
219 (define_insn "cmptqf"
221 (compare (match_operand:TQF
0 "general_operand" "r,r")
222 (match_operand:TQF
1 "general_operand" "r,m")))]
229 ;; truncation instructions
230 ;;-
1750: any needed?
232 (define_insn "trunchiqi2"
233 [(set (match_operand:QI
0 "register_operand" "=r")
235 (match_operand:HI
1 "register_operand" "r")))]
239 REGNO(operands[
1]) +=
1;
240 return
\"LR R%
0,R%
1 ;trunchiqi2
\";
243 ;; zero extension instructions
245 (define_insn "zero_extendqihi2"
246 [(set (match_operand:HI
0 "register_operand" "=r,r,r")
247 (zero_extend:HI (match_operand:QI
1 "general_operand" "r,m,i")))]
251 output_asm_insn(
\"XORR R%
0,R%
0 ;zero_extendqihi2
\",operands);
252 REGNO(operands[
0]) +=
1;
253 switch (which_alternative)
256 return
\"LR R%
0,R%
1\";
260 return
\"LIM R%
0,%
1\";
264 ;; sign extension instructions
266 (define_insn "extendqihi2"
267 [(set (match_operand:HI
0 "register_operand" "=r,r,r")
268 (sign_extend:HI (match_operand:QI
1 "general_operand" "r,m,i")) )]
271 LR R%
0,R%
1 ;extendqihi2\;DSRA R%
0,
16
272 L R%
0,%
1 ;extendqihi2\;DSRA R%
0,
16
273 LIM R%
0,%
1 ;extendqihi2\;DSRA R%
0,
16 ")
276 ;; Conversions between float and double.
278 ;
1750 HF-to-TQF extend: just append
16 bits (least signif.) with all bits zero
279 (define_insn "extendhftqf2"
280 [(set (match_operand:TQF
0 "register_operand" "=r,r")
282 (match_operand:HF
1 "general_operand" "r,m")))]
286 REGNO(operands[
0]) +=
2;
287 output_asm_insn(
\"XORR R%
0,R%
0 ;extendhftqf2
\",operands);
288 REGNO(operands[
0]) -=
2;
289 if (which_alternative ==
0)
290 return
\"DLR R%
0,R%
1\";
292 return
\"DL R%
0,%
1\";
295 ;
1750 TQF-to-HF truncate is a no-op: just leave away the least signif.
16 bits
296 (define_insn "trunctqfhf2"
297 [(set (match_operand:HF
0 "register_operand" "=r,r")
299 (match_operand:TQF
1 "general_operand" "r,m")))]
302 DLR R%
0,R%
1 ;trunctqfhf2
303 DL R%
0,%
1 ;trunctqfhf2 ")
306 ;; Conversion between fixed point and floating point.
308 (define_insn "floatqihf2"
309 [(set (match_operand:HF
0 "register_operand" "=r")
310 (float:HF (match_operand:QI
1 "register_operand" "r")))]
314 (define_insn "floathitqf2"
315 [(set (match_operand:TQF
0 "register_operand" "=r")
316 (float:TQF (match_operand:HI
1 "register_operand" "r")))]
321 ;; Convert floats to ints
323 (define_insn "fix_trunchfqi2"
324 [(set (match_operand:QI
0 "register_operand" "=r")
325 (fix:QI (fix:HF (match_operand:HF
1 "register_operand" "r"))))]
329 (define_insn "fix_trunctqfhi2"
330 [(set (match_operand:HI
0 "register_operand" "=r")
331 (fix:HI (fix:TQF (match_operand:TQF
1 "register_operand" "r"))))]
338 ;; We can't deal with normal byte-size characters, only with WIDE characters!
339 ;; This may appear as a serious restriction, but it also opens the doors
345 [(set (match_operand:QI
0 "general_operand" "=r,r,r,r,r,r,r,m,m")
346 (match_operand:QI
1 "general_operand" "O,I,J,M,i,r,m,r,K"))]
352 LIM R%
0,%
1 ; 'M' constraint
353 LIM R%
0,%
1 ; 'i' constraint
361 ;; Set HIreg to constant
363 [(set (match_operand:HI
0 "register_operand" "=r")
364 (match_operand
1 "immediate_operand" "i"))]
367 if (GET_CODE(operands[
1]) == CONST_INT)
369 int val = INTVAL(operands[
1]);
374 output_asm_insn(
\"XORR R%
0,R%
0 ;movhi cst->reg
\",operands);
375 operands[
0] = gen_rtx(REG,QImode,REGNO(operands[
0]) +
1);
377 return
\"XORR R%
0,R%
0\";
379 return
\"LISP R%
0,%
1\";
381 return
\"LIM R%
0,%
1\";
385 return
\"LISN R%
0,%J1\;DSRA R%
0,
16 ;movhi cst
\";
386 INTVAL(operands[
1]) >>=
16;
387 output_asm_insn(
\"LIM R%
0,%
1 ;movhi cst->reg
\",operands);
388 REGNO(operands[
0]) +=
1;
389 INTVAL(operands[
1]) = val &
0xFFFF;
390 return
\"LIM R%
0,%
1\";
392 return
\"LIM R%
0,%
1\;DSRA R%
0,
16 ;movhi cst
\";
396 [(set (match_operand:HI
0 "general_operand" "=r,r,m")
397 (match_operand:HI
1 "general_operand" "r,m,r"))]
405 ;; Single-Float moves are *same* as HImode moves:
408 [(set (match_operand:HF
0 "general_operand" "=r,r,r,r,m")
409 (match_operand:HF
1 "general_operand" "G,F,r,m,r"))]
412 DXRR.M %
0,%
0 ; movhf const(
0.0)
421 (define_insn "movtqf"
422 [(set (match_operand:TQF
0 "general_operand" "=r,r,r,m")
423 (match_operand:TQF
1 "general_operand" "F,r,m,r"))]
436 ;; Use "LIM Ra,sym,Rb" for adding a symbol value to a register and
437 ;; transferring the result to a different register.
439 ; [(set (match_operand:QI
0 "register_operand" "=r")
440 ; (plus:QI (match_operand:QI
1 "register_operand" "b")
441 ; (match_operand:QI
2 "immediate_operand" "i")))]
442 ; "REGNO(operands[
0]) != REGNO(operands[
1])"
443 ; "LIM R%
0,%
2,R%
1 ;md special addqi")
445 (define_insn "addqi3"
446 [(set (match_operand:QI
0 "general_operand" "=r,r,r,r,r,m,m")
447 (plus:QI (match_operand:QI
1 "general_operand" "%
0,
0,
0,
0,
0,
0,
0")
448 (match_operand:QI
2 "general_operand" "I,J,i,r,m,I,J")))]
451 switch (which_alternative)
454 return
\"AISP R%
0,%
2\";
456 return
\"SISP R%
0,%J2
\";
458 if (INTVAL(operands[
2]) <
0)
459 return
\"SIM R%
0,%J2
\";
461 return
\"AIM R%
0,%
2\";
463 return
\"AR R%
0,R%
2\";
467 return
\"INCM %
2,%
0\";
469 return
\"DECM %J2,%
0\";
473 (define_insn "addhi3"
474 [(set (match_operand:HI
0 "register_operand" "=r,r")
475 (plus:HI (match_operand:HI
1 "register_operand" "%
0,
0")
476 (match_operand:HI
2 "general_operand" "r,m")))]
482 (define_insn "addhf3"
483 [(set (match_operand:HF
0 "register_operand" "=r,r")
484 (plus:HF (match_operand:HF
1 "register_operand" "%
0,
0")
485 (match_operand:HF
2 "general_operand" "m,r")))]
491 (define_insn "addtqf3"
492 [(set (match_operand:TQF
0 "register_operand" "=r,r")
493 (plus:TQF (match_operand:TQF
1 "register_operand" "%
0,
0")
494 (match_operand:TQF
2 "general_operand" "m,r")))]
501 ;; subtract instructions
504 (define_insn "subqi3"
505 [(set (match_operand:QI
0 "general_operand" "=r,r,r,r,m")
506 (minus:QI (match_operand:QI
1 "general_operand" "%
0,
0,
0,
0,
0")
507 (match_operand:QI
2 "general_operand" "I,i,r,m,I")))]
517 (define_insn "subhi3"
518 [(set (match_operand:HI
0 "register_operand" "=r,r")
519 (minus:HI (match_operand:HI
1 "register_operand" "
0,
0")
520 (match_operand:HI
2 "general_operand" "r,m")))]
526 (define_insn "subhf3"
527 [(set (match_operand:HF
0 "register_operand" "=r,r")
528 (minus:HF (match_operand:HF
1 "register_operand" "
0,
0")
529 (match_operand:HF
2 "general_operand" "r,m")))]
535 (define_insn "subtqf3"
536 [(set (match_operand:TQF
0 "register_operand" "=r,r")
537 (minus:TQF (match_operand:TQF
1 "register_operand" "
0,
0")
538 (match_operand:TQF
2 "general_operand" "r,m")))]
545 ;; multiply instructions
547 (define_insn "mulqi3"
548 [(set (match_operand:QI
0 "register_operand" "=r,r,r,r,r")
549 (mult:QI (match_operand:QI
1 "register_operand" "%
0,
0,
0,
0,
0")
550 (match_operand:QI
2 "general_operand" "I,J,M,r,m")))]
561 (define_insn "mulqihi3"
562 [(set (match_operand:HI
0 "register_operand" "=r,r,r")
563 (mult:HI (match_operand:QI
1 "register_operand" "%
0,
0,
0")
564 (match_operand:QI
2 "general_operand" "M,r,m")))]
571 (define_insn "mulhi3"
572 [(set (match_operand:HI
0 "register_operand" "=r,r")
573 (mult:HI (match_operand:HI
1 "register_operand" "%
0,
0")
574 (match_operand:HI
2 "general_operand" "r,m")))]
580 ; not available on
1750: "umulhi3","umulhisi3","umulsi3" (unsigned multiply's)
582 (define_insn "mulhf3"
583 [(set (match_operand:HF
0 "register_operand" "=r,r")
584 (mult:HF (match_operand:HF
1 "register_operand" "%
0,
0")
585 (match_operand:HF
2 "general_operand" "r,m")))]
591 (define_insn "multqf3"
592 [(set (match_operand:TQF
0 "register_operand" "=r,r")
593 (mult:TQF (match_operand:TQF
1 "register_operand" "%
0,
0")
594 (match_operand:TQF
2 "general_operand" "r,m")))]
601 ;; divide instructions
602 ;; The
1750 16bit integer division instructions deliver a
16-bit
603 ;; quotient and a
16-bit remainder, where the remainder is in the next higher
604 ;; register number above the quotient. For now, we haven't found a way
605 ;; to give the reload pass knowledge of this property. So we make do with
606 ;; whatever registers the allocator wants, and willy-nilly output a pair of
607 ;; register-copy ops when needed. (See mod_regno_adjust() in file aux-output.c)
608 ;; A comment in the description of
`divmodM4' suggests that one leave the divM3
609 ;; undefined when there is a divmodM4 available.
611 (define_insn "divmodqi4"
612 [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
613 (div:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0")
614 (match_operand:QI 2 "general_operand" "I,J,M,r,m")))
615 (set (match_operand:QI 3 "register_operand" "=r,r,r,r,r")
616 (mod:QI (match_dup 1) (match_dup 2)))]
621 switch(which_alternative)
627 INTVAL(operands[2]) = - INTVAL(operands[2]); /* to be corrected */
640 return (char *)mod_regno_adjust(istr,operands);
643 ;; Division for other types is straightforward.
645 (define_insn "divhi3"
646 [(set (match_operand:HI 0 "register_operand" "=r,r")
647 (div:HI (match_operand:HI 1 "register_operand" "0,0")
648 (match_operand:HI 2 "general_operand" "r,m")))]
654 (define_insn "divhf3"
655 [(set (match_operand:HF 0 "register_operand" "=r,r")
656 (div:HF (match_operand:HF 1 "register_operand" "0,0")
657 (match_operand:HF 2 "general_operand" "r,m")))]
663 (define_insn "divtqf3"
664 [(set (match_operand:TQF 0 "register_operand" "=r,r")
665 (div:TQF (match_operand:TQF 1 "register_operand" "0,0")
666 (match_operand:TQF 2 "general_operand" "r,m")))]
673 ;; Other arithmetic instructions:
677 (define_insn "absqi2"
678 [(set (match_operand:QI 0 "register_operand" "=r")
679 (abs:QI (match_operand:QI 1 "register_operand" "r")))]
683 (define_insn "abshi2"
684 [(set (match_operand:HI 0 "register_operand" "=r")
685 (abs:HI (match_operand:HI 1 "register_operand" "r")))]
689 (define_insn "abshf2"
690 [(set (match_operand:HF 0 "register_operand" "=r")
691 (abs:HF (match_operand:HF 1 "register_operand" "r")))]
698 (define_insn "negqi2"
699 [(set (match_operand:QI 0 "register_operand" "=r")
700 (neg:QI (match_operand:QI 1 "register_operand" "r")))]
704 (define_insn "neghi2"
705 [(set (match_operand:HI 0 "register_operand" "=r")
706 (neg:HI (match_operand:HI 1 "register_operand" "r")))]
710 (define_insn "neghf2"
711 [(set (match_operand:HF 0 "register_operand" "=r")
712 (neg:HF (match_operand:HF 1 "register_operand" "r")))]
716 ; The 1750A does not have an extended float negate instruction, so simulate.
717 ;(define_expand "negtqf2"
718 ; [(set (match_operand:TQF 0 "register_operand" "=&r")
719 ; (neg:TQF (match_operand:TQF 1 "register_operand" "r")))]
722 ; emit_insn(gen_rtx(SET,VOIDmode,operands[0],CONST0_RTX(TQFmode)));
723 ; emit_insn(gen_rtx(SET,VOIDmode,operands[0],
724 ; gen_rtx(MINUS,TQFmode,operands[0],operands[1])));
729 ;; bit-logical instructions
733 (define_insn "andqi3"
734 [(set (match_operand:QI 0 "general_operand" "=r,r,r")
735 (and:QI (match_operand:QI 1 "general_operand" "%0,0,0")
736 (match_operand:QI 2 "general_operand" "M,r,m")))]
743 ; This sets incorrect condition codes. See notice_update_cc()
744 (define_insn "andhi3"
745 [(set (match_operand:HI 0 "register_operand" "=r")
746 (and:HI (match_operand:HI 1 "register_operand" "%0")
747 (match_operand:HI 2 "register_operand" "r")))]
753 (define_insn "iorqi3"
754 [(set (match_operand:QI 0 "general_operand" "=r,r,r")
755 (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0")
756 (match_operand:QI 2 "general_operand" "M,r,m")))]
763 ; This sets incorrect condition codes. See notice_update_cc()
764 (define_insn "iorhi3"
765 [(set (match_operand:HI 0 "register_operand" "=r")
766 (ior:HI (match_operand:HI 1 "register_operand" "%0")
767 (match_operand:HI 2 "register_operand" "r")))]
773 (define_insn "xorqi3"
774 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
775 (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0")
776 (match_operand:QI 2 "general_operand" "M,r,m")))]
783 ; This sets incorrect condition codes. See notice_update_cc()
784 (define_insn "xorhi3"
785 [(set (match_operand:HI 0 "register_operand" "=r")
786 (xor:HI (match_operand:HI 1 "register_operand" "%0")
787 (match_operand:HI 2 "register_operand" "r")))]
794 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
795 (ior:QI (not:QI (match_operand:QI 1 "register_operand" "%0,0,0"))
796 (not:QI (match_operand:QI 2 "general_operand" "M,r,m"))))]
803 ; This sets incorrect condition codes. See notice_update_cc()
805 [(set (match_operand:HI 0 "register_operand" "=r")
806 (ior:HI (not:HI (match_operand:HI 1 "register_operand" "%0"))
807 (not:HI (match_operand:HI 2 "register_operand" "r"))))]
813 (define_insn "one_cmplqi2"
814 [(set (match_operand:QI 0 "register_operand" "=r")
815 (not:QI (match_operand:QI 1 "register_operand" "0")))]
819 ; This sets incorrect condition codes. See notice_update_cc()
820 (define_insn "one_cmplhi2"
821 [(set (match_operand:HI 0 "register_operand" "=r")
822 (not:HI (match_operand:HI 1 "register_operand" "0")))]
827 ;; Shift instructions
829 ; (What to the 1750 is logical-shift-left, GCC likes to call "arithmetic")
830 (define_insn "ashlqi3"
831 [(set (match_operand:QI 0 "register_operand" "=r,r,r")
832 (ashift:QI (match_operand:QI 1 "register_operand" "0,0,0")
833 (match_operand:QI 2 "general_operand" "O,I,r")))]
836 ; optimized away an SLL R%0,0
840 (define_insn "ashlhi3"
841 [(set (match_operand:HI 0 "register_operand" "=r,r")
842 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
843 (match_operand:QI 2 "general_operand" "L,r")))]
844 "" ; the 'L' constraint is a slight imprecise...
849 (define_insn "lshrqi3"
850 [(set (match_operand:QI 0 "register_operand" "=r,r")
851 (lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0")
852 (match_operand:QI 2 "general_operand" "I,r")))]
856 NEG R%2,R%2\;SLR R%0,R%2 ")
858 (define_insn "lshrhi3"
859 [(set (match_operand:HI 0 "register_operand" "=r,r")
860 (lshiftrt: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...
865 NEG R%2,R%2\;DSLR R%0,R%2 ")
867 (define_insn "ashrqi3"
868 [(set (match_operand:QI 0 "register_operand" "=r,r")
869 (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0")
870 (match_operand:QI 2 "general_operand" "I,r")))]
874 NEG R%2,R%2\;SAR R%0,R%2 ")
876 (define_insn "ashrhi3"
877 [(set (match_operand:HI 0 "register_operand" "=r,r")
878 (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
879 (match_operand:QI 2 "general_operand" "I,r")))]
883 NEG R%2,R%2\;DSAR R%0,R%2 ")
886 ;; rotate instructions
888 (define_insn "rotlqi3"
889 [(set (match_operand:QI 0 "register_operand" "=r,r")
890 (rotate:QI (match_operand:QI 1 "register_operand" "0,0")
891 (match_operand:QI 2 "general_operand" "I,r")))]
897 (define_insn "rotlhi3"
898 [(set (match_operand:HI 0 "register_operand" "=r,r")
899 (rotate:HI (match_operand:HI 1 "register_operand" "0,0")
900 (match_operand:QI 2 "general_operand" "I,r")))]
906 (define_insn "rotrqi3"
907 [(set (match_operand:QI 0 "register_operand" "=r,r")
908 (rotatert:QI (match_operand:QI 1 "register_operand" "0,0")
909 (match_operand:QI 2 "general_operand" "I,r")))]
913 NEG R%2,R%2\;SCR R%0,R%2 ")
915 (define_insn "rotrhi3"
916 [(set (match_operand:HI 0 "register_operand" "=r,r")
917 (rotatert:HI (match_operand:HI 1 "register_operand" "0,0")
918 (match_operand:QI 2 "general_operand" "I,r")))]
922 NEG R%2,R%2\;DSCR R%0,R%2 ")
926 ;; Special cases of bit-field insns which we should
927 ;; recognize in preference to the general case.
928 ;; These handle aligned 8-bit and 16-bit fields,
929 ;; which can usually be done with move instructions.
931 ;********************
933 ;; Bit field instructions, general cases.
934 ;; "o,d" constraint causes a nonoffsetable memref to match the "o"
935 ;; so that its address is reloaded.
937 ;; (define_insn "extv" ...
939 ;; (define_insn "extzv" ...
941 ;; (define_insn "insv" ...
943 ;; Now recognize bit field insns that operate on registers
944 ;; (or at least were intended to do so).
947 ;; Special patterns for optimizing bit-field instructions.
948 ;**************************************
950 ; cc status test ops n.a. on 1750 ......... e.g. "sleu" on 68k:
951 ; [(set (match_operand:QI 0 "general_operand" "=d")
952 ; (leu (cc0) (const_int 0)))]
954 ; "* cc_status = cc_prev_status;
955 ; return \"sls %0\"; ")
958 ;; Basic conditional jump instructions.
962 (if_then_else (eq (cc0)
964 (label_ref (match_operand 0 "" ""))
967 "* return (char *)branch_or_jump(\"EZ\",CODE_LABEL_NUMBER(operands[0]));
972 (if_then_else (ne (cc0)
974 (label_ref (match_operand 0 "" ""))
977 "* return (char *)branch_or_jump(\"NZ\",CODE_LABEL_NUMBER(operands[0]));
982 (if_then_else (gt (cc0)
984 (label_ref (match_operand 0 "" ""))
987 "* return (char *)branch_or_jump(\"GT\",CODE_LABEL_NUMBER(operands[0]));
992 (if_then_else (lt (cc0)
994 (label_ref (match_operand 0 "" ""))
997 "* return (char *)branch_or_jump(\"LT\",CODE_LABEL_NUMBER(operands[0]));
1002 (if_then_else (ge (cc0)
1004 (label_ref (match_operand 0 "" ""))
1007 "* return (char *)branch_or_jump(\"GE\",CODE_LABEL_NUMBER(operands[0]));
1012 (if_then_else (le (cc0)
1014 (label_ref (match_operand 0 "" ""))
1017 "* return (char *)branch_or_jump(\"LE\",CODE_LABEL_NUMBER(operands[0]));
1021 ; no unsigned branches available on 1750. But GCC still needs them, so faking:
1025 (if_then_else (gtu (cc0)
1027 (label_ref (match_operand 0 "" ""))
1030 "JC GT,%l0 ; Warning: this should be an *unsigned* test!")
1034 (if_then_else (ltu (cc0)
1036 (label_ref (match_operand 0 "" ""))
1039 "JC LT,%l0 ; Warning: this should be an *unsigned* test!")
1043 (if_then_else (geu (cc0)
1045 (label_ref (match_operand 0 "" ""))
1048 "JC GE,%l0 ; Warning: this should be an *unsigned* test!")
1052 (if_then_else (leu (cc0)
1054 (label_ref (match_operand 0 "" ""))
1057 "JC LE,%l0 ; Warning: this should be an *unsigned* test!")
1060 ;; Negated conditional jump instructions.
1064 (if_then_else (eq (cc0)
1067 (label_ref (match_operand 0 "" ""))))]
1069 "* return (char *)branch_or_jump(\"NZ\",CODE_LABEL_NUMBER(operands[0]));
1074 (if_then_else (ne (cc0)
1077 (label_ref (match_operand 0 "" ""))))]
1079 "* return (char *)branch_or_jump(\"EZ\",CODE_LABEL_NUMBER(operands[0]));
1084 (if_then_else (gt (cc0)
1087 (label_ref (match_operand 0 "" ""))))]
1089 "* return (char *)branch_or_jump(\"LE\",CODE_LABEL_NUMBER(operands[0]));
1094 (if_then_else (lt (cc0)
1097 (label_ref (match_operand 0 "" ""))))]
1099 "* return (char *)branch_or_jump(\"GE\",CODE_LABEL_NUMBER(operands[0]));
1104 (if_then_else (ge (cc0)
1107 (label_ref (match_operand 0 "" ""))))]
1109 "* return (char *)branch_or_jump(\"LT\",CODE_LABEL_NUMBER(operands[0]));
1114 (if_then_else (le (cc0)
1117 (label_ref (match_operand 0 "" ""))))]
1119 "* return (char *)branch_or_jump(\"GT\",CODE_LABEL_NUMBER(operands[0]));
1123 ;; Negated unsigned conditional jump instructions (faked for 1750).
1127 (if_then_else (gtu (cc0)
1130 (label_ref (match_operand 0 "" ""))))]
1132 "JC LE,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1136 (if_then_else (ltu (cc0)
1139 (label_ref (match_operand 0 "" ""))))]
1141 "JC GE,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1145 (if_then_else (geu (cc0)
1148 (label_ref (match_operand 0 "" ""))))]
1150 "JC LT,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1154 (if_then_else (leu (cc0)
1157 (label_ref (match_operand 0 "" ""))))]
1159 "JC GT,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1162 ;; 1750 note: CASE_VECTOR_PC_RELATIVE is not defined
1163 (define_insn "tablejump"
1165 (match_operand:QI 0 "register_operand" "b"))
1166 (use (label_ref (match_operand 1 "" "")))]
1168 "JC 15,0,R%0 ; tablejump label_ref=%1")
1171 ;; Unconditional jump
1174 (label_ref (match_operand 0 "" "")))]
1178 ;; Call subroutine, returning value in operand 0
1179 ;; (which must be a hard register).
1180 (define_insn "call_value"
1181 [(set (match_operand 0 "register_operand" "r")
1182 (call (match_operand:QI 1 "memory_operand" "m")
1183 (match_operand:QI 2 "general_operand" "g")))]
1184 ;; Operand 2 not really used for 1750.
1186 "SJS R15,%1 ; return value in R0")
1188 ;; Call subroutine with no return value.
1190 ;; Operand 1 not really used in MIL-STD-1750.
1192 [(call (match_operand:QI 0 "memory_operand" "mp")
1193 (match_operand:QI 1 "general_operand" ""))]
1195 "SJS R15,%0 ; no return value")
1197 ;;;;;;;;;;;; 1750: NOT READY YET.
1199 [(call (match_operand:QI 0 "" "")
1200 (match_operand:QI 1 "" ""))]
1205 ; (define_insn "return"
1210 ; rtx oprnd = gen_rtx(CONST_INT,VOIDmode,get_frame_size());
1211 ; output_asm_insn(\"RET.M %0\",&oprnd);
1215 (define_insn "indirect_jump"
1216 [(set (pc) (match_operand:QI 0 "address_operand" "p"))]
1226 ;; Subtract One and Jump (if non-zero)
1228 [(set (match_operand:QI 0 "register_operand" "=r")
1229 (plus:QI (match_operand:QI 1 "register_operand" "%0")
1230 (match_operand:QI 2 "immediate_operand" "J")))
1231 (set (cc0) (match_dup 0))
1233 (if_then_else (ne (cc0) (const_int 0))
1234 (label_ref (match_operand 3 "" ""))
1237 "INTVAL(operands[2]) == -1"