OSDN Git Service

1f4098f0f803b552c3fa3094cd935e980b2a33a5
[pf3gnuchains/gcc-fork.git] / gcc / config / 1750a / 1750a.md
1 ;;- Machine description for GNU compiler
2 ;;- MIL-STD-1750A version.
3 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999,
4 ;; 2000 Free Software Foundation, Inc.
5 ;; Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de).
6
7 ;; This file is part of GNU CC.
8
9 ;; GNU CC is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
13
14 ;; GNU CC is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU CC; see the file COPYING.  If not, write to
21 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24
25 ;;- instruction definitions
26
27 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
28
29 ;;- When naming insn's (operand 0 of define_insn) be careful about using
30 ;;- names from other targets machine descriptions.
31
32 ;; MIL-STD-1750 specific remarks:
33 ;;
34 ;; 1) BITS_PER_UNIT = 16
35 ;;
36 ;; 2) GCC   to    MIL-STD-1750       data type mappings:
37 ;;    QImode => single integer (16 bits or 1 reg).
38 ;;    HImode => double integer (32 bits or 2 regs).
39 ;;    HFmode => single precision float (32 bits or 2 regs).
40 ;;    TQFmode => extended precision float (48 bits or 3 regs).
41 ;; 
42 ;; 3) Immediate integer operands Constraints:
43 ;;    'I'  1 .. 16
44 ;;    'J' -1 ..-16
45 ;;    'K'  0 .. 15
46 ;;    'L'  0 .. 255
47 ;;    'M' -32768 .. 32767
48 ;;    'O' => 0  (for optimizations and GCC quirks)
49 ;;
50 ;; Further notes:
51 ;;-  Assembly output ending in ".M" are macros in file M1750.INC
52
53
54 ;; stackpush
55 (define_insn ""
56   [(set (match_operand:QI 0 "push_operand" "=<")
57         (match_operand:QI 1 "general_operand" "r"))]
58   ""
59   "pshm r%1,r%1")
60
61 (define_insn ""
62   [(set (match_operand:HI 0 "push_operand" "=<")
63         (match_operand:HI 1 "general_operand" "r"))]
64   ""
65   "pshm r%1,r%d1")
66
67 (define_insn ""
68   [(set (match_operand:HF 0 "push_operand" "=<")
69         (match_operand:HF 1 "general_operand" "r"))]
70   ""
71   "pshm r%1,r%d1")
72
73 (define_insn ""
74   [(set (match_operand:TQF 0 "push_operand" "=<")
75         (match_operand:TQF 1 "general_operand" "r"))]
76   ""
77   "pshm r%1,r%t1")
78
79 ;; stackpop
80 (define_insn ""
81   [(set (match_operand:QI 0 "general_operand" "=r")
82         (match_operand:QI 1 "push_operand" ">"))]
83   ""
84   "popm r%1,r%1")
85
86 (define_insn ""
87   [(set (match_operand:HI 0 "general_operand" "=r")
88         (match_operand:HI 1 "push_operand" ">"))]
89   ""
90   "popm r%1,r%d1")
91
92 (define_insn ""
93   [(set (match_operand:HF 0 "general_operand" "=r")
94         (match_operand:HF 1 "push_operand" ">"))]
95   ""
96   "popm r%1,r%d1")
97    
98 (define_insn ""
99   [(set (match_operand:TQF 0 "general_operand" "=r")
100         (match_operand:TQF 1 "push_operand" ">"))]
101   ""
102   "popm r%1,r%t1")
103
104
105 ;; Test operations.
106
107 (define_insn "tstqi"
108   [(set (cc0)
109         (match_operand:QI 0 "register_operand" "r"))]
110   ""
111   "lr r%0,r%0   ; from tstqi")
112
113 (define_insn "tsthi"
114   [(set (cc0)
115         (match_operand:HI 0 "register_operand" "r"))]
116   ""
117   "dlr r%0,r%0   ; from tsthi")
118
119 ; With 1750A floats, testing the most significant word suffices.
120
121 (define_insn "tsthf"
122   [(set (cc0)
123         (match_operand:HF 0 "register_operand" "r"))]
124   ""
125   "lr r%0,r%0   ; tsthf")
126
127 (define_insn "tsttqf"
128   [(set (cc0)
129         (match_operand:TQF 0 "register_operand" "r"))]
130   ""
131   "lr r%0,r%0   ; tsttqf")
132
133
134 ;; block move.
135
136 (define_insn "movstrqi"
137   [(set (match_operand:BLK 0 "mov_memory_operand" "=m")
138         (match_operand:BLK 1 "mov_memory_operand" "m"))
139    (use (match_operand:QI 2 "general_operand" "r"))
140    (match_operand 3 "" "")
141    (clobber (match_dup 0))
142    (clobber (match_dup 1))
143    (clobber (match_dup 2))]
144   ""
145   "*
146    {
147      rtx regops[3];
148
149      regops[0] = XEXP (operands[0], 0);
150      regops[1] = XEXP (operands[1], 0);
151      regops[2] = operands[2];
152
153      return movcnt_regno_adjust (regops);
154    } ")
155
156
157 ;; compare instructions.
158
159 (define_insn "cmpqi"
160   [(set (cc0)
161         (compare (match_operand:QI 0 "register_operand" "r,r,r,r,r")
162                  (match_operand:QI 1 "general_operand"  "I,J,i,r,m")))]
163   ""
164   "*
165    {
166      if (next_cc_user_is_unsigned (insn))
167        switch (which_alternative)
168          {
169          case 0:
170          case 1:
171          case 2:
172            return \"ucim.m %0,%1\";
173          case 3:
174            return \"ucr.m %0,%1\";
175          case 4:
176            return \"uc.m %0,%1\";
177          default:
178            abort();
179          }
180      else
181        switch (which_alternative)
182          {
183          case 0:
184            return \"cisp r%0,%1\";
185          case 1:
186            return \"cisn r%0,%J1\";
187          case 2:
188            return \"cim  r%0,%1\";
189          case 3:
190            return \"cr   r%0,r%1\";
191          case 4:
192            return \"c    r%0,%1\";
193          default:
194            abort();
195          }
196    } ")
197
198 (define_insn "cmphi"
199   [(set (cc0)
200         (compare (match_operand:HI 0 "general_operand" "r,r")
201                  (match_operand:HI 1 "general_operand" "r,m")))]
202   ""
203   "*
204    {
205      if (next_cc_user_is_unsigned (insn))
206        {
207          if (which_alternative == 0)
208            return \"ducr.m %0,%1\";
209          return \"duc.m %0,%1\";
210        }
211      else
212        {
213          if (which_alternative == 0)
214            return \"dcr r%0,r%1\";
215          return \"dc  r%0,%1\";
216        }
217    } ")
218
219 (define_insn "cmphf"
220  [(set (cc0)
221        (compare (match_operand:HF 0 "general_operand" "r,r")
222                 (match_operand:HF 1 "general_operand" "r,m")))]
223  ""
224  "@
225    fcr r%0,r%1
226    fc  r%0,%1 ")
227
228 (define_insn "cmptqf"
229   [(set (cc0)
230         (compare (match_operand:TQF 0 "general_operand" "r,r")
231                  (match_operand:TQF 1 "general_operand" "r,m")))]
232   ""
233   "@
234     efcr r%0,r%1
235     efc  r%0,%1 ")
236
237
238 ;; truncation instructions
239 ;;- 1750: any needed?
240
241 (define_insn "trunchiqi2"
242   [(set (match_operand:QI 0 "register_operand" "=r")
243         (truncate:QI (match_operand:HI 1 "register_operand" "r")))]
244   ""
245   "lr  r%0,r%d1")
246
247
248 ;; zero extension instructions: not defined, GCC can synthesize
249
250 ;; sign extension instructions
251
252 (define_insn "extendqihi2"
253   [(set (match_operand:HI 0 "register_operand" "=r,r")
254         (sign_extend:HI (match_operand:QI 1 "general_operand" "r,m")) )]
255   ""
256   "*
257     if (which_alternative == 0)
258       {
259         if (REGNO (operands [0]) != REGNO (operands [1]))
260           output_asm_insn (\"lr r%0,r%1\", operands);
261       }
262     else
263       output_asm_insn (\"l  r%0,%1\", operands);
264     return \"dsra r%0,16  ;extendqihi2\";
265   ")
266
267
268 ;; Conversions between float and double.
269
270 ; 1750 HF-to-TQF extend: just append 16 bits (least signif.) with all bits zero
271 (define_insn "extendhftqf2"
272   [(set (match_operand:TQF 0 "register_operand" "=r,r")
273         (float_extend:TQF (match_operand:HF 1 "general_operand" "r,m")))]
274   ""
275   "*
276     output_asm_insn(\"xorr r%t0,r%t0   ;extendhftqf2\", operands);
277     if (which_alternative == 0)
278       {
279         if (REGNO (operands[1]) != REGNO (operands[0]))
280           return \"dlr r%0,r%1\";
281         else
282           return \";\";
283       }
284     else
285       return \"dl  r%0,%1\";
286    ")
287
288 ; 1750 TQF-to-HF truncate is a no-op: just leave away the least signif. 16 bits
289 (define_insn "trunctqfhf2"
290   [(set (match_operand:HF 0 "register_operand" "=r,r")
291         (float_truncate:HF
292           (match_operand:TQF 1 "general_operand" "r,m")))]
293   ""
294   "@
295      dlr r%0,r%1  ;trunctqfhf2
296      dl  r%0,%1   ;trunctqfhf2 ")
297
298
299 ;; Conversion between fixed point and floating point.
300
301 (define_insn "floatqihf2"
302   [(set           (match_operand:HF 0 "register_operand" "=r")
303         (float:HF (match_operand:QI 1 "register_operand" "r")))]
304   ""
305   "flt r%0,r%1")
306
307 (define_insn "floathitqf2"
308   [(set           (match_operand:TQF 0 "register_operand" "=r")
309         (float:TQF (match_operand:HI 1 "register_operand" "r")))]
310   ""
311   "eflt r%0,r%1")
312
313
314 ;; Convert floats to ints
315
316 (define_insn "fix_trunchfqi2"
317   [(set                 (match_operand:QI 0 "register_operand" "=r")
318         (fix:QI (fix:HF (match_operand:HF 1 "register_operand" "r"))))]
319   ""
320   "fix r%0,r%1")
321
322 (define_insn "fix_trunctqfhi2"
323   [(set                 (match_operand:HI 0 "register_operand" "=r")
324         (fix:HI (fix:TQF (match_operand:TQF 1 "register_operand" "r"))))]
325   ""
326   "efix r%0,r%1")
327
328
329 ;; Move instructions
330
331 ;; We can't deal with normal byte-size characters, only with WIDE characters!
332 ;; This may appear as a serious restriction, but it also opens the doors
333 ;; for ISO 10646  :-)
334
335 ;; 16-bit moves
336
337 ; memory indirect to reg
338 (define_insn ""
339   [(set (match_operand:QI 0 "register_operand" "=r")
340         (mem:QI (match_operand 1 "memory_operand"  "m")))]
341   ""
342   "li   r%0,%1")
343
344 ; reg/const to memory indirect
345 (define_insn ""
346   [(set (mem:QI (match_operand 0 "memory_operand" "=m,m"))
347         (match_operand:QI 1 "nonmemory_operand"  "r,K"))]
348   ""
349   "@
350      sti  r%1,%0
351      stci %1,%0")
352
353 ; general case
354 (define_insn "movqi"
355   [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,r,m,m")
356         (match_operand:QI 1 "general_operand"  "O,I,J,i,r,m,r,K"))]
357   ""
358   "@
359      xorr r%0,r%0
360      lisp r%0,%1
361      lisn r%0,%J1
362      lim  r%0,%1
363      lr   r%0,r%1
364      l    r%0,%1
365      st   r%1,%0
366      stc  %1,%0   ")
367
368 ;; 32-bit moves
369
370 ; memory indirect to reg
371 (define_insn ""
372   [(set (match_operand:HI 0 "register_operand" "=r")
373         (mem:HI (match_operand 1 "memory_operand"  "m")))]
374   ""
375   "dli  r%0,%1")
376
377 ; reg to memory indirect
378 (define_insn ""
379   [(set (mem:HI (match_operand 0 "memory_operand" "=m"))
380         (match_operand:HI 1 "register_operand"  "r"))]
381   ""
382   "dsti r%1,%0")
383
384 ; general case
385 (define_insn ""
386   [(set (match_operand:HI 0 "general_operand" "=r,r,r,r,r,m,m")
387         (match_operand:HI 1 "general_operand"  "O,I,J,r,m,r,K"))]
388   ""
389   "@
390     xorr r%0,r%0\;xorr r%d0,r%d0
391     xorr r%0,r%0\;lisp r%d0,%1
392     lisn r%0,1  \;lisn r%d0,%J1
393     dlr  r%0,r%1
394     dl   r%0,%1
395     dst  r%1,%0
396     stc  0,%0   \;stc  %1,%A0 ")
397
398 (define_expand "movhi"
399   [(set (match_operand:HI 0 "general_operand" "=g")
400         (match_operand:HI 1 "general_operand"  "g"))]
401   ""
402   "
403    {
404      rtx op1 = operands[1];
405      if (GET_CODE (operands[0]) == MEM)
406        {
407          if (GET_CODE (op1) == MEM
408              || (GET_CODE (op1) == CONST_INT
409                  && (INTVAL (op1) < 0 || INTVAL (op1) > 15)))
410            operands[1] = force_reg (HImode, operands[1]);
411        }
412      else if (GET_CODE (op1) == CONST_INT
413               && (INTVAL (op1) < -16 || INTVAL (op1) > 16))
414        operands[1] = force_const_mem (HImode, operands[1]);
415    }")
416
417
418 ;; Single-Float moves
419
420 (define_insn ""
421   [(set (match_operand:HF 0 "general_operand" "=r,r,m,m")
422         (match_operand:HF 1 "general_operand"  "r,m,r,G"))]
423   ""
424   "@
425     dlr  r%0,r%1
426     dl   r%0,%1
427     dst  r%1,%0
428     stc  0,%0   \;stc 0,%A0 ")
429
430 (define_expand "movhf"
431   [(set (match_operand:HF 0 "general_operand" "")
432         (match_operand:HF 1 "general_operand" ""))]
433   ""
434   "
435    {
436      enum rtx_code op1code = GET_CODE (operands[1]);
437      if (GET_CODE (operands[0]) == MEM)
438        {
439          if (op1code == MEM || (op1code == CONST_DOUBLE
440              && !rtx_equal_p (operands[1], CONST0_RTX (HFmode))))
441            operands[1] = force_reg (HFmode, operands[1]);
442        }
443      else if (op1code == CONST_DOUBLE)
444        operands[1] = force_const_mem (HFmode, operands[1]);
445    }")
446
447
448 ;; Longfloat moves
449
450 (define_insn ""
451   [(set (match_operand:TQF 0 "general_operand" "=r,r,m")
452         (match_operand:TQF 1 "general_operand"  "r,m,r"))]
453   ""
454   "@
455     eflr.m %0,%1
456     efl  r%0,%1
457     efst r%1,%0 ")
458
459 (define_expand "movtqf"
460   [(set (match_operand:TQF 0 "general_operand" "")
461         (match_operand:TQF 1 "general_operand" ""))]
462   ""
463   "
464    {
465      enum rtx_code op1code = GET_CODE (operands[1]);
466      if (GET_CODE (operands[0]) == MEM)
467        {
468          if (op1code == MEM || op1code == CONST_DOUBLE)
469            operands[1] = force_reg (TQFmode, operands[1]);
470        }
471      else if (op1code == CONST_DOUBLE)
472        operands[1] = force_const_mem (TQFmode, operands[1]);
473    }")
474
475
476 ;; add instructions 
477
478 ;; single integer
479
480 (define_insn "addqi3"
481   [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,m,m")
482         (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0,0")
483                  (match_operand:QI 2 "general_operand"  "I,J,i,r,m,I,J")))]
484   ""
485   "*
486     switch (which_alternative)
487       {
488         case 0:
489           return \"aisp r%0,%2\";
490         case 1:
491           return \"sisp r%0,%J2\";
492         case 2:
493           if (INTVAL(operands[2]) < 0)
494             return \"sim r%0,%J2\";
495           else
496             return \"aim r%0,%2\";
497         case 3:
498           return \"ar r%0,r%2\";
499         case 4:
500           return \"a r%0,%2\";
501         case 5:
502           return \"incm %2,%0\";
503         case 6:
504           return \"decm %J2,%0\";
505         default:
506           abort();
507       } ")
508
509 ;; double integer
510 (define_insn "addhi3"
511   [(set (match_operand:HI 0 "register_operand" "=r,r")
512         (plus:HI (match_operand:HI 1 "register_operand" "%0,0")
513                  (match_operand:HI 2 "general_operand" "r,m")))]
514   ""
515   "@
516     dar r%0,r%2
517     da  r%0,%2 ")
518
519 (define_insn "addhf3"
520   [(set (match_operand:HF 0 "register_operand" "=r,r")
521         (plus:HF (match_operand:HF 1 "register_operand" "%0,0")
522                  (match_operand:HF 2 "general_operand" "r,m")))]
523   ""
524   "@
525     far r%0,r%2
526     fa  r%0,%2 ")
527
528 (define_insn "addtqf3"
529   [(set (match_operand:TQF 0 "register_operand" "=r,r")
530         (plus:TQF (match_operand:TQF 1 "register_operand" "%0,0")
531                  (match_operand:TQF 2 "general_operand" "r,m")))]
532   ""
533   "@
534     efar r%0,r%2
535     efa  r%0,%2 ")
536
537
538 ;; subtract instructions
539
540 ;; single integer
541 (define_insn "subqi3"
542   [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,m")
543         (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0,0")
544                   (match_operand:QI 2 "general_operand"  "I,i,r,m,I")))]
545   ""
546   "@
547     sisp r%0,%2
548     sim  r%0,%2
549     sr   r%0,r%2
550     s    r%0,%2
551     decm %2,%0 ")
552
553 ;; double integer
554 (define_insn "subhi3"
555   [(set (match_operand:HI 0 "register_operand" "=r,r")
556         (minus:HI (match_operand:HI 1 "register_operand" "0,0")
557                   (match_operand:HI 2 "general_operand" "r,m")))]
558   ""
559   "@
560     dsr r%0,r%2
561     ds  r%0,%2 ")
562
563 (define_insn "subhf3"
564   [(set (match_operand:HF 0 "register_operand" "=r,r")
565         (minus:HF (match_operand:HF 1 "register_operand" "0,0")
566                   (match_operand:HF 2 "general_operand" "r,m")))]
567   ""
568   "@
569     fsr r%0,r%2
570     fs  r%0,%2 ")
571
572 (define_insn "subtqf3"
573   [(set (match_operand:TQF 0 "register_operand" "=r,r")
574         (minus:TQF (match_operand:TQF 1 "register_operand" "0,0")
575                   (match_operand:TQF 2 "general_operand" "r,m")))]
576   ""
577   "@
578     efsr r%0,r%2
579     efs  r%0,%2 ")
580
581
582 ;; multiply instructions
583
584 (define_insn "mulqi3"
585   [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
586         (mult:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0")
587                  (match_operand:QI 2 "general_operand"  "I,J,M,r,m")))]
588   ""
589   "@
590      misp r%0,%2
591      misn r%0,%J2
592      msim r%0,%2
593      msr  r%0,r%2
594      ms   r%0,%2  ")
595
596
597 ; 32-bit product
598 (define_insn "mulqihi3"
599   [(set (match_operand:HI 0 "register_operand" "=r,r,r")
600     (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "%r,r,r"))
601              (sign_extend:HI (match_operand:QI 2 "general_operand" "r,m,i"))))]
602   ""
603   "*
604     if (REGNO (operands[1]) != REGNO (operands[0]))
605       output_asm_insn (\"lr r%0,r%1\", operands);
606
607     switch (which_alternative)
608       {
609       case 0:
610         return \"mr  r%0,r%2\";
611       case 1:
612         return \"m   r%0,%2\";
613       case 2:
614         return \"mim r%0,%2\";
615       default:
616         abort();
617       }
618   ")
619
620
621 (define_insn "mulhi3"
622   [(set (match_operand:HI 0 "register_operand" "=r,r")
623         (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
624                  (match_operand:HI 2 "general_operand" "r,m")))]
625   ""
626   "@
627     dmr r%0,r%2
628     dm  r%0,%2 ")
629
630 ; not available on 1750: "umulhi3","umulhisi3","umulsi3" (unsigned multiply's)
631
632 (define_insn "mulhf3"
633   [(set (match_operand:HF 0 "register_operand" "=r,r")
634         (mult:HF (match_operand:HF 1 "register_operand" "%0,0")
635                  (match_operand:HF 2 "general_operand" "r,m")))]
636   ""
637   "@
638     fmr r%0,r%2
639     fm  r%0,%2 ")
640
641 (define_insn "multqf3"
642   [(set (match_operand:TQF 0 "register_operand" "=r,r")
643         (mult:TQF (match_operand:TQF 1 "register_operand" "%0,0")
644                  (match_operand:TQF 2 "general_operand" "r,m")))]
645   ""
646   "@
647     efmr r%0,r%2
648     efm  r%0,%2 ")
649
650
651 ;; divide instructions
652 ;; The 1750 16bit integer division instructions deliver a 16-bit
653 ;; quotient and a 16-bit remainder, where the remainder is in the next higher
654 ;; register number above the quotient. For now, we haven't found a way
655 ;; to give the reload pass knowledge of this property. So we make do with
656 ;; whatever registers the allocator wants, and willy-nilly output a pair of
657 ;; register-copy ops when needed. (See mod_regno_adjust() in file aux-output.c)
658 ;; A comment in the description of `divmodM4' suggests that one leave the divM3
659 ;; undefined when there is a divmodM4 available.
660
661 (define_insn "divmodqi4"
662   [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")
663         (div:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0")
664                 (match_operand:QI 2 "general_operand"  "I,J,M,r,m")))
665    (set (match_operand:QI 3 "register_operand" "=r,r,r,r,r")
666         (mod:QI (match_dup 1) (match_dup 2)))]
667   ""
668   "*
669    {
670      const char *istr;
671      switch(which_alternative)
672        {
673        case 0:
674          istr = \"disp\";
675          break;
676        case 1:
677          {
678            rtx new_opnds[4];
679            new_opnds[0] = operands[0];
680            new_opnds[1] = operands[1];
681            new_opnds[2] = GEN_INT (-INTVAL(operands[2]));
682            new_opnds[3] = operands[3];
683            istr = \"disn\";
684            return mod_regno_adjust (istr, new_opnds);
685          }
686          break;
687        case 2:
688          istr = \"dvim\";
689          break;
690        case 3:
691          istr = \"dvr \";
692          break;
693        case 4:
694          istr = \"dv  \";
695          break;
696       }
697       return mod_regno_adjust (istr, operands);
698      }")
699
700 ;; Division for other types is straightforward.
701
702 (define_insn "divhi3"
703   [(set (match_operand:HI 0 "register_operand" "=r,r")
704         (div:HI (match_operand:HI 1 "register_operand" "0,0")
705                 (match_operand:HI 2 "general_operand" "r,m")))]
706   ""
707   "@
708     ddr r%0,r%2
709     dd  r%0,%2 ")
710
711 (define_insn "divhf3"
712   [(set (match_operand:HF 0 "register_operand" "=r,r")
713         (div:HF (match_operand:HF 1 "register_operand" "0,0")
714                 (match_operand:HF 2 "general_operand" "r,m")))]
715   ""
716   "@
717     fdr r%0,r%2
718     fd  r%0,%2 ")
719
720 (define_insn "divtqf3"
721   [(set (match_operand:TQF 0 "register_operand" "=r,r")
722         (div:TQF (match_operand:TQF 1 "register_operand" "0,0")
723                 (match_operand:TQF 2 "general_operand" "r,m")))]
724   ""
725   "@
726     efdr r%0,r%2
727     efd  r%0,%2 ")
728
729
730 ;; Other arithmetic instructions:
731
732 ;; Absolute value
733
734 (define_insn "absqi2"
735   [(set (match_operand:QI 0 "register_operand" "=r")
736         (abs:QI (match_operand:QI 1 "register_operand" "r")))]
737   ""
738   "abs r%0,r%1")
739
740 (define_insn "abshi2"
741   [(set (match_operand:HI 0 "register_operand" "=r")
742         (abs:HI (match_operand:HI 1 "register_operand" "r")))]
743   ""
744   "dabs r%0,r%1")
745
746 (define_insn "abshf2"
747   [(set (match_operand:HF 0 "register_operand" "=r")
748         (abs:HF (match_operand:HF 1 "register_operand" "r")))]
749   ""
750   "fabs r%0,r%1")
751
752
753 ;; Negation
754
755 (define_insn "negqi2"
756   [(set (match_operand:QI 0 "register_operand" "=r")
757         (neg:QI (match_operand:QI 1 "register_operand" "r")))]
758   ""
759   "neg r%0,r%1")
760
761 (define_insn "neghi2"
762   [(set (match_operand:HI 0 "register_operand" "=r")
763         (neg:HI (match_operand:HI 1 "register_operand" "r")))]
764   ""
765   "dneg r%0,r%1")
766
767 (define_insn "neghf2"
768   [(set (match_operand:HF 0 "register_operand" "=r")
769         (neg:HF (match_operand:HF 1 "register_operand" "r")))]
770   ""
771   "fneg r%0,r%1")
772
773 ; The 1750A does not have an extended float negate instruction, so simulate.
774 (define_expand "negtqf2"
775   [(set (match_operand:TQF 0 "register_operand" "=&r")
776         (neg:TQF (match_operand:TQF 1 "register_operand" "r")))]
777   ""
778   "
779    emit_insn (gen_rtx_SET (VOIDmode, operands[0], CONST0_RTX (TQFmode)));
780    emit_insn (gen_rtx_SET (VOIDmode, operands[0],
781                            gen_rtx_MINUS (TQFmode, operands[0], operands[1])));
782    DONE;
783   ")
784
785
786 ;; bit-logical instructions
787
788 ;; Set Bit
789 (define_insn ""
790   [(set (match_operand:QI 0 "general_operand" "=r,m")
791         (ior:QI  (match_operand:QI 1 "general_operand" "0,0")
792                  (match_operand:QI 2 "const_int_operand" "i,i")))]
793   "one_bit_set_p (INTVAL (operands [2]))"
794   "@
795     sbr    %b2,r%0
796     sb     %b2,%0")
797
798 ;; Reset Bit
799 (define_insn ""
800   [(set (match_operand:QI 0 "general_operand" "=r,m")
801         (and:QI  (match_operand:QI 1 "general_operand" "0,0")
802                  (match_operand:QI 2 "const_int_operand" "i,i")))]
803   "one_bit_set_p ((~INTVAL (operands [2])) & 0xffff)"
804   "@
805     rbr    %B2,r%0
806     rb     %B2,%0")
807
808 ;; Set Variable Bit
809 (define_insn ""
810   [(set (match_operand:QI 0 "register_operand" "=r")
811         (ior:QI  (match_operand:QI 1 "register_operand" "0")
812                  (lshiftrt:QI (const_int 0x8000)
813                       (match_operand:QI 2 "register_operand" "r"))))]
814   ""
815   "svbr   r%2,%r0")
816
817 ;; Reset Variable Bit
818 (define_insn ""
819   [(set (match_operand:QI 0 "general_operand" "=r")
820         (and:QI  (match_operand:QI 1 "general_operand" "0")
821             (not:QI (lshiftrt:QI (const_int 0x8000)
822                         (match_operand:QI 2 "register_operand" "r")))))]
823   ""
824   "rvbr   r%2,%r0")
825
826
827 ;; AND
828
829 (define_insn "andqi3"
830   [(set (match_operand:QI 0 "general_operand" "=r,r,r")
831         (and:QI (match_operand:QI 1 "general_operand" "%0,0,0")
832                 (match_operand:QI 2 "general_operand" "M,r,m")))]
833   ""
834   "@
835     andm r%0,%2
836     andr r%0,r%2
837     and  r%0,%2 ")
838
839 ; This sets incorrect condition codes. See notice_update_cc()
840 (define_insn "andhi3"
841   [(set (match_operand:HI 0 "register_operand" "=r")
842         (and:HI (match_operand:HI 1 "register_operand" "%0")
843                 (match_operand:HI 2 "register_operand" "r")))]
844   ""
845   "danr.m %0,%2")
846
847 ;; OR
848
849 (define_insn "iorqi3"
850   [(set (match_operand:QI 0 "general_operand" "=r,r,r")
851         (ior:QI  (match_operand:QI 1 "general_operand" "%0,0,0")
852                  (match_operand:QI 2 "general_operand" "M,r,m")))]
853   ""
854   "@
855     orim r%0,%2
856     orr  r%0,r%2
857     or   r%0,%2 ")
858
859 ; This sets incorrect condition codes. See notice_update_cc()
860 (define_insn "iorhi3"
861   [(set (match_operand:HI 0 "register_operand" "=r")
862         (ior:HI (match_operand:HI 1 "register_operand" "%0")
863                 (match_operand:HI 2 "register_operand" "r")))]
864   ""
865   "dorr.m %0,%2")
866
867 ;; XOR
868
869 (define_insn "xorqi3"
870   [(set (match_operand:QI 0 "register_operand" "=r,r,r")
871         (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0")
872                 (match_operand:QI 2 "general_operand"  "M,r,m")))]
873   ""
874   "@
875     xorm r%0,%2
876     xorr r%0,r%2
877     xor  r%0,%2 ")
878
879 ; This sets incorrect condition codes. See notice_update_cc()
880 (define_insn "xorhi3"
881   [(set (match_operand:HI 0 "register_operand" "=r")
882         (xor:HI (match_operand:HI 1 "register_operand" "%0")
883                 (match_operand:HI 2 "register_operand" "r")))]
884   ""
885   "dxrr.m %0,%2")
886
887 ;; NAND
888
889 (define_insn ""
890   [(set (match_operand:QI 0 "register_operand" "=r,r,r")
891         (ior:QI (not:QI (match_operand:QI 1 "register_operand" "%0,0,0"))
892                 (not:QI (match_operand:QI 2 "general_operand" "M,r,m"))))]
893   ""
894   "@
895     nim r%0,%2
896     nr  r%0,r%2
897     n   r%0,%2 ")
898
899 ; This sets incorrect condition codes. See notice_update_cc()
900 (define_insn ""
901   [(set (match_operand:HI 0 "register_operand" "=r")
902         (ior:HI (not:HI (match_operand:HI 1 "register_operand" "%0"))
903                 (not:HI (match_operand:HI 2 "register_operand" "r"))))]
904   ""
905   "dnr.m %0,%2")
906
907 ;; NOT
908
909 (define_insn "one_cmplqi2"
910   [(set (match_operand:QI 0 "register_operand" "=r")
911         (not:QI (match_operand:QI 1 "register_operand" "0")))]
912   ""
913   "nr r%0,r%0")
914
915 ; This sets incorrect condition codes. See notice_update_cc()
916 (define_insn "one_cmplhi2"
917   [(set (match_operand:HI 0 "register_operand" "=r")
918         (not:HI (match_operand:HI 1 "register_operand" "0")))]
919   ""
920   "dnr.m %0,%0")
921
922
923 ;; Shift instructions
924
925 ; (What to the 1750 is logical-shift-left, GCC likes to call "arithmetic")
926 (define_insn "ashlqi3"
927   [(set (match_operand:QI 0 "register_operand" "=r,r")
928         (ashift:QI (match_operand:QI 1 "register_operand" "0,0")
929                    (match_operand:QI 2 "nonmemory_operand" "I,r")))]
930   ""
931   "@
932     sll r%0,%2
933     slr r%0,r%2 ")
934
935 (define_insn "ashlhi3"
936   [(set (match_operand:HI 0 "register_operand" "=r,r")
937         (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
938                    (match_operand:QI 2 "nonmemory_operand" "L,r")))]
939   ""                        ; the 'L' constraint is a slight imprecise...
940   "*
941     if (which_alternative == 1)
942       return \"dslr r%0,r%2\";
943     else if (INTVAL(operands[2]) <= 16)
944       return \"dsll r%0,%2\";
945     else
946       {
947         output_asm_insn (\"dsll r%0,16  ; ashlhi3 shiftcnt > 16\", operands);
948         return \"sll r%0,%w2\";
949       }
950   ")
951
952
953 ;; Right shift by a variable shiftcount works by negating the shift count,
954 ;; then emitting a right shift with the shift count negated.  This means
955 ;; that all actual shift counts in the RTL will be positive.  This 
956 ;; prevents converting shifts to ZERO_EXTRACTs with negative positions,
957 ;; which isn't valid.
958 (define_expand "lshrqi3"
959   [(set (match_operand:QI 0 "register_operand" "=r")
960         (lshiftrt:QI (match_operand:QI 1 "register_operand" "0")
961                      (match_operand:QI 2 "nonmemory_operand" "g")))]
962   ""
963   "
964 {
965   if (GET_CODE (operands[2]) != CONST_INT)
966     operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
967 }")
968
969 (define_insn ""
970   [(set (match_operand:QI 0 "register_operand" "=r")
971         (lshiftrt:QI (match_operand:QI 1 "register_operand" "0")
972                      (match_operand:QI 2 "immediate_operand" "I")))]
973   ""
974   "srl r%0,%2")
975
976 (define_insn ""
977   [(set (match_operand:QI 0 "register_operand" "=r")
978         (lshiftrt:QI (match_operand:QI 1 "register_operand" "0")
979                      (neg:QI (match_operand:QI 2 "register_operand" "r"))))]
980   ""
981   "slr r%0,r%2 ")
982
983 ;; Same thing for HImode.
984
985 (define_expand "lshrhi3"
986   [(set (match_operand:HI 0 "register_operand" "=r")
987         (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
988                      (match_operand:QI 2 "nonmemory_operand" "g")))]
989   ""
990   "
991   {
992     if (GET_CODE (operands[2]) != CONST_INT)
993       operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
994   }")
995
996 (define_insn ""
997   [(set (match_operand:HI 0 "register_operand" "=r")
998         (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
999                      (match_operand:QI 2 "immediate_operand" "L")))]
1000   ""
1001   "*
1002     if (INTVAL (operands[2]) <= 16)
1003       return \"dsrl r%0,%2\";
1004     output_asm_insn (\"dsrl r%0,16  ; lshrhi3 shiftcount > 16\", operands);
1005     return \"srl  r%d0,%w2\";
1006   ")
1007
1008 (define_insn ""
1009   [(set (match_operand:HI 0 "register_operand" "=r")
1010         (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
1011                      (neg:QI (match_operand:QI 2 "register_operand" "r"))))]
1012   ""
1013   "dslr r%0,r%2 ")
1014
1015 ;; Same applies for arithmetic shift right.
1016 (define_expand "ashrqi3"
1017   [(set (match_operand:QI 0 "register_operand" "=r")
1018         (ashiftrt:QI (match_operand:QI 1 "register_operand" "0")
1019                      (match_operand:QI 2 "nonmemory_operand" "g")))]
1020   ""
1021   "
1022   {
1023     if (GET_CODE (operands[2]) != CONST_INT)
1024       operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
1025   }")
1026
1027 (define_insn ""
1028   [(set (match_operand:QI 0 "register_operand" "=r")
1029         (ashiftrt:QI (match_operand:QI 1 "register_operand" "0")
1030                      (match_operand:QI 2 "immediate_operand" "I")))]
1031   ""
1032   "sra r%0,%2")
1033
1034 (define_insn ""
1035   [(set (match_operand:QI 0 "register_operand" "=r")
1036         (ashiftrt:QI (match_operand:QI 1 "register_operand" "0")
1037                      (neg:QI (match_operand:QI 2 "register_operand" "r"))))]
1038   ""
1039   "sar r%0,r%2 ")
1040
1041 ;; HImode arithmetic shift right.
1042 (define_expand "ashrhi3"
1043   [(set (match_operand:HI 0 "register_operand" "=r")
1044         (ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
1045                      (match_operand:QI 2 "nonmemory_operand" "g")))]
1046   ""
1047   "
1048   {
1049     if (GET_CODE (operands[2]) != CONST_INT)
1050       operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
1051   }")
1052
1053 (define_insn ""
1054   [(set (match_operand:HI 0 "register_operand" "=r")
1055         (ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
1056                      (match_operand:QI 2 "immediate_operand" "L")))]
1057   ""
1058   "*
1059     if (INTVAL (operands[2]) <= 16)
1060       return \"dsra r%0,%2\";
1061     output_asm_insn (\"dsra r%0,16  ; ashrhi3 shiftcount > 16\", operands);
1062     return \"sra  r%d0,%w2\";
1063   ")
1064
1065 (define_insn ""
1066   [(set (match_operand:HI 0 "register_operand" "=r")
1067         (ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
1068                      (neg:QI (match_operand:QI 2 "register_operand" "r"))))]
1069   ""
1070   "dsar r%0,r%2 ")
1071
1072
1073 ;; rotate instructions
1074
1075 (define_insn "rotlqi3"
1076   [(set (match_operand:QI 0 "register_operand" "=r,r")
1077         (rotate:QI (match_operand:QI 1 "register_operand" "0,0")
1078                    (match_operand:QI 2 "nonmemory_operand" "I,r")))]
1079   ""
1080   "@
1081     slc r%0,%2
1082     scr r%0,r%2 ")
1083
1084 (define_insn "rotlhi3"
1085   [(set (match_operand:HI 0 "register_operand" "=r,r")
1086         (rotate:HI (match_operand:HI 1 "register_operand" "0,0")
1087                    (match_operand:QI 2 "nonmemory_operand" "I,r")))]
1088   ""
1089   "@
1090     dslc r%0,%2
1091     dscr r%0,r%2 ")
1092
1093 (define_insn "rotrqi3"
1094   [(set (match_operand:QI 0 "register_operand" "=r")
1095         (rotatert:QI (match_operand:QI 1 "register_operand" "0")
1096                      (match_operand:QI 2 "register_operand" "r")))]
1097   ""
1098   "neg r%2,r%2\;scr r%0,r%2 ")
1099
1100 (define_insn "rotrhi3"
1101   [(set (match_operand:HI 0 "register_operand" "=r")
1102         (rotatert:HI (match_operand:HI 1 "register_operand" "0")
1103                      (match_operand:QI 2 "nonmemory_operand" "r")))]
1104   ""
1105   "neg  r%2,r%2\;dscr r%0,r%2 ")
1106
1107
1108
1109 ;; Special cases of bit-field insns which we should
1110 ;; recognize in preference to the general case.
1111 ;; These handle aligned 8-bit and 16-bit fields,
1112 ;; which can usually be done with move instructions.
1113 ;    1750: t.b.d.
1114 ;********************
1115
1116 ;; Bit field instructions, general cases.
1117 ;; "o,d" constraint causes a nonoffsettable memref to match the "o"
1118 ;; so that its address is reloaded.
1119
1120 ;; (define_insn "extv" ...
1121
1122 ;; (define_insn "extzv" ...
1123
1124 ;; (define_insn "insv" ...
1125
1126 ;; Now recognize bit field insns that operate on registers
1127 ;; (or at least were intended to do so).
1128 ;[unnamed only]
1129
1130 ;; Special patterns for optimizing bit-field instructions.
1131 ;**************************************
1132
1133 ; cc status test ops n.a. on 1750 ......... e.g. "sleu" on 68k:
1134 ;  [(set (match_operand:QI 0 "general_operand" "=d")
1135 ;        (leu (cc0) (const_int 0)))]
1136 ;  ""
1137 ;  "* cc_status = cc_prev_status;
1138 ;     return \"sls %0\"; ")
1139
1140
1141 ;; Basic conditional jump instructions.
1142
1143 (define_insn "beq"
1144   [(set (pc)
1145         (if_then_else (eq (cc0)
1146                           (const_int 0))
1147                       (label_ref (match_operand 0 "" ""))
1148                       (pc)))]
1149   ""
1150   "* return branch_or_jump (\"ez\", CODE_LABEL_NUMBER (operands[0]));
1151   ")
1152
1153 (define_insn "bne"
1154   [(set (pc)
1155         (if_then_else (ne (cc0)
1156                           (const_int 0))
1157                       (label_ref (match_operand 0 "" ""))
1158                       (pc)))]
1159   ""
1160   "* return branch_or_jump (\"nz\", CODE_LABEL_NUMBER (operands[0]));
1161   ")
1162
1163 (define_insn "bgt"
1164   [(set (pc)
1165         (if_then_else (gt (cc0)
1166                           (const_int 0))
1167                       (label_ref (match_operand 0 "" ""))
1168                       (pc)))]
1169   ""
1170   "* return branch_or_jump (\"gt\", CODE_LABEL_NUMBER (operands[0]));
1171   ")
1172
1173 (define_insn "blt"
1174   [(set (pc)
1175         (if_then_else (lt (cc0)
1176                           (const_int 0))
1177                       (label_ref (match_operand 0 "" ""))
1178                       (pc)))]
1179   ""
1180   "* return branch_or_jump (\"lt\", CODE_LABEL_NUMBER (operands[0]));
1181   ")
1182
1183 (define_insn "bge"
1184   [(set (pc)
1185         (if_then_else (ge (cc0)
1186                           (const_int 0))
1187                       (label_ref (match_operand 0 "" ""))
1188                       (pc)))]
1189   ""
1190   "* return branch_or_jump (\"ge\", CODE_LABEL_NUMBER (operands[0]));
1191   ")
1192
1193 (define_insn "ble"
1194   [(set (pc)
1195         (if_then_else (le (cc0)
1196                           (const_int 0))
1197                       (label_ref (match_operand 0 "" ""))
1198                       (pc)))]
1199   ""
1200   "* return branch_or_jump (\"le\", CODE_LABEL_NUMBER (operands[0]));
1201   ")
1202
1203
1204 ; no unsigned branches available on 1750. But GCC still needs them, so faking:
1205
1206 (define_insn "bgtu"
1207   [(set (pc)
1208         (if_then_else (gtu (cc0)
1209                           (const_int 0))
1210                       (label_ref (match_operand 0 "" ""))
1211                       (pc)))]
1212   ""
1213   "jc gt,%l0 ; Warning: this should be an *unsigned* test!")
1214
1215 (define_insn "bltu"
1216   [(set (pc)
1217         (if_then_else (ltu (cc0)
1218                           (const_int 0))
1219                       (label_ref (match_operand 0 "" ""))
1220                       (pc)))]
1221   ""
1222   "jc lt,%l0 ; Warning: this should be an *unsigned* test!")
1223
1224 (define_insn "bgeu"
1225   [(set (pc)
1226         (if_then_else (geu (cc0)
1227                           (const_int 0))
1228                       (label_ref (match_operand 0 "" ""))
1229                       (pc)))]
1230   ""
1231   "jc ge,%l0 ; Warning: this should be an *unsigned* test!")
1232
1233 (define_insn "bleu"
1234   [(set (pc)
1235         (if_then_else (leu (cc0)
1236                           (const_int 0))
1237                       (label_ref (match_operand 0 "" ""))
1238                       (pc)))]
1239   ""
1240   "jc le,%l0 ; Warning: this should be an *unsigned* test!")
1241
1242
1243 ;; Negated conditional jump instructions.
1244
1245 (define_insn ""
1246   [(set (pc)
1247         (if_then_else (eq (cc0)
1248                           (const_int 0))
1249                       (pc)
1250                       (label_ref (match_operand 0 "" ""))))]
1251   ""
1252   "* return branch_or_jump (\"nz\", CODE_LABEL_NUMBER (operands[0]));
1253   ")
1254
1255 (define_insn ""
1256   [(set (pc)
1257         (if_then_else (ne (cc0)
1258                           (const_int 0))
1259                       (pc)
1260                       (label_ref (match_operand 0 "" ""))))]
1261   ""
1262   "* return branch_or_jump (\"ez\", CODE_LABEL_NUMBER (operands[0]));
1263   ")
1264
1265 (define_insn ""
1266   [(set (pc)
1267         (if_then_else (gt (cc0)
1268                           (const_int 0))
1269                       (pc)
1270                       (label_ref (match_operand 0 "" ""))))]
1271   ""
1272   "* return branch_or_jump (\"le\", CODE_LABEL_NUMBER (operands[0]));
1273   ")
1274
1275 (define_insn ""
1276   [(set (pc)
1277         (if_then_else (lt (cc0)
1278                           (const_int 0))
1279                       (pc)
1280                       (label_ref (match_operand 0 "" ""))))]
1281   ""
1282   "* return branch_or_jump (\"ge\", CODE_LABEL_NUMBER (operands[0]));
1283   ")
1284
1285 (define_insn ""
1286   [(set (pc)
1287         (if_then_else (ge (cc0)
1288                           (const_int 0))
1289                       (pc)
1290                       (label_ref (match_operand 0 "" ""))))]
1291   ""
1292   "* return branch_or_jump (\"lt\", CODE_LABEL_NUMBER (operands[0]));
1293   ")
1294
1295 (define_insn ""
1296   [(set (pc)
1297         (if_then_else (le (cc0)
1298                           (const_int 0))
1299                       (pc)
1300                       (label_ref (match_operand 0 "" ""))))]
1301   ""
1302   "* return branch_or_jump (\"gt\", CODE_LABEL_NUMBER (operands[0]));
1303   ")
1304
1305
1306 ;; Negated unsigned conditional jump instructions (faked for 1750).
1307
1308 (define_insn ""
1309   [(set (pc)
1310         (if_then_else (gtu (cc0)
1311                           (const_int 0))
1312                       (pc)
1313                       (label_ref (match_operand 0 "" ""))))]
1314   ""
1315   "jc le,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1316
1317 (define_insn ""
1318   [(set (pc)
1319         (if_then_else (ltu (cc0)
1320                           (const_int 0))
1321                       (pc)
1322                       (label_ref (match_operand 0 "" ""))))]
1323   ""
1324   "jc ge,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1325
1326 (define_insn ""
1327   [(set (pc)
1328         (if_then_else (geu (cc0)
1329                           (const_int 0))
1330                       (pc)
1331                       (label_ref (match_operand 0 "" ""))))]
1332   ""
1333   "jc lt,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1334
1335 (define_insn ""
1336   [(set (pc)
1337         (if_then_else (leu (cc0)
1338                           (const_int 0))
1339                       (pc)
1340                       (label_ref (match_operand 0 "" ""))))]
1341   ""
1342   "jc gt,%l0 ;inv.cond. ;Warning: this should be an *unsigned* test!")
1343
1344 ;; Tablejump 
1345 ;; 1750 note: CASE_VECTOR_PC_RELATIVE is not defined
1346 (define_insn "tablejump"
1347   [(set (pc)
1348         (match_operand:QI 0 "register_operand" "b"))
1349    (use (label_ref (match_operand 1 "" "")))]
1350   ""
1351   "jc 15,0,r%0   ; tablejump label_ref=%1")
1352
1353
1354 ;; Unconditional jump
1355 (define_insn "jump"
1356   [(set (pc)
1357         (label_ref (match_operand 0 "" "")))]
1358   ""
1359   "jc 15,%0")
1360
1361 ;; Call subroutine, returning value in operand 0
1362 ;; (which must be a hard register).
1363 (define_insn "call_value"
1364   [(set (match_operand 0 "register_operand" "=r")
1365         (call (match_operand:QI 1 "memory_operand" "m")
1366               (match_operand:QI 2 "general_operand" "g")))]
1367   ;; Operand 2 not really used for 1750.
1368   ""
1369   "sjs r15,%1   ; return value in R0")
1370
1371 ;; Call subroutine with no return value.
1372
1373 ;;  Operand 1 not really used in MIL-STD-1750.
1374 (define_insn ""
1375   [(call (match_operand:QI 0 "memory_operand" "mp")
1376          (match_operand:QI 1 "general_operand" ""))]
1377   ""
1378   "sjs r15,%0   ; no return value")
1379
1380 ;;;;;;;;;;;; 1750: NOT READY YET.
1381 (define_insn "call"
1382   [(call (match_operand:QI 0 "" "")
1383          (match_operand:QI 1 "" ""))]
1384   ""
1385   "ANYCALL %0")
1386
1387 (define_insn "indirect_jump"
1388   [(set (pc) (match_operand:QI 0 "address_operand" "p"))]
1389   ""
1390   "jci 15,%0")
1391
1392 (define_insn "nop"
1393   [(const_int 0)]
1394   ""
1395   "nop")
1396
1397
1398 ;; Subtract One and Jump (if non-zero)
1399 (define_peephole 
1400   [(set (match_operand:QI 0 "register_operand" "=r")
1401         (plus:QI (match_operand:QI 1 "register_operand" "%0")
1402                  (match_operand:QI 2 "immediate_operand" "J")))
1403    (set (cc0) (match_dup 0))
1404    (set (pc)
1405         (if_then_else (ne (cc0) (const_int 0))
1406          (label_ref (match_operand 3 "" ""))
1407          (pc)))
1408    ]
1409   "INTVAL(operands[2]) == -1"
1410   "soj r%0,%3")
1411
1412 ;; Combine a Load Register with subsequent increment/decrement into a LIM
1413 (define_peephole 
1414   [(set (match_operand:QI 0 "register_operand" "=r")
1415         (match_operand:QI 1 "register_operand" "b"))
1416    (set (match_dup 0)
1417         (plus:QI (match_dup 0)
1418                  (match_operand:QI 2 "immediate_operand" "i")))]
1419   "REGNO(operands[1]) > 0"
1420   "lim r%0,%2,r%1  ; LR,inc/dec peephole")
1421
1422 ;; Eliminate the redundant load in a store/load sequence
1423 (define_peephole 
1424   [(set (mem:QI (plus:QI (match_operand:QI 0 "register_operand" "r")
1425                           (match_operand:QI 1 "immediate_operand" "i")))
1426         (match_operand:QI 2 "register_operand" "r"))
1427    (set (match_operand:QI 3 "register_operand" "=r")
1428         (mem:QI (plus:QI (match_dup 0)
1429                          (match_dup 1))))
1430    ]
1431   "REGNO(operands[2]) == REGNO(operands[3])"
1432   "st r%2,%1,r%0  ; eliminated previous redundant load")
1433
1434 ;;;End.