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 ;; 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
5 ;; Brendan Eich, brendan@microunity.com.
6 ;; Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
8 ;; This file is part of GNU CC.
10 ;; GNU CC is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU CC is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU CC; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26 ;; ....................
30 ;; ....................
32 ;; Classification of each insn.
33 ;; branch conditional branch
34 ;; jump unconditional jump
35 ;; call unconditional call
36 ;; load load instruction(s)
37 ;; store store instruction(s)
38 ;; move data movement within same register set
39 ;; xfer transfer to/from coprocessor
40 ;; hilo transfer of hi/lo registers
41 ;; arith integer arithmetic instruction
42 ;; darith double precision integer arithmetic instructions
43 ;; imul integer multiply
44 ;; idiv integer divide
45 ;; icmp integer compare
46 ;; fadd floating point add/subtract
47 ;; fmul floating point multiply
48 ;; fdiv floating point divide
49 ;; fabs floating point absolute value
50 ;; fneg floating point negation
51 ;; fcmp floating point compare
52 ;; fcvt floating point convert
53 ;; fsqrt floating point square root
54 ;; multi multiword sequence (or user asm statements)
58 "unknown,branch,jump,call,load,store,move,xfer,hilo,arith,darith,imul,idiv,icmp,fadd,fmul,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,multi,nop"
59 (const_string "unknown"))
61 ;; Main data type used by the insn
62 (define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW" (const_string "unknown"))
64 ;; # instructions (4 bytes each)
65 (define_attr "length" "" (const_int 1))
67 ;; whether or not an instruction has a mandatory delay slot
68 (define_attr "dslot" "no,yes"
69 (if_then_else (eq_attr "type" "branch,jump,call,load,xfer,hilo,fcmp")
73 ;; Attribute describing the processor. This attribute must match exactly
74 ;; with the processor_type enumeration in mips.h.
76 ;; Attribute describing the processor
77 ;; (define_attr "cpu" "default,r3000,r6000,r4000"
79 ;; (cond [(eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R3000")) (const_string "r3000")
80 ;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R4000")) (const_string "r4000")
81 ;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R6000")) (const_string "r6000")]
82 ;; (const_string "default"))))
84 (define_attr "cpu" "default,r3000,r6000,r4000,r4600"
85 (const (symbol_ref "mips_cpu_attr")))
87 ;; Attribute defining whether or not we can use the branch-likely instructions
90 (define_attr "branch_likely" "no,yes"
92 (if_then_else (ge (symbol_ref "mips_isa") (const_int 2))
94 (const_string "no"))))
97 ;; Describe a user's asm statement.
98 (define_asm_attributes
99 [(set_attr "type" "multi")])
101 ;; whether or not generating calls to position independent functions
102 (define_attr "abicalls" "no,yes"
103 (const (symbol_ref "mips_abicalls_attr")))
107 ;; .........................
109 ;; Delay slots, can't describe load/fcmp/xfer delay slots here
111 ;; .........................
113 (define_delay (eq_attr "type" "branch")
114 [(and (eq_attr "dslot" "no") (eq_attr "length" "1"))
116 (and (eq_attr "branch_likely" "yes") (and (eq_attr "dslot" "no") (eq_attr "length" "1")))])
118 (define_delay (eq_attr "type" "jump")
119 [(and (eq_attr "dslot" "no") (eq_attr "length" "1"))
123 (define_delay (and (eq_attr "type" "call") (eq_attr "abicalls" "no"))
124 [(and (eq_attr "dslot" "no") (eq_attr "length" "1"))
130 ;; .........................
134 ;; .........................
136 ; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
137 ; TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST])
139 ;; Make the default case (PROCESSOR_DEFAULT) handle the worst case
141 (define_function_unit "memory" 1 0
142 (and (eq_attr "type" "load") (eq_attr "cpu" "!r3000"))
145 (define_function_unit "memory" 1 0
146 (and (eq_attr "type" "load") (eq_attr "cpu" "r3000,r4600"))
149 (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
151 (define_function_unit "memory" 1 0 (eq_attr "type" "xfer") 2 0)
153 (define_function_unit "imuldiv" 1 0
154 (eq_attr "type" "hilo")
157 (define_function_unit "imuldiv" 1 0
158 (and (eq_attr "type" "imul") (eq_attr "cpu" "!r3000,r4000,r4600"))
161 (define_function_unit "imuldiv" 1 0
162 (and (eq_attr "type" "imul") (eq_attr "cpu" "r3000"))
165 (define_function_unit "imuldiv" 1 0
166 (and (eq_attr "type" "imul") (eq_attr "cpu" "r4000,r4600"))
169 (define_function_unit "imuldiv" 1 0
170 (and (eq_attr "type" "idiv") (eq_attr "cpu" "!r3000,r4000,r4600"))
173 (define_function_unit "imuldiv" 1 0
174 (and (eq_attr "type" "idiv") (eq_attr "cpu" "r3000"))
177 (define_function_unit "imuldiv" 1 0
178 (and (eq_attr "type" "idiv") (eq_attr "cpu" "r4600"))
181 (define_function_unit "imuldiv" 1 0
182 (and (eq_attr "type" "idiv") (eq_attr "cpu" "r4000"))
185 (define_function_unit "adder" 1 1
186 (and (eq_attr "type" "fcmp") (eq_attr "cpu" "!r3000,r6000"))
189 (define_function_unit "adder" 1 1
190 (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3000,r6000"))
193 (define_function_unit "adder" 1 1
194 (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r6000"))
197 (define_function_unit "adder" 1 1
198 (and (eq_attr "type" "fadd") (eq_attr "cpu" "r3000"))
201 (define_function_unit "adder" 1 1
202 (and (eq_attr "type" "fadd") (eq_attr "cpu" "r6000"))
205 (define_function_unit "adder" 1 1
206 (and (eq_attr "type" "fabs,fneg") (eq_attr "cpu" "!r3000,r4600"))
209 (define_function_unit "adder" 1 1
210 (and (eq_attr "type" "fabs,fneg") (eq_attr "cpu" "r3000,r4600"))
213 (define_function_unit "mult" 1 1
214 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r3000,r6000,r4600")))
217 (define_function_unit "mult" 1 1
218 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3000")))
221 (define_function_unit "mult" 1 1
222 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r6000")))
225 (define_function_unit "mult" 1 1
226 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r4600")))
229 (define_function_unit "mult" 1 1
230 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r6000")))
233 (define_function_unit "mult" 1 1
234 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3000")))
237 (define_function_unit "mult" 1 1
238 (and (eq_attr "type" "fmul") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r6000")))
241 (define_function_unit "divide" 1 1
242 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r3000,r6000,r4600")))
245 (define_function_unit "divide" 1 1
246 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3000")))
249 (define_function_unit "divide" 1 1
250 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r6000")))
253 (define_function_unit "divide" 1 1
254 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r4600")))
257 (define_function_unit "divide" 1 1
258 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r6000,r4600")))
261 (define_function_unit "divide" 1 1
262 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3000")))
265 (define_function_unit "divide" 1 1
266 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r6000")))
269 (define_function_unit "divide" 1 1
270 (and (eq_attr "type" "fdiv") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r4600")))
273 ;;; ??? Is this number right?
274 (define_function_unit "divide" 1 1
275 (and (eq_attr "type" "fsqrt") (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r4600")))
277 (define_function_unit "divide" 1 1
278 (and (eq_attr "type" "fsqrt") (and (eq_attr "mode" "SF") (eq_attr "cpu" "r4600")))
281 ;;; ??? Is this number right?
282 (define_function_unit "divide" 1 1
283 (and (eq_attr "type" "fsqrt") (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r4600")))
285 (define_function_unit "divide" 1 1
286 (and (eq_attr "type" "fsqrt") (and (eq_attr "mode" "DF") (eq_attr "cpu" "r4600")))
290 ;; The following functional units do not use the cpu type, and use
291 ;; much less memory in genattrtab.c.
293 ;; (define_function_unit "memory" 1 0 (eq_attr "type" "load") 3 0)
294 ;; (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
296 ;; (define_function_unit "fp_comp" 1 0 (eq_attr "type" "fcmp") 2 0)
298 ;; (define_function_unit "transfer" 1 0 (eq_attr "type" "xfer") 2 0)
299 ;; (define_function_unit "transfer" 1 0 (eq_attr "type" "hilo") 3 0)
301 ;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "imul") 17 0)
302 ;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "idiv") 38 0)
304 ;; (define_function_unit "adder" 1 1 (eq_attr "type" "fadd") 4 0)
305 ;; (define_function_unit "adder" 1 1 (eq_attr "type" "fabs,fneg") 2 0)
307 ;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "SF")) 7 0)
308 ;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "DF")) 8 0)
310 ;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "SF")) 23 0)
311 ;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "DF")) 36 0)
313 ;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "SF")) 54 0)
314 ;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "DF")) 112 0)
318 ;; ....................
322 ;; ....................
325 (define_insn "adddf3"
326 [(set (match_operand:DF 0 "register_operand" "=f")
327 (plus:DF (match_operand:DF 1 "register_operand" "f")
328 (match_operand:DF 2 "register_operand" "f")))]
331 [(set_attr "type" "fadd")
332 (set_attr "mode" "DF")
333 (set_attr "length" "1")])
335 (define_insn "addsf3"
336 [(set (match_operand:SF 0 "register_operand" "=f")
337 (plus:SF (match_operand:SF 1 "register_operand" "f")
338 (match_operand:SF 2 "register_operand" "f")))]
341 [(set_attr "type" "fadd")
342 (set_attr "mode" "SF")
343 (set_attr "length" "1")])
345 (define_expand "addsi3"
346 [(set (match_operand:SI 0 "register_operand" "=d")
347 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
348 (match_operand:SI 2 "arith_operand" "dI")))]
352 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == -32768)
353 operands[2] = force_reg (SImode, operands[2]);
356 (define_insn "addsi3_internal"
357 [(set (match_operand:SI 0 "register_operand" "=d")
358 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
359 (match_operand:SI 2 "arith_operand" "dI")))]
360 "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768"
362 [(set_attr "type" "arith")
363 (set_attr "mode" "SI")
364 (set_attr "length" "1")])
366 (define_expand "adddi3"
367 [(parallel [(set (match_operand:DI 0 "register_operand" "")
368 (plus:DI (match_operand:DI 1 "register_operand" "")
369 (match_operand:DI 2 "arith_operand" "")))
370 (clobber (match_dup 3))])]
371 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
374 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == -32768)
375 operands[2] = force_reg (DImode, operands[2]);
379 emit_insn (gen_adddi3_internal_3 (operands[0], operands[1],
384 operands[3] = gen_reg_rtx (SImode);
387 (define_insn "adddi3_internal_1"
388 [(set (match_operand:DI 0 "register_operand" "=d,&d")
389 (plus:DI (match_operand:DI 1 "register_operand" "0,d")
390 (match_operand:DI 2 "register_operand" "d,d")))
391 (clobber (match_operand:SI 3 "register_operand" "=d,d"))]
392 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE"
395 return (REGNO (operands[0]) == REGNO (operands[1])
396 && REGNO (operands[0]) == REGNO (operands[2]))
397 ? \"srl\\t%3,%L0,31\;sll\\t%M0,%M0,1\;sll\\t%L0,%L1,1\;addu\\t%M0,%M0,%3\"
398 : \"addu\\t%L0,%L1,%L2\;sltu\\t%3,%L0,%L2\;addu\\t%M0,%M1,%M2\;addu\\t%M0,%M0,%3\";
400 [(set_attr "type" "darith")
401 (set_attr "mode" "DI")
402 (set_attr "length" "4")])
405 [(set (match_operand:DI 0 "register_operand" "")
406 (plus:DI (match_operand:DI 1 "register_operand" "")
407 (match_operand:DI 2 "register_operand" "")))
408 (clobber (match_operand:SI 3 "register_operand" ""))]
409 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
410 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
411 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
412 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))
413 && (REGNO (operands[0]) != REGNO (operands[1])
414 || REGNO (operands[0]) != REGNO (operands[2]))"
416 [(set (subreg:SI (match_dup 0) 0)
417 (plus:SI (subreg:SI (match_dup 1) 0)
418 (subreg:SI (match_dup 2) 0)))
421 (ltu:SI (subreg:SI (match_dup 0) 0)
422 (subreg:SI (match_dup 2) 0)))
424 (set (subreg:SI (match_dup 0) 1)
425 (plus:SI (subreg:SI (match_dup 1) 1)
426 (subreg:SI (match_dup 2) 1)))
428 (set (subreg:SI (match_dup 0) 1)
429 (plus:SI (subreg:SI (match_dup 0) 1)
434 [(set (match_operand:DI 0 "register_operand" "")
435 (plus:DI (match_operand:DI 1 "register_operand" "")
436 (match_operand:DI 2 "register_operand" "")))
437 (clobber (match_operand:SI 3 "register_operand" ""))]
438 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
439 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
440 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
441 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))
442 && (REGNO (operands[0]) != REGNO (operands[1])
443 || REGNO (operands[0]) != REGNO (operands[2]))"
445 [(set (subreg:SI (match_dup 0) 1)
446 (plus:SI (subreg:SI (match_dup 1) 1)
447 (subreg:SI (match_dup 2) 1)))
450 (ltu:SI (subreg:SI (match_dup 0) 1)
451 (subreg:SI (match_dup 2) 1)))
453 (set (subreg:SI (match_dup 0) 0)
454 (plus:SI (subreg:SI (match_dup 1) 0)
455 (subreg:SI (match_dup 2) 0)))
457 (set (subreg:SI (match_dup 0) 0)
458 (plus:SI (subreg:SI (match_dup 0) 0)
462 (define_insn "adddi3_internal_2"
463 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
464 (plus:DI (match_operand:DI 1 "register_operand" "%d,%d,%d")
465 (match_operand:DI 2 "small_int" "P,J,N")))
466 (clobber (match_operand:SI 3 "register_operand" "=d,d,d"))]
467 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE && INTVAL (operands[2]) != -32768"
469 addu\\t%L0,%L1,%2\;sltu\\t%3,%L0,%2\;addu\\t%M0,%M1,%3
470 move\\t%L0,%L1\;move\\t%M0,%M1
471 subu\\t%L0,%L1,%n2\;sltu\\t%3,%L0,%2\;subu\\t%M0,%M1,1\;addu\\t%M0,%M0,%3"
472 [(set_attr "type" "darith")
473 (set_attr "mode" "DI")
474 (set_attr "length" "3,2,4")])
477 [(set (match_operand:DI 0 "register_operand" "")
478 (plus:DI (match_operand:DI 1 "register_operand" "")
479 (match_operand:DI 2 "small_int" "")))
480 (clobber (match_operand:SI 3 "register_operand" "=d"))]
481 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
482 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
483 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
484 && INTVAL (operands[2]) > 0"
486 [(set (subreg:SI (match_dup 0) 0)
487 (plus:SI (subreg:SI (match_dup 1) 0)
491 (ltu:SI (subreg:SI (match_dup 0) 0)
494 (set (subreg:SI (match_dup 0) 1)
495 (plus:SI (subreg:SI (match_dup 1) 1)
500 [(set (match_operand:DI 0 "register_operand" "")
501 (plus:DI (match_operand:DI 1 "register_operand" "")
502 (match_operand:DI 2 "small_int" "")))
503 (clobber (match_operand:SI 3 "register_operand" "=d"))]
504 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
505 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
506 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
507 && INTVAL (operands[2]) > 0"
509 [(set (subreg:SI (match_dup 0) 1)
510 (plus:SI (subreg:SI (match_dup 1) 1)
514 (ltu:SI (subreg:SI (match_dup 0) 1)
517 (set (subreg:SI (match_dup 0) 0)
518 (plus:SI (subreg:SI (match_dup 1) 0)
522 (define_insn "adddi3_internal_3"
523 [(set (match_operand:DI 0 "register_operand" "=d")
524 (plus:DI (match_operand:DI 1 "reg_or_0_operand" "dJ")
525 (match_operand:DI 2 "arith_operand" "dI")))]
526 "TARGET_64BIT && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
529 return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
530 ? \"dsubu\\t%0,%z1,%n2\"
531 : \"daddu\\t%0,%z1,%2\";
533 [(set_attr "type" "darith")
534 (set_attr "mode" "DI")
535 (set_attr "length" "1")])
538 (define_insn "addsi3_internal_2"
539 [(set (match_operand:DI 0 "register_operand" "=d")
540 (sign_extend:DI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
541 (match_operand:SI 2 "arith_operand" "dI"))))]
542 "TARGET_64BIT && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
545 return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
546 ? \"subu\\t%0,%z1,%n2\"
547 : \"addu\\t%0,%z1,%2\";
549 [(set_attr "type" "arith")
550 (set_attr "mode" "SI")
551 (set_attr "length" "1")])
555 ;; ....................
559 ;; ....................
562 (define_insn "subdf3"
563 [(set (match_operand:DF 0 "register_operand" "=f")
564 (minus:DF (match_operand:DF 1 "register_operand" "f")
565 (match_operand:DF 2 "register_operand" "f")))]
568 [(set_attr "type" "fadd")
569 (set_attr "mode" "DF")
570 (set_attr "length" "1")])
572 (define_insn "subsf3"
573 [(set (match_operand:SF 0 "register_operand" "=f")
574 (minus:SF (match_operand:SF 1 "register_operand" "f")
575 (match_operand:SF 2 "register_operand" "f")))]
578 [(set_attr "type" "fadd")
579 (set_attr "mode" "SF")
580 (set_attr "length" "1")])
582 (define_expand "subsi3"
583 [(set (match_operand:SI 0 "register_operand" "=d")
584 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
585 (match_operand:SI 2 "arith_operand" "dI")))]
589 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == -32768)
590 operands[2] = force_reg (SImode, operands[2]);
593 (define_insn "subsi3_internal"
594 [(set (match_operand:SI 0 "register_operand" "=d")
595 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
596 (match_operand:SI 2 "arith_operand" "dI")))]
597 "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768"
599 [(set_attr "type" "arith")
600 (set_attr "mode" "SI")
601 (set_attr "length" "1")])
603 (define_expand "subdi3"
604 [(parallel [(set (match_operand:DI 0 "register_operand" "=d")
605 (minus:DI (match_operand:DI 1 "register_operand" "d")
606 (match_operand:DI 2 "register_operand" "d")))
607 (clobber (match_dup 3))])]
608 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
613 emit_insn (gen_subdi3_internal_3 (operands[0], operands[1],
618 operands[3] = gen_reg_rtx (SImode);
621 (define_insn "subdi3_internal"
622 [(set (match_operand:DI 0 "register_operand" "=d")
623 (minus:DI (match_operand:DI 1 "register_operand" "d")
624 (match_operand:DI 2 "register_operand" "d")))
625 (clobber (match_operand:SI 3 "register_operand" "=d"))]
626 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE"
627 "sltu\\t%3,%L1,%L2\;subu\\t%L0,%L1,%L2\;subu\\t%M0,%M1,%M2\;subu\\t%M0,%M0,%3"
628 [(set_attr "type" "darith")
629 (set_attr "mode" "DI")
630 (set_attr "length" "4")])
633 [(set (match_operand:DI 0 "register_operand" "")
634 (minus:DI (match_operand:DI 1 "register_operand" "")
635 (match_operand:DI 2 "register_operand" "")))
636 (clobber (match_operand:SI 3 "register_operand" ""))]
637 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
638 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
639 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
640 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
643 (ltu:SI (subreg:SI (match_dup 1) 0)
644 (subreg:SI (match_dup 2) 0)))
646 (set (subreg:SI (match_dup 0) 0)
647 (minus:SI (subreg:SI (match_dup 1) 0)
648 (subreg:SI (match_dup 2) 0)))
650 (set (subreg:SI (match_dup 0) 1)
651 (minus:SI (subreg:SI (match_dup 1) 1)
652 (subreg:SI (match_dup 2) 1)))
654 (set (subreg:SI (match_dup 0) 1)
655 (minus:SI (subreg:SI (match_dup 0) 1)
660 [(set (match_operand:DI 0 "register_operand" "")
661 (minus:DI (match_operand:DI 1 "register_operand" "")
662 (match_operand:DI 2 "register_operand" "")))
663 (clobber (match_operand:SI 3 "register_operand" ""))]
664 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
665 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
666 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
667 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
670 (ltu:SI (subreg:SI (match_dup 1) 1)
671 (subreg:SI (match_dup 2) 1)))
673 (set (subreg:SI (match_dup 0) 1)
674 (minus:SI (subreg:SI (match_dup 1) 1)
675 (subreg:SI (match_dup 2) 1)))
677 (set (subreg:SI (match_dup 0) 0)
678 (minus:SI (subreg:SI (match_dup 1) 0)
679 (subreg:SI (match_dup 2) 0)))
681 (set (subreg:SI (match_dup 0) 0)
682 (minus:SI (subreg:SI (match_dup 0) 0)
686 (define_insn "subdi3_internal_2"
687 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
688 (minus:DI (match_operand:DI 1 "register_operand" "d,d,d")
689 (match_operand:DI 2 "small_int" "P,J,N")))
690 (clobber (match_operand:SI 3 "register_operand" "=d,d,d"))]
691 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE && INTVAL (operands[2]) != -32768"
693 sltu\\t%3,%L1,%2\;subu\\t%L0,%L1,%2\;subu\\t%M0,%M1,%3
694 move\\t%L0,%L1\;move\\t%M0,%M1
695 sltu\\t%3,%L1,%2\;subu\\t%L0,%L1,%2\;subu\\t%M0,%M1,1\;subu\\t%M0,%M0,%3"
696 [(set_attr "type" "darith")
697 (set_attr "mode" "DI")
698 (set_attr "length" "3,2,4")])
701 [(set (match_operand:DI 0 "register_operand" "")
702 (minus:DI (match_operand:DI 1 "register_operand" "")
703 (match_operand:DI 2 "small_int" "")))
704 (clobber (match_operand:SI 3 "register_operand" ""))]
705 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
706 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
707 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
708 && INTVAL (operands[2]) > 0"
711 (ltu:SI (subreg:SI (match_dup 1) 0)
714 (set (subreg:SI (match_dup 0) 0)
715 (minus:SI (subreg:SI (match_dup 1) 0)
718 (set (subreg:SI (match_dup 0) 1)
719 (minus:SI (subreg:SI (match_dup 1) 1)
724 [(set (match_operand:DI 0 "register_operand" "")
725 (minus:DI (match_operand:DI 1 "register_operand" "")
726 (match_operand:DI 2 "small_int" "")))
727 (clobber (match_operand:SI 3 "register_operand" ""))]
728 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
729 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
730 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
731 && INTVAL (operands[2]) > 0"
734 (ltu:SI (subreg:SI (match_dup 1) 1)
737 (set (subreg:SI (match_dup 0) 1)
738 (minus:SI (subreg:SI (match_dup 1) 1)
741 (set (subreg:SI (match_dup 0) 0)
742 (minus:SI (subreg:SI (match_dup 1) 0)
746 (define_insn "subdi3_internal_3"
747 [(set (match_operand:DI 0 "register_operand" "=d")
748 (minus:DI (match_operand:DI 1 "reg_or_0_operand" "dJ")
749 (match_operand:DI 2 "arith_operand" "dI")))]
750 "TARGET_64BIT && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
753 return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
754 ? \"daddu\\t%0,%z1,%n2\"
755 : \"dsubu\\t%0,%z1,%2\";
757 [(set_attr "type" "darith")
758 (set_attr "mode" "DI")
759 (set_attr "length" "1")])
762 (define_insn "subsi3_internal_2"
763 [(set (match_operand:DI 0 "register_operand" "=d")
764 (sign_extend:DI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
765 (match_operand:SI 2 "arith_operand" "dI"))))]
766 "TARGET_64BIT && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
769 return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
770 ? \"addu\\t%0,%z1,%n2\"
771 : \"subu\\t%0,%z1,%2\";
773 [(set_attr "type" "arith")
774 (set_attr "mode" "DI")
775 (set_attr "length" "1")])
779 ;; ....................
783 ;; ....................
786 (define_insn "muldf3"
787 [(set (match_operand:DF 0 "register_operand" "=f")
788 (mult:DF (match_operand:DF 1 "register_operand" "f")
789 (match_operand:DF 2 "register_operand" "f")))]
792 [(set_attr "type" "fmul")
793 (set_attr "mode" "DF")
794 (set_attr "length" "1")])
796 (define_insn "mulsf3"
797 [(set (match_operand:SF 0 "register_operand" "=f")
798 (mult:SF (match_operand:SF 1 "register_operand" "f")
799 (match_operand:SF 2 "register_operand" "f")))]
802 [(set_attr "type" "fmul")
803 (set_attr "mode" "SF")
804 (set_attr "length" "1")])
806 (define_insn "mulsi3"
807 [(set (match_operand:SI 0 "register_operand" "=d")
808 (mult:SI (match_operand:SI 1 "register_operand" "d")
809 (match_operand:SI 2 "register_operand" "d")))
810 (clobber (reg:SI 64))
811 (clobber (reg:SI 65))]
817 xoperands[0] = operands[0];
818 xoperands[1] = gen_rtx (REG, SImode, LO_REGNUM);
820 output_asm_insn (\"mult\\t%1,%2\", operands);
821 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
824 [(set_attr "type" "imul")
825 (set_attr "mode" "SI")
826 (set_attr "length" "3")]) ;; mult + mflo + delay
828 ;; ??? The R4000 (only) has a cpu bug. If a double-word shift executes while
829 ;; a multiply is in progress, it may give an incorrect result. We solve
830 ;; this by not splitting on the r4000.
833 [(set (match_operand:SI 0 "register_operand" "")
834 (mult:SI (match_operand:SI 1 "register_operand" "")
835 (match_operand:SI 2 "register_operand" "")))
836 (clobber (reg:SI 64))
837 (clobber (reg:SI 65))]
838 "!TARGET_DEBUG_D_MODE && mips_cpu != PROCESSOR_R4000"
839 [(parallel [(set (reg:SI 65) ;; low register
840 (mult:SI (match_dup 1)
842 (clobber (reg:SI 64))])
847 (define_insn "mulsi3_internal"
848 [(set (reg:SI 65) ;; low register
849 (mult:SI (match_operand:SI 0 "register_operand" "d")
850 (match_operand:SI 1 "register_operand" "d")))
851 (clobber (reg:SI 64))]
854 [(set_attr "type" "imul")
855 (set_attr "mode" "SI")
856 (set_attr "length" "1")])
858 (define_insn "muldi3"
859 [(set (match_operand:DI 0 "register_operand" "=d")
860 (mult:DI (match_operand:DI 1 "register_operand" "d")
861 (match_operand:DI 2 "register_operand" "d")))
862 (clobber (reg:DI 64))
863 (clobber (reg:DI 65))]
869 xoperands[0] = operands[0];
870 xoperands[1] = gen_rtx (REG, DImode, LO_REGNUM);
872 output_asm_insn (\"dmult\\t%1,%2\", operands);
873 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
876 [(set_attr "type" "imul")
877 (set_attr "mode" "DI")
878 (set_attr "length" "3")]) ;; mult + mflo + delay
880 ;; ??? The R4000 (only) has a cpu bug. If a double-word shift executes while
881 ;; a multiply is in progress, it may give an incorrect result. We solve
882 ;; this by not splitting on the r4000.
885 [(set (match_operand:DI 0 "register_operand" "")
886 (mult:DI (match_operand:DI 1 "register_operand" "")
887 (match_operand:DI 2 "register_operand" "")))
888 (clobber (reg:DI 64))
889 (clobber (reg:DI 65))]
890 "TARGET_64BIT && !TARGET_DEBUG_D_MODE && mips_cpu != PROCESSOR_R4000"
891 [(parallel [(set (reg:DI 65) ;; low register
892 (mult:DI (match_dup 1)
894 (clobber (reg:DI 64))])
899 (define_insn "muldi3_internal"
900 [(set (reg:DI 65) ;; low register
901 (mult:DI (match_operand:DI 0 "register_operand" "d")
902 (match_operand:DI 1 "register_operand" "d")))
903 (clobber (reg:DI 64))]
906 [(set_attr "type" "imul")
907 (set_attr "mode" "DI")
908 (set_attr "length" "1")])
910 ;; In 64 bit mode the mult instruction still writes 32 bits each to HI
911 ;; and LO, so to do mulsidi3 and umultsidi3 we need to pull the values
912 ;; out and combine them by hand into the single output register. Not
913 ;; supported for now.
915 ;; ??? We could define a mulditi3 pattern when TARGET_64BIT.
917 (define_insn "mulsidi3"
918 [(set (match_operand:DI 0 "register_operand" "=d")
919 (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
920 (sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))
921 (clobber (reg:SI 64))
922 (clobber (reg:SI 65))]
928 xoperands[0] = operands[0];
929 xoperands[1] = gen_rtx (REG, DImode, MD_REG_FIRST);
931 output_asm_insn (\"mult\\t%1,%2\", operands);
932 output_asm_insn (mips_move_2words (xoperands, insn), xoperands);
935 [(set_attr "type" "imul")
936 (set_attr "mode" "SI")
937 (set_attr "length" "4")]) ;; mult + mflo + mfhi + delay
939 (define_insn "smulsi3_highpart"
940 [(set (match_operand:SI 0 "register_operand" "=d")
942 (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
943 (sign_extend:DI (match_operand:SI 2 "register_operand" "d")))
945 (clobber (reg:SI 64))
946 (clobber (reg:SI 65))]
952 xoperands[0] = operands[0];
953 xoperands[1] = gen_rtx (REG, SImode, HI_REGNUM);
955 output_asm_insn (\"mult\\t%1,%2\", operands);
956 output_asm_insn (mips_move_1word (xoperands, insn, TRUE), xoperands);
959 [(set_attr "type" "imul")
960 (set_attr "mode" "SI")
961 (set_attr "length" "3")]) ;; mult + mfhi + delay
964 [(set (match_operand:SI 0 "register_operand" "")
966 (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
967 (sign_extend:DI (match_operand:SI 2 "register_operand" "d")))
969 (clobber (reg:SI 64))
970 (clobber (reg:SI 65))]
971 "!TARGET_DEBUG_D_MODE"
972 [(parallel [(set (reg:SI 64) ;; high register
974 (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
975 (sign_extend:DI (match_dup 2)))
977 (clobber (reg:SI 65))])
982 (define_insn "smulsi3_highpart_internal"
983 [(set (reg:SI 64) ;; high register
985 (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 0 "register_operand" "d"))
986 (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))
988 (clobber (reg:SI 65))]
991 [(set_attr "type" "imul")
992 (set_attr "mode" "SI")
993 (set_attr "length" "1")])
995 (define_insn "umulsidi3"
996 [(set (match_operand:DI 0 "register_operand" "=d")
997 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
998 (zero_extend:DI (match_operand:SI 2 "register_operand" "d"))))
999 (clobber (reg:SI 64))
1000 (clobber (reg:SI 65))]
1006 xoperands[0] = operands[0];
1007 xoperands[1] = gen_rtx (REG, DImode, MD_REG_FIRST);
1009 output_asm_insn (\"multu\\t%1,%2\", operands);
1010 output_asm_insn (mips_move_2words (xoperands, insn), xoperands);
1013 [(set_attr "type" "imul")
1014 (set_attr "mode" "SI")
1015 (set_attr "length" "4")]) ;; mult + mflo + mfhi + delay
1017 (define_insn "umulsi3_highpart"
1018 [(set (match_operand:SI 0 "register_operand" "=d")
1020 (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
1021 (zero_extend:DI (match_operand:SI 2 "register_operand" "d")))
1023 (clobber (reg:SI 64))
1024 (clobber (reg:SI 65))]
1030 xoperands[0] = operands[0];
1031 xoperands[1] = gen_rtx (REG, SImode, HI_REGNUM);
1033 output_asm_insn (\"multu\\t%1,%2\", operands);
1034 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
1037 [(set_attr "type" "imul")
1038 (set_attr "mode" "SI")
1039 (set_attr "length" "3")]) ;; multu + mfhi + delay
1042 [(set (match_operand:SI 0 "register_operand" "")
1044 (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
1045 (zero_extend:DI (match_operand:SI 2 "register_operand" "d")))
1047 (clobber (reg:SI 64))
1048 (clobber (reg:SI 65))]
1049 "!TARGET_DEBUG_D_MODE"
1050 [(parallel [(set (reg:SI 64) ;; high register
1052 (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
1053 (zero_extend:DI (match_dup 2)))
1055 (clobber (reg:SI 65))])
1060 (define_insn "umulsi3_highpart_internal"
1061 [(set (reg:SI 64) ;; high register
1063 (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 0 "register_operand" "d"))
1064 (zero_extend:DI (match_operand:SI 1 "register_operand" "d")))
1066 (clobber (reg:SI 65))]
1069 [(set_attr "type" "imul")
1070 (set_attr "mode" "SI")
1071 (set_attr "length" "1")])
1074 ;; ....................
1076 ;; DIVISION and REMAINDER
1078 ;; ....................
1081 (define_insn "divdf3"
1082 [(set (match_operand:DF 0 "register_operand" "=f")
1083 (div:DF (match_operand:DF 1 "register_operand" "f")
1084 (match_operand:DF 2 "register_operand" "f")))]
1087 [(set_attr "type" "fdiv")
1088 (set_attr "mode" "DF")
1089 (set_attr "length" "1")])
1091 (define_insn "divsf3"
1092 [(set (match_operand:SF 0 "register_operand" "=f")
1093 (div:SF (match_operand:SF 1 "register_operand" "f")
1094 (match_operand:SF 2 "register_operand" "f")))]
1097 [(set_attr "type" "fdiv")
1098 (set_attr "mode" "SF")
1099 (set_attr "length" "1")])
1101 ;; If optimizing, prefer the divmod functions over separate div and
1102 ;; mod functions, since this will allow using one instruction for both
1103 ;; the quotient and remainder. At present, the divmod is not moved out
1104 ;; of loops if it is constant within the loop, so allow -mdebugc to
1105 ;; use the old method of doing things.
1107 ;; 64 is the multiply/divide hi register
1108 ;; 65 is the multiply/divide lo register
1110 ;; ??? We can't accept constants here, because the MIPS assembler will replace
1111 ;; a divide by power of 2 with a shift, and then the remainder is no longer
1114 (define_insn "divmodsi4"
1115 [(set (match_operand:SI 0 "register_operand" "=d")
1116 (div:SI (match_operand:SI 1 "register_operand" "d")
1117 (match_operand:SI 2 "register_operand" "d")))
1118 (set (match_operand:SI 3 "register_operand" "=d")
1119 (mod:SI (match_dup 1)
1121 (clobber (reg:SI 64))
1122 (clobber (reg:SI 65))]
1126 if (find_reg_note (insn, REG_UNUSED, operands[3]))
1127 return \"div\\t%0,%1,%2\";
1129 if (find_reg_note (insn, REG_UNUSED, operands[0]))
1130 return \"rem\\t%3,%1,%2\";
1132 return \"div\\t%0,%1,%2\;mfhi\\t%3\";
1134 [(set_attr "type" "idiv")
1135 (set_attr "mode" "SI")
1136 (set_attr "length" "14")]) ;; various tests for dividing by 0 and such
1138 (define_insn "divmoddi4"
1139 [(set (match_operand:DI 0 "register_operand" "=d")
1140 (div:DI (match_operand:DI 1 "register_operand" "d")
1141 (match_operand:DI 2 "register_operand" "d")))
1142 (set (match_operand:DI 3 "register_operand" "=d")
1143 (mod:DI (match_dup 1)
1145 (clobber (reg:DI 64))
1146 (clobber (reg:DI 65))]
1147 "TARGET_64BIT && optimize"
1150 if (find_reg_note (insn, REG_UNUSED, operands[3]))
1151 return \"ddiv\\t%0,%1,%2\";
1153 if (find_reg_note (insn, REG_UNUSED, operands[0]))
1154 return \"drem\\t%3,%1,%2\";
1156 return \"ddiv\\t%0,%1,%2\;mfhi\\t%3\";
1158 [(set_attr "type" "idiv")
1159 (set_attr "mode" "DI")
1160 (set_attr "length" "15")]) ;; various tests for dividing by 0 and such
1162 (define_insn "udivmodsi4"
1163 [(set (match_operand:SI 0 "register_operand" "=d")
1164 (udiv:SI (match_operand:SI 1 "register_operand" "d")
1165 (match_operand:SI 2 "register_operand" "d")))
1166 (set (match_operand:SI 3 "register_operand" "=d")
1167 (umod:SI (match_dup 1)
1169 (clobber (reg:SI 64))
1170 (clobber (reg:SI 65))]
1174 if (find_reg_note (insn, REG_UNUSED, operands[3]))
1175 return \"divu\\t%0,%1,%2\";
1177 if (find_reg_note (insn, REG_UNUSED, operands[0]))
1178 return \"remu\\t%3,%1,%2\";
1180 return \"divu\\t%0,%1,%2\;mfhi\\t%3\";
1182 [(set_attr "type" "idiv")
1183 (set_attr "mode" "SI")
1184 (set_attr "length" "8")]) ;; various tests for dividing by 0 and such
1186 (define_insn "udivmoddi4"
1187 [(set (match_operand:DI 0 "register_operand" "=d")
1188 (udiv:DI (match_operand:DI 1 "register_operand" "d")
1189 (match_operand:DI 2 "register_operand" "d")))
1190 (set (match_operand:DI 3 "register_operand" "=d")
1191 (umod:DI (match_dup 1)
1193 (clobber (reg:DI 64))
1194 (clobber (reg:DI 65))]
1195 "TARGET_64BIT && optimize"
1198 if (find_reg_note (insn, REG_UNUSED, operands[3]))
1199 return \"ddivu\\t%0,%1,%2\";
1201 if (find_reg_note (insn, REG_UNUSED, operands[0]))
1202 return \"dremu\\t%3,%1,%2\";
1204 return \"ddivu\\t%0,%1,%2\;mfhi\\t%3\";
1206 [(set_attr "type" "idiv")
1207 (set_attr "mode" "DI")
1208 (set_attr "length" "8")]) ;; various tests for dividing by 0 and such
1210 (define_insn "divsi3"
1211 [(set (match_operand:SI 0 "register_operand" "=d")
1212 (div:SI (match_operand:SI 1 "register_operand" "d")
1213 (match_operand:SI 2 "nonmemory_operand" "di")))
1214 (clobber (reg:SI 64))
1215 (clobber (reg:SI 65))]
1218 [(set_attr "type" "idiv")
1219 (set_attr "mode" "SI")
1220 (set_attr "length" "13")]) ;; various tests for dividing by 0 and such
1222 (define_insn "divdi3"
1223 [(set (match_operand:DI 0 "register_operand" "=d")
1224 (div:DI (match_operand:DI 1 "register_operand" "d")
1225 (match_operand:DI 2 "nonmemory_operand" "di")))
1226 (clobber (reg:DI 64))
1227 (clobber (reg:DI 65))]
1228 "TARGET_64BIT && !optimize"
1230 [(set_attr "type" "idiv")
1231 (set_attr "mode" "DI")
1232 (set_attr "length" "14")]) ;; various tests for dividing by 0 and such
1234 (define_insn "modsi3"
1235 [(set (match_operand:SI 0 "register_operand" "=d")
1236 (mod:SI (match_operand:SI 1 "register_operand" "d")
1237 (match_operand:SI 2 "nonmemory_operand" "di")))
1238 (clobber (reg:SI 64))
1239 (clobber (reg:SI 65))]
1242 [(set_attr "type" "idiv")
1243 (set_attr "mode" "SI")
1244 (set_attr "length" "13")]) ;; various tests for dividing by 0 and such
1246 (define_insn "moddi3"
1247 [(set (match_operand:DI 0 "register_operand" "=d")
1248 (mod:DI (match_operand:DI 1 "register_operand" "d")
1249 (match_operand:DI 2 "nonmemory_operand" "di")))
1250 (clobber (reg:DI 64))
1251 (clobber (reg:DI 65))]
1252 "TARGET_64BIT && !optimize"
1254 [(set_attr "type" "idiv")
1255 (set_attr "mode" "DI")
1256 (set_attr "length" "14")]) ;; various tests for dividing by 0 and such
1258 (define_insn "udivsi3"
1259 [(set (match_operand:SI 0 "register_operand" "=d")
1260 (udiv:SI (match_operand:SI 1 "register_operand" "d")
1261 (match_operand:SI 2 "nonmemory_operand" "di")))
1262 (clobber (reg:SI 64))
1263 (clobber (reg:SI 65))]
1266 [(set_attr "type" "idiv")
1267 (set_attr "mode" "SI")
1268 (set_attr "length" "7")]) ;; various tests for dividing by 0 and such
1270 (define_insn "udivdi3"
1271 [(set (match_operand:DI 0 "register_operand" "=d")
1272 (udiv:DI (match_operand:DI 1 "register_operand" "d")
1273 (match_operand:DI 2 "nonmemory_operand" "di")))
1274 (clobber (reg:DI 64))
1275 (clobber (reg:DI 65))]
1276 "TARGET_64BIT && !optimize"
1278 [(set_attr "type" "idiv")
1279 (set_attr "mode" "DI")
1280 (set_attr "length" "7")]) ;; various tests for dividing by 0 and such
1282 (define_insn "umodsi3"
1283 [(set (match_operand:SI 0 "register_operand" "=d")
1284 (umod:SI (match_operand:SI 1 "register_operand" "d")
1285 (match_operand:SI 2 "nonmemory_operand" "di")))
1286 (clobber (reg:SI 64))
1287 (clobber (reg:SI 65))]
1290 [(set_attr "type" "idiv")
1291 (set_attr "mode" "SI")
1292 (set_attr "length" "7")]) ;; various tests for dividing by 0 and such
1294 (define_insn "umoddi3"
1295 [(set (match_operand:DI 0 "register_operand" "=d")
1296 (umod:DI (match_operand:DI 1 "register_operand" "d")
1297 (match_operand:DI 2 "nonmemory_operand" "di")))
1298 (clobber (reg:DI 64))
1299 (clobber (reg:DI 65))]
1300 "TARGET_64BIT && !optimize"
1302 [(set_attr "type" "idiv")
1303 (set_attr "mode" "DI")
1304 (set_attr "length" "7")]) ;; various tests for dividing by 0 and such
1308 ;; ....................
1312 ;; ....................
1314 (define_insn "sqrtdf2"
1315 [(set (match_operand:DF 0 "register_operand" "=f")
1316 (sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
1317 "TARGET_HARD_FLOAT && HAVE_SQRT_P()"
1319 [(set_attr "type" "fsqrt")
1320 (set_attr "mode" "DF")
1321 (set_attr "length" "1")])
1323 (define_insn "sqrtsf2"
1324 [(set (match_operand:SF 0 "register_operand" "=f")
1325 (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
1326 "TARGET_HARD_FLOAT && HAVE_SQRT_P()"
1328 [(set_attr "type" "fsqrt")
1329 (set_attr "mode" "SF")
1330 (set_attr "length" "1")])
1334 ;; ....................
1338 ;; ....................
1340 ;; Do not use the integer abs macro instruction, since that signals an
1341 ;; exception on -2147483648 (sigh).
1343 (define_insn "abssi2"
1344 [(set (match_operand:SI 0 "register_operand" "=d")
1345 (abs:SI (match_operand:SI 1 "register_operand" "d")))]
1349 dslots_jump_total++;
1350 dslots_jump_filled++;
1351 operands[2] = const0_rtx;
1353 if (REGNO (operands[0]) == REGNO (operands[1]))
1356 return \"%(bltzl\\t%1,1f\\n\\tsubu\\t%0,%z2,%0\\n1:%)\";
1358 return \"bgez\\t%1,1f%#\\n\\tsubu\\t%0,%z2,%0\\n1:\";
1361 return \"%(bgez\\t%1,1f\\n\\tmove\\t%0,%1\\n\\tsubu\\t%0,%z2,%0\\n1:%)\";
1363 [(set_attr "type" "multi")
1364 (set_attr "mode" "SI")
1365 (set_attr "length" "3")])
1367 (define_insn "absdi2"
1368 [(set (match_operand:DI 0 "register_operand" "=d")
1369 (abs:DI (match_operand:DI 1 "register_operand" "d")))]
1373 dslots_jump_total++;
1374 dslots_jump_filled++;
1375 operands[2] = const0_rtx;
1377 if (REGNO (operands[0]) == REGNO (operands[1]))
1378 return \"%(bltzl\\t%1,1f\\n\\tdsubu\\t%0,%z2,%0\\n1:%)\";
1380 return \"%(bgez\\t%1,1f\\n\\tmove\\t%0,%1\\n\\tdsubu\\t%0,%z2,%0\\n1:%)\";
1382 [(set_attr "type" "multi")
1383 (set_attr "mode" "DI")
1384 (set_attr "length" "3")])
1386 (define_insn "absdf2"
1387 [(set (match_operand:DF 0 "register_operand" "=f")
1388 (abs:DF (match_operand:DF 1 "register_operand" "f")))]
1391 [(set_attr "type" "fabs")
1392 (set_attr "mode" "DF")
1393 (set_attr "length" "1")])
1395 (define_insn "abssf2"
1396 [(set (match_operand:SF 0 "register_operand" "=f")
1397 (abs:SF (match_operand:SF 1 "register_operand" "f")))]
1400 [(set_attr "type" "fabs")
1401 (set_attr "mode" "SF")
1402 (set_attr "length" "1")])
1406 ;; ....................
1408 ;; FIND FIRST BIT INSTRUCTION
1410 ;; ....................
1413 (define_insn "ffssi2"
1414 [(set (match_operand:SI 0 "register_operand" "=&d")
1415 (ffs:SI (match_operand:SI 1 "register_operand" "d")))
1416 (clobber (match_scratch:SI 2 "=&d"))
1417 (clobber (match_scratch:SI 3 "=&d"))]
1421 dslots_jump_total += 2;
1422 dslots_jump_filled += 2;
1423 operands[4] = const0_rtx;
1425 if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))
1428 \\tbeq\\t%1,%z4,2f\\n\\
1429 1:\\tand\\t%2,%1,0x0001\\n\\
1430 \\taddu\\t%0,%0,1\\n\\
1431 \\tbeq\\t%2,%z4,1b\\n\\
1432 \\tsrl\\t%1,%1,1\\n\\
1437 \\tmove\\t%3,%1\\n\\
1438 \\tbeq\\t%3,%z4,2f\\n\\
1439 1:\\tand\\t%2,%3,0x0001\\n\\
1440 \\taddu\\t%0,%0,1\\n\\
1441 \\tbeq\\t%2,%z4,1b\\n\\
1442 \\tsrl\\t%3,%3,1\\n\\
1445 [(set_attr "type" "multi")
1446 (set_attr "mode" "SI")
1447 (set_attr "length" "6")])
1449 (define_insn "ffsdi2"
1450 [(set (match_operand:DI 0 "register_operand" "=&d")
1451 (ffs:DI (match_operand:DI 1 "register_operand" "d")))
1452 (clobber (match_scratch:DI 2 "=&d"))
1453 (clobber (match_scratch:DI 3 "=&d"))]
1457 dslots_jump_total += 2;
1458 dslots_jump_filled += 2;
1459 operands[4] = const0_rtx;
1461 if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))
1464 \\tbeq\\t%1,%z4,2f\\n\\
1465 1:\\tand\\t%2,%1,0x0001\\n\\
1466 \\tdaddu\\t%0,%0,1\\n\\
1467 \\tbeq\\t%2,%z4,1b\\n\\
1468 \\tdsrl\\t%1,%1,1\\n\\
1473 \\tmove\\t%3,%1\\n\\
1474 \\tbeq\\t%3,%z4,2f\\n\\
1475 1:\\tand\\t%2,%3,0x0001\\n\\
1476 \\tdaddu\\t%0,%0,1\\n\\
1477 \\tbeq\\t%2,%z4,1b\\n\\
1478 \\tdsrl\\t%3,%3,1\\n\\
1481 [(set_attr "type" "multi")
1482 (set_attr "mode" "DI")
1483 (set_attr "length" "6")])
1487 ;; ....................
1489 ;; NEGATION and ONE'S COMPLEMENT
1491 ;; ....................
1493 (define_insn "negsi2"
1494 [(set (match_operand:SI 0 "register_operand" "=d")
1495 (neg:SI (match_operand:SI 1 "register_operand" "d")))]
1499 operands[2] = const0_rtx;
1500 return \"subu\\t%0,%z2,%1\";
1502 [(set_attr "type" "arith")
1503 (set_attr "mode" "SI")
1504 (set_attr "length" "1")])
1506 (define_expand "negdi2"
1507 [(parallel [(set (match_operand:DI 0 "register_operand" "=d")
1508 (neg:DI (match_operand:DI 1 "register_operand" "d")))
1509 (clobber (match_dup 2))])]
1510 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
1515 emit_insn (gen_negdi2_internal_2 (operands[0], operands[1]));
1519 operands[2] = gen_reg_rtx (SImode);
1522 (define_insn "negdi2_internal"
1523 [(set (match_operand:DI 0 "register_operand" "=d")
1524 (neg:DI (match_operand:DI 1 "register_operand" "d")))
1525 (clobber (match_operand:SI 2 "register_operand" "=d"))]
1526 "! TARGET_64BIT && !TARGET_DEBUG_G_MODE"
1529 operands[3] = const0_rtx;
1530 return \"subu\\t%L0,%z3,%L1\;subu\\t%M0,%z3,%M1\;sltu\\t%2,%z3,%L0\;subu\\t%M0,%M0,%2\";
1532 [(set_attr "type" "darith")
1533 (set_attr "mode" "DI")
1534 (set_attr "length" "4")])
1536 (define_insn "negdi2_internal_2"
1537 [(set (match_operand:DI 0 "register_operand" "=d")
1538 (neg:DI (match_operand:DI 1 "register_operand" "d")))]
1542 operands[2] = const0_rtx;
1543 return \"dsubu\\t%0,%z2,%1\";
1545 [(set_attr "type" "arith")
1546 (set_attr "mode" "DI")
1547 (set_attr "length" "1")])
1549 (define_insn "negdf2"
1550 [(set (match_operand:DF 0 "register_operand" "=f")
1551 (neg:DF (match_operand:DF 1 "register_operand" "f")))]
1554 [(set_attr "type" "fneg")
1555 (set_attr "mode" "DF")
1556 (set_attr "length" "1")])
1558 (define_insn "negsf2"
1559 [(set (match_operand:SF 0 "register_operand" "=f")
1560 (neg:SF (match_operand:SF 1 "register_operand" "f")))]
1563 [(set_attr "type" "fneg")
1564 (set_attr "mode" "SF")
1565 (set_attr "length" "1")])
1567 (define_insn "one_cmplsi2"
1568 [(set (match_operand:SI 0 "register_operand" "=d")
1569 (not:SI (match_operand:SI 1 "register_operand" "d")))]
1573 operands[2] = const0_rtx;
1574 return \"nor\\t%0,%z2,%1\";
1576 [(set_attr "type" "arith")
1577 (set_attr "mode" "SI")
1578 (set_attr "length" "1")])
1580 (define_insn "one_cmpldi2"
1581 [(set (match_operand:DI 0 "register_operand" "=d")
1582 (not:DI (match_operand:DI 1 "register_operand" "d")))]
1586 operands[2] = const0_rtx;
1588 return \"nor\\t%0,%z2,%1\";
1589 return \"nor\\t%M0,%z2,%M1\;nor\\t%L0,%z2,%L1\";
1591 [(set_attr "type" "darith")
1592 (set_attr "mode" "DI")
1593 (set (attr "length")
1594 (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
1599 [(set (match_operand:DI 0 "register_operand" "")
1600 (not:DI (match_operand:DI 1 "register_operand" "")))]
1601 "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1602 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1603 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
1605 [(set (subreg:SI (match_dup 0) 0) (not:SI (subreg:SI (match_dup 1) 0)))
1606 (set (subreg:SI (match_dup 0) 1) (not:SI (subreg:SI (match_dup 1) 1)))]
1609 ;; Simple hack to recognize the "nor" instruction on the MIPS
1610 ;; This must appear before the normal or patterns, so that the
1611 ;; combiner will correctly fold things.
1613 (define_insn "norsi3"
1614 [(set (match_operand:SI 0 "register_operand" "=d")
1615 (not:SI (ior:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
1616 (match_operand:SI 2 "reg_or_0_operand" "dJ"))))]
1619 [(set_attr "type" "arith")
1620 (set_attr "mode" "SI")
1621 (set_attr "length" "1")])
1623 (define_insn "nordi3"
1624 [(set (match_operand:DI 0 "register_operand" "=d")
1625 (not:DI (ior:DI (match_operand:DI 1 "register_operand" "d")
1626 (match_operand:DI 2 "register_operand" "d"))))]
1631 return \"nor\\t%0,%z1,%z2\";
1632 return \"nor\\t%M0,%M1,%M2\;nor\\t%L0,%L1,%L2\";
1634 [(set_attr "type" "darith")
1635 (set_attr "mode" "DI")
1636 (set (attr "length")
1637 (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
1642 [(set (match_operand:DI 0 "register_operand" "")
1643 (not:DI (ior:DI (match_operand:DI 1 "register_operand" "")
1644 (match_operand:DI 2 "register_operand" ""))))]
1645 "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1646 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1647 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1648 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1650 [(set (subreg:SI (match_dup 0) 0) (not:SI (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0))))
1651 (set (subreg:SI (match_dup 0) 1) (not:SI (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1))))]
1656 ;; ....................
1660 ;; ....................
1663 (define_insn "andsi3"
1664 [(set (match_operand:SI 0 "register_operand" "=d,d")
1665 (and:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
1666 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
1671 [(set_attr "type" "arith")
1672 (set_attr "mode" "SI")
1673 (set_attr "length" "1")])
1675 (define_insn "anddi3"
1676 [(set (match_operand:DI 0 "register_operand" "=d")
1677 (and:DI (match_operand:DI 1 "register_operand" "d")
1678 (match_operand:DI 2 "register_operand" "d")))]
1679 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
1683 return \"and\\t%0,%1,%2\";
1684 return \"and\\t%M0,%M1,%M2\;and\\t%L0,%L1,%L2\";
1686 [(set_attr "type" "darith")
1687 (set_attr "mode" "DI")
1688 (set (attr "length")
1689 (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
1694 [(set (match_operand:DI 0 "register_operand" "")
1695 (and:DI (match_operand:DI 1 "register_operand" "")
1696 (match_operand:DI 2 "register_operand" "")))]
1697 "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1698 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1699 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1700 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1702 [(set (subreg:SI (match_dup 0) 0) (and:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))
1703 (set (subreg:SI (match_dup 0) 1) (and:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]
1706 (define_insn "anddi3_internal1"
1707 [(set (match_operand:DI 0 "register_operand" "=d,d")
1708 (and:DI (match_operand:DI 1 "register_operand" "%d,d")
1709 (match_operand:DI 2 "uns_arith_operand" "d,K")))]
1714 [(set_attr "type" "arith")
1715 (set_attr "mode" "DI")
1716 (set_attr "length" "1")])
1718 (define_insn "iorsi3"
1719 [(set (match_operand:SI 0 "register_operand" "=d,d")
1720 (ior:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
1721 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
1726 [(set_attr "type" "arith")
1727 (set_attr "mode" "SI")
1728 (set_attr "length" "1")])
1730 ;;; ??? There is no iordi3 pattern which accepts 'K' constants when
1733 (define_insn "iordi3"
1734 [(set (match_operand:DI 0 "register_operand" "=d")
1735 (ior:DI (match_operand:DI 1 "register_operand" "d")
1736 (match_operand:DI 2 "register_operand" "d")))]
1737 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
1741 return \"or\\t%0,%1,%2\";
1742 return \"or\\t%M0,%M1,%M2\;or\\t%L0,%L1,%L2\";
1744 [(set_attr "type" "darith")
1745 (set_attr "mode" "DI")
1746 (set (attr "length")
1747 (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
1752 [(set (match_operand:DI 0 "register_operand" "")
1753 (ior:DI (match_operand:DI 1 "register_operand" "")
1754 (match_operand:DI 2 "register_operand" "")))]
1755 "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1756 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1757 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1758 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1760 [(set (subreg:SI (match_dup 0) 0) (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))
1761 (set (subreg:SI (match_dup 0) 1) (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]
1764 (define_insn "xorsi3"
1765 [(set (match_operand:SI 0 "register_operand" "=d,d")
1766 (xor:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
1767 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
1772 [(set_attr "type" "arith")
1773 (set_attr "mode" "SI")
1774 (set_attr "length" "1")])
1776 ;; ??? If delete the 32-bit long long patterns, then could merge this with
1777 ;; the following xordi3_internal pattern.
1778 (define_insn "xordi3"
1779 [(set (match_operand:DI 0 "register_operand" "=d")
1780 (xor:DI (match_operand:DI 1 "register_operand" "d")
1781 (match_operand:DI 2 "register_operand" "d")))]
1782 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
1786 return \"xor\\t%0,%1,%2\";
1787 return \"xor\\t%M0,%M1,%M2\;xor\\t%L0,%L1,%L2\";
1789 [(set_attr "type" "darith")
1790 (set_attr "mode" "DI")
1791 (set (attr "length")
1792 (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
1797 [(set (match_operand:DI 0 "register_operand" "")
1798 (xor:DI (match_operand:DI 1 "register_operand" "")
1799 (match_operand:DI 2 "register_operand" "")))]
1800 "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
1801 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1802 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1803 && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
1805 [(set (subreg:SI (match_dup 0) 0) (xor:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))
1806 (set (subreg:SI (match_dup 0) 1) (xor:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]
1809 (define_insn "xordi3_immed"
1810 [(set (match_operand:DI 0 "register_operand" "d")
1811 (xor:DI (match_operand:DI 1 "register_operand" "d")
1812 (match_operand:DI 2 "uns_arith_operand" "K")))]
1815 [(set_attr "type" "arith")
1816 (set_attr "mode" "DI")
1817 (set_attr "length" "1")])
1821 ;; ....................
1825 ;; ....................
1827 (define_insn "truncdfsf2"
1828 [(set (match_operand:SF 0 "register_operand" "=f")
1829 (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))]
1832 [(set_attr "type" "fcvt")
1833 (set_attr "mode" "SF")
1834 (set_attr "length" "1")])
1836 ;; ??? This should be a define expand.
1837 ;; See the zero_extendsidi2 pattern.
1838 (define_insn "truncdisi2"
1839 [(set (match_operand:SI 0 "register_operand" "=d")
1840 (truncate:SI (match_operand:DI 1 "register_operand" "d")))]
1842 "dsll\\t%0,%1,32\;dsra\\t%0,%0,32"
1843 [(set_attr "type" "darith")
1844 (set_attr "mode" "SI")
1845 (set_attr "length" "2")])
1847 (define_insn "truncdihi2"
1848 [(set (match_operand:HI 0 "register_operand" "=d")
1849 (truncate:HI (match_operand:DI 1 "register_operand" "d")))]
1851 "andi\\t%0,%1,0xffff"
1852 [(set_attr "type" "darith")
1853 (set_attr "mode" "HI")
1854 (set_attr "length" "1")])
1856 (define_insn "truncdiqi2"
1857 [(set (match_operand:QI 0 "register_operand" "=d")
1858 (truncate:QI (match_operand:DI 1 "register_operand" "d")))]
1860 "andi\\t%0,%1,0x00ff"
1861 [(set_attr "type" "darith")
1862 (set_attr "mode" "QI")
1863 (set_attr "length" "1")])
1866 ;; ....................
1870 ;; ....................
1873 ;; Those for integer source operand
1874 ;; are ordered widest source type first.
1876 (define_expand "zero_extendsidi2"
1877 [(set (match_operand:DI 0 "register_operand" "")
1878 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
1882 if (optimize && GET_CODE (operands[1]) == MEM)
1883 operands[1] = force_not_mem (operands[1]);
1885 if (GET_CODE (operands[1]) != MEM)
1887 rtx op1 = gen_lowpart (DImode, operands[1]);
1888 rtx temp = gen_reg_rtx (DImode);
1889 rtx shift = gen_rtx (CONST_INT, VOIDmode, 32);
1891 emit_insn (gen_ashldi3 (temp, op1, shift));
1892 emit_insn (gen_lshrdi3 (operands[0], temp, shift));
1897 (define_insn "zero_extendsidi2_internal"
1898 [(set (match_operand:DI 0 "register_operand" "=d,d")
1899 (zero_extend:DI (match_operand:SI 1 "memory_operand" "R,m")))]
1901 "* return mips_move_1word (operands, insn, TRUE);"
1902 [(set_attr "type" "load")
1903 (set_attr "mode" "DI")
1904 (set_attr "length" "1,2")])
1907 (define_insn "zero_extendhisi2"
1908 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
1909 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d,R,m")))]
1913 if (which_alternative == 0)
1914 return \"andi\\t%0,%1,0xffff\";
1916 return mips_move_1word (operands, insn, TRUE);
1918 [(set_attr "type" "arith,load,load")
1919 (set_attr "mode" "SI")
1920 (set_attr "length" "1,1,2")])
1922 (define_insn "zero_extendhidi2"
1923 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
1924 (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,R,m")))]
1928 if (which_alternative == 0)
1929 return \"andi\\t%0,%1,0xffff\";
1931 return mips_move_1word (operands, insn, TRUE);
1933 [(set_attr "type" "arith,load,load")
1934 (set_attr "mode" "DI")
1935 (set_attr "length" "1,1,2")])
1937 (define_insn "zero_extendqihi2"
1938 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
1939 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "d,R,m")))]
1943 if (which_alternative == 0)
1944 return \"andi\\t%0,%1,0x00ff\";
1946 return mips_move_1word (operands, insn, TRUE);
1948 [(set_attr "type" "arith,load,load")
1949 (set_attr "mode" "HI")
1950 (set_attr "length" "1,1,2")])
1952 (define_insn "zero_extendqisi2"
1953 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
1954 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "d,R,m")))]
1958 if (which_alternative == 0)
1959 return \"andi\\t%0,%1,0x00ff\";
1961 return mips_move_1word (operands, insn, TRUE);
1963 [(set_attr "type" "arith,load,load")
1964 (set_attr "mode" "SI")
1965 (set_attr "length" "1,1,2")])
1967 (define_insn "zero_extendqidi2"
1968 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
1969 (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "d,R,m")))]
1973 if (which_alternative == 0)
1974 return \"andi\\t%0,%1,0x00ff\";
1976 return mips_move_1word (operands, insn, TRUE);
1978 [(set_attr "type" "arith,load,load")
1979 (set_attr "mode" "DI")
1980 (set_attr "length" "1,1,2")])
1984 ;; ....................
1988 ;; ....................
1991 ;; Those for integer source operand
1992 ;; are ordered widest source type first.
1994 ;; ??? This should be a define_expand.
1996 (define_insn "extendsidi2"
1997 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
1998 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
2002 if (which_alternative == 0)
2003 return \"dsll\\t%0,%1,32\;dsra\\t%0,%0,32\";
2004 return mips_move_1word (operands, insn, FALSE);
2006 [(set_attr "type" "arith,load,load")
2007 (set_attr "mode" "DI")
2008 (set_attr "length" "2,1,2")])
2010 ;; These patterns originally accepted general_operands, however, slightly
2011 ;; better code is generated by only accepting register_operands, and then
2012 ;; letting combine generate the lh and lb insns.
2014 (define_expand "extendhidi2"
2015 [(set (match_operand:DI 0 "register_operand" "")
2016 (sign_extend:DI (match_operand:HI 1 "nonimmediate_operand" "")))]
2020 if (optimize && GET_CODE (operands[1]) == MEM)
2021 operands[1] = force_not_mem (operands[1]);
2023 if (GET_CODE (operands[1]) != MEM)
2025 rtx op1 = gen_lowpart (DImode, operands[1]);
2026 rtx temp = gen_reg_rtx (DImode);
2027 rtx shift = gen_rtx (CONST_INT, VOIDmode, 48);
2029 emit_insn (gen_ashldi3 (temp, op1, shift));
2030 emit_insn (gen_ashrdi3 (operands[0], temp, shift));
2035 (define_insn "extendhidi2_internal"
2036 [(set (match_operand:DI 0 "register_operand" "=d,d")
2037 (sign_extend:DI (match_operand:HI 1 "memory_operand" "R,m")))]
2039 "* return mips_move_1word (operands, insn, FALSE);"
2040 [(set_attr "type" "load")
2041 (set_attr "mode" "DI")
2042 (set_attr "length" "1,2")])
2044 (define_expand "extendhisi2"
2045 [(set (match_operand:SI 0 "register_operand" "")
2046 (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
2050 if (optimize && GET_CODE (operands[1]) == MEM)
2051 operands[1] = force_not_mem (operands[1]);
2053 if (GET_CODE (operands[1]) != MEM)
2055 rtx op1 = gen_lowpart (SImode, operands[1]);
2056 rtx temp = gen_reg_rtx (SImode);
2057 rtx shift = gen_rtx (CONST_INT, VOIDmode, 16);
2059 emit_insn (gen_ashlsi3 (temp, op1, shift));
2060 emit_insn (gen_ashrsi3 (operands[0], temp, shift));
2065 (define_insn "extendhisi2_internal"
2066 [(set (match_operand:SI 0 "register_operand" "=d,d")
2067 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,m")))]
2069 "* return mips_move_1word (operands, insn, FALSE);"
2070 [(set_attr "type" "load")
2071 (set_attr "mode" "SI")
2072 (set_attr "length" "1,2")])
2074 (define_expand "extendqihi2"
2075 [(set (match_operand:HI 0 "register_operand" "")
2076 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]
2080 if (optimize && GET_CODE (operands[1]) == MEM)
2081 operands[1] = force_not_mem (operands[1]);
2083 if (GET_CODE (operands[1]) != MEM)
2085 rtx op0 = gen_lowpart (SImode, operands[0]);
2086 rtx op1 = gen_lowpart (SImode, operands[1]);
2087 rtx temp = gen_reg_rtx (SImode);
2088 rtx shift = gen_rtx (CONST_INT, VOIDmode, 24);
2090 emit_insn (gen_ashlsi3 (temp, op1, shift));
2091 emit_insn (gen_ashrsi3 (op0, temp, shift));
2096 (define_insn "extendqihi2_internal"
2097 [(set (match_operand:HI 0 "register_operand" "=d,d")
2098 (sign_extend:HI (match_operand:QI 1 "memory_operand" "R,m")))]
2100 "* return mips_move_1word (operands, insn, FALSE);"
2101 [(set_attr "type" "load")
2102 (set_attr "mode" "SI")
2103 (set_attr "length" "1,2")])
2106 (define_expand "extendqisi2"
2107 [(set (match_operand:SI 0 "register_operand" "")
2108 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
2112 if (optimize && GET_CODE (operands[1]) == MEM)
2113 operands[1] = force_not_mem (operands[1]);
2115 if (GET_CODE (operands[1]) != MEM)
2117 rtx op1 = gen_lowpart (SImode, operands[1]);
2118 rtx temp = gen_reg_rtx (SImode);
2119 rtx shift = gen_rtx (CONST_INT, VOIDmode, 24);
2121 emit_insn (gen_ashlsi3 (temp, op1, shift));
2122 emit_insn (gen_ashrsi3 (operands[0], temp, shift));
2127 (define_insn "extendqisi2_insn"
2128 [(set (match_operand:SI 0 "register_operand" "=d,d")
2129 (sign_extend:SI (match_operand:QI 1 "memory_operand" "R,m")))]
2131 "* return mips_move_1word (operands, insn, FALSE);"
2132 [(set_attr "type" "load")
2133 (set_attr "mode" "SI")
2134 (set_attr "length" "1,2")])
2136 (define_expand "extendqidi2"
2137 [(set (match_operand:DI 0 "register_operand" "")
2138 (sign_extend:DI (match_operand:QI 1 "nonimmediate_operand" "")))]
2142 if (optimize && GET_CODE (operands[1]) == MEM)
2143 operands[1] = force_not_mem (operands[1]);
2145 if (GET_CODE (operands[1]) != MEM)
2147 rtx op1 = gen_lowpart (DImode, operands[1]);
2148 rtx temp = gen_reg_rtx (DImode);
2149 rtx shift = gen_rtx (CONST_INT, VOIDmode, 56);
2151 emit_insn (gen_ashldi3 (temp, op1, shift));
2152 emit_insn (gen_ashrdi3 (operands[0], temp, shift));
2157 (define_insn "extendqidi2_insn"
2158 [(set (match_operand:DI 0 "register_operand" "=d,d")
2159 (sign_extend:DI (match_operand:QI 1 "memory_operand" "R,m")))]
2161 "* return mips_move_1word (operands, insn, FALSE);"
2162 [(set_attr "type" "load")
2163 (set_attr "mode" "DI")
2164 (set_attr "length" "1,2")])
2167 (define_insn "extendsfdf2"
2168 [(set (match_operand:DF 0 "register_operand" "=f")
2169 (float_extend:DF (match_operand:SF 1 "register_operand" "f")))]
2172 [(set_attr "type" "fcvt")
2173 (set_attr "mode" "DF")
2174 (set_attr "length" "1")])
2179 ;; ....................
2183 ;; ....................
2185 ;; The SImode scratch register can not be shared with address regs used for
2186 ;; operand zero, because then the address in the move instruction will be
2187 ;; clobbered. We mark the scratch register as early clobbered to prevent this.
2189 (define_insn "fix_truncdfsi2"
2190 [(set (match_operand:SI 0 "general_operand" "=d,*f,R,o")
2191 (fix:SI (match_operand:DF 1 "register_operand" "f,*f,f,f")))
2192 (clobber (match_scratch:SI 2 "=d,*d,&d,&d"))
2193 (clobber (match_scratch:DF 3 "=f,*X,f,f"))]
2199 if (which_alternative == 1)
2200 return \"trunc.w.d %0,%1,%2\";
2202 output_asm_insn (\"trunc.w.d %3,%1,%2\", operands);
2204 xoperands[0] = operands[0];
2205 xoperands[1] = operands[3];
2206 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
2209 [(set_attr "type" "fcvt")
2210 (set_attr "mode" "DF")
2211 (set_attr "length" "11,9,10,11")])
2214 (define_insn "fix_truncsfsi2"
2215 [(set (match_operand:SI 0 "general_operand" "=d,*f,R,o")
2216 (fix:SI (match_operand:SF 1 "register_operand" "f,*f,f,f")))
2217 (clobber (match_scratch:SI 2 "=d,*d,&d,&d"))
2218 (clobber (match_scratch:SF 3 "=f,*X,f,f"))]
2224 if (which_alternative == 1)
2225 return \"trunc.w.s %0,%1,%2\";
2227 output_asm_insn (\"trunc.w.s %3,%1,%2\", operands);
2229 xoperands[0] = operands[0];
2230 xoperands[1] = operands[3];
2231 output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
2234 [(set_attr "type" "fcvt")
2235 (set_attr "mode" "SF")
2236 (set_attr "length" "11,9,10,11")])
2239 ;;; ??? trunc.l.d is mentioned in the appendix of the 1993 r4000/r4600 manuals
2240 ;;; but not in the chapter that describes the FPU. It is not mentioned at all
2241 ;;; in the 1991 manuals. The r4000 at Cygnus does not have this instruction.
2243 ;;; Deleting this means that we now need two libgcc2.a libraries. One for
2244 ;;; the 32 bit calling convention and one for the 64 bit calling convention.
2246 ;;; If this is disabled, then fixuns_truncdfdi2 must be disabled also.
2248 (define_insn "fix_truncdfdi2"
2249 [(set (match_operand:DI 0 "general_operand" "=d,*f,R,o")
2250 (fix:DI (match_operand:DF 1 "register_operand" "f,*f,f,f")))
2251 (clobber (match_scratch:DF 2 "=f,*X,f,f"))]
2252 "TARGET_HARD_FLOAT && TARGET_64BIT"
2257 if (which_alternative == 1)
2258 return \"trunc.l.d %0,%1\";
2260 output_asm_insn (\"trunc.l.d %2,%1\", operands);
2262 xoperands[0] = operands[0];
2263 xoperands[1] = operands[2];
2264 output_asm_insn (mips_move_2words (xoperands, insn, FALSE), xoperands);
2267 [(set_attr "type" "fcvt")
2268 (set_attr "mode" "DF")
2269 (set_attr "length" "2,1,2,3")])
2272 ;;; ??? trunc.l.s is mentioned in the appendix of the 1993 r4000/r4600 manuals
2273 ;;; but not in the chapter that describes the FPU. It is not mentioned at all
2274 ;;; in the 1991 manuals. The r4000 at Cygnus does not have this instruction.
2275 (define_insn "fix_truncsfdi2"
2276 [(set (match_operand:DI 0 "general_operand" "=d,*f,R,o")
2277 (fix:DI (match_operand:SF 1 "register_operand" "f,*f,f,f")))
2278 (clobber (match_scratch:DF 2 "=f,*X,f,f"))]
2279 "TARGET_HARD_FLOAT && TARGET_64BIT"
2284 if (which_alternative == 1)
2285 return \"trunc.l.s %0,%1\";
2287 output_asm_insn (\"trunc.l.s %2,%1\", operands);
2289 xoperands[0] = operands[0];
2290 xoperands[1] = operands[2];
2291 output_asm_insn (mips_move_2words (xoperands, insn, FALSE), xoperands);
2294 [(set_attr "type" "fcvt")
2295 (set_attr "mode" "SF")
2296 (set_attr "length" "2,1,2,3")])
2299 (define_insn "floatsidf2"
2300 [(set (match_operand:DF 0 "register_operand" "=f,f,f")
2301 (float:DF (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
2305 dslots_load_total++;
2306 if (GET_CODE (operands[1]) == MEM)
2307 return \"l.s\\t%0,%1%#\;cvt.d.w\\t%0,%0\";
2309 return \"mtc1\\t%1,%0%#\;cvt.d.w\\t%0,%0\";
2311 [(set_attr "type" "fcvt")
2312 (set_attr "mode" "DF")
2313 (set_attr "length" "3,4,3")])
2316 (define_insn "floatdidf2"
2317 [(set (match_operand:DF 0 "register_operand" "=f,f,f")
2318 (float:DF (match_operand:DI 1 "nonimmediate_operand" "d,R,m")))]
2319 "TARGET_HARD_FLOAT && TARGET_64BIT"
2322 dslots_load_total++;
2323 if (GET_CODE (operands[1]) == MEM)
2324 return \"l.d\\t%0,%1%#\;cvt.d.l\\t%0,%0\";
2326 return \"dmtc1\\t%1,%0%#\;cvt.d.l\\t%0,%0\";
2328 [(set_attr "type" "fcvt")
2329 (set_attr "mode" "DF")
2330 (set_attr "length" "3,4,3")])
2333 (define_insn "floatsisf2"
2334 [(set (match_operand:SF 0 "register_operand" "=f,f,f")
2335 (float:SF (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
2339 dslots_load_total++;
2340 if (GET_CODE (operands[1]) == MEM)
2341 return \"l.s\\t%0,%1%#\;cvt.s.w\\t%0,%0\";
2343 return \"mtc1\\t%1,%0%#\;cvt.s.w\\t%0,%0\";
2345 [(set_attr "type" "fcvt")
2346 (set_attr "mode" "SF")
2347 (set_attr "length" "3,4,3")])
2350 (define_insn "floatdisf2"
2351 [(set (match_operand:SF 0 "register_operand" "=f,f,f")
2352 (float:SF (match_operand:DI 1 "nonimmediate_operand" "d,R,m")))]
2353 "TARGET_HARD_FLOAT && TARGET_64BIT"
2356 dslots_load_total++;
2357 if (GET_CODE (operands[1]) == MEM)
2358 return \"l.d\\t%0,%1%#\;cvt.s.l\\t%0,%0\";
2360 return \"dmtc1\\t%1,%0%#\;cvt.s.l\\t%0,%0\";
2362 [(set_attr "type" "fcvt")
2363 (set_attr "mode" "SF")
2364 (set_attr "length" "3,4,3")])
2367 (define_expand "fixuns_truncdfsi2"
2368 [(set (match_operand:SI 0 "register_operand" "")
2369 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2373 rtx reg1 = gen_reg_rtx (DFmode);
2374 rtx reg2 = gen_reg_rtx (DFmode);
2375 rtx reg3 = gen_reg_rtx (SImode);
2376 rtx label1 = gen_label_rtx ();
2377 rtx label2 = gen_label_rtx ();
2378 REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (1.0, 31);
2380 if (reg1) /* turn off complaints about unreached code */
2382 emit_move_insn (reg1, immed_real_const_1 (offset, DFmode));
2383 do_pending_stack_adjust ();
2385 emit_insn (gen_cmpdf (operands[1], reg1));
2386 emit_jump_insn (gen_bge (label1));
2388 emit_insn (gen_fix_truncdfsi2 (operands[0], operands[1]));
2389 emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
2390 gen_rtx (LABEL_REF, VOIDmode, label2)));
2393 emit_label (label1);
2394 emit_move_insn (reg2, gen_rtx (MINUS, DFmode, operands[1], reg1));
2395 emit_move_insn (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
2397 emit_insn (gen_fix_truncdfsi2 (operands[0], reg2));
2398 emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
2400 emit_label (label2);
2402 /* allow REG_NOTES to be set on last insn (labels don't have enough
2403 fields, and can't be used for REG_NOTES anyway). */
2404 emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
2410 (define_expand "fixuns_truncdfdi2"
2411 [(set (match_operand:DI 0 "register_operand" "")
2412 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2413 "TARGET_HARD_FLOAT && TARGET_64BIT"
2416 rtx reg1 = gen_reg_rtx (DFmode);
2417 rtx reg2 = gen_reg_rtx (DFmode);
2418 rtx reg3 = gen_reg_rtx (DImode);
2419 rtx label1 = gen_label_rtx ();
2420 rtx label2 = gen_label_rtx ();
2421 REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (1.0, 63);
2423 if (reg1) /* turn off complaints about unreached code */
2425 emit_move_insn (reg1, immed_real_const_1 (offset, DFmode));
2426 do_pending_stack_adjust ();
2428 emit_insn (gen_cmpdf (operands[1], reg1));
2429 emit_jump_insn (gen_bge (label1));
2431 emit_insn (gen_fix_truncdfdi2 (operands[0], operands[1]));
2432 emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
2433 gen_rtx (LABEL_REF, VOIDmode, label2)));
2436 emit_label (label1);
2437 emit_move_insn (reg2, gen_rtx (MINUS, DFmode, operands[1], reg1));
2438 emit_move_insn (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
2439 emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32)));
2441 emit_insn (gen_fix_truncdfdi2 (operands[0], reg2));
2442 emit_insn (gen_iordi3 (operands[0], operands[0], reg3));
2444 emit_label (label2);
2446 /* allow REG_NOTES to be set on last insn (labels don't have enough
2447 fields, and can't be used for REG_NOTES anyway). */
2448 emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
2454 (define_expand "fixuns_truncsfsi2"
2455 [(set (match_operand:SI 0 "register_operand" "")
2456 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2460 rtx reg1 = gen_reg_rtx (SFmode);
2461 rtx reg2 = gen_reg_rtx (SFmode);
2462 rtx reg3 = gen_reg_rtx (SImode);
2463 rtx label1 = gen_label_rtx ();
2464 rtx label2 = gen_label_rtx ();
2465 REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (1.0, 31);
2467 if (reg1) /* turn off complaints about unreached code */
2469 emit_move_insn (reg1, immed_real_const_1 (offset, SFmode));
2470 do_pending_stack_adjust ();
2472 emit_insn (gen_cmpsf (operands[1], reg1));
2473 emit_jump_insn (gen_bge (label1));
2475 emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
2476 emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
2477 gen_rtx (LABEL_REF, VOIDmode, label2)));
2480 emit_label (label1);
2481 emit_move_insn (reg2, gen_rtx (MINUS, SFmode, operands[1], reg1));
2482 emit_move_insn (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
2484 emit_insn (gen_fix_truncsfsi2 (operands[0], reg2));
2485 emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
2487 emit_label (label2);
2489 /* allow REG_NOTES to be set on last insn (labels don't have enough
2490 fields, and can't be used for REG_NOTES anyway). */
2491 emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
2497 (define_expand "fixuns_truncsfdi2"
2498 [(set (match_operand:DI 0 "register_operand" "")
2499 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2500 "TARGET_HARD_FLOAT && TARGET_64BIT"
2503 rtx reg1 = gen_reg_rtx (SFmode);
2504 rtx reg2 = gen_reg_rtx (SFmode);
2505 rtx reg3 = gen_reg_rtx (DImode);
2506 rtx label1 = gen_label_rtx ();
2507 rtx label2 = gen_label_rtx ();
2508 REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (1.0, 63);
2510 if (reg1) /* turn off complaints about unreached code */
2512 emit_move_insn (reg1, immed_real_const_1 (offset, SFmode));
2513 do_pending_stack_adjust ();
2515 emit_insn (gen_cmpsf (operands[1], reg1));
2516 emit_jump_insn (gen_bge (label1));
2518 emit_insn (gen_fix_truncsfdi2 (operands[0], operands[1]));
2519 emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
2520 gen_rtx (LABEL_REF, VOIDmode, label2)));
2523 emit_label (label1);
2524 emit_move_insn (reg2, gen_rtx (MINUS, SFmode, operands[1], reg1));
2525 emit_move_insn (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
2526 emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32)));
2528 emit_insn (gen_fix_truncsfdi2 (operands[0], reg2));
2529 emit_insn (gen_iordi3 (operands[0], operands[0], reg3));
2531 emit_label (label2);
2533 /* allow REG_NOTES to be set on last insn (labels don't have enough
2534 fields, and can't be used for REG_NOTES anyway). */
2535 emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
2542 ;; ....................
2546 ;; ....................
2548 ;; unaligned word moves generated by the block moves.
2550 ;; I don't think these are used anymore. Ian Taylor 30 Sep 93
2552 ;;(define_expand "movsi_unaligned"
2553 ;; [(set (match_operand:SI 0 "general_operand" "")
2554 ;; (unspec [(match_operand:SI 1 "general_operand" "")] 0))]
2558 ;; /* Handle stores. */
2559 ;; if (GET_CODE (operands[0]) == MEM)
2561 ;; rtx reg = gen_reg_rtx (SImode);
2562 ;; rtx insn = emit_insn (gen_movsi_ulw (reg, operands[1]));
2563 ;; rtx addr = XEXP (operands[0], 0);
2564 ;; if (CONSTANT_P (addr))
2565 ;; REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUIV, addr, REG_NOTES (insn));
2567 ;; if (reg_or_0_operand (operands[1], SImode))
2570 ;; operands[1] = reg;
2573 ;; /* Generate appropriate load, store. If not a load or store,
2574 ;; do a normal movsi. */
2575 ;; if (GET_CODE (operands[0]) != MEM && GET_CODE (operands[1]) != MEM)
2577 ;; emit_insn (gen_movsi (operands[0], operands[1]));
2581 ;; /* Fall through and generate normal code. */
2584 ;;(define_insn "movsi_ulw"
2585 ;; [(set (match_operand:SI 0 "register_operand" "=&d,&d,d,d")
2586 ;; (unspec [(match_operand:SI 1 "general_operand" "R,o,dIKL,M")] 0))]
2590 ;; enum rtx_code code;
2596 ;; if (which_alternative != 0)
2597 ;; return mips_move_1word (operands, insn, FALSE);
2599 ;; if (TARGET_STATS)
2600 ;; mips_count_memory_refs (operands[1], 2);
2602 ;; /* The stack/frame pointers are always aligned, so we can convert
2603 ;; to the faster lw if we are referencing an aligned stack location. */
2605 ;; offset = const0_rtx;
2606 ;; addr = XEXP (operands[1], 0);
2607 ;; mem_addr = eliminate_constant_term (addr, &offset);
2609 ;; if ((INTVAL (offset) & (UNITS_PER_WORD-1)) == 0
2610 ;; && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
2611 ;; ret = \"lw\\t%0,%1\";
2615 ;; ret = \"ulw\\t%0,%1\";
2618 ;; enum rtx_code code = GET_CODE (addr);
2620 ;; if (code == CONST || code == SYMBOL_REF || code == LABEL_REF)
2622 ;; operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 1);
2623 ;; ret = \"%[la\\t%2,%1\;ulw\\t%0,0(%2)%]\";
2628 ;; return mips_fill_delay_slot (ret, DELAY_LOAD, operands, insn);
2630 ;; [(set_attr "type" "load,load,move,arith")
2631 ;; (set_attr "mode" "SI")
2632 ;; (set_attr "length" "2,4,1,2")])
2634 ;;(define_insn "movsi_usw"
2635 ;; [(set (match_operand:SI 0 "memory_operand" "=R,o")
2636 ;; (unspec [(match_operand:SI 1 "reg_or_0_operand" "dJ,dJ")] 0))]
2640 ;; rtx offset = const0_rtx;
2641 ;; rtx addr = XEXP (operands[0], 0);
2642 ;; rtx mem_addr = eliminate_constant_term (addr, &offset);
2644 ;; if (TARGET_STATS)
2645 ;; mips_count_memory_refs (operands[0], 2);
2647 ;; /* The stack/frame pointers are always aligned, so we can convert
2648 ;; to the faster sw if we are referencing an aligned stack location. */
2650 ;; if ((INTVAL (offset) & (UNITS_PER_WORD-1)) == 0
2651 ;; && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
2652 ;; return \"sw\\t%1,%0\";
2657 ;; enum rtx_code code = GET_CODE (XEXP (operands[0], 0));
2659 ;; if (code == CONST || code == SYMBOL_REF || code == LABEL_REF)
2661 ;; operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 1);
2662 ;; return \"%[la\\t%2,%0\;usw\\t%z1,0(%2)%]\";
2666 ;; return \"usw\\t%z1,%0\";
2668 ;; [(set_attr "type" "store")
2669 ;; (set_attr "mode" "SI")
2670 ;; (set_attr "length" "2,4")])
2673 ;; 64-bit integer moves
2675 ;; Unlike most other insns, the move insns can't be split with
2676 ;; different predicates, because register spilling and other parts of
2677 ;; the compiler, have memoized the insn number already.
2679 (define_expand "movdi"
2680 [(set (match_operand:DI 0 "nonimmediate_operand" "")
2681 (match_operand:DI 1 "general_operand" ""))]
2685 if ((reload_in_progress | reload_completed) == 0
2686 && !register_operand (operands[0], DImode)
2687 && !register_operand (operands[1], DImode)
2688 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
2689 && operands[1] != CONST0_RTX (DImode))
2691 rtx temp = force_reg (DImode, operands[1]);
2692 emit_move_insn (operands[0], temp);
2697 (define_insn "movdi_internal"
2698 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,R,o,*d,*x")
2699 (match_operand:DI 1 "general_operand" "d,iF,R,o,d,d,*x,*d"))]
2701 && (register_operand (operands[0], DImode)
2702 || register_operand (operands[1], DImode)
2703 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2704 || operands[1] == CONST0_RTX (DImode))"
2705 "* return mips_move_2words (operands, insn); "
2706 [(set_attr "type" "move,arith,load,load,store,store,hilo,hilo")
2707 (set_attr "mode" "DI")
2708 (set_attr "length" "2,4,2,4,2,4,2,2")])
2711 [(set (match_operand:DI 0 "register_operand" "")
2712 (match_operand:DI 1 "register_operand" ""))]
2713 "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
2714 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
2715 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
2717 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))
2718 (set (subreg:SI (match_dup 0) 1) (subreg:SI (match_dup 1) 1))]
2721 (define_insn "movdi_internal2"
2722 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,R,m,*d,*x")
2723 (match_operand:DI 1 "general_operand" " d,S,IKL,Mnis,R,m,dJ,dJ,*x,*d"))]
2725 && (register_operand (operands[0], DImode)
2726 || register_operand (operands[1], DImode)
2727 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2728 || operands[1] == CONST0_RTX (DImode))"
2729 "* return mips_move_2words (operands, insn); "
2730 [(set_attr "type" "move,load,arith,arith,load,load,store,store,hilo,hilo")
2731 (set_attr "mode" "DI")
2732 (set_attr "length" "1,2,1,2,1,2,1,2,1,1")])
2735 ;; 32-bit Integer moves
2738 [(set (match_operand:SI 0 "register_operand" "")
2739 (match_operand:SI 1 "large_int" ""))]
2740 "!TARGET_DEBUG_D_MODE"
2744 (ior:SI (match_dup 0)
2748 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 0xffff0000);
2749 operands[3] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 0x0000ffff);
2752 ;; Unlike most other insns, the move insns can't be split with
2753 ;; different predicates, because register spilling and other parts of
2754 ;; the compiler, have memoized the insn number already.
2756 (define_expand "movsi"
2757 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2758 (match_operand:SI 1 "general_operand" ""))]
2762 /* If operands[1] is a constant address illegal for pic, then we need to
2763 handle it just like LEGITIMIZE_ADDRESS does. */
2764 if (flag_pic && pic_address_needs_scratch (operands[1]))
2766 rtx temp = force_reg (SImode, XEXP (XEXP (operands[1], 0), 0));
2767 rtx temp2 = XEXP (XEXP (operands[1], 0), 1);
2769 if (! SMALL_INT (temp2))
2770 temp2 = force_reg (SImode, temp2);
2772 emit_move_insn (operands[0], gen_rtx (PLUS, SImode, temp, temp2));
2776 if ((reload_in_progress | reload_completed) == 0
2777 && !register_operand (operands[0], SImode)
2778 && !register_operand (operands[1], SImode)
2779 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0))
2781 rtx temp = force_reg (SImode, operands[1]);
2782 emit_move_insn (operands[0], temp);
2787 ;; The difference between these two is whether or not ints are allowed
2788 ;; in FP registers (off by default, use -mdebugh to enable).
2790 (define_insn "movsi_internal1"
2791 [(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")
2792 (match_operand:SI 1 "general_operand" "d,S,IKL,Mnis,R,m,dJ,dJ,*f*z,*d,*f,*R,*m,*f,*f,*d,*x"))]
2793 "TARGET_DEBUG_H_MODE
2794 && (register_operand (operands[0], SImode)
2795 || register_operand (operands[1], SImode)
2796 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
2797 "* return mips_move_1word (operands, insn, FALSE);"
2798 [(set_attr "type" "move,load,arith,arith,load,load,store,store,xfer,xfer,move,load,load,store,store,hilo,hilo")
2799 (set_attr "mode" "SI")
2800 (set_attr "length" "1,2,1,2,1,2,1,2,1,1,1,1,2,1,2,1,1")])
2802 (define_insn "movsi_internal2"
2803 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,R,m,*d,*z,*d,*x")
2804 (match_operand:SI 1 "general_operand" "d,S,IKL,Mnis,R,m,dJ,dJ,*z,*d,*x,*d"))]
2805 "!TARGET_DEBUG_H_MODE
2806 && (register_operand (operands[0], SImode)
2807 || register_operand (operands[1], SImode)
2808 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
2809 "* return mips_move_1word (operands, insn, FALSE);"
2810 [(set_attr "type" "move,load,arith,arith,load,load,store,store,xfer,xfer,hilo,hilo")
2811 (set_attr "mode" "SI")
2812 (set_attr "length" "1,2,1,2,1,2,1,2,1,1,1,1")])
2815 ;; 16-bit Integer moves
2817 ;; Unlike most other insns, the move insns can't be split with
2818 ;; different predicates, because register spilling and other parts of
2819 ;; the compiler, have memoized the insn number already.
2820 ;; Unsigned loads are used because BYTE_LOADS_ZERO_EXTEND is defined
2822 (define_expand "movhi"
2823 [(set (match_operand:HI 0 "nonimmediate_operand" "")
2824 (match_operand:HI 1 "general_operand" ""))]
2828 if ((reload_in_progress | reload_completed) == 0
2829 && !register_operand (operands[0], HImode)
2830 && !register_operand (operands[1], HImode)
2831 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0))
2833 rtx temp = force_reg (HImode, operands[1]);
2834 emit_move_insn (operands[0], temp);
2839 ;; The difference between these two is whether or not ints are allowed
2840 ;; in FP registers (off by default, use -mdebugh to enable).
2842 (define_insn "movhi_internal1"
2843 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*f,*f*z,*x,*d")
2844 (match_operand:HI 1 "general_operand" "d,IK,R,m,dJ,dJ,*f*z,*d,*f,*d,*x"))]
2845 "TARGET_DEBUG_H_MODE
2846 && (register_operand (operands[0], HImode)
2847 || register_operand (operands[1], HImode)
2848 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
2849 "* return mips_move_1word (operands, insn, TRUE);"
2850 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,move,hilo,hilo")
2851 (set_attr "mode" "HI")
2852 (set_attr "length" "1,1,1,2,1,2,1,1,1,1,1")])
2854 (define_insn "movhi_internal2"
2855 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*z,*x,*d")
2856 (match_operand:HI 1 "general_operand" "d,IK,R,m,dJ,dJ,*z,*d,*d,*x"))]
2857 "!TARGET_DEBUG_H_MODE
2858 && (register_operand (operands[0], HImode)
2859 || register_operand (operands[1], HImode)
2860 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
2861 "* return mips_move_1word (operands, insn, TRUE);"
2862 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,hilo,hilo")
2863 (set_attr "mode" "HI")
2864 (set_attr "length" "1,1,1,2,1,2,1,1,1,1")])
2867 ;; 8-bit Integer moves
2869 ;; Unlike most other insns, the move insns can't be split with
2870 ;; different predicates, because register spilling and other parts of
2871 ;; the compiler, have memoized the insn number already.
2872 ;; Unsigned loads are used because BYTE_LOADS_ZERO_EXTEND is defined
2874 (define_expand "movqi"
2875 [(set (match_operand:QI 0 "nonimmediate_operand" "")
2876 (match_operand:QI 1 "general_operand" ""))]
2880 if ((reload_in_progress | reload_completed) == 0
2881 && !register_operand (operands[0], QImode)
2882 && !register_operand (operands[1], QImode)
2883 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0))
2885 rtx temp = force_reg (QImode, operands[1]);
2886 emit_move_insn (operands[0], temp);
2891 ;; The difference between these two is whether or not ints are allowed
2892 ;; in FP registers (off by default, use -mdebugh to enable).
2894 (define_insn "movqi_internal1"
2895 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*f*z,*f,*x,*d")
2896 (match_operand:QI 1 "general_operand" "d,IK,R,m,dJ,dJ,*f*z,*d,*f,*d,*x"))]
2897 "TARGET_DEBUG_H_MODE
2898 && (register_operand (operands[0], QImode)
2899 || register_operand (operands[1], QImode)
2900 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
2901 "* return mips_move_1word (operands, insn, TRUE);"
2902 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,move,hilo,hilo")
2903 (set_attr "mode" "QI")
2904 (set_attr "length" "1,1,1,2,1,2,1,1,1,1,1")])
2906 (define_insn "movqi_internal2"
2907 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*z,*x,*d")
2908 (match_operand:QI 1 "general_operand" "d,IK,R,m,dJ,dJ,*z,*d,*d,*x"))]
2909 "!TARGET_DEBUG_H_MODE
2910 && (register_operand (operands[0], QImode)
2911 || register_operand (operands[1], QImode)
2912 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
2913 "* return mips_move_1word (operands, insn, TRUE);"
2914 [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,hilo,hilo")
2915 (set_attr "mode" "QI")
2916 (set_attr "length" "1,1,1,2,1,2,1,1,1,1")])
2919 ;; 32-bit floating point moves
2921 (define_expand "movsf"
2922 [(set (match_operand:SF 0 "nonimmediate_operand" "")
2923 (match_operand:SF 1 "general_operand" ""))]
2927 if ((reload_in_progress | reload_completed) == 0
2928 && !register_operand (operands[0], SFmode)
2929 && !register_operand (operands[1], SFmode)
2930 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
2931 && operands[1] != CONST0_RTX (SFmode))
2933 rtx temp = force_reg (SFmode, operands[1]);
2934 emit_move_insn (operands[0], temp);
2939 (define_insn "movsf_internal1"
2940 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,m,*f,*d,*d,*d,*d,*R,*m")
2941 (match_operand:SF 1 "general_operand" "f,G,R,Fm,fG,fG,*d,*f,*G*d,*R,*F*m,*d,*d"))]
2943 && (register_operand (operands[0], SFmode)
2944 || register_operand (operands[1], SFmode)
2945 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2946 || operands[1] == CONST0_RTX (SFmode))"
2947 "* return mips_move_1word (operands, insn, FALSE);"
2948 [(set_attr "type" "move,xfer,load,load,store,store,xfer,xfer,move,load,load,store,store")
2949 (set_attr "mode" "SF")
2950 (set_attr "length" "1,1,1,2,1,2,1,1,1,1,2,1,2")])
2953 (define_insn "movsf_internal2"
2954 [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,d,R,m")
2955 (match_operand:SF 1 "general_operand" " Gd,R,Fm,d,d"))]
2957 && (register_operand (operands[0], SFmode)
2958 || register_operand (operands[1], SFmode)
2959 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2960 || operands[1] == CONST0_RTX (SFmode))"
2961 "* return mips_move_1word (operands, insn, FALSE);"
2962 [(set_attr "type" "move,load,load,store,store")
2963 (set_attr "mode" "SF")
2964 (set_attr "length" "1,1,2,1,2")])
2967 ;; 64-bit floating point moves
2969 (define_expand "movdf"
2970 [(set (match_operand:DF 0 "nonimmediate_operand" "")
2971 (match_operand:DF 1 "general_operand" ""))]
2975 if ((reload_in_progress | reload_completed) == 0
2976 && !register_operand (operands[0], DFmode)
2977 && !register_operand (operands[1], DFmode)
2978 && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
2979 && operands[1] != CONST0_RTX (DFmode))
2981 rtx temp = force_reg (DFmode, operands[1]);
2982 emit_move_insn (operands[0], temp);
2987 (define_insn "movdf_internal1"
2988 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,o,f,*f,*d,*d,*d,*d,*R,*o")
2989 (match_operand:DF 1 "general_operand" "f,R,o,fG,fG,F,*d,*f,*d*G,*R,*o*F,*d,*d"))]
2990 "TARGET_HARD_FLOAT && !(TARGET_FLOAT64 && !TARGET_64BIT)
2991 && (register_operand (operands[0], DFmode)
2992 || register_operand (operands[1], DFmode)
2993 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
2994 || operands[1] == CONST0_RTX (DFmode))"
2995 "* return mips_move_2words (operands, insn); "
2996 [(set_attr "type" "move,load,load,store,store,load,xfer,xfer,move,load,load,store,store")
2997 (set_attr "mode" "DF")
2998 (set_attr "length" "1,2,4,2,4,4,2,2,2,2,4,2,4")])
3000 (define_insn "movdf_internal1a"
3001 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,R,R,o,o,f,*d,*d,*d,*o,*R")
3002 (match_operand:DF 1 "general_operand" " f,o,f,G,f,G,F,*F,*o,*R,*d,*d"))]
3003 "TARGET_HARD_FLOAT && (TARGET_FLOAT64 && !TARGET_64BIT)
3004 && (register_operand (operands[0], DFmode)
3005 || register_operand (operands[1], DFmode))
3006 || (GET_CODE (operands [0]) == MEM
3007 && ((GET_CODE (operands[1]) == CONST_INT
3008 && INTVAL (operands[1]) == 0)
3009 || operands[1] == CONST0_RTX (DFmode)))"
3010 "* return mips_move_2words (operands, insn); "
3011 [(set_attr "type" "move,load,store,store,store,store,load,load,load,load,store,store")
3012 (set_attr "mode" "DF")
3013 (set_attr "length" "1,2,1,1,2,2,2,2,2,1,2,1")])
3015 (define_insn "movdf_internal2"
3016 [(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,d,R,o")
3017 (match_operand:DF 1 "general_operand" "dG,R,oF,d,d"))]
3019 && (register_operand (operands[0], DFmode)
3020 || register_operand (operands[1], DFmode)
3021 || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
3022 || operands[1] == CONST0_RTX (DFmode))"
3023 "* return mips_move_2words (operands, insn); "
3024 [(set_attr "type" "move,load,load,store,store")
3025 (set_attr "mode" "DF")
3026 (set_attr "length" "2,2,4,2,4")])
3029 [(set (match_operand:DF 0 "register_operand" "")
3030 (match_operand:DF 1 "register_operand" ""))]
3031 "reload_completed && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3032 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
3033 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
3035 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))
3036 (set (subreg:SI (match_dup 0) 1) (subreg:SI (match_dup 1) 1))]
3040 ;; Block moves, see mips.c for more details.
3041 ;; Argument 0 is the destination
3042 ;; Argument 1 is the source
3043 ;; Argument 2 is the length
3044 ;; Argument 3 is the alignment
3046 (define_expand "movstrsi"
3047 [(parallel [(set (mem:BLK (match_operand:BLK 0 "general_operand" ""))
3048 (mem:BLK (match_operand:BLK 1 "general_operand" "")))
3049 (use (match_operand:SI 2 "arith32_operand" ""))
3050 (use (match_operand:SI 3 "immediate_operand" ""))])]
3054 if (operands[0]) /* avoid unused code messages */
3056 expand_block_move (operands);
3061 ;; Insn generated by block moves
3063 (define_insn "movstrsi_internal"
3064 [(set (match_operand:BLK 0 "memory_operand" "=Ro") ;; destination
3065 (match_operand:BLK 1 "memory_operand" "Ro")) ;; source
3066 (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
3067 (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
3068 (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
3069 (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
3070 (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
3071 (use (match_operand:SI 3 "small_int" "I")) ;; alignment
3072 (use (const_int 0))] ;; normal block move
3074 "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NORMAL);"
3075 [(set_attr "type" "multi")
3076 (set_attr "mode" "none")
3077 (set_attr "length" "20")])
3079 ;; Split a block move into 2 parts, the first part is everything
3080 ;; except for the last move, and the second part is just the last
3081 ;; store, which is exactly 1 instruction (ie, not a usw), so it can
3082 ;; fill a delay slot. This also prevents a bug in delayed branches
3083 ;; from showing up, which reuses one of the registers in our clobbers.
3086 [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
3087 (mem:BLK (match_operand:SI 1 "register_operand" "")))
3088 (clobber (match_operand:SI 4 "register_operand" ""))
3089 (clobber (match_operand:SI 5 "register_operand" ""))
3090 (clobber (match_operand:SI 6 "register_operand" ""))
3091 (clobber (match_operand:SI 7 "register_operand" ""))
3092 (use (match_operand:SI 2 "small_int" ""))
3093 (use (match_operand:SI 3 "small_int" ""))
3094 (use (const_int 0))]
3096 "reload_completed && !TARGET_DEBUG_D_MODE && INTVAL (operands[2]) > 0"
3098 ;; All but the last move
3099 [(parallel [(set (mem:BLK (match_dup 0))
3100 (mem:BLK (match_dup 1)))
3101 (clobber (match_dup 4))
3102 (clobber (match_dup 5))
3103 (clobber (match_dup 6))
3104 (clobber (match_dup 7))
3107 (use (const_int 1))])
3109 ;; The last store, so it can fill a delay slot
3110 (parallel [(set (mem:BLK (match_dup 0))
3111 (mem:BLK (match_dup 1)))
3112 (clobber (match_dup 4))
3113 (clobber (match_dup 5))
3114 (clobber (match_dup 6))
3115 (clobber (match_dup 7))
3118 (use (const_int 2))])]
3122 (define_insn "movstrsi_internal2"
3123 [(set (match_operand:BLK 0 "memory_operand" "=Ro") ;; destination
3124 (match_operand:BLK 1 "memory_operand" "Ro")) ;; source
3125 (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
3126 (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
3127 (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
3128 (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
3129 (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
3130 (use (match_operand:SI 3 "small_int" "I")) ;; alignment
3131 (use (const_int 1))] ;; all but last store
3133 "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NOT_LAST);"
3134 [(set_attr "type" "multi")
3135 (set_attr "mode" "none")
3136 (set_attr "length" "20")])
3138 (define_insn "movstrsi_internal3"
3139 [(set (match_operand:BLK 0 "memory_operand" "=Ro") ;; destination
3140 (match_operand:BLK 1 "memory_operand" "Ro")) ;; source
3141 (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
3142 (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
3143 (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
3144 (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
3145 (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
3146 (use (match_operand:SI 3 "small_int" "I")) ;; alignment
3147 (use (const_int 2))] ;; just last store of block move
3149 "* return output_block_move (insn, operands, 4, BLOCK_MOVE_LAST);"
3150 [(set_attr "type" "store")
3151 (set_attr "mode" "none")
3152 (set_attr "length" "1")])
3156 ;; ....................
3160 ;; ....................
3162 (define_insn "ashlsi3"
3163 [(set (match_operand:SI 0 "register_operand" "=d")
3164 (ashift:SI (match_operand:SI 1 "register_operand" "d")
3165 (match_operand:SI 2 "arith_operand" "dI")))]
3169 if (GET_CODE (operands[2]) == CONST_INT)
3170 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
3172 return \"sll\\t%0,%1,%2\";
3174 [(set_attr "type" "arith")
3175 (set_attr "mode" "SI")
3176 (set_attr "length" "1")])
3179 (define_expand "ashldi3"
3180 [(parallel [(set (match_operand:DI 0 "register_operand" "")
3181 (ashift:DI (match_operand:DI 1 "register_operand" "")
3182 (match_operand:SI 2 "arith_operand" "")))
3183 (clobber (match_dup 3))])]
3184 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
3189 emit_insn (gen_ashldi3_internal4 (operands[0], operands[1],
3194 operands[3] = gen_reg_rtx (SImode);
3198 (define_insn "ashldi3_internal"
3199 [(set (match_operand:DI 0 "register_operand" "=&d")
3200 (ashift:DI (match_operand:DI 1 "register_operand" "d")
3201 (match_operand:SI 2 "register_operand" "d")))
3202 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3203 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE"
3206 operands[4] = const0_rtx;
3207 dslots_jump_total += 3;
3208 dslots_jump_filled += 2;
3210 return \"sll\\t%3,%2,26\\n\\
3211 \\tbgez\\t%3,1f\\n\\
3212 \\tsll\\t%M0,%L1,%2\\n\\
3214 \\tmove\\t%L0,%z4%)\\n\\
3217 \\t%(beq\\t%3,%z4,2f\\n\\
3218 \\tsll\\t%M0,%M1,%2%)\\n\\
3220 \\tsubu\\t%3,%z4,%2\\n\\
3221 \\tsrl\\t%3,%L1,%3\\n\\
3222 \\tor\\t%M0,%M0,%3\\n\\
3224 \\tsll\\t%L0,%L1,%2\\n\\
3227 [(set_attr "type" "darith")
3228 (set_attr "mode" "SI")
3229 (set_attr "length" "12")])
3232 (define_insn "ashldi3_internal2"
3233 [(set (match_operand:DI 0 "register_operand" "=d")
3234 (ashift:DI (match_operand:DI 1 "register_operand" "d")
3235 (match_operand:SI 2 "small_int" "IJK")))
3236 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3237 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
3240 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
3241 operands[4] = const0_rtx;
3242 return \"sll\\t%M0,%L1,%2\;move\\t%L0,%z4\";
3244 [(set_attr "type" "darith")
3245 (set_attr "mode" "DI")
3246 (set_attr "length" "2")])
3250 [(set (match_operand:DI 0 "register_operand" "")
3251 (ashift:DI (match_operand:DI 1 "register_operand" "")
3252 (match_operand:SI 2 "small_int" "")))
3253 (clobber (match_operand:SI 3 "register_operand" ""))]
3254 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3255 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3256 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3257 && (INTVAL (operands[2]) & 32) != 0"
3259 [(set (subreg:SI (match_dup 0) 1) (ashift:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
3260 (set (subreg:SI (match_dup 0) 0) (const_int 0))]
3262 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
3266 [(set (match_operand:DI 0 "register_operand" "")
3267 (ashift:DI (match_operand:DI 1 "register_operand" "")
3268 (match_operand:SI 2 "small_int" "")))
3269 (clobber (match_operand:SI 3 "register_operand" ""))]
3270 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3271 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3272 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3273 && (INTVAL (operands[2]) & 32) != 0"
3275 [(set (subreg:SI (match_dup 0) 0) (ashift:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
3276 (set (subreg:SI (match_dup 0) 1) (const_int 0))]
3278 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
3281 (define_insn "ashldi3_internal3"
3282 [(set (match_operand:DI 0 "register_operand" "=d")
3283 (ashift:DI (match_operand:DI 1 "register_operand" "d")
3284 (match_operand:SI 2 "small_int" "IJK")))
3285 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3286 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE
3287 && (INTVAL (operands[2]) & 63) < 32
3288 && (INTVAL (operands[2]) & 63) != 0"
3291 int amount = INTVAL (operands[2]);
3293 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3294 operands[4] = const0_rtx;
3295 operands[5] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3297 return \"sll\\t%M0,%M1,%2\;srl\\t%3,%L1,%5\;or\\t%M0,%M0,%3\;sll\\t%L0,%L1,%2\";
3299 [(set_attr "type" "darith")
3300 (set_attr "mode" "DI")
3301 (set_attr "length" "4")])
3305 [(set (match_operand:DI 0 "register_operand" "")
3306 (ashift:DI (match_operand:DI 1 "register_operand" "")
3307 (match_operand:SI 2 "small_int" "")))
3308 (clobber (match_operand:SI 3 "register_operand" ""))]
3309 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3310 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3311 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3312 && (INTVAL (operands[2]) & 63) < 32
3313 && (INTVAL (operands[2]) & 63) != 0"
3315 [(set (subreg:SI (match_dup 0) 1)
3316 (ashift:SI (subreg:SI (match_dup 1) 1)
3320 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
3323 (set (subreg:SI (match_dup 0) 1)
3324 (ior:SI (subreg:SI (match_dup 0) 1)
3327 (set (subreg:SI (match_dup 0) 0)
3328 (ashift:SI (subreg:SI (match_dup 1) 0)
3332 int amount = INTVAL (operands[2]);
3333 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3334 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3339 [(set (match_operand:DI 0 "register_operand" "")
3340 (ashift:DI (match_operand:DI 1 "register_operand" "")
3341 (match_operand:SI 2 "small_int" "")))
3342 (clobber (match_operand:SI 3 "register_operand" ""))]
3343 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3344 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3345 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3346 && (INTVAL (operands[2]) & 63) < 32
3347 && (INTVAL (operands[2]) & 63) != 0"
3349 [(set (subreg:SI (match_dup 0) 0)
3350 (ashift:SI (subreg:SI (match_dup 1) 0)
3354 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
3357 (set (subreg:SI (match_dup 0) 0)
3358 (ior:SI (subreg:SI (match_dup 0) 0)
3361 (set (subreg:SI (match_dup 0) 1)
3362 (ashift:SI (subreg:SI (match_dup 1) 1)
3366 int amount = INTVAL (operands[2]);
3367 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3368 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3372 (define_insn "ashldi3_internal4"
3373 [(set (match_operand:DI 0 "register_operand" "=d")
3374 (ashift:DI (match_operand:DI 1 "register_operand" "d")
3375 (match_operand:SI 2 "arith_operand" "dI")))]
3379 if (GET_CODE (operands[2]) == CONST_INT)
3380 operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
3382 return \"dsll\\t%0,%1,%2\";
3384 [(set_attr "type" "arith")
3385 (set_attr "mode" "DI")
3386 (set_attr "length" "1")])
3389 (define_insn "ashrsi3"
3390 [(set (match_operand:SI 0 "register_operand" "=d")
3391 (ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
3392 (match_operand:SI 2 "arith_operand" "dI")))]
3396 if (GET_CODE (operands[2]) == CONST_INT)
3397 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
3399 return \"sra\\t%0,%1,%2\";
3401 [(set_attr "type" "arith")
3402 (set_attr "mode" "SI")
3403 (set_attr "length" "1")])
3406 (define_expand "ashrdi3"
3407 [(parallel [(set (match_operand:DI 0 "register_operand" "")
3408 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
3409 (match_operand:SI 2 "arith_operand" "")))
3410 (clobber (match_dup 3))])]
3411 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
3416 emit_insn (gen_ashrdi3_internal4 (operands[0], operands[1],
3421 operands[3] = gen_reg_rtx (SImode);
3425 (define_insn "ashrdi3_internal"
3426 [(set (match_operand:DI 0 "register_operand" "=&d")
3427 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
3428 (match_operand:SI 2 "register_operand" "d")))
3429 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3430 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE"
3433 operands[4] = const0_rtx;
3434 dslots_jump_total += 3;
3435 dslots_jump_filled += 2;
3437 return \"sll\\t%3,%2,26\\n\\
3438 \\tbgez\\t%3,1f\\n\\
3439 \\tsra\\t%L0,%M1,%2\\n\\
3441 \\tsra\\t%M0,%M1,31%)\\n\\
3444 \\t%(beq\\t%3,%z4,2f\\n\\
3445 \\tsrl\\t%L0,%L1,%2%)\\n\\
3447 \\tsubu\\t%3,%z4,%2\\n\\
3448 \\tsll\\t%3,%M1,%3\\n\\
3449 \\tor\\t%L0,%L0,%3\\n\\
3451 \\tsra\\t%M0,%M1,%2\\n\\
3454 [(set_attr "type" "darith")
3455 (set_attr "mode" "DI")
3456 (set_attr "length" "12")])
3459 (define_insn "ashrdi3_internal2"
3460 [(set (match_operand:DI 0 "register_operand" "=d")
3461 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
3462 (match_operand:SI 2 "small_int" "IJK")))
3463 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3464 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
3467 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
3468 return \"sra\\t%L0,%M1,%2\;sra\\t%M0,%M1,31\";
3470 [(set_attr "type" "darith")
3471 (set_attr "mode" "DI")
3472 (set_attr "length" "2")])
3476 [(set (match_operand:DI 0 "register_operand" "")
3477 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
3478 (match_operand:SI 2 "small_int" "")))
3479 (clobber (match_operand:SI 3 "register_operand" ""))]
3480 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3481 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3482 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3483 && (INTVAL (operands[2]) & 32) != 0"
3485 [(set (subreg:SI (match_dup 0) 0) (ashiftrt:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
3486 (set (subreg:SI (match_dup 0) 1) (ashiftrt:SI (subreg:SI (match_dup 1) 1) (const_int 31)))]
3488 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
3492 [(set (match_operand:DI 0 "register_operand" "")
3493 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
3494 (match_operand:SI 2 "small_int" "")))
3495 (clobber (match_operand:SI 3 "register_operand" ""))]
3496 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3497 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3498 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3499 && (INTVAL (operands[2]) & 32) != 0"
3501 [(set (subreg:SI (match_dup 0) 1) (ashiftrt:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
3502 (set (subreg:SI (match_dup 0) 0) (ashiftrt:SI (subreg:SI (match_dup 1) 0) (const_int 31)))]
3504 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
3507 (define_insn "ashrdi3_internal3"
3508 [(set (match_operand:DI 0 "register_operand" "=d")
3509 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
3510 (match_operand:SI 2 "small_int" "IJK")))
3511 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3512 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE
3513 && (INTVAL (operands[2]) & 63) < 32
3514 && (INTVAL (operands[2]) & 63) != 0"
3517 int amount = INTVAL (operands[2]);
3519 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3520 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3522 return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;sra\\t%M0,%M1,%2\";
3524 [(set_attr "type" "darith")
3525 (set_attr "mode" "DI")
3526 (set_attr "length" "4")])
3530 [(set (match_operand:DI 0 "register_operand" "")
3531 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
3532 (match_operand:SI 2 "small_int" "")))
3533 (clobber (match_operand:SI 3 "register_operand" ""))]
3534 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3535 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3536 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3537 && (INTVAL (operands[2]) & 63) < 32
3538 && (INTVAL (operands[2]) & 63) != 0"
3540 [(set (subreg:SI (match_dup 0) 0)
3541 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
3545 (ashift:SI (subreg:SI (match_dup 1) 1)
3548 (set (subreg:SI (match_dup 0) 0)
3549 (ior:SI (subreg:SI (match_dup 0) 0)
3552 (set (subreg:SI (match_dup 0) 1)
3553 (ashiftrt:SI (subreg:SI (match_dup 1) 1)
3557 int amount = INTVAL (operands[2]);
3558 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3559 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3564 [(set (match_operand:DI 0 "register_operand" "")
3565 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
3566 (match_operand:SI 2 "small_int" "")))
3567 (clobber (match_operand:SI 3 "register_operand" ""))]
3568 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3569 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3570 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3571 && (INTVAL (operands[2]) & 63) < 32
3572 && (INTVAL (operands[2]) & 63) != 0"
3574 [(set (subreg:SI (match_dup 0) 1)
3575 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
3579 (ashift:SI (subreg:SI (match_dup 1) 0)
3582 (set (subreg:SI (match_dup 0) 1)
3583 (ior:SI (subreg:SI (match_dup 0) 1)
3586 (set (subreg:SI (match_dup 0) 0)
3587 (ashiftrt:SI (subreg:SI (match_dup 1) 0)
3591 int amount = INTVAL (operands[2]);
3592 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3593 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3597 (define_insn "ashrdi3_internal4"
3598 [(set (match_operand:DI 0 "register_operand" "=d")
3599 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
3600 (match_operand:SI 2 "arith_operand" "dI")))]
3604 if (GET_CODE (operands[2]) == CONST_INT)
3605 operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
3607 return \"dsra\\t%0,%1,%2\";
3609 [(set_attr "type" "arith")
3610 (set_attr "mode" "DI")
3611 (set_attr "length" "1")])
3614 (define_insn "lshrsi3"
3615 [(set (match_operand:SI 0 "register_operand" "=d")
3616 (lshiftrt:SI (match_operand:SI 1 "register_operand" "d")
3617 (match_operand:SI 2 "arith_operand" "dI")))]
3621 if (GET_CODE (operands[2]) == CONST_INT)
3622 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
3624 return \"srl\\t%0,%1,%2\";
3626 [(set_attr "type" "arith")
3627 (set_attr "mode" "SI")
3628 (set_attr "length" "1")])
3631 (define_expand "lshrdi3"
3632 [(parallel [(set (match_operand:DI 0 "register_operand" "")
3633 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
3634 (match_operand:SI 2 "arith_operand" "")))
3635 (clobber (match_dup 3))])]
3636 "TARGET_64BIT || !TARGET_DEBUG_G_MODE"
3641 emit_insn (gen_lshrdi3_internal4 (operands[0], operands[1],
3646 operands[3] = gen_reg_rtx (SImode);
3650 (define_insn "lshrdi3_internal"
3651 [(set (match_operand:DI 0 "register_operand" "=&d")
3652 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
3653 (match_operand:SI 2 "register_operand" "d")))
3654 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3655 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE"
3658 operands[4] = const0_rtx;
3659 dslots_jump_total += 3;
3660 dslots_jump_filled += 2;
3662 return \"sll\\t%3,%2,26\\n\\
3663 \\tbgez\\t%3,1f\\n\\
3664 \\tsrl\\t%L0,%M1,%2\\n\\
3666 \\tmove\\t%M0,%z4%)\\n\\
3669 \\t%(beq\\t%3,%z4,2f\\n\\
3670 \\tsrl\\t%L0,%L1,%2%)\\n\\
3672 \\tsubu\\t%3,%z4,%2\\n\\
3673 \\tsll\\t%3,%M1,%3\\n\\
3674 \\tor\\t%L0,%L0,%3\\n\\
3676 \\tsrl\\t%M0,%M1,%2\\n\\
3679 [(set_attr "type" "darith")
3680 (set_attr "mode" "DI")
3681 (set_attr "length" "12")])
3684 (define_insn "lshrdi3_internal2"
3685 [(set (match_operand:DI 0 "register_operand" "=d")
3686 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
3687 (match_operand:SI 2 "small_int" "IJK")))
3688 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3689 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
3692 operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);
3693 operands[4] = const0_rtx;
3694 return \"srl\\t%L0,%M1,%2\;move\\t%M0,%z4\";
3696 [(set_attr "type" "darith")
3697 (set_attr "mode" "DI")
3698 (set_attr "length" "2")])
3702 [(set (match_operand:DI 0 "register_operand" "")
3703 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
3704 (match_operand:SI 2 "small_int" "")))
3705 (clobber (match_operand:SI 3 "register_operand" ""))]
3706 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3707 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3708 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3709 && (INTVAL (operands[2]) & 32) != 0"
3711 [(set (subreg:SI (match_dup 0) 0) (lshiftrt:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
3712 (set (subreg:SI (match_dup 0) 1) (const_int 0))]
3714 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
3718 [(set (match_operand:DI 0 "register_operand" "")
3719 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
3720 (match_operand:SI 2 "small_int" "")))
3721 (clobber (match_operand:SI 3 "register_operand" ""))]
3722 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3723 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3724 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3725 && (INTVAL (operands[2]) & 32) != 0"
3727 [(set (subreg:SI (match_dup 0) 1) (lshiftrt:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
3728 (set (subreg:SI (match_dup 0) 0) (const_int 0))]
3730 "operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f);")
3733 (define_insn "lshrdi3_internal3"
3734 [(set (match_operand:DI 0 "register_operand" "=d")
3735 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
3736 (match_operand:SI 2 "small_int" "IJK")))
3737 (clobber (match_operand:SI 3 "register_operand" "=d"))]
3738 "!TARGET_64BIT && !TARGET_DEBUG_G_MODE
3739 && (INTVAL (operands[2]) & 63) < 32
3740 && (INTVAL (operands[2]) & 63) != 0"
3743 int amount = INTVAL (operands[2]);
3745 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3746 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3748 return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;srl\\t%M0,%M1,%2\";
3750 [(set_attr "type" "darith")
3751 (set_attr "mode" "DI")
3752 (set_attr "length" "4")])
3756 [(set (match_operand:DI 0 "register_operand" "")
3757 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
3758 (match_operand:SI 2 "small_int" "")))
3759 (clobber (match_operand:SI 3 "register_operand" ""))]
3760 "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3761 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3762 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3763 && (INTVAL (operands[2]) & 63) < 32
3764 && (INTVAL (operands[2]) & 63) != 0"
3766 [(set (subreg:SI (match_dup 0) 0)
3767 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
3771 (ashift:SI (subreg:SI (match_dup 1) 1)
3774 (set (subreg:SI (match_dup 0) 0)
3775 (ior:SI (subreg:SI (match_dup 0) 0)
3778 (set (subreg:SI (match_dup 0) 1)
3779 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
3783 int amount = INTVAL (operands[2]);
3784 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3785 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3790 [(set (match_operand:DI 0 "register_operand" "")
3791 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
3792 (match_operand:SI 2 "small_int" "")))
3793 (clobber (match_operand:SI 3 "register_operand" ""))]
3794 "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
3795 && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
3796 && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
3797 && (INTVAL (operands[2]) & 63) < 32
3798 && (INTVAL (operands[2]) & 63) != 0"
3800 [(set (subreg:SI (match_dup 0) 1)
3801 (lshiftrt:SI (subreg:SI (match_dup 1) 1)
3805 (ashift:SI (subreg:SI (match_dup 1) 0)
3808 (set (subreg:SI (match_dup 0) 1)
3809 (ior:SI (subreg:SI (match_dup 0) 1)
3812 (set (subreg:SI (match_dup 0) 0)
3813 (lshiftrt:SI (subreg:SI (match_dup 1) 0)
3817 int amount = INTVAL (operands[2]);
3818 operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
3819 operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
3823 (define_insn "lshrdi3_internal4"
3824 [(set (match_operand:DI 0 "register_operand" "=d")
3825 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
3826 (match_operand:SI 2 "arith_operand" "dI")))]
3830 if (GET_CODE (operands[2]) == CONST_INT)
3831 operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
3833 return \"dsrl\\t%0,%1,%2\";
3835 [(set_attr "type" "arith")
3836 (set_attr "mode" "DI")
3837 (set_attr "length" "1")])
3841 ;; ....................
3845 ;; ....................
3847 ;; Flow here is rather complex:
3849 ;; 1) The cmp{si,di,sf,df} routine is called. It deposits the
3850 ;; arguments into the branch_cmp array, and the type into
3851 ;; branch_type. No RTL is generated.
3853 ;; 2) The appropriate branch define_expand is called, which then
3854 ;; creates the appropriate RTL for the comparison and branch.
3855 ;; Different CC modes are used, based on what type of branch is
3856 ;; done, so that we can constrain things appropriately. There
3857 ;; are assumptions in the rest of GCC that break if we fold the
3858 ;; operands into the branchs for integer operations, and use cc0
3859 ;; for floating point, so we use the fp status register instead.
3860 ;; If needed, an appropriate temporary is created to hold the
3861 ;; of the integer compare.
3863 (define_expand "cmpsi"
3865 (compare:CC (match_operand:SI 0 "register_operand" "")
3866 (match_operand:SI 1 "arith_operand" "")))]
3870 if (operands[0]) /* avoid unused code message */
3872 branch_cmp[0] = operands[0];
3873 branch_cmp[1] = operands[1];
3874 branch_type = CMP_SI;
3879 (define_expand "tstsi"
3881 (match_operand:SI 0 "register_operand" ""))]
3885 if (operands[0]) /* avoid unused code message */
3887 branch_cmp[0] = operands[0];
3888 branch_cmp[1] = const0_rtx;
3889 branch_type = CMP_SI;
3894 (define_expand "cmpdi"
3896 (compare:CC (match_operand:DI 0 "register_operand" "")
3897 (match_operand:DI 1 "arith_operand" "")))]
3901 if (operands[0]) /* avoid unused code message */
3903 branch_cmp[0] = operands[0];
3904 branch_cmp[1] = operands[1];
3905 branch_type = CMP_DI;
3910 (define_expand "tstdi"
3912 (match_operand:DI 0 "register_operand" ""))]
3916 if (operands[0]) /* avoid unused code message */
3918 branch_cmp[0] = operands[0];
3919 branch_cmp[1] = const0_rtx;
3920 branch_type = CMP_DI;
3925 (define_expand "cmpdf"
3927 (compare:CC_FP (match_operand:DF 0 "register_operand" "")
3928 (match_operand:DF 1 "register_operand" "")))]
3932 if (operands[0]) /* avoid unused code message */
3934 branch_cmp[0] = operands[0];
3935 branch_cmp[1] = operands[1];
3936 branch_type = CMP_DF;
3941 (define_expand "cmpsf"
3943 (compare:CC_FP (match_operand:SF 0 "register_operand" "")
3944 (match_operand:SF 1 "register_operand" "")))]
3948 if (operands[0]) /* avoid unused code message */
3950 branch_cmp[0] = operands[0];
3951 branch_cmp[1] = operands[1];
3952 branch_type = CMP_SF;
3959 ;; ....................
3961 ;; CONDITIONAL BRANCHES
3963 ;; ....................
3965 (define_insn "branch_fp_ne"
3967 (if_then_else (ne:CC_FP (reg:CC_FP 66)
3969 (match_operand 0 "pc_or_label_operand" "")
3970 (match_operand 1 "pc_or_label_operand" "")))]
3974 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
3975 return (operands[0] != pc_rtx) ? \"%*bc1t%?\\t%0\" : \"%*bc1f%?\\t%1\";
3977 [(set_attr "type" "branch")
3978 (set_attr "mode" "none")
3979 (set_attr "length" "1")])
3981 (define_insn "branch_fp_ne_rev"
3983 (if_then_else (ne:CC_REV_FP (reg:CC_REV_FP 66)
3985 (match_operand 0 "pc_or_label_operand" "")
3986 (match_operand 1 "pc_or_label_operand" "")))]
3990 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
3991 return (operands[0] != pc_rtx) ? \"%*bc1f%?\\t%0\" : \"%*bc1t%?\\t%1\";
3993 [(set_attr "type" "branch")
3994 (set_attr "mode" "none")
3995 (set_attr "length" "1")])
3997 (define_insn "branch_fp_eq"
3999 (if_then_else (eq:CC_FP (reg:CC_FP 66)
4001 (match_operand 0 "pc_or_label_operand" "")
4002 (match_operand 1 "pc_or_label_operand" "")))]
4006 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
4007 return (operands[0] != pc_rtx) ? \"%*bc1f%?\\t%0\" : \"%*bc1t%?\\t%1\";
4009 [(set_attr "type" "branch")
4010 (set_attr "mode" "none")
4011 (set_attr "length" "1")])
4013 (define_insn "branch_fp_eq_rev"
4015 (if_then_else (eq:CC_REV_FP (reg:CC_REV_FP 66)
4017 (match_operand 0 "pc_or_label_operand" "")
4018 (match_operand 1 "pc_or_label_operand" "")))]
4022 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
4023 return (operands[0] != pc_rtx) ? \"%*bc1t%?\\t%0\" : \"%*bc1f%?\\t%1\";
4025 [(set_attr "type" "branch")
4026 (set_attr "mode" "none")
4027 (set_attr "length" "1")])
4030 (define_insn "branch_zero"
4032 (if_then_else (match_operator:SI 0 "cmp_op"
4033 [(match_operand:SI 1 "register_operand" "d")
4035 (match_operand 2 "pc_or_label_operand" "")
4036 (match_operand 3 "pc_or_label_operand" "")))]
4040 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
4041 if (operands[2] != pc_rtx)
4043 switch (GET_CODE (operands[0]))
4045 case EQ: return \"%*beq%?\\t%z1,%.,%2\";
4046 case NE: return \"%*bne%?\\t%z1,%.,%2\";
4047 case GTU: return \"%*bne%?\\t%z1,%.,%2\";
4048 case LEU: return \"%*beq%?\\t%z1,%.,%2\";
4049 case GEU: return \"%*j\\t%2\";
4050 case LTU: return \"%*bne%?\\t%.,%.,%2\";
4053 return \"%*b%C0z%?\\t%z1,%2\";
4056 { /* inverted jump */
4057 switch (GET_CODE (operands[0]))
4059 case EQ: return \"%*bne%?\\t%z1,%.,%3\";
4060 case NE: return \"%*beq%?\\t%z1,%.,%3\";
4061 case GTU: return \"%*beq%?\\t%z1,%.,%3\";
4062 case LEU: return \"%*bne%?\\t%z1,%.,%3\";
4063 case GEU: return \"%*beq%?\\t%.,%.,%3\";
4064 case LTU: return \"%*j\\t%3\";
4067 return \"%*b%N0z%?\\t%z1,%3\";
4070 [(set_attr "type" "branch")
4071 (set_attr "mode" "none")
4072 (set_attr "length" "1")])
4075 (define_insn "branch_zero_di"
4077 (if_then_else (match_operator:DI 0 "cmp_op"
4078 [(match_operand:DI 1 "register_operand" "d")
4080 (match_operand 2 "pc_or_label_operand" "")
4081 (match_operand 3 "pc_or_label_operand" "")))]
4085 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
4086 if (operands[2] != pc_rtx)
4088 switch (GET_CODE (operands[0]))
4090 case EQ: return \"%*beq%?\\t%z1,%.,%2\";
4091 case NE: return \"%*bne%?\\t%z1,%.,%2\";
4092 case GTU: return \"%*bne%?\\t%z1,%.,%2\";
4093 case LEU: return \"%*beq%?\\t%z1,%.,%2\";
4094 case GEU: return \"%*j\\t%2\";
4095 case LTU: return \"%*bne%?\\t%.,%.,%2\";
4098 return \"%*b%C0z%?\\t%z1,%2\";
4101 { /* inverted jump */
4102 switch (GET_CODE (operands[0]))
4104 case EQ: return \"%*bne%?\\t%z1,%.,%3\";
4105 case NE: return \"%*beq%?\\t%z1,%.,%3\";
4106 case GTU: return \"%*beq%?\\t%z1,%.,%3\";
4107 case LEU: return \"%*bne%?\\t%z1,%.,%3\";
4108 case GEU: return \"%*beq%?\\t%.,%.,%3\";
4109 case LTU: return \"%*j\\t%3\";
4112 return \"%*b%N0z%?\\t%z1,%3\";
4115 [(set_attr "type" "branch")
4116 (set_attr "mode" "none")
4117 (set_attr "length" "1")])
4120 (define_insn "branch_equality"
4122 (if_then_else (match_operator:SI 0 "equality_op"
4123 [(match_operand:SI 1 "register_operand" "d")
4124 (match_operand:SI 2 "register_operand" "d")])
4125 (match_operand 3 "pc_or_label_operand" "")
4126 (match_operand 4 "pc_or_label_operand" "")))]
4130 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
4131 return (operands[3] != pc_rtx)
4132 ? \"%*b%C0%?\\t%z1,%z2,%3\"
4133 : \"%*b%N0%?\\t%z1,%z2,%4\";
4135 [(set_attr "type" "branch")
4136 (set_attr "mode" "none")
4137 (set_attr "length" "1")])
4140 (define_insn "branch_equality_di"
4142 (if_then_else (match_operator:DI 0 "equality_op"
4143 [(match_operand:DI 1 "register_operand" "d")
4144 (match_operand:DI 2 "register_operand" "d")])
4145 (match_operand 3 "pc_or_label_operand" "")
4146 (match_operand 4 "pc_or_label_operand" "")))]
4150 mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
4151 return (operands[3] != pc_rtx)
4152 ? \"%*b%C0%?\\t%z1,%z2,%3\"
4153 : \"%*b%N0%?\\t%z1,%z2,%4\";
4155 [(set_attr "type" "branch")
4156 (set_attr "mode" "none")
4157 (set_attr "length" "1")])
4160 (define_expand "beq"
4162 (if_then_else (eq:CC_EQ (cc0)
4164 (label_ref (match_operand 0 "" ""))
4169 if (operands[0]) /* avoid unused code warning */
4171 gen_conditional_branch (operands, EQ);
4176 (define_expand "bne"
4178 (if_then_else (ne:CC_EQ (cc0)
4180 (label_ref (match_operand 0 "" ""))
4185 if (operands[0]) /* avoid unused code warning */
4187 gen_conditional_branch (operands, NE);
4192 (define_expand "bgt"
4194 (if_then_else (gt:CC (cc0)
4196 (label_ref (match_operand 0 "" ""))
4201 if (operands[0]) /* avoid unused code warning */
4203 gen_conditional_branch (operands, GT);
4208 (define_expand "bge"
4210 (if_then_else (ge:CC (cc0)
4212 (label_ref (match_operand 0 "" ""))
4217 if (operands[0]) /* avoid unused code warning */
4219 gen_conditional_branch (operands, GE);
4224 (define_expand "blt"
4226 (if_then_else (lt:CC (cc0)
4228 (label_ref (match_operand 0 "" ""))
4233 if (operands[0]) /* avoid unused code warning */
4235 gen_conditional_branch (operands, LT);
4240 (define_expand "ble"
4242 (if_then_else (le:CC (cc0)
4244 (label_ref (match_operand 0 "" ""))
4249 if (operands[0]) /* avoid unused code warning */
4251 gen_conditional_branch (operands, LE);
4256 (define_expand "bgtu"
4258 (if_then_else (gtu:CC (cc0)
4260 (label_ref (match_operand 0 "" ""))
4265 if (operands[0]) /* avoid unused code warning */
4267 gen_conditional_branch (operands, GTU);
4272 (define_expand "bgeu"
4274 (if_then_else (geu:CC (cc0)
4276 (label_ref (match_operand 0 "" ""))
4281 if (operands[0]) /* avoid unused code warning */
4283 gen_conditional_branch (operands, GEU);
4289 (define_expand "bltu"
4291 (if_then_else (ltu:CC (cc0)
4293 (label_ref (match_operand 0 "" ""))
4298 if (operands[0]) /* avoid unused code warning */
4300 gen_conditional_branch (operands, LTU);
4305 (define_expand "bleu"
4307 (if_then_else (leu:CC (cc0)
4309 (label_ref (match_operand 0 "" ""))
4314 if (operands[0]) /* avoid unused code warning */
4316 gen_conditional_branch (operands, LEU);
4323 ;; ....................
4325 ;; SETTING A REGISTER FROM A COMPARISON
4327 ;; ....................
4329 (define_expand "seq"
4330 [(set (match_operand:SI 0 "register_operand" "=d")
4331 (eq:SI (match_dup 1)
4336 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4339 /* set up operands from compare. */
4340 operands[1] = branch_cmp[0];
4341 operands[2] = branch_cmp[1];
4343 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4345 gen_int_relational (EQ, operands[0], operands[1], operands[2], (int *)0);
4349 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4350 operands[2] = force_reg (SImode, operands[2]);
4352 /* fall through and generate default code */
4356 (define_insn "seq_si_zero"
4357 [(set (match_operand:SI 0 "register_operand" "=d")
4358 (eq:SI (match_operand:SI 1 "register_operand" "d")
4362 [(set_attr "type" "arith")
4363 (set_attr "mode" "SI")
4364 (set_attr "length" "1")])
4366 (define_insn "seq_di_zero"
4367 [(set (match_operand:DI 0 "register_operand" "=d")
4368 (eq:DI (match_operand:DI 1 "register_operand" "d")
4372 [(set_attr "type" "arith")
4373 (set_attr "mode" "DI")
4374 (set_attr "length" "1")])
4376 (define_insn "seq_si"
4377 [(set (match_operand:SI 0 "register_operand" "=d,d")
4378 (eq:SI (match_operand:SI 1 "register_operand" "%d,d")
4379 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
4380 "TARGET_DEBUG_C_MODE"
4382 xor\\t%0,%1,%2\;sltu\\t%0,%0,1
4383 xori\\t%0,%1,%2\;sltu\\t%0,%0,1"
4384 [(set_attr "type" "arith")
4385 (set_attr "mode" "SI")
4386 (set_attr "length" "2")])
4389 [(set (match_operand:SI 0 "register_operand" "")
4390 (eq:SI (match_operand:SI 1 "register_operand" "")
4391 (match_operand:SI 2 "uns_arith_operand" "")))]
4392 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE
4393 && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0)"
4395 (xor:SI (match_dup 1)
4398 (ltu:SI (match_dup 0)
4402 (define_insn "seq_di"
4403 [(set (match_operand:DI 0 "register_operand" "=d,d")
4404 (eq:DI (match_operand:DI 1 "register_operand" "%d,d")
4405 (match_operand:DI 2 "uns_arith_operand" "d,K")))]
4406 "TARGET_64BIT && TARGET_DEBUG_C_MODE"
4408 xor\\t%0,%1,%2\;sltu\\t%0,%0,1
4409 xori\\t%0,%1,%2\;sltu\\t%0,%0,1"
4410 [(set_attr "type" "arith")
4411 (set_attr "mode" "DI")
4412 (set_attr "length" "2")])
4415 [(set (match_operand:DI 0 "register_operand" "")
4416 (eq:DI (match_operand:DI 1 "register_operand" "")
4417 (match_operand:DI 2 "uns_arith_operand" "")))]
4418 "TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE
4419 && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0)"
4421 (xor:DI (match_dup 1)
4424 (ltu:DI (match_dup 0)
4428 (define_expand "sne"
4429 [(set (match_operand:SI 0 "register_operand" "=d")
4430 (ne:SI (match_dup 1)
4435 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4438 /* set up operands from compare. */
4439 operands[1] = branch_cmp[0];
4440 operands[2] = branch_cmp[1];
4442 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4444 gen_int_relational (NE, operands[0], operands[1], operands[2], (int *)0);
4448 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4449 operands[2] = force_reg (SImode, operands[2]);
4451 /* fall through and generate default code */
4454 (define_insn "sne_si_zero"
4455 [(set (match_operand:SI 0 "register_operand" "=d")
4456 (ne:SI (match_operand:SI 1 "register_operand" "d")
4460 [(set_attr "type" "arith")
4461 (set_attr "mode" "SI")
4462 (set_attr "length" "1")])
4464 (define_insn "sne_di_zero"
4465 [(set (match_operand:DI 0 "register_operand" "=d")
4466 (ne:DI (match_operand:DI 1 "register_operand" "d")
4470 [(set_attr "type" "arith")
4471 (set_attr "mode" "DI")
4472 (set_attr "length" "1")])
4474 (define_insn "sne_si"
4475 [(set (match_operand:SI 0 "register_operand" "=d,d")
4476 (ne:SI (match_operand:SI 1 "register_operand" "%d,d")
4477 (match_operand:SI 2 "uns_arith_operand" "d,K")))]
4478 "TARGET_DEBUG_C_MODE"
4480 xor\\t%0,%1,%2\;sltu\\t%0,%.,%0
4481 xori\\t%0,%1,%x2\;sltu\\t%0,%.,%0"
4482 [(set_attr "type" "arith")
4483 (set_attr "mode" "SI")
4484 (set_attr "length" "2")])
4487 [(set (match_operand:SI 0 "register_operand" "")
4488 (ne:SI (match_operand:SI 1 "register_operand" "")
4489 (match_operand:SI 2 "uns_arith_operand" "")))]
4490 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE
4491 && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0)"
4493 (xor:SI (match_dup 1)
4496 (gtu:SI (match_dup 0)
4500 (define_insn "sne_di"
4501 [(set (match_operand:DI 0 "register_operand" "=d,d")
4502 (ne:DI (match_operand:DI 1 "register_operand" "%d,d")
4503 (match_operand:DI 2 "uns_arith_operand" "d,K")))]
4504 "TARGET_64BIT && TARGET_DEBUG_C_MODE"
4506 xor\\t%0,%1,%2\;sltu\\t%0,%.,%0
4507 xori\\t%0,%1,%x2\;sltu\\t%0,%.,%0"
4508 [(set_attr "type" "arith")
4509 (set_attr "mode" "DI")
4510 (set_attr "length" "2")])
4513 [(set (match_operand:DI 0 "register_operand" "")
4514 (ne:DI (match_operand:DI 1 "register_operand" "")
4515 (match_operand:DI 2 "uns_arith_operand" "")))]
4516 "TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE
4517 && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0)"
4519 (xor:DI (match_dup 1)
4522 (gtu:DI (match_dup 0)
4526 (define_expand "sgt"
4527 [(set (match_operand:SI 0 "register_operand" "=d")
4528 (gt:SI (match_dup 1)
4533 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4536 /* set up operands from compare. */
4537 operands[1] = branch_cmp[0];
4538 operands[2] = branch_cmp[1];
4540 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4542 gen_int_relational (GT, operands[0], operands[1], operands[2], (int *)0);
4546 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
4547 operands[2] = force_reg (SImode, operands[2]);
4549 /* fall through and generate default code */
4552 (define_insn "sgt_si"
4553 [(set (match_operand:SI 0 "register_operand" "=d")
4554 (gt:SI (match_operand:SI 1 "register_operand" "d")
4555 (match_operand:SI 2 "reg_or_0_operand" "dJ")))]
4558 [(set_attr "type" "arith")
4559 (set_attr "mode" "SI")
4560 (set_attr "length" "1")])
4562 (define_insn "sgt_di"
4563 [(set (match_operand:DI 0 "register_operand" "=d")
4564 (gt:DI (match_operand:DI 1 "register_operand" "d")
4565 (match_operand:DI 2 "reg_or_0_operand" "dJ")))]
4568 [(set_attr "type" "arith")
4569 (set_attr "mode" "DI")
4570 (set_attr "length" "1")])
4572 (define_expand "sge"
4573 [(set (match_operand:SI 0 "register_operand" "=d")
4574 (ge:SI (match_dup 1)
4579 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4582 /* set up operands from compare. */
4583 operands[1] = branch_cmp[0];
4584 operands[2] = branch_cmp[1];
4586 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4588 gen_int_relational (GE, operands[0], operands[1], operands[2], (int *)0);
4592 /* fall through and generate default code */
4595 (define_insn "sge_si"
4596 [(set (match_operand:SI 0 "register_operand" "=d")
4597 (ge:SI (match_operand:SI 1 "register_operand" "d")
4598 (match_operand:SI 2 "arith_operand" "dI")))]
4599 "TARGET_DEBUG_C_MODE"
4600 "slt\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
4601 [(set_attr "type" "arith")
4602 (set_attr "mode" "SI")
4603 (set_attr "length" "2")])
4606 [(set (match_operand:SI 0 "register_operand" "")
4607 (ge:SI (match_operand:SI 1 "register_operand" "")
4608 (match_operand:SI 2 "arith_operand" "")))]
4609 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
4611 (lt:SI (match_dup 1)
4614 (xor:SI (match_dup 0)
4618 (define_insn "sge_di"
4619 [(set (match_operand:DI 0 "register_operand" "=d")
4620 (ge:DI (match_operand:DI 1 "register_operand" "d")
4621 (match_operand:DI 2 "arith_operand" "dI")))]
4622 "TARGET_64BIT && TARGET_DEBUG_C_MODE"
4623 "slt\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
4624 [(set_attr "type" "arith")
4625 (set_attr "mode" "DI")
4626 (set_attr "length" "2")])
4629 [(set (match_operand:DI 0 "register_operand" "")
4630 (ge:DI (match_operand:DI 1 "register_operand" "")
4631 (match_operand:DI 2 "arith_operand" "")))]
4632 "TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
4634 (lt:DI (match_dup 1)
4637 (xor:DI (match_dup 0)
4641 (define_expand "slt"
4642 [(set (match_operand:SI 0 "register_operand" "=d")
4643 (lt:SI (match_dup 1)
4648 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4651 /* set up operands from compare. */
4652 operands[1] = branch_cmp[0];
4653 operands[2] = branch_cmp[1];
4655 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4657 gen_int_relational (LT, operands[0], operands[1], operands[2], (int *)0);
4661 /* fall through and generate default code */
4664 (define_insn "slt_si"
4665 [(set (match_operand:SI 0 "register_operand" "=d")
4666 (lt:SI (match_operand:SI 1 "register_operand" "d")
4667 (match_operand:SI 2 "arith_operand" "dI")))]
4670 [(set_attr "type" "arith")
4671 (set_attr "mode" "SI")
4672 (set_attr "length" "1")])
4674 (define_insn "slt_di"
4675 [(set (match_operand:DI 0 "register_operand" "=d")
4676 (lt:DI (match_operand:DI 1 "register_operand" "d")
4677 (match_operand:DI 2 "arith_operand" "dI")))]
4680 [(set_attr "type" "arith")
4681 (set_attr "mode" "DI")
4682 (set_attr "length" "1")])
4684 (define_expand "sle"
4685 [(set (match_operand:SI 0 "register_operand" "=d")
4686 (le:SI (match_dup 1)
4691 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4694 /* set up operands from compare. */
4695 operands[1] = branch_cmp[0];
4696 operands[2] = branch_cmp[1];
4698 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4700 gen_int_relational (LE, operands[0], operands[1], operands[2], (int *)0);
4704 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 32767)
4705 operands[2] = force_reg (SImode, operands[2]);
4707 /* fall through and generate default code */
4710 (define_insn "sle_si_const"
4711 [(set (match_operand:SI 0 "register_operand" "=d")
4712 (le:SI (match_operand:SI 1 "register_operand" "d")
4713 (match_operand:SI 2 "small_int" "I")))]
4714 "INTVAL (operands[2]) < 32767"
4717 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
4718 return \"slt\\t%0,%1,%2\";
4720 [(set_attr "type" "arith")
4721 (set_attr "mode" "SI")
4722 (set_attr "length" "1")])
4724 (define_insn "sle_di_const"
4725 [(set (match_operand:DI 0 "register_operand" "=d")
4726 (le:DI (match_operand:DI 1 "register_operand" "d")
4727 (match_operand:DI 2 "small_int" "I")))]
4728 "TARGET_64BIT && INTVAL (operands[2]) < 32767"
4731 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
4732 return \"slt\\t%0,%1,%2\";
4734 [(set_attr "type" "arith")
4735 (set_attr "mode" "DI")
4736 (set_attr "length" "1")])
4738 (define_insn "sle_si_reg"
4739 [(set (match_operand:SI 0 "register_operand" "=d")
4740 (le:SI (match_operand:SI 1 "register_operand" "d")
4741 (match_operand:SI 2 "register_operand" "d")))]
4742 "TARGET_DEBUG_C_MODE"
4743 "slt\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
4744 [(set_attr "type" "arith")
4745 (set_attr "mode" "SI")
4746 (set_attr "length" "2")])
4749 [(set (match_operand:SI 0 "register_operand" "")
4750 (le:SI (match_operand:SI 1 "register_operand" "")
4751 (match_operand:SI 2 "register_operand" "")))]
4752 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
4754 (lt:SI (match_dup 2)
4757 (xor:SI (match_dup 0)
4761 (define_insn "sle_di_reg"
4762 [(set (match_operand:DI 0 "register_operand" "=d")
4763 (le:DI (match_operand:DI 1 "register_operand" "d")
4764 (match_operand:DI 2 "register_operand" "d")))]
4765 "TARGET_64BIT && TARGET_DEBUG_C_MODE"
4766 "slt\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
4767 [(set_attr "type" "arith")
4768 (set_attr "mode" "DI")
4769 (set_attr "length" "2")])
4772 [(set (match_operand:DI 0 "register_operand" "")
4773 (le:DI (match_operand:DI 1 "register_operand" "")
4774 (match_operand:DI 2 "register_operand" "")))]
4775 "TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
4777 (lt:DI (match_dup 2)
4780 (xor:DI (match_dup 0)
4784 (define_expand "sgtu"
4785 [(set (match_operand:SI 0 "register_operand" "=d")
4786 (gtu:SI (match_dup 1)
4791 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4794 /* set up operands from compare. */
4795 operands[1] = branch_cmp[0];
4796 operands[2] = branch_cmp[1];
4798 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4800 gen_int_relational (GTU, operands[0], operands[1], operands[2], (int *)0);
4804 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
4805 operands[2] = force_reg (SImode, operands[2]);
4807 /* fall through and generate default code */
4810 (define_insn "sgtu_si"
4811 [(set (match_operand:SI 0 "register_operand" "=d")
4812 (gtu:SI (match_operand:SI 1 "register_operand" "d")
4813 (match_operand:SI 2 "reg_or_0_operand" "dJ")))]
4816 [(set_attr "type" "arith")
4817 (set_attr "mode" "SI")
4818 (set_attr "length" "1")])
4820 (define_insn "sgtu_di"
4821 [(set (match_operand:DI 0 "register_operand" "=d")
4822 (gtu:DI (match_operand:DI 1 "register_operand" "d")
4823 (match_operand:DI 2 "reg_or_0_operand" "dJ")))]
4826 [(set_attr "type" "arith")
4827 (set_attr "mode" "DI")
4828 (set_attr "length" "1")])
4830 (define_expand "sgeu"
4831 [(set (match_operand:SI 0 "register_operand" "=d")
4832 (geu:SI (match_dup 1)
4837 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4840 /* set up operands from compare. */
4841 operands[1] = branch_cmp[0];
4842 operands[2] = branch_cmp[1];
4844 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4846 gen_int_relational (GEU, operands[0], operands[1], operands[2], (int *)0);
4850 /* fall through and generate default code */
4853 (define_insn "sgeu_si"
4854 [(set (match_operand:SI 0 "register_operand" "=d")
4855 (geu:SI (match_operand:SI 1 "register_operand" "d")
4856 (match_operand:SI 2 "arith_operand" "dI")))]
4857 "TARGET_DEBUG_C_MODE"
4858 "sltu\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
4859 [(set_attr "type" "arith")
4860 (set_attr "mode" "SI")
4861 (set_attr "length" "2")])
4864 [(set (match_operand:SI 0 "register_operand" "")
4865 (geu:SI (match_operand:SI 1 "register_operand" "")
4866 (match_operand:SI 2 "arith_operand" "")))]
4867 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
4869 (ltu:SI (match_dup 1)
4872 (xor:SI (match_dup 0)
4876 (define_insn "sgeu_di"
4877 [(set (match_operand:DI 0 "register_operand" "=d")
4878 (geu:DI (match_operand:DI 1 "register_operand" "d")
4879 (match_operand:DI 2 "arith_operand" "dI")))]
4880 "TARGET_64BIT && TARGET_DEBUG_C_MODE"
4881 "sltu\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
4882 [(set_attr "type" "arith")
4883 (set_attr "mode" "DI")
4884 (set_attr "length" "2")])
4887 [(set (match_operand:DI 0 "register_operand" "")
4888 (geu:DI (match_operand:DI 1 "register_operand" "")
4889 (match_operand:DI 2 "arith_operand" "")))]
4890 "TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
4892 (ltu:DI (match_dup 1)
4895 (xor:DI (match_dup 0)
4899 (define_expand "sltu"
4900 [(set (match_operand:SI 0 "register_operand" "=d")
4901 (ltu:SI (match_dup 1)
4906 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4909 /* set up operands from compare. */
4910 operands[1] = branch_cmp[0];
4911 operands[2] = branch_cmp[1];
4913 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4915 gen_int_relational (LTU, operands[0], operands[1], operands[2], (int *)0);
4919 /* fall through and generate default code */
4922 (define_insn "sltu_si"
4923 [(set (match_operand:SI 0 "register_operand" "=d")
4924 (ltu:SI (match_operand:SI 1 "register_operand" "d")
4925 (match_operand:SI 2 "arith_operand" "dI")))]
4928 [(set_attr "type" "arith")
4929 (set_attr "mode" "SI")
4930 (set_attr "length" "1")])
4932 (define_insn "sltu_di"
4933 [(set (match_operand:DI 0 "register_operand" "=d")
4934 (ltu:DI (match_operand:DI 1 "register_operand" "d")
4935 (match_operand:DI 2 "arith_operand" "dI")))]
4938 [(set_attr "type" "arith")
4939 (set_attr "mode" "DI")
4940 (set_attr "length" "1")])
4942 (define_expand "sleu"
4943 [(set (match_operand:SI 0 "register_operand" "=d")
4944 (leu:SI (match_dup 1)
4949 if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
4952 /* set up operands from compare. */
4953 operands[1] = branch_cmp[0];
4954 operands[2] = branch_cmp[1];
4956 if (TARGET_64BIT || !TARGET_DEBUG_C_MODE)
4958 gen_int_relational (LEU, operands[0], operands[1], operands[2], (int *)0);
4962 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 32767)
4963 operands[2] = force_reg (SImode, operands[2]);
4965 /* fall through and generate default code */
4968 (define_insn "sleu_si_const"
4969 [(set (match_operand:SI 0 "register_operand" "=d")
4970 (leu:SI (match_operand:SI 1 "register_operand" "d")
4971 (match_operand:SI 2 "small_int" "I")))]
4972 "INTVAL (operands[2]) < 32767"
4975 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
4976 return \"sltu\\t%0,%1,%2\";
4978 [(set_attr "type" "arith")
4979 (set_attr "mode" "SI")
4980 (set_attr "length" "1")])
4982 (define_insn "sleu_di_const"
4983 [(set (match_operand:DI 0 "register_operand" "=d")
4984 (leu:DI (match_operand:DI 1 "register_operand" "d")
4985 (match_operand:DI 2 "small_int" "I")))]
4986 "TARGET_64BIT && INTVAL (operands[2]) < 32767"
4989 operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
4990 return \"sltu\\t%0,%1,%2\";
4992 [(set_attr "type" "arith")
4993 (set_attr "mode" "DI")
4994 (set_attr "length" "1")])
4996 (define_insn "sleu_si_reg"
4997 [(set (match_operand:SI 0 "register_operand" "=d")
4998 (leu:SI (match_operand:SI 1 "register_operand" "d")
4999 (match_operand:SI 2 "register_operand" "d")))]
5000 "TARGET_DEBUG_C_MODE"
5001 "sltu\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
5002 [(set_attr "type" "arith")
5003 (set_attr "mode" "SI")
5004 (set_attr "length" "2")])
5007 [(set (match_operand:SI 0 "register_operand" "")
5008 (leu:SI (match_operand:SI 1 "register_operand" "")
5009 (match_operand:SI 2 "register_operand" "")))]
5010 "TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
5012 (ltu:SI (match_dup 2)
5015 (xor:SI (match_dup 0)
5019 (define_insn "sleu_di_reg"
5020 [(set (match_operand:DI 0 "register_operand" "=d")
5021 (leu:DI (match_operand:DI 1 "register_operand" "d")
5022 (match_operand:DI 2 "register_operand" "d")))]
5023 "TARGET_64BIT && TARGET_DEBUG_C_MODE"
5024 "sltu\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
5025 [(set_attr "type" "arith")
5026 (set_attr "mode" "DI")
5027 (set_attr "length" "2")])
5030 [(set (match_operand:DI 0 "register_operand" "")
5031 (leu:DI (match_operand:DI 1 "register_operand" "")
5032 (match_operand:DI 2 "register_operand" "")))]
5033 "TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_DEBUG_D_MODE"
5035 (ltu:DI (match_dup 2)
5038 (xor:DI (match_dup 0)
5044 ;; ....................
5046 ;; FLOATING POINT COMPARISONS
5048 ;; ....................
5050 (define_insn "seq_df"
5051 [(set (reg:CC_FP 66)
5052 (eq:CC_FP (match_operand:DF 0 "register_operand" "f")
5053 (match_operand:DF 1 "register_operand" "f")))]
5058 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5059 xoperands[1] = operands[0];
5060 xoperands[2] = operands[1];
5062 return mips_fill_delay_slot (\"c.eq.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5064 [(set_attr "type" "fcmp")
5065 (set_attr "mode" "FPSW")
5066 (set_attr "length" "1")])
5068 (define_insn "sne_df"
5069 [(set (reg:CC_REV_FP 66)
5070 (ne:CC_REV_FP (match_operand:DF 0 "register_operand" "f")
5071 (match_operand:DF 1 "register_operand" "f")))]
5076 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5077 xoperands[1] = operands[0];
5078 xoperands[2] = operands[1];
5080 return mips_fill_delay_slot (\"c.eq.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5082 [(set_attr "type" "fcmp")
5083 (set_attr "mode" "FPSW")
5084 (set_attr "length" "1")])
5086 (define_insn "slt_df"
5087 [(set (reg:CC_FP 66)
5088 (lt:CC_FP (match_operand:DF 0 "register_operand" "f")
5089 (match_operand:DF 1 "register_operand" "f")))]
5094 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5095 xoperands[1] = operands[0];
5096 xoperands[2] = operands[1];
5098 return mips_fill_delay_slot (\"c.lt.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5100 [(set_attr "type" "fcmp")
5101 (set_attr "mode" "FPSW")
5102 (set_attr "length" "1")])
5104 (define_insn "sle_df"
5105 [(set (reg:CC_FP 66)
5106 (le:CC_FP (match_operand:DF 0 "register_operand" "f")
5107 (match_operand:DF 1 "register_operand" "f")))]
5112 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5113 xoperands[1] = operands[0];
5114 xoperands[2] = operands[1];
5116 return mips_fill_delay_slot (\"c.le.d\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5118 [(set_attr "type" "fcmp")
5119 (set_attr "mode" "FPSW")
5120 (set_attr "length" "1")])
5122 (define_insn "sgt_df"
5123 [(set (reg:CC_FP 66)
5124 (gt:CC_FP (match_operand:DF 0 "register_operand" "f")
5125 (match_operand:DF 1 "register_operand" "f")))]
5130 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5131 xoperands[1] = operands[0];
5132 xoperands[2] = operands[1];
5134 return mips_fill_delay_slot (\"c.lt.d\\t%1,%0\", DELAY_FCMP, xoperands, insn);
5136 [(set_attr "type" "fcmp")
5137 (set_attr "mode" "FPSW")
5138 (set_attr "length" "1")])
5140 (define_insn "sge_df"
5141 [(set (reg:CC_FP 66)
5142 (ge:CC_FP (match_operand:DF 0 "register_operand" "f")
5143 (match_operand:DF 1 "register_operand" "f")))]
5148 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5149 xoperands[1] = operands[0];
5150 xoperands[2] = operands[1];
5152 return mips_fill_delay_slot (\"c.le.d\\t%1,%0\", DELAY_FCMP, xoperands, insn);
5154 [(set_attr "type" "fcmp")
5155 (set_attr "mode" "FPSW")
5156 (set_attr "length" "1")])
5158 (define_insn "seq_sf"
5159 [(set (reg:CC_FP 66)
5160 (eq:CC_FP (match_operand:SF 0 "register_operand" "f")
5161 (match_operand:SF 1 "register_operand" "f")))]
5166 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5167 xoperands[1] = operands[0];
5168 xoperands[2] = operands[1];
5170 return mips_fill_delay_slot (\"c.eq.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5172 [(set_attr "type" "fcmp")
5173 (set_attr "mode" "FPSW")
5174 (set_attr "length" "1")])
5176 (define_insn "sne_sf"
5177 [(set (reg:CC_REV_FP 66)
5178 (ne:CC_REV_FP (match_operand:SF 0 "register_operand" "f")
5179 (match_operand:SF 1 "register_operand" "f")))]
5184 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5185 xoperands[1] = operands[0];
5186 xoperands[2] = operands[1];
5188 return mips_fill_delay_slot (\"c.eq.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5190 [(set_attr "type" "fcmp")
5191 (set_attr "mode" "FPSW")
5192 (set_attr "length" "1")])
5194 (define_insn "slt_sf"
5195 [(set (reg:CC_FP 66)
5196 (lt:CC_FP (match_operand:SF 0 "register_operand" "f")
5197 (match_operand:SF 1 "register_operand" "f")))]
5202 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5203 xoperands[1] = operands[0];
5204 xoperands[2] = operands[1];
5206 return mips_fill_delay_slot (\"c.lt.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5208 [(set_attr "type" "fcmp")
5209 (set_attr "mode" "FPSW")
5210 (set_attr "length" "1")])
5212 (define_insn "sle_sf"
5213 [(set (reg:CC_FP 66)
5214 (le:CC_FP (match_operand:SF 0 "register_operand" "f")
5215 (match_operand:SF 1 "register_operand" "f")))]
5220 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5221 xoperands[1] = operands[0];
5222 xoperands[2] = operands[1];
5224 return mips_fill_delay_slot (\"c.le.s\\t%0,%1\", DELAY_FCMP, xoperands, insn);
5226 [(set_attr "type" "fcmp")
5227 (set_attr "mode" "FPSW")
5228 (set_attr "length" "1")])
5230 (define_insn "sgt_sf"
5231 [(set (reg:CC_FP 66)
5232 (gt:CC_FP (match_operand:SF 0 "register_operand" "f")
5233 (match_operand:SF 1 "register_operand" "f")))]
5238 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5239 xoperands[1] = operands[0];
5240 xoperands[2] = operands[1];
5242 return mips_fill_delay_slot (\"c.lt.s\\t%1,%0\", DELAY_FCMP, xoperands, insn);
5244 [(set_attr "type" "fcmp")
5245 (set_attr "mode" "FPSW")
5246 (set_attr "length" "1")])
5248 (define_insn "sge_sf"
5249 [(set (reg:CC_FP 66)
5250 (ge:CC_FP (match_operand:SF 0 "register_operand" "f")
5251 (match_operand:SF 1 "register_operand" "f")))]
5256 xoperands[0] = gen_rtx (REG, CC_FPmode, FPSW_REGNUM);
5257 xoperands[1] = operands[0];
5258 xoperands[2] = operands[1];
5260 return mips_fill_delay_slot (\"c.le.s\\t%1,%0\", DELAY_FCMP, xoperands, insn);
5262 [(set_attr "type" "fcmp")
5263 (set_attr "mode" "FPSW")
5264 (set_attr "length" "1")])
5268 ;; ....................
5270 ;; UNCONDITIONAL BRANCHES
5272 ;; ....................
5274 ;; Unconditional branches.
5278 (label_ref (match_operand 0 "" "")))]
5282 if (GET_CODE (operands[0]) == REG)
5283 return \"%*j\\t%0\";
5285 return \"%*j\\t%l0\";
5287 [(set_attr "type" "jump")
5288 (set_attr "mode" "none")
5289 (set_attr "length" "1")])
5291 (define_expand "indirect_jump"
5292 [(set (pc) (match_operand 0 "register_operand" "d"))]
5298 if (operands[0]) /* eliminate unused code warnings */
5301 if (GET_CODE (dest) != REG || GET_MODE (dest) != Pmode)
5302 operands[0] = copy_to_mode_reg (Pmode, dest);
5305 emit_jump_insn (gen_indirect_jump_internal1 (operands[0]));
5307 emit_jump_insn (gen_indirect_jump_internal2 (operands[0]));
5313 (define_insn "indirect_jump_internal1"
5314 [(set (pc) (match_operand:SI 0 "register_operand" "d"))]
5317 [(set_attr "type" "jump")
5318 (set_attr "mode" "none")
5319 (set_attr "length" "1")])
5321 (define_insn "indirect_jump_internal2"
5322 [(set (pc) (match_operand:DI 0 "register_operand" "d"))]
5325 [(set_attr "type" "jump")
5326 (set_attr "mode" "none")
5327 (set_attr "length" "1")])
5329 (define_expand "tablejump"
5331 (match_operand 0 "register_operand" "d"))
5332 (use (label_ref (match_operand 1 "" "")))]
5338 if (operands[0]) /* eliminate unused code warnings */
5340 if (GET_MODE (operands[0]) != Pmode)
5344 emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
5346 emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
5352 (define_insn "tablejump_internal1"
5354 (match_operand:SI 0 "register_operand" "d"))
5355 (use (label_ref (match_operand 1 "" "")))]
5359 /* .cpadd expands to add REG,REG,$gp when pic, and nothing when not pic. */
5360 if (TARGET_ABICALLS)
5361 output_asm_insn (\".cpadd\\t%0\", operands);
5362 return \"%*j\\t%0\";
5364 [(set_attr "type" "jump")
5365 (set_attr "mode" "none")
5366 (set (attr "length")
5367 (if_then_else (eq_attr "abicalls" "yes")
5371 (define_insn "tablejump_internal2"
5373 (match_operand:DI 0 "register_operand" "d"))
5374 (use (label_ref (match_operand 1 "" "")))]
5378 /* .cpdadd expands to dadd REG,REG,$gp when pic, and nothing when not pic. */
5379 if (TARGET_ABICALLS)
5380 output_asm_insn (\".cpdadd\\t%0\", operands);
5381 return \"%*j\\t%0\";
5383 [(set_attr "type" "jump")
5384 (set_attr "mode" "none")
5385 (set (attr "length")
5386 (if_then_else (eq_attr "abicalls" "yes")
5390 ;; Function return, only allow after optimization, so that we can
5391 ;; eliminate jumps to jumps if no stack space is used.
5393 ;; (define_expand "return"
5394 ;; [(set (pc) (reg:SI 31))]
5395 ;; "simple_epilogue_p ()"
5398 (define_expand "return"
5399 [(parallel [(return)
5400 (use (reg:SI 31))])]
5401 "simple_epilogue_p ()"
5404 (define_insn "return_internal"
5405 [(parallel [(return)
5406 (use (match_operand:SI 0 "register_operand" "d"))])]
5409 [(set_attr "type" "jump")
5410 (set_attr "mode" "none")
5411 (set_attr "length" "1")])
5415 ;; ....................
5417 ;; Function prologue/epilogue
5419 ;; ....................
5422 (define_expand "prologue"
5427 if (mips_isa >= 0) /* avoid unused code warnings */
5429 mips_expand_prologue ();
5434 ;; Block any insns from being moved before this point, since the
5435 ;; profiling call to mcount can use various registers that aren't
5436 ;; saved or used to pass arguments.
5438 (define_insn "blockage"
5439 [(unspec_volatile [(const_int 0)] 0)]
5442 [(set_attr "type" "unknown")
5443 (set_attr "mode" "none")
5444 (set_attr "length" "0")])
5446 ;; At present, don't expand the epilogue, reorg.c will clobber the
5447 ;; return register in compiling gen_lowpart (emit-rtl.c).
5449 ;; (define_expand "epilogue"
5454 ;; if (mips_isa >= 0) /* avoid unused code warnings */
5456 ;; mips_expand_epilogue ();
5463 ;; ....................
5467 ;; ....................
5469 ;; calls.c now passes a third argument, make saber happy
5471 (define_expand "call"
5472 [(parallel [(call (match_operand 0 "memory_operand" "m")
5473 (match_operand 1 "" "i"))
5474 (clobber (reg:SI 31))
5475 (use (match_operand 2 "" "")) ;; next_arg_reg
5476 (use (match_operand 3 "" ""))])] ;; struct_value_size_rtx
5482 if (operands[0]) /* eliminate unused code warnings */
5484 addr = XEXP (operands[0], 0);
5485 if ((GET_CODE (addr) != REG && (!CONSTANT_ADDRESS_P (addr) || TARGET_LONG_CALLS))
5486 || ! call_insn_operand (operands[0], VOIDmode))
5487 XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, addr);
5489 /* In order to pass small structures by value in registers
5490 compatibly with the MIPS compiler, we need to shift the value
5491 into the high part of the register. Function_arg has encoded
5492 a PARALLEL rtx, holding a vector of adjustments to be made
5493 as the next_arg_reg variable, so we split up the insns,
5494 and emit them separately. */
5496 if (operands[2] != (rtx)0 && GET_CODE (operands[2]) == PARALLEL)
5498 rtvec adjust = XVEC (operands[2], 0);
5499 int num = GET_NUM_ELEM (adjust);
5502 for (i = 0; i < num; i++)
5503 emit_insn (RTVEC_ELT (adjust, i));
5506 emit_call_insn (gen_call_internal1 (operands[0], operands[1],
5507 gen_rtx (REG, SImode, GP_REG_FIRST + 31)));
5512 (define_insn "call_internal1"
5513 [(call (match_operand 0 "call_insn_operand" "m")
5514 (match_operand 1 "" "i"))
5515 (clobber (match_operand:SI 2 "register_operand" "=d"))]
5516 "!TARGET_ABICALLS && !TARGET_LONG_CALLS"
5519 register rtx target = XEXP (operands[0], 0);
5521 if (GET_CODE (target) == SYMBOL_REF)
5522 return \"%*jal\\t%0\";
5524 else if (GET_CODE (target) == CONST_INT)
5526 operands[0] = target;
5527 return \"%*%[li\\t%@,%0\\n\\tjal\\t%2,%@%]\";
5532 operands[0] = target;
5533 return \"%*jal\\t%2,%0\";
5536 [(set_attr "type" "call")
5537 (set_attr "mode" "none")
5538 (set_attr "length" "1")])
5540 (define_insn "call_internal2"
5541 [(call (match_operand 0 "call_insn_operand" "m")
5542 (match_operand 1 "" "i"))
5543 (clobber (match_operand:SI 2 "register_operand" "=d"))]
5544 "TARGET_ABICALLS && !TARGET_LONG_CALLS"
5547 register rtx target = XEXP (operands[0], 0);
5549 if (GET_CODE (target) == SYMBOL_REF)
5550 return \"jal\\t%0\";
5552 else if (GET_CODE (target) == CONST_INT)
5554 operands[0] = target;
5555 return \"li\\t%^,%0\\n\\tjal\\t%2,%^\";
5560 operands[0] = target;
5561 if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
5562 return \"move\\t%^,%0\\n\\tjal\\t%2,%^\";
5564 return \"jal\\t%2,%0\";
5567 [(set_attr "type" "call")
5568 (set_attr "mode" "none")
5569 (set_attr "length" "2")])
5571 (define_insn "call_internal3a"
5572 [(call (mem:SI (match_operand:SI 0 "register_operand" "r"))
5573 (match_operand 1 "" "i"))
5574 (clobber (match_operand:SI 2 "register_operand" "=d"))]
5575 "!TARGET_LONG64 && !TARGET_ABICALLS && TARGET_LONG_CALLS"
5577 [(set_attr "type" "call")
5578 (set_attr "mode" "none")
5579 (set_attr "length" "1")])
5581 (define_insn "call_internal3b"
5582 [(call (mem:DI (match_operand:DI 0 "register_operand" "r"))
5583 (match_operand 1 "" "i"))
5584 (clobber (match_operand:SI 2 "register_operand" "=d"))]
5585 "TARGET_LONG64 && !TARGET_ABICALLS && TARGET_LONG_CALLS"
5587 [(set_attr "type" "call")
5588 (set_attr "mode" "none")
5589 (set_attr "length" "1")])
5591 (define_insn "call_internal4a"
5592 [(call (mem:SI (match_operand:SI 0 "register_operand" "r"))
5593 (match_operand 1 "" "i"))
5594 (clobber (match_operand:SI 2 "register_operand" "=d"))]
5595 "!TARGET_LONG64 && TARGET_ABICALLS && TARGET_LONG_CALLS"
5598 if (REGNO (operands[0]) != PIC_FUNCTION_ADDR_REGNUM)
5599 return \"move\\t%^,%0\\n\\tjal\\t%2,%^\";
5601 return \"jal\\t%2,%0\";
5603 [(set_attr "type" "call")
5604 (set_attr "mode" "none")
5605 (set_attr "length" "2")])
5607 (define_insn "call_internal4b"
5608 [(call (mem:DI (match_operand:DI 0 "register_operand" "r"))
5609 (match_operand 1 "" "i"))
5610 (clobber (match_operand:SI 2 "register_operand" "=d"))]
5611 "TARGET_LONG64 && TARGET_ABICALLS && TARGET_LONG_CALLS"
5614 if (REGNO (operands[0]) != PIC_FUNCTION_ADDR_REGNUM)
5615 return \"move\\t%^,%0\\n\\tjal\\t%2,%^\";
5617 return \"jal\\t%2,%0\";
5619 [(set_attr "type" "call")
5620 (set_attr "mode" "none")
5621 (set_attr "length" "2")])
5623 ;; calls.c now passes a fourth argument, make saber happy
5625 (define_expand "call_value"
5626 [(parallel [(set (match_operand 0 "register_operand" "=df")
5627 (call (match_operand 1 "memory_operand" "m")
5628 (match_operand 2 "" "i")))
5629 (clobber (reg:SI 31))
5630 (use (match_operand 3 "" ""))])] ;; next_arg_reg
5636 if (operands[0]) /* eliminate unused code warning */
5638 addr = XEXP (operands[1], 0);
5639 if ((GET_CODE (addr) != REG && (!CONSTANT_ADDRESS_P (addr) || TARGET_LONG_CALLS))
5640 || ! call_insn_operand (operands[1], VOIDmode))
5641 XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, addr);
5643 /* In order to pass small structures by value in registers
5644 compatibly with the MIPS compiler, we need to shift the value
5645 into the high part of the register. Function_arg has encoded
5646 a PARALLEL rtx, holding a vector of adjustments to be made
5647 as the next_arg_reg variable, so we split up the insns,
5648 and emit them separately. */
5650 if (operands[3] != (rtx)0 && GET_CODE (operands[3]) == PARALLEL)
5652 rtvec adjust = XVEC (operands[3], 0);
5653 int num = GET_NUM_ELEM (adjust);
5656 for (i = 0; i < num; i++)
5657 emit_insn (RTVEC_ELT (adjust, i));
5660 emit_call_insn (gen_call_value_internal1 (operands[0], operands[1], operands[2],
5661 gen_rtx (REG, SImode, GP_REG_FIRST + 31)));
5668 (define_insn "call_value_internal1"
5669 [(set (match_operand 0 "register_operand" "=df")
5670 (call (match_operand 1 "call_insn_operand" "m")
5671 (match_operand 2 "" "i")))
5672 (clobber (match_operand:SI 3 "register_operand" "=d"))]
5673 "!TARGET_ABICALLS && !TARGET_LONG_CALLS"
5676 register rtx target = XEXP (operands[1], 0);
5678 if (GET_CODE (target) == SYMBOL_REF)
5679 return \"%*jal\\t%1\";
5681 else if (GET_CODE (target) == CONST_INT)
5683 operands[1] = target;
5684 return \"%*%[li\\t%@,%1\\n\\tjal\\t%3,%@%]\";
5689 operands[1] = target;
5690 return \"%*jal\\t%3,%1\";
5693 [(set_attr "type" "call")
5694 (set_attr "mode" "none")
5695 (set_attr "length" "1")])
5697 (define_insn "call_value_internal2"
5698 [(set (match_operand 0 "register_operand" "=df")
5699 (call (match_operand 1 "call_insn_operand" "m")
5700 (match_operand 2 "" "i")))
5701 (clobber (match_operand:SI 3 "register_operand" "=d"))]
5702 "TARGET_ABICALLS && !TARGET_LONG_CALLS"
5705 register rtx target = XEXP (operands[1], 0);
5707 if (GET_CODE (target) == SYMBOL_REF)
5708 return \"jal\\t%1\";
5710 else if (GET_CODE (target) == CONST_INT)
5712 operands[1] = target;
5713 return \"li\\t%^,%1\\n\\tjal\\t%3,%^\";
5718 operands[1] = target;
5719 if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
5720 return \"move\\t%^,%1\\n\\tjal\\t%3,%^\";
5722 return \"jal\\t%3,%1\";
5725 [(set_attr "type" "call")
5726 (set_attr "mode" "none")
5727 (set_attr "length" "2")])
5729 (define_insn "call_value_internal3a"
5730 [(set (match_operand 0 "register_operand" "=df")
5731 (call (mem:SI (match_operand:SI 1 "register_operand" "r"))
5732 (match_operand 2 "" "i")))
5733 (clobber (match_operand:SI 3 "register_operand" "=d"))]
5734 "!TARGET_LONG64 && !TARGET_ABICALLS && TARGET_LONG_CALLS"
5736 [(set_attr "type" "call")
5737 (set_attr "mode" "none")
5738 (set_attr "length" "1")])
5740 (define_insn "call_value_internal3b"
5741 [(set (match_operand 0 "register_operand" "=df")
5742 (call (mem:DI (match_operand:DI 1 "register_operand" "r"))
5743 (match_operand 2 "" "i")))
5744 (clobber (match_operand:SI 3 "register_operand" "=d"))]
5745 "TARGET_LONG64 && !TARGET_ABICALLS && TARGET_LONG_CALLS"
5747 [(set_attr "type" "call")
5748 (set_attr "mode" "none")
5749 (set_attr "length" "1")])
5751 (define_insn "call_value_internal4a"
5752 [(set (match_operand 0 "register_operand" "=df")
5753 (call (mem:SI (match_operand:SI 1 "register_operand" "r"))
5754 (match_operand 2 "" "i")))
5755 (clobber (match_operand:SI 3 "register_operand" "=d"))]
5756 "!TARGET_LONG64 && TARGET_ABICALLS && TARGET_LONG_CALLS"
5759 if (REGNO (operands[1]) != PIC_FUNCTION_ADDR_REGNUM)
5760 return \"move\\t%^,%1\\n\\tjal\\t%3,%^\";
5762 return \"jal\\t%3,%1\";
5764 [(set_attr "type" "call")
5765 (set_attr "mode" "none")
5766 (set_attr "length" "2")])
5768 (define_insn "call_value_internal4b"
5769 [(set (match_operand 0 "register_operand" "=df")
5770 (call (mem:DI (match_operand:DI 1 "register_operand" "r"))
5771 (match_operand 2 "" "i")))
5772 (clobber (match_operand:SI 3 "register_operand" "=d"))]
5773 "TARGET_LONG64 && TARGET_ABICALLS && TARGET_LONG_CALLS"
5776 if (REGNO (operands[1]) != PIC_FUNCTION_ADDR_REGNUM)
5777 return \"move\\t%^,%1\\n\\tjal\\t%3,%^\";
5779 return \"jal\\t%3,%1\";
5781 [(set_attr "type" "call")
5782 (set_attr "mode" "none")
5783 (set_attr "length" "2")])
5785 ;; Call subroutine returning any type.
5787 (define_expand "untyped_call"
5788 [(parallel [(call (match_operand 0 "" "")
5790 (match_operand 1 "" "")
5791 (match_operand 2 "" "")])]
5795 if (operands[0]) /* silence statement not reached warnings */
5799 emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx));
5801 for (i = 0; i < XVECLEN (operands[2], 0); i++)
5803 rtx set = XVECEXP (operands[2], 0, i);
5804 emit_move_insn (SET_DEST (set), SET_SRC (set));
5807 emit_insn (gen_blockage ());
5813 ;; ....................
5817 ;; ....................
5824 [(set_attr "type" "nop")
5825 (set_attr "mode" "none")
5826 (set_attr "length" "1")])
5828 (define_expand "probe"
5834 operands[0] = gen_reg_rtx (SImode);
5835 operands[1] = gen_rtx (MEM, SImode, stack_pointer_rtx);
5836 MEM_VOLATILE_P (operands[1]) = TRUE;
5838 /* fall through and generate default code */