1 ;; Machine description for Visium.
2 ;; Copyright (C) 2002-2015 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))]
692 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
693 REAL_VALUE_TO_TARGET_SINGLE (rv, l);
695 operands[2] = operand_subword (operands[0], 0, 0, SFmode);
696 operands[3] = GEN_INT (trunc_int_for_mode (l, SImode));
700 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
704 ;; We always split a DFmode move into two SImode moves.
706 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
709 (define_expand "movdf"
710 [(set (match_operand:DF 0 "nonimmediate_operand" "")
711 (match_operand:DF 1 "general_operand" ""))]
714 prepare_move_operands (operands, DFmode);
717 (define_insn "*movdf_insn"
718 [(set (match_operand:DF 0 "nonimmediate_operand" "= r, m")
719 (match_operand:DF 1 "general_operand" "rFm,rG"))]
720 "ok_for_simple_move_operands (operands, DFmode)"
722 [(set_attr "type" "multi")])
725 [(set (match_operand:DF 0 "nonimmediate_operand" "")
726 (match_operand:DF 1 "general_operand" ""))]
728 [(set (match_dup 2) (match_dup 3))
729 (set (match_dup 4) (match_dup 5))]
731 split_double_move (operands, DFmode);
735 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
739 ;; Modes QI, HI, SI and DI are supported directly.
741 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
744 (define_expand "add<mode>3"
745 [(set (match_operand:QHI 0 "register_operand" "")
746 (plus:QHI (match_operand:QHI 1 "register_operand" "")
747 (match_operand:QHI 2 "register_operand" "")))]
750 (define_insn_and_split "*add<mode>3_insn"
751 [(set (match_operand:QHI 0 "register_operand" "=r")
752 (plus:QHI (match_operand:QHI 1 "register_operand" "%r")
753 (match_operand:QHI 2 "register_operand" "r")))]
754 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
757 [(parallel [(set (match_dup 0)
758 (plus:QHI (match_dup 1) (match_dup 2)))
759 (clobber (reg:CC R_FLAGS))])]
761 [(set_attr "type" "arith")])
763 (define_insn "*add<mode>3_insn<subst_arith>"
764 [(set (match_operand:QHI 0 "register_operand" "=r")
765 (plus:QHI (match_operand:QHI 1 "register_operand" "%r")
766 (match_operand:QHI 2 "register_operand" "r")))
767 (clobber (reg:CC R_FLAGS))]
770 [(set_attr "type" "arith")])
772 (define_expand "addsi3"
773 [(set (match_operand:SI 0 "register_operand" "")
774 (plus:SI (match_operand:SI 1 "register_operand" "")
775 (match_operand:SI 2 "add_operand" "")))]
778 (define_expand "addsi3_flags"
779 [(parallel [(set (match_operand:SI 0 "register_operand" "")
780 (plus:SI (match_operand:SI 1 "register_operand" "")
781 (match_operand:SI 2 "add_operand" "")))
782 (clobber (reg:CC R_FLAGS))])]
786 (define_insn_and_split "*addsi3_insn"
787 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
788 (plus:SI (match_operand:SI 1 "register_operand" "%0,r,0")
789 (match_operand:SI 2 "add_operand" " L,r,J")))]
790 "ok_for_simple_arith_logic_operands (operands, SImode)"
793 [(parallel [(set (match_dup 0)
794 (plus:SI (match_dup 1) (match_dup 2)))
795 (clobber (reg:CC R_FLAGS))])]
797 [(set_attr "type" "arith")])
799 ; Favour the addition of small negative constants, since they are
800 ; expensive to load into a register.
802 (define_insn "*addsi3_insn<subst_arith>"
803 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
804 (plus:SI (match_operand:SI 1 "register_operand" "%0,r,0")
805 (match_operand:SI 2 "add_operand" " L,r,J")))
806 (clobber (reg:CC R_FLAGS))]
812 [(set_attr "type" "arith")])
814 (define_expand "adddi3"
815 [(set (match_operand:DI 0 "register_operand" "")
816 (plus:DI (match_operand:DI 1 "register_operand" "")
817 (match_operand:DI 2 "add_operand" "")))]
820 (define_insn_and_split "*addi3_insn"
821 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
822 (plus:DI (match_operand:DI 1 "register_operand" "%0,0, r")
823 (match_operand:DI 2 "add_operand" " J,L, r")))]
824 "ok_for_simple_arith_logic_operands (operands, DImode)"
827 [(parallel [(set (match_dup 0)
828 (plus:DI (match_dup 1) (match_dup 2)))
829 (clobber (reg:CC R_FLAGS))])]
831 [(set_attr "type" "arith2")])
833 ; Disfavour the use of add.l because of the early clobber.
835 (define_insn "*adddi3_insn_flags"
836 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
837 (plus:DI (match_operand:DI 1 "register_operand" "%0,0, r")
838 (match_operand:DI 2 "add_operand" " J,L, r")))
839 (clobber (reg:CC R_FLAGS))]
842 addi %d0,%2\n\tadc.l %0,%0,r0
843 subi %d0,%n2\n\tsubc.l %0,%0,r0
844 add.l %d0,%d1,%d2\n\tadc.l %0,%1,%2"
845 [(set_attr "type" "arith2")])
848 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
850 ;; Integer Add with Carry
852 ;; Only SI mode is supported as slt[u] for the sake of cstore.
854 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
857 (define_insn "*<scc_str><subst_arith>"
858 [(set (match_operand:SI 0 "register_operand" "=r")
859 (any_scc:SI (reg R_FLAGS) (const_int 0)))
860 (clobber (reg:CC R_FLAGS))]
863 [(set_attr "type" "arith")])
865 (define_insn "*plus_<scc_str><subst_arith>"
866 [(set (match_operand:SI 0 "register_operand" "=r")
867 (plus:SI (match_operand:SI 1 "register_operand" "r")
868 (any_scc:SI (reg R_FLAGS) (const_int 0))))
869 (clobber (reg:CC R_FLAGS))]
872 [(set_attr "type" "arith")])
875 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
879 ;; Modes QI, HI, SI and DI are supported directly.
881 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
884 (define_expand "sub<mode>3"
885 [(set (match_operand:QHI 0 "register_operand" "")
886 (minus:QHI (match_operand:QHI 1 "reg_or_0_operand" "")
887 (match_operand:QHI 2 "register_operand" "")))]
890 (define_insn_and_split "*sub<mode>3_insn"
891 [(set (match_operand:QHI 0 "register_operand" "=r")
892 (minus:QHI (match_operand:QHI 1 "reg_or_0_operand" "rO")
893 (match_operand:QHI 2 "register_operand" "r")))]
894 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
897 [(parallel [(set (match_dup 0)
898 (minus:QHI (match_dup 1) (match_dup 2)))
899 (clobber (reg:CC R_FLAGS))])]
901 [(set_attr "type" "arith")])
903 (define_insn "*sub<mode>3_insn<subst_arith>"
904 [(set (match_operand:QHI 0 "register_operand" "=r")
905 (minus:QHI (match_operand:QHI 1 "reg_or_0_operand" "rO")
906 (match_operand:QHI 2 "register_operand" "r")))
907 (clobber (reg:CC R_FLAGS))]
910 [(set_attr "type" "arith")])
912 (define_expand "subsi3"
913 [(set (match_operand:SI 0 "register_operand" "")
914 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
915 (match_operand:SI 2 "add_operand" "")))]
918 (define_expand "subsi3_flags"
919 [(parallel [(set (match_operand:SI 0 "register_operand" "")
920 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
921 (match_operand:SI 2 "add_operand" "")))
922 (clobber (reg:CC R_FLAGS))])]
926 (define_insn_and_split "*subsi3_insn"
927 [(set (match_operand:SI 0 "register_operand" "=r,r, r")
928 (minus:SI (match_operand:SI 1 "reg_or_0_operand" " 0,rO,0")
929 (match_operand:SI 2 "add_operand" " L,r, J")))]
930 "ok_for_simple_arith_logic_operands (operands, SImode)"
933 [(parallel [(set (match_dup 0)
934 (minus:SI (match_dup 1) (match_dup 2)))
935 (clobber (reg:CC R_FLAGS))])]
937 [(set_attr "type" "arith")])
939 ; Favour the subtraction of small negative constants, since they are
940 ; expensive to load into a register.
942 (define_insn "*subsi3_insn<subst_arith>"
943 [(set (match_operand:SI 0 "register_operand" "=r,r, r")
944 (minus:SI (match_operand:SI 1 "reg_or_0_operand" " 0,rO,0")
945 (match_operand:SI 2 "add_operand" " L,r, J")))
946 (clobber (reg:CC R_FLAGS))]
952 [(set_attr "type" "arith")])
954 (define_expand "subdi3"
955 [(set (match_operand:DI 0 "register_operand" "")
956 (minus:DI (match_operand:DI 1 "register_operand" "")
957 (match_operand:DI 2 "add_operand" "")))]
960 (define_insn_and_split "*subdi3_insn"
961 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
962 (minus:DI (match_operand:DI 1 "register_operand" " 0,0, r")
963 (match_operand:DI 2 "add_operand" " J,L, r")))]
964 "ok_for_simple_arith_logic_operands (operands, DImode)"
967 [(parallel [(set (match_dup 0)
968 (minus:DI (match_dup 1) (match_dup 2)))
969 (clobber (reg:CC R_FLAGS))])]
971 [(set_attr "type" "arith2")])
973 ; Disfavour the use of the sub.l because of the early clobber.
975 (define_insn "*subdi3_insn_flags"
976 [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
977 (minus:DI (match_operand:DI 1 "register_operand" " 0,0, r")
978 (match_operand:DI 2 "add_operand" " J,L, r")))
979 (clobber (reg:CC R_FLAGS))]
982 subi %d0,%2\n\tsubc.l %0,%0,r0
983 addi %d0,%n2\n\tadc.l %0,%0,r0
984 sub.l %d0,%d1,%d2\n\tsubc.l %0,%1,%2"
985 [(set_attr "type" "arith2")])
988 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
990 ;; Integer Subtract with Carry
992 ;; Only SI mode is supported as neg<slt[u]> for the sake of cstore.
994 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
997 (define_insn "*neg_<scc_str><subst_arith>"
998 [(set (match_operand:SI 0 "register_operand" "=r")
999 (neg:SI (any_scc:SI (reg R_FLAGS) (const_int 0))))
1000 (clobber (reg:CC R_FLAGS))]
1003 [(set_attr "type" "arith")])
1005 (define_insn "*minus_<scc_str><subst_arith>"
1006 [(set (match_operand:SI 0 "register_operand" "=r")
1007 (minus:SI (match_operand:SI 1 "register_operand" "r")
1008 (any_scc:SI (reg R_FLAGS) (const_int 0))))
1009 (clobber (reg:CC R_FLAGS))]
1012 [(set_attr "type" "arith")])
1015 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1019 ;; Modes QI, HI, SI and DI are supported directly.
1021 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1024 (define_expand "neg<mode>2"
1025 [(set (match_operand:I 0 "register_operand" "")
1026 (neg:I (match_operand:I 1 "register_operand" "")))]
1029 (define_insn_and_split "*neg<mode>2_insn"
1030 [(set (match_operand:I 0 "register_operand" "=r")
1031 (neg:I (match_operand:I 1 "register_operand" "r")))]
1032 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1035 [(parallel [(set (match_dup 0) (neg:I (match_dup 1)))
1036 (clobber (reg:CC R_FLAGS))])]
1038 [(set_attr "type" "arith")])
1040 (define_insn "*neg<mode>2_insn<subst_arith>"
1041 [(set (match_operand:I 0 "register_operand" "=r")
1042 (neg:I (match_operand:I 1 "register_operand" "r")))
1043 (clobber (reg:CC R_FLAGS))]
1046 [(set_attr "type" "arith")])
1048 (define_expand "negdi2"
1049 [(set (match_operand:DI 0 "register_operand" "")
1050 (neg:DI (match_operand:DI 1 "register_operand" "")))]
1053 (define_insn_and_split "*negdi2_insn"
1054 [(set (match_operand:DI 0 "register_operand" "=&r")
1055 (neg:DI (match_operand:DI 1 "register_operand" "r")))]
1056 "ok_for_simple_arith_logic_operands (operands, DImode)"
1059 [(parallel [(set (match_dup 0) (neg:DI (match_dup 1)))
1060 (clobber (reg:CC R_FLAGS))])]
1062 [(set_attr "type" "arith2")])
1064 (define_insn "*negdi2_insn_flags"
1065 [(set (match_operand:DI 0 "register_operand" "=&r")
1066 (neg:DI (match_operand:DI 1 "register_operand" "r")))
1067 (clobber (reg:CC R_FLAGS))]
1069 "sub.l %d0,r0,%d1\n\tsubc.l %0,r0,%1"
1070 [(set_attr "type" "arith2")])
1073 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1075 ;; Integer Multiply (non-widening and widening, signed and unsigned)
1077 ;; Only SI mode is supported.
1079 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1082 ; The mults and multu instructions clear MDC but we only pretend that they
1083 ; clobber it to keep things relatively simple.
1085 (define_insn "mulsi3"
1086 [(set (match_operand:SI 0 "register_operand" "=b")
1087 (mult:SI (match_operand:SI 1 "register_operand" "%r")
1088 (match_operand:SI 2 "register_operand" "r")))
1089 (clobber (reg:SI R_MDC))]
1092 [(set_attr "type" "mul")])
1094 ; The names are mulsidi3 and umulsidi3 here.
1096 (define_insn "<u>mulsidi3"
1097 [(set (match_operand:DI 0 "register_operand" "=b")
1098 (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "%r"))
1099 (any_extend:DI (match_operand:SI 2 "register_operand" "r"))))
1100 (clobber (reg:SI R_MDC))]
1103 [(set_attr "type" "mul")])
1105 ; But they are smulsi3_highpart and umulsi3_highpart here.
1107 (define_insn_and_split "<su>mulsi3_highpart"
1108 [(set (match_operand:SI 0 "register_operand" "=r")
1111 (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "%r"))
1112 (any_extend:DI (match_operand:SI 2 "register_operand" "r")))
1114 (clobber (reg:DI R_MDB))
1115 (clobber (reg:SI R_MDC))]
1119 [(parallel [(set (reg:DI R_MDB)
1120 (mult:DI (any_extend:DI (match_dup 1))
1121 (any_extend:DI (match_dup 2))))
1122 (clobber (reg:SI R_MDC))])
1123 (set (match_dup 0) (unspec:SI [(reg:DI R_MDB)] UNSPEC_MDBHI))]
1125 [(set_attr "type" "multi")])
1128 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1130 ;; Integer divide and modulus (signed and unsigned)
1132 ;; Only SI mode is supported.
1134 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1137 (define_insn "*divmodsi4_insn"
1138 [(set (match_operand:SI 0 "register_operand" "=b")
1139 (div:SI (match_operand:SI 1 "register_operand" "0")
1140 (match_operand:SI 2 "register_operand" "r")))
1141 (set (reg:SI R_MDC) (mod:SI (match_dup 1) (match_dup 2)))]
1144 [(set_attr "type" "div")])
1146 (define_insn_and_split "divmodsi4"
1147 [(set (match_operand:SI 0 "register_operand" "=b")
1148 (div:SI (match_operand:SI 1 "register_operand" "0")
1149 (match_operand:SI 2 "register_operand" "r")))
1150 (set (match_operand:SI 3 "register_operand" "=r")
1151 (mod:SI (match_dup 1) (match_dup 2)))
1152 (clobber (reg:SI R_MDC))]
1156 [(parallel [(set (match_dup 0) (div:SI (match_dup 1) (match_dup 2)))
1157 (set (reg:SI R_MDC) (mod:SI (match_dup 1) (match_dup 2)))])
1158 (set (match_dup 3) (reg:SI R_MDC))]
1160 [(set_attr "type" "multi")])
1162 (define_insn "*udivmodsi4_insn"
1163 [(set (match_operand:SI 0 "register_operand" "=b")
1164 (udiv:SI (match_operand:SI 1 "register_operand" "0")
1165 (match_operand:SI 2 "register_operand" "r")))
1166 (set (reg:SI R_MDC) (umod:SI (match_dup 1) (match_dup 2)))]
1169 [(set_attr "type" "div")])
1171 (define_insn_and_split "udivmodsi4"
1172 [(set (match_operand:SI 0 "register_operand" "=b")
1173 (udiv:SI (match_operand:SI 1 "register_operand" "0")
1174 (match_operand:SI 2 "register_operand" "r")))
1175 (set (match_operand:SI 3 "register_operand" "=r")
1176 (umod:SI (match_dup 1) (match_dup 2)))
1177 (clobber (reg:SI R_MDC))]
1181 [(parallel [(set (match_dup 0) (udiv:SI (match_dup 1) (match_dup 2)))
1182 (set (reg:SI R_MDC) (umod:SI (match_dup 1) (match_dup 2)))])
1183 (set (match_dup 3) (reg:SI R_MDC))]
1185 [(set_attr "type" "multi")])
1187 ; FIXME. How do we persuade the compiler to use 64/32 bit divides directly ?
1189 (define_insn "*divds"
1190 [(set (reg:DI R_MDB)
1191 (div:DI (reg:DI R_MDB) (sign_extend:DI (match_operand:SI 0 "register_operand" "r"))))
1192 (set (reg:SI R_MDC) (truncate:SI (mod:DI (reg:DI R_MDB) (sign_extend:DI (match_dup 0)))))]
1195 [(set_attr "type" "divd")])
1197 (define_insn "*divdu"
1198 [(set (reg:DI R_MDB)
1199 (udiv:DI (reg:DI R_MDB) (zero_extend:DI (match_operand:SI 0 "register_operand" "r"))))
1200 (set (reg:SI R_MDC) (truncate:SI (umod:DI (reg:DI R_MDB) (zero_extend:DI (match_dup 0)))))]
1203 [(set_attr "type" "divd")])
1205 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1207 ;; Bitwise Logical AND
1209 ;; Modes QI, HI and SI are supported directly.
1211 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1214 (define_expand "and<mode>3"
1215 [(set (match_operand:I 0 "register_operand" "")
1216 (and:I (match_operand:I 1 "register_operand" "")
1217 (match_operand:I 2 "register_operand" "")))]
1220 (define_insn_and_split "*and<mode>3_insn"
1221 [(set (match_operand:I 0 "register_operand" "=r")
1222 (and:I (match_operand:I 1 "register_operand" "%r")
1223 (match_operand:I 2 "register_operand" "r")))]
1224 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1227 [(parallel [(set (match_dup 0)
1228 (and:I (match_dup 1) (match_dup 2)))
1229 (clobber (reg:CC R_FLAGS))])]
1231 [(set_attr "type" "logic")])
1233 (define_insn "*and<mode>3_insn<subst_logic>"
1234 [(set (match_operand:I 0 "register_operand" "=r")
1235 (and:I (match_operand:I 1 "register_operand" "%r")
1236 (match_operand:I 2 "register_operand" "r")))
1237 (clobber (reg:CC R_FLAGS))]
1240 [(set_attr "type" "logic")])
1243 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1245 ;; Bitwise Inclusive Logical OR
1247 ;; Modes QI, HI and SI are supported directly.
1249 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1252 (define_expand "ior<mode>3"
1253 [(set (match_operand:I 0 "register_operand" "")
1254 (ior:I (match_operand:I 1 "register_operand" "")
1255 (match_operand:I 2 "register_operand" "")))]
1258 (define_insn_and_split "*ior<mode>3_insn"
1259 [(set (match_operand:I 0 "register_operand" "=r")
1260 (ior:I (match_operand:I 1 "register_operand" "%r")
1261 (match_operand:I 2 "register_operand" "r")))]
1262 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1265 [(parallel [(set (match_dup 0)
1266 (ior:I (match_dup 1) (match_dup 2)))
1267 (clobber (reg:CC R_FLAGS))])]
1269 [(set_attr "type" "logic")])
1271 (define_insn "*ior<mode>3_insn<subst_logic>"
1272 [(set (match_operand:I 0 "register_operand" "=r")
1273 (ior:I (match_operand:I 1 "register_operand" "%r")
1274 (match_operand:I 2 "register_operand" "r")))
1275 (clobber (reg:CC R_FLAGS))]
1278 [(set_attr "type" "logic")])
1281 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1283 ;; Bitwise Exclusive Logical OR
1285 ;; Modes QI, HI and SI are supported directly.
1287 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1290 (define_expand "xor<mode>3"
1291 [(set (match_operand:I 0 "register_operand" "")
1292 (xor:I (match_operand:I 1 "register_operand" "")
1293 (match_operand:I 2 "register_operand" "")))]
1296 (define_insn_and_split "*xor<mode>3_insn"
1297 [(set (match_operand:I 0 "register_operand" "=r")
1298 (xor:I (match_operand:I 1 "register_operand" "%r")
1299 (match_operand:I 2 "register_operand" "r")))]
1300 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1303 [(parallel [(set (match_dup 0)
1304 (xor:I (match_dup 1) (match_dup 2)))
1305 (clobber (reg:CC R_FLAGS))])]
1307 [(set_attr "type" "logic")])
1309 (define_insn "*xor<mode>3_insn<subst_logic>"
1310 [(set (match_operand:I 0 "register_operand" "=r")
1311 (xor:I (match_operand:I 1 "register_operand" "%r")
1312 (match_operand:I 2 "register_operand" "r")))
1313 (clobber (reg:CC R_FLAGS))]
1316 [(set_attr "type" "logic")])
1319 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1321 ;; Bitwise Logical NOT
1323 ;; Modes QI, HI and SI are supported directly.
1325 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1328 (define_expand "one_cmpl<mode>2"
1329 [(set (match_operand:I 0 "register_operand" "")
1330 (not:I (match_operand:I 1 "reg_or_0_operand" "")))]
1333 (define_insn_and_split "*one_cmpl<mode>2_insn"
1334 [(set (match_operand:I 0 "register_operand" "=r")
1335 (not:I (match_operand:I 1 "reg_or_0_operand" "rO")))]
1336 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1339 [(parallel [(set (match_dup 0) (not:I (match_dup 1)))
1340 (clobber (reg:CC R_FLAGS))])]
1342 [(set_attr "type" "logic")])
1344 (define_insn "*one_cmpl<mode>2_insn<subst_logic>"
1345 [(set (match_operand:I 0 "register_operand" "=r")
1346 (not:I (match_operand:I 1 "reg_or_0_operand" "rO")))
1347 (clobber (reg:CC R_FLAGS))]
1350 [(set_attr "type" "logic")])
1353 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1355 ;; Arithmetic Shift Left
1357 ;; Modes QI, HI, SI and DI are supported directly.
1359 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1362 (define_expand "ashl<mode>3"
1363 [(set (match_operand:I 0 "register_operand" "")
1364 (ashift:I (match_operand:I 1 "register_operand" "")
1365 (match_operand:QI 2 "reg_or_shift_operand" "")))]
1368 (define_insn_and_split "*ashl<mode>3_insn"
1369 [(set (match_operand:I 0 "register_operand" "=r,r")
1370 (ashift:I (match_operand:I 1 "register_operand" "r,r")
1371 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
1372 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1375 [(parallel [(set (match_dup 0)
1376 (ashift:I (match_dup 1) (match_dup 2)))
1377 (clobber (reg:CC R_FLAGS))])]
1379 [(set_attr "type" "arith")])
1381 (define_insn "*ashl<mode>3_insn<subst_arith>"
1382 [(set (match_operand:I 0 "register_operand" "=r,r")
1383 (ashift:I (match_operand:I 1 "register_operand" "r,r")
1384 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))
1385 (clobber (reg:CC R_FLAGS))]
1388 [(set_attr "type" "arith")])
1390 (define_insn "ashldi3"
1391 [(set (match_operand:DI 0 "register_operand" "=b,r")
1392 (ashift:DI (match_operand:DI 1 "register_operand" "0,r")
1393 (match_operand:QI 2 "reg_or_32_operand" "r,P")))
1394 (clobber (reg:SI R_MDC))]
1399 [(set_attr "type" "shiftdi,multi")])
1402 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1403 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
1405 (clobber (reg:SI R_MDC))]
1407 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 4))
1408 (set (subreg:SI (match_dup 0) 4) (const_int 0))]
1412 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414 ;; Arithmetic Shift Right
1416 ;; Modes QI, HI, SI and DI are supported directly.
1418 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1421 (define_expand "ashr<mode>3"
1422 [(set (match_operand:I 0 "register_operand" "")
1423 (ashiftrt:I (match_operand:I 1 "register_operand" "")
1424 (match_operand:QI 2 "reg_or_shift_operand" "")))]
1427 (define_insn_and_split "*ashr<mode>3_insn"
1428 [(set (match_operand:I 0 "register_operand" "=r,r")
1429 (ashiftrt:I (match_operand:I 1 "register_operand" "r,r")
1430 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
1431 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1434 [(parallel [(set (match_dup 0)
1435 (ashiftrt:I (match_dup 1) (match_dup 2)))
1436 (clobber (reg:CC R_FLAGS))])]
1438 [(set_attr "type" "logic")])
1440 (define_insn "*ashr<mode>3_insn<subst_logic>"
1441 [(set (match_operand:I 0 "register_operand" "=r,r")
1442 (ashiftrt:I (match_operand:I 1 "register_operand" "r,r")
1443 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))
1444 (clobber (reg:CC R_FLAGS))]
1447 [(set_attr "type" "logic")])
1449 (define_insn "ashrdi3"
1450 [(set (match_operand:DI 0 "register_operand" "=b,r")
1451 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,r")
1452 (match_operand:QI 2 "reg_or_32_operand" "r,P")))
1453 (clobber (reg:SI R_MDC))]
1458 [(set_attr "type" "shiftdi,multi")])
1461 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1462 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
1464 (clobber (reg:SI R_MDC))]
1466 [(set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 0))
1467 (parallel [(set (subreg:SI (match_dup 0) 0)
1468 (ashiftrt:SI (subreg:SI (match_dup 1) 0) (const_int 31)))
1469 (clobber (reg:CC R_FLAGS))])]
1473 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1475 ;; Logical Shift Right
1477 ;; Modes QI, HI, SI and DI are supported directly.
1479 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1482 (define_expand "lshr<mode>3"
1483 [(set (match_operand:I 0 "register_operand" "")
1484 (lshiftrt:I (match_operand:I 1 "register_operand" "")
1485 (match_operand:QI 2 "reg_or_shift_operand" "")))]
1488 (define_insn_and_split "*lshr<mode>3_insn"
1489 [(set (match_operand:I 0 "register_operand" "=r,r")
1490 (lshiftrt:I (match_operand:I 1 "register_operand" "r,r")
1491 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
1492 "ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
1495 [(parallel [(set (match_dup 0)
1496 (lshiftrt:I (match_dup 1) (match_dup 2)))
1497 (clobber (reg:CC R_FLAGS))])]
1499 [(set_attr "type" "logic")])
1501 (define_insn "*lshr<mode>3_insn<subst_logic>"
1502 [(set (match_operand:I 0 "register_operand" "=r,r")
1503 (lshiftrt:I (match_operand:I 1 "register_operand" "r,r")
1504 (match_operand:QI 2 "reg_or_shift_operand" "r,K")))
1505 (clobber (reg:CC R_FLAGS))]
1508 [(set_attr "type" "logic")])
1510 (define_insn "lshrdi3"
1511 [(set (match_operand:DI 0 "register_operand" "=b,r")
1512 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,r")
1513 (match_operand:QI 2 "reg_or_32_operand" "r,P")))
1514 (clobber (reg:SI R_MDC))]
1519 [(set_attr "type" "shiftdi,multi")])
1522 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1523 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
1525 (clobber (reg:SI R_MDC))]
1527 [(set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 0))
1528 (set (subreg:SI (match_dup 0) 0) (const_int 0))]
1532 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1536 ;; Truncations among modes QI, HI, SI and DI are supported directly.
1538 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1541 (define_expand "trunchiqi2"
1542 [(set (match_operand:QI 0 "register_operand" "")
1543 (truncate:QI (match_operand:HI 1 "register_operand" "")))]
1546 (define_insn_and_split "*trunchiqi2_insn"
1547 [(set (match_operand:QI 0 "register_operand" "=r")
1548 (truncate:QI (match_operand:HI 1 "register_operand" "r")))]
1549 "ok_for_simple_arith_logic_operands (operands, QImode)"
1552 [(parallel [(set (match_dup 0) (truncate:QI (match_dup 1)))
1553 (clobber (reg:CC R_FLAGS))])]
1555 [(set_attr "type" "logic")])
1557 (define_insn "*trunchiqi2_insn<subst_logic>"
1558 [(set (match_operand:QI 0 "register_operand" "=r")
1559 (truncate:QI (match_operand:HI 1 "register_operand" "r")))
1560 (clobber (reg:CC R_FLAGS))]
1563 [(set_attr "type" "logic")])
1565 (define_expand "truncsihi2"
1566 [(set (match_operand:HI 0 "register_operand" "")
1567 (truncate:HI (match_operand:SI 1 "register_operand" "")))]
1570 (define_insn_and_split "*truncsihi2_insn"
1571 [(set (match_operand:HI 0 "register_operand" "=r")
1572 (truncate:HI (match_operand:SI 1 "register_operand" "r")))]
1573 "ok_for_simple_arith_logic_operands (operands, HImode)"
1576 [(parallel [(set (match_dup 0) (truncate:HI (match_dup 1)))
1577 (clobber (reg:CC R_FLAGS))])]
1579 [(set_attr "type" "logic")])
1581 (define_insn "*truncsihi2_insn<subst_logic>"
1582 [(set (match_operand:HI 0 "register_operand" "=r")
1583 (truncate:HI (match_operand:SI 1 "register_operand" "r")))
1584 (clobber (reg:CC R_FLAGS))]
1587 [(set_attr "type" "logic")])
1589 (define_expand "truncdisi2"
1590 [(set (match_operand:SI 0 "register_operand" "")
1591 (truncate:SI (match_operand:DI 1 "register_operand" "")))]
1594 (define_insn_and_split "*truncdisi2_insn"
1595 [(set (match_operand:SI 0 "register_operand" "=r")
1596 (truncate:SI (match_operand:DI 1 "register_operand" "r")))]
1597 "ok_for_simple_arith_logic_operands (operands, SImode)"
1600 [(parallel [(set (match_dup 0) (truncate:SI (match_dup 1)))
1601 (clobber (reg:CC R_FLAGS))])]
1603 [(set_attr "type" "logic")])
1605 (define_insn "*truncdisi2_insn<subst_logic>"
1606 [(set (match_operand:SI 0 "register_operand" "=r")
1607 (truncate:SI (match_operand:DI 1 "register_operand" "r")))
1608 (clobber (reg:CC R_FLAGS))]
1611 [(set_attr "type" "logic")])
1614 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1618 ;; Sign-extensions among modes QI, HI, SI and DI are supported directly.
1620 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1623 (define_expand "extendqihi2"
1624 [(set (match_operand:HI 0 "register_operand" "")
1625 (sign_extend:HI (match_operand:QI 1 "register_operand" "")))]
1628 (define_insn_and_split "*extendqihi2_insn"
1629 [(set (match_operand:HI 0 "register_operand" "=r")
1630 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
1631 "ok_for_simple_arith_logic_operands (operands, HImode)"
1634 [(parallel [(set (match_dup 0) (sign_extend:HI (match_dup 1)))
1635 (clobber (reg:CC R_FLAGS))])]
1637 [(set_attr "type" "logic")])
1639 (define_insn "*extendqihi2_insn<subst_logic>"
1640 [(set (match_operand:HI 0 "register_operand" "=r")
1641 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))
1642 (clobber (reg:CC R_FLAGS))]
1645 [(set_attr "type" "logic")])
1647 (define_expand "extendqisi2"
1648 [(set (match_operand:SI 0 "register_operand" "")
1649 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
1652 (define_insn_and_split "*extendqisi2_insn"
1653 [(set (match_operand:SI 0 "register_operand" "=r")
1654 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
1655 "ok_for_simple_arith_logic_operands (operands, SImode)"
1658 [(parallel [(set (match_dup 0) (sign_extend:SI (match_dup 1)))
1659 (clobber (reg:CC R_FLAGS))])]
1661 [(set_attr "type" "logic")])
1663 (define_insn "*extendqisi2_insn<subst_logic>"
1664 [(set (match_operand:SI 0 "register_operand" "=r")
1665 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))
1666 (clobber (reg:CC R_FLAGS))]
1669 [(set_attr "type" "logic")])
1671 (define_expand "extendhisi2"
1672 [(set (match_operand:SI 0 "register_operand" "")
1673 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
1676 (define_insn_and_split "*extendhisi2_insn"
1677 [(set (match_operand:SI 0 "register_operand" "=r")
1678 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
1679 "ok_for_simple_arith_logic_operands (operands, SImode)"
1682 [(parallel [(set (match_operand:SI 0 "register_operand" "")
1683 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))
1684 (clobber (reg:CC R_FLAGS))])]
1686 [(set_attr "type" "logic")])
1688 (define_insn "*extendhisi2_insn<subst_logic>"
1689 [(set (match_operand:SI 0 "register_operand" "=r")
1690 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))
1691 (clobber (reg:CC R_FLAGS))]
1694 [(set_attr "type" "logic")])
1696 (define_expand "extendsidi2"
1697 [(set (match_operand:DI 0 "register_operand" "")
1698 (sign_extend:DI (match_operand:SI 1 "register_operand" "")))]
1701 (define_insn_and_split "*extendsidi2_insn"
1702 [(set (match_operand:DI 0 "register_operand" "=r")
1703 (sign_extend:DI (match_operand:SI 1 "register_operand" "r")))]
1704 "ok_for_simple_arith_logic_operands (operands, DImode)"
1707 [(parallel [(set (match_dup 3) (match_dup 1))
1708 (clobber (reg:CC R_FLAGS))])
1709 (parallel [(set (match_dup 2)
1710 (ashiftrt:SI (match_dup 1) (const_int 31)))
1711 (clobber (reg:CC R_FLAGS))])]
1713 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1714 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1716 [(set_attr "type" "multi")])
1719 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1723 ;; Zero-extensions among modes QI, HI, SI and DI are supported directly.
1725 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1728 ; QI is zero-extended to wider modes by shifting left and then performing
1729 ; a logical shift right to insert the zeroes. This avoids the need to use
1732 (define_expand "zero_extendqihi2"
1733 [(set (match_operand:HI 0 "register_operand" "")
1734 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
1737 (define_insn_and_split "*zero_extendqihi2_insn"
1738 [(set (match_operand:HI 0 "register_operand" "=r")
1739 (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))]
1740 "ok_for_simple_arith_logic_operands (operands, HImode)"
1743 [(parallel [(set (match_dup 0)
1744 (ashift:HI (match_dup 2) (const_int 8)))
1745 (clobber (reg:CC R_FLAGS))])
1746 (parallel [(set (match_dup 0)
1747 (lshiftrt:HI (match_dup 0) (const_int 8)))
1748 (clobber (reg:CC R_FLAGS))])]
1750 operands[2] = gen_rtx_SUBREG (HImode, operands[1], 0);
1752 [(set_attr "type" "multi")])
1754 (define_expand "zero_extendqisi2"
1755 [(set (match_operand:SI 0 "register_operand" "")
1756 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
1759 (define_insn_and_split "*zero_extendqisi2_insn"
1760 [(set (match_operand:SI 0 "register_operand" "=r")
1761 (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))]
1762 "ok_for_simple_arith_logic_operands (operands, SImode)"
1765 [(parallel [(set (match_dup 0)
1766 (ashift:SI (match_dup 2) (const_int 24)))
1767 (clobber (reg:CC R_FLAGS))])
1768 (parallel [(set (match_dup 0)
1769 (lshiftrt:SI (match_dup 0) (const_int 24)))
1770 (clobber (reg:CC R_FLAGS))])]
1772 operands[2] = gen_rtx_SUBREG (SImode, operands[1], 0);
1774 [(set_attr "type" "multi")])
1776 (define_insn "zero_extendhisi2"
1777 [(set (match_operand:SI 0 "register_operand" "=r")
1778 (zero_extend:SI (match_operand:HI 1 "register_operand" "0")))]
1781 [(set_attr "type" "imm_reg")])
1783 (define_expand "zero_extendsidi2"
1784 [(set (match_operand:DI 0 "register_operand" "")
1785 (zero_extend:DI (match_operand:SI 1 "register_operand" "")))]
1788 (define_insn_and_split "*zero_extendsidi2_insn"
1789 [(set (match_operand:DI 0 "register_operand" "=r")
1790 (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
1791 "ok_for_simple_arith_logic_operands (operands, DImode)"
1794 [(parallel [(set (match_dup 3) (match_dup 1))
1795 (clobber (reg:CC R_FLAGS))])
1796 (set (match_dup 2) (const_int 0))]
1798 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1799 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1801 [(set_attr "type" "multi")])
1804 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1808 ;; Only SI mode is supported directly.
1810 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1813 ; BITS_BIG_ENDIAN is defined to 1 so operand #1 counts from the MSB.
1815 (define_insn "*btst"
1816 [(set (reg:CC_BTST R_FLAGS)
1817 (compare:CC_BTST (zero_extract:SI
1818 (match_operand:SI 0 "register_operand" "r")
1820 (match_operand:QI 1 "const_shift_operand" "K"))
1824 [(set_attr "type" "logic")])
1827 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1829 ;; Integer comparisons
1831 ;; Modes QI, HI and SI are supported directly.
1833 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1836 (define_insn "*cmp<mode>"
1837 [(set (reg:CC R_FLAGS)
1838 (compare:CC (match_operand:I 0 "register_operand" "r")
1839 (match_operand:I 1 "reg_or_0_operand" "rO")))]
1842 [(set_attr "type" "cmp")])
1844 (define_insn "*cmp<mode>_sne"
1845 [(set (reg:CC R_FLAGS)
1846 (compare:CC (not:I (match_operand:I 0 "register_operand" "r"))
1850 [(set_attr "type" "cmp")])
1853 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1855 ;; Single float operations
1857 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1860 (define_insn "addsf3"
1861 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1862 (plus:SF (match_operand:SF 1 "fp_reg_operand" "%f")
1863 (match_operand:SF 2 "fp_reg_operand" "f")))]
1866 [(set_attr "type" "fp")])
1868 (define_insn "subsf3"
1869 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1870 (minus:SF (match_operand:SF 1 "fp_reg_operand" "f")
1871 (match_operand:SF 2 "fp_reg_operand" "f")))]
1874 [(set_attr "type" "fp")])
1876 (define_insn "mulsf3"
1877 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1878 (mult:SF (match_operand:SF 1 "fp_reg_operand" "%f")
1879 (match_operand:SF 2 "fp_reg_operand" "f")))]
1882 [(set_attr "type" "fp")])
1884 (define_insn "divsf3"
1885 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1886 (div:SF (match_operand:SF 1 "fp_reg_operand" "f")
1887 (match_operand:SF 2 "fp_reg_operand" "f")))]
1890 [(set_attr "type" "fdiv")])
1892 (define_insn "sqrtsf2"
1893 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1894 (sqrt:SF (match_operand:SF 1 "fp_reg_operand" "f")))]
1897 [(set_attr "type" "fsqrt")])
1899 (define_insn "negsf2"
1900 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1901 (neg:SF (match_operand:SF 1 "fp_reg_operand" "f")))]
1904 [(set_attr "type" "fmove")])
1906 (define_insn "abssf2"
1907 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1908 (abs:SF (match_operand:SF 1 "fp_reg_operand" "f")))]
1911 [(set_attr "type" "fmove")])
1913 (define_expand "copysignsf3"
1914 [(match_operand:SF 0 "register_operand" "")
1915 (match_operand:SF 1 "nonmemory_operand" "")
1916 (match_operand:SF 2 "register_operand" "")]
1917 "TARGET_FPU && !TARGET_FPU_IEEE"
1919 visium_expand_copysign (operands, SFmode);
1924 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1926 ;; Single float <-> single integer conversions for !TARGET_FPU_IEEE
1928 ;; An FMOVE instruction converts a signalling NaN (zero high order bit of the
1929 ;; mantissa) to a quiet NaN (-1). This is acceptable when the data to be
1930 ;; moved is in fact a floating-point number, but to avoid nasty surprises
1931 ;; integers must in general be kept out of the floating-point registers.
1932 ;; HARD_REGNO_MODE_OK thus only allows SFmode in these registers.
1933 ;; However, since FTOI and ITOF use floating-point registers for both their
1934 ;; inputs and outputs, to use these instructions integers must transiently
1935 ;; occupy such registers. To disguise this from the compiler, UNSPECs are
1936 ;; used for floating-point operations on integers and floating from general
1937 ;; register to floating-point register and fixing in the reverse direction
1938 ;; are only split into the individual UNSPEC operations after reload.
1940 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1943 (define_insn "*fload_no_ieee"
1944 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1945 (unspec:SF [(match_operand:SI 1 "register_operand" "r")] UNSPEC_FLOAD))]
1946 "TARGET_FPU && !TARGET_FPU_IEEE"
1948 [(set_attr "type" "reg_fp")])
1950 (define_insn "*itof_no_ieee"
1951 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1952 (unspec:SF [(match_operand:SF 1 "fp_reg_operand" "f")] UNSPEC_ITOF))]
1953 "TARGET_FPU && !TARGET_FPU_IEEE"
1955 [(set_attr "type" "itof")])
1957 (define_insn_and_split "*floatsisf2_no_ieee"
1958 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1959 (float:SF (match_operand:SI 1 "register_operand" "r")))]
1960 "TARGET_FPU && !TARGET_FPU_IEEE"
1962 "&& reload_completed"
1964 (unspec:SF [(match_dup 1)] UNSPEC_FLOAD))
1966 (unspec:SF [(match_dup 0)] UNSPEC_ITOF))]
1968 [(set_attr "type" "multi")])
1970 (define_insn "*ftoi_no_ieee"
1971 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
1972 (unspec:SF [(match_operand:SF 1 "fp_reg_operand" "f")] UNSPEC_FTOI))]
1973 "TARGET_FPU && !TARGET_FPU_IEEE"
1975 [(set_attr "type" "ftoi")])
1977 (define_insn "*fstore_no_ieee"
1978 [(set (match_operand:SI 0 "register_operand" "=r")
1979 (unspec:SI [(match_operand:SF 1 "fp_reg_operand" "f")] UNSPEC_FSTORE))]
1980 "TARGET_FPU && !TARGET_FPU_IEEE"
1982 [(set_attr "type" "fp_reg")])
1984 (define_insn_and_split "fix_truncsfsi2_no_ieee"
1985 [(set (match_operand:SI 0 "register_operand" "=r")
1986 (fix:SI (fix:SF (match_operand:SF 1 "fp_reg_operand" "f"))))
1987 (clobber (match_scratch:SF 2 "=1"))]
1988 "TARGET_FPU && !TARGET_FPU_IEEE"
1990 "&& reload_completed"
1992 (unspec:SF [(match_dup 1)] UNSPEC_FTOI))
1994 (unspec:SI [(match_dup 1)] UNSPEC_FSTORE))]
1996 [(set_attr "type" "multi")])
1999 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2001 ;; Single float <-> single integer conversions
2003 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2006 (define_insn "*itof"
2007 [(set (match_operand:SF 0 "fp_reg_operand" "=f")
2008 (float:SF (match_operand:SI 1 "register_operand" "f")))]
2011 [(set_attr "type" "itof")])
2013 (define_expand "floatsisf2"
2014 [(set (match_operand:SF 0 "fp_reg_operand" "")
2015 (float:SF (match_operand:SI 1 "register_operand" "")))]
2019 (define_insn "*ftoi"
2020 [(set (match_operand:SI 0 "register_operand" "=f")
2021 (fix:SI (fix:SF (match_operand:SF 1 "fp_reg_operand" "f"))))]
2024 [(set_attr "type" "ftoi")])
2026 (define_expand "fix_truncsfsi2"
2027 [(set (match_operand:SI 0 "register_operand" "")
2028 (fix:SI (fix:SF (match_operand:SF 1 "fp_reg_operand" ""))))]
2031 if (!TARGET_FPU_IEEE)
2033 emit_insn (gen_fix_truncsfsi2_no_ieee (operands[0], operands[1]));
2039 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2041 ;; Single float comparisons
2043 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2046 (define_insn "*cmpsf_fp"
2047 [(set (reg:CCFP R_FLAGS)
2048 (compare:CCFP (match_operand:SF 0 "fp_reg_or_0_operand" "fG")
2049 (match_operand:SF 1 "fp_reg_or_0_operand" "fG")))]
2050 "TARGET_FPU && reload_completed"
2052 [(set_attr "type" "fcmp")])
2054 (define_insn "*cmpsf_fpe"
2055 [(set (reg:CCFPE R_FLAGS)
2056 (compare:CCFPE (match_operand:SF 0 "fp_reg_or_0_operand" "fG")
2057 (match_operand:SF 1 "fp_reg_or_0_operand" "fG")))]
2058 "TARGET_FPU && reload_completed"
2060 [(set_attr "type" "fcmp")])
2063 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2065 ;; Conditional branch instructions
2067 ;; Note - we do not specify the two instructions necessary to perform
2068 ;; a compare-and-branch in the cbranch<mode>4 pattern because that would
2069 ;; allow the comparison to be moved away from the jump before the reload
2070 ;; pass has completed. That would be problematical because reload can
2071 ;; generate instructions in between which would clobber the CC register.
2073 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2076 (define_expand "cbranch<mode>4"
2078 (if_then_else (match_operator 0 "comparison_operator"
2079 [(match_operand:I 1 "register_operand")
2080 (match_operand:I 2 "reg_or_0_operand")])
2081 (label_ref (match_operand 3 ""))
2086 (define_insn_and_split "*cbranch<mode>4_insn"
2088 (if_then_else (match_operator 0 "comparison_operator"
2089 [(match_operand:I 1 "register_operand" "r")
2090 (match_operand:I 2 "reg_or_0_operand" "rO")])
2091 (label_ref (match_operand 3 ""))
2098 visium_split_cbranch (GET_CODE (operands[0]), operands[1], operands[2],
2102 [(set_attr "type" "cmp")])
2104 (define_insn_and_split "*cbranchsi4_btst_insn"
2106 (if_then_else (match_operator 0 "visium_btst_operator"
2108 (match_operand:SI 1 "register_operand" "r")
2110 (match_operand:QI 2 "const_shift_operand" "K"))
2112 (label_ref (match_operand 3 ""))
2119 visium_split_cbranch (GET_CODE (operands[0]), XEXP (operands[0], 0),
2120 XEXP (operands[0], 1), operands[3]);
2123 [(set_attr "type" "cmp")])
2125 (define_expand "cbranchsf4"
2127 (if_then_else (match_operator 0 "visium_fp_comparison_operator"
2128 [(match_operand:SF 1 "fp_reg_operand")
2129 (match_operand:SF 2 "fp_reg_or_0_operand")])
2130 (label_ref (match_operand 3 ""))
2135 (define_insn_and_split "*cbranchsf4_insn"
2137 (if_then_else (match_operator 0 "visium_fp_comparison_operator"
2138 [(match_operand:SF 1 "fp_reg_operand" "f")
2139 (match_operand:SF 2 "fp_reg_or_0_operand" "fG")])
2140 (label_ref (match_operand 3 ""))
2144 "&& reload_completed"
2147 visium_split_cbranch (GET_CODE (operands[0]), operands[1], operands[2],
2151 [(set_attr "type" "fcmp")])
2153 ; Now match both normal and inverted branches.
2155 (define_insn "*normal_branch"
2157 (if_then_else (match_operator 1 "visium_branch_operator"
2158 [(reg R_FLAGS) (const_int 0)])
2159 (label_ref (match_operand 0 ""))
2163 return output_cbranch (operands[0], GET_CODE (operands[1]),
2164 GET_MODE (XEXP (operands[1], 0)), 0, insn);
2166 [(set_attr "type" "branch")])
2168 (define_insn "*inverted_branch"
2170 (if_then_else (match_operator 1 "visium_branch_operator"
2171 [(reg R_FLAGS) (const_int 0)])
2173 (label_ref (match_operand 0 ""))))]
2176 return output_cbranch (operands[0], GET_CODE (operands[1]),
2177 GET_MODE (XEXP (operands[1], 0)), 1, insn);
2179 [(set_attr "type" "branch")])
2181 ; And then match both normal and inverted returns.
2183 (define_insn "*cond_<return_str>return"
2185 (if_then_else (match_operator 0 "visium_branch_operator"
2186 [(reg R_FLAGS) (const_int 0)])
2189 "<return_pred> && reload_completed"
2191 return output_cbranch (pc_rtx, GET_CODE (operands[0]),
2192 GET_MODE (XEXP (operands[0], 0)), 0, insn);
2194 [(set_attr "type" "ret")])
2196 (define_insn "*inverted_cond_<return_str>return"
2198 (if_then_else (match_operator 0 "visium_branch_operator"
2199 [(reg R_FLAGS) (const_int 0)])
2202 "<return_pred> && reload_completed"
2204 return output_cbranch (pc_rtx, GET_CODE (operands[0]),
2205 GET_MODE (XEXP (operands[0], 0)), 1, insn);
2207 [(set_attr "type" "ret")])
2210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2212 ;; Unconditional branch instructions
2214 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2219 (label_ref (match_operand 0 "" "")))]
2222 return output_ubranch (operands[0], insn);
2224 [(set_attr "type" "branch")])
2226 (define_insn "indirect_jump"
2228 (match_operand:SI 0 "register_operand" "r"))]
2230 "bra tr,%0,r0%# ;indirect jump"
2231 [(set_attr "type" "abs_branch")])
2233 (define_insn "tablejump"
2235 (match_operand:SI 0 "register_operand" "r"))
2236 (use (label_ref (match_operand 1 "" "")))]
2238 "bra tr,%0,r0%# ;tablejump"
2239 [(set_attr "type" "abs_branch")])
2242 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2244 ;; Subprogram call instructions
2246 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2249 ; Subroutine call instruction returning no value. Operand 0 is the function
2250 ; to call; operand 1 is the number of bytes of arguments pushed (in mode
2251 ; 'SImode', except it is normally a 'const_int'); operand 2 is the number of
2252 ; registers used as operands.
2254 (define_expand "call"
2255 [(parallel [(call (match_operand 0 "" "")
2256 (match_operand 1 "" ""))
2257 (use (match_operand 2 "" ""))
2258 (clobber (match_dup 3))])]
2261 if (GET_CODE (XEXP (operands[0], 0)) != REG)
2262 XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
2265 operands[2] = const0_rtx;
2267 operands[3] = gen_rtx_REG (Pmode, R_LINK);
2270 (define_insn "*call_internal"
2271 [(call (mem:SI (match_operand:SI 0 "register_operand" "l,!r"))
2272 (match_operand 1 "" ""))
2273 (use (match_operand 2 "" ""))
2274 (clobber (match_operand 3 "" ""))]
2275 "!SIBLING_CALL_P (insn)"
2276 "bra tr,%0,%3%# ;call"
2277 [(set_attr "type" "call")])
2279 ; Subroutine call instruction returning a value. Operand 0 is the hard
2280 ; register in which the value is returned. There are three more operands, the
2281 ; same as the three operands of the 'call' instruction (but with numbers
2282 ; increased by one).
2284 (define_expand "call_value"
2285 [(parallel [(set (match_operand 0 "register_operand" "")
2286 (call (match_operand 1 "" "")
2287 (match_operand 2 "" "")))
2288 (use (match_operand 3 "" ""))
2289 (clobber (match_dup 4))])]
2292 if (GET_CODE (XEXP (operands[1], 0)) != REG)
2293 XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
2296 operands[3] = const0_rtx;
2298 operands[4] = gen_rtx_REG (Pmode, R_LINK);
2301 (define_insn "*call_value_internal"
2302 [(set (match_operand 0 "register_operand" "")
2303 (call (mem:SI (match_operand:SI 1 "register_operand" "l,!r"))
2304 (match_operand 2 "" "")))
2305 (use (match_operand 3 "" ""))
2306 (clobber (match_operand 4 "" ""))]
2307 "!SIBLING_CALL_P (insn)"
2308 "bra tr,%1,%4%# ;call value"
2309 [(set_attr "type" "call")])
2311 ; Tail calls are similar, except that the link register is not used. But
2312 ; we don't use r0 as the destination register of the branch because we want
2313 ; the Branch Pre-decode Logic of the GR6 to use the Address Load Array to
2314 ; predict the branch target.
2316 (define_expand "sibcall"
2317 [(parallel [(call (match_operand 0 "" "")
2318 (match_operand 1 "" ""))
2319 (use (match_operand 2 "" ""))
2320 (clobber (match_dup 3))])]
2323 if (GET_CODE (XEXP (operands[0], 0)) != REG)
2324 XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
2327 operands[2] = const0_rtx;
2329 operands[3] = gen_rtx_SCRATCH (SImode);
2332 (define_insn "*sibcall_internal"
2333 [(call (mem:SI (match_operand:SI 0 "register_operand" "k"))
2334 (match_operand 1 "" ""))
2335 (use (match_operand 2 "" ""))
2336 (clobber (match_scratch:SI 3 "=0"))]
2337 "SIBLING_CALL_P (insn)"
2338 "bra tr,%0,%0%# ;sibcall"
2339 [(set_attr "type" "call")])
2341 (define_expand "sibcall_value"
2342 [(parallel [(set (match_operand 0 "register_operand" "")
2343 (call (match_operand 1 "" "")
2344 (match_operand 2 "" "")))
2345 (use (match_operand 3 "" ""))
2346 (clobber (match_dup 4))])]
2349 if (GET_CODE (XEXP (operands[1], 0)) != REG)
2350 XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
2353 operands[3] = const0_rtx;
2355 operands[4] = gen_rtx_SCRATCH (SImode);
2358 (define_insn "*sibcall_value_internal"
2359 [(set (match_operand 0 "register_operand" "")
2360 (call (mem:SI (match_operand:SI 1 "register_operand" "k"))
2361 (match_operand 2 "" "")))
2362 (use (match_operand 3 "" ""))
2363 (clobber (match_scratch:SI 4 "=1"))]
2364 "SIBLING_CALL_P (insn)"
2365 "bra tr,%1,%1%# ;sibcall value"
2366 [(set_attr "type" "call")])
2368 ; Call subroutine returning any type.
2369 (define_expand "untyped_call"
2370 [(parallel [(call (match_operand 0 "" "")
2372 (match_operand 1 "" "")
2373 (match_operand 2 "" "")])]
2378 emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
2380 for (i = 0; i < XVECLEN (operands[2], 0); i++)
2382 rtx set = XVECEXP (operands[2], 0, i);
2383 emit_move_insn (SET_DEST (set), SET_SRC (set));
2386 /* The optimizer does not know that the call sets the function value
2387 registers we stored in the result block. We avoid problems by
2388 claiming that all hard registers are used and clobbered at this
2390 emit_insn (gen_blockage ());
2396 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2398 ;; Compare-and-store instructions
2400 ;; Modes QI, HI, SI and SF are supported directly.
2402 ;; Note - we do not specify the two instructions necessary to perform
2403 ;; a compare-and-store in the cstore<mode>4 pattern because that would
2404 ;; allow the comparison to be moved away from the store before the reload
2405 ;; pass has completed. That would be problematical because reload can
2406 ;; generate instructions in between which would clobber the CC register.
2408 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2411 (define_expand "cstore<mode>4"
2412 [(set (match_operand:SI 0)
2413 (match_operator:SI 1 "visium_int_cstore_operator"
2414 [(match_operand:I 2 "register_operand")
2415 (match_operand:I 3 "reg_or_0_operand")]))]
2418 visium_expand_int_cstore (operands, <MODE>mode);
2422 (define_insn_and_split "*cstore<mode>4_insn"
2423 [(set (match_operand:SI 0 "register_operand" "=r")
2424 (ltu:SI (match_operand:I 1 "register_operand" "r")
2425 (match_operand:I 2 "reg_or_0_operand" "rO")))]
2431 visium_split_cstore (SET, operands[0], NULL_RTX,
2432 LTU, operands[1], operands[2]);
2435 [(set_attr "type" "cmp")])
2437 (define_insn_and_split "*neg_cstore<mode>4_insn"
2438 [(set (match_operand:SI 0 "register_operand" "=r")
2439 (neg:SI (ltu:SI (match_operand:I 1 "register_operand" "r")
2440 (match_operand:I 2 "reg_or_0_operand" "rO"))))]
2446 visium_split_cstore (NEG, operands[0], NULL_RTX,
2447 LTU, operands[1], operands[2]);
2450 [(set_attr "type" "cmp")])
2452 (define_insn_and_split "*<add_str>_cstore<mode>4_insn"
2453 [(set (match_operand:SI 0 "register_operand" "=r")
2454 (any_add:SI (match_operand:SI 1 "register_operand" "r")
2455 (ltu:SI (match_operand:I 2 "register_operand" "r")
2456 (match_operand:I 3 "reg_or_0_operand" "rO"))))]
2462 visium_split_cstore (<add_op>, operands[0], operands[1],
2463 LTU, operands[2], operands[3]);
2466 [(set_attr "type" "cmp")])
2468 (define_insn_and_split "*cstore<mode>4_sne_insn"
2469 [(set (match_operand:SI 0 "register_operand" "=r")
2470 (ltu:SI (not:I (match_operand:I 1 "register_operand" "r"))
2477 visium_split_cstore (SET, operands[0], NULL_RTX,
2478 LTU, gen_rtx_NOT (<MODE>mode, operands[1]), constm1_rtx);
2481 [(set_attr "type" "cmp")])
2483 (define_insn_and_split "*neg_cstore<mode>4_sne_insn"
2484 [(set (match_operand:SI 0 "register_operand" "=r")
2485 (neg:SI (ltu:SI (not:I (match_operand:I 1 "register_operand" "r"))
2492 visium_split_cstore (NEG, operands[0], NULL_RTX,
2493 LTU, gen_rtx_NOT (<MODE>mode, operands[1]), constm1_rtx);
2496 [(set_attr "type" "cmp")])
2498 (define_insn_and_split "*<add_str>_cstore<mode>4_sne_insn"
2499 [(set (match_operand:SI 0 "register_operand" "=r")
2500 (any_add:SI (match_operand:SI 1 "register_operand" "r")
2501 (ltu:SI (not:I (match_operand:I 2 "register_operand" "r"))
2508 visium_split_cstore (<add_op>, operands[0], operands[1],
2509 LTU, gen_rtx_NOT (<MODE>mode, operands[2]), constm1_rtx);
2512 [(set_attr "type" "cmp")])
2514 (define_expand "cstoresf4"
2515 [(set (match_operand:SI 0)
2516 (match_operator:SI 1 "visium_fp_cstore_operator"
2517 [(match_operand:SF 2 "fp_reg_operand")
2518 (match_operand:SF 3 "fp_reg_or_0_operand")]))]
2521 visium_expand_fp_cstore (operands, SFmode);
2525 (define_insn_and_split "*cstoresf4_insn"
2526 [(set (match_operand:SI 0 "register_operand" "=r")
2527 (lt:SI (match_operand:SF 1 "fp_reg_or_0_operand" "fG")
2528 (match_operand:SF 2 "fp_reg_or_0_operand" "fG")))]
2531 "&& reload_completed"
2534 visium_split_cstore (SET, operands [0], NULL_RTX,
2535 LT, operands[1], operands[2]);
2538 [(set_attr "type" "fcmp")])
2540 (define_insn_and_split "*neg_cstoresf4_insn"
2541 [(set (match_operand:SI 0 "register_operand" "=r")
2542 (neg:SI (lt:SI (match_operand:SF 1 "fp_reg_or_0_operand" "fG")
2543 (match_operand:SF 2 "fp_reg_or_0_operand" "fG"))))]
2546 "&& reload_completed"
2549 visium_split_cstore (NEG, operands [0], NULL_RTX,
2550 LT, operands[1], operands[2]);
2553 [(set_attr "type" "fcmp")])
2555 (define_insn_and_split "*<add_str>_cstoresf4_insn"
2556 [(set (match_operand:SI 0 "register_operand" "=r")
2557 (any_add:SI (match_operand:SI 1 "register_operand" "r")
2558 (lt:SI (match_operand:SF 2 "fp_reg_or_0_operand" "fG")
2559 (match_operand:SF 3 "fp_reg_or_0_operand" "fG"))))]
2562 "&& reload_completed"
2565 visium_split_cstore (<add_op>, operands [0], operands[1],
2566 LT, operands[2], operands[3]);
2569 [(set_attr "type" "fcmp")])
2572 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2574 ;; RTL pro/epilogue support
2576 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2579 ; Expand prologue in RTL
2580 (define_expand "prologue"
2584 visium_expand_prologue ();
2588 ; Expand epilogue in RTL
2589 (define_expand "epilogue"
2593 visium_expand_epilogue ();
2596 ; Expand epilogue without a final jump in RTL
2597 (define_expand "sibcall_epilogue"
2601 visium_expand_epilogue ();
2605 ; The artificial dependency on the link register is to prevent the
2606 ; frame instruction from being put in a call delay slot, which can
2607 ; confuse the CFI machinery.
2609 (define_insn "stack_save"
2610 [(set (reg:SI R_FP) (reg:SI R_SP))
2611 (use (reg:SI R_LINK))
2612 (clobber (reg:CC R_FLAGS))]
2614 "move.l fp,sp ;stack_save"
2615 [(set_attr "type" "logic")])
2617 ; The construct (mem:BLK (scratch)) is considered to alias all other
2618 ; memory accesses. Thus it can be used as a memory barrier in stack
2619 ; deallocation patterns.
2621 (define_insn "stack_restore"
2622 [(set (reg:SI R_SP) (reg:SI R_FP))
2623 (clobber (mem:BLK (scratch)))
2624 (clobber (reg:CC R_FLAGS))]
2626 "move.l sp,fp ;stack_restore"
2627 [(set_attr "type" "logic")])
2629 (define_insn "stack_pop"
2631 (plus:SI (reg:SI R_SP) (match_operand:SI 0 "add_operand" "J,r")))
2632 (clobber (mem:BLK (scratch)))
2633 (clobber (reg:CC R_FLAGS))]
2636 addi sp,%0 ;stack pop
2637 add.l sp,sp,%0 ;stack pop"
2638 [(set_attr "type" "arith")])
2640 (define_expand "<return_str>return"
2645 (define_insn "*<return_str>return_internal"
2647 "!visium_interrupt_function_p ()"
2649 return output_ubranch (pc_rtx, insn);
2651 [(set_attr "type" "ret")])
2653 (define_insn "*return_internal_interrupt"
2655 "visium_interrupt_function_p ()"
2656 "rfi\n\t nop ;return from interrupt"
2657 [(set_attr "type" "rfi")])
2660 [(unspec_volatile [(const_int 0)] UNSPECV_DSI)]
2663 [(set_attr "type" "dsi")])
2666 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2668 ;; NOP (no-op instruction)
2670 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2676 "nop ;generated nop"
2677 [(set_attr "type" "nop")])
2679 (define_insn "hazard_nop"
2680 [(unspec_volatile [(const_int 0)] UNSPEC_NOP)]
2682 "nop ;hazard avoidance nop"
2683 [(set_attr "type" "nop")])
2685 (define_insn "blockage"
2686 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
2689 [(set_attr "type" "nop")])
2692 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2694 ;; String/block operations
2696 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2699 ;; String/block move insn.
2700 ;; Argument 0 is the destination
2701 ;; Argument 1 is the source
2702 ;; Argument 2 is the length
2703 ;; Argument 3 is the alignment
2705 (define_expand "movmemsi"
2706 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
2707 (match_operand:BLK 1 "memory_operand" ""))
2708 (use (match_operand:SI 2 "general_operand" ""))
2709 (use (match_operand:SI 3 "const_int_operand" ""))])]
2712 if (visium_expand_block_move (operands))
2719 [(set (mem:BLK (reg:SI R_R1))
2720 (mem:BLK (reg:SI R_R2)))
2722 (clobber (reg:SI R_R1))
2723 (clobber (reg:SI R_R2))
2724 (clobber (reg:SI R_R3))
2725 (clobber (reg:SI R_R4))
2726 (clobber (reg:SI R_R5))
2727 (clobber (reg:SI R_R6))]
2730 [(set_attr "type" "bmi")])
2732 ;; String/block set insn.
2733 ;; Argument 0 is the destination
2734 ;; Argument 1 is the length
2735 ;; Argument 2 is the value
2736 ;; Argument 3 is the alignment
2738 (define_expand "setmemsi"
2739 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
2740 (match_operand 2 "nonmemory_operand" ""))
2741 (use (match_operand:SI 1 "general_operand" ""))
2742 (use (match_operand:SI 3 "const_int_operand" ""))])]
2745 if (visium_expand_block_set (operands))