1 ;;- Machine description for GNU compiler, Elxsi Version
2 ;; Copyright (C) 1987, 1988, 1992, 1994, 2000 Free Software Foundation, Inc.
3 ;; Contributed by Mike Stump <mrs@cygnus.com> in 1988, and is the first
4 ;; 64 bit port of GNU CC.
5 ;; Based upon the VAX port.
7 ;; This file is part of GNU CC.
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 1, or (at your option)
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.
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.
25 ;;- Instruction patterns. When multiple patterns apply,
26 ;;- the first one in the file is chosen.
28 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
30 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
31 ;;- updates for most instructions.
37 (match_operand:SI 0 "general_operand" "g")))]
43 (plus:SI (match_operand:SI 0 "general_operand" "g")
49 [(set (match_operand:SI 0 "register_operand" "=r")
51 (match_operand:SI 1 "general_operand" "g")))]
53 "ld.32\\t%0,.sp\;add.64\\t%0,%1")
56 [(set (match_operand:SI 0 "register_operand" "=r")
57 (plus:SI (match_operand:SI 1 "general_operand" "g")
60 "ld.32\\t%0,.sp\;add.64\\t%0,%1")
65 (match_operand:SI 0 "general_operand" "g")))]
71 (match_operand:SI 0 "general_operand" "rm"))]
76 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,r")
83 ; tstdi is first test insn so that it is the one to match
84 ; a constant argument.
88 (match_operand:DI 0 "register_operand" "r"))]
91 extern rtx cmp_op0, cmp_op1;
92 cmp_op0=operands[0]; cmp_op1=0;
93 return \";\\ttstdi\\t%0\";
98 (match_operand:DF 0 "register_operand" "r"))]
101 extern rtx cmp_op0, cmp_op1;
102 cmp_op0=operands[0]; cmp_op1=0;
103 return \";\\ttstdf\\t%0\";
108 (match_operand:SF 0 "register_operand" "r"))]
111 extern rtx cmp_op0, cmp_op1;
112 cmp_op0=operands[0]; cmp_op1=0;
113 return \";\\ttstsf\\t%0\";
118 (compare (match_operand:DI 0 "register_operand" "r")
119 (match_operand:DI 1 "general_operand" "rm")))]
122 extern rtx cmp_op0, cmp_op1;
123 cmp_op0=operands[0]; cmp_op1=operands[1];
124 return \";\\tcmpdi\\t%0,%1\";
129 (compare (match_operand:DF 0 "register_operand" "r")
130 (match_operand:DF 1 "general_operand" "rm")))]
133 extern rtx cmp_op0, cmp_op1;
134 cmp_op0=operands[0]; cmp_op1=operands[1];
135 return \";\\tcmpdf\\t%0,%1\";
140 (compare (match_operand:SF 0 "register_operand" "r")
141 (match_operand:SF 1 "general_operand" "rm")))]
144 extern rtx cmp_op0, cmp_op1;
145 cmp_op0=operands[0]; cmp_op1=operands[1];
146 return \";\\tcmpsf\\t%0,%1\";
150 [(set (match_operand:DI 0 "register_operand" "=r")
151 (eq (match_operand:DI 1 "register_operand" "r")
152 (match_operand:DI 2 "general_operand" "g")))]
154 "cmp.64\\t%0,%1,%2:eq")
157 [(set (match_operand:DI 0 "register_operand" "=r")
158 (ne (match_operand:DI 1 "register_operand" "r")
159 (match_operand:DI 2 "general_operand" "g")))]
161 "cmp.64\\t%0,%1,%2:ne")
164 [(set (match_operand:DI 0 "register_operand" "=r")
165 (le (match_operand:DI 1 "register_operand" "r")
166 (match_operand:DI 2 "general_operand" "g")))]
168 "cmp.64\\t%0,%1,%2:le")
171 [(set (match_operand:DI 0 "register_operand" "=r")
172 (leu (match_operand:DI 1 "register_operand" "r")
173 (match_operand:DI 2 "general_operand" "g")))]
175 "cmpu.64\\t%0,%1,%2:le")
178 [(set (match_operand:DI 0 "register_operand" "=r")
179 (lt (match_operand:DI 1 "register_operand" "r")
180 (match_operand:DI 2 "general_operand" "g")))]
182 "cmp.64\\t%0,%1,%2:lt")
185 [(set (match_operand:DI 0 "register_operand" "=r")
186 (ltu (match_operand:DI 1 "register_operand" "r")
187 (match_operand:DI 2 "general_operand" "g")))]
189 "cmpu.64\\t%0,%1,%2:lt")
192 [(set (match_operand:DI 0 "register_operand" "=r")
193 (ge (match_operand:DI 1 "register_operand" "r")
194 (match_operand:DI 2 "general_operand" "g")))]
196 "cmp.64\\t%0,%1,%2:ge")
199 [(set (match_operand:DI 0 "register_operand" "=r")
200 (geu (match_operand:DI 1 "register_operand" "r")
201 (match_operand:DI 2 "general_operand" "g")))]
203 "cmpu.64\\t%0,%1,%2:ge")
206 [(set (match_operand:DI 0 "register_operand" "=r")
207 (gt (match_operand:DI 1 "register_operand" "r")
208 (match_operand:DI 2 "general_operand" "g")))]
210 "cmp.64\\t%0,%1,%2:gt")
213 [(set (match_operand:DI 0 "register_operand" "=r")
214 (gtu (match_operand:DI 1 "register_operand" "r")
215 (match_operand:DI 2 "general_operand" "g")))]
217 "cmpu.64\\t%0,%1,%2:gt")
220 [(set (match_operand:DI 0 "register_operand" "=r")
221 (eq (cc0) (const_int 0)))]
223 "* return cmp_set(\"\", \"eq\", operands[0]); ")
226 [(set (match_operand:DI 0 "register_operand" "=r")
227 (ne (cc0) (const_int 0)))]
229 "* return cmp_set(\"\", \"ne\", operands[0]); ")
232 [(set (match_operand:DI 0 "register_operand" "=r")
233 (le (cc0) (const_int 0)))]
235 "* return cmp_set(\"\", \"le\", operands[0]); ")
238 [(set (match_operand:DI 0 "register_operand" "=r")
239 (leu (cc0) (const_int 0)))]
241 "* return cmp_set(\"u\", \"le\", operands[0]); ")
244 [(set (match_operand:DI 0 "register_operand" "=r")
245 (lt (cc0) (const_int 0)))]
247 "* return cmp_set(\"\", \"lt\", operands[0]); ")
250 [(set (match_operand:DI 0 "register_operand" "=r")
251 (ltu (cc0) (const_int 0)))]
253 "* return cmp_set(\"u\", \"lt\", operands[0]); ")
256 [(set (match_operand:DI 0 "register_operand" "=r")
257 (ge (cc0) (const_int 0)))]
259 "* return cmp_set(\"\", \"ge\", operands[0]); ")
262 [(set (match_operand:DI 0 "register_operand" "=r")
263 (geu (cc0) (const_int 0)))]
265 "* return cmp_set(\"u\", \"ge\", operands[0]); ")
268 [(set (match_operand:DI 0 "register_operand" "=r")
269 (gt (cc0) (const_int 0)))]
271 "* return cmp_set(\"\", \"gt\", operands[0]); ")
274 [(set (match_operand:DI 0 "register_operand" "=r")
275 (gtu (cc0) (const_int 0)))]
277 "* return cmp_set(\"u\", \"gt\", operands[0]); ")
280 [(set (match_operand:SI 0 "register_operand" "=r")
281 (eq (match_operand:SI 1 "register_operand" "r")
282 (match_operand:SI 2 "general_operand" "m")))]
284 "cmp.32\\t%0,%1,%2:eq")
287 [(set (match_operand:SI 0 "register_operand" "=r")
288 (ne (match_operand:SI 1 "register_operand" "r")
289 (match_operand:SI 2 "general_operand" "m")))]
291 "cmp.32\\t%0,%1,%2:ne")
294 [(set (match_operand:SI 0 "register_operand" "=r")
295 (le (match_operand:SI 1 "register_operand" "r")
296 (match_operand:SI 2 "general_operand" "m")))]
298 "cmp.32\\t%0,%1,%2:le")
301 [(set (match_operand:SI 0 "register_operand" "=r")
302 (leu (match_operand:SI 1 "register_operand" "r")
303 (match_operand:SI 2 "general_operand" "m")))]
305 "cmpu.32\\t%0,%1,%2:le")
308 [(set (match_operand:SI 0 "register_operand" "=r")
309 (lt (match_operand:SI 1 "register_operand" "r")
310 (match_operand:SI 2 "general_operand" "m")))]
312 "cmp.32\\t%0,%1,%2:lt")
315 [(set (match_operand:SI 0 "register_operand" "=r")
316 (ltu (match_operand:SI 1 "register_operand" "r")
317 (match_operand:SI 2 "general_operand" "m")))]
319 "cmpu.32\\t%0,%1,%2:lt")
322 [(set (match_operand:SI 0 "register_operand" "=r")
323 (ge (match_operand:SI 1 "register_operand" "r")
324 (match_operand:SI 2 "general_operand" "m")))]
326 "cmp.32\\t%0,%1,%2:ge")
329 [(set (match_operand:SI 0 "register_operand" "=r")
330 (geu (match_operand:SI 1 "register_operand" "r")
331 (match_operand:SI 2 "general_operand" "m")))]
333 "cmpu.32\\t%0,%1,%2:ge")
336 [(set (match_operand:SI 0 "register_operand" "=r")
337 (gt (match_operand:SI 1 "register_operand" "r")
338 (match_operand:SI 2 "general_operand" "m")))]
340 "cmp.32\\t%0,%1,%2:gt")
343 [(set (match_operand:SI 0 "register_operand" "=r")
344 (gtu (match_operand:SI 1 "register_operand" "r")
345 (match_operand:SI 2 "general_operand" "m")))]
347 "cmpu.32\\t%0,%1,%2:gt")
350 [(set (match_operand:HI 0 "register_operand" "=r")
351 (eq (match_operand:HI 1 "register_operand" "r")
352 (match_operand:HI 2 "general_operand" "m")))]
354 "cmp.16\\t%0,%1,%2:eq")
357 [(set (match_operand:HI 0 "register_operand" "=r")
358 (ne (match_operand:HI 1 "register_operand" "r")
359 (match_operand:HI 2 "general_operand" "m")))]
361 "cmp.16\\t%0,%1,%2:ne")
364 [(set (match_operand:HI 0 "register_operand" "=r")
365 (le (match_operand:HI 1 "register_operand" "r")
366 (match_operand:HI 2 "general_operand" "m")))]
368 "cmp.16\\t%0,%1,%2:le")
371 [(set (match_operand:HI 0 "register_operand" "=r")
372 (leu (match_operand:HI 1 "register_operand" "r")
373 (match_operand:HI 2 "general_operand" "m")))]
375 "cmpu.16\\t%0,%1,%2:le")
378 [(set (match_operand:HI 0 "register_operand" "=r")
379 (lt (match_operand:HI 1 "register_operand" "r")
380 (match_operand:HI 2 "general_operand" "m")))]
382 "cmp.16\\t%0,%1,%2:lt")
385 [(set (match_operand:HI 0 "register_operand" "=r")
386 (ltu (match_operand:HI 1 "register_operand" "r")
387 (match_operand:HI 2 "general_operand" "m")))]
389 "cmpu.16\\t%0,%1,%2:lt")
392 [(set (match_operand:HI 0 "register_operand" "=r")
393 (ge (match_operand:HI 1 "register_operand" "r")
394 (match_operand:HI 2 "general_operand" "m")))]
396 "cmp.16\\t%0,%1,%2:ge")
399 [(set (match_operand:HI 0 "register_operand" "=r")
400 (geu (match_operand:HI 1 "register_operand" "r")
401 (match_operand:HI 2 "general_operand" "m")))]
403 "cmpu.16\\t%0,%1,%2:ge")
406 [(set (match_operand:HI 0 "register_operand" "=r")
407 (gt (match_operand:HI 1 "register_operand" "r")
408 (match_operand:HI 2 "general_operand" "m")))]
410 "cmp.16\\t%0,%1,%2:gt")
413 [(set (match_operand:HI 0 "register_operand" "=r")
414 (gtu (match_operand:HI 1 "register_operand" "r")
415 (match_operand:HI 2 "general_operand" "m")))]
417 "cmpu.16\\t%0,%1,%2:gt")
420 [(set (match_operand:QI 0 "register_operand" "=r")
421 (eq (match_operand:QI 1 "register_operand" "r")
422 (match_operand:QI 2 "general_operand" "m")))]
424 "cmp.8\\t%0,%1,%2:eq")
427 [(set (match_operand:QI 0 "register_operand" "=r")
428 (ne (match_operand:QI 1 "register_operand" "r")
429 (match_operand:QI 2 "general_operand" "m")))]
431 "cmp.8\\t%0,%1,%2:ne")
434 [(set (match_operand:QI 0 "register_operand" "=r")
435 (le (match_operand:QI 1 "register_operand" "r")
436 (match_operand:QI 2 "general_operand" "m")))]
438 "cmp.8\\t%0,%1,%2:le")
441 [(set (match_operand:QI 0 "register_operand" "=r")
442 (leu (match_operand:QI 1 "register_operand" "r")
443 (match_operand:QI 2 "general_operand" "m")))]
445 "cmpu.8\\t%0,%1,%2:le")
448 [(set (match_operand:QI 0 "register_operand" "=r")
449 (lt (match_operand:QI 1 "register_operand" "r")
450 (match_operand:QI 2 "general_operand" "m")))]
452 "cmp.8\\t%0,%1,%2:lt")
455 [(set (match_operand:QI 0 "register_operand" "=r")
456 (ltu (match_operand:QI 1 "register_operand" "r")
457 (match_operand:QI 2 "general_operand" "m")))]
459 "cmpu.8\\t%0,%1,%2:lt")
462 [(set (match_operand:QI 0 "register_operand" "=r")
463 (ge (match_operand:QI 1 "register_operand" "r")
464 (match_operand:QI 2 "general_operand" "m")))]
466 "cmp.8\\t%0,%1,%2:ge")
469 [(set (match_operand:QI 0 "register_operand" "=r")
470 (geu (match_operand:QI 1 "register_operand" "r")
471 (match_operand:QI 2 "general_operand" "m")))]
473 "cmpu.8\\t%0,%1,%2:ge")
476 [(set (match_operand:QI 0 "register_operand" "=r")
477 (gt (match_operand:QI 1 "register_operand" "r")
478 (match_operand:QI 2 "general_operand" "m")))]
480 "cmp.8\\t%0,%1,%2:gt")
483 [(set (match_operand:QI 0 "register_operand" "=r")
484 (gtu (match_operand:QI 1 "register_operand" "r")
485 (match_operand:QI 2 "general_operand" "m")))]
487 "cmpu.8\\t%0,%1,%2:gt")
491 (define_insn "movdf" [(set (match_operand:DF 0 "general_operand" "=r,m")
492 (match_operand:DF 1 "general_operand" "rm,r"))]
496 if (which_alternative == 0)
497 return \"ld.64\\t%0,%1\";
498 return \"st.64\\t%1,%0\";
502 [(set (match_operand:SF 0 "general_operand" "=r,m")
503 (match_operand:SF 1 "general_operand" "rm,r"))]
507 if (which_alternative == 0)
508 return \"ld.32\\t%0,%1\";
509 return \"st.32\\t%1,%0\";
513 [(set (match_operand:DI 0 "general_operand" "=r,m,rm")
514 (match_operand:DI 1 "general_operand" "g,r,I"))]
517 if (which_alternative == 0)
518 return \"ld.64\\t%0,%1\";
519 else if (which_alternative == 1)
520 return \"st.64\\t%1,%0\";
522 if (GET_CODE(operands[1])==CONST_INT) {
523 if (INTVAL(operands[1]) >= 0)
524 return \"sti.64\\t%c1,%0\";
526 return \"stin.64\\t%n1,%0\";
533 [(set (match_operand:SI 0 "general_operand" "=r,m,r")
534 (match_operand:SI 1 "general_operand" "rm,rI,i"))]
537 if (which_alternative == 0)
538 return \"ld.32\\t%0,%1\";
539 else if (which_alternative == 1) {
540 if (GET_CODE(operands[1])==CONST_INT) {
541 if (INTVAL(operands[1]) >= 0)
542 return \"sti.32\\t%c1,%0\";
544 return \"stin.32\\t%n1,%0\";
546 return \"st.32\\t%1,%0\";
548 return \"ld.64\\t%0,%1 ; I only want 32\";
552 [(set (match_operand:HI 0 "general_operand" "=r,m,r")
553 (match_operand:HI 1 "general_operand" "m,rI,ri"))]
557 if (which_alternative == 0)
558 return \"ld.16\\t%0,%1\";
559 if (which_alternative == 2)
560 return \"ld.64\\t%0,%1\\t; I only want 16\";
561 if (GET_CODE(operands[1])==CONST_INT) {
562 if (INTVAL(operands[1]) >= 0)
563 return \"sti.16\\t%c1,%0\";
565 return \"stin.16\\t%n1,%0\";
567 return \"st.16\\t%1,%0\";
571 [(set (match_operand:QI 0 "general_operand" "=r,m,r")
572 (match_operand:QI 1 "general_operand" "m,rI,ri"))]
576 if (which_alternative == 0)
577 return \"ld.8\\t%0,%1\";
578 if (which_alternative == 2)
579 return \"ld.64\\t%0,%1\\t; I only want 8\";
580 if (GET_CODE(operands[1])==CONST_INT) {
581 if (INTVAL(operands[1]) >= 0)
582 return \"sti.8\\t%c1,%0\";
584 return \"stin.8\\t%n1,%0\";
586 return \"st.8\\t%1,%0\";
589 ;; Extension and truncation insns.
590 ;; Those for integer source operand
591 ;; are ordered widest source type first.
593 (define_insn "truncdfsf2"
594 [(set (match_operand:SF 0 "register_operand" "=r")
595 (truncate:SF (match_operand:DF 1 "general_operand" "rm")))]
599 (define_insn "truncdiqi2"
600 [(set (match_operand:QI 0 "general_operand" "=r,m,r")
601 (truncate:QI (match_operand:DI 1 "general_operand" "m,r,0")))]
605 if (which_alternative == 0)
606 return \"ld.8\\t%0,%1\";
607 else if (which_alternative == 1)
608 return \"st.8\\t%1,%0\";
612 (define_insn "truncdihi2"
613 [(set (match_operand:HI 0 "general_operand" "=r,m,r")
614 (truncate:HI (match_operand:DI 1 "general_operand" "m,r,0")))]
618 if (which_alternative == 0)
619 return \"ld.16\\t%0,%1\";
620 if (which_alternative == 1)
621 return \"st.16\\t%1,%0\";
625 (define_insn "truncdisi2"
626 [(set (match_operand:SI 0 "general_operand" "=r,m")
627 (truncate:SI (match_operand:DI 1 "general_operand" "rm,r")))]
631 if (which_alternative == 0)
632 return \"ld.32\\t%0,%1\";
633 return \"st.32\\t%1,%0\";
636 (define_insn "truncsiqi2"
637 [(set (match_operand:QI 0 "general_operand" "=r,m,r")
638 (truncate:QI (match_operand:SI 1 "general_operand" "m,r,0")))]
642 if (which_alternative == 0)
643 return \"ld.8\\t%0,%1\";
644 if (which_alternative == 1)
645 return \"st.8\\t%1,%0\";
649 (define_insn "truncsihi2"
650 [(set (match_operand:HI 0 "general_operand" "=r,m,r")
651 (truncate:HI (match_operand:SI 1 "general_operand" "m,r,0")))]
655 if (which_alternative == 0)
656 return \"ld.16\\t%0,%1\";
657 if (which_alternative == 1)
658 return \"st.16\\t%1,%0\";
662 (define_insn "trunchiqi2"
663 [(set (match_operand:QI 0 "general_operand" "=r,m,r")
664 (truncate:QI (match_operand:HI 1 "general_operand" "m,r,0")))]
668 if (which_alternative == 0)
669 return \"ld.8\\t%0,%1\";
670 if (which_alternative == 1)
671 return \"st.8\\t%1,%0\";
675 (define_insn "extendsfdf2"
676 [(set (match_operand:DF 0 "register_operand" "=r")
677 (sign_extend:DF (match_operand:SF 1 "general_operand" "rm")))]
681 (define_insn "extendsidi2"
682 [(set (match_operand:DI 0 "register_operand" "=r")
683 (sign_extend:DI (match_operand:SI 1 "general_operand" "rm")))]
687 (define_insn "extendhisi2"
688 [(set (match_operand:SI 0 "register_operand" "=r,r")
689 (sign_extend:SI (match_operand:HI 1 "general_operand" "m,r")))]
692 if (which_alternative==0)
693 return \"ld.16\\t%0,%1\";
694 return \"extract\\t%0,%1:bit 48,16\";
697 (define_insn "extendhidi2"
698 [(set (match_operand:DI 0 "register_operand" "=r,r")
699 (sign_extend:DI (match_operand:HI 1 "general_operand" "m,r")))]
702 if (which_alternative==0)
703 return \"ld.16\\t%0,%1\";
704 return \"extract\\t%0,%1:bit 48,16\";
707 (define_insn "extendqihi2"
708 [(set (match_operand:HI 0 "register_operand" "=r,r")
709 (sign_extend:HI (match_operand:QI 1 "general_operand" "m,r")))]
712 if (which_alternative==0)
713 return \"ld.8\\t%0,%1\";
714 return \"extract\\t%0,%1:bit 56,8\";
717 (define_insn "extendqisi2"
718 [(set (match_operand:SI 0 "register_operand" "=r,r")
719 (sign_extend:SI (match_operand:QI 1 "general_operand" "m,r")))]
722 if (which_alternative==0)
723 return \"ld.8\\t%0,%1\";
724 return \"extract\\t%0,%1:bit 56,8\";
727 (define_insn "extendqidi2"
728 [(set (match_operand:DI 0 "register_operand" "=r,r")
729 (sign_extend:DI (match_operand:QI 1 "general_operand" "m,r")))]
732 if (which_alternative==0)
733 return \"ld.8\\t%0,%1\";
734 return \"extract\\t%0,%1:bit 56,8\";
737 (define_insn "zero_extendsidi2"
738 [(set (match_operand:DI 0 "register_operand" "=r")
739 (zero_extend:DI (match_operand:SI 1 "general_operand" "rm")))]
744 (define_insn "zero_extendhisi2"
745 [(set (match_operand:SI 0 "register_operand" "=r,r")
746 (zero_extend:SI (match_operand:HI 1 "general_operand" "m,r")))]
749 if (which_alternative==0)
750 return \"ldz.16\\t%0,%1\";
751 return \"extractz\\t%0,%1:bit 48,16\";
754 (define_insn "zero_extendhidi2"
755 [(set (match_operand:DI 0 "register_operand" "=r,r")
756 (zero_extend:DI (match_operand:HI 1 "general_operand" "m,r")))]
759 if (which_alternative==0)
760 return \"ldz.16\\t%0,%1\";
761 return \"extractz\\t%0,%1:bit 48,16\";
764 (define_insn "zero_extendqihi2"
765 [(set (match_operand:HI 0 "register_operand" "=r,r")
766 (zero_extend:HI (match_operand:QI 1 "general_operand" "m,r")))]
769 if (which_alternative==0)
770 return \"ldz.8\\t%0,%1\";
771 return \"extractz\\t%0,%1:bit 56,8\";
774 (define_insn "zero_extendqisi2"
775 [(set (match_operand:SI 0 "register_operand" "=r,r")
776 (zero_extend:SI (match_operand:QI 1 "general_operand" "m,r")))]
779 if (which_alternative==0)
780 return \"ldz.8\\t%0,%1\";
781 return \"extractz\\t%0,%1:bit 56,8\";
784 (define_insn "zero_extendqidi2"
785 [(set (match_operand:DI 0 "register_operand" "=r,r")
786 (zero_extend:DI (match_operand:QI 1 "general_operand" "m,r")))]
789 if (which_alternative==0)
790 return \"ldz.8\\t%0,%1\";
791 return \"extractz\\t%0,%1:bit 56,8\";
795 (define_insn "ashrdi3"
796 [(set (match_operand:DI 0 "register_operand" "=r")
797 (ashiftrt:DI (match_operand:DI 1 "register_operand" "r")
798 (match_operand:SI 2 "general_operand" "rn")))]
802 (define_insn "lshrdi3"
803 [(set (match_operand:DI 0 "register_operand" "=r")
804 (lshiftrt:DI (match_operand:DI 1 "register_operand" "r")
805 (match_operand:SI 2 "general_operand" "rn")))]
809 (define_insn "ashldi3"
810 [(set (match_operand:DI 0 "register_operand" "=r")
811 (ashift:DI (match_operand:DI 1 "register_operand" "r")
812 (match_operand:SI 2 "general_operand" "rn")))]
816 (define_insn "anddi3"
817 [(set (match_operand:DI 0 "register_operand" "=r,r")
818 (and:DI (match_operand:DI 1 "general_operand" "%0,r")
819 (match_operand:DI 2 "general_operand" "g,g")))]
820 "1 /*which_alternative == 0 || check356(operands[2])*/"
822 if (which_alternative == 0)
823 return \"and\\t%0,%2\";
824 return \"and\\t%0,%1,%2\";
827 (define_insn "iordi3"
828 [(set (match_operand:DI 0 "register_operand" "=r,r")
829 (ior:DI (match_operand:DI 1 "general_operand" "%0,r")
830 (match_operand:DI 2 "general_operand" "g,g")))]
831 "1 /*which_alternative == 0 || check356(operands[2])*/"
833 if (which_alternative == 0)
834 return \"or\\t%0,%2\";
835 return \"or\\t%0,%1,%2\";
838 (define_insn "xordi3"
839 [(set (match_operand:DI 0 "register_operand" "=r,r")
840 (xor:DI (match_operand:DI 1 "general_operand" "%0,r")
841 (match_operand:DI 2 "general_operand" "g,g")))]
842 "1 /*which_alternative == 0 || check356(operands[2])*/"
844 if (which_alternative == 0)
845 return \"xor\\t%0,%2\";
846 return \"xor\\t%0,%1,%2\";
849 (define_insn "one_cmpldi2"
850 [(set (match_operand:DI 0 "register_operand" "=r")
851 (not:DI (match_operand:DI 1 "general_operand" "rm")))]
855 ;; gcc 2.1 does not widen ~si into ~di.
856 (define_insn "one_cmplsi2"
857 [(set (match_operand:SI 0 "register_operand" "=r")
858 (not:SI (match_operand:SI 1 "register_operand" "r")))]
862 (define_insn "negdi2"
863 [(set (match_operand:DI 0 "register_operand" "=r")
864 (neg:DI (match_operand:DI 1 "general_operand" "rm")))]
868 (define_insn "negsi2"
869 [(set (match_operand:SI 0 "register_operand" "=r,r")
870 (neg:SI (match_operand:SI 1 "general_operand" "m,r")))]
873 if (which_alternative == 0)
874 return \"neg.32\\t%0,%1\";
875 return \"neg.64\\t%0,%1 ; I only want 32\";
878 (define_insn "neghi2"
879 [(set (match_operand:HI 0 "register_operand" "=r,r")
880 (neg:HI (match_operand:HI 1 "general_operand" "m,r")))]
883 if (which_alternative == 0)
884 return \"neg.16\\t%0,%1\";
885 return \"neg.64\\t%0,%1 ; I only want 16\";
888 (define_insn "adddf3"
889 [(set (match_operand:DF 0 "register_operand" "=r")
890 (plus:DF (match_operand:DF 1 "general_operand" "%0")
891 (match_operand:DF 2 "general_operand" "rm")))]
895 (define_insn "addsf3"
896 [(set (match_operand:SF 0 "register_operand" "=r")
897 (plus:SF (match_operand:SF 1 "general_operand" "%0")
898 (match_operand:SF 2 "general_operand" "rm")))]
902 ;; There is also an addi.64 4,.r0'' optimization
903 (define_insn "adddi3"
904 [(set (match_operand:DI 0 "register_operand" "=r,r")
905 (plus:DI (match_operand:DI 1 "general_operand" "%0,r")
906 (match_operand:DI 2 "general_operand" "g,g")))]
907 "1 /*which_alternative == 0 || check356(operands[2])*/"
909 if (which_alternative == 0)
910 return \"add.64\\t%0,%2\";
911 return \"add.64\\t%0,%1,%2\";
914 (define_insn "addsi3"
915 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
916 (plus:SI (match_operand:SI 1 "general_operand" "%0,r,0")
917 (match_operand:SI 2 "general_operand" "m,m,g")))]
918 "1 /*which_alternative != 1 || check356(operands[2])*/"
920 if (which_alternative == 0)
921 return \"add.32\\t%0,%2\";
922 if (which_alternative == 1)
923 return \"add.32\\t%0,%1,%2\";
924 return \"add.64\\t%0,%2 ; I only want 32\";
927 (define_insn "addhi3"
928 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
929 (plus:HI (match_operand:HI 1 "general_operand" "%0,r,0")
930 (match_operand:HI 2 "general_operand" "m,m,g")))]
931 "1 /*which_alternative != 1 || check356(operands[2])*/"
933 if (which_alternative == 0)
934 return \"add.16\\t%0,%2\";
935 if (which_alternative == 1)
936 return \"add.16\\t%0,%1,%2\";
937 return \"add.64\\t%0,%2 ; I only want 16\";
940 (define_insn "subdf3"
941 [(set (match_operand:DF 0 "register_operand" "=r")
942 (minus:DF (match_operand:DF 1 "general_operand" "0")
943 (match_operand:DF 2 "general_operand" "rm")))]
947 (define_insn "subsf3"
948 [(set (match_operand:SF 0 "register_operand" "=r")
949 (minus:SF (match_operand:SF 1 "general_operand" "0")
950 (match_operand:SF 2 "general_operand" "rm")))]
954 (define_insn "subdi3"
955 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
956 (minus:DI (match_operand:DI 1 "general_operand" "0,g,r")
957 (match_operand:DI 2 "general_operand" "g,r,g")))]
958 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
960 if (which_alternative == 0)
961 return \"sub.64\\t%0,%2\";
962 else if (which_alternative == 1)
963 return \"subr.64\\t%0,%2,%1\";
965 return \"sub.64\\t%0,%1,%2\";
968 (define_insn "subsi3"
969 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
970 (minus:SI (match_operand:SI 1 "general_operand" "0,m,r,0")
971 (match_operand:SI 2 "general_operand" "m,r,m,g")))]
972 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
974 if (which_alternative == 0)
975 return \"sub.32\\t%0,%2\";
976 else if (which_alternative == 1)
977 return \"subr.32\\t%0,%2,%1\";
978 else if (which_alternative == 2)
979 return \"sub.32\\t%0,%1,%2\";
981 return \"sub.64\\t%0,%2 ; I only want 32\";
984 (define_insn "subhi3"
985 [(set (match_operand:HI 0 "register_operand" "=r,r,r,r")
986 (minus:HI (match_operand:HI 1 "general_operand" "0,m,r,0")
987 (match_operand:HI 2 "general_operand" "m,r,m,g")))]
988 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
990 if (which_alternative == 0)
991 return \"sub.16\\t%0,%2\";
992 else if (which_alternative == 1)
993 return \"subr.16\\t%0,%2,%1\";
994 else if (which_alternative == 2)
995 return \"sub.16\\t%0,%1,%2\";
997 return \"sub.64\\t%0,%2 ; I only want 16\";
1000 (define_insn "muldf3"
1001 [(set (match_operand:DF 0 "register_operand" "=r")
1002 (mult:DF (match_operand:DF 1 "general_operand" "%0")
1003 (match_operand:DF 2 "general_operand" "rm")))]
1007 (define_insn "mulsf3"
1008 [(set (match_operand:SF 0 "register_operand" "=r")
1009 (mult:SF (match_operand:SF 1 "general_operand" "%0")
1010 (match_operand:SF 2 "general_operand" "rm")))]
1014 (define_insn "muldi3"
1015 [(set (match_operand:DI 0 "register_operand" "=r,r")
1016 (mult:DI (match_operand:DI 1 "general_operand" "%0,r")
1017 (match_operand:DI 2 "general_operand" "g,g")))]
1018 "1 /*which_alternative == 0 || check356(operands[2])*/"
1020 if (which_alternative == 0)
1021 return \"mul.64\\t%0,%2\";
1022 return \"mul.64\\t%0,%1,%2\";
1025 (define_insn "mulsi3"
1026 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1027 (mult:SI (match_operand:SI 1 "general_operand" "%0,r,0")
1028 (match_operand:SI 2 "general_operand" "m,m,g")))]
1029 "1 /*which_alternative == 0 || check356(operands[2])*/"
1031 if (which_alternative == 0)
1032 return \"mul.32\\t%0,%2\";
1033 else if (which_alternative == 1)
1034 return \"mul.32\\t%0,%1,%2\";
1036 return \"mul.64\\t%0,%2 ; I only want 32\";
1039 (define_insn "mulhi3"
1040 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
1041 (mult:HI (match_operand:HI 1 "general_operand" "%0,r,0")
1042 (match_operand:HI 2 "general_operand" "m,m,g")))]
1043 "1 /*which_alternative == 0 || check356(operands[2])*/"
1045 if (which_alternative == 0)
1046 return \"mul.16\\t%0,%2\";
1047 else if (which_alternative == 1)
1048 return \"mul.16\\t%0,%1,%2\";
1050 return \"mul.64\\t%0,%2 ; I only want 16\";
1053 (define_insn "divdf3"
1054 [(set (match_operand:DF 0 "register_operand" "=r")
1055 (div:DF (match_operand:DF 1 "general_operand" "0")
1056 (match_operand:DF 2 "general_operand" "rm")))]
1060 (define_insn "divsf3"
1061 [(set (match_operand:SF 0 "register_operand" "=r")
1062 (div:SF (match_operand:SF 1 "general_operand" "0")
1063 (match_operand:SF 2 "general_operand" "rm")))]
1067 (define_insn "divdi3"
1068 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1069 (div:DI (match_operand:DI 1 "general_operand" "0,g,r")
1070 (match_operand:DI 2 "general_operand" "g,r,g")))]
1071 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
1073 if (which_alternative == 0)
1074 return \"div.64\\t%0,%2\";
1075 else if (which_alternative == 1)
1076 return \"divr.64\\t%0,%2,%1\";
1078 return \"div.64\\t%0,%1,%2\";
1081 (define_insn "divsi3"
1082 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1083 (div:SI (match_operand:SI 1 "general_operand" "0,m,r,0")
1084 (match_operand:SI 2 "general_operand" "m,r,m,g")))]
1085 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
1087 /* We don't ignore high bits. */
1089 if (which_alternative == 0)
1090 return \"div.32\\t%0,%2\";
1091 else if (which_alternative == 1)
1092 return \"divr.32\\t%0,%2,%1\";
1093 else if (which_alternative == 2)
1094 return \"div.32\\t%0,%1,%2\";
1096 return \"ld.32\\t%0,%0\;div.64\\t%0,%2 ; I only want 32\";
1098 if (which_alternative == 0)
1099 return \"ld.32\\t%0,%0\;div.32\\t%0,%2\";
1100 else if (which_alternative == 1)
1101 return \"ld.32\\t%2,%2\;divr.32\\t%0,%2,%1\";
1102 else if (which_alternative == 2)
1103 return \"ld.32\\t%1,%1\;div.32\\t%0,%1,%2\";
1105 return \"ld.32\\t%0,%0\;div.64\\t%0,%2 ; I only want 32\";
1109 (define_insn "divhi3"
1110 [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r")
1111 (div:HI (match_operand:HI 1 "general_operand" "0,m,r,0,0")
1112 (match_operand:HI 2 "general_operand" "m,r,m,r,i")))]
1113 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
1115 if (which_alternative == 0)
1116 return \"extract\\t%0,%0:bit 48,16\;div.16\\t%0,%2\";
1117 else if (which_alternative == 1)
1118 return \"extract\\t%2,%2:bit 48,16\;divr.16\\t%0,%2,%1\";
1119 else if (which_alternative == 2)
1120 return \"extract\\t%1,%1:bit 48,16\;div.16\\t%0,%1,%2\";
1121 else if (which_alternative == 3)
1122 return \"extract\\t%0,%0:bit 48,16\;extract\\t%2,%2:bit 48,16\;div.64\\t%0,%2 ; I only want 16\";
1124 return \"extract\\t%0,%0:bit 48,16\;div.64\\t%0,%2 ; I only want 16\";
1127 (define_insn "modhi3"
1128 [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r")
1129 (mod:HI (match_operand:HI 1 "general_operand" "0,m,r,0,0")
1130 (match_operand:HI 2 "general_operand" "m,r,m,r,i")))]
1131 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
1133 if (which_alternative == 0)
1134 return \"extract\\t%0,%0:bit 48,16\;rem.16\\t%0,%2\";
1135 else if (which_alternative == 1)
1136 return \"extract\\t%2,%2:bit 48,16\;remr.16\\t%0,%2,%1\";
1137 else if (which_alternative == 2)
1138 return \"extract\\t%1,%1:bit 48,16\;rem.16\\t%0,%1,%2\";
1139 else if (which_alternative == 3)
1140 return \"extract\\t%0,%0:bit 48,16\;extract\\t%2,%2:bit 48,16\;rem.64\\t%0,%2 ; I only want 16\";
1142 return \"extract\\t%0,%0:bit 48,16\;rem.64\\t%0,%2 ; I only want 16\";
1145 (define_insn "moddi3"
1146 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1147 (mod:DI (match_operand:DI 1 "general_operand" "0,g,r")
1148 (match_operand:DI 2 "general_operand" "g,r,g")))]
1149 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
1151 if (which_alternative == 0)
1152 return \"rem.64\\t%0,%2\";
1153 else if (which_alternative == 1)
1154 return \"remr.64\\t%0,%2,%1\";
1156 return \"rem.64\\t%0,%1,%2\";
1159 (define_insn "modsi3"
1160 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1161 (mod:SI (match_operand:SI 1 "general_operand" "0,m,r,0")
1162 (match_operand:SI 2 "general_operand" "m,r,m,g")))]
1163 "1 /*which_alternative == 0 || check356(operands[which_alternative])*/"
1165 /* There is a micro code bug with the below... */
1167 if (which_alternative == 0)
1168 return \"rem.32\\t%0,%2\";
1169 else if (which_alternative == 1)
1170 return \"remr.32\\t%0,%2,%1\";
1171 else if (which_alternative == 2)
1172 return \"rem.32\\t%0,%1,%2\";
1174 return \"ld.32\\t%0,%0\;rem.64\\t%0,%2 ; I only want 32\";
1176 if (which_alternative == 0)
1177 return \"ld.32\\t%0,%0\;rem.32\\t%0,%2\";
1178 else if (which_alternative == 1)
1179 return \"ld.32\\t%2,%2\;remr.32\\t%0,%2,%1\";
1180 else if (which_alternative == 2)
1181 return \"ld.32\\t%1,%1\;rem.32\\t%0,%1,%2\";
1183 return \"ld.32\\t%0,%0\;rem.64\\t%0,%2 ; I only want 32\";
1190 (label_ref (match_operand 0 "" "")))]
1194 (define_insn "indirect_jump"
1195 [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
1197 ;; Maybe %l0 is better, maybe we can relax register only.
1198 "verify this before use ld.32\\t.r0,%0\;br.reg\\t.r0")
1202 (if_then_else (eq (cc0)
1204 (label_ref (match_operand 0 "" ""))
1207 "* return cmp_jmp(\"\", 2, operands[0]); ")
1211 (if_then_else (ne (cc0)
1213 (label_ref (match_operand 0 "" ""))
1216 "* return cmp_jmp(\"\", 8, operands[0]); ")
1220 (if_then_else (gt (cc0)
1222 (label_ref (match_operand 0 "" ""))
1225 "* return cmp_jmp(\"\", 0, operands[0]); ")
1229 (if_then_else (gtu (cc0)
1231 (label_ref (match_operand 0 "" ""))
1234 "* return cmp_jmp(\"u\", 0, operands[0]); ")
1238 (if_then_else (lt (cc0)
1240 (label_ref (match_operand 0 "" ""))
1243 "* return cmp_jmp(\"\", 6, operands[0]); ")
1247 (if_then_else (ltu (cc0)
1249 (label_ref (match_operand 0 "" ""))
1252 "* return cmp_jmp(\"u\", 6, operands[0]); ")
1256 (if_then_else (ge (cc0)
1258 (label_ref (match_operand 0 "" ""))
1261 "* return cmp_jmp(\"\", 4, operands[0]); ")
1265 (if_then_else (geu (cc0)
1267 (label_ref (match_operand 0 "" ""))
1270 "* return cmp_jmp(\"u\", 4, operands[0]); ")
1274 (if_then_else (le (cc0)
1276 (label_ref (match_operand 0 "" ""))
1279 "* return cmp_jmp(\"\", 10, operands[0]); ")
1283 (if_then_else (leu (cc0)
1285 (label_ref (match_operand 0 "" ""))
1288 "* return cmp_jmp(\"u\", 10, operands[0]); ")
1292 (if_then_else (eq (cc0)
1295 (label_ref (match_operand 0 "" ""))))]
1297 "* return cmp_jmp(\"\", 8, operands[0]); ")
1301 (if_then_else (ne (cc0)
1304 (label_ref (match_operand 0 "" ""))))]
1306 "* return cmp_jmp(\"\", 2, operands[0]); ")
1310 (if_then_else (gt (cc0)
1313 (label_ref (match_operand 0 "" ""))))]
1315 "* return cmp_jmp(\"\", 10, operands[0]); ")
1319 (if_then_else (gtu (cc0)
1322 (label_ref (match_operand 0 "" ""))))]
1324 "* return cmp_jmp(\"u\", 10, operands[0]); ")
1328 (if_then_else (lt (cc0)
1331 (label_ref (match_operand 0 "" ""))))]
1333 "* return cmp_jmp(\"\", 4, operands[0]); ")
1337 (if_then_else (ltu (cc0)
1340 (label_ref (match_operand 0 "" ""))))]
1342 "* return cmp_jmp(\"u\", 4, operands[0]); ")
1346 (if_then_else (ge (cc0)
1349 (label_ref (match_operand 0 "" ""))))]
1351 "* return cmp_jmp(\"\", 6, operands[0]); ")
1355 (if_then_else (geu (cc0)
1358 (label_ref (match_operand 0 "" ""))))]
1360 "* return cmp_jmp(\"u\", 6, operands[0]); ")
1364 (if_then_else (le (cc0)
1367 (label_ref (match_operand 0 "" ""))))]
1369 "* return cmp_jmp(\"\", 0, operands[0]); ")
1373 (if_then_else (leu (cc0)
1376 (label_ref (match_operand 0 "" ""))))]
1378 "* return cmp_jmp(\"u\", 0, operands[0]); ")
1380 ;; Note that operand 1 is total size of args, in bytes,
1381 ;; and what the call insn wants is the number of words.
1383 [(call (match_operand:QI 0 "general_operand" "m")
1384 (match_operand:QI 1 "general_operand" "g"))]
1387 if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == REG)
1388 if (REGNO (XEXP (operands[0], 0)) != 0)
1389 return \"add.64\\t.sp,=-4\;ld.64\\t.r0,=.+11\;st.32\\t.r0,[.sp]\;br.reg\\t%r0\;add.64\\t.sp,=4\;add.64\\t.sp,%1\";
1391 return \"add.64\\t.sp,=-4\;ld.64\\t.r1,=.+11\;st.32\\t.r1,[.sp]\;br.reg\\t%r0\;add.64\\t.sp,=4\;add.64\\t.sp,%1\";
1393 return \"add.64\\t.sp,=-4\;call\\t%0\;add.64\\t.sp,=4\;add.64\\t.sp,%1\";
1396 (define_insn "call_value"
1397 [(set (match_operand 0 "" "")
1398 (call (match_operand:QI 1 "general_operand" "m")
1399 (match_operand:QI 2 "general_operand" "g")))]
1402 if (GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == REG)
1403 if (REGNO (XEXP (operands[1], 0)) != 0)
1404 return \"add.64\\t.sp,=-4\;ld.64\\t.r0,=.+11\;st.32\\t.r0,[.sp]\;br.reg\\t%r1\;add.64\\t.sp,=4\;add.64\\t.sp,%2\";
1406 return \"add.64\\t.sp,=-4\;ld.64\\t.r1,=.+11\;st.32\\t.r1,[.sp]\;br.reg\\t%r1\;add.64\\t.sp,=4\;add.64\\t.sp,%2\";
1408 return \"add.64\\t.sp,=-4\;call\\t%1\;add.64\\t.sp,=4\;add.64\\t.sp,%2\";
1411 (define_insn "tablejump"
1412 [(set (pc) (match_operand:SI 0 "register_operand" "r"))
1413 (use (label_ref (match_operand 1 "" "")))]