1 ;; Mips.md Machine Description for MIPS based processors
2 ;; Contributed by A. Lichnewsky, lich@inria.inria.fr
3 ;; Changes by Michael Meissner, meissner@osf.org
4 ;; Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
6 ;; This file is part of GNU CC.
8 ;; GNU CC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; GNU CC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU CC; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 ;; ....................
28 ;; ....................
30 ;; Classification of each insn.
31 ;; branch conditional branch
32 ;; jump unconditional jump
33 ;; call unconditional call
34 ;; load load instruction(s)
35 ;; store store instruction(s)
36 ;; move data movement within same register set
37 ;; xfer transfer to/from coprocessor
38 ;; hilo transfer of hi/lo registers
39 ;; arith integer arithmetic instruction
40 ;; darith double precision integer arithmetic instructions
41 ;; imul integer multiply
42 ;; idiv integer divide
43 ;; icmp integer compare
44 ;; fadd floating point add/subtract
45 ;; fmul floating point multiply
46 ;; fdiv floating point divide
47 ;; fabs floating point absolute value
48 ;; fneg floating point negation
49 ;; fcmp floating point compare
50 ;; fcvt floating point convert
51 ;; fsqrt floating point square root
52 ;; multi multiword sequence (or user asm statements)
56 "unknown,branch,jump,call,load,store,move,xfer,hilo,arith,darith,imul,idiv,icmp,fadd,fmul,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,multi,nop"
57 (const_string "unknown"))
59 ;; Main data type used by the insn
60 (define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW" (const_string "unknown"))
62 ;; # instructions (4 bytes each)
63 (define_attr "length" "" (const_int 1))
65 ;; whether or not an instruction has a mandatory delay slot
66 (define_attr "dslot" "no,yes"
67 (if_then_else (eq_attr "type" "branch,jump,call,load,xfer,hilo,fcmp")
71 ;; Attribute describing the processor. This attribute must match exactly
72 ;; with the processor_type enumeration in mips.h.
74 ;; Attribute describing the processor
75 ;; (define_attr "cpu" "default,r3000,r6000,r4000"
77 ;; (cond [(eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R3000")) (const_string "r3000")
78 ;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R4000")) (const_string "r4000")
79 ;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R6000")) (const_string "r6000")]
80 ;; (const_string "default"))))
82 (define_attr "cpu" "default,r3000,r6000,r4000"
83 (const (symbol_ref "mips_cpu_attr")))
85 ;; Attribute defining whether or not we can use the branch-likely instructions
88 (define_attr "branch_likely" "no,yes"
90 (if_then_else (ge (symbol_ref "mips_isa") (const_int 2))
92 (const_string "no"))))
95 ;; Describe a user's asm statement.
96 (define_asm_attributes
97 [(set_attr "type" "multi")])
101 ;; .........................
103 ;; Delay slots, can't describe load/fcmp/xfer delay slots here
105 ;; .........................
107 (define_delay (eq_attr "type" "branch")
108 [(and (eq_attr "dslot" "no") (eq_attr "length" "1"))
110 (and (eq_attr "branch_likely" "yes") (and (eq_attr "dslot" "no") (eq_attr "length" "1")))])
112 (define_delay (eq_attr "type" "call,jump")
113 [(and (eq_attr "dslot" "no") (eq_attr "length" "1"))
119 ;; .........................
123 ;; .........................
125 ; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
126 ; TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST])
128 ;; Make the default case (PROCESSOR_DEFAULT) handle the worst case
130 (define_function_unit "memory" 1 0
131 (and (eq_attr "type" "load") (eq_attr "cpu" "!r3000"))
134 (define_function_unit "memory" 1 0
135 (and (eq_attr "type" "load") (eq_attr "cpu" "r3000"))
138 (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
140 (define_function_unit "addr" 1 0 (eq_attr "type" "fcmp") 2 0)
142 (define_function_unit "memory" 1 0 (eq_attr "type" "xfer") 2 0)
143 (define_function_unit "memory" 1 0 (eq_attr "type" "hilo") 3 0)
145 (define_function_unit "imuldiv" 1 1
146 (and (eq_attr "type" "imul") (eq_attr "cpu" "!r3000,r4000"))
149 (define_function_unit "imuldiv" 1 1
150 (and (eq_attr "type" "imul") (eq_attr "cpu" "r3000"))
153 (define_function_unit "imuldiv" 1 1
154 (and (eq_attr "type" "imul") (eq_attr "cpu" "r4000"))
157 (define_function_unit "imuldiv" 1 1
158 (and (eq_attr "type" "idiv") (eq_attr "cpu" "!r3000,r4000"))
161 (define_function_unit "imuldiv" 1 1
162 (and (eq_attr "type" "idiv") (eq_attr "cpu" "r3000"))
165 (define_function_unit "imuldiv" 1 1
166 (and (eq_attr "type" "idiv") (eq_attr "cpu" "r4000"))
169 (define_function_unit "adder" 1 1
170 (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r6000"))
173 (define_function_unit "adder" 1 1
174 (and (eq_attr "type" "fadd") (eq_attr "cpu" "r3000"))
177 (define_function_unit "adder" 1 1
178 (and (eq_attr "type" "fadd") (eq_attr "cpu" "r6000"))
181 (define_function_unit "adder" 1 1
182 (and (eq_attr "type" "fabs,fneg") (eq_attr "cpu" "!r3000"))
185 (define_function_unit "adder" 1 1
186 (and (eq_attr "type" "fabs,fneg") (eq_attr "cpu" "r3000"))
189 (define_function_unit "mult" 1 1
190 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r3000,r6000")))
193 (define_function_unit "mult" 1 1
194 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3000")))
197 (define_function_unit "mult" 1 1
198 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r6000")))
201 (define_function_unit "mult" 1 1
202 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r6000")))
205 (define_function_unit "mult" 1 1
206 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3000")))
209 (define_function_unit "mult" 1 1
210 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r6000")))
213 (define_function_unit "divide" 1 1
214 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r3000,r6000")))
217 (define_function_unit "divide" 1 1
218 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3000")))
221 (define_function_unit "divide" 1 1
222 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r6000")))
225 (define_function_unit "divide" 1 1
226 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r6000")))
229 (define_function_unit "divide" 1 1
230 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3000")))
233 (define_function_unit "divide" 1 1
234 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r6000")))
237 (define_function_unit "divide" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "SF")) 54 0)
238 (define_function_unit "divide" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "DF")) 112 0)
241 ;; The following functional units do not use the cpu type, and use
242 ;; much less memory in genattrtab.c.
244 ;; (define_function_unit "memory" 1 0 (eq_attr "type" "load") 3 0)
245 ;; (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
247 ;; (define_function_unit "fp_comp" 1 0 (eq_attr "type" "fcmp") 2 0)
249 ;; (define_function_unit "transfer" 1 0 (eq_attr "type" "xfer") 2 0)
250 ;; (define_function_unit "transfer" 1 0 (eq_attr "type" "hilo") 3 0)
252 ;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "imul") 17 0)
253 ;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "idiv") 38 0)
255 ;; (define_function_unit "adder" 1 1 (eq_attr "type" "fadd") 4 0)
256 ;; (define_function_unit "adder" 1 1 (eq_attr "type" "fabs,fneg") 2 0)
258 ;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "SF")) 7 0)
259 ;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "DF")) 8 0)
261 ;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "SF")) 23 0)
262 ;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "DF")) 36 0)
264 ;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "SF")) 54 0)
265 ;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "DF")) 112 0)
269 ;; ....................
273 ;; ....................
276 (define_insn "adddf3"
277 [(set (match_operand:DF 0 "register_operand" "=f")
278 (plus:DF (match_operand:DF 1 "register_operand" "f")
279 (match_operand:DF 2 "register_operand" "f")))]
282 [(set_attr "type" "fadd")
283 (set_attr "mode" "DF")
284 (set_attr "length" "1")])
286 (define_insn "addsf3"
287 [(set (match_operand:SF 0 "register_operand" "=f")
288 (plus:SF (match_operand:SF 1 "register_operand" "f")
289 (match_operand:SF 2 "register_operand" "f")))]
292 [(set_attr "type" "fadd")
293 (set_attr "mode" "SF")
294 (set_attr "length" "1")])
296 (define_insn "addsi3"
297 [(set (match_operand:SI 0 "register_operand" "=d")
298 (plus:SI (match_operand:SI 1 "arith_operand" "%d")
299 (match_operand:SI 2 "arith_operand" "dI")))]
303 return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
304 ? \"subu\\t%0,%1,%n2\"
305 : \"addu\\t%0,%1,%2\";
307 [(set_attr "type" "arith")
308 (set_attr "mode" "SI")
309 (set_attr "length" "1")])
311 (define_expand "adddi3"
312 [(parallel [(set (match_operand:DI 0 "register_operand" "")
313 (plus:DI (match_operand:DI 1 "register_operand" "")
314 (match_operand:DI 2 "arith_operand" "")))
315 (clobber (match_dup 3))])]
316 "!TARGET_DEBUG_G_MODE"
319 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == -32768)
320 operands[2] = force_reg (SImode, operands[2]);
322 operands[3] = gen_reg_rtx (SImode);
325 (define_insn "adddi3_internal_1"
326 [(set (match_operand:DI 0 "register_operand" "=d,&d")
327 (plus:DI (match_operand:DI 1 "register_operand" "0,d")
328 (match_operand:DI 2 "register_operand" "d,d")))
329 (clobber (match_operand:SI 3 "register_operand" "=d,d"))]
330 "!TARGET_DEBUG_G_MODE"
333 return (REGNO (operands[0]) == REGNO (operands[1])
334 && REGNO (operands[0]) == REGNO (operands[2]))
335 ? \"srl\\t%3,%L0,31\;sll\\t%M0,%M0,1\;sll\\t%L0,%L1,1\;addu\\t%M0,%M0,%3\"
336 : \"addu\\t%L0,%L1,%L2\;sltu\\t%3,%L0,%L2\;addu\\t%M0,%M1,%M2\;addu\\t%M0,%M0,%3\";
338 [(set_attr "type" "darith")
339 (set_attr "mode" "DI")
340 (set_attr "length" "4")])
343 [(set (match_operand:DI 0 "register_operand" "")
344 (plus:DI (match_operand:DI 1 "register_operand" "")
345 (match_operand:DI 2 "register_operand" "")))
346 (clobber (match_operand:SI 3 "register_operand" ""))]
347 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
348 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
349 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
350 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))
351 && (REGNO (operands[0]) != REGNO (operands[1])
352 || REGNO (operands[0]) != REGNO (operands[2]))"
354 [(set (subreg:SI (match_dup 0) 0)
355 (plus:SI (subreg:SI (match_dup 1) 0)
356 (subreg:SI (match_dup 2) 0)))
359 (ltu:SI (subreg:SI (match_dup 0) 0)
360 (subreg:SI (match_dup 2) 0)))
362 (set (subreg:SI (match_dup 0) 1)
363 (plus:SI (subreg:SI (match_dup 1) 1)
364 (subreg:SI (match_dup 2) 1)))
366 (set (subreg:SI (match_dup 0) 1)
367 (plus:SI (subreg:SI (match_dup 0) 1)
372 [(set (match_operand:DI 0 "register_operand" "")
373 (plus:DI (match_operand:DI 1 "register_operand" "")
374 (match_operand:DI 2 "register_operand" "")))
375 (clobber (match_operand:SI 3 "register_operand" ""))]
376 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
377 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
378 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
379 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))
380 && (REGNO (operands[0]) != REGNO (operands[1])
381 || REGNO (operands[0]) != REGNO (operands[2]))"
383 [(set (subreg:SI (match_dup 0) 1)
384 (plus:SI (subreg:SI (match_dup 1) 1)
385 (subreg:SI (match_dup 2) 1)))
388 (ltu:SI (subreg:SI (match_dup 0) 1)
389 (subreg:SI (match_dup 2) 1)))
391 (set (subreg:SI (match_dup 0) 0)
392 (plus:SI (subreg:SI (match_dup 1) 0)
393 (subreg:SI (match_dup 2) 0)))
395 (set (subreg:SI (match_dup 0) 0)
396 (plus:SI (subreg:SI (match_dup 0) 0)
400 (define_insn "adddi3_internal_2"
401 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
402 (plus:DI (match_operand:DI 1 "register_operand" "%d,%d,%d")
403 (match_operand:DI 2 "small_int" "P,J,N")))
404 (clobber (match_operand:SI 3 "register_operand" "=d,d,d"))]
405 "!TARGET_DEBUG_G_MODE && INTVAL (operands[2]) != -32768"
407 addu\\t%L0,%L1,%2\;sltu\\t%3,%L0,%2\;addu\\t%M0,%M1,%3
408 move\\t%L0,%L1\;move\\t%M0,%M1
409 subu\\t%L0,%L1,%n2\;sltu\\t%3,%L0,%2\;subu\\t%M0,%M1,1\;addu\\t%M0,%M0,%3"
410 [(set_attr "type" "darith")
411 (set_attr "mode" "DI")
412 (set_attr "length" "3,2,4")])
415 [(set (match_operand:DI 0 "register_operand" "")
416 (plus:DI (match_operand:DI 1 "register_operand" "")
417 (match_operand:DI 2 "small_int" "")))
418 (clobber (match_operand:SI 3 "register_operand" "=d"))]
419 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
420 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
421 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
422 && INTVAL (operands[2]) > 0"
424 [(set (subreg:SI (match_dup 0) 0)
425 (plus:SI (subreg:SI (match_dup 1) 0)
429 (ltu:SI (subreg:SI (match_dup 0) 0)
432 (set (subreg:SI (match_dup 0) 1)
433 (plus:SI (subreg:SI (match_dup 1) 1)
438 [(set (match_operand:DI 0 "register_operand" "")
439 (plus:DI (match_operand:DI 1 "register_operand" "")
440 (match_operand:DI 2 "small_int" "")))
441 (clobber (match_operand:SI 3 "register_operand" "=d"))]
442 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
443 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
444 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
445 && INTVAL (operands[2]) > 0"
447 [(set (subreg:SI (match_dup 0) 1)
448 (plus:SI (subreg:SI (match_dup 1) 1)
452 (ltu:SI (subreg:SI (match_dup 0) 1)
455 (set (subreg:SI (match_dup 0) 0)
456 (plus:SI (subreg:SI (match_dup 1) 0)
461 ;; ....................
465 ;; ....................
468 (define_insn "subdf3"
469 [(set (match_operand:DF 0 "register_operand" "=f")
470 (minus:DF (match_operand:DF 1 "register_operand" "f")
471 (match_operand:DF 2 "register_operand" "f")))]
474 [(set_attr "type" "fadd")
475 (set_attr "mode" "DF")
476 (set_attr "length" "1")])
478 (define_insn "subsf3"
479 [(set (match_operand:SF 0 "register_operand" "=f")
480 (minus:SF (match_operand:SF 1 "register_operand" "f")
481 (match_operand:SF 2 "register_operand" "f")))]
484 [(set_attr "type" "fadd")
485 (set_attr "mode" "SF")
486 (set_attr "length" "1")])
488 (define_insn "subsi3"
489 [(set (match_operand:SI 0 "register_operand" "=d")
490 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
491 (match_operand:SI 2 "arith_operand" "dI")))]
495 return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
496 ? \"addu\\t%0,%z1,%n2\"
497 : \"subu\\t%0,%z1,%2\";
499 [(set_attr "type" "arith")
500 (set_attr "mode" "SI")
501 (set_attr "length" "1")])
503 (define_expand "subdi3"
504 [(parallel [(set (match_operand:DI 0 "register_operand" "=d")
505 (minus:DI (match_operand:DI 1 "register_operand" "d")
506 (match_operand:DI 2 "register_operand" "d")))
507 (clobber (match_dup 3))])]
508 "!TARGET_DEBUG_G_MODE"
509 "operands[3] = gen_reg_rtx (SImode);")
511 (define_insn "subdi3_internal"
512 [(set (match_operand:DI 0 "register_operand" "=d")
513 (minus:DI (match_operand:DI 1 "register_operand" "d")
514 (match_operand:DI 2 "register_operand" "d")))
515 (clobber (match_operand:SI 3 "register_operand" "=d"))]
516 "!TARGET_DEBUG_G_MODE"
517 "sltu\\t%3,%L1,%L2\;subu\\t%L0,%L1,%L2\;subu\\t%M0,%M1,%M2\;subu\\t%M0,%M0,%3"
518 [(set_attr "type" "darith")
519 (set_attr "mode" "DI")
520 (set_attr "length" "4")])
523 [(set (match_operand:DI 0 "register_operand" "")
524 (minus:DI (match_operand:DI 1 "register_operand" "")
525 (match_operand:DI 2 "register_operand" "")))
526 (clobber (match_operand:SI 3 "register_operand" ""))]
527 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
528 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
529 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
530 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
533 (ltu:SI (subreg:SI (match_dup 1) 0)
534 (subreg:SI (match_dup 2) 0)))
536 (set (subreg:SI (match_dup 0) 0)
537 (minus:SI (subreg:SI (match_dup 1) 0)
538 (subreg:SI (match_dup 2) 0)))
540 (set (subreg:SI (match_dup 0) 1)
541 (minus:SI (subreg:SI (match_dup 1) 1)
542 (subreg:SI (match_dup 2) 1)))
544 (set (subreg:SI (match_dup 0) 1)
545 (minus:SI (subreg:SI (match_dup 0) 1)
550 [(set (match_operand:DI 0 "register_operand" "")
551 (minus:DI (match_operand:DI 1 "register_operand" "")
552 (match_operand:DI 2 "register_operand" "")))
553 (clobber (match_operand:SI 3 "register_operand" ""))]
554 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
555 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
556 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
557 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
560 (ltu:SI (subreg:SI (match_dup 1) 1)
561 (subreg:SI (match_dup 2) 1)))
563 (set (subreg:SI (match_dup 0) 1)
564 (minus:SI (subreg:SI (match_dup 1) 1)
565 (subreg:SI (match_dup 2) 1)))
567 (set (subreg:SI (match_dup 0) 0)
568 (minus:SI (subreg:SI (match_dup 1) 0)
569 (subreg:SI (match_dup 2) 0)))
571 (set (subreg:SI (match_dup 0) 0)
572 (minus:SI (subreg:SI (match_dup 0) 0)
576 (define_insn "subdi3_internal_2"
577 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
578 (minus:DI (match_operand:DI 1 "register_operand" "d,d,d")
579 (match_operand:DI 2 "small_int" "P,J,N")))
580 (clobber (match_operand:SI 3 "register_operand" "=d,d,d"))]
581 "!TARGET_DEBUG_G_MODE && INTVAL (operands[2]) != -32768"
583 sltu\\t%3,%L1,%2\;subu\\t%L0,%L1,%2\;subu\\t%M0,%M1,%3
584 move\\t%L0,%L1\;move\\t%M0,%M1
585 sltu\\t%3,%L1,%2\;subu\\t%L0,%L1,%2\;subu\\t%M0,%M1,1\;subu\\t%M0,%M0,%3"
586 [(set_attr "type" "darith")
587 (set_attr "mode" "DI")
588 (set_attr "length" "3,2,4")])
591 [(set (match_operand:DI 0 "register_operand" "")
592 (minus:DI (match_operand:DI 1 "register_operand" "")
593 (match_operand:DI 2 "small_int" "")))
594 (clobber (match_operand:SI 3 "register_operand" ""))]
595 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
596 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
597 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
598 && INTVAL (operands[2]) > 0"
601 (ltu:SI (subreg:SI (match_dup 1) 0)
604 (set (subreg:SI (match_dup 0) 0)
605 (minus:SI (subreg:SI (match_dup 1) 0)
608 (set (subreg:SI (match_dup 0) 1)
609 (minus:SI (subreg:SI (match_dup 1) 1)
614 [(set (match_operand:DI 0 "register_operand" "")
615 (minus:DI (match_operand:DI 1 "register_operand" "")
616 (match_operand:DI 2 "small_int" "")))
617 (clobber (match_operand:SI 3 "register_operand" ""))]
618 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
619 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
620 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
621 && INTVAL (operands[2]) > 0"
624 (ltu:SI (subreg:SI (match_dup 1) 1)
627 (set (subreg:SI (match_dup 0) 1)
628 (minus:SI (subreg:SI (match_dup 1) 1)
631 (set (subreg:SI (match_dup 0) 0)
632 (minus:SI (subreg:SI (match_dup 1) 0)
638 ;; ....................
642 ;; ....................
645 (define_insn "muldf3"
646 [(set (match_operand:DF 0 "register_operand" "=f")
647 (mult:DF (match_operand:DF 1 "register_operand" "f")
648 (match_operand:DF 2 "register_operand" "f")))]
651 [(set_attr "type" "fmul")
652 (set_attr "mode" "DF")
653 (set_attr "length" "1")])
655 (define_insn "mulsf3"
656 [(set (match_operand:SF 0 "register_operand" "=f")
657 (mult:SF (match_operand:SF 1 "register_operand" "f")
658 (match_operand:SF 2 "register_operand" "f")))]
661 [(set_attr "type" "fmul")
662 (set_attr "mode" "SF")
663 (set_attr "length" "1")])
665 (define_insn "mulsi3"
666 [(set (match_operand:SI 0 "register_operand" "=d")
667 (mult:SI (match_operand:SI 1 "register_operand" "d")
668 (match_operand:SI 2 "register_operand" "d")))
669 (clobber (reg:SI 64))
670 (clobber (reg:SI 65))]
676 xoperands[0] = operands[0];
677 xoperands[1] = gen_rtx (REG, SImode, LO_REGNUM);
679 output_asm_insn (\"mult\\t%1,%2\", operands);
680 output_asm_insn (mips_move_1word (xoperands, insn), xoperands);
683 [(set_attr "type" "imul")
684 (set_attr "mode" "SI")
685 (set_attr "length" "3")]) ;; mult + mflo + delay
688 [(set (match_operand:SI 0 "register_operand" "")
689 (mult:SI (match_operand:SI 1 "register_operand" "")
690 (match_operand:SI 2 "register_operand" "")))
691 (clobber (reg:SI 64))
692 (clobber (reg:SI 65))]
693 "!TARGET_DEBUG_D_MODE"
694 [(parallel [(set (reg:SI 65) ;; low register
695 (mult:SI (match_dup 1)
697 (clobber (reg:SI 64))])
702 (define_insn "mulsi3_internal"
703 [(set (reg:SI 65) ;; low register
704 (mult:SI (match_operand:SI 0 "register_operand" "d")
705 (match_operand:SI 1 "register_operand" "d")))
706 (clobber (reg:SI 64))]
709 [(set_attr "type" "imul")
710 (set_attr "mode" "SI")
711 (set_attr "length" "1")])
713 (define_insn "mulsidi3"
714 [(set (match_operand:DI 0 "register_operand" "=d")
715 (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
716 (sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))
717 (clobber (reg:DI 64))]
723 xoperands[0] = operands[0];
724 xoperands[1] = gen_rtx (REG, DImode, MD_REG_FIRST);
726 output_asm_insn (\"mult\\t%1,%2\", operands);
727 output_asm_insn (mips_move_2words (xoperands, insn), xoperands);
730 [(set_attr "type" "imul")
731 (set_attr "mode" "SI")
732 (set_attr "length" "4")]) ;; mult + mflo + mfhi + delay
734 (define_insn "umulsidi3"
735 [(set (match_operand:DI 0 "register_operand" "=d")
736 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
737 (zero_extend:DI (match_operand:SI 2 "register_operand" "d"))))
738 (clobber (reg:DI 64))]
744 xoperands[0] = operands[0];
745 xoperands[1] = gen_rtx (REG, DImode, MD_REG_FIRST);
747 output_asm_insn (\"multu\\t%1,%2\", operands);
748 output_asm_insn (mips_move_2words (xoperands, insn), xoperands);
751 [(set_attr "type" "imul")
752 (set_attr "mode" "SI")
753 (set_attr "length" "4")]) ;; mult + mflo + mfhi + delay
757 ;; ....................
759 ;; DIVISION and REMAINDER
761 ;; ....................
764 (define_insn "divdf3"
765 [(set (match_operand:DF 0 "register_operand" "=f")
766 (div:DF (match_operand:DF 1 "register_operand" "f")
767 (match_operand:DF 2 "register_operand" "f")))]
770 [(set_attr "type" "fdiv")
771 (set_attr "mode" "DF")
772 (set_attr "length" "1")])
774 (define_insn "divsf3"
775 [(set (match_operand:SF 0 "register_operand" "=f")
776 (div:SF (match_operand:SF 1 "register_operand" "f")
777 (match_operand:SF 2 "register_operand" "f")))]
780 [(set_attr "type" "fdiv")
781 (set_attr "mode" "SF")
782 (set_attr "length" "1")])
784 ;; If optimizing, prefer the divmod functions over separate div and
785 ;; mod functions, since this will allow using one instruction for both
786 ;; the quotient and remainder. At present, the divmod is not moved out
787 ;; of loops if it is constant within the loop, so allow -mdebugc to
788 ;; use the old method of doing things.
790 ;; 64 is the multiply/divide hi register
791 ;; 65 is the multiply/divide lo register
793 (define_insn "divmodsi4"
794 [(set (match_operand:SI 0 "register_operand" "=d")
795 (div:SI (match_operand:SI 1 "register_operand" "d")
796 (match_operand:SI 2 "register_operand" "d")))
797 (set (match_operand:SI 3 "register_operand" "=d")
798 (mod:SI (match_dup 1)
800 (clobber (reg:SI 64))
801 (clobber (reg:SI 65))]
805 if (find_reg_note (insn, REG_UNUSED, operands[3]))
806 return \"div\\t%0,%1,%2\";
808 if (find_reg_note (insn, REG_UNUSED, operands[0]))
809 return \"rem\\t%3,%1,%2\";
811 return \"div\\t%0,%1,%2\;mfhi\\t%3\";
813 [(set_attr "type" "idiv")
814 (set_attr "mode" "SI")
815 (set_attr "length" "13")]) ;; various tests for dividing by 0 and such
817 (define_insn "udivmodsi4"
818 [(set (match_operand:SI 0 "register_operand" "=d")
819 (udiv:SI (match_operand:SI 1 "register_operand" "d")
820 (match_operand:SI 2 "register_operand" "d")))
821 (set (match_operand:SI 3 "register_operand" "=d")
822 (umod:SI (match_dup 1)
824 (clobber (reg:SI 64))
825 (clobber (reg:SI 65))]
829 if (find_reg_note (insn, REG_UNUSED, operands[3]))
830 return \"divu\\t%0,%1,%2\";
832 if (find_reg_note (insn, REG_UNUSED, operands[0]))
833 return \"remu\\t%3,%1,%2\";
835 return \"divu\\t%0,%1,%2\;mfhi\\t%3\";
837 [(set_attr "type" "idiv")
838 (set_attr "mode" "SI")
839 (set_attr "length" "13")]) ;; various tests for dividing by 0 and such
841 (define_insn "divsi3"
842 [(set (match_operand:SI 0 "register_operand" "=d")
843 (div:SI (match_operand:SI 1 "register_operand" "d")
844 (match_operand:SI 2 "register_operand" "d")))
845 (clobber (reg:SI 64))
846 (clobber (reg:SI 65))]
849 [(set_attr "type" "idiv")
850 (set_attr "mode" "SI")
851 (set_attr "length" "13")]) ;; various tests for dividing by 0 and such
853 (define_insn "modsi3"
854 [(set (match_operand:SI 0 "register_operand" "=d")
855 (mod:SI (match_operand:SI 1 "register_operand" "d")
856 (match_operand:SI 2 "register_operand" "d")))
857 (clobber (reg:SI 64))
858 (clobber (reg:SI 65))]
861 [(set_attr "type" "idiv")
862 (set_attr "mode" "SI")
863 (set_attr "length" "14")]) ;; various tests for dividing by 0 and such
865 (define_insn "udivsi3"
866 [(set (match_operand:SI 0 "register_operand" "=d")
867 (udiv:SI (match_operand:SI 1 "register_operand" "d")
868 (match_operand:SI 2 "register_operand" "d")))
869 (clobber (reg:SI 64))
870 (clobber (reg:SI 65))]
873 [(set_attr "type" "idiv")
874 (set_attr "mode" "SI")
875 (set_attr "length" "14")]) ;; various tests for dividing by 0 and such
877 (define_insn "umodsi3"
878 [(set (match_operand:SI 0 "register_operand" "=d")
879 (umod:SI (match_operand:SI 1 "register_operand" "d")
880 (match_operand:SI 2 "register_operand" "d")))
881 (clobber (reg:SI 64))
882 (clobber (reg:SI 65))]
885 [(set_attr "type" "idiv")
886 (set_attr "mode" "SI")
887 (set_attr "length" "14")]) ;; various tests for dividing by 0 and such
891 ;; ....................
895 ;; ....................
897 (define_insn "sqrtdf2"
898 [(set (match_operand:DF 0 "register_operand" "=f")
899 (sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
900 "TARGET_HARD_FLOAT && HAVE_SQRT_P()"
902 [(set_attr "type" "fabs")
903 (set_attr "mode" "DF")
904 (set_attr "length" "1")])
906 (define_insn "sqrtsf2"
907 [(set (match_operand:SF 0 "register_operand" "=f")
908 (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
909 "TARGET_HARD_FLOAT && HAVE_SQRT_P()"
911 [(set_attr "type" "fabs")
912 (set_attr "mode" "SF")
913 (set_attr "length" "1")])
917 ;; ....................
921 ;; ....................
923 ;; Do not use the integer abs macro instruction, since that signals an
924 ;; exception on -2147483648 (sigh).
926 (define_insn "abssi2"
927 [(set (match_operand:SI 0 "register_operand" "=d")
928 (abs:SI (match_operand:SI 1 "register_operand" "d")))]
933 dslots_jump_filled++;
934 operands[2] = const0_rtx;
936 return (REGNO (operands[0]) == REGNO (operands[1]))
937 ? \"bgez\\t%1,1f%#\\n\\tsubu\\t%0,%z2,%0\\n1:\"
938 : \"%(bgez\\t%1,1f\\n\\tmove\\t%0,%1\\n\\tsubu\\t%0,%z2,%0\\n1:%)\";
940 [(set_attr "type" "multi")
941 (set_attr "mode" "SI")
942 (set_attr "length" "3")])
944 (define_insn "absdf2"
945 [(set (match_operand:DF 0 "register_operand" "=f")
946 (abs:DF (match_operand:DF 1 "register_operand" "f")))]
949 [(set_attr "type" "fabs")
950 (set_attr "mode" "DF")
951 (set_attr "length" "1")])
953 (define_insn "abssf2"
954 [(set (match_operand:SF 0 "register_operand" "=f")
955 (abs:SF (match_operand:SF 1 "register_operand" "f")))]
958 [(set_attr "type" "fabs")
959 (set_attr "mode" "SF")
960 (set_attr "length" "1")])
964 ;; ....................
966 ;; FIND FIRST BIT INSTRUCTION
968 ;; ....................
971 (define_insn "ffssi2"
972 [(set (match_operand:SI 0 "register_operand" "=&d")
973 (ffs:SI (match_operand:SI 1 "register_operand" "d")))
974 (clobber (match_scratch:SI 2 "d"))
975 (clobber (match_scratch:SI 3 "d"))]
979 dslots_jump_total += 2;
980 dslots_jump_filled += 2;
981 operands[4] = const0_rtx;
983 if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))
986 \\tbeq\\t%1,%z4,2f\\n\\
987 1:\\tand\\t%2,%1,0x0001\\n\\
988 \\taddu\\t%0,%0,1\\n\\
989 \\tbeq\\t%2,%z4,1b\\n\\
990 \\tsrl\\t%1,%1,1\\n\\
996 \\tbeq\\t%3,%z4,2f\\n\\
997 1:\\tand\\t%2,%3,0x0001\\n\\
998 \\taddu\\t%0,%0,1\\n\\
999 \\tbeq\\t%2,%z4,1b\\n\\
1000 \\tsrl\\t%3,%3,1\\n\\
1003 [(set_attr "type" "multi")
1004 (set_attr "mode" "SI")
1005 (set_attr "length" "6")])
1009 ;; ....................
1011 ;; NEGATION and ONE'S COMPLEMENT
1013 ;; ....................
1015 (define_insn "negsi2"
1016 [(set (match_operand:SI 0 "register_operand" "=d")
1017 (neg:SI (match_operand:SI 1 "register_operand" "d")))]
1021 operands[2] = const0_rtx;
1022 return \"subu\\t%0,%z2,%1\";
1024 [(set_attr "type" "arith")
1025 (set_attr "mode" "SI")
1026 (set_attr "length" "1")])
1028 (define_expand "negdi3"
1029 [(parallel [(set (match_operand:DI 0 "register_operand" "=d")
1030 (neg:DI (match_operand:DI 1 "register_operand" "d")))
1031 (clobber (match_dup 2))])]
1032 "!TARGET_DEBUG_G_MODE"
1033 "operands[2] = gen_reg_rtx (SImode);")
1035 (define_insn "negdi3_internal"
1036 [(set (match_operand:DI 0 "register_operand" "=d")
1037 (neg:DI (match_operand:DI 1 "register_operand" "d")))
1038 (clobber (match_operand:SI 2 "register_operand" "=d"))]
1039 "!TARGET_DEBUG_G_MODE"
1042 operands[3] = const0_rtx;
1043 return \"subu\\t%L0,%z3,%L1\;subu\\t%M0,%z3,%M1\;sltu\\t%2,%z3,%L0\;subu\\t%M0,%M0,%2\";
1045 [(set_attr "type" "darith")
1046 (set_attr "mode" "DI")
1047 (set_attr "length" "4")])
1049 (define_insn "negdf2"
1050 [(set (match_operand:DF 0 "register_operand" "=f")
1051 (neg:DF (match_operand:DF 1 "register_operand" "f")))]
1054 [(set_attr "type" "fneg")
1055 (set_attr "mode" "DF")
1056 (set_attr "length" "1")])
1058 (define_insn "negsf2"
1059 [(set (match_operand:SF 0 "register_operand" "=f")
1060 (neg:SF (match_operand:SF 1 "register_operand" "f")))]
1063 [(set_attr "type" "fneg")
1064 (set_attr "mode" "SF")
1065 (set_attr "length" "1")])
1067 (define_insn "one_cmplsi2"
1068 [(set (match_operand:SI 0 "register_operand" "=d")
1069 (not:SI (match_operand:SI 1 "register_operand" "d")))]
1073 operands[2] = const0_rtx;
1074 return \"nor\\t%0,%z2,%1\";
1076 [(set_attr "type" "arith")
1077 (set_attr "mode" "SI")
1078 (set_attr "length" "1")])
1080 (define_insn "one_cmpldi2"
1081 [(set (match_operand:DI 0 "register_operand" "=d")
1082 (not:SI (match_operand:DI 1 "register_operand" "d")))]
1086 operands[2] = const0_rtx;
1087 return \"nor\\t%M0,%z2,%M1\;nor\\t%L0,%z2,%L1\";
1089 [(set_attr "type" "darith")
1090 (set_attr "mode" "DI")
1091 (set_attr "length" "2")])
1094 [(set (match_operand:DI 0 "register_operand" "")
1095 (not:DI (match_operand:DI 1 "register_operand" "")))]
1096 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1097 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1098 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
1100 [(set (subreg:SI (match_dup 0) 0) (not:SI (subreg:SI (match_dup 1) 0)))
1101 (set (subreg:SI (match_dup 0) 1) (not:SI (subreg:SI (match_dup 1) 1)))]
1104 ;; Simple hack to recognize the "nor" instruction on the MIPS
1105 ;; This must appear before the normal or patterns, so that the
1106 ;; combiner will correctly fold things.
1108 (define_insn "norsi3"
1109 [(set (match_operand:SI 0 "register_operand" "=d")
1110 (not:SI (ior:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
1111 (match_operand:SI 2 "reg_or_0_operand" "dJ"))))]
1114 [(set_attr "type" "arith")
1115 (set_attr "mode" "SI")
1116 (set_attr "length" "1")])
1118 (define_insn "nordi3"
1119 [(set (match_operand:DI 0 "register_operand" "=d")
1120 (not:DI (ior:DI (match_operand:DI 1 "register_operand" "d")
1121 (match_operand:DI 2 "register_operand" "d"))))]
1123 "nor\\t%M0,%M1,%M2\;nor\\t%L0,%L1,%L2"
1124 [(set_attr "type" "darith")
1125 (set_attr "mode" "DI")
1126 (set_attr "length" "2")])
1129 [(set (match_operand:DI 0 "register_operand" "")
1130 (not:DI (ior:DI (match_operand:DI 1 "register_operand" "")
1131 (match_operand:DI 2 "register_operand" ""))))]
1132 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1133 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1134 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1135 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1137 [(set (subreg:SI (match_dup 0) 0) (not:SI (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0))))
1138 (set (subreg:SI (match_dup 0) 1) (not:SI (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1))))]
1143 ;; ....................
1147 ;; ....................
1150 (define_insn "andsi3"
1151 [(set (match_operand:SI 0 "register_operand" "=d,d")
1152 (and:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
1153 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
1158 [(set_attr "type" "arith")
1159 (set_attr "mode" "SI")
1160 (set_attr "length" "1")])
1162 (define_insn "anddi3"
1163 [(set (match_operand:DI 0 "register_operand" "=d")
1164 (and:DI (match_operand:DI 1 "register_operand" "d")
1165 (match_operand:DI 2 "register_operand" "d")))]
1166 "!TARGET_DEBUG_G_MODE"
1167 "and\\t%M0,%M1,%M2\;and\\t%L0,%L1,%L2"
1168 [(set_attr "type" "darith")
1169 (set_attr "mode" "DI")
1170 (set_attr "length" "2")])
1173 [(set (match_operand:DI 0 "register_operand" "")
1174 (and:DI (match_operand:DI 1 "register_operand" "")
1175 (match_operand:DI 2 "register_operand" "")))]
1176 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1177 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1178 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1179 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1181 [(set (subreg:SI (match_dup 0) 0) (and:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))
1182 (set (subreg:SI (match_dup 0) 1) (and:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]
1185 (define_insn "iorsi3"
1186 [(set (match_operand:SI 0 "register_operand" "=d,d")
1187 (ior:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
1188 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
1193 [(set_attr "type" "arith")
1194 (set_attr "mode" "SI")
1195 (set_attr "length" "1")])
1197 (define_insn "iordi3"
1198 [(set (match_operand:DI 0 "register_operand" "=d")
1199 (ior:DI (match_operand:DI 1 "register_operand" "d")
1200 (match_operand:DI 2 "register_operand" "d")))]
1201 "!TARGET_DEBUG_G_MODE"
1202 "or\\t%M0,%M1,%M2\;or\\t%L0,%L1,%L2"
1203 [(set_attr "type" "darith")
1204 (set_attr "mode" "DI")
1205 (set_attr "length" "2")])
1208 [(set (match_operand:DI 0 "register_operand" "")
1209 (ior:DI (match_operand:DI 1 "register_operand" "")
1210 (match_operand:DI 2 "register_operand" "")))]
1211 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1212 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1213 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1214 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1216 [(set (subreg:SI (match_dup 0) 0) (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))
1217 (set (subreg:SI (match_dup 0) 1) (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]
1220 (define_insn "xorsi3"
1221 [(set (match_operand:SI 0 "register_operand" "=d,d")
1222 (xor:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
1223 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
1228 [(set_attr "type" "arith")
1229 (set_attr "mode" "SI")
1230 (set_attr "length" "1")])
1232 (define_insn "xordi3"
1233 [(set (match_operand:DI 0 "register_operand" "=d")
1234 (xor:DI (match_operand:DI 1 "register_operand" "d")
1235 (match_operand:DI 2 "register_operand" "d")))]
1236 "!TARGET_DEBUG_G_MODE"
1237 "xor\\t%M0,%M1,%M2\;xor\\t%L0,%L1,%L2"
1238 [(set_attr "type" "darith")
1239 (set_attr "mode" "DI")
1240 (set_attr "length" "2")])
1243 [(set (match_operand:DI 0 "register_operand" "")
1244 (xor:DI (match_operand:DI 1 "register_operand" "")
1245 (match_operand:DI 2 "register_operand" "")))]
1246 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1247 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1248 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1249 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1251 [(set (subreg:SI (match_dup 0) 0) (xor:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))
1252 (set (subreg:SI (match_dup 0) 1) (xor:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]
1257 ;; ....................
1261 ;; ....................
1263 (define_insn "truncdfsf2"
1264 [(set (match_operand:SF 0 "register_operand" "=f")
1265 (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))]
1268 [(set_attr "type" "fcvt")
1269 (set_attr "mode" "SF")
1270 (set_attr "length" "1")])
1274 ;; ....................
1278 ;; ....................
1281 ;; Those for integer source operand
1282 ;; are ordered widest source type first.
1284 (define_insn "zero_extendhisi2"
1285 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
1286 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d,R,m")))]
1290 if (which_alternative == 0)
1291 return \"andi\\t%0,%1,0xffff\";
1293 return mips_move_1word (operands, insn, TRUE);
1295 [(set_attr "type" "arith,load,load")
1296 (set_attr "mode" "SI")
1297 (set_attr "length" "1,1,2")])
1299 (define_insn "zero_extendqihi2"
1300 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
1301 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "d,R,m")))]
1305 if (which_alternative == 0)
1306 return \"andi\\t%0,%1,0x00ff\";
1308 return mips_move_1word (operands, insn, TRUE);
1310 [(set_attr "type" "arith,load,load")
1311 (set_attr "mode" "HI")
1312 (set_attr "length" "1,1,2")])
1314 (define_insn "zero_extendqisi2"
1315 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
1316 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "d,R,m")))]
1320 if (which_alternative == 0)
1321 return \"andi\\t%0,%1,0x00ff\";
1323 return mips_move_1word (operands, insn, TRUE);
1325 [(set_attr "type" "arith,load,load")
1326 (set_attr "mode" "SI")
1327 (set_attr "length" "1,1,2")])
1331 ;; ....................
1335 ;; ....................
1338 ;; Those for integer source operand
1339 ;; are ordered widest source type first.
1341 ;; These patterns originally accepted general_operands, however, slightly
1342 ;; better code is generated by only accepting register_operands, and then
1343 ;; letting combine generate the lh and lb insns.
1345 (define_expand "extendhisi2"
1346 [(set (match_operand:SI 0 "register_operand" "")
1347 (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
1351 if (optimize && GET_CODE (operands[1]) == MEM)
1352 operands[1] = force_not_mem (operands[1]);
1354 if (GET_CODE (operands[1]) != MEM)
1356 rtx op1 = gen_lowpart (SImode, operands[1]);
1357 rtx temp = gen_reg_rtx (SImode);
1358 rtx shift = gen_rtx (CONST_INT, VOIDmode, 16);
1360 emit_insn (gen_ashlsi3 (temp, op1, shift));
1361 emit_insn (gen_ashrsi3 (operands[0], temp, shift));
1366 (define_insn "extendhisi2_internal"
1367 [(set (match_operand:SI 0 "register_operand" "=d,d")
1368 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,m")))]
1370 "* return mips_move_1word (operands, insn, FALSE);"
1371 [(set_attr "type" "load")
1372 (set_attr "mode" "SI")
1373 (set_attr "length" "1,2")])
1375 (define_expand "extendqihi2"
1376 [(set (match_operand:HI 0 "register_operand" "")
1377 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]
1381 if (optimize && GET_CODE (operands[1]) == MEM)
1382 operands[1] = force_not_mem (operands[1]);
1384 if (GET_CODE (operands[1]) != MEM)
1386 rtx op0 = gen_lowpart (SImode, operands[0]);
1387 rtx op1 = gen_lowpart (SImode, operands[1]);
1388 rtx temp = gen_reg_rtx (SImode);
1389 rtx shift = gen_rtx (CONST_INT, VOIDmode, 24);
1391 emit_insn (gen_ashlsi3 (temp, op1, shift));
1392 emit_insn (gen_ashrsi3 (op0, temp, shift));
1397 (define_insn "extendqihi2_internal"
1398 [(set (match_operand:HI 0 "register_operand" "=d,d")
1399 (sign_extend:HI (match_operand:QI 1 "memory_operand" "R,m")))]
1401 "* return mips_move_1word (operands, insn, FALSE);"
1402 [(set_attr "type" "load")
1403 (set_attr "mode" "SI")
1404 (set_attr "length" "1,2")])
1407 (define_expand "extendqisi2"
1408 [(set (match_operand:SI 0 "register_operand" "")
1409 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
1413 if (optimize && GET_CODE (operands[1]) == MEM)
1414 operands[1] = force_not_mem (operands[1]);
1416 if (GET_CODE (operands[1]) != MEM)
1418 rtx op1 = gen_lowpart (SImode, operands[1]);
1419 rtx temp = gen_reg_rtx (SImode);
1420 rtx shift = gen_rtx (CONST_INT, VOIDmode, 24);
1422 emit_insn (gen_ashlsi3 (temp, op1, shift));
1423 emit_insn (gen_ashrsi3 (operands[0], temp, shift));
1428 (define_insn "extendqisi2_insn"
1429 [(set (match_operand:SI 0 "register_operand" "=d,d")
1430 (sign_extend:SI (match_operand:QI 1 "memory_operand" "R,m")))]
1432 "* return mips_move_1word (operands, insn, FALSE);"
1433 [(set_attr "type" "load")
1434 (set_attr "mode" "SI")
1435 (set_attr "length" "1,2")])
1438 (define_insn "extendsfdf2"
1439 [(set (match_operand:DF 0 "register_operand" "=f")
1440 (float_extend:DF (match_operand:SF 1 "register_operand" "f")))]
1443 [(set_attr "type" "fcvt")
1444 (set_attr "mode" "DF")
1445 (set_attr "length" "1")])
1450 ;; ....................
1454 ;; ....................
1456 (define_insn "fix_truncdfsi2"
1457 [(set (match_operand:SI 0 "general_operand" "=d,*f,R,o")
1458 (fix:SI (match_operand:DF 1 "register_operand" "f,*f,f,f")))
1459 (clobber (match_scratch:SI 2 "=d,*d,d,d"))
1460 (clobber (match_scratch:DF 3 "=f,*X,f,f"))]
1466 if (which_alternative == 1)
1467 return \"trunc.w.d %0,%1,%2\";
1469 output_asm_insn (\"trunc.w.d %3,%1,%2\", operands);
1471 xoperands[0] = operands[0];
1472 xoperands[1] = operands[3];
1473 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
1476 [(set_attr "type" "fcvt")
1477 (set_attr "mode" "DF")
1478 (set_attr "length" "11,9,10,11")])
1481 (define_insn "fix_truncsfsi2"
1482 [(set (match_operand:SI 0 "general_operand" "=d,*f,R,o")
1483 (fix:SI (match_operand:SF 1 "register_operand" "f,*f,f,f")))
1484 (clobber (match_scratch:SI 2 "=d,*d,d,d"))
1485 (clobber (match_scratch:SF 3 "=f,*X,f,f"))]
1491 if (which_alternative == 1)
1492 return \"trunc.w.s %0,%1,%2\";
1494 output_asm_insn (\"trunc.w.s %3,%1,%2\", operands);
1496 xoperands[0] = operands[0];
1497 xoperands[1] = operands[3];
1498 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
1501 [(set_attr "type" "fcvt")
1502 (set_attr "mode" "SF")
1503 (set_attr "length" "11,9,10,11")])
1506 (define_insn "floatsidf2"
1507 [(set (match_operand:DF 0 "register_operand" "=f,f,f")
1508 (float:DF (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
1512 dslots_load_total++;
1513 if (GET_CODE (operands[1]) == MEM)
1514 return \"l.s\\t%0,%1%#\;cvt.d.w\\t%0,%0\";
1516 return \"mtc1\\t%1,%0%#\;cvt.d.w\\t%0,%0\";
1518 [(set_attr "type" "fcvt")
1519 (set_attr "mode" "DF")
1520 (set_attr "length" "3,4,3")])
1523 (define_insn "floatsisf2"
1524 [(set (match_operand:SF 0 "register_operand" "=f,f,f")
1525 (float:SF (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
1529 dslots_load_total++;
1530 if (GET_CODE (operands[1]) == MEM)
1531 return \"l.s\\t%0,%1%#\;cvt.s.w\\t%0,%0\";
1533 return \"mtc1\\t%1,%0%#\;cvt.s.w\\t%0,%0\";
1535 [(set_attr "type" "fcvt")
1536 (set_attr "mode" "SF")
1537 (set_attr "length" "3,4,3")])
1540 (define_expand "fixuns_truncdfsi2"
1541 [(set (match_operand:SI 0 "register_operand" "")
1542 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
1546 rtx reg1 = gen_reg_rtx (DFmode);
1547 rtx reg2 = gen_reg_rtx (DFmode);
1548 rtx reg3 = gen_reg_rtx (SImode);
1549 rtx label1 = gen_label_rtx ();
1550 rtx label2 = gen_label_rtx ();
1551 REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (1.0, 31);
1553 if (reg1) /* turn off complaints about unreached code */
1555 emit_move_insn (reg1, immed_real_const_1 (offset, DFmode));
1556 do_pending_stack_adjust ();
1558 emit_insn (gen_cmpdf (operands[1], reg1));
1559 emit_jump_insn (gen_bge (label1));
1561 emit_insn (gen_fix_truncdfsi2 (operands[0], operands[1]));
1562 emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
1563 gen_rtx (LABEL_REF, VOIDmode, label2)));
1566 emit_label (label1);
1567 emit_move_insn (reg2, gen_rtx (MINUS, DFmode, operands[1], reg1));
1568 emit_move_insn (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
1570 emit_insn (gen_fix_truncdfsi2 (operands[0], reg2));
1571 emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
1573 emit_label (label2);
1575 /* allow REG_NOTES to be set on last insn (labels don't have enough
1576 fields, and can't be used for REG_NOTES anyway). */
1577 emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
1583 (define_expand "fixuns_truncsfsi2"
1584 [(set (match_operand:SI 0 "register_operand" "")
1585 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
1589 rtx reg1 = gen_reg_rtx (SFmode);
1590 rtx reg2 = gen_reg_rtx (SFmode);
1591 rtx reg3 = gen_reg_rtx (SImode);
1592 rtx label1 = gen_label_rtx ();
1593 rtx label2 = gen_label_rtx ();
1594 REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (1.0, 31);
1596 if (reg1) /* turn off complaints about unreached code */
1598 emit_move_insn (reg1, immed_real_const_1 (offset, SFmode));
1599 do_pending_stack_adjust ();
1601 emit_insn (gen_cmpsf (operands[1], reg1));
1602 emit_jump_insn (gen_bge (label1));
1604 emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
1605 emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
1606 gen_rtx (LABEL_REF, VOIDmode, label2)));
1609 emit_label (label1);
1610 emit_move_insn (reg2, gen_rtx (MINUS, SFmode, operands[1], reg1));
1611 emit_move_insn (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
1613 emit_insn (gen_fix_truncsfsi2 (operands[0], reg2));
1614 emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
1616 emit_label (label2);
1618 /* allow REG_NOTES to be set on last insn (labels don't have enough
1619 fields, and can't be used for REG_NOTES anyway). */
1620 emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
1627 ;; ....................
1631 ;; ....................
1633 ;; unaligned word moves generated by the block moves.
1635 (define_expand "movsi_unaligned"
1636 [(set (match_operand:SI 0 "general_operand" "")
1637 (unspec [(match_operand:SI 1 "general_operand" "")] 0))]
1642 if (GET_CODE (operands[0]) == MEM)
1644 rtx reg = gen_reg_rtx (SImode);
1645 rtx insn = emit_insn (gen_movsi_ulw (reg, operands[1]));
1646 rtx addr = XEXP (operands[0], 0);
1647 if (CONSTANT_P (addr))
1648 REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUIV, addr, REG_NOTES (insn));
1650 if (reg_or_0_operand (operands[1], SImode))
1656 /* Generate appropriate load, store. If not a load or store,
1657 do a normal movsi. */
1658 if (GET_CODE (operands[0]) != MEM && GET_CODE (operands[1]) != MEM)
1660 emit_insn (gen_movsi (operands[0], operands[1]));
1664 /* Fall through and generate normal code. */
1667 (define_insn "movsi_ulw"
1668 [(set (match_operand:SI 0 "register_operand" "=&d,&d,d,d")
1669 (unspec [(match_operand:SI 1 "general_operand" "R,o,dIKL,M")] 0))]
1679 if (which_alternative != 0)
1680 return mips_move_1word (operands, insn, FALSE);
1683 mips_count_memory_refs (operands[1], 2);
1685 /* The stack/frame pointers are always aligned, so we can convert
1686 to the faster lw if we are referencing an aligned stack location. */
1688 offset = const0_rtx;
1689 addr = XEXP (operands[1], 0);
1690 mem_addr = eliminate_constant_term (addr, &offset);
1692 if ((INTVAL (offset) & (UNITS_PER_WORD-1)) == 0
1693 && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
1694 ret = \"lw\\t%0,%1\";
1698 ret = \"ulw\\t%0,%1\";
1701 enum rtx_code code = GET_CODE (addr);
1703 if (code == CONST || code == SYMBOL_REF || code == LABEL_REF)
1705 operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 1);
1706 ret = \"%[la\\t%2,%1\;ulw\\t%0,0(%2)%]\";
1711 return mips_fill_delay_slot (ret, DELAY_LOAD, operands, insn);
1713 [(set_attr "type" "load,load,move,arith")
1714 (set_attr "mode" "SI")
1715 (set_attr "length" "2,4,1,2")])
1717 (define_insn "movsi_usw"
1718 [(set (match_operand:SI 0 "memory_operand" "=R,o")
1719 (unspec [(match_operand:SI 1 "reg_or_0_operand" "dJ,dJ")] 0))]
1723 rtx offset = const0_rtx;
1724 rtx addr = XEXP (operands[0], 0);
1725 rtx mem_addr = eliminate_constant_term (addr, &offset);
1728 mips_count_memory_refs (operands[0], 2);
1730 /* The stack/frame pointers are always aligned, so we can convert
1731 to the faster sw if we are referencing an aligned stack location. */
1733 if ((INTVAL (offset) & (UNITS_PER_WORD-1)) == 0
1734 && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
1735 return \"sw\\t%1,%0\";
1740 enum rtx_code code = GET_CODE (XEXP (operands[0], 0));
1742 if (code == CONST || code == SYMBOL_REF || code == LABEL_REF)
1744 operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 1);
1745 return \"%[la\\t%2,%0\;usw\\t%z1,0(%2)%]\";
1749 return \"usw\\t%z1,%0\";
1751 [(set_attr "type" "store")
1752 (set_attr "mode" "SI")
1753 (set_attr "length" "2,4")])
1756 ;; 64-bit integer moves
1758 ;; Unlike most other insns, the move insns can't be split with
1759 ;; different predicates, because register spilling and other parts of
1760 ;; the compiler, have memoized the insn number already.
1762 (define_expand "movdi"
1763 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1764 (match_operand:DI 1 "general_operand" ""))]
1768 if ((reload_in_progress | reload_completed) == 0
1769 && !register_operand (operands[0], DImode)
1770 && !register_operand (operands[1], DImode)
1771 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
1772 && operands[1] != CONST0_RTX (DImode))
1774 rtx temp = force_reg (DImode, operands[1]);
1775 emit_move_insn (operands[0], temp);
1780 (define_insn "movdi_internal"
1781 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,R,o,*d,*x")
1782 (match_operand:DI 1 "general_operand" "d,iF,R,o,d,d,*x,*d"))]
1783 "register_operand (operands[0], DImode)
1784 || register_operand (operands[1], DImode)
1785 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
1786 || operands[1] == CONST0_RTX (DImode)"
1787 "* return mips_move_2words (operands, insn); "
1788 [(set_attr "type" "move,arith,load,load,store,store,hilo,hilo")
1789 (set_attr "mode" "DI")
1790 (set_attr "length" "2,4,2,4,2,4,2,2")])
1793 [(set (match_operand:DI 0 "register_operand" "")
1794 (match_operand:DI 1 "register_operand" ""))]
1795 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1796 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1797 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
1799 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))
1800 (set (subreg:SI (match_dup 0) 1) (subreg:SI (match_dup 1) 1))]
1804 ;; 32-bit Integer moves
1807 [(set (match_operand:SI 0 "register_operand" "")
1808 (match_operand:SI 1 "large_int" ""))]
1809 "!TARGET_DEBUG_D_MODE"
1813 (ior:SI (match_dup 0)
1817 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 0xffff0000);
1818 operands[3] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 0x0000ffff);
1821 ;; Unlike most other insns, the move insns can't be split with
1822 ;; different predicates, because register spilling and other parts of
1823 ;; the compiler, have memoized the insn number already.
1825 (define_expand "movsi"
1826 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1827 (match_operand:SI 1 "general_operand" ""))]
1831 if ((reload_in_progress | reload_completed) == 0
1832 && !register_operand (operands[0], SImode)
1833 && !register_operand (operands[1], SImode)
1834 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0))
1836 rtx temp = force_reg (SImode, operands[1]);
1837 emit_move_insn (operands[0], temp);
1842 ;; The difference between these two is whether or not ints are allowed
1843 ;; in FP registers (off by default, use -mdebugh to enable).
1845 (define_insn "movsi_internal1"
1846 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,R,m,*d,*f*z,*f,*f,*f,*R,*m,*x,*d")
1847 (match_operand:SI 1 "general_operand" "d,S,IKL,Mnis,R,m,dJ,dJ,*f*z,*d,*f,*R,*m,*f,*f,*d,*x"))]
1848 "TARGET_DEBUG_H_MODE
1849 && (register_operand (operands[0], SImode)
1850 || register_operand (operands[1], SImode)
1851 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
1852 "* return mips_move_1word (operands, insn, TRUE);"
1853 [(set_attr "type" "move,load,arith,arith,load,load,store,store,xfer,xfer,move,load,load,store,store,hilo,hilo")
1854 (set_attr "mode" "SI")
1855 (set_attr "length" "1,2,1,2,1,2,1,2,1,1,1,1,2,1,2,1,1")])
1857 (define_insn "movsi_internal2"
1858 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,R,m,*d,*z,*d,*x")
1859 (match_operand:SI 1 "general_operand" "d,S,IKL,Mnis,R,m,dJ,dJ,*z,*d,*x,*d"))]
1860 "!TARGET_DEBUG_H_MODE
1861 && (register_operand (operands[0], SImode)
1862 || register_operand (operands[1], SImode)
1863 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
1864 "* return mips_move_1word (operands, insn, TRUE);"
1865 [(set_attr "type" "move,load,arith,arith,load,load,store,store,xfer,xfer,hilo,hilo")
1866 (set_attr "mode" "SI")
1867 (set_attr "length" "1,2,1,2,1,2,1,2,1,1,1,1")])
1870 ;; 16-bit Integer moves
1872 ;; Unlike most other insns, the move insns can't be split with
1873 ;; different predicates, because register spilling and other parts of
1874 ;; the compiler, have memoized the insn number already.
1875 ;; Unsigned loads are used because BYTE_LOADS_ZERO_EXTEND is defined
1877 (define_expand "movhi"
1878 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1879 (match_operand:HI 1 "general_operand" ""))]
1883 if ((reload_in_progress | reload_completed) == 0
1884 && !register_operand (operands[0], HImode)
1885 && !register_operand (operands[1], HImode)
1886 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0))
1888 rtx temp = force_reg (HImode, operands[1]);
1889 emit_move_insn (operands[0], temp);
1894 ;; The difference between these two is whether or not ints are allowed
1895 ;; in FP registers (off by default, use -mdebugh to enable).
1897 (define_insn "movhi_internal1"
1898 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*f,*f*z,*x,*d")
1899 (match_operand:HI 1 "general_operand" "d,IK,R,m,dJ,dJ,*f*z,*d,*f,*d,*x"))]
1900 "TARGET_DEBUG_H_MODE
1901 && (register_operand (operands[0], HImode)
1902 || register_operand (operands[1], HImode)
1903 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
1904 "* return mips_move_1word (operands, insn, TRUE);"
1905 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,move,hilo,hilo")
1906 (set_attr "mode" "HI")
1907 (set_attr "length" "1,1,1,2,1,2,1,1,1,1,1")])
1909 (define_insn "movhi_internal2"
1910 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*z,*x,*d")
1911 (match_operand:HI 1 "general_operand" "d,IK,R,m,dJ,dJ,*z,*d,*d,*x"))]
1912 "!TARGET_DEBUG_H_MODE
1913 && (register_operand (operands[0], HImode)
1914 || register_operand (operands[1], HImode)
1915 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
1916 "* return mips_move_1word (operands, insn, TRUE);"
1917 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,hilo,hilo")
1918 (set_attr "mode" "HI")
1919 (set_attr "length" "1,1,1,2,1,2,1,1,1,1")])
1922 ;; 8-bit Integer moves
1924 ;; Unlike most other insns, the move insns can't be split with
1925 ;; different predicates, because register spilling and other parts of
1926 ;; the compiler, have memoized the insn number already.
1927 ;; Unsigned loads are used because BYTE_LOADS_ZERO_EXTEND is defined
1929 (define_expand "movqi"
1930 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1931 (match_operand:QI 1 "general_operand" ""))]
1935 if ((reload_in_progress | reload_completed) == 0
1936 && !register_operand (operands[0], QImode)
1937 && !register_operand (operands[1], QImode)
1938 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0))
1940 rtx temp = force_reg (QImode, operands[1]);
1941 emit_move_insn (operands[0], temp);
1946 ;; The difference between these two is whether or not ints are allowed
1947 ;; in FP registers (off by default, use -mdebugh to enable).
1949 (define_insn "movqi_internal1"
1950 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*f*z,*f,*x,*d")
1951 (match_operand:QI 1 "general_operand" "d,IK,R,m,dJ,dJ,*f*z,*d,*f,*d,*x"))]
1952 "TARGET_DEBUG_H_MODE
1953 && (register_operand (operands[0], QImode)
1954 || register_operand (operands[1], QImode)
1955 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
1956 "* return mips_move_1word (operands, insn, TRUE);"
1957 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,move,hilo,hilo")
1958 (set_attr "mode" "QI")
1959 (set_attr "length" "1,1,1,2,1,2,1,1,1,1,1")])
1961 (define_insn "movqi_internal2"
1962 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*z,*x,*d")
1963 (match_operand:QI 1 "general_operand" "d,IK,R,m,dJ,dJ,*z,*d,*d,*x"))]
1964 "!TARGET_DEBUG_H_MODE
1965 && (register_operand (operands[0], QImode)
1966 || register_operand (operands[1], QImode)
1967 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
1968 "* return mips_move_1word (operands, insn, TRUE);"
1969 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,hilo,hilo")
1970 (set_attr "mode" "QI")
1971 (set_attr "length" "1,1,1,2,1,2,1,1,1,1")])
1974 ;; 32-bit floating point moves
1976 (define_expand "movsf"
1977 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1978 (match_operand:SF 1 "general_operand" ""))]
1982 if ((reload_in_progress | reload_completed) == 0
1983 && !register_operand (operands[0], SFmode)
1984 && !register_operand (operands[1], SFmode)
1985 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
1986 && operands[1] != CONST0_RTX (SFmode))
1988 rtx temp = force_reg (SFmode, operands[1]);
1989 emit_move_insn (operands[0], temp);
1994 (define_insn "movsf_internal"
1995 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,m,*f,*d,*d,*d,*d,*R,*m")
1996 (match_operand:SF 1 "general_operand" "f,G,R,Em,fG,fG,*d,*f,*G*d,*R,*E*m,*d,*d"))]
1997 "register_operand (operands[0], SFmode)
1998 || register_operand (operands[1], SFmode)
1999 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2000 || operands[1] == CONST0_RTX (SFmode)"
2001 "* return mips_move_1word (operands, insn, FALSE);"
2002 [(set_attr "type" "move,xfer,load,load,store,store,xfer,xfer,move,load,load,store,store")
2003 (set_attr "mode" "SF")
2004 (set_attr "length" "1,1,1,2,1,2,1,1,1,1,2,1,2")])
2007 ;; 64-bit floating point moves
2009 (define_expand "movdf"
2010 [(set (match_operand:DF 0 "nonimmediate_operand" "")
2011 (match_operand:DF 1 "general_operand" ""))]
2015 if ((reload_in_progress | reload_completed) == 0
2016 && !register_operand (operands[0], DFmode)
2017 && !register_operand (operands[1], DFmode)
2018 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
2019 && operands[1] != CONST0_RTX (DFmode))
2021 rtx temp = force_reg (DFmode, operands[1]);
2022 emit_move_insn (operands[0], temp);
2027 (define_insn "movdf_internal"
2028 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,o,f,*f,*d,*d,*d,*d,*R,*o")
2029 (match_operand:DF 1 "general_operand" "f,R,o,fG,fG,E,*d,*f,*d*G,*R,*o*E,*d,*d"))]
2030 "register_operand (operands[0], DFmode)
2031 || register_operand (operands[1], DFmode)
2032 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2033 || operands[1] == CONST0_RTX (DFmode)"
2034 "* return mips_move_2words (operands, insn); "
2035 [(set_attr "type" "move,load,load,store,store,load,xfer,xfer,move,load,load,store,store")
2036 (set_attr "mode" "DF")
2037 (set_attr "length" "1,2,4,2,4,4,2,2,2,2,4,2,4")])
2040 [(set (match_operand:DF 0 "register_operand" "")
2041 (match_operand:DF 1 "register_operand" ""))]
2042 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2043 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
2044 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
2046 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))
2047 (set (subreg:SI (match_dup 0) 1) (subreg:SI (match_dup 1) 1))]
2051 ;; Block moves, see mips.c for more details.
2052 ;; Argument 0 is the destination
2053 ;; Argument 1 is the source
2054 ;; Argument 2 is the length
2055 ;; Argument 3 is the alignment
2057 (define_expand "movstrsi"
2058 [(parallel [(set (mem:BLK (match_operand:BLK 0 "general_operand" ""))
2059 (mem:BLK (match_operand:BLK 1 "general_operand" "")))
2060 (use (match_operand:SI 2 "arith32_operand" ""))
2061 (use (match_operand:SI 3 "immediate_operand" ""))])]
2065 if (operands[0]) /* avoid unused code messages */
2067 expand_block_move (operands);
2072 ;; Insn generated by block moves
2074 (define_insn "movstrsi_internal"
2075 [(set (match_operand:BLK 0 "memory_operand" "=Ro") ;; destination
2076 (match_operand:BLK 1 "memory_operand" "Ro")) ;; source
2077 (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
2078 (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
2079 (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
2080 (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
2081 (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
2082 (use (match_operand:SI 3 "small_int" "I")) ;; alignment
2083 (use (const_int 0))] ;; normal block move
2085 "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NORMAL);"
2086 [(set_attr "type" "multi")
2087 (set_attr "mode" "none")
2088 (set_attr "length" "20")])
2090 ;; Split a block move into 2 parts, the first part is everything
2091 ;; except for the last move, and the second part is just the last
2092 ;; store, which is exactly 1 instruction (ie, not a usw), so it can
2093 ;; fill a delay slot. This also prevents a bug in delayed branches
2094 ;; from showing up, which reuses one of the registers in our clobbers.
2097 [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
2098 (mem:BLK (match_operand:SI 1 "register_operand" "")))
2099 (clobber (match_operand:SI 4 "register_operand" ""))
2100 (clobber (match_operand:SI 5 "register_operand" ""))
2101 (clobber (match_operand:SI 6 "register_operand" ""))
2102 (clobber (match_operand:SI 7 "register_operand" ""))
2103 (use (match_operand:SI 2 "small_int" ""))
2104 (use (match_operand:SI 3 "small_int" ""))
2105 (use (const_int 0))]
2107 "reload_completed && !TARGET_DEBUG_D_MODE && INTVAL (operands[2]) > 0"
2109 ;; All but the last move
2110 [(parallel [(set (mem:BLK (match_dup 0))
2111 (mem:BLK (match_dup 1)))
2112 (clobber (match_dup 4))
2113 (clobber (match_dup 5))
2114 (clobber (match_dup 6))
2115 (clobber (match_dup 7))
2118 (use (const_int 1))])
2120 ;; The last store, so it can fill a delay slot
2121 (parallel [(set (mem:BLK (match_dup 0))
2122 (mem:BLK (match_dup 1)))
2123 (clobber (match_dup 4))
2124 (clobber (match_dup 5))
2125 (clobber (match_dup 6))
2126 (clobber (match_dup 7))
2129 (use (const_int 2))])]
2133 (define_insn "movstrsi_internal2"
2134 [(set (match_operand:BLK 0 "memory_operand" "=Ro") ;; destination
2135 (match_operand:BLK 1 "memory_operand" "Ro")) ;; source
2136 (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
2137 (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
2138 (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
2139 (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
2140 (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
2141 (use (match_operand:SI 3 "small_int" "I")) ;; alignment
2142 (use (const_int 1))] ;; all but last store
2144 "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NOT_LAST);"
2145 [(set_attr "type" "multi")
2146 (set_attr "mode" "none")
2147 (set_attr "length" "20")])
2149 (define_insn "movstrsi_internal3"
2150 [(set (match_operand:BLK 0 "memory_operand" "=Ro") ;; destination
2151 (match_operand:BLK 1 "memory_operand" "Ro")) ;; source
2152 (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
2153 (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
2154 (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
2155 (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
2156 (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
2157 (use (match_operand:SI 3 "small_int" "I")) ;; alignment
2158 (use (const_int 2))] ;; just last store of block mvoe
2160 "* return output_block_move (insn, operands, 4, BLOCK_MOVE_LAST);"
2161 [(set_attr "type" "store")
2162 (set_attr "mode" "none")
2163 (set_attr "length" "1")])
2167 ;; ....................
2171 ;; ....................
2173 (define_insn "ashlsi3"
2174 [(set (match_operand:SI 0 "register_operand" "=d")
2175 (ashift:SI (match_operand:SI 1 "register_operand" "d")
2176 (match_operand:SI 2 "arith_operand" "dI")))]
2180 if (GET_CODE (operands[2]) == CONST_INT)
2181 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
2183 return \"sll\\t%0,%1,%2\";
2185 [(set_attr "type" "arith")
2186 (set_attr "mode" "SI")
2187 (set_attr "length" "1")])
2190 (define_expand "ashldi3"
2191 [(parallel [(set (match_operand:DI 0 "register_operand" "")
2192 (ashift:DI (match_operand:DI 1 "register_operand" "")
2193 (match_operand:SI 2 "arith_operand" "")))
2194 (clobber (match_dup 3))])]
2195 "!TARGET_DEBUG_G_MODE"
2196 "operands[3] = gen_reg_rtx (SImode);")
2199 (define_insn "ashldi3_internal"
2200 [(set (match_operand:DI 0 "register_operand" "=&d")
2201 (ashift:DI (match_operand:DI 1 "register_operand" "d")
2202 (match_operand:SI 2 "register_operand" "d")))
2203 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2204 "!TARGET_DEBUG_G_MODE"
2207 operands[4] = const0_rtx;
2208 dslots_jump_total += 3;
2209 dslots_jump_filled += 2;
2211 return \"sll\\t%3,%2,26\\n\\
2212 \\tbgez\\t%3,1f\\n\\
2213 \\tsll\\t%M0,%L1,%2\\n\\
2215 \\tmove\\t%L0,%z4%)\\n\\
2218 \\t%(beq\\t%3,%z4,2f\\n\\
2219 \\tsll\\t%M0,%M1,%2%)\\n\\
2221 \\tsubu\\t%3,%z4,%2\\n\\
2222 \\tsrl\\t%3,%L1,%3\\n\\
2223 \\tor\\t%M0,%M0,%3\\n\\
2225 \\tsll\\t%L0,%L1,%2\\n\\
2228 [(set_attr "type" "darith")
2229 (set_attr "mode" "SI")
2230 (set_attr "length" "12")])
2233 (define_insn "ashldi3_internal2"
2234 [(set (match_operand:DI 0 "register_operand" "=d")
2235 (ashift:DI (match_operand:DI 1 "register_operand" "d")
2236 (match_operand:SI 2 "small_int" "IJK")))
2237 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2238 "!TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
2241 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
2242 operands[4] = const0_rtx;
2243 return \"sll\\t%M0,%L1,%2\;move\\t%L0,%z4\";
2245 [(set_attr "type" "darith")
2246 (set_attr "mode" "DI")
2247 (set_attr "length" "2")])
2251 [(set (match_operand:DI 0 "register_operand" "")
2252 (ashift:DI (match_operand:DI 1 "register_operand" "")
2253 (match_operand:SI 2 "small_int" "")))
2254 (clobber (match_operand:SI 3 "register_operand" ""))]
2255 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2256 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2257 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2258 && (INTVAL (operands[2]) & 32) != 0"
2260 [(set (subreg:SI (match_dup 0) 1) (ashift:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
2261 (set (subreg:SI (match_dup 0) 0) (const_int 0))]
2263 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
2267 [(set (match_operand:DI 0 "register_operand" "")
2268 (ashift:DI (match_operand:DI 1 "register_operand" "")
2269 (match_operand:SI 2 "small_int" "")))
2270 (clobber (match_operand:SI 3 "register_operand" ""))]
2271 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2272 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2273 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2274 && (INTVAL (operands[2]) & 32) != 0"
2276 [(set (subreg:SI (match_dup 0) 0) (ashift:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
2277 (set (subreg:SI (match_dup 0) 1) (const_int 0))]
2279 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
2282 (define_insn "ashldi3_internal3"
2283 [(set (match_operand:DI 0 "register_operand" "=d")
2284 (ashift:DI (match_operand:DI 1 "register_operand" "d")
2285 (match_operand:SI 2 "small_int" "IJK")))
2286 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2287 "!TARGET_DEBUG_G_MODE
2288 && (INTVAL (operands[2]) & 63) < 32
2289 && (INTVAL (operands[2]) & 63) != 0"
2292 int amount = INTVAL (operands[2]);
2294 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2295 operands[4] = const0_rtx;
2296 operands[5] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2298 return \"sll\\t%M0,%M1,%2\;srl\\t%3,%L1,%5\;or\\t%M0,%M0,%3\;sll\\t%L0,%L1,%2\";
2300 [(set_attr "type" "darith")
2301 (set_attr "mode" "DI")
2302 (set_attr "length" "4")])
2306 [(set (match_operand:DI 0 "register_operand" "")
2307 (ashift:DI (match_operand:DI 1 "register_operand" "")
2308 (match_operand:SI 2 "small_int" "")))
2309 (clobber (match_operand:SI 3 "register_operand" ""))]
2310 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2311 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2312 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2313 && (INTVAL (operands[2]) & 63) < 32
2314 && (INTVAL (operands[2]) & 63) != 0"
2316 [(set (subreg:SI (match_dup 0) 1)
2317 (ashift:SI (subreg:SI (match_dup 1) 1)
2321 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
2324 (set (subreg:SI (match_dup 0) 1)
2325 (ior:SI (subreg:SI (match_dup 0) 1)
2328 (set (subreg:SI (match_dup 0) 0)
2329 (ashift:SI (subreg:SI (match_dup 1) 0)
2333 int amount = INTVAL (operands[2]);
2334 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2335 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2340 [(set (match_operand:DI 0 "register_operand" "")
2341 (ashift:DI (match_operand:DI 1 "register_operand" "")
2342 (match_operand:SI 2 "small_int" "")))
2343 (clobber (match_operand:SI 3 "register_operand" ""))]
2344 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2345 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2346 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2347 && (INTVAL (operands[2]) & 63) < 32
2348 && (INTVAL (operands[2]) & 63) != 0"
2350 [(set (subreg:SI (match_dup 0) 0)
2351 (ashift:SI (subreg:SI (match_dup 1) 0)
2355 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
2358 (set (subreg:SI (match_dup 0) 0)
2359 (ior:SI (subreg:SI (match_dup 0) 0)
2362 (set (subreg:SI (match_dup 0) 1)
2363 (ashift:SI (subreg:SI (match_dup 1) 1)
2367 int amount = INTVAL (operands[2]);
2368 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2369 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2373 (define_insn "ashrsi3"
2374 [(set (match_operand:SI 0 "register_operand" "=d")
2375 (ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
2376 (match_operand:SI 2 "arith_operand" "dI")))]
2380 if (GET_CODE (operands[2]) == CONST_INT)
2381 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
2383 return \"sra\\t%0,%1,%2\";
2385 [(set_attr "type" "arith")
2386 (set_attr "mode" "SI")
2387 (set_attr "length" "1")])
2390 (define_expand "ashrdi3"
2391 [(parallel [(set (match_operand:DI 0 "register_operand" "")
2392 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
2393 (match_operand:SI 2 "arith_operand" "")))
2394 (clobber (match_dup 3))])]
2395 "!TARGET_DEBUG_G_MODE"
2396 "operands[3] = gen_reg_rtx (SImode);")
2399 (define_insn "ashrdi3_internal"
2400 [(set (match_operand:DI 0 "register_operand" "=&d")
2401 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
2402 (match_operand:SI 2 "register_operand" "d")))
2403 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2404 "!TARGET_DEBUG_G_MODE"
2407 operands[4] = const0_rtx;
2408 dslots_jump_total += 3;
2409 dslots_jump_filled += 2;
2411 return \"sll\\t%3,%2,26\\n\\
2412 \\tbgez\\t%3,1f\\n\\
2413 \\tsra\\t%L0,%M1,%2\\n\\
2415 \\tsra\\t%M0,%M1,31%)\\n\\
2418 \\t%(beq\\t%3,%z4,2f\\n\\
2419 \\tsrl\\t%L0,%L1,%2%)\\n\\
2421 \\tsubu\\t%3,%z4,%2\\n\\
2422 \\tsll\\t%3,%M1,%3\\n\\
2423 \\tor\\t%L0,%L0,%3\\n\\
2425 \\tsra\\t%M0,%M1,%2\\n\\
2428 [(set_attr "type" "darith")
2429 (set_attr "mode" "DI")
2430 (set_attr "length" "12")])
2433 (define_insn "ashrdi3_internal2"
2434 [(set (match_operand:DI 0 "register_operand" "=d")
2435 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
2436 (match_operand:SI 2 "small_int" "IJK")))
2437 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2438 "!TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
2441 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
2442 return \"sra\\t%L0,%M1,%2\;sra\\t%M0,%M1,31\";
2444 [(set_attr "type" "darith")
2445 (set_attr "mode" "DI")
2446 (set_attr "length" "2")])
2450 [(set (match_operand:DI 0 "register_operand" "")
2451 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
2452 (match_operand:SI 2 "small_int" "")))
2453 (clobber (match_operand:SI 3 "register_operand" ""))]
2454 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2455 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2456 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2457 && (INTVAL (operands[2]) & 32) != 0"
2459 [(set (subreg:SI (match_dup 0) 0) (ashiftrt:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
2460 (set (subreg:SI (match_dup 0) 1) (ashiftrt:SI (subreg:SI (match_dup 1) 1) (const_int 31)))]
2462 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
2466 [(set (match_operand:DI 0 "register_operand" "")
2467 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
2468 (match_operand:SI 2 "small_int" "")))
2469 (clobber (match_operand:SI 3 "register_operand" ""))]
2470 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2471 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2472 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2473 && (INTVAL (operands[2]) & 32) != 0"
2475 [(set (subreg:SI (match_dup 0) 1) (ashiftrt:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
2476 (set (subreg:SI (match_dup 0) 0) (ashiftrt:SI (subreg:SI (match_dup 1) 0) (const_int 31)))]
2478 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
2481 (define_insn "ashrdi3_internal3"
2482 [(set (match_operand:DI 0 "register_operand" "=d")
2483 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
2484 (match_operand:SI 2 "small_int" "IJK")))
2485 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2486 "!TARGET_DEBUG_G_MODE
2487 && (INTVAL (operands[2]) & 63) < 32
2488 && (INTVAL (operands[2]) & 63) != 0"
2491 int amount = INTVAL (operands[2]);
2493 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2494 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2496 return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;sra\\t%M0,%M1,%2\";
2498 [(set_attr "type" "darith")
2499 (set_attr "mode" "DI")
2500 (set_attr "length" "4")])
2504 [(set (match_operand:DI 0 "register_operand" "")
2505 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
2506 (match_operand:SI 2 "small_int" "")))
2507 (clobber (match_operand:SI 3 "register_operand" ""))]
2508 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2509 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2510 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2511 && (INTVAL (operands[2]) & 63) < 32
2512 && (INTVAL (operands[2]) & 63) != 0"
2514 [(set (subreg:SI (match_dup 0) 0)
2515 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
2519 (ashift:SI (subreg:SI (match_dup 1) 1)
2522 (set (subreg:SI (match_dup 0) 0)
2523 (ior:SI (subreg:SI (match_dup 0) 0)
2526 (set (subreg:SI (match_dup 0) 1)
2527 (ashiftrt:SI (subreg:SI (match_dup 1) 1)
2531 int amount = INTVAL (operands[2]);
2532 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2533 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2538 [(set (match_operand:DI 0 "register_operand" "")
2539 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
2540 (match_operand:SI 2 "small_int" "")))
2541 (clobber (match_operand:SI 3 "register_operand" ""))]
2542 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2543 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2544 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2545 && (INTVAL (operands[2]) & 63) < 32
2546 && (INTVAL (operands[2]) & 63) != 0"
2548 [(set (subreg:SI (match_dup 0) 1)
2549 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
2553 (ashift:SI (subreg:SI (match_dup 1) 0)
2556 (set (subreg:SI (match_dup 0) 1)
2557 (ior:SI (subreg:SI (match_dup 0) 1)
2560 (set (subreg:SI (match_dup 0) 0)
2561 (ashiftrt:SI (subreg:SI (match_dup 1) 0)
2565 int amount = INTVAL (operands[2]);
2566 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2567 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2571 (define_insn "lshrsi3"
2572 [(set (match_operand:SI 0 "register_operand" "=d")
2573 (lshiftrt:SI (match_operand:SI 1 "register_operand" "d")
2574 (match_operand:SI 2 "arith_operand" "dI")))]
2578 if (GET_CODE (operands[2]) == CONST_INT)
2579 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
2581 return \"srl\\t%0,%1,%2\";
2583 [(set_attr "type" "arith")
2584 (set_attr "mode" "SI")
2585 (set_attr "length" "1")])
2588 (define_expand "lshrdi3"
2589 [(parallel [(set (match_operand:DI 0 "register_operand" "")
2590 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
2591 (match_operand:SI 2 "arith_operand" "")))
2592 (clobber (match_dup 3))])]
2593 "!TARGET_DEBUG_G_MODE"
2594 "operands[3] = gen_reg_rtx (SImode);")
2597 (define_insn "lshrdi3_internal"
2598 [(set (match_operand:DI 0 "register_operand" "=&d")
2599 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
2600 (match_operand:SI 2 "register_operand" "d")))
2601 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2602 "!TARGET_DEBUG_G_MODE"
2605 operands[4] = const0_rtx;
2606 dslots_jump_total += 3;
2607 dslots_jump_filled += 2;
2609 return \"sll\\t%3,%2,26\\n\\
2610 \\tbgez\\t%3,1f\\n\\
2611 \\tsrl\\t%L0,%M1,%2\\n\\
2613 \\tmove\\t%M0,%z4%)\\n\\
2616 \\t%(beq\\t%3,%z4,2f\\n\\
2617 \\tsrl\\t%L0,%L1,%2%)\\n\\
2619 \\tsubu\\t%3,%z4,%2\\n\\
2620 \\tsll\\t%3,%M1,%3\\n\\
2621 \\tor\\t%L0,%L0,%3\\n\\
2623 \\tsrl\\t%M0,%M1,%2\\n\\
2626 [(set_attr "type" "darith")
2627 (set_attr "mode" "DI")
2628 (set_attr "length" "12")])
2631 (define_insn "lshrdi3_internal2"
2632 [(set (match_operand:DI 0 "register_operand" "=d")
2633 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
2634 (match_operand:SI 2 "small_int" "IJK")))
2635 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2636 "!TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
2639 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
2640 operands[4] = const0_rtx;
2641 return \"srl\\t%L0,%M1,%2\;move\\t%M0,%z4\";
2643 [(set_attr "type" "darith")
2644 (set_attr "mode" "DI")
2645 (set_attr "length" "2")])
2649 [(set (match_operand:DI 0 "register_operand" "")
2650 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
2651 (match_operand:SI 2 "small_int" "")))
2652 (clobber (match_operand:SI 3 "register_operand" ""))]
2653 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2654 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2655 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2656 && (INTVAL (operands[2]) & 32) != 0"
2658 [(set (subreg:SI (match_dup 0) 0) (lshiftrt:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
2659 (set (subreg:SI (match_dup 0) 1) (const_int 0))]
2661 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
2665 [(set (match_operand:DI 0 "register_operand" "")
2666 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
2667 (match_operand:SI 2 "small_int" "")))
2668 (clobber (match_operand:SI 3 "register_operand" ""))]
2669 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2670 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2671 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2672 && (INTVAL (operands[2]) & 32) != 0"
2674 [(set (subreg:SI (match_dup 0) 1) (lshiftrt:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
2675 (set (subreg:SI (match_dup 0) 0) (const_int 0))]
2677 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
2680 (define_insn "lshrdi3_internal3"
2681 [(set (match_operand:DI 0 "register_operand" "=d")
2682 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
2683 (match_operand:SI 2 "small_int" "IJK")))
2684 (clobber (match_operand:SI 3 "register_operand" "=d"))]
2685 "!TARGET_DEBUG_G_MODE
2686 && (INTVAL (operands[2]) & 63) < 32
2687 && (INTVAL (operands[2]) & 63) != 0"
2690 int amount = INTVAL (operands[2]);
2692 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2693 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2695 return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;srl\\t%M0,%M1,%2\";
2697 [(set_attr "type" "darith")
2698 (set_attr "mode" "DI")
2699 (set_attr "length" "4")])
2703 [(set (match_operand:DI 0 "register_operand" "")
2704 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
2705 (match_operand:SI 2 "small_int" "")))
2706 (clobber (match_operand:SI 3 "register_operand" ""))]
2707 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2708 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2709 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2710 && (INTVAL (operands[2]) & 63) < 32
2711 && (INTVAL (operands[2]) & 63) != 0"
2713 [(set (subreg:SI (match_dup 0) 0)
2714 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
2718 (ashift:SI (subreg:SI (match_dup 1) 1)
2721 (set (subreg:SI (match_dup 0) 0)
2722 (ior:SI (subreg:SI (match_dup 0) 0)
2725 (set (subreg:SI (match_dup 0) 1)
2726 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
2730 int amount = INTVAL (operands[2]);
2731 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2732 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2737 [(set (match_operand:DI 0 "register_operand" "")
2738 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
2739 (match_operand:SI 2 "small_int" "")))
2740 (clobber (match_operand:SI 3 "register_operand" ""))]
2741 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2742 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
2743 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
2744 && (INTVAL (operands[2]) & 63) < 32
2745 && (INTVAL (operands[2]) & 63) != 0"
2747 [(set (subreg:SI (match_dup 0) 1)
2748 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
2752 (ashift:SI (subreg:SI (match_dup 1) 0)
2755 (set (subreg:SI (match_dup 0) 1)
2756 (ior:SI (subreg:SI (match_dup 0) 1)
2759 (set (subreg:SI (match_dup 0) 0)
2760 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
2764 int amount = INTVAL (operands[2]);
2765 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
2766 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
2771 ;; ....................
2775 ;; ....................
2777 ;; Flow here is rather complex:
2779 ;; 1) The cmp{si,sf,df} routine is called. It deposits the
2780 ;; arguments into the branch_cmp array, and the type into
2781 ;; branch_type. No RTL is generated.
2783 ;; 2) The appropriate branch define_expand is called, which then
2784 ;; creates the appropriate RTL for the comparison and branch.
2785 ;; Different CC modes are used, based on what type of branch is
2786 ;; done, so that we can constrain things appropriately. There
2787 ;; are assumptions in the rest of GCC that break if we fold the
2788 ;; operands into the branchs for integer operations, and use cc0
2789 ;; for floating point, so we use the fp status register instead.
2790 ;; If needed, an appropriate temporary is created to hold the
2791 ;; of the integer compare.
2793 (define_expand "cmpsi"
2795 (compare:CC (match_operand:SI 0 "register_operand" "")
2796 (match_operand:SI 1 "arith_operand" "")))]
2800 if (operands[0]) /* avoid unused code message */
2802 branch_cmp[0] = operands[0];
2803 branch_cmp[1] = operands[1];
2804 branch_type = CMP_SI;
2809 (define_expand "tstsi"
2811 (match_operand:SI 0 "register_operand" ""))]
2815 if (operands[0]) /* avoid unused code message */
2817 branch_cmp[0] = operands[0];
2818 branch_cmp[1] = const0_rtx;
2819 branch_type = CMP_SI;
2824 (define_expand "cmpdf"
2826 (compare:CC_FP (match_operand:DF 0 "register_operand" "")
2827 (match_operand:DF 1 "register_operand" "")))]
2831 if (operands[0]) /* avoid unused code message */
2833 branch_cmp[0] = operands[0];
2834 branch_cmp[1] = operands[1];
2835 branch_type = CMP_DF;
2840 (define_expand "cmpsf"
2842 (compare:CC_FP (match_operand:SF 0 "register_operand" "")
2843 (match_operand:SF 1 "register_operand" "")))]
2847 if (operands[0]) /* avoid unused code message */
2849 branch_cmp[0] = operands[0];
2850 branch_cmp[1] = operands[1];
2851 branch_type = CMP_SF;
2858 ;; ....................
2860 ;; CONDITIONAL BRANCHES
2862 ;; ....................
2864 (define_insn "branch_fp_ne"
2866 (if_then_else (ne:CC_FP (reg:CC_FP 66)
2868 (match_operand 0 "pc_or_label_operand" "")
2869 (match_operand 1 "pc_or_label_operand" "")))]
2873 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
2874 return (operands[0] != pc_rtx) ? \"%*bc1t%?\\t%0\" : \"%*bc1f%?\\t%1\";
2876 [(set_attr "type" "branch")
2877 (set_attr "mode" "none")
2878 (set_attr "length" "1")])
2880 (define_insn "branch_fp_ne_rev"
2882 (if_then_else (ne:CC_REV_FP (reg:CC_REV_FP 66)
2884 (match_operand 0 "pc_or_label_operand" "")
2885 (match_operand 1 "pc_or_label_operand" "")))]
2889 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
2890 return (operands[0] != pc_rtx) ? \"%*bc1f%?\\t%0\" : \"%*bc1t%?\\t%1\";
2892 [(set_attr "type" "branch")
2893 (set_attr "mode" "none")
2894 (set_attr "length" "1")])
2896 (define_insn "branch_fp_eq"
2898 (if_then_else (eq:CC_FP (reg:CC_FP 66)
2900 (match_operand 0 "pc_or_label_operand" "")
2901 (match_operand 1 "pc_or_label_operand" "")))]
2905 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
2906 return (operands[0] != pc_rtx) ? \"%*bc1f%?\\t%0\" : \"%*bc1t%?\\t%1\";
2908 [(set_attr "type" "branch")
2909 (set_attr "mode" "none")
2910 (set_attr "length" "1")])
2912 (define_insn "branch_fp_eq_rev"
2914 (if_then_else (eq:CC_REV_FP (reg:CC_REV_FP 66)
2916 (match_operand 0 "pc_or_label_operand" "")
2917 (match_operand 1 "pc_or_label_operand" "")))]
2921 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
2922 return (operands[0] != pc_rtx) ? \"%*bc1t%?\\t%0\" : \"%*bc1f%?\\t%1\";
2924 [(set_attr "type" "branch")
2925 (set_attr "mode" "none")
2926 (set_attr "length" "1")])
2929 (define_insn "branch_zero"
2931 (if_then_else (match_operator:SI 0 "cmp_op"
2932 [(match_operand:SI 1 "register_operand" "d")
2934 (match_operand 2 "pc_or_label_operand" "")
2935 (match_operand 3 "pc_or_label_operand" "")))]
2939 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
2940 if (operands[2] != pc_rtx)
2942 switch (GET_CODE (operands[0]))
2944 case EQ: return \"%*beq%?\\t%z1,%.,%2\";
2945 case NE: return \"%*bne%?\\t%z1,%.,%2\";
2946 case GTU: return \"%*bne%?\\t%z1,%.,%2\";
2947 case LEU: return \"%*beq%?\\t%z1,%.,%2\";
2948 case GEU: return \"%*j\\t%2\";
2949 case LTU: return \"%*bne%?\\t%.,%.,%2\";
2952 return \"%*b%C0z%?\\t%z1,%2\";
2955 { /* inverted jump */
2956 switch (GET_CODE (operands[0]))
2958 case EQ: return \"%*bne%?\\t%z1,%.,%3\";
2959 case NE: return \"%*beq%?\\t%z1,%.,%3\";
2960 case GTU: return \"%*beq%?\\t%z1,%.,%3\";
2961 case LEU: return \"%*bne%?\\t%z1,%.,%3\";
2962 case GEU: return \"%*beq%?\\t%.,%.,%3\";
2963 case LTU: return \"%*j\\t%3\";
2966 return \"%*b%N0z%?\\t%z1,%3\";
2969 [(set_attr "type" "branch")
2970 (set_attr "mode" "none")
2971 (set_attr "length" "1")])
2974 (define_insn "branch_equality"
2976 (if_then_else (match_operator:SI 0 "equality_op"
2977 [(match_operand:SI 1 "register_operand" "d")
2978 (match_operand:SI 2 "register_operand" "d")])
2979 (match_operand 3 "pc_or_label_operand" "")
2980 (match_operand 4 "pc_or_label_operand" "")))]
2984 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
2985 return (operands[3] != pc_rtx)
2986 ? \"%*b%C0%?\\t%z1,%z2,%3\"
2987 : \"%*b%N0%?\\t%z1,%z2,%4\";
2989 [(set_attr "type" "branch")
2990 (set_attr "mode" "none")
2991 (set_attr "length" "1")])
2994 (define_expand "beq"
2996 (if_then_else (eq:CC_EQ (cc0)
2998 (label_ref (match_operand 0 "" ""))
3003 if (operands[0]) /* avoid unused code warning */
3005 gen_conditional_branch (operands, EQ);
3010 (define_expand "bne"
3012 (if_then_else (ne:CC_EQ (cc0)
3014 (label_ref (match_operand 0 "" ""))
3019 if (operands[0]) /* avoid unused code warning */
3021 gen_conditional_branch (operands, NE);
3026 (define_expand "bgt"
3028 (if_then_else (gt:CC (cc0)
3030 (label_ref (match_operand 0 "" ""))
3035 if (operands[0]) /* avoid unused code warning */
3037 gen_conditional_branch (operands, GT);
3042 (define_expand "bge"
3044 (if_then_else (ge:CC (cc0)
3046 (label_ref (match_operand 0 "" ""))
3051 if (operands[0]) /* avoid unused code warning */
3053 gen_conditional_branch (operands, GE);
3058 (define_expand "blt"
3060 (if_then_else (lt:CC (cc0)
3062 (label_ref (match_operand 0 "" ""))
3067 if (operands[0]) /* avoid unused code warning */
3069 gen_conditional_branch (operands, LT);
3074 (define_expand "ble"
3076 (if_then_else (le:CC (cc0)
3078 (label_ref (match_operand 0 "" ""))
3083 if (operands[0]) /* avoid unused code warning */
3085 gen_conditional_branch (operands, LE);
3090 (define_expand "bgtu"
3092 (if_then_else (gtu:CC (cc0)
3094 (label_ref (match_operand 0 "" ""))
3099 if (operands[0]) /* avoid unused code warning */
3101 gen_conditional_branch (operands, GTU);
3106 (define_expand "bgeu"
3108 (if_then_else (geu:CC (cc0)
3110 (label_ref (match_operand 0 "" ""))
3115 if (operands[0]) /* avoid unused code warning */
3117 gen_conditional_branch (operands, GEU);
3123 (define_expand "bltu"
3125 (if_then_else (ltu:CC (cc0)
3127 (label_ref (match_operand 0 "" ""))
3132 if (operands[0]) /* avoid unused code warning */
3134 gen_conditional_branch (operands, LTU);
3139 (define_expand "bleu"
3141 (if_then_else (leu:CC (cc0)
3143 (label_ref (match_operand 0 "" ""))
3148 if (operands[0]) /* avoid unused code warning */
3150 gen_conditional_branch (operands, LEU);
3157 ;; ....................
3159 ;; SETTING A REGISTER FROM A COMPARISON
3161 ;; ....................
3163 (define_expand "seq"
3164 [(set (match_operand:SI 0 "register_operand" "=d")
3165 (eq:SI (match_dup 1)
3170 if (branch_type != CMP_SI)
3173 /* set up operands from compare. */
3174 operands[1] = branch_cmp[0];
3175 operands[2] = branch_cmp[1];
3177 if (!TARGET_DEBUG_C_MODE)
3179 gen_int_relational (EQ, operands[0], operands[1], operands[2], (int *)0);
3183 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
3184 operands[2] = force_reg (SImode, operands[2]);
3186 /* fall through and generate default code */
3190 (define_insn "seq_si_zero"
3191 [(set (match_operand:SI 0 "register_operand" "=d")
3192 (eq:SI (match_operand:SI 1 "register_operand" "d")
3196 [(set_attr "type" "arith")
3197 (set_attr "mode" "SI")
3198 (set_attr "length" "1")])
3200 (define_insn "seq_si"
3201 [(set (match_operand:SI 0 "register_operand" "=d,d")
3202 (eq:SI (match_operand:SI 1 "register_operand" "%d,d")
3203 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
3204 "TARGET_DEBUG_C_MODE"
3206 xor\\t%0,%1,%2\;sltu\\t%0,%0,1
3207 xori\\t%0,%1,%2\;sltu\\t%0,%0,1"
3208 [(set_attr "type" "arith")
3209 (set_attr "mode" "SI")
3210 (set_attr "length" "2")])
3213 [(set (match_operand:SI 0 "register_operand" "")
3214 (eq:SI (match_operand:SI 1 "register_operand" "")
3215 (match_operand:SI 2 "uns_arith_operand" "")))]
3216 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE
3217 && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0)"
3219 (xor:SI (match_dup 1)
3222 (ltu:SI (match_dup 0)
3226 (define_expand "sne"
3227 [(set (match_operand:SI 0 "register_operand" "=d")
3228 (ne:SI (match_dup 1)
3233 if (branch_type != CMP_SI)
3236 /* set up operands from compare. */
3237 operands[1] = branch_cmp[0];
3238 operands[2] = branch_cmp[1];
3240 if (!TARGET_DEBUG_C_MODE)
3242 gen_int_relational (NE, operands[0], operands[1], operands[2], (int *)0);
3246 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
3247 operands[2] = force_reg (SImode, operands[2]);
3249 /* fall through and generate default code */
3252 (define_insn "sne_si_zero"
3253 [(set (match_operand:SI 0 "register_operand" "=d")
3254 (ne:SI (match_operand:SI 1 "register_operand" "d")
3258 [(set_attr "type" "arith")
3259 (set_attr "mode" "SI")
3260 (set_attr "length" "1")])
3262 (define_insn "sne_si"
3263 [(set (match_operand:SI 0 "register_operand" "=d,d")
3264 (ne:SI (match_operand:SI 1 "register_operand" "%d,d")
3265 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
3266 "TARGET_DEBUG_C_MODE"
3268 xor\\t%0,%1,%2\;sltu\\t%0,%.,%0
3269 xori\\t%0,%1,%x2\;sltu\\t%0,%.,%0"
3270 [(set_attr "type" "arith")
3271 (set_attr "mode" "SI")
3272 (set_attr "length" "2")])
3275 [(set (match_operand:SI 0 "register_operand" "")
3276 (ne:SI (match_operand:SI 1 "register_operand" "")
3277 (match_operand:SI 2 "uns_arith_operand" "")))]
3278 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE
3279 && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0)"
3281 (xor:SI (match_dup 1)
3284 (gtu:SI (match_dup 0)
3288 (define_expand "sgt"
3289 [(set (match_operand:SI 0 "register_operand" "=d")
3290 (gt:SI (match_dup 1)
3295 if (branch_type != CMP_SI)
3298 /* set up operands from compare. */
3299 operands[1] = branch_cmp[0];
3300 operands[2] = branch_cmp[1];
3302 if (!TARGET_DEBUG_C_MODE)
3304 gen_int_relational (GT, operands[0], operands[1], operands[2], (int *)0);
3308 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
3309 operands[2] = force_reg (SImode, operands[2]);
3311 /* fall through and generate default code */
3314 (define_insn "sgt_si"
3315 [(set (match_operand:SI 0 "register_operand" "=d")
3316 (gt:SI (match_operand:SI 1 "register_operand" "d")
3317 (match_operand:SI 2 "reg_or_0_operand" "dJ")))]
3320 [(set_attr "type" "arith")
3321 (set_attr "mode" "SI")
3322 (set_attr "length" "1")])
3324 (define_expand "sge"
3325 [(set (match_operand:SI 0 "register_operand" "=d")
3326 (ge:SI (match_dup 1)
3331 if (branch_type != CMP_SI)
3334 /* set up operands from compare. */
3335 operands[1] = branch_cmp[0];
3336 operands[2] = branch_cmp[1];
3338 if (!TARGET_DEBUG_C_MODE)
3340 gen_int_relational (GE, operands[0], operands[1], operands[2], (int *)0);
3344 /* fall through and generate default code */
3347 (define_insn "sge_si"
3348 [(set (match_operand:SI 0 "register_operand" "=d")
3349 (ge:SI (match_operand:SI 1 "register_operand" "d")
3350 (match_operand:SI 2 "arith_operand" "dI")))]
3351 "TARGET_DEBUG_C_MODE"
3352 "slt\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
3353 [(set_attr "type" "arith")
3354 (set_attr "mode" "SI")
3355 (set_attr "length" "2")])
3358 [(set (match_operand:SI 0 "register_operand" "")
3359 (ge:SI (match_operand:SI 1 "register_operand" "")
3360 (match_operand:SI 2 "arith_operand" "")))]
3361 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
3363 (lt:SI (match_dup 1)
3366 (xor:SI (match_dup 0)
3370 (define_expand "slt"
3371 [(set (match_operand:SI 0 "register_operand" "=d")
3372 (lt:SI (match_dup 1)
3377 if (branch_type != CMP_SI)
3380 /* set up operands from compare. */
3381 operands[1] = branch_cmp[0];
3382 operands[2] = branch_cmp[1];
3384 if (!TARGET_DEBUG_C_MODE)
3386 gen_int_relational (LT, operands[0], operands[1], operands[2], (int *)0);
3390 /* fall through and generate default code */
3393 (define_insn "slt_si"
3394 [(set (match_operand:SI 0 "register_operand" "=d")
3395 (lt:SI (match_operand:SI 1 "register_operand" "d")
3396 (match_operand:SI 2 "arith_operand" "dI")))]
3399 [(set_attr "type" "arith")
3400 (set_attr "mode" "SI")
3401 (set_attr "length" "1")])
3403 (define_expand "sle"
3404 [(set (match_operand:SI 0 "register_operand" "=d")
3405 (le:SI (match_dup 1)
3410 if (branch_type != CMP_SI)
3413 /* set up operands from compare. */
3414 operands[1] = branch_cmp[0];
3415 operands[2] = branch_cmp[1];
3417 if (!TARGET_DEBUG_C_MODE)
3419 gen_int_relational (LE, operands[0], operands[1], operands[2], (int *)0);
3423 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 32767)
3424 operands[2] = force_reg (SImode, operands[2]);
3426 /* fall through and generate default code */
3429 (define_insn "sle_si_const"
3430 [(set (match_operand:SI 0 "register_operand" "=d")
3431 (le:SI (match_operand:SI 1 "register_operand" "d")
3432 (match_operand:SI 2 "small_int" "I")))]
3433 "INTVAL (operands[2]) < 32767"
3436 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
3437 return \"slt\\t%0,%1,%2\";
3439 [(set_attr "type" "arith")
3440 (set_attr "mode" "SI")
3441 (set_attr "length" "1")])
3443 (define_insn "sle_si_reg"
3444 [(set (match_operand:SI 0 "register_operand" "=d")
3445 (le:SI (match_operand:SI 1 "register_operand" "d")
3446 (match_operand:SI 2 "register_operand" "d")))]
3447 "TARGET_DEBUG_C_MODE"
3448 "slt\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
3449 [(set_attr "type" "arith")
3450 (set_attr "mode" "SI")
3451 (set_attr "length" "2")])
3454 [(set (match_operand:SI 0 "register_operand" "")
3455 (le:SI (match_operand:SI 1 "register_operand" "")
3456 (match_operand:SI 2 "register_operand" "")))]
3457 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
3459 (lt:SI (match_dup 2)
3462 (xor:SI (match_dup 0)
3466 (define_expand "sgtu"
3467 [(set (match_operand:SI 0 "register_operand" "=d")
3468 (gtu:SI (match_dup 1)
3473 if (branch_type != CMP_SI)
3476 /* set up operands from compare. */
3477 operands[1] = branch_cmp[0];
3478 operands[2] = branch_cmp[1];
3480 if (!TARGET_DEBUG_C_MODE)
3482 gen_int_relational (GTU, operands[0], operands[1], operands[2], (int *)0);
3486 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
3487 operands[2] = force_reg (SImode, operands[2]);
3489 /* fall through and generate default code */
3492 (define_insn "sgtu_si"
3493 [(set (match_operand:SI 0 "register_operand" "=d")
3494 (gtu:SI (match_operand:SI 1 "register_operand" "d")
3495 (match_operand:SI 2 "reg_or_0_operand" "dJ")))]
3498 [(set_attr "type" "arith")
3499 (set_attr "mode" "SI")
3500 (set_attr "length" "1")])
3502 (define_expand "sgeu"
3503 [(set (match_operand:SI 0 "register_operand" "=d")
3504 (geu:SI (match_dup 1)
3509 if (branch_type != CMP_SI)
3512 /* set up operands from compare. */
3513 operands[1] = branch_cmp[0];
3514 operands[2] = branch_cmp[1];
3516 if (!TARGET_DEBUG_C_MODE)
3518 gen_int_relational (GEU, operands[0], operands[1], operands[2], (int *)0);
3522 /* fall through and generate default code */
3525 (define_insn "sgeu_si"
3526 [(set (match_operand:SI 0 "register_operand" "=d")
3527 (geu:SI (match_operand:SI 1 "register_operand" "d")
3528 (match_operand:SI 2 "arith_operand" "dI")))]
3529 "TARGET_DEBUG_C_MODE"
3530 "sltu\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
3531 [(set_attr "type" "arith")
3532 (set_attr "mode" "SI")
3533 (set_attr "length" "2")])
3536 [(set (match_operand:SI 0 "register_operand" "")
3537 (geu:SI (match_operand:SI 1 "register_operand" "")
3538 (match_operand:SI 2 "arith_operand" "")))]
3539 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
3541 (ltu:SI (match_dup 1)
3544 (xor:SI (match_dup 0)
3548 (define_expand "sltu"
3549 [(set (match_operand:SI 0 "register_operand" "=d")
3550 (ltu:SI (match_dup 1)
3555 if (branch_type != CMP_SI)
3558 /* set up operands from compare. */
3559 operands[1] = branch_cmp[0];
3560 operands[2] = branch_cmp[1];
3562 if (!TARGET_DEBUG_C_MODE)
3564 gen_int_relational (LTU, operands[0], operands[1], operands[2], (int *)0);
3568 /* fall through and generate default code */
3571 (define_insn "sltu_si"
3572 [(set (match_operand:SI 0 "register_operand" "=d")
3573 (ltu:SI (match_operand:SI 1 "register_operand" "d")
3574 (match_operand:SI 2 "arith_operand" "dI")))]
3577 [(set_attr "type" "arith")
3578 (set_attr "mode" "SI")
3579 (set_attr "length" "1")])
3581 (define_expand "sleu"
3582 [(set (match_operand:SI 0 "register_operand" "=d")
3583 (leu:SI (match_dup 1)
3588 if (branch_type != CMP_SI)
3591 /* set up operands from compare. */
3592 operands[1] = branch_cmp[0];
3593 operands[2] = branch_cmp[1];
3595 if (!TARGET_DEBUG_C_MODE)
3597 gen_int_relational (LEU, operands[0], operands[1], operands[2], (int *)0);
3601 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 32767)
3602 operands[2] = force_reg (SImode, operands[2]);
3604 /* fall through and generate default code */
3607 (define_insn "sleu_si_const"
3608 [(set (match_operand:SI 0 "register_operand" "=d")
3609 (leu:SI (match_operand:SI 1 "register_operand" "d")
3610 (match_operand:SI 2 "small_int" "I")))]
3611 "INTVAL (operands[2]) < 32767"
3614 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
3615 return \"sltu\\t%0,%1,%2\";
3617 [(set_attr "type" "arith")
3618 (set_attr "mode" "SI")
3619 (set_attr "length" "1")])
3621 (define_insn "sleu_si_reg"
3622 [(set (match_operand:SI 0 "register_operand" "=d")
3623 (leu:SI (match_operand:SI 1 "register_operand" "d")
3624 (match_operand:SI 2 "register_operand" "d")))]
3625 "TARGET_DEBUG_C_MODE"
3626 "sltu\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
3627 [(set_attr "type" "arith")
3628 (set_attr "mode" "SI")
3629 (set_attr "length" "2")])
3632 [(set (match_operand:SI 0 "register_operand" "")
3633 (leu:SI (match_operand:SI 1 "register_operand" "")
3634 (match_operand:SI 2 "register_operand" "")))]
3635 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
3637 (ltu:SI (match_dup 2)
3640 (xor:SI (match_dup 0)
3646 ;; ....................
3648 ;; FLOATING POINT COMPARISONS
3650 ;; ....................
3652 (define_insn "seq_df"
3653 [(set (reg:CC_FP 66)
3654 (eq:CC_FP (match_operand:DF 0 "register_operand" "f")
3655 (match_operand:DF 1 "register_operand" "f")))]
3660 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3661 xoperands[1] = operands[0];
3662 xoperands[2] = operands[1];
3664 return mips_fill_delay_slot (\"c.eq.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3666 [(set_attr "type" "fcmp")
3667 (set_attr "mode" "FPSW")
3668 (set_attr "length" "1")])
3670 (define_insn "sne_df"
3671 [(set (reg:CC_REV_FP 66)
3672 (ne:CC_REV_FP (match_operand:DF 0 "register_operand" "f")
3673 (match_operand:DF 1 "register_operand" "f")))]
3678 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3679 xoperands[1] = operands[0];
3680 xoperands[2] = operands[1];
3682 return mips_fill_delay_slot (\"c.eq.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3684 [(set_attr "type" "fcmp")
3685 (set_attr "mode" "FPSW")
3686 (set_attr "length" "1")])
3688 (define_insn "slt_df"
3689 [(set (reg:CC_FP 66)
3690 (lt:CC_FP (match_operand:DF 0 "register_operand" "f")
3691 (match_operand:DF 1 "register_operand" "f")))]
3696 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3697 xoperands[1] = operands[0];
3698 xoperands[2] = operands[1];
3700 return mips_fill_delay_slot (\"c.lt.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3702 [(set_attr "type" "fcmp")
3703 (set_attr "mode" "FPSW")
3704 (set_attr "length" "1")])
3706 (define_insn "sle_df"
3707 [(set (reg:CC_FP 66)
3708 (le:CC_FP (match_operand:DF 0 "register_operand" "f")
3709 (match_operand:DF 1 "register_operand" "f")))]
3714 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3715 xoperands[1] = operands[0];
3716 xoperands[2] = operands[1];
3718 return mips_fill_delay_slot (\"c.le.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3720 [(set_attr "type" "fcmp")
3721 (set_attr "mode" "FPSW")
3722 (set_attr "length" "1")])
3724 (define_insn "sgt_df"
3725 [(set (reg:CC_FP 66)
3726 (gt:CC_FP (match_operand:DF 0 "register_operand" "f")
3727 (match_operand:DF 1 "register_operand" "f")))]
3732 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3733 xoperands[1] = operands[0];
3734 xoperands[2] = operands[1];
3736 return mips_fill_delay_slot (\"c.lt.d\\t%1,%0\", DELAY_FCMP, xoperands, insn);
3738 [(set_attr "type" "fcmp")
3739 (set_attr "mode" "FPSW")
3740 (set_attr "length" "1")])
3742 (define_insn "sge_df"
3743 [(set (reg:CC_FP 66)
3744 (ge:CC_FP (match_operand:DF 0 "register_operand" "f")
3745 (match_operand:DF 1 "register_operand" "f")))]
3750 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3751 xoperands[1] = operands[0];
3752 xoperands[2] = operands[1];
3754 return mips_fill_delay_slot (\"c.le.d\\t%1,%0\", DELAY_FCMP, xoperands, insn);
3756 [(set_attr "type" "fcmp")
3757 (set_attr "mode" "FPSW")
3758 (set_attr "length" "1")])
3760 (define_insn "seq_sf"
3761 [(set (reg:CC_FP 66)
3762 (eq:CC_FP (match_operand:SF 0 "register_operand" "f")
3763 (match_operand:SF 1 "register_operand" "f")))]
3768 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3769 xoperands[1] = operands[0];
3770 xoperands[2] = operands[1];
3772 return mips_fill_delay_slot (\"c.eq.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3774 [(set_attr "type" "fcmp")
3775 (set_attr "mode" "FPSW")
3776 (set_attr "length" "1")])
3778 (define_insn "sne_sf"
3779 [(set (reg:CC_REV_FP 66)
3780 (ne:CC_REV_FP (match_operand:SF 0 "register_operand" "f")
3781 (match_operand:SF 1 "register_operand" "f")))]
3786 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3787 xoperands[1] = operands[0];
3788 xoperands[2] = operands[1];
3790 return mips_fill_delay_slot (\"c.eq.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3792 [(set_attr "type" "fcmp")
3793 (set_attr "mode" "FPSW")
3794 (set_attr "length" "1")])
3796 (define_insn "slt_sf"
3797 [(set (reg:CC_FP 66)
3798 (lt:CC_FP (match_operand:SF 0 "register_operand" "f")
3799 (match_operand:SF 1 "register_operand" "f")))]
3804 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3805 xoperands[1] = operands[0];
3806 xoperands[2] = operands[1];
3808 return mips_fill_delay_slot (\"c.lt.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3810 [(set_attr "type" "fcmp")
3811 (set_attr "mode" "FPSW")
3812 (set_attr "length" "1")])
3814 (define_insn "sle_sf"
3815 [(set (reg:CC_FP 66)
3816 (le:CC_FP (match_operand:SF 0 "register_operand" "f")
3817 (match_operand:SF 1 "register_operand" "f")))]
3822 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3823 xoperands[1] = operands[0];
3824 xoperands[2] = operands[1];
3826 return mips_fill_delay_slot (\"c.le.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
3828 [(set_attr "type" "fcmp")
3829 (set_attr "mode" "FPSW")
3830 (set_attr "length" "1")])
3832 (define_insn "sgt_sf"
3833 [(set (reg:CC_FP 66)
3834 (gt:CC_FP (match_operand:SF 0 "register_operand" "f")
3835 (match_operand:SF 1 "register_operand" "f")))]
3840 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3841 xoperands[1] = operands[0];
3842 xoperands[2] = operands[1];
3844 return mips_fill_delay_slot (\"c.lt.s\\t%1,%0\", DELAY_FCMP, xoperands, insn);
3846 [(set_attr "type" "fcmp")
3847 (set_attr "mode" "FPSW")
3848 (set_attr "length" "1")])
3850 (define_insn "sge_sf"
3851 [(set (reg:CC_FP 66)
3852 (ge:CC_FP (match_operand:SF 0 "register_operand" "f")
3853 (match_operand:SF 1 "register_operand" "f")))]
3858 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
3859 xoperands[1] = operands[0];
3860 xoperands[2] = operands[1];
3862 return mips_fill_delay_slot (\"c.le.s\\t%1,%0\", DELAY_FCMP, xoperands, insn);
3864 [(set_attr "type" "fcmp")
3865 (set_attr "mode" "FPSW")
3866 (set_attr "length" "1")])
3870 ;; ....................
3872 ;; UNCONDITIONAL BRANCHES
3874 ;; ....................
3876 ;; Unconditional branches.
3880 (label_ref (match_operand 0 "" "")))]
3884 if (GET_CODE (operands[0]) == REG)
3885 return \"%*j\\t%0\";
3887 return \"%*j\\t%l0\";
3889 [(set_attr "type" "jump")
3890 (set_attr "mode" "none")
3891 (set_attr "length" "1")])
3893 (define_insn "indirect_jump"
3894 [(set (pc) (match_operand:SI 0 "register_operand" "d"))]
3897 [(set_attr "type" "jump")
3898 (set_attr "mode" "none")
3899 (set_attr "length" "1")])
3901 (define_insn "tablejump"
3903 (match_operand:SI 0 "register_operand" "d"))
3904 (use (label_ref (match_operand 1 "" "")))]
3907 [(set_attr "type" "jump")
3908 (set_attr "mode" "none")
3909 (set_attr "length" "1")])
3911 ;; Function return, only allow after optimization, so that we can
3912 ;; eliminate jumps to jumps if no stack space is used.
3914 ;; (define_expand "return"
3915 ;; [(set (pc) (reg:SI 31))]
3916 ;; "simple_epilogue_p ()"
3919 (define_expand "return"
3920 [(parallel [(return)
3921 (use (reg:SI 31))])]
3922 "simple_epilogue_p ()"
3925 (define_insn "return_internal"
3926 [(parallel [(return)
3927 (use (match_operand:SI 0 "register_operand" "d"))])]
3930 [(set_attr "type" "jump")
3931 (set_attr "mode" "none")
3932 (set_attr "length" "1")])
3936 ;; ....................
3938 ;; Function prologue/epilogue
3940 ;; ....................
3943 (define_expand "prologue"
3948 if (mips_isa >= 0) /* avoid unused code warnings */
3950 mips_expand_prologue ();
3955 ;; At present, don't expand the epilogue, reorg.c will clobber the
3956 ;; return register in compiling gen_lowpart (emit-rtl.c).
3958 ;; (define_expand "epilogue"
3963 ;; if (mips_isa >= 0) /* avoid unused code warnings */
3965 ;; mips_expand_epilogue ();
3972 ;; ....................
3976 ;; ....................
3978 ;; calls.c now passes a third argument, make saber happy
3980 (define_expand "call"
3981 [(parallel [(call (match_operand 0 "memory_operand" "m")
3982 (match_operand 1 "" "i"))
3983 (clobber (match_operand 2 "" ""))])] ;; overwrite op2 with $31
3989 operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
3991 addr = XEXP (operands[0], 0);
3992 if (GET_CODE (addr) != REG && !CONSTANT_ADDRESS_P (addr))
3993 XEXP (operands[0], 0) = force_reg (FUNCTION_MODE, addr);
3996 (define_insn "call_internal"
3997 [(call (match_operand 0 "memory_operand" "m")
3998 (match_operand 1 "" "i"))
3999 (clobber (match_operand:SI 2 "register_operand" "=d"))]
4003 register rtx target = XEXP (operands[0], 0);
4005 if (GET_CODE (target) == SYMBOL_REF)
4006 return \"%*jal\\t%0\";
4008 else if (GET_CODE (target) == CONST_INT)
4010 operands[0] = target;
4011 operands[1] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
4012 return \"%*%[li\\t%@,%0\\n\\tjal\\t%1,%@%]\";
4017 operands[0] = target;
4018 operands[1] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
4019 return \"%*jal\\t%1,%0\";
4022 [(set_attr "type" "call")
4023 (set_attr "mode" "none")
4024 (set_attr "length" "1")])
4026 ;; calls.c now passes a fourth argument, make saber happy
4028 (define_expand "call_value"
4029 [(parallel [(set (match_operand 0 "register_operand" "=df")
4030 (call (match_operand 1 "memory_operand" "m")
4031 (match_operand 2 "" "i")))
4032 (clobber (match_operand 3 "" ""))])] ;; overwrite op3 with $31
4038 operands[3] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
4040 addr = XEXP (operands[1], 0);
4041 if (GET_CODE (addr) != REG && !CONSTANT_ADDRESS_P (addr))
4042 XEXP (operands[1], 0) = force_reg (FUNCTION_MODE, addr);
4045 (define_insn "call_value_internal"
4046 [(set (match_operand 0 "register_operand" "=df")
4047 (call (match_operand 1 "memory_operand" "m")
4048 (match_operand 2 "" "i")))
4049 (clobber (match_operand:SI 3 "register_operand" "=d"))]
4053 register rtx target = XEXP (operands[1], 0);
4055 if (GET_CODE (target) == SYMBOL_REF)
4056 return \"%*jal\\t%1\";
4058 else if (GET_CODE (target) == CONST_INT)
4060 operands[1] = target;
4061 operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
4062 return \"%*%[li\\t%@,%1\\n\\tjal\\t%2,%@%]\";
4067 operands[1] = target;
4068 operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
4069 return \"%*jal\\t%2,%1\";
4072 [(set_attr "type" "call")
4073 (set_attr "mode" "none")
4074 (set_attr "length" "1")])
4078 ;; ....................
4082 ;; ....................
4089 [(set_attr "type" "nop")
4090 (set_attr "mode" "none")
4091 (set_attr "length" "1")])
4093 (define_expand "probe"
4099 operands[0] = gen_reg_rtx (SImode);
4100 operands[1] = gen_rtx (MEM, SImode, stack_pointer_rtx);
4101 MEM_VOLATILE_P (operands[1]) = TRUE;
4103 /* fall through and generate default code */
4110 ;; comment-start: ";; "
4111 ;; eval: (set-syntax-table (copy-sequence (syntax-table)))
4112 ;; eval: (modify-syntax-entry ?[ "(]")
4113 ;; eval: (modify-syntax-entry ?] ")[")
4114 ;; eval: (modify-syntax-entry ?{ "(}")
4115 ;; eval: (modify-syntax-entry ?} "){")