1 ;; Machine description for GNU compiler, picoJava Version
2 ;; Copyright (C) 2000 Free Software Foundation, Inc.
3 ;; Contributed by Steve Chamberlain, of Transmeta (sac@pobox.com).
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 2, 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, 59 Temple Place - Suite 330,
20 ;; Boston, MA 02111-1307, USA.
25 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
26 (match_operand:SI 1 "pj_source_operand" "gS"))]
31 [(set (match_operand:HI 0 "nonimmediate_operand" "=gD")
32 (match_operand:HI 1 "pj_source_operand" "gS"))]
37 [(set (match_operand:QI 0 "nonimmediate_operand" "=gD")
38 (match_operand:QI 1 "pj_source_operand" "gS"))]
43 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
44 (match_operand:DI 1 "pj_source_operand" "gS"))]
49 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
50 (match_operand:DF 1 "pj_source_operand" "gS"))]
55 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
56 (match_operand:SF 1 "pj_source_operand" "gS"))]
64 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
65 (plus:SI (match_operand:SI 1 "pj_source_operand" "%gS")
66 (match_operand:SI 2 "pj_source_operand" "gS")))]
68 "* return pj_output_addsi3 (operands);")
71 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
72 (plus:DI (match_operand:DI 1 "pj_source_operand" "%gS")
73 (match_operand:DI 2 "pj_source_operand" "gS")))]
78 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
79 (plus:SF (match_operand:SF 1 "pj_source_operand" "%gS")
80 (match_operand:SF 2 "pj_source_operand" "gS")))]
85 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
86 (plus:DF (match_operand:DF 1 "pj_source_operand" "%gS")
87 (match_operand:DF 2 "pj_source_operand" "gS")))]
92 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
93 (neg:SI (match_operand:SI 1 "pj_source_operand" "gS")))]
98 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
99 (neg:DI (match_operand:DI 1 "pj_source_operand" "gS")))]
103 (define_insn "negsf2"
104 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
105 (neg:SF (match_operand:SF 1 "pj_source_operand" "gS")))]
109 (define_insn "negdf2"
110 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
111 (neg:DF (match_operand:DF 1 "pj_source_operand" "gS")))]
115 (define_insn "subsi3"
116 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
117 (minus:SI (match_operand:SI 1 "pj_source_operand" "gS")
118 (match_operand:SI 2 "pj_source_operand" "gS")))]
122 (define_insn "subdi3"
123 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
124 (minus:DI (match_operand:DI 1 "pj_source_operand" "gS")
125 (match_operand:DI 2 "pj_source_operand" "gS")))]
129 (define_insn "subsf3"
130 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
131 (minus:SF (match_operand:SF 1 "pj_source_operand" "gS")
132 (match_operand:SF 2 "pj_source_operand" "gS")))]
136 (define_insn "subdf3"
137 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
138 (minus:DF (match_operand:DF 1 "pj_source_operand" "gS")
139 (match_operand:DF 2 "pj_source_operand" "gS")))]
143 (define_insn "divsi3"
144 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
145 (div:SI (match_operand:SI 1 "pj_source_operand" "gS")
146 (match_operand:SI 2 "pj_source_operand" "gS")))]
150 (define_insn "divdi3"
151 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
152 (div:DI (match_operand:DI 1 "pj_source_operand" "gS")
153 (match_operand:DI 2 "pj_source_operand" "gS")))]
157 (define_insn "divsf3"
158 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
159 (div:SF (match_operand:SF 1 "pj_source_operand" "gS")
160 (match_operand:SF 2 "pj_source_operand" "gS")))]
164 (define_insn "divdf3"
165 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
166 (div:DF (match_operand:DF 1 "pj_source_operand" "gS")
167 (match_operand:DF 2 "pj_source_operand" "gS")))]
171 (define_insn "udivsi3"
172 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
173 (udiv:SI (match_operand:SI 1 "pj_source_operand" "gS")
174 (match_operand:SI 2 "pj_source_operand" "gS")))]
176 "%P1%P2%*ldiv%*l2i%R0")
178 (define_insn "mulsi3"
179 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
180 (mult:SI (match_operand:SI 1 "pj_source_operand" "gS")
181 (match_operand:SI 2 "pj_source_operand" "gS")))]
185 (define_insn "muldi3"
186 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
187 (mult:DI (match_operand:DI 1 "pj_source_operand" "gS")
188 (match_operand:DI 2 "pj_source_operand" "gS")))]
192 (define_insn "muldf3"
193 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
194 (mult:DF (match_operand:DF 1 "pj_source_operand" "%gS")
195 (match_operand:DF 2 "pj_source_operand" "gS")))]
199 (define_insn "mulsf3"
200 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
201 (mult:SF (match_operand:SF 1 "pj_source_operand" "%gS")
202 (match_operand:SF 2 "pj_source_operand" "gS")))]
206 (define_insn "modsi3"
207 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
208 (mod:SI (match_operand:SI 1 "pj_source_operand" "gS")
209 (match_operand:SI 2 "pj_source_operand" "gS")))]
213 (define_insn "moddi3"
214 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
215 (mod:DI (match_operand:DI 1 "pj_source_operand" "gS")
216 (match_operand:DI 2 "pj_source_operand" "gS")))]
220 (define_insn "moddf3"
221 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
222 (mod:DF (match_operand:DF 1 "pj_source_operand" "gS")
223 (match_operand:DF 2 "pj_source_operand" "gS")))]
227 (define_insn "modsf3"
228 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
229 (mod:SF (match_operand:SF 1 "pj_source_operand" "gS")
230 (match_operand:SF 2 "pj_source_operand" "gS")))]
234 (define_insn "umodsi3"
235 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
236 (umod:SI (match_operand:SI 1 "pj_source_operand" "gS")
237 (match_operand:SI 2 "pj_source_operand" "gS")))]
239 "%P1%P2%*lrem%*l2i%R0")
242 ;; Logical operations.
244 (define_insn "andsi3"
245 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
246 (and:SI (match_operand:SI 1 "pj_source_operand" "%gS")
247 (match_operand:SI 2 "pj_source_operand" "gS")))]
251 (define_insn "anddi3"
252 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
253 (and:DI (match_operand:DI 1 "pj_source_operand" "%gS")
254 (match_operand:DI 2 "pj_source_operand" "gS")))]
258 (define_insn "iorsi3"
259 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
260 (ior:SI (match_operand:SI 1 "pj_source_operand" "%gS")
261 (match_operand:SI 2 "pj_source_operand" "gS")))]
265 (define_insn "iordi3"
266 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
267 (ior:DI (match_operand:DI 1 "pj_source_operand" "%gS")
268 (match_operand:DI 2 "pj_source_operand" "gS")))]
272 (define_insn "xorsi3"
273 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
274 (xor:SI (match_operand:SI 1 "pj_source_operand" "%gS")
275 (match_operand:SI 2 "pj_source_operand" "gS")))]
279 (define_insn "xordi3"
280 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
281 (xor:DI (match_operand:DI 1 "pj_source_operand" "%gS")
282 (match_operand:DI 2 "pj_source_operand" "gS")))]
286 (define_insn "one_cmplsi2"
287 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
288 (not:SI (match_operand:SI 1 "pj_source_operand" "gS")))]
290 "%S1%*iconst_m1%*ixor%R0")
292 (define_insn "one_cmpldi2"
293 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
294 (not:DI (match_operand:DI 1 "pj_source_operand" "gS")))]
296 "%S1%*iconst_m1%*iconst_m1%*lxor%R0")
299 ;; Shift instructions.
301 (define_insn "ashlsi3"
302 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
303 (ashift:SI (match_operand:SI 1 "pj_source_operand" "gS")
304 (match_operand:SI 2 "pj_source_operand" "gS")))]
309 (define_insn "ashldi3"
310 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
311 (ashift:DI (match_operand:DI 1 "pj_source_operand" "gS")
312 (match_operand:SI 2 "pj_source_operand" "gS")))]
316 (define_insn "ashrsi3"
317 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
318 (ashiftrt:SI (match_operand:SI 1 "pj_source_operand" "gS")
319 (match_operand:SI 2 "pj_source_operand" "gS")))]
323 (define_insn "ashrdi3"
324 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
325 (ashiftrt:DI (match_operand:DI 1 "pj_source_operand" "gS")
326 (match_operand:SI 2 "pj_source_operand" "gS")))]
330 (define_insn "lshrsi3"
331 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
332 (lshiftrt:SI (match_operand:SI 1 "pj_source_operand" "gS")
333 (match_operand:SI 2 "pj_source_operand" "gS")))]
337 (define_insn "lshrdi3"
338 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
339 (lshiftrt:DI (match_operand:DI 1 "pj_source_operand" "gS")
340 (match_operand:SI 2 "pj_source_operand" "gS")))]
347 (define_expand "cmpsi"
348 [(set (cc0) (compare (match_operand:SI 0 "pj_source_operand" "gS")
349 (match_operand:SI 1 "pj_source_operand" "gS")))]
352 pj_cmp_op0 = operands[0];
353 pj_cmp_op1 = operands[1];
354 pj_cmp_mode = SImode;
358 (define_expand "cmpdi"
359 [(set (cc0) (compare (match_operand:DI 0 "pj_source_operand" "gS")
360 (match_operand:DI 1 "pj_source_operand" "gS")))]
363 pj_cmp_op0 = operands[0];
364 pj_cmp_op1 = operands[1];
365 pj_cmp_mode = DImode;
369 (define_expand "cmpsf"
370 [(set (cc0) (compare (match_operand:SF 0 "pj_source_operand" "gS")
371 (match_operand:SF 1 "pj_source_operand" "gS")))]
374 pj_cmp_op0 = operands[0];
375 pj_cmp_op1 = operands[1];
376 pj_cmp_mode = SFmode;
380 (define_expand "cmpdf"
381 [(set (cc0) (compare (match_operand:DF 0 "pj_source_operand" "gS")
382 (match_operand:DF 1 "pj_source_operand" "gS")))]
385 pj_cmp_op0 = operands[0];
386 pj_cmp_op1 = operands[1];
387 pj_cmp_mode = DFmode;
394 (define_insn "truncsiqi2"
395 [(set (match_operand:QI 0 "nonimmediate_operand" "=gD")
396 (truncate:QI (match_operand:SI 1 "pj_source_operand" "gS")))]
400 (define_insn "truncsihi2"
401 [(set (match_operand:HI 0 "nonimmediate_operand" "=gD")
402 (truncate:HI (match_operand:SI 1 "pj_source_operand" "gS")))]
406 (define_insn "truncdisi2"
407 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
408 (truncate:SI (match_operand:DI 1 "pj_source_operand" "gS")))]
412 (define_insn "fix_truncsfsi2"
413 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
414 (fix:SI (match_operand:SF 1 "pj_source_operand" "gS")))]
418 (define_insn "fix_truncsfdi2"
419 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
420 (fix:DI (match_operand:SF 1 "pj_source_operand" "gS")))]
424 (define_insn "truncdfsf2"
425 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
426 (float_truncate:SF (match_operand:DF 1 "pj_source_operand" "gS")))]
430 (define_insn "fix_truncdfsi2"
431 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
432 (fix:SI (match_operand:DF 1 "pj_source_operand" "gS")))]
436 (define_insn "fix_truncdfdi2"
437 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
438 (fix:DI (match_operand:DF 1 "pj_source_operand" "gS")))]
442 (define_insn "floatsisf2"
443 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
444 (float:SF (match_operand:SI 1 "pj_source_operand" "gS")))]
448 (define_insn "floatsidf2"
449 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
450 (float:DF (match_operand:SI 1 "pj_source_operand" "gS")))]
454 (define_insn "floatdisf2"
455 [(set (match_operand:SF 0 "nonimmediate_operand" "=gD")
456 (float:SF (match_operand:DI 1 "pj_source_operand" "gS")))]
460 (define_insn "floatdidf2"
461 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
462 (float:DF (match_operand:DI 1 "pj_source_operand" "gS")))]
467 ;; Zero-extend move instructions.
469 (define_insn "zero_extendsidi2"
470 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
471 (zero_extend:DI (match_operand:SI 1 "pj_source_operand" "gS")))]
475 (define_insn "zero_extendhisi2"
476 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
477 (zero_extend:SI (match_operand:HI 1 "pj_source_operand" "gS")))]
481 (define_insn "zero_extendqisi2"
482 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
483 (zero_extend:SI (match_operand:QI 1 "pj_source_operand" "gS")))]
485 "%S1%*sipush 0xff%*iand%R0")
488 ;; Conditional branch instructions.
491 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
492 (label_ref (match_operand 0 "" ""))
495 "operands[3] = gen_rtx (EQ, pj_cmp_mode);
496 operands[1] = pj_cmp_op0;
497 operands[2] = pj_cmp_op1;")
500 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
501 (label_ref (match_operand 0 "" ""))
504 "operands[3] = gen_rtx (NE, pj_cmp_mode);
505 operands[1] = pj_cmp_op0;
506 operands[2] = pj_cmp_op1;")
509 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
510 (label_ref (match_operand 0 "" ""))
513 "operands[3] = gen_rtx (GT, pj_cmp_mode);
514 operands[1] = pj_cmp_op0;
515 operands[2] = pj_cmp_op1;")
518 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
519 (label_ref (match_operand 0 "" ""))
522 "operands[3] = gen_rtx (LT, pj_cmp_mode);
523 operands[1] = pj_cmp_op0;
524 operands[2] = pj_cmp_op1;")
527 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
528 (label_ref (match_operand 0 "" ""))
531 "operands[3] = gen_rtx (GE, pj_cmp_mode);
532 operands[1] = pj_cmp_op0;
533 operands[2] = pj_cmp_op1;")
536 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
537 (label_ref (match_operand 0 "" ""))
540 "operands[3] = gen_rtx (LE, pj_cmp_mode);
541 operands[1] = pj_cmp_op0;
542 operands[2] = pj_cmp_op1;")
544 (define_expand "bgtu"
545 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
546 (label_ref (match_operand 0 "" ""))
549 "operands[3] = gen_rtx (GTU, pj_cmp_mode);
550 operands[1] = pj_cmp_op0;
551 operands[2] = pj_cmp_op1;")
553 (define_expand "bltu"
554 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
555 (label_ref (match_operand 0 "" ""))
558 "operands[3] = gen_rtx (LTU, pj_cmp_mode);
559 operands[1] = pj_cmp_op0;
560 operands[2] = pj_cmp_op1;")
562 (define_expand "bgeu"
563 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
564 (label_ref (match_operand 0 "" ""))
567 "operands[3] = gen_rtx (GEU, pj_cmp_mode);
568 operands[1] = pj_cmp_op0;
569 operands[2] = pj_cmp_op1;")
571 (define_expand "bleu"
572 [(set (pc) (if_then_else (match_op_dup 3 [(match_dup 1) (match_dup 2)])
573 (label_ref (match_operand 0 "" ""))
576 "operands[3] = gen_rtx (LEU, pj_cmp_mode);
577 operands[1] = pj_cmp_op0;
578 operands[2] = pj_cmp_op1;")
581 [(set (pc) (if_then_else (match_operand:SI 0 "pj_source_operand" "gS")
582 (label_ref (match_operand 1 "" ""))
587 (define_insn "*rev_bop"
588 [(set (pc) (if_then_else (match_operand:SI 0 "pj_source_operand" "gS")
590 (label_ref (match_operand 1 "" ""))))]
595 (define_insn "*blopsi"
598 (match_operator:SI 3 "pj_signed_comparison_operator"
599 [(match_operand:SI 0 "pj_source_operand" "gS,gS")
600 (match_operand:SI 1 "pj_source_operand" "K,gS")])
601 (label_ref (match_operand 2 "" ""))
606 %S0%S1%*if_icmp%Y3 %2")
608 (define_insn "*rev_blopsi"
611 (match_operator:SI 3 "pj_signed_comparison_operator"
612 [(match_operand:SI 0 "pj_source_operand" "gS,gS")
613 (match_operand:SI 1 "pj_source_operand" "K,gS")])
615 (label_ref (match_operand 2 "" ""))))]
619 %S0%S1%*if_icmp%Z3 %2")
621 (define_insn "*bluopsi"
624 (match_operator:SI 3 "pj_unsigned_comparison_operator"
625 [(match_operand:SI 0 "pj_source_operand" "gS")
626 (match_operand:SI 1 "pj_source_operand" "gS")])
627 (label_ref (match_operand 2 "" ""))
630 "%S0%S1%*iucmp%*if%Y3 %2")
632 (define_insn "*rev_bluopsi"
635 (match_operator:SI 3 "pj_unsigned_comparison_operator"
636 [(match_operand:SI 0 "pj_source_operand" "gS")
637 (match_operand:SI 1 "pj_source_operand" "gS")])
639 (label_ref (match_operand 2 "" ""))))]
641 "%S0%S1%*iucmp%*if%Z3 %2")
643 (define_insn "*blopdi"
646 (match_operator:DI 3 "pj_signed_comparison_operator"
647 [(match_operand:DI 0 "pj_source_operand" "gS")
648 (match_operand:DI 1 "pj_source_operand" "gS")])
649 (label_ref (match_operand 2 "" ""))
652 "%D0%D1%*lcmp%*if%Y3 %2")
654 (define_insn "*rev_blopdi"
657 (match_operator:DI 3 "pj_signed_comparison_operator"
658 [(match_operand:DI 0 "pj_source_operand" "gS")
659 (match_operand:DI 1 "pj_source_operand" "gS")])
661 (label_ref (match_operand 2 "" ""))))]
663 "%D0%D1%*lcmp%*if%Z3 %2")
665 (define_insn "*bluopdi"
668 (match_operator:DI 3 "pj_unsigned_comparison_operator"
669 [(match_operand:DI 0 "pj_source_operand" "gS")
670 (match_operand:DI 1 "pj_source_operand" "gS")])
671 (label_ref (match_operand 2 "" ""))
674 "%D0%D1%*ipush __pjucmpdi2%*bipush 6%*call%*if%Y3 %2")
676 (define_insn "*rev_bluopdi"
679 (match_operator:DI 3 "pj_unsigned_comparison_operator"
680 [(match_operand:DI 0 "pj_source_operand" "gS")
681 (match_operand:DI 1 "pj_source_operand" "gS")])
683 (label_ref (match_operand 2 "" ""))))]
685 "%D0%D1%*ipush __pjucmpdi2%*bipush 6%*call%*if%Z3 %2")
687 (define_insn "*blopsf"
690 (match_operator:SF 3 "comparison_operator"
691 [(match_operand:SF 0 "pj_source_operand" "gS")
692 (match_operand:SF 1 "pj_source_operand" "gS")])
693 (label_ref (match_operand 2 "" ""))
696 "%S0%S1%*fcmp%X3%*if%Y3 %2")
698 (define_insn "*rev_bluopsf"
701 (match_operator:SF 3 "comparison_operator"
702 [(match_operand:SF 0 "pj_source_operand" "gS")
703 (match_operand:SF 1 "pj_source_operand" "gS")])
705 (label_ref (match_operand 2 "" ""))))]
707 "%S0%S1%*fcmp%X3%*if%Z3 %2")
709 (define_insn "*blopdf"
712 (match_operator:DF 3 "comparison_operator"
713 [(match_operand:DF 0 "pj_source_operand" "gS")
714 (match_operand:DF 1 "pj_source_operand" "gS")])
715 (label_ref (match_operand 2 "" ""))
718 "%D0%D1%*dcmp%X3%*if%Y3 %2")
720 (define_insn "*rev_bluopdf"
723 (match_operator:DF 3 "comparison_operator"
724 [(match_operand:DF 0 "pj_source_operand" "gS")
725 (match_operand:DF 1 "pj_source_operand" "gS")])
727 (label_ref (match_operand 2 "" ""))))]
729 "%D0%D1%*dcmp%X3%*if%Z3 %2")
734 (define_insn "pj_call"
735 [(call (mem:QI (match_operand:SI 0 "pj_source_operand" "gS"))
736 (match_operand:SI 1 "immediate_operand" "i"))]
738 "%C0%E1%S0%S1%*call")
740 (define_insn "pj_call_value"
741 [(set (match_operand 0 "nonimmediate_operand" "=gD")
742 (call (mem:QI (match_operand:SI 1 "pj_source_operand" "gS"))
743 (match_operand:SI 2 "immediate_operand" "i")))]
746 "%C1%E2%S1%S2%*call")
748 (define_expand "call"
749 [(call (match_operand:SI 0 "pj_source_operand" "gS")
750 (match_operand:SI 1 "immediate_operand" "i"))
751 (use (match_operand:SI 2 "register_operand" "r"))
752 (use (match_operand:SI 3 "" ""))]
755 emit_call_insn (gen_pj_call (XEXP (operands[0], 0),
756 pj_workout_arg_words (operands[1],
761 (define_expand "call_value"
762 [(set (match_operand:SI 0 "nonimmediate_operand" "gS")
763 (call (match_operand:SI 1 "pj_source_operand" "gS")
764 (match_operand:SI 2 "immediate_operand" "i")))
765 (use (match_operand:SI 3 "register_operand" "r"))
766 (use (match_operand:SI 4 "" ""))]
769 emit_call_insn (gen_pj_call_value (operands[0],
770 XEXP (operands[1], 0),
771 pj_workout_arg_words (operands[2],
777 ;; No-op instruction.
788 [(set (pc) (label_ref (match_operand 0 "" "")))]
792 (define_insn "indirect_jump"
793 [(set (pc) (match_operand:SI 0 "pj_source_operand" "gS"))]
797 (define_insn "casesi"
800 (leu (minus:SI (match_operand:SI 0 "pj_source_operand" "gS")
801 (match_operand:SI 1 "immediate_operand" "i"))
802 (match_operand:SI 2 "immediate_operand" "i"))
803 (plus:SI (sign_extend:SI
806 (mult:SI (minus:SI (match_dup 0)
809 (label_ref (match_operand 3 "" "")))
810 (label_ref (match_operand 4 "" ""))))]
812 "%S0\\n%3i:%*tableswitch\\n\\t%*.align 2%*.long %4-%3i%*.long %1%*.long %1+%2")
814 ;; Sign-extend move instructions.
816 (define_insn "extendsfdf2"
817 [(set (match_operand:DF 0 "nonimmediate_operand" "=gD")
818 (float_extend:DF (match_operand:SF 1 "pj_source_operand" "gS")))]
822 (define_insn "extendhisi2"
823 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
824 (sign_extend:SI (match_operand:HI 1 "pj_source_operand" "gS")))]
826 "%S1%*bipush 16%*ishl%*bipush 16%*ishr%R0")
828 (define_insn "extendqisi2"
829 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
830 (sign_extend:SI (match_operand:QI 1 "pj_source_operand" "gS")))]
832 "%S1%*bipush 24%*ishl%*bipush 24%*ishr%R0")
834 (define_insn "extendqihi2"
835 [(set (match_operand:HI 0 "nonimmediate_operand" "=gD")
836 (sign_extend:HI (match_operand:QI 1 "pj_source_operand" "gS")))]
838 "%S1%*bipush 24%*ishl%*bipush 24%*ishr%R0")
840 (define_insn "extendsidi2"
841 [(set (match_operand:DI 0 "nonimmediate_operand" "=gD")
842 (sign_extend:DI (match_operand:SI 1 "pj_source_operand" "gS")))]
847 ;; non local control flow.
849 (define_expand "save_stack_nonlocal"
850 [(set (match_operand 0 "nonimmediate_operand" "=gD")
851 (match_operand 1 "pj_source_operand" "gS"))]
854 rtx reg = force_reg (Pmode, XEXP (operands[0], 0));
855 rtx addr0 = gen_rtx_MEM (SImode,reg);
856 rtx addr1 = gen_rtx_MEM (SImode, gen_rtx_PRE_INC (SImode, reg));
857 rtx addr2 = gen_rtx_MEM (SImode, gen_rtx_PRE_INC (SImode, reg));
859 emit_move_insn (addr0, gen_rtx_REG (SImode, 64));
860 emit_move_insn (addr1, gen_rtx_REG (SImode, 72));
861 emit_move_insn (addr2, gen_rtx_REG (SImode, 73));
866 (define_insn "restore_stack_nonlocal_helper"
867 [(set (reg:SI 64) (mem:SI (match_operand:SI 0 "register_operand" "r")))
868 (set (reg:SI 72) (mem:SI (pre_inc:SI (match_dup 0))))
869 (set (reg:SI 73) (mem:SI (pre_inc:SI (match_dup 0))))]
871 "%S0%*load_word%*write_global0%*iinc %J0,4%S0%*load_word%*iinc %J0,4%S0%*load_word%*write_vars%*write_optop")
873 (define_expand "restore_stack_nonlocal"
874 [(set (match_operand 0 "nonimmediate_operand" "=gD")
875 (match_operand 1 "pj_source_operand" "gS"))]
878 rtx reg = force_reg (Pmode, XEXP (operands[1], 0));
879 emit_insn (gen_restore_stack_nonlocal_helper (reg));
883 (define_insn "nonlocal_goto_helper"
884 [(set (reg:SI 64) (mem:SI (match_operand:SI 0 "register_operand" "r")))
885 (set (reg:SI 72) (mem:SI (pre_inc:SI (match_dup 0))))
886 (set (reg:SI 73) (mem:SI (pre_inc:SI (match_dup 0))))
887 (set (pc) (match_operand:SI 1 "pj_source_operand" "gS"))]
889 "%S0%*load_word%*write_global0%*iinc %J0,4%*%S0%*load_word%*%S1%*iinc %J0,4%*%S0%*load_word%*iinc %J0,4%*write_vars%*return0")
891 (define_expand "nonlocal_goto"
892 [(match_operand:SI 0 "pj_source_operand" "")
893 (match_operand:SI 1 "pj_source_operand" "")
894 (match_operand:SI 2 "pj_source_operand" "")
895 (match_operand:SI 3 "" "")]
898 operands[2] = force_reg (Pmode, XEXP (operands[2], 0));
899 emit_move_insn (hard_frame_pointer_rtx, operands[0]);
900 emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
901 emit_insn (gen_nonlocal_goto_helper (operands[2], operands[1]));
906 ;; Function overhead.
908 (define_expand "prologue"
911 "pj_expand_prologue (); DONE;")
913 (define_expand "epilogue"
916 "pj_expand_epilogue();")
918 (define_insn "return"
923 (define_insn "tm_frame"
924 [(use (match_operand:SI 0 "pj_source_operand" "gS"))
926 (minus:SI (reg:SI 73)
927 (mult:SI (match_operand:SI 1 "pj_source_operand" "gS")
933 (define_insn "varargs"
934 [(unspec_volatile [(match_operand:SI 0 "pj_source_operand" "gS")] 10)]
936 "%S0%*jsr_w __vhelper")
938 (define_insn "varargs_finish"
939 [(unspec_volatile [(match_operand:SI 0 "pj_source_operand" "gS")] 11)]
941 "%*iload %J0%*write_global0")
943 ;; Extensions to picoJava.
945 (define_insn "strlensi"
946 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
947 (unspec:SI [(match_operand:BLK 1 "memory_operand" "gS")
948 (match_operand:QI 2 "pj_source_operand" "gS")
949 (match_operand:SI 3 "immediate_operand" "gS")] 0))
950 (clobber (reg:SI 65))]
951 "TARGET_TM_EXTENSIONS"
952 "%I1%S2%S3%*iconst_0%*write_global1%*tm_strlensi%R0")
954 (define_insn "movstrsi"
955 [(set (match_operand:BLK 0 "memory_operand" "=gS")
956 (match_operand:BLK 1 "memory_operand" "gS"))
957 (use (match_operand:SI 2 "pj_source_operand" "gS"))
958 (use (match_operand:SI 3 "pj_source_operand" "gS"))
959 (clobber (reg:SI 65))]
960 "TARGET_TM_EXTENSIONS"
961 "%I0%I1%S2%S3%*iconst_0%*write_global1%*tm_movstrsi")
963 (define_insn "clrstrsi"
964 [(set (match_operand:BLK 0 "memory_operand" "=gS")
966 (use (match_operand:SI 1 "pj_source_operand" "gS"))
967 (use (match_operand:SI 2 "pj_source_operand" "gS"))
968 (clobber (reg:SI 65))]
969 "TARGET_TM_EXTENSIONS"
970 "%I0%*iconst_0%S1%S2%*iconst_0%*write_global1%*tm_memsetsi")
972 (define_insn "cmpstrsi"
973 [(set (match_operand:SI 0 "nonimmediate_operand" "=gD")
974 (compare:SI (match_operand:BLK 1 "memory_operand" "g")
975 (match_operand:BLK 2 "memory_operand" "g")))
976 (use (match_operand:SI 3 "pj_source_operand" "gS"))
977 (use (match_operand:SI 4 "pj_source_operand" "gS"))
978 (clobber (reg:SI 65))]
979 "TARGET_TM_EXTENSIONS"
980 "%I1%I2%S3%S4%*iconst_0%*write_global1%*tm_cmpstrsi%R0")