1 ;; Machine description for Visium.
2 ;; Copyright (C) 2002-2016 Free Software Foundation, Inc.
3 ;; Contributed by C.Nettleton, J.P.Parkes and P.Garbett.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 ;; License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>.
22 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24 ;; Extra register constraints are:
25 ;; 'b' EAM register mdb
26 ;; 'c' EAM register mdc
27 ;; 'f' Floating-point register
28 ;; 'k' Register that can be used as the target of a sibcall, i.e. call-used
29 ;; general register not clobbered in the epilogue: r1-r8 and r10
30 ;; 'l' Low general register, i.e. general register accessible in user mode
31 ;; on the GR6 and, consequently, that can be used as the target of a
32 ;; branch with prediction: r1-r28
37 ;; Immediate integer operand constraints are:
38 ;; 'J' 0 .. 65535 (16-bit immediate)
39 ;; 'K' 1 .. 31 (5-bit immediate)
40 ;; 'L' -1 .. -65535 (16-bit negative immediate)
42 ;; 'O' 0 (integer zero)
43 ;; 'P' 32 (thirty two)
45 ;; Immediate FP operand constraints are:
46 ;; 'G' 0.0 (floating-point zero)
48 ;; Operand substitution characters are:
49 ;; %# delay slot follows, if empty, fill with NOP
50 ;; %b LS 8 bits of immediate operand
51 ;; %w LS 16 bits of immediate operand
52 ;; %u MS 16 bits of immediate operand
53 ;; %r register or zero (r0)
54 ;; %f FP register or zero (f0)
55 ;; %d second register in a pair
57 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77 (define_c_enum "unspec" [
86 ;; UNSPEC_VOLATILE usage.
87 (define_c_enum "unspecv" [
92 (include "predicates.md")
93 (include "constraints.md")
96 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
100 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
105 ;imm_reg Move of immediate value to register.
106 ;mem_reg Move from memory to register.
107 ;eam_reg Move from EAM to register.
108 ;fp_reg Move from FPU to register.
109 ;reg_mem Move from register to memory.
110 ;reg_eam Move from register to EAM.
111 ;reg_fp Move from register to FPU.
112 ;arith Arithmetic operation, result in register, sets overflow.
113 ;arith2 Two successive arithmetic operations.
114 ;logic Logical operation, result in register, does not set overflow.
115 ;abs_branch Absolute branch.
118 ;call Call to subprogram.
119 ;ret Return from subprogram.
120 ;rfi Return from interrupt.
121 ;dsi Disable interrupts.
122 ;cmp Compare or test.
123 ;div EAM 32/32 division.
124 ;divd EAM 64/32 division.
125 ;mul EAM 32 * 32 -> 64 multiplication.
126 ;shiftdi EAM 64 bit shift.
127 ;fdiv Floating point divide.
128 ;fsqrt Floating point square root.
129 ;ftoi Fix float to integer.
131 ;fmove Floating point move w/ or w/o change of sign: fmove, fabs, fneg.
132 ;fcmp Floating point compare or test.
133 ;fp Other floating point operations.
135 ;multi Multiple instructions which split.
136 ;asm User asm instructions.
139 "imm_reg,mem_reg,eam_reg,fp_reg,reg_mem,reg_eam,reg_fp,arith,arith2,logic,abs_branch,branch,bmi,call,ret,rfi,dsi,cmp,div,divd,mul,shiftdi,fdiv,fsqrt,ftoi,itof,fmove,fcmp,fp,nop,multi,asm" (const_string "logic"))
141 ; Those insns that occupy 4 bytes.
142 (define_attr "single_insn" "no,yes"
143 (if_then_else (eq_attr "type" "arith2,rfi,multi")
145 (const_string "yes")))
147 ; True if branch or call will be emitting a nop into its delay slot.
148 (define_attr "empty_delay_slot" "false,true"
149 (symbol_ref "(empty_delay_slot (insn)
150 ? EMPTY_DELAY_SLOT_TRUE : EMPTY_DELAY_SLOT_FALSE)"))
153 ; The allowed range for the offset of short branches is [-131072;131068]
154 ; and it is counted from the address of the insn so we need to subtract
155 ; 8 for forward branches because (pc) points to the next insn for them.
156 (define_attr "length" ""
157 (cond [(eq_attr "type" "abs_branch,call,ret")
158 (if_then_else (eq_attr "empty_delay_slot" "true")
161 (eq_attr "type" "branch")
162 (if_then_else (leu (plus (minus (match_dup 0) (pc))
165 (if_then_else (eq_attr "empty_delay_slot" "true")
169 (eq_attr "single_insn" "no")
170 (const_int 8)] (const_int 4)))
172 (define_asm_attributes [(set_attr "type" "asm")])
175 (define_delay (eq_attr "type" "abs_branch,branch,call,ret")
176 [(and (eq_attr "type" "!abs_branch,branch,call,ret,rfi,bmi,mul,div,divd,fdiv,fsqrt,asm")
177 (eq_attr "single_insn" "yes"))
181 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
183 ;; Processor pipeline description.
185 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188 ; Attribute for cpu type.
189 ; These must match the values for enum processor_type in visium-opts.h.
190 (define_attr "cpu" "gr5,gr6" (const (symbol_ref "visium_cpu_attr")))
196 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
200 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
203 (define_mode_iterator QHI [QI HI])
204 (define_mode_iterator I [QI HI SI])
205 (define_mode_attr s [(QI ".b") (HI ".w") (SI ".l")])
207 ; This code iterator allows signed and unsigned widening multiplications
208 ; to use the same template.
209 (define_code_iterator any_extend [sign_extend zero_extend])
211 ; <u> expands to an empty string when doing a signed operation and
212 ; "u" when doing an unsigned operation.
213 (define_code_attr u [(sign_extend "") (zero_extend "u")])
215 ; <su> is like <u>, but the signed form expands to "s" rather than "".
216 (define_code_attr su [(sign_extend "s") (zero_extend "u")])
218 ; This code iterator allows returns and simple returns to use the same template.
219 (define_code_iterator any_return [return simple_return])
220 (define_code_attr return_pred [(return "visium_can_use_return_insn_p ()")
221 (simple_return "!visium_interrupt_function_p ()")])
222 (define_code_attr return_str [(return "") (simple_return "simple_")])
224 ; This code iterator allows integer and FP cstores to use the same template.
225 (define_code_iterator any_scc [ltu lt])
226 (define_code_attr scc_str [(ltu "sltu") (lt "slt")])
228 ;This code iterator allows cstore splitters to use the same template.
229 (define_code_iterator any_add [plus minus])
230 (define_code_attr add_op [(plus "PLUS") (minus "MINUS")])
231 (define_code_attr add_str [(plus "plus") (minus "minus")])
234 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
238 ;; They are used to define the second instruction of the pairs required by
239 ;; the postreload compare elimination pass, with a first variant for the
240 ;; logical insns and a second variant for the arithmetic insns.
242 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
245 (define_subst "flags_subst_logic"
246 [(set (match_operand 0 "") (match_operand 1 ""))
247 (clobber (reg:CC R_FLAGS))]
249 [(set (match_dup 0) (match_dup 1))
250 (set (reg:CC R_FLAGS)
251 (compare:CC (match_dup 1) (const_int 0)))])
253 (define_subst_attr "subst_logic" "flags_subst_logic" "_flags" "_set_flags")
255 (define_subst "flags_subst_arith"
256 [(set (match_operand 0 "") (match_operand 1 ""))
257 (clobber (reg:CC R_FLAGS))]
259 [(set (match_dup 0) (match_dup 1))
260 (set (reg:CC_NOOV R_FLAGS)
261 (compare:CC_NOOV (match_dup 1) (const_int 0)))])
263 (define_subst_attr "subst_arith" "flags_subst_arith" "_flags" "_set_flags")
266 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
270 ;; For moving among registers we use the move.b instruction. This is
271 ;; actually an OR instruction using an alias. For moving between register
272 ;; and memory we need the address of the memory location in a register.
273 ;; However, we can accept an expression (reg + offset) where offset is in
274 ;; the range 0 .. 31.
276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
279 (define_expand "movqi"
280 [(set (match_operand:QI 0 "nonimmediate_operand" "")
281 (match_operand:QI 1 "general_operand" ""))]
284 prepare_move_operands (operands, QImode);
287 (define_insn "*movqi_insn"
288 [(set (match_operand:QI 0 "nonimmediate_operand" "=r, m,?b,?c, r, r,r,r")
289 (match_operand:QI 1 "general_operand" " r,rO, r, r,?b,?c,i,m"))]
290 "ok_for_simple_move_operands (operands, QImode)"
294 writemd %1,r0 ;movqi ?b r
295 writemdc %1 ;movqi ?c r
296 readmda %0 ;movqi r ?b
297 readmdc %0 ;movqi r ?c
298 moviq %0,%b1 ;movqi r i
300 [(set_attr "type" "logic,reg_mem,reg_eam,reg_eam,eam_reg,eam_reg,imm_reg,mem_reg")])
302 (define_insn "*movqi_insn<subst_logic>"
303 [(set (match_operand:QI 0 "gpc_reg_operand" "=r")
304 (match_operand:QI 1 "gpc_reg_operand" "r"))
305 (clobber (reg:CC R_FLAGS))]
308 [(set_attr "type" "logic")])
311 [(set (match_operand:QI 0 "gpc_reg_operand" "")
312 (match_operand:QI 1 "gpc_reg_operand" ""))]
314 [(parallel [(set (match_dup 0) (match_dup 1))
315 (clobber (reg:CC R_FLAGS))])]
318 (define_expand "movstrictqi"
319 [(set (strict_low_part (match_operand:QI 0 "register_operand" ""))
320 (match_operand:QI 1 "general_operand" ""))]
323 (define_insn "*movstrictqi_insn"
324 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r,r"))
325 (match_operand:QI 1 "general_operand" "rO,m"))]
326 "ok_for_simple_move_strict_operands (operands, QImode)"
330 [(set_attr "type" "logic,mem_reg")])
332 (define_insn "*movstrictqi_insn<subst_logic>"
333 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r"))
334 (match_operand:QI 1 "reg_or_0_operand" "rO"))
335 (clobber (reg:CC R_FLAGS))]
338 [(set_attr "type" "logic")])
341 [(set (strict_low_part (match_operand:QI 0 "register_operand" ""))
342 (match_operand:QI 1 "reg_or_0_operand" ""))]
344 [(parallel [(set (strict_low_part (match_dup 0)) (match_dup 1))
345 (clobber (reg:CC R_FLAGS))])]
349 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
353 ;; For moving among registers we use the move.w instruction. This is
354 ;; actually an OR instruction using an alias. For moving between register
355 ;; and memory we need the address of the memory location in a register.
356 ;; However, we can accept an expression (reg + offset) where offset is in
357 ;; the range 0 .. 62 and is shifted right one place in the assembled
360 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
363 (define_expand "movhi"
364 [(set (match_operand:HI 0 "nonimmediate_operand" "")
365 (match_operand:HI 1 "general_operand" ""))]
368 prepare_move_operands (operands, HImode);
371 (define_insn "*movhi_insn"
372 [(set (match_operand:HI 0 "nonimmediate_operand" "=r, m,?b,?c, r, r,r,r")
373 (match_operand:HI 1 "general_operand" " r,rO, r, r,?b,?c,i,m"))]
374 "ok_for_simple_move_operands (operands, HImode)"
378 writemd %1,r0 ;movhi ?b r
379 writemdc %1 ;movhi ?c r
380 readmda %0 ;movhi r ?b
381 readmdc %0 ;movhi r ?c
382 moviq %0,%w1 ;movhi r i
384 [(set_attr "type" "logic,reg_mem,reg_eam,reg_eam,eam_reg,eam_reg,imm_reg,mem_reg")])
386 (define_insn "*movhi_insn<subst_logic>"
387 [(set (match_operand:HI 0 "gpc_reg_operand" "=r")
388 (match_operand:HI 1 "gpc_reg_operand" "r"))
389 (clobber (reg:CC R_FLAGS))]
392 [(set_attr "type" "logic")])
395 [(set (match_operand:HI 0 "gpc_reg_operand" "")
396 (match_operand:HI 1 "gpc_reg_operand" ""))]
398 [(parallel [(set (match_dup 0) (match_dup 1))
399 (clobber (reg:CC R_FLAGS))])]
402 (define_expand "movstricthi"
403 [(set (strict_low_part (match_operand:HI 0 "register_operand" ""))
404 (match_operand:HI 1 "general_operand" ""))]
407 (define_insn "*movstricthi_insn"
408 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r,r,r"))
409 (match_operand:HI 1 "general_operand" " r,i,m"))]
410 "ok_for_simple_move_strict_operands (operands, HImode)"
415 [(set_attr "type" "logic,imm_reg,mem_reg")])
417 (define_insn "*movstricthi_insn<subst_logic>"
418 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r"))
419 (match_operand:HI 1 "register_operand" "r"))
420 (clobber (reg:CC R_FLAGS))]
423 [(set_attr "type" "logic")])
426 [(set (strict_low_part (match_operand:HI 0 "register_operand" ""))
427 (match_operand:HI 1 "register_operand" ""))]
429 [(parallel [(set (strict_low_part (match_dup 0)) (match_dup 1))
430 (clobber (reg:CC R_FLAGS))])]
434 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
438 ;; For moving among registers we use the move.l instruction. This is
439 ;; actually an OR instruction using an alias. For moving between register
440 ;; and memory we need the address of the memory location in a register.
441 ;; However, we can accept an expression (reg + offset) where offset is in
442 ;; the range 0 .. 124 and is shifted right two places in the assembled
445 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
448 (define_expand "movsi"
449 [(set (match_operand:SI 0 "nonimmediate_operand" "")
450 (match_operand:SI 1 "general_operand" ""))]
453 prepare_move_operands (operands, SImode);
456 (define_insn "*movsi_high"
457 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
458 (high:SI (match_operand:SI 1 "immediate_operand" "n,i")) )]
463 [(set_attr "type" "imm_reg")])
465 ; We only care about the lower 16 bits of the constant
466 ; being inserted into the upper 16 bits of the register.
467 (define_insn "*moviu"
468 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
471 (match_operand:SI 1 "const_int_operand" "n"))]
474 [(set_attr "type" "imm_reg")])
476 (define_insn "*movsi_losum"
477 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
478 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
479 (match_operand:SI 2 "immediate_operand" "n,i")))]
484 [(set_attr "type" "imm_reg")])
486 (define_insn "*movil"
487 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
490 (match_operand:SI 1 "const_int_operand" "n"))]
493 [(set_attr "type" "imm_reg")])
495 (define_insn "*movsi_insn_no_ieee"
496 [(set (match_operand:SI 0 "nonimmediate_operand" "=r, m,?b,?c, r, r,r,r,r,r, r,!f")
497 (match_operand:SI 1 "general_operand" " r,rO, r, r,?b,?c,J,M,i,m,!f, r"))]
498 "!TARGET_FPU_IEEE && ok_for_simple_move_operands (operands, SImode)"
502 writemd %1,r0 ;movsi ?b r
503 writemdc %1 ;movsi ?c r
504 readmda %0 ;movsi r ?b
505 readmdc %0 ;movsi r ?c
506 moviq %0,%1 ;movsi r J
512 [(set_attr "type" "logic,reg_mem,reg_eam,reg_eam,eam_reg,eam_reg,imm_reg,logic,multi,mem_reg,fp_reg,reg_fp")])
514 (define_insn "*movsi_insn"
515 [(set (match_operand:SI 0 "nonimmediate_operand" "=r, m,?b,?c, r, r,r,r,r,r, r,?f,f")
516 (match_operand:SI 1 "general_operand" " r,rO, r, r,?b,?c,J,M,i,m,?f, r,f"))]
517 "TARGET_FPU_IEEE && ok_for_simple_move_operands (operands, SImode)"
521 writemd %1,r0 ;movsi ?b r
522 writemdc %1 ;movsi ?c r
523 readmda %0 ;movsi r ?b
524 readmdc %0 ;movsi r ?c
525 moviq %0,%1 ;movsi r J
532 [(set_attr "type" "logic,reg_mem,reg_eam,reg_eam,eam_reg,eam_reg,imm_reg,logic,multi,mem_reg,fp_reg,reg_fp,fmove")])
534 (define_insn "*movsi_insn<subst_logic>"
535 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
536 (match_operand:SI 1 "gpc_reg_operand" "r"))
537 (clobber (reg:CC R_FLAGS))]
540 [(set_attr "type" "logic")])
542 (define_insn "*movsi_insn_m1<subst_logic>"
543 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
545 (clobber (reg:CC R_FLAGS))]
548 [(set_attr "type" "logic")])
551 [(set (match_operand:SI 0 "gpc_reg_operand" "")
552 (match_operand:SI 1 "gpc_reg_operand" ""))]
554 [(parallel [(set (match_dup 0) (match_dup 1))
555 (clobber (reg:CC R_FLAGS))])]
559 [(set (match_operand:SI 0 "gpc_reg_operand" "")
562 [(parallel [(set (match_dup 0) (const_int -1))
563 (clobber (reg:CC R_FLAGS))])]
566 (define_insn "*movsi_mdbhi"
567 [(set (match_operand:SI 0 "register_operand" "=r")
568 (unspec:SI [(reg:DI R_MDB)] UNSPEC_MDBHI))]
571 [(set_attr "type" "eam_reg")])
574 [(set (match_operand:SI 0 "gpc_reg_operand" "")
575 (match_operand:SI 1 "large_immediate_operand" ""))]
578 (high:SI (match_dup 1)) )
580 (lo_sum:SI (match_dup 0) (match_dup 1)))]
584 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
588 ;; When the destination is the EAM register MDB, then we use the writemd
589 ;; instruction. In all other cases we split the move into two 32-bit moves.
591 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
594 (define_expand "movdi"
595 [(set (match_operand:DI 0 "nonimmediate_operand" "")
596 (match_operand:DI 1 "general_operand" ""))]
599 prepare_move_operands (operands, DImode);
602 (define_insn "*movdi_insn"
603 [(set (match_operand:DI 0 "nonimmediate_operand" "= r, m, r,??b")
604 (match_operand:DI 1 "general_operand" "rim,rO,?b, r"))]
605 "ok_for_simple_move_operands (operands, DImode)"
610 writemd %d1,%1 ;movdi ?b r"
611 [(set_attr "type" "multi,multi,multi,reg_eam")])
614 [(set (match_operand:DI 0 "gpc_reg_operand" "") (reg:DI R_MDB))]
616 [(set (match_dup 1) (unspec:SI [(reg:DI R_MDB)] UNSPEC_MDBHI))
617 (set (match_dup 2) (reg:SI R_MDB))]
619 operands[1] = operand_subword (operands[0], 0, 1, DImode);
620 operands[2] = operand_subword (operands[0], 1, 1, DImode);
624 [(set (match_operand:DI 0 "non_eam_dst_operand" "")
625 (match_operand:DI 1 "non_eam_src_operand" ""))]
627 [(set (match_dup 2) (match_dup 3))
628 (set (match_dup 4) (match_dup 5))]
630 split_double_move (operands, DImode);
634 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
638 ;; Constants are constructed in a GP register and moved to the FP register.
640 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
643 (define_expand "movsf"
644 [(set (match_operand:SF 0 "nonimmediate_operand" "")
645 (match_operand:SF 1 "general_operand" ""))]
648 prepare_move_operands (operands, SFmode);
651 (define_insn "*movsf_insn"
652 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,r,r, m,r,r,r")
653 (match_operand:SF 1 "general_operand" " f,G,r,f,r,rG,G,F,m"))]
654 "ok_for_simple_move_operands (operands, SFmode)"
665 [(set_attr "type" "fmove,fmove,reg_fp,fp_reg,logic,reg_mem,imm_reg,multi,mem_reg")])
667 (define_insn "*movsf_insn"
668 [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
669 (match_operand:SF 1 "gpc_reg_operand" "r"))
670 (clobber (reg:CC R_FLAGS))]
673 [(set_attr "type" "logic")])
676 [(set (match_operand:SF 0 "gpc_reg_operand" "")
677 (match_operand:SF 1 "gpc_reg_operand" ""))]
679 [(parallel [(set (match_dup 0) (match_dup 1))
680 (clobber (reg:CC R_FLAGS))])]
684 [(set (match_operand:SF 0 "gpc_reg_operand" "")
685 (match_operand:SF 1 "const_double_operand" ""))]
687 [(set (match_dup 2) (match_dup 3))]
691 REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (operands[1]), l);
693 operands[2] = operand_subword (operands[0], 0, 0, SFmode);
694 operands[3] = GEN_INT (trunc_int_for_mode (l, SImode));
698 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
702 ;; We always split a DFmode move into two SImode moves.
704 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
707 (define_expand "movdf"
708 [(set (match_operand:DF 0 "nonimmediate_operand" "")
709 (match_operand:DF 1 "general_operand" ""))]
712 prepare_move_operands (operands, DFmode);
715 (define_insn "*movdf_insn"
716 [(set (match_operand:DF 0 "nonimmediate_operand" "= r, m")
717 (match_operand:DF 1 "general_operand" "rFm,rG"))]
718 "ok_for_simple_move_operands (operands, DFmode)"
720 [(set_attr "type" "multi")])
723 [(set (match_operand:DF 0 "nonimmediate_operand" "")
724 (match_operand:DF 1 "general_operand" ""))]
726 [(set (match_dup 2) (match_dup 3))
727 (set (match_dup 4) (match_dup 5))]
729 split_double_move (operands, DFmode);
733 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
737 ;; Modes QI, HI, SI and DI are supported directly.
739 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
742 (define_expand "add<mode>3"
743 [(set (match_operand:QHI 0 "register_operand" "")
744 (plus:QHI (match_operand:QHI 1 "register_operand" "")
745 (match_operand:QHI 2 "register_operand" "")))]
748 (define_insn_and_split "*add<mode>3_insn"
749 [(set (match_operand:QHI 0 "register_operand" "=r")
750 (plus:QHI (match_operand:QHI 1 "register_operand" "%r")
751 (match_operand:QHI 2 "register_operand" "r")))]
752 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
755 [(parallel [(set (match_dup 0)
756 (plus:QHI (match_dup 1) (match_dup 2)))
757 (clobber (reg:CC R_FLAGS))])]
759 [(set_attr "type" "arith")])
761 (define_insn "*add<mode>3_insn<subst_arith>"
762 [(set (match_operand:QHI 0 "register_operand" "=r")
763 (plus:QHI (match_operand:QHI 1 "register_operand" "%r")
764 (match_operand:QHI 2 "register_operand" "r")))
765 (clobber (reg:CC R_FLAGS))]
768 [(set_attr "type" "arith")])
770 (define_expand "addsi3"
771 [(set (match_operand:SI 0 "register_operand" "")
772 (plus:SI (match_operand:SI 1 "register_operand" "")
773 (match_operand:SI 2 "add_operand" "")))]
776 (define_expand "addsi3_flags"
777 [(parallel [(set (match_operand:SI 0 "register_operand" "")
778 (plus:SI (match_operand:SI 1 "register_operand" "")
779 (match_operand:SI 2 "add_operand" "")))
780 (clobber (reg:CC R_FLAGS))])]
784 (define_insn_and_split "*addsi3_insn"
785 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
786 (plus:SI (match_operand:SI 1 "register_operand" "%0,r,0")
787 (match_operand:SI 2 "add_operand" " L,r,J")))]
788 "ok_for_simple_arith_logic_operands (operands, SImode)"
791 [(parallel [(set (match_dup 0)
792 (plus:SI (match_dup 1) (match_dup 2)))
793 (clobber (reg:CC R_FLAGS))])]
795 [(set_attr "type" "arith")])
797 ; Favour the addition of small negative constants, since they are
798 ; expensive to load into a register.
800 (define_insn "*addsi3_insn<subst_arith>"
801 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
802 (plus:SI (match_operand:SI 1 "register_operand" "%0,r,0")
803 (match_operand:SI 2 "add_operand" " L,r,J")))
804 (clobber (reg:CC R_FLAGS))]
810 [(set_attr "type" "arith")])
812 (define_expand "adddi3"
813 [(set (match_operand:DI 0 "register_operand" "")
814 (plus:DI (match_operand:DI 1 "register_operand" "")
815 (match_operand:DI 2 "add_operand" "")))]
818 (define_insn_and_split "*addi3_insn"
819 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
820 (plus:DI (match_operand:DI 1 "register_operand" "%0,0, r")
821 (match_operand:DI 2 "add_operand" " J,L, r")))]
822 "ok_for_simple_arith_logic_operands (operands, DImode)"
825 [(parallel [(set (match_dup 0)
826 (plus:DI (match_dup 1) (match_dup 2)))
827 (clobber (reg:CC R_FLAGS))])]
829 [(set_attr "type" "arith2")])
831 ; Disfavour the use of add.l because of the early clobber.
833 (define_insn "*adddi3_insn_flags"
834 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
835 (plus:DI (match_operand:DI 1 "register_operand" "%0,0, r")
836 (match_operand:DI 2 "add_operand" " J,L, r")))
837 (clobber (reg:CC R_FLAGS))]
840 addi %d0,%2\n\tadc.l %0,%0,r0
841 subi %d0,%n2\n\tsubc.l %0,%0,r0
842 add.l %d0,%d1,%d2\n\tadc.l %0,%1,%2"
843 [(set_attr "type" "arith2")])
846 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
848 ;; Integer Add with Carry
850 ;; Only SI mode is supported as slt[u] for the sake of cstore.
852 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
855 (define_insn "*<scc_str><subst_arith>"
856 [(set (match_operand:SI 0 "register_operand" "=r")
857 (any_scc:SI (reg R_FLAGS) (const_int 0)))
858 (clobber (reg:CC R_FLAGS))]
861 [(set_attr "type" "arith")])
863 (define_insn "*plus_<scc_str><subst_arith>"
864 [(set (match_operand:SI 0 "register_operand" "=r")
865 (plus:SI (match_operand:SI 1 "register_operand" "r")
866 (any_scc:SI (reg R_FLAGS) (const_int 0))))
867 (clobber (reg:CC R_FLAGS))]
870 [(set_attr "type" "arith")])
873 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
877 ;; Modes QI, HI, SI and DI are supported directly.
879 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
882 (define_expand "sub<mode>3"
883 [(set (match_operand:QHI 0 "register_operand" "")
884 (minus:QHI (match_operand:QHI 1 "reg_or_0_operand" "")
885 (match_operand:QHI 2 "register_operand" "")))]
888 (define_insn_and_split "*sub<mode>3_insn"
889 [(set (match_operand:QHI 0 "register_operand" "=r")
890 (minus:QHI (match_operand:QHI 1 "reg_or_0_operand" "rO")
891 (match_operand:QHI 2 "register_operand" "r")))]
892 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
895 [(parallel [(set (match_dup 0)
896 (minus:QHI (match_dup 1) (match_dup 2)))
897 (clobber (reg:CC R_FLAGS))])]
899 [(set_attr "type" "arith")])
901 (define_insn "*sub<mode>3_insn<subst_arith>"
902 [(set (match_operand:QHI 0 "register_operand" "=r")
903 (minus:QHI (match_operand:QHI 1 "reg_or_0_operand" "rO")
904 (match_operand:QHI 2 "register_operand" "r")))
905 (clobber (reg:CC R_FLAGS))]
908 [(set_attr "type" "arith")])
910 (define_expand "subsi3"
911 [(set (match_operand:SI 0 "register_operand" "")
912 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
913 (match_operand:SI 2 "add_operand" "")))]
916 (define_expand "subsi3_flags"
917 [(parallel [(set (match_operand:SI 0 "register_operand" "")
918 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
919 (match_operand:SI 2 "add_operand" "")))
920 (clobber (reg:CC R_FLAGS))])]
924 (define_insn_and_split "*subsi3_insn"
925 [(set (match_operand:SI 0 "register_operand" "=r,r, r")
926 (minus:SI (match_operand:SI 1 "reg_or_0_operand" " 0,rO,0")
927 (match_operand:SI 2 "add_operand" " L,r, J")))]
928 "ok_for_simple_arith_logic_operands (operands, SImode)"
931 [(parallel [(set (match_dup 0)
932 (minus:SI (match_dup 1) (match_dup 2)))
933 (clobber (reg:CC R_FLAGS))])]
935 [(set_attr "type" "arith")])
937 ; Favour the subtraction of small negative constants, since they are
938 ; expensive to load into a register.
940 (define_insn "*subsi3_insn<subst_arith>"
941 [(set (match_operand:SI 0 "register_operand" "=r,r, r")
942 (minus:SI (match_operand:SI 1 "reg_or_0_operand" " 0,rO,0")
943 (match_operand:SI 2 "add_operand" " L,r, J")))
944 (clobber (reg:CC R_FLAGS))]
950 [(set_attr "type" "arith")])
952 (define_expand "subdi3"
953 [(set (match_operand:DI 0 "register_operand" "")
954 (minus:DI (match_operand:DI 1 "register_operand" "")
955 (match_operand:DI 2 "add_operand" "")))]
958 (define_insn_and_split "*subdi3_insn"
959 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
960 (minus:DI (match_operand:DI 1 "register_operand" " 0,0, r")
961 (match_operand:DI 2 "add_operand" " J,L, r")))]
962 "ok_for_simple_arith_logic_operands (operands, DImode)"
965 [(parallel [(set (match_dup 0)
966 (minus:DI (match_dup 1) (match_dup 2)))
967 (clobber (reg:CC R_FLAGS))])]
969 [(set_attr "type" "arith2")])
971 ; Disfavour the use of the sub.l because of the early clobber.
973 (define_insn "*subdi3_insn_flags"
974 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
975 (minus:DI (match_operand:DI 1 "register_operand" " 0,0, r")
976 (match_operand:DI 2 "add_operand" " J,L, r")))
977 (clobber (reg:CC R_FLAGS))]
980 subi %d0,%2\n\tsubc.l %0,%0,r0
981 addi %d0,%n2\n\tadc.l %0,%0,r0
982 sub.l %d0,%d1,%d2\n\tsubc.l %0,%1,%2"
983 [(set_attr "type" "arith2")])
986 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
988 ;; Integer Subtract with Carry
990 ;; Only SI mode is supported as neg<slt[u]> for the sake of cstore.
992 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
995 (define_insn "*neg_<scc_str><subst_arith>"
996 [(set (match_operand:SI 0 "register_operand" "=r")
997 (neg:SI (any_scc:SI (reg R_FLAGS) (const_int 0))))
998 (clobber (reg:CC R_FLAGS))]
1001 [(set_attr "type" "arith")])
1003 (define_insn "*minus_<scc_str><subst_arith>"
1004 [(set (match_operand:SI 0 "register_operand" "=r")
1005 (minus:SI (match_operand:SI 1 "register_operand" "r")
1006 (any_scc:SI (reg R_FLAGS) (const_int 0))))
1007 (clobber (reg:CC R_FLAGS))]
1010 [(set_attr "type" "arith")])
1013 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1017 ;; Modes QI, HI, SI and DI are supported directly.
1019 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1022 (define_expand "neg<mode>2"
1023 [(set (match_operand:I 0 "register_operand" "")
1024 (neg:I (match_operand:I 1 "register_operand" "")))]
1027 (define_insn_and_split "*neg<mode>2_insn"
1028 [(set (match_operand:I 0 "register_operand" "=r")
1029 (neg:I (match_operand:I 1 "register_operand" "r")))]
1030 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1033 [(parallel [(set (match_dup 0) (neg:I (match_dup 1)))
1034 (clobber (reg:CC R_FLAGS))])]
1036 [(set_attr "type" "arith")])
1038 (define_insn "*neg<mode>2_insn<subst_arith>"
1039 [(set (match_operand:I 0 "register_operand" "=r")
1040 (neg:I (match_operand:I 1 "register_operand" "r")))
1041 (clobber (reg:CC R_FLAGS))]
1044 [(set_attr "type" "arith")])
1046 (define_expand "negdi2"
1047 [(set (match_operand:DI 0 "register_operand" "")
1048 (neg:DI (match_operand:DI 1 "register_operand" "")))]
1051 (define_insn_and_split "*negdi2_insn"
1052 [(set (match_operand:DI 0 "register_operand" "=&r")
1053 (neg:DI (match_operand:DI 1 "register_operand" "r")))]
1054 "ok_for_simple_arith_logic_operands (operands, DImode)"
1057 [(parallel [(set (match_dup 0) (neg:DI (match_dup 1)))
1058 (clobber (reg:CC R_FLAGS))])]
1060 [(set_attr "type" "arith2")])
1062 (define_insn "*negdi2_insn_flags"
1063 [(set (match_operand:DI 0 "register_operand" "=&r")
1064 (neg:DI (match_operand:DI 1 "register_operand" "r")))
1065 (clobber (reg:CC R_FLAGS))]
1067 "sub.l %d0,r0,%d1\n\tsubc.l %0,r0,%1"
1068 [(set_attr "type" "arith2")])
1071 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1073 ;; Integer Multiply (non-widening and widening, signed and unsigned)
1075 ;; Only SI mode is supported.
1077 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1080 ; The mults and multu instructions clear MDC but we only pretend that they
1081 ; clobber it to keep things relatively simple.
1083 (define_insn "mulsi3"
1084 [(set (match_operand:SI 0 "register_operand" "=b")
1085 (mult:SI (match_operand:SI 1 "register_operand" "%r")
1086 (match_operand:SI 2 "register_operand" "r")))
1087 (clobber (reg:SI R_MDC))]
1090 [(set_attr "type" "mul")])
1092 ; The names are mulsidi3 and umulsidi3 here.
1094 (define_insn "<u>mulsidi3"
1095 [(set (match_operand:DI 0 "register_operand" "=b")
1096 (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "%r"))
1097 (any_extend:DI (match_operand:SI 2 "register_operand" "r"))))
1098 (clobber (reg:SI R_MDC))]
1101 [(set_attr "type" "mul")])
1103 ; But they are smulsi3_highpart and umulsi3_highpart here.
1105 (define_insn_and_split "<su>mulsi3_highpart"
1106 [(set (match_operand:SI 0 "register_operand" "=r")
1109 (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "%r"))
1110 (any_extend:DI (match_operand:SI 2 "register_operand" "r")))
1112 (clobber (reg:DI R_MDB))
1113 (clobber (reg:SI R_MDC))]
1117 [(parallel [(set (reg:DI R_MDB)
1118 (mult:DI (any_extend:DI (match_dup 1))
1119 (any_extend:DI (match_dup 2))))
1120 (clobber (reg:SI R_MDC))])
1121 (set (match_dup 0) (unspec:SI [(reg:DI R_MDB)] UNSPEC_MDBHI))]
1123 [(set_attr "type" "multi")])
1126 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1128 ;; Integer divide and modulus (signed and unsigned)
1130 ;; Only SI mode is supported.
1132 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1135 (define_insn "*divmodsi4_insn"
1136 [(set (match_operand:SI 0 "register_operand" "=b")
1137 (div:SI (match_operand:SI 1 "register_operand" "0")
1138 (match_operand:SI 2 "register_operand" "r")))
1139 (set (reg:SI R_MDC) (mod:SI (match_dup 1) (match_dup 2)))]
1142 [(set_attr "type" "div")])
1144 (define_insn_and_split "divmodsi4"
1145 [(set (match_operand:SI 0 "register_operand" "=b")
1146 (div:SI (match_operand:SI 1 "register_operand" "0")
1147 (match_operand:SI 2 "register_operand" "r")))
1148 (set (match_operand:SI 3 "register_operand" "=r")
1149 (mod:SI (match_dup 1) (match_dup 2)))
1150 (clobber (reg:SI R_MDC))]
1154 [(parallel [(set (match_dup 0) (div:SI (match_dup 1) (match_dup 2)))
1155 (set (reg:SI R_MDC) (mod:SI (match_dup 1) (match_dup 2)))])
1156 (set (match_dup 3) (reg:SI R_MDC))]
1158 [(set_attr "type" "multi")])
1160 (define_insn "*udivmodsi4_insn"
1161 [(set (match_operand:SI 0 "register_operand" "=b")
1162 (udiv:SI (match_operand:SI 1 "register_operand" "0")
1163 (match_operand:SI 2 "register_operand" "r")))
1164 (set (reg:SI R_MDC) (umod:SI (match_dup 1) (match_dup 2)))]
1167 [(set_attr "type" "div")])
1169 (define_insn_and_split "udivmodsi4"
1170 [(set (match_operand:SI 0 "register_operand" "=b")
1171 (udiv:SI (match_operand:SI 1 "register_operand" "0")
1172 (match_operand:SI 2 "register_operand" "r")))
1173 (set (match_operand:SI 3 "register_operand" "=r")
1174 (umod:SI (match_dup 1) (match_dup 2)))
1175 (clobber (reg:SI R_MDC))]
1179 [(parallel [(set (match_dup 0) (udiv:SI (match_dup 1) (match_dup 2)))
1180 (set (reg:SI R_MDC) (umod:SI (match_dup 1) (match_dup 2)))])
1181 (set (match_dup 3) (reg:SI R_MDC))]
1183 [(set_attr "type" "multi")])
1185 ; FIXME. How do we persuade the compiler to use 64/32 bit divides directly ?
1187 (define_insn "*divds"
1188 [(set (reg:DI R_MDB)
1189 (div:DI (reg:DI R_MDB) (sign_extend:DI (match_operand:SI 0 "register_operand" "r"))))
1190 (set (reg:SI R_MDC) (truncate:SI (mod:DI (reg:DI R_MDB) (sign_extend:DI (match_dup 0)))))]
1193 [(set_attr "type" "divd")])
1195 (define_insn "*divdu"
1196 [(set (reg:DI R_MDB)
1197 (udiv:DI (reg:DI R_MDB) (zero_extend:DI (match_operand:SI 0 "register_operand" "r"))))
1198 (set (reg:SI R_MDC) (truncate:SI (umod:DI (reg:DI R_MDB) (zero_extend:DI (match_dup 0)))))]
1201 [(set_attr "type" "divd")])
1203 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1205 ;; Bitwise Logical AND
1207 ;; Modes QI, HI and SI are supported directly.
1209 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1212 (define_expand "and<mode>3"
1213 [(set (match_operand:I 0 "register_operand" "")
1214 (and:I (match_operand:I 1 "register_operand" "")
1215 (match_operand:I 2 "register_operand" "")))]
1218 (define_insn_and_split "*and<mode>3_insn"
1219 [(set (match_operand:I 0 "register_operand" "=r")
1220 (and:I (match_operand:I 1 "register_operand" "%r")
1221 (match_operand:I 2 "register_operand" "r")))]
1222 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1225 [(parallel [(set (match_dup 0)
1226 (and:I (match_dup 1) (match_dup 2)))
1227 (clobber (reg:CC R_FLAGS))])]
1229 [(set_attr "type" "logic")])
1231 (define_insn "*and<mode>3_insn<subst_logic>"
1232 [(set (match_operand:I 0 "register_operand" "=r")
1233 (and:I (match_operand:I 1 "register_operand" "%r")
1234 (match_operand:I 2 "register_operand" "r")))
1235 (clobber (reg:CC R_FLAGS))]
1238 [(set_attr "type" "logic")])
1241 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1243 ;; Bitwise Inclusive Logical OR
1245 ;; Modes QI, HI and SI are supported directly.
1247 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1250 (define_expand "ior<mode>3"
1251 [(set (match_operand:I 0 "register_operand" "")
1252 (ior:I (match_operand:I 1 "register_operand" "")
1253 (match_operand:I 2 "register_operand" "")))]
1256 (define_insn_and_split "*ior<mode>3_insn"
1257 [(set (match_operand:I 0 "register_operand" "=r")
1258 (ior:I (match_operand:I 1 "register_operand" "%r")
1259 (match_operand:I 2 "register_operand" "r")))]
1260 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1263 [(parallel [(set (match_dup 0)
1264 (ior:I (match_dup 1) (match_dup 2)))
1265 (clobber (reg:CC R_FLAGS))])]
1267 [(set_attr "type" "logic")])
1269 (define_insn "*ior<mode>3_insn<subst_logic>"
1270 [(set (match_operand:I 0 "register_operand" "=r")
1271 (ior:I (match_operand:I 1 "register_operand" "%r")
1272 (match_operand:I 2 "register_operand" "r")))
1273 (clobber (reg:CC R_FLAGS))]
1276 [(set_attr "type" "logic")])
1279 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1281 ;; Bitwise Exclusive Logical OR
1283 ;; Modes QI, HI and SI are supported directly.
1285 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1288 (define_expand "xor<mode>3"
1289 [(set (match_operand:I 0 "register_operand" "")
1290 (xor:I (match_operand:I 1 "register_operand" "")
1291 (match_operand:I 2 "register_operand" "")))]
1294 (define_insn_and_split "*xor<mode>3_insn"
1295 [(set (match_operand:I 0 "register_operand" "=r")
1296 (xor:I (match_operand:I 1 "register_operand" "%r")
1297 (match_operand:I 2 "register_operand" "r")))]
1298 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1301 [(parallel [(set (match_dup 0)
1302 (xor:I (match_dup 1) (match_dup 2)))
1303 (clobber (reg:CC R_FLAGS))])]
1305 [(set_attr "type" "logic")])
1307 (define_insn "*xor<mode>3_insn<subst_logic>"
1308 [(set (match_operand:I 0 "register_operand" "=r")
1309 (xor:I (match_operand:I 1 "register_operand" "%r")
1310 (match_operand:I 2 "register_operand" "r")))
1311 (clobber (reg:CC R_FLAGS))]
1314 [(set_attr "type" "logic")])
1317 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1319 ;; Bitwise Logical NOT
1321 ;; Modes QI, HI and SI are supported directly.
1323 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1326 (define_expand "one_cmpl<mode>2"
1327 [(set (match_operand:I 0 "register_operand" "")
1328 (not:I (match_operand:I 1 "reg_or_0_operand" "")))]
1331 (define_insn_and_split "*one_cmpl<mode>2_insn"
1332 [(set (match_operand:I 0 "register_operand" "=r")
1333 (not:I (match_operand:I 1 "reg_or_0_operand" "rO")))]
1334 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1337 [(parallel [(set (match_dup 0) (not:I (match_dup 1)))
1338 (clobber (reg:CC R_FLAGS))])]
1340 [(set_attr "type" "logic")])
1342 (define_insn "*one_cmpl<mode>2_insn<subst_logic>"
1343 [(set (match_operand:I 0 "register_operand" "=r")
1344 (not:I (match_operand:I 1 "reg_or_0_operand" "rO")))
1345 (clobber (reg:CC R_FLAGS))]
1348 [(set_attr "type" "logic")])
1351 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1353 ;; Arithmetic Shift Left
1355 ;; Modes QI, HI, SI and DI are supported directly.
1357 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1360 (define_expand "ashl<mode>3"
1361 [(set (match_operand:I 0 "register_operand" "")
1362 (ashift:I (match_operand:I 1 "register_operand" "")
1363 (match_operand:QI 2 "reg_or_shift_operand" "")))]
1366 (define_insn_and_split "*ashl<mode>3_insn"
1367 [(set (match_operand:I 0 "register_operand" "=r,r")
1368 (ashift:I (match_operand:I 1 "register_operand" "r,r")
1369 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
1370 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1373 [(parallel [(set (match_dup 0)
1374 (ashift:I (match_dup 1) (match_dup 2)))
1375 (clobber (reg:CC R_FLAGS))])]
1377 [(set_attr "type" "arith")])
1379 (define_insn "*ashl<mode>3_insn<subst_arith>"
1380 [(set (match_operand:I 0 "register_operand" "=r,r")
1381 (ashift:I (match_operand:I 1 "register_operand" "r,r")
1382 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))
1383 (clobber (reg:CC R_FLAGS))]
1386 [(set_attr "type" "arith")])
1388 (define_insn "ashldi3"
1389 [(set (match_operand:DI 0 "register_operand" "=b,r")
1390 (ashift:DI (match_operand:DI 1 "register_operand" "0,r")
1391 (match_operand:QI 2 "reg_or_32_operand" "r,P")))
1392 (clobber (reg:SI R_MDC))]
1397 [(set_attr "type" "shiftdi,multi")])
1400 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1401 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
1403 (clobber (reg:SI R_MDC))]
1405 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 4))
1406 (set (subreg:SI (match_dup 0) 4) (const_int 0))]
1410 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1412 ;; Arithmetic Shift Right
1414 ;; Modes QI, HI, SI and DI are supported directly.
1416 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1419 (define_expand "ashr<mode>3"
1420 [(set (match_operand:I 0 "register_operand" "")
1421 (ashiftrt:I (match_operand:I 1 "register_operand" "")
1422 (match_operand:QI 2 "reg_or_shift_operand" "")))]
1425 (define_insn_and_split "*ashr<mode>3_insn"
1426 [(set (match_operand:I 0 "register_operand" "=r,r")
1427 (ashiftrt:I (match_operand:I 1 "register_operand" "r,r")
1428 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
1429 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1432 [(parallel [(set (match_dup 0)
1433 (ashiftrt:I (match_dup 1) (match_dup 2)))
1434 (clobber (reg:CC R_FLAGS))])]
1436 [(set_attr "type" "logic")])
1438 (define_insn "*ashr<mode>3_insn<subst_logic>"
1439 [(set (match_operand:I 0 "register_operand" "=r,r")
1440 (ashiftrt:I (match_operand:I 1 "register_operand" "r,r")
1441 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))
1442 (clobber (reg:CC R_FLAGS))]
1445 [(set_attr "type" "logic")])
1447 (define_insn "ashrdi3"
1448 [(set (match_operand:DI 0 "register_operand" "=b,r")
1449 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,r")
1450 (match_operand:QI 2 "reg_or_32_operand" "r,P")))
1451 (clobber (reg:SI R_MDC))]
1456 [(set_attr "type" "shiftdi,multi")])
1459 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1460 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
1462 (clobber (reg:SI R_MDC))]
1464 [(set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 0))
1465 (parallel [(set (subreg:SI (match_dup 0) 0)
1466 (ashiftrt:SI (subreg:SI (match_dup 1) 0) (const_int 31)))
1467 (clobber (reg:CC R_FLAGS))])]
1471 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1473 ;; Logical Shift Right
1475 ;; Modes QI, HI, SI and DI are supported directly.
1477 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1480 (define_expand "lshr<mode>3"
1481 [(set (match_operand:I 0 "register_operand" "")
1482 (lshiftrt:I (match_operand:I 1 "register_operand" "")
1483 (match_operand:QI 2 "reg_or_shift_operand" "")))]
1486 (define_insn_and_split "*lshr<mode>3_insn"
1487 [(set (match_operand:I 0 "register_operand" "=r,r")
1488 (lshiftrt:I (match_operand:I 1 "register_operand" "r,r")
1489 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
1490 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1493 [(parallel [(set (match_dup 0)
1494 (lshiftrt:I (match_dup 1) (match_dup 2)))
1495 (clobber (reg:CC R_FLAGS))])]
1497 [(set_attr "type" "logic")])
1499 (define_insn "*lshr<mode>3_insn<subst_logic>"
1500 [(set (match_operand:I 0 "register_operand" "=r,r")
1501 (lshiftrt:I (match_operand:I 1 "register_operand" "r,r")
1502 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))
1503 (clobber (reg:CC R_FLAGS))]
1506 [(set_attr "type" "logic")])
1508 (define_insn "lshrdi3"
1509 [(set (match_operand:DI 0 "register_operand" "=b,r")
1510 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,r")
1511 (match_operand:QI 2 "reg_or_32_operand" "r,P")))
1512 (clobber (reg:SI R_MDC))]
1517 [(set_attr "type" "shiftdi,multi")])
1520 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1521 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
1523 (clobber (reg:SI R_MDC))]
1525 [(set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 0))
1526 (set (subreg:SI (match_dup 0) 0) (const_int 0))]
1530 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1534 ;; Truncations among modes QI, HI, SI and DI are supported directly.
1536 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1539 (define_expand "trunchiqi2"
1540 [(set (match_operand:QI 0 "register_operand" "")
1541 (truncate:QI (match_operand:HI 1 "register_operand" "")))]
1544 (define_insn_and_split "*trunchiqi2_insn"
1545 [(set (match_operand:QI 0 "register_operand" "=r")
1546 (truncate:QI (match_operand:HI 1 "register_operand" "r")))]
1547 "ok_for_simple_arith_logic_operands (operands, QImode)"
1550 [(parallel [(set (match_dup 0) (truncate:QI (match_dup 1)))
1551 (clobber (reg:CC R_FLAGS))])]
1553 [(set_attr "type" "logic")])
1555 (define_insn "*trunchiqi2_insn<subst_logic>"
1556 [(set (match_operand:QI 0 "register_operand" "=r")
1557 (truncate:QI (match_operand:HI 1 "register_operand" "r")))
1558 (clobber (reg:CC R_FLAGS))]
1561 [(set_attr "type" "logic")])
1563 (define_expand "truncsihi2"
1564 [(set (match_operand:HI 0 "register_operand" "")
1565 (truncate:HI (match_operand:SI 1 "register_operand" "")))]
1568 (define_insn_and_split "*truncsihi2_insn"
1569 [(set (match_operand:HI 0 "register_operand" "=r")
1570 (truncate:HI (match_operand:SI 1 "register_operand" "r")))]
1571 "ok_for_simple_arith_logic_operands (operands, HImode)"
1574 [(parallel [(set (match_dup 0) (truncate:HI (match_dup 1)))
1575 (clobber (reg:CC R_FLAGS))])]
1577 [(set_attr "type" "logic")])
1579 (define_insn "*truncsihi2_insn<subst_logic>"
1580 [(set (match_operand:HI 0 "register_operand" "=r")
1581 (truncate:HI (match_operand:SI 1 "register_operand" "r")))
1582 (clobber (reg:CC R_FLAGS))]
1585 [(set_attr "type" "logic")])
1587 (define_expand "truncdisi2"
1588 [(set (match_operand:SI 0 "register_operand" "")
1589 (truncate:SI (match_operand:DI 1 "register_operand" "")))]
1592 (define_insn_and_split "*truncdisi2_insn"
1593 [(set (match_operand:SI 0 "register_operand" "=r")
1594 (truncate:SI (match_operand:DI 1 "register_operand" "r")))]
1595 "ok_for_simple_arith_logic_operands (operands, SImode)"
1598 [(parallel [(set (match_dup 0) (truncate:SI (match_dup 1)))
1599 (clobber (reg:CC R_FLAGS))])]
1601 [(set_attr "type" "logic")])
1603 (define_insn "*truncdisi2_insn<subst_logic>"
1604 [(set (match_operand:SI 0 "register_operand" "=r")
1605 (truncate:SI (match_operand:DI 1 "register_operand" "r")))
1606 (clobber (reg:CC R_FLAGS))]
1609 [(set_attr "type" "logic")])
1612 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1616 ;; Sign-extensions among modes QI, HI, SI and DI are supported directly.
1618 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1621 (define_expand "extendqihi2"
1622 [(set (match_operand:HI 0 "register_operand" "")
1623 (sign_extend:HI (match_operand:QI 1 "register_operand" "")))]
1626 (define_insn_and_split "*extendqihi2_insn"
1627 [(set (match_operand:HI 0 "register_operand" "=r")
1628 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
1629 "ok_for_simple_arith_logic_operands (operands, HImode)"
1632 [(parallel [(set (match_dup 0) (sign_extend:HI (match_dup 1)))
1633 (clobber (reg:CC R_FLAGS))])]
1635 [(set_attr "type" "logic")])
1637 (define_insn "*extendqihi2_insn<subst_logic>"
1638 [(set (match_operand:HI 0 "register_operand" "=r")
1639 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))
1640 (clobber (reg:CC R_FLAGS))]
1643 [(set_attr "type" "logic")])
1645 (define_expand "extendqisi2"
1646 [(set (match_operand:SI 0 "register_operand" "")
1647 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
1650 (define_insn_and_split "*extendqisi2_insn"
1651 [(set (match_operand:SI 0 "register_operand" "=r")
1652 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
1653 "ok_for_simple_arith_logic_operands (operands, SImode)"
1656 [(parallel [(set (match_dup 0) (sign_extend:SI (match_dup 1)))
1657 (clobber (reg:CC R_FLAGS))])]
1659 [(set_attr "type" "logic")])
1661 (define_insn "*extendqisi2_insn<subst_logic>"
1662 [(set (match_operand:SI 0 "register_operand" "=r")
1663 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))
1664 (clobber (reg:CC R_FLAGS))]
1667 [(set_attr "type" "logic")])
1669 (define_expand "extendhisi2"
1670 [(set (match_operand:SI 0 "register_operand" "")
1671 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
1674 (define_insn_and_split "*extendhisi2_insn"
1675 [(set (match_operand:SI 0 "register_operand" "=r")
1676 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
1677 "ok_for_simple_arith_logic_operands (operands, SImode)"
1680 [(parallel [(set (match_operand:SI 0 "register_operand" "")
1681 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))
1682 (clobber (reg:CC R_FLAGS))])]
1684 [(set_attr "type" "logic")])
1686 (define_insn "*extendhisi2_insn<subst_logic>"
1687 [(set (match_operand:SI 0 "register_operand" "=r")
1688 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))
1689 (clobber (reg:CC R_FLAGS))]
1692 [(set_attr "type" "logic")])
1694 (define_expand "extendsidi2"
1695 [(set (match_operand:DI 0 "register_operand" "")
1696 (sign_extend:DI (match_operand:SI 1 "register_operand" "")))]
1699 (define_insn_and_split "*extendsidi2_insn"
1700 [(set (match_operand:DI 0 "register_operand" "=r")
1701 (sign_extend:DI (match_operand:SI 1 "register_operand" "r")))]
1702 "ok_for_simple_arith_logic_operands (operands, DImode)"
1705 [(parallel [(set (match_dup 3) (match_dup 1))
1706 (clobber (reg:CC R_FLAGS))])
1707 (parallel [(set (match_dup 2)
1708 (ashiftrt:SI (match_dup 1) (const_int 31)))
1709 (clobber (reg:CC R_FLAGS))])]
1711 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1712 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1714 [(set_attr "type" "multi")])
1717 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1721 ;; Zero-extensions among modes QI, HI, SI and DI are supported directly.
1723 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1726 ; QI is zero-extended to wider modes by shifting left and then performing
1727 ; a logical shift right to insert the zeroes. This avoids the need to use
1730 (define_expand "zero_extendqihi2"
1731 [(set (match_operand:HI 0 "register_operand" "")
1732 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
1735 (define_insn_and_split "*zero_extendqihi2_insn"
1736 [(set (match_operand:HI 0 "register_operand" "=r")
1737 (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))]
1738 "ok_for_simple_arith_logic_operands (operands, HImode)"
1741 [(parallel [(set (match_dup 0)
1742 (ashift:HI (match_dup 2) (const_int 8)))
1743 (clobber (reg:CC R_FLAGS))])
1744 (parallel [(set (match_dup 0)
1745 (lshiftrt:HI (match_dup 0) (const_int 8)))
1746 (clobber (reg:CC R_FLAGS))])]
1748 operands[2] = gen_rtx_SUBREG (HImode, operands[1], 0);
1750 [(set_attr "type" "multi")])
1752 (define_expand "zero_extendqisi2"
1753 [(set (match_operand:SI 0 "register_operand" "")
1754 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
1757 (define_insn_and_split "*zero_extendqisi2_insn"
1758 [(set (match_operand:SI 0 "register_operand" "=r")
1759 (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))]
1760 "ok_for_simple_arith_logic_operands (operands, SImode)"
1763 [(parallel [(set (match_dup 0)
1764 (ashift:SI (match_dup 2) (const_int 24)))
1765 (clobber (reg:CC R_FLAGS))])
1766 (parallel [(set (match_dup 0)
1767 (lshiftrt:SI (match_dup 0) (const_int 24)))
1768 (clobber (reg:CC R_FLAGS))])]
1770 operands[2] = gen_rtx_SUBREG (SImode, operands[1], 0);
1772 [(set_attr "type" "multi")])
1774 (define_insn "zero_extendhisi2"
1775 [(set (match_operand:SI 0 "register_operand" "=r")
1776 (zero_extend:SI (match_operand:HI 1 "register_operand" "0")))]
1779 [(set_attr "type" "imm_reg")])
1781 (define_expand "zero_extendsidi2"
1782 [(set (match_operand:DI 0 "register_operand" "")
1783 (zero_extend:DI (match_operand:SI 1 "register_operand" "")))]
1786 (define_insn_and_split "*zero_extendsidi2_insn"
1787 [(set (match_operand:DI 0 "register_operand" "=r")
1788 (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
1789 "ok_for_simple_arith_logic_operands (operands, DImode)"
1792 [(parallel [(set (match_dup 3) (match_dup 1))
1793 (clobber (reg:CC R_FLAGS))])
1794 (set (match_dup 2) (const_int 0))]
1796 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1797 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1799 [(set_attr "type" "multi")])
1802 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1806 ;; Only SI mode is supported directly.
1808 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1811 ; BITS_BIG_ENDIAN is defined to 1 so operand #1 counts from the MSB.
1813 (define_insn "*btst"
1814 [(set (reg:CC_BTST R_FLAGS)
1815 (compare:CC_BTST (zero_extract:SI
1816 (match_operand:SI 0 "register_operand" "r")
1818 (match_operand:QI 1 "const_shift_operand" "K"))
1822 [(set_attr "type" "logic")])
1825 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1827 ;; Integer comparisons
1829 ;; Modes QI, HI and SI are supported directly.
1831 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1834 (define_insn "*cmp<mode>"
1835 [(set (reg:CC R_FLAGS)
1836 (compare:CC (match_operand:I 0 "register_operand" "r")
1837 (match_operand:I 1 "reg_or_0_operand" "rO")))]
1840 [(set_attr "type" "cmp")])
1842 (define_insn "*cmp<mode>_sne"
1843 [(set (reg:CC R_FLAGS)
1844 (compare:CC (not:I (match_operand:I 0 "register_operand" "r"))
1848 [(set_attr "type" "cmp")])
1851 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1853 ;; Single float operations
1855 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1858 (define_insn "addsf3"
1859 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1860 (plus:SF (match_operand:SF 1 "fp_reg_operand" "%f")
1861 (match_operand:SF 2 "fp_reg_operand" "f")))]
1864 [(set_attr "type" "fp")])
1866 (define_insn "subsf3"
1867 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1868 (minus:SF (match_operand:SF 1 "fp_reg_operand" "f")
1869 (match_operand:SF 2 "fp_reg_operand" "f")))]
1872 [(set_attr "type" "fp")])
1874 (define_insn "mulsf3"
1875 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1876 (mult:SF (match_operand:SF 1 "fp_reg_operand" "%f")
1877 (match_operand:SF 2 "fp_reg_operand" "f")))]
1880 [(set_attr "type" "fp")])
1882 (define_insn "divsf3"
1883 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1884 (div:SF (match_operand:SF 1 "fp_reg_operand" "f")
1885 (match_operand:SF 2 "fp_reg_operand" "f")))]
1888 [(set_attr "type" "fdiv")])
1890 (define_insn "sqrtsf2"
1891 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1892 (sqrt:SF (match_operand:SF 1 "fp_reg_operand" "f")))]
1895 [(set_attr "type" "fsqrt")])
1897 (define_insn "negsf2"
1898 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1899 (neg:SF (match_operand:SF 1 "fp_reg_operand" "f")))]
1902 [(set_attr "type" "fmove")])
1904 (define_insn "abssf2"
1905 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1906 (abs:SF (match_operand:SF 1 "fp_reg_operand" "f")))]
1909 [(set_attr "type" "fmove")])
1911 (define_expand "copysignsf3"
1912 [(match_operand:SF 0 "register_operand" "")
1913 (match_operand:SF 1 "nonmemory_operand" "")
1914 (match_operand:SF 2 "register_operand" "")]
1915 "TARGET_FPU && !TARGET_FPU_IEEE"
1917 visium_expand_copysign (operands, SFmode);
1922 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1924 ;; Single float <-> single integer conversions for !TARGET_FPU_IEEE
1926 ;; An FMOVE instruction converts a signalling NaN (zero high order bit of the
1927 ;; mantissa) to a quiet NaN (-1). This is acceptable when the data to be
1928 ;; moved is in fact a floating-point number, but to avoid nasty surprises
1929 ;; integers must in general be kept out of the floating-point registers.
1930 ;; HARD_REGNO_MODE_OK thus only allows SFmode in these registers.
1931 ;; However, since FTOI and ITOF use floating-point registers for both their
1932 ;; inputs and outputs, to use these instructions integers must transiently
1933 ;; occupy such registers. To disguise this from the compiler, UNSPECs are
1934 ;; used for floating-point operations on integers and floating from general
1935 ;; register to floating-point register and fixing in the reverse direction
1936 ;; are only split into the individual UNSPEC operations after reload.
1938 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1941 (define_insn "*fload_no_ieee"
1942 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1943 (unspec:SF [(match_operand:SI 1 "register_operand" "r")] UNSPEC_FLOAD))]
1944 "TARGET_FPU && !TARGET_FPU_IEEE"
1946 [(set_attr "type" "reg_fp")])
1948 (define_insn "*itof_no_ieee"
1949 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1950 (unspec:SF [(match_operand:SF 1 "fp_reg_operand" "f")] UNSPEC_ITOF))]
1951 "TARGET_FPU && !TARGET_FPU_IEEE"
1953 [(set_attr "type" "itof")])
1955 (define_insn_and_split "*floatsisf2_no_ieee"
1956 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1957 (float:SF (match_operand:SI 1 "register_operand" "r")))]
1958 "TARGET_FPU && !TARGET_FPU_IEEE"
1960 "&& reload_completed"
1962 (unspec:SF [(match_dup 1)] UNSPEC_FLOAD))
1964 (unspec:SF [(match_dup 0)] UNSPEC_ITOF))]
1966 [(set_attr "type" "multi")])
1968 (define_insn "*ftoi_no_ieee"
1969 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1970 (unspec:SF [(match_operand:SF 1 "fp_reg_operand" "f")] UNSPEC_FTOI))]
1971 "TARGET_FPU && !TARGET_FPU_IEEE"
1973 [(set_attr "type" "ftoi")])
1975 (define_insn "*fstore_no_ieee"
1976 [(set (match_operand:SI 0 "register_operand" "=r")
1977 (unspec:SI [(match_operand:SF 1 "fp_reg_operand" "f")] UNSPEC_FSTORE))]
1978 "TARGET_FPU && !TARGET_FPU_IEEE"
1980 [(set_attr "type" "fp_reg")])
1982 (define_insn_and_split "fix_truncsfsi2_no_ieee"
1983 [(set (match_operand:SI 0 "register_operand" "=r")
1984 (fix:SI (fix:SF (match_operand:SF 1 "fp_reg_operand" "f"))))
1985 (clobber (match_scratch:SF 2 "=1"))]
1986 "TARGET_FPU && !TARGET_FPU_IEEE"
1988 "&& reload_completed"
1990 (unspec:SF [(match_dup 1)] UNSPEC_FTOI))
1992 (unspec:SI [(match_dup 1)] UNSPEC_FSTORE))]
1994 [(set_attr "type" "multi")])
1997 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1999 ;; Single float <-> single integer conversions
2001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2004 (define_insn "*itof"
2005 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
2006 (float:SF (match_operand:SI 1 "register_operand" "f")))]
2009 [(set_attr "type" "itof")])
2011 (define_expand "floatsisf2"
2012 [(set (match_operand:SF 0 "fp_reg_operand" "")
2013 (float:SF (match_operand:SI 1 "register_operand" "")))]
2017 (define_insn "*ftoi"
2018 [(set (match_operand:SI 0 "register_operand" "=f")
2019 (fix:SI (fix:SF (match_operand:SF 1 "fp_reg_operand" "f"))))]
2022 [(set_attr "type" "ftoi")])
2024 (define_expand "fix_truncsfsi2"
2025 [(set (match_operand:SI 0 "register_operand" "")
2026 (fix:SI (fix:SF (match_operand:SF 1 "fp_reg_operand" ""))))]
2029 if (!TARGET_FPU_IEEE)
2031 emit_insn (gen_fix_truncsfsi2_no_ieee (operands[0], operands[1]));
2037 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2039 ;; Single float comparisons
2041 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2044 (define_insn "*cmpsf_fp"
2045 [(set (reg:CCFP R_FLAGS)
2046 (compare:CCFP (match_operand:SF 0 "fp_reg_or_0_operand" "fG")
2047 (match_operand:SF 1 "fp_reg_or_0_operand" "fG")))]
2048 "TARGET_FPU && reload_completed"
2050 [(set_attr "type" "fcmp")])
2052 (define_insn "*cmpsf_fpe"
2053 [(set (reg:CCFPE R_FLAGS)
2054 (compare:CCFPE (match_operand:SF 0 "fp_reg_or_0_operand" "fG")
2055 (match_operand:SF 1 "fp_reg_or_0_operand" "fG")))]
2056 "TARGET_FPU && reload_completed"
2058 [(set_attr "type" "fcmp")])
2061 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2063 ;; Conditional branch instructions
2065 ;; Note - we do not specify the two instructions necessary to perform
2066 ;; a compare-and-branch in the cbranch<mode>4 pattern because that would
2067 ;; allow the comparison to be moved away from the jump before the reload
2068 ;; pass has completed. That would be problematical because reload can
2069 ;; generate instructions in between which would clobber the CC register.
2071 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2074 (define_expand "cbranch<mode>4"
2076 (if_then_else (match_operator 0 "comparison_operator"
2077 [(match_operand:I 1 "register_operand")
2078 (match_operand:I 2 "reg_or_0_operand")])
2079 (label_ref (match_operand 3 ""))
2084 (define_insn_and_split "*cbranch<mode>4_insn"
2086 (if_then_else (match_operator 0 "comparison_operator"
2087 [(match_operand:I 1 "register_operand" "r")
2088 (match_operand:I 2 "reg_or_0_operand" "rO")])
2089 (label_ref (match_operand 3 ""))
2096 visium_split_cbranch (GET_CODE (operands[0]), operands[1], operands[2],
2100 [(set_attr "type" "cmp")])
2102 (define_insn_and_split "*cbranchsi4_btst_insn"
2104 (if_then_else (match_operator 0 "visium_btst_operator"
2106 (match_operand:SI 1 "register_operand" "r")
2108 (match_operand:QI 2 "const_shift_operand" "K"))
2110 (label_ref (match_operand 3 ""))
2117 visium_split_cbranch (GET_CODE (operands[0]), XEXP (operands[0], 0),
2118 XEXP (operands[0], 1), operands[3]);
2121 [(set_attr "type" "cmp")])
2123 (define_expand "cbranchsf4"
2125 (if_then_else (match_operator 0 "visium_fp_comparison_operator"
2126 [(match_operand:SF 1 "fp_reg_operand")
2127 (match_operand:SF 2 "fp_reg_or_0_operand")])
2128 (label_ref (match_operand 3 ""))
2133 (define_insn_and_split "*cbranchsf4_insn"
2135 (if_then_else (match_operator 0 "visium_fp_comparison_operator"
2136 [(match_operand:SF 1 "fp_reg_operand" "f")
2137 (match_operand:SF 2 "fp_reg_or_0_operand" "fG")])
2138 (label_ref (match_operand 3 ""))
2142 "&& reload_completed"
2145 visium_split_cbranch (GET_CODE (operands[0]), operands[1], operands[2],
2149 [(set_attr "type" "fcmp")])
2151 ; Now match both normal and inverted branches.
2153 (define_insn "*normal_branch"
2155 (if_then_else (match_operator 1 "visium_branch_operator"
2156 [(reg R_FLAGS) (const_int 0)])
2157 (label_ref (match_operand 0 ""))
2161 return output_cbranch (operands[0], GET_CODE (operands[1]),
2162 GET_MODE (XEXP (operands[1], 0)), 0, insn);
2164 [(set_attr "type" "branch")])
2166 (define_insn "*inverted_branch"
2168 (if_then_else (match_operator 1 "visium_branch_operator"
2169 [(reg R_FLAGS) (const_int 0)])
2171 (label_ref (match_operand 0 ""))))]
2174 return output_cbranch (operands[0], GET_CODE (operands[1]),
2175 GET_MODE (XEXP (operands[1], 0)), 1, insn);
2177 [(set_attr "type" "branch")])
2179 ; And then match both normal and inverted returns.
2181 (define_insn "*cond_<return_str>return"
2183 (if_then_else (match_operator 0 "visium_branch_operator"
2184 [(reg R_FLAGS) (const_int 0)])
2187 "<return_pred> && reload_completed"
2189 return output_cbranch (pc_rtx, GET_CODE (operands[0]),
2190 GET_MODE (XEXP (operands[0], 0)), 0, insn);
2192 [(set_attr "type" "ret")])
2194 (define_insn "*inverted_cond_<return_str>return"
2196 (if_then_else (match_operator 0 "visium_branch_operator"
2197 [(reg R_FLAGS) (const_int 0)])
2200 "<return_pred> && reload_completed"
2202 return output_cbranch (pc_rtx, GET_CODE (operands[0]),
2203 GET_MODE (XEXP (operands[0], 0)), 1, insn);
2205 [(set_attr "type" "ret")])
2208 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2210 ;; Unconditional branch instructions
2212 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2217 (label_ref (match_operand 0 "" "")))]
2220 return output_ubranch (operands[0], insn);
2222 [(set_attr "type" "branch")])
2224 (define_insn "indirect_jump"
2226 (match_operand:SI 0 "register_operand" "r"))]
2228 "bra tr,%0,r0%# ;indirect jump"
2229 [(set_attr "type" "abs_branch")])
2231 (define_insn "tablejump"
2233 (match_operand:SI 0 "register_operand" "r"))
2234 (use (label_ref (match_operand 1 "" "")))]
2236 "bra tr,%0,r0%# ;tablejump"
2237 [(set_attr "type" "abs_branch")])
2240 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2242 ;; Subprogram call instructions
2244 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2247 ; Subroutine call instruction returning no value. Operand 0 is the function
2248 ; to call; operand 1 is the number of bytes of arguments pushed (in mode
2249 ; 'SImode', except it is normally a 'const_int'); operand 2 is the number of
2250 ; registers used as operands.
2252 (define_expand "call"
2253 [(parallel [(call (match_operand 0 "" "")
2254 (match_operand 1 "" ""))
2255 (use (match_operand 2 "" ""))
2256 (clobber (match_dup 3))])]
2259 if (GET_CODE (XEXP (operands[0], 0)) != REG)
2260 XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
2263 operands[2] = const0_rtx;
2265 operands[3] = gen_rtx_REG (Pmode, R_LINK);
2268 (define_insn "*call_internal"
2269 [(call (mem:SI (match_operand:SI 0 "register_operand" "l,!r"))
2270 (match_operand 1 "" ""))
2271 (use (match_operand 2 "" ""))
2272 (clobber (match_operand 3 "" ""))]
2273 "!SIBLING_CALL_P (insn)"
2274 "bra tr,%0,%3%# ;call"
2275 [(set_attr "type" "call")])
2277 ; Subroutine call instruction returning a value. Operand 0 is the hard
2278 ; register in which the value is returned. There are three more operands, the
2279 ; same as the three operands of the 'call' instruction (but with numbers
2280 ; increased by one).
2282 (define_expand "call_value"
2283 [(parallel [(set (match_operand 0 "register_operand" "")
2284 (call (match_operand 1 "" "")
2285 (match_operand 2 "" "")))
2286 (use (match_operand 3 "" ""))
2287 (clobber (match_dup 4))])]
2290 if (GET_CODE (XEXP (operands[1], 0)) != REG)
2291 XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
2294 operands[3] = const0_rtx;
2296 operands[4] = gen_rtx_REG (Pmode, R_LINK);
2299 (define_insn "*call_value_internal"
2300 [(set (match_operand 0 "register_operand" "")
2301 (call (mem:SI (match_operand:SI 1 "register_operand" "l,!r"))
2302 (match_operand 2 "" "")))
2303 (use (match_operand 3 "" ""))
2304 (clobber (match_operand 4 "" ""))]
2305 "!SIBLING_CALL_P (insn)"
2306 "bra tr,%1,%4%# ;call value"
2307 [(set_attr "type" "call")])
2309 ; Tail calls are similar, except that the link register is not used. But
2310 ; we don't use r0 as the destination register of the branch because we want
2311 ; the Branch Pre-decode Logic of the GR6 to use the Address Load Array to
2312 ; predict the branch target.
2314 (define_expand "sibcall"
2315 [(parallel [(call (match_operand 0 "" "")
2316 (match_operand 1 "" ""))
2317 (use (match_operand 2 "" ""))
2318 (clobber (match_dup 3))])]
2321 if (GET_CODE (XEXP (operands[0], 0)) != REG)
2322 XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
2325 operands[2] = const0_rtx;
2327 operands[3] = gen_rtx_SCRATCH (SImode);
2330 (define_insn "*sibcall_internal"
2331 [(call (mem:SI (match_operand:SI 0 "register_operand" "k"))
2332 (match_operand 1 "" ""))
2333 (use (match_operand 2 "" ""))
2334 (clobber (match_scratch:SI 3 "=0"))]
2335 "SIBLING_CALL_P (insn)"
2336 "bra tr,%0,%0%# ;sibcall"
2337 [(set_attr "type" "call")])
2339 (define_expand "sibcall_value"
2340 [(parallel [(set (match_operand 0 "register_operand" "")
2341 (call (match_operand 1 "" "")
2342 (match_operand 2 "" "")))
2343 (use (match_operand 3 "" ""))
2344 (clobber (match_dup 4))])]
2347 if (GET_CODE (XEXP (operands[1], 0)) != REG)
2348 XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
2351 operands[3] = const0_rtx;
2353 operands[4] = gen_rtx_SCRATCH (SImode);
2356 (define_insn "*sibcall_value_internal"
2357 [(set (match_operand 0 "register_operand" "")
2358 (call (mem:SI (match_operand:SI 1 "register_operand" "k"))
2359 (match_operand 2 "" "")))
2360 (use (match_operand 3 "" ""))
2361 (clobber (match_scratch:SI 4 "=1"))]
2362 "SIBLING_CALL_P (insn)"
2363 "bra tr,%1,%1%# ;sibcall value"
2364 [(set_attr "type" "call")])
2366 ; Call subroutine returning any type.
2367 (define_expand "untyped_call"
2368 [(parallel [(call (match_operand 0 "" "")
2370 (match_operand 1 "" "")
2371 (match_operand 2 "" "")])]
2376 emit_call_insn (gen_call (operands[0], const0_rtx, NULL));
2378 for (i = 0; i < XVECLEN (operands[2], 0); i++)
2380 rtx set = XVECEXP (operands[2], 0, i);
2381 emit_move_insn (SET_DEST (set), SET_SRC (set));
2384 /* The optimizer does not know that the call sets the function value
2385 registers we stored in the result block. We avoid problems by
2386 claiming that all hard registers are used and clobbered at this
2388 emit_insn (gen_blockage ());
2394 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2396 ;; Compare-and-store instructions
2398 ;; Modes QI, HI, SI and SF are supported directly.
2400 ;; Note - we do not specify the two instructions necessary to perform
2401 ;; a compare-and-store in the cstore<mode>4 pattern because that would
2402 ;; allow the comparison to be moved away from the store before the reload
2403 ;; pass has completed. That would be problematical because reload can
2404 ;; generate instructions in between which would clobber the CC register.
2406 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2409 (define_expand "cstore<mode>4"
2410 [(set (match_operand:SI 0)
2411 (match_operator:SI 1 "visium_int_cstore_operator"
2412 [(match_operand:I 2 "register_operand")
2413 (match_operand:I 3 "reg_or_0_operand")]))]
2416 visium_expand_int_cstore (operands, <MODE>mode);
2420 (define_insn_and_split "*cstore<mode>4_insn"
2421 [(set (match_operand:SI 0 "register_operand" "=r")
2422 (ltu:SI (match_operand:I 1 "register_operand" "r")
2423 (match_operand:I 2 "reg_or_0_operand" "rO")))]
2429 visium_split_cstore (SET, operands[0], NULL_RTX,
2430 LTU, operands[1], operands[2]);
2433 [(set_attr "type" "cmp")])
2435 (define_insn_and_split "*neg_cstore<mode>4_insn"
2436 [(set (match_operand:SI 0 "register_operand" "=r")
2437 (neg:SI (ltu:SI (match_operand:I 1 "register_operand" "r")
2438 (match_operand:I 2 "reg_or_0_operand" "rO"))))]
2444 visium_split_cstore (NEG, operands[0], NULL_RTX,
2445 LTU, operands[1], operands[2]);
2448 [(set_attr "type" "cmp")])
2450 (define_insn_and_split "*<add_str>_cstore<mode>4_insn"
2451 [(set (match_operand:SI 0 "register_operand" "=r")
2452 (any_add:SI (match_operand:SI 1 "register_operand" "r")
2453 (ltu:SI (match_operand:I 2 "register_operand" "r")
2454 (match_operand:I 3 "reg_or_0_operand" "rO"))))]
2460 visium_split_cstore (<add_op>, operands[0], operands[1],
2461 LTU, operands[2], operands[3]);
2464 [(set_attr "type" "cmp")])
2466 (define_insn_and_split "*cstore<mode>4_sne_insn"
2467 [(set (match_operand:SI 0 "register_operand" "=r")
2468 (ltu:SI (not:I (match_operand:I 1 "register_operand" "r"))
2475 visium_split_cstore (SET, operands[0], NULL_RTX,
2476 LTU, gen_rtx_NOT (<MODE>mode, operands[1]), constm1_rtx);
2479 [(set_attr "type" "cmp")])
2481 (define_insn_and_split "*neg_cstore<mode>4_sne_insn"
2482 [(set (match_operand:SI 0 "register_operand" "=r")
2483 (neg:SI (ltu:SI (not:I (match_operand:I 1 "register_operand" "r"))
2490 visium_split_cstore (NEG, operands[0], NULL_RTX,
2491 LTU, gen_rtx_NOT (<MODE>mode, operands[1]), constm1_rtx);
2494 [(set_attr "type" "cmp")])
2496 (define_insn_and_split "*<add_str>_cstore<mode>4_sne_insn"
2497 [(set (match_operand:SI 0 "register_operand" "=r")
2498 (any_add:SI (match_operand:SI 1 "register_operand" "r")
2499 (ltu:SI (not:I (match_operand:I 2 "register_operand" "r"))
2506 visium_split_cstore (<add_op>, operands[0], operands[1],
2507 LTU, gen_rtx_NOT (<MODE>mode, operands[2]), constm1_rtx);
2510 [(set_attr "type" "cmp")])
2512 (define_expand "cstoresf4"
2513 [(set (match_operand:SI 0)
2514 (match_operator:SI 1 "visium_fp_cstore_operator"
2515 [(match_operand:SF 2 "fp_reg_operand")
2516 (match_operand:SF 3 "fp_reg_or_0_operand")]))]
2519 visium_expand_fp_cstore (operands, SFmode);
2523 (define_insn_and_split "*cstoresf4_insn"
2524 [(set (match_operand:SI 0 "register_operand" "=r")
2525 (lt:SI (match_operand:SF 1 "fp_reg_or_0_operand" "fG")
2526 (match_operand:SF 2 "fp_reg_or_0_operand" "fG")))]
2529 "&& reload_completed"
2532 visium_split_cstore (SET, operands [0], NULL_RTX,
2533 LT, operands[1], operands[2]);
2536 [(set_attr "type" "fcmp")])
2538 (define_insn_and_split "*neg_cstoresf4_insn"
2539 [(set (match_operand:SI 0 "register_operand" "=r")
2540 (neg:SI (lt:SI (match_operand:SF 1 "fp_reg_or_0_operand" "fG")
2541 (match_operand:SF 2 "fp_reg_or_0_operand" "fG"))))]
2544 "&& reload_completed"
2547 visium_split_cstore (NEG, operands [0], NULL_RTX,
2548 LT, operands[1], operands[2]);
2551 [(set_attr "type" "fcmp")])
2553 (define_insn_and_split "*<add_str>_cstoresf4_insn"
2554 [(set (match_operand:SI 0 "register_operand" "=r")
2555 (any_add:SI (match_operand:SI 1 "register_operand" "r")
2556 (lt:SI (match_operand:SF 2 "fp_reg_or_0_operand" "fG")
2557 (match_operand:SF 3 "fp_reg_or_0_operand" "fG"))))]
2560 "&& reload_completed"
2563 visium_split_cstore (<add_op>, operands [0], operands[1],
2564 LT, operands[2], operands[3]);
2567 [(set_attr "type" "fcmp")])
2570 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2572 ;; RTL pro/epilogue support
2574 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2577 ; Expand prologue in RTL
2578 (define_expand "prologue"
2582 visium_expand_prologue ();
2586 ; Expand epilogue in RTL
2587 (define_expand "epilogue"
2591 visium_expand_epilogue ();
2594 ; Expand epilogue without a final jump in RTL
2595 (define_expand "sibcall_epilogue"
2599 visium_expand_epilogue ();
2603 ; The artificial dependency on the link register is to prevent the
2604 ; frame instruction from being put in a call delay slot, which can
2605 ; confuse the CFI machinery.
2607 (define_insn "stack_save"
2608 [(set (reg:SI R_FP) (reg:SI R_SP))
2609 (use (reg:SI R_LINK))
2610 (clobber (reg:CC R_FLAGS))]
2612 "move.l fp,sp ;stack_save"
2613 [(set_attr "type" "logic")])
2615 ; The construct (mem:BLK (scratch)) is considered to alias all other
2616 ; memory accesses. Thus it can be used as a memory barrier in stack
2617 ; deallocation patterns.
2619 (define_insn "stack_restore"
2620 [(set (reg:SI R_SP) (reg:SI R_FP))
2621 (clobber (mem:BLK (scratch)))
2622 (clobber (reg:CC R_FLAGS))]
2624 "move.l sp,fp ;stack_restore"
2625 [(set_attr "type" "logic")])
2627 (define_insn "stack_pop"
2629 (plus:SI (reg:SI R_SP) (match_operand:SI 0 "add_operand" "J,r")))
2630 (clobber (mem:BLK (scratch)))
2631 (clobber (reg:CC R_FLAGS))]
2634 addi sp,%0 ;stack pop
2635 add.l sp,sp,%0 ;stack pop"
2636 [(set_attr "type" "arith")])
2638 (define_expand "<return_str>return"
2643 (define_insn "*<return_str>return_internal"
2645 "!visium_interrupt_function_p ()"
2647 return output_ubranch (pc_rtx, insn);
2649 [(set_attr "type" "ret")])
2651 (define_insn "*return_internal_interrupt"
2653 "visium_interrupt_function_p ()"
2654 "rfi\n\t nop ;return from interrupt"
2655 [(set_attr "type" "rfi")])
2658 [(unspec_volatile [(const_int 0)] UNSPECV_DSI)]
2661 [(set_attr "type" "dsi")])
2664 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2666 ;; NOP (no-op instruction)
2668 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2674 "nop ;generated nop"
2675 [(set_attr "type" "nop")])
2677 (define_insn "hazard_nop"
2678 [(unspec_volatile [(const_int 0)] UNSPEC_NOP)]
2680 "nop ;hazard avoidance nop"
2681 [(set_attr "type" "nop")])
2683 (define_insn "blockage"
2684 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
2687 [(set_attr "type" "nop")])
2690 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2692 ;; String/block operations
2694 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2697 ;; String/block move insn.
2698 ;; Argument 0 is the destination
2699 ;; Argument 1 is the source
2700 ;; Argument 2 is the length
2701 ;; Argument 3 is the alignment
2703 (define_expand "movmemsi"
2704 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
2705 (match_operand:BLK 1 "memory_operand" ""))
2706 (use (match_operand:SI 2 "general_operand" ""))
2707 (use (match_operand:SI 3 "const_int_operand" ""))])]
2710 if (visium_expand_block_move (operands))
2717 [(set (mem:BLK (reg:SI R_R1))
2718 (mem:BLK (reg:SI R_R2)))
2720 (clobber (reg:SI R_R1))
2721 (clobber (reg:SI R_R2))
2722 (clobber (reg:SI R_R3))
2723 (clobber (reg:SI R_R4))
2724 (clobber (reg:SI R_R5))
2725 (clobber (reg:SI R_R6))]
2728 [(set_attr "type" "bmi")])
2730 ;; String/block set insn.
2731 ;; Argument 0 is the destination
2732 ;; Argument 1 is the length
2733 ;; Argument 2 is the value
2734 ;; Argument 3 is the alignment
2736 (define_expand "setmemsi"
2737 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
2738 (match_operand 2 "nonmemory_operand" ""))
2739 (use (match_operand:SI 1 "general_operand" ""))
2740 (use (match_operand:SI 3 "const_int_operand" ""))])]
2743 if (visium_expand_block_set (operands))