1 1.1 mrg ;; Machine description for GNU compiler, VAX Version 2 1.19 mrg ;; Copyright (C) 1987-2022 Free Software Foundation, Inc. 3 1.1 mrg 4 1.1 mrg ;; This file is part of GCC. 5 1.1 mrg 6 1.1 mrg ;; GCC is free software; you can redistribute it and/or modify 7 1.1 mrg ;; it under the terms of the GNU General Public License as published by 8 1.1 mrg ;; the Free Software Foundation; either version 3, or (at your option) 9 1.1 mrg ;; any later version. 10 1.1 mrg 11 1.1 mrg ;; GCC is distributed in the hope that it will be useful, 12 1.1 mrg ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 1.1 mrg ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 1.1 mrg ;; GNU General Public License for more details. 15 1.1 mrg 16 1.1 mrg ;; You should have received a copy of the GNU General Public License 17 1.1 mrg ;; along with GCC; see the file COPYING3. If not see 18 1.1 mrg ;; <http://www.gnu.org/licenses/>. 19 1.1 mrg 20 1.1 mrg 21 1.1 mrg ;;- Instruction patterns. When multiple patterns apply, 22 1.1 mrg ;;- the first one in the file is chosen. 23 1.1 mrg ;;- 24 1.1 mrg ;;- See file "rtl.def" for documentation on define_insn, match_*, et al. 25 1.1 mrg 26 1.1 mrg ;; UNSPEC_VOLATILE usage: 27 1.1 mrg 28 1.3 mrg (define_c_enum "unspecv" [ 29 1.3 mrg VUNSPEC_BLOCKAGE ; 'blockage' insn to prevent scheduling across an 30 1.3 mrg ; insn in the code. 31 1.3 mrg VUNSPEC_SYNC_ISTREAM ; sequence of insns to sync the I-stream 32 1.3 mrg VUNSPEC_PEM ; 'procedure_entry_mask' insn. 33 1.12 rin 34 1.12 rin VUNSPEC_EH_RETURN 35 1.3 mrg ]) 36 1.3 mrg 37 1.19 mrg ;; UNSPEC usage: 38 1.19 mrg 39 1.19 mrg (define_c_enum "unspec" [ 40 1.19 mrg UNSPEC_SETMEM_FILL ; 'fill' operand to 'setmem' insn. 41 1.19 mrg ]) 42 1.19 mrg 43 1.1 mrg (define_constants 44 1.3 mrg [(VAX_AP_REGNUM 12) ; Register 12 contains the argument pointer 45 1.1 mrg (VAX_FP_REGNUM 13) ; Register 13 contains the frame pointer 46 1.1 mrg (VAX_SP_REGNUM 14) ; Register 14 contains the stack pointer 47 1.1 mrg (VAX_PC_REGNUM 15) ; Register 15 contains the program counter 48 1.19 mrg (VAX_PSL_REGNUM 16) ; Register 16 contains the processor status 49 1.19 mrg ; and condition codes in particular 50 1.1 mrg ] 51 1.1 mrg ) 52 1.1 mrg 53 1.1 mrg ;; Integer modes supported on VAX, with a mapping from machine mode 54 1.1 mrg ;; to mnemonic suffix. DImode is always a special case. 55 1.1 mrg (define_mode_iterator VAXint [QI HI SI]) 56 1.1 mrg (define_mode_iterator VAXintQH [QI HI]) 57 1.1 mrg (define_mode_iterator VAXintQHSD [QI HI SI DI]) 58 1.1 mrg (define_mode_attr isfx [(QI "b") (HI "w") (SI "l") (DI "q")]) 59 1.1 mrg 60 1.1 mrg ;; Similar for float modes supported on VAX. 61 1.1 mrg (define_mode_iterator VAXfp [SF DF]) 62 1.1 mrg (define_mode_attr fsfx [(SF "f") (DF "%#")]) 63 1.1 mrg 64 1.1 mrg ;; Some output patterns want integer immediates with a prefix... 65 1.1 mrg (define_mode_attr iprefx [(QI "B") (HI "H") (SI "N")]) 66 1.1 mrg 67 1.19 mrg (define_mode_iterator VAXcc [CC CCN CCNZ CCZ]) 68 1.19 mrg (define_mode_iterator VAXccnz [CCN CCNZ CCZ]) 69 1.19 mrg 70 1.19 mrg (define_code_iterator any_extract [sign_extract zero_extract]) 71 1.19 mrg 72 1.1 mrg ;; 73 1.1 mrg (include "constraints.md") 74 1.1 mrg (include "predicates.md") 75 1.1 mrg 76 1.19 mrg ;; Make instructions that set the N, N+Z, and Z condition codes respectively. 77 1.19 mrg (define_subst "subst_<mode>" 78 1.19 mrg [(set (match_operand 0 "") 79 1.19 mrg (match_operand 1 "")) 80 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 81 1.19 mrg "" 82 1.19 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 83 1.19 mrg (compare:VAXccnz (match_dup 1) 84 1.19 mrg (const_int 0))) 85 1.19 mrg (set (match_dup 0) 86 1.19 mrg (match_dup 1))]) 87 1.19 mrg 88 1.19 mrg (define_subst "subst_f<VAXccnz:mode>" 89 1.19 mrg [(set (match_operand:VAXfp 0 "") 90 1.19 mrg (match_operand:VAXfp 1 "")) 91 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 92 1.19 mrg "" 93 1.19 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 94 1.19 mrg (compare:VAXccnz (match_dup 1) 95 1.19 mrg (const_double_zero:VAXfp))) 96 1.19 mrg (set (match_dup 0) 97 1.19 mrg (match_dup 1))]) 98 1.19 mrg 99 1.19 mrg ;; Select all from the attributes below that apply to a given insn that 100 1.19 mrg ;; has a clobber on CC for the comparison elimination pass to use it in 101 1.19 mrg ;; place of a subsequent comparison instruction matching the mode used 102 1.19 mrg ;; by a comparison operator in branch. 103 1.19 mrg ;; 104 1.19 mrg ;; For example a branch doing `eq' in SImode will use `*cmpsi_ccz', so 105 1.19 mrg ;; to eliminate it a `*movsi_ccz', etc. pattern will be required via the 106 1.19 mrg ;; `ccz' substitution. Analogously for the other CC modes. 107 1.19 mrg ;; 108 1.19 mrg ;; The general `cc' mode, which sets all of the C, N, V and Z condition 109 1.19 mrg ;; codes, has to be handled specially as it makes no sense for the usual 110 1.19 mrg ;; comparison against zero, so no substitution has been defined for it. 111 1.19 mrg (define_subst_attr "ccn" "subst_ccn" "" "_ccn") 112 1.19 mrg (define_subst_attr "ccnz" "subst_ccnz" "" "_ccnz") 113 1.19 mrg (define_subst_attr "ccz" "subst_ccz" "" "_ccz") 114 1.19 mrg (define_subst_attr "fccn" "subst_fccn" "" "_ccn") 115 1.19 mrg (define_subst_attr "fccnz" "subst_fccnz" "" "_ccnz") 116 1.19 mrg (define_subst_attr "fccz" "subst_fccz" "" "_ccz") 117 1.19 mrg 118 1.19 mrg (define_insn "*cmp<VAXint:mode>_<VAXcc:mode>" 119 1.19 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 120 1.19 mrg (compare:VAXcc (match_operand:VAXint 0 "general_operand" "nrmT,nrmT") 121 1.19 mrg (match_operand:VAXint 1 "general_operand" "I,nrmT")))] 122 1.19 mrg "reload_completed" 123 1.1 mrg "@ 124 1.1 mrg tst<VAXint:isfx> %0 125 1.1 mrg cmp<VAXint:isfx> %0,%1") 126 1.1 mrg 127 1.19 mrg ;; We don't have a CMPQ instruction, but we can set the N and Z condition 128 1.19 mrg ;; codes with MOVQ, and also this comparison can be folded into a preceding 129 1.19 mrg ;; operation by the post-reload comparison elimination pass. 130 1.19 mrg (define_insn "*cmpdi_<VAXccnz:mode>" 131 1.19 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 132 1.19 mrg (compare:VAXccnz (match_operand:DI 0 "general_operand" "r,nmT") 133 1.19 mrg (match_operand:DI 1 "const_zero_operand" "I,I"))) 134 1.19 mrg (clobber (match_scratch:DI 2 "=X,r"))] 135 1.19 mrg "reload_completed" 136 1.19 mrg "@ 137 1.19 mrg movq %0,%0 138 1.19 mrg movq %0,%2") 139 1.19 mrg 140 1.19 mrg (define_insn "*cmp<VAXfp:mode>_<VAXccnz:mode>" 141 1.19 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 142 1.19 mrg (compare:VAXccnz (match_operand:VAXfp 0 "general_operand" "gF,gF") 143 1.19 mrg (match_operand:VAXfp 1 "general_operand" "G,gF")))] 144 1.19 mrg "reload_completed" 145 1.1 mrg "@ 146 1.1 mrg tst<VAXfp:fsfx> %0 147 1.1 mrg cmp<VAXfp:fsfx> %0,%1") 148 1.1 mrg 149 1.19 mrg (define_insn "*bit<VAXint:mode>_<VAXccnz:mode>" 150 1.19 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 151 1.19 mrg (compare:VAXccnz 152 1.19 mrg (and:VAXint (match_operand:VAXint 0 "general_operand" "nrmT") 153 1.19 mrg (match_operand:VAXint 1 "general_operand" "nrmT")) 154 1.19 mrg (const_int 0)))] 155 1.19 mrg "reload_completed" 156 1.1 mrg "bit<VAXint:isfx> %0,%1") 157 1.1 mrg 158 1.1 mrg ;; The VAX has no sCOND insns. It does have add/subtract with carry 159 1.1 mrg ;; which could be used to implement the sltu and sgeu patterns. However, 160 1.1 mrg ;; to do this properly requires a complete rewrite of the compare insns 161 1.1 mrg ;; to keep them together with the sltu/sgeu insns until after the 162 1.1 mrg ;; reload pass is complete. The previous implementation didn't do this 163 1.1 mrg ;; and has been deleted. 164 1.1 mrg 165 1.1 mrg 167 1.1 mrg (define_insn_and_split "mov<mode>" 168 1.1 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") 169 1.1 mrg (match_operand:VAXfp 1 "general_operand" "G,gF"))] 170 1.19 mrg "" 171 1.19 mrg "#" 172 1.19 mrg "reload_completed" 173 1.19 mrg [(parallel 174 1.19 mrg [(set (match_dup 0) 175 1.19 mrg (match_dup 1)) 176 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 177 1.19 mrg "") 178 1.19 mrg 179 1.19 mrg (define_insn "*mov<mode><fccn><fccnz><fccz>" 180 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") 181 1.19 mrg (match_operand:VAXfp 1 "general_operand" "G,gF")) 182 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 183 1.1 mrg "reload_completed" 184 1.1 mrg "@ 185 1.1 mrg clr<VAXfp:fsfx> %0 186 1.1 mrg mov<VAXfp:fsfx> %1,%0") 187 1.1 mrg 188 1.19 mrg ;; Some VAXen don't support this instruction. 189 1.19 mrg ;;(define_insn_and_split "movti" 190 1.1 mrg ;; [(set (match_operand:TI 0 "nonimmediate_operand" "=g") 191 1.1 mrg ;; (match_operand:TI 1 "general_operand" "g"))] 192 1.19 mrg ;; "" 193 1.19 mrg ;; "#" 194 1.19 mrg ;; "reload_completed" 195 1.19 mrg ;; [(parallel 196 1.19 mrg ;; [(set (match_dup 0) 197 1.19 mrg ;; (match_dup 1)) 198 1.19 mrg ;; (clobber (reg:CC VAX_PSL_REGNUM))])] 199 1.19 mrg ;; "") 200 1.19 mrg ;; 201 1.19 mrg ;;(define_insn "*movti<ccn><ccnz><ccz>" 202 1.19 mrg ;; [(set (match_operand:TI 0 "nonimmediate_operand" "=g") 203 1.19 mrg ;; (match_operand:TI 1 "general_operand" "g")) 204 1.19 mrg ;; (clobber (reg:CC VAX_PSL_REGNUM))] 205 1.19 mrg ;; "reload_completed" 206 1.1 mrg ;; "movo %1,%0") 207 1.19 mrg 208 1.1 mrg (define_insn_and_split "movdi" 209 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 210 1.1 mrg (match_operand:DI 1 "general_operand" "g"))] 211 1.19 mrg "" 212 1.19 mrg "#" 213 1.19 mrg "reload_completed" 214 1.19 mrg [(parallel 215 1.19 mrg [(set (match_dup 0) 216 1.19 mrg (match_dup 1)) 217 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 218 1.19 mrg "") 219 1.19 mrg 220 1.19 mrg ;; In some cases `vax_output_int_move' splits a `DImode' move into a pair 221 1.19 mrg ;; of `SImode' moves, in which case the flags aren't usefully set. Have 222 1.19 mrg ;; separate patterns then, for the cases where the move may and may not be 223 1.19 mrg ;; split each. We use the outer condition only so in some cases we will 224 1.19 mrg ;; fail to notice the move does not actually get split, but this is OK. 225 1.19 mrg (define_insn "*movdi_maybe_split" 226 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 227 1.19 mrg (match_operand:DI 1 "general_operand" "g")) 228 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 229 1.19 mrg "reload_completed && vax_maybe_split_dimode_move (operands)" 230 1.19 mrg "* return vax_output_int_move (insn, operands, DImode);") 231 1.19 mrg 232 1.19 mrg (define_insn "*movdi_unsplit<ccn><ccnz><ccz>" 233 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 234 1.19 mrg (match_operand:DI 1 "general_operand" "g")) 235 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 236 1.1 mrg "reload_completed && !vax_maybe_split_dimode_move (operands)" 237 1.1 mrg "* return vax_output_int_move (insn, operands, DImode);") 238 1.1 mrg 239 1.1 mrg ;; The VAX move instructions have space-time tradeoffs. On a MicroVAX 240 1.1 mrg ;; register-register mov instructions take 3 bytes and 2 CPU cycles. clrl 241 1.1 mrg ;; takes 2 bytes and 3 cycles. mov from constant to register takes 2 cycles 242 1.1 mrg ;; if the constant is smaller than 4 bytes, 3 cycles for a longword 243 1.1 mrg ;; constant. movz, mneg, and mcom are as fast as mov, so movzwl is faster 244 1.1 mrg ;; than movl for positive constants that fit in 16 bits but not 6 bits. cvt 245 1.1 mrg ;; instructions take 4 cycles. inc takes 3 cycles. The machine description 246 1.1 mrg ;; is willing to trade 1 byte for 1 cycle (clrl instead of movl $0; cvtwl 247 1.1 mrg ;; instead of movl). 248 1.1 mrg 249 1.1 mrg ;; Cycle counts for other models may vary (on a VAX 750 they are similar, 250 1.1 mrg ;; but on a VAX 9000 most move and add instructions with one constant 251 1.1 mrg ;; operand take 1 cycle). 252 1.1 mrg 253 1.1 mrg ;; Loads of constants between 64 and 128 used to be done with 254 1.1 mrg ;; "addl3 $63,#,dst" but this is slower than movzbl and takes as much space. 255 1.1 mrg 256 1.1 mrg (define_expand "movsi" 257 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "") 258 1.1 mrg (match_operand:SI 1 "general_operand" ""))] 259 1.1 mrg "" 260 1.1 mrg " 261 1.1 mrg { 262 1.1 mrg #ifdef NO_EXTERNAL_INDIRECT_ADDRESS 263 1.1 mrg if (flag_pic 264 1.1 mrg && GET_CODE (operands[1]) == CONST 265 1.1 mrg && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == SYMBOL_REF 266 1.1 mrg && !SYMBOL_REF_LOCAL_P (XEXP (XEXP (operands[1], 0), 0))) 267 1.1 mrg { 268 1.1 mrg rtx symbol_ref = XEXP (XEXP (operands[1], 0), 0); 269 1.1 mrg rtx const_int = XEXP (XEXP (operands[1], 0), 1); 270 1.1 mrg rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); 271 1.1 mrg emit_move_insn (temp, symbol_ref); 272 1.1 mrg emit_move_insn (operands[0], gen_rtx_PLUS (SImode, temp, const_int)); 273 1.1 mrg DONE; 274 1.1 mrg } 275 1.1 mrg #endif 276 1.1 mrg }") 277 1.19 mrg 278 1.19 mrg ;; Split a store of the upper half of a 64 bit value in memory into 279 1.19 mrg ;; two operations. 280 1.19 mrg (define_split 281 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "") 282 1.19 mrg (subreg:SI 283 1.19 mrg (match_operand:DI 1 "indexed_memory_operand" "") 284 1.19 mrg 4 285 1.19 mrg ) 286 1.19 mrg ) 287 1.19 mrg (clobber (match_scratch:DI 2 "")) 288 1.19 mrg ] 289 1.19 mrg "" 290 1.19 mrg [ 291 1.19 mrg (set (match_dup 2) 292 1.19 mrg (match_dup 1) 293 1.19 mrg ) 294 1.19 mrg (set (match_dup 0) 295 1.19 mrg (subreg:SI (match_dup 2) 4) 296 1.19 mrg ) 297 1.19 mrg ] 298 1.19 mrg ) 299 1.19 mrg 300 1.1 mrg (define_insn_and_split "movsi_2" 301 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 302 1.1 mrg (match_operand:SI 1 "nonsymbolic_operand" "nrmT"))] 303 1.19 mrg "" 304 1.19 mrg "#" 305 1.19 mrg "reload_completed" 306 1.19 mrg [(parallel 307 1.19 mrg [(set (match_dup 0) 308 1.19 mrg (match_dup 1)) 309 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 310 1.19 mrg "") 311 1.19 mrg 312 1.19 mrg (define_insn "*movsi_2<ccn><ccnz><ccz>" 313 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 314 1.19 mrg (match_operand:SI 1 "nonsymbolic_operand" "nrmT")) 315 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 316 1.1 mrg "reload_completed" 317 1.1 mrg "* return vax_output_int_move (insn, operands, SImode);") 318 1.19 mrg 319 1.1 mrg (define_insn_and_split "mov<mode>" 320 1.1 mrg [(set (match_operand:VAXintQH 0 "nonimmediate_operand" "=g") 321 1.1 mrg (match_operand:VAXintQH 1 "general_operand" "g"))] 322 1.19 mrg "" 323 1.19 mrg "#" 324 1.19 mrg "reload_completed" 325 1.19 mrg [(parallel 326 1.19 mrg [(set (match_dup 0) 327 1.19 mrg (match_dup 1)) 328 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 329 1.19 mrg "") 330 1.19 mrg 331 1.19 mrg (define_insn "*mov<mode><ccn><ccnz><ccz>" 332 1.19 mrg [(set (match_operand:VAXintQH 0 "nonimmediate_operand" "=g") 333 1.19 mrg (match_operand:VAXintQH 1 "general_operand" "g")) 334 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 335 1.1 mrg "reload_completed" 336 1.1 mrg "* return vax_output_int_move (insn, operands, <MODE>mode);") 337 1.19 mrg 338 1.19 mrg (define_insn_and_split "movstricthi" 339 1.1 mrg [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r")) 340 1.1 mrg (match_operand:HI 1 "general_operand" "g"))] 341 1.19 mrg "" 342 1.19 mrg "#" 343 1.19 mrg "reload_completed" 344 1.19 mrg [(parallel 345 1.19 mrg [(set (strict_low_part (match_dup 0)) 346 1.19 mrg (match_dup 1)) 347 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 348 1.19 mrg "") 349 1.19 mrg 350 1.19 mrg (define_insn "*movstricthi<ccn><ccnz><ccz>" 351 1.19 mrg [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r")) 352 1.19 mrg (match_operand:HI 1 "general_operand" "g")) 353 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 354 1.1 mrg "reload_completed" 355 1.1 mrg "* 356 1.1 mrg { 357 1.1 mrg if (CONST_INT_P (operands[1])) 358 1.1 mrg { 359 1.1 mrg int i = INTVAL (operands[1]); 360 1.1 mrg if (i == 0) 361 1.1 mrg return \"clrw %0\"; 362 1.1 mrg else if ((unsigned int)i < 64) 363 1.1 mrg return \"movw %1,%0\"; 364 1.1 mrg else if ((unsigned int)~i < 64) 365 1.1 mrg return \"mcomw %H1,%0\"; 366 1.1 mrg else if ((unsigned int)i < 256) 367 1.1 mrg return \"movzbw %1,%0\"; 368 1.1 mrg } 369 1.1 mrg return \"movw %1,%0\"; 370 1.1 mrg }") 371 1.19 mrg 372 1.19 mrg (define_insn_and_split "movstrictqi" 373 1.1 mrg [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r")) 374 1.1 mrg (match_operand:QI 1 "general_operand" "g"))] 375 1.19 mrg "" 376 1.19 mrg "#" 377 1.19 mrg "reload_completed" 378 1.19 mrg [(parallel 379 1.19 mrg [(set (strict_low_part (match_dup 0)) 380 1.19 mrg (match_dup 1)) 381 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 382 1.19 mrg "") 383 1.19 mrg 384 1.19 mrg (define_insn "*movstrictqi<ccn><ccnz><ccz>" 385 1.19 mrg [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r")) 386 1.19 mrg (match_operand:QI 1 "general_operand" "g")) 387 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 388 1.1 mrg "reload_completed" 389 1.1 mrg "* 390 1.1 mrg { 391 1.1 mrg if (CONST_INT_P (operands[1])) 392 1.1 mrg { 393 1.1 mrg int i = INTVAL (operands[1]); 394 1.1 mrg if (i == 0) 395 1.1 mrg return \"clrb %0\"; 396 1.1 mrg else if ((unsigned int)~i < 64) 397 1.1 mrg return \"mcomb %B1,%0\"; 398 1.1 mrg } 399 1.1 mrg return \"movb %1,%0\"; 400 1.1 mrg }") 401 1.1 mrg 402 1.19 mrg ;; This is here to accept 4 arguments and pass the first 3 along 403 1.11 mrg ;; to the movmemhi1 pattern that really does the work. 404 1.19 mrg (define_expand "cpymemhi" 405 1.19 mrg [(set (match_operand:BLK 0 "memory_operand" "") 406 1.19 mrg (match_operand:BLK 1 "memory_operand" "")) 407 1.1 mrg (use (match_operand:HI 2 "general_operand" "")) 408 1.1 mrg (match_operand 3 "" "")] 409 1.1 mrg "" 410 1.1 mrg " 411 1.19 mrg { 412 1.1 mrg emit_insn (gen_movmemhi1 (operands[0], operands[1], operands[2])); 413 1.1 mrg DONE; 414 1.1 mrg }") 415 1.19 mrg 416 1.19 mrg (define_expand "movmemhi" 417 1.19 mrg [(set (match_operand:BLK 0 "memory_operand" "") 418 1.19 mrg (match_operand:BLK 1 "memory_operand" "")) 419 1.19 mrg (use (match_operand:HI 2 "general_operand" "")) 420 1.19 mrg (match_operand 3 "" "")] 421 1.19 mrg "" 422 1.19 mrg " 423 1.19 mrg { 424 1.19 mrg emit_insn (gen_movmemhi1 (operands[0], operands[1], operands[2])); 425 1.19 mrg DONE; 426 1.11 mrg }") 427 1.1 mrg 428 1.1 mrg ;; The definition of this insn does not really explain what it does, 429 1.1 mrg ;; but it should suffice 430 1.1 mrg ;; that anything generated as this insn will be recognized as one 431 1.1 mrg ;; and that it won't successfully combine with anything. 432 1.19 mrg 433 1.1 mrg (define_insn_and_split "movmemhi1" 434 1.1 mrg [(set (match_operand:BLK 0 "memory_operand" "=o") 435 1.1 mrg (match_operand:BLK 1 "memory_operand" "o")) 436 1.1 mrg (use (match_operand:HI 2 "general_operand" "g")) 437 1.1 mrg (clobber (reg:SI 0)) 438 1.1 mrg (clobber (reg:SI 1)) 439 1.1 mrg (clobber (reg:SI 2)) 440 1.1 mrg (clobber (reg:SI 3)) 441 1.1 mrg (clobber (reg:SI 4)) 442 1.1 mrg (clobber (reg:SI 5))] 443 1.19 mrg "" 444 1.19 mrg "#" 445 1.19 mrg "reload_completed" 446 1.19 mrg [(parallel 447 1.19 mrg [(set (match_dup 0) 448 1.19 mrg (match_dup 1)) 449 1.19 mrg (use (match_dup 2)) 450 1.19 mrg (clobber (reg:SI 0)) 451 1.19 mrg (clobber (reg:SI 1)) 452 1.19 mrg (clobber (reg:SI 2)) 453 1.19 mrg (clobber (reg:SI 3)) 454 1.19 mrg (clobber (reg:SI 4)) 455 1.19 mrg (clobber (reg:SI 5)) 456 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 457 1.19 mrg "") 458 1.19 mrg 459 1.19 mrg (define_insn "*movmemhi1" 460 1.19 mrg [(set (match_operand:BLK 0 "memory_operand" "=o") 461 1.19 mrg (match_operand:BLK 1 "memory_operand" "o")) 462 1.19 mrg (use (match_operand:HI 2 "general_operand" "g")) 463 1.19 mrg (clobber (reg:SI 0)) 464 1.19 mrg (clobber (reg:SI 1)) 465 1.19 mrg (clobber (reg:SI 2)) 466 1.19 mrg (clobber (reg:SI 3)) 467 1.19 mrg (clobber (reg:SI 4)) 468 1.19 mrg (clobber (reg:SI 5)) 469 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 470 1.1 mrg "reload_completed" 471 1.19 mrg "movc3 %2,%1,%0") 472 1.19 mrg 473 1.19 mrg ;; This is here to accept 4 arguments and pass the first 3 along 474 1.19 mrg ;; to the setmemhi1 pattern that really does the work. 475 1.19 mrg (define_expand "setmemhi" 476 1.19 mrg [(set (match_operand:BLK 0 "memory_operand" "") 477 1.19 mrg (match_operand:QI 2 "general_operand" "")) 478 1.19 mrg (use (match_operand:HI 1 "general_operand" "")) 479 1.19 mrg (match_operand 3 "" "")] 480 1.19 mrg "" 481 1.19 mrg " 482 1.19 mrg { 483 1.19 mrg emit_insn (gen_setmemhi1 (operands[0], operands[1], operands[2])); 484 1.19 mrg DONE; 485 1.19 mrg }") 486 1.19 mrg 487 1.19 mrg ;; The srcaddr operand of MOVC5 is not dereferenced if srclen is zero, so we 488 1.19 mrg ;; set it to (%ap) somewhat arbitrarily chosen for the shortest encoding. 489 1.19 mrg (define_insn_and_split "setmemhi1" 490 1.19 mrg [(set (match_operand:BLK 0 "memory_operand" "=o") 491 1.19 mrg (unspec:BLK [(use (match_operand:QI 2 "general_operand" "g"))] 492 1.19 mrg UNSPEC_SETMEM_FILL)) 493 1.19 mrg (use (match_operand:HI 1 "general_operand" "g")) 494 1.19 mrg (clobber (reg:SI 0)) 495 1.19 mrg (clobber (reg:SI 1)) 496 1.19 mrg (clobber (reg:SI 2)) 497 1.19 mrg (clobber (reg:SI 3)) 498 1.19 mrg (clobber (reg:SI 4)) 499 1.19 mrg (clobber (reg:SI 5))] 500 1.19 mrg "" 501 1.19 mrg "#" 502 1.19 mrg "reload_completed" 503 1.19 mrg [(parallel 504 1.19 mrg [(set (match_dup 0) 505 1.19 mrg (unspec:BLK [(use (match_dup 2))] UNSPEC_SETMEM_FILL)) 506 1.19 mrg (use (match_dup 1)) 507 1.19 mrg (clobber (reg:SI 0)) 508 1.19 mrg (clobber (reg:SI 1)) 509 1.19 mrg (clobber (reg:SI 2)) 510 1.19 mrg (clobber (reg:SI 3)) 511 1.19 mrg (clobber (reg:SI 4)) 512 1.19 mrg (clobber (reg:SI 5)) 513 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 514 1.19 mrg "") 515 1.19 mrg 516 1.19 mrg (define_insn "*setmemhi1" 517 1.19 mrg [(set (match_operand:BLK 0 "memory_operand" "=o") 518 1.19 mrg (unspec:BLK [(use (match_operand:QI 2 "general_operand" "g"))] 519 1.19 mrg UNSPEC_SETMEM_FILL)) 520 1.19 mrg (use (match_operand:HI 1 "general_operand" "g")) 521 1.19 mrg (clobber (reg:SI 0)) 522 1.19 mrg (clobber (reg:SI 1)) 523 1.19 mrg (clobber (reg:SI 2)) 524 1.19 mrg (clobber (reg:SI 3)) 525 1.19 mrg (clobber (reg:SI 4)) 526 1.19 mrg (clobber (reg:SI 5)) 527 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 528 1.19 mrg "reload_completed" 529 1.1 mrg "movc5 $0,(%%ap),%2,%1,%0") 530 1.1 mrg 532 1.19 mrg ;; Extension and truncation insns. 533 1.1 mrg 534 1.1 mrg (define_insn_and_split "truncsiqi2" 535 1.1 mrg [(set (match_operand:QI 0 "nonimmediate_operand" "=g") 536 1.19 mrg (truncate:QI (match_operand:SI 1 "nonimmediate_operand" "nrmT")))] 537 1.19 mrg "" 538 1.19 mrg "#" 539 1.19 mrg "reload_completed" 540 1.19 mrg [(parallel 541 1.19 mrg [(set (match_dup 0) 542 1.19 mrg (truncate:QI (match_dup 1))) 543 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 544 1.19 mrg "") 545 1.19 mrg 546 1.19 mrg (define_insn "*truncsiqi2<ccn><ccnz><ccz>" 547 1.19 mrg [(set (match_operand:QI 0 "nonimmediate_operand" "=g") 548 1.19 mrg (truncate:QI (match_operand:SI 1 "nonimmediate_operand" "nrmT"))) 549 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 550 1.1 mrg "reload_completed" 551 1.19 mrg "cvtlb %1,%0") 552 1.1 mrg 553 1.1 mrg (define_insn_and_split "truncsihi2" 554 1.1 mrg [(set (match_operand:HI 0 "nonimmediate_operand" "=g") 555 1.19 mrg (truncate:HI (match_operand:SI 1 "nonimmediate_operand" "nrmT")))] 556 1.19 mrg "" 557 1.19 mrg "#" 558 1.19 mrg "reload_completed" 559 1.19 mrg [(parallel 560 1.19 mrg [(set (match_dup 0) 561 1.19 mrg (truncate:HI (match_dup 1))) 562 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 563 1.19 mrg "") 564 1.19 mrg 565 1.19 mrg (define_insn "*truncsihi2<ccn><ccnz><ccz>" 566 1.19 mrg [(set (match_operand:HI 0 "nonimmediate_operand" "=g") 567 1.19 mrg (truncate:HI (match_operand:SI 1 "nonimmediate_operand" "nrmT"))) 568 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 569 1.1 mrg "reload_completed" 570 1.19 mrg "cvtlw %1,%0") 571 1.1 mrg 572 1.1 mrg (define_insn_and_split "trunchiqi2" 573 1.1 mrg [(set (match_operand:QI 0 "nonimmediate_operand" "=g") 574 1.19 mrg (truncate:QI (match_operand:HI 1 "nonimmediate_operand" "g")))] 575 1.19 mrg "" 576 1.19 mrg "#" 577 1.19 mrg "reload_completed" 578 1.19 mrg [(parallel 579 1.19 mrg [(set (match_dup 0) 580 1.19 mrg (truncate:QI (match_dup 1))) 581 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 582 1.19 mrg "") 583 1.19 mrg 584 1.19 mrg (define_insn "*trunchiqi2<ccn><ccnz><ccz>" 585 1.19 mrg [(set (match_operand:QI 0 "nonimmediate_operand" "=g") 586 1.19 mrg (truncate:QI (match_operand:HI 1 "nonimmediate_operand" "g"))) 587 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 588 1.1 mrg "reload_completed" 589 1.19 mrg "cvtwb %1,%0") 590 1.1 mrg 591 1.1 mrg (define_insn_and_split "extendhisi2" 592 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 593 1.19 mrg (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))] 594 1.19 mrg "" 595 1.19 mrg "#" 596 1.19 mrg "reload_completed" 597 1.19 mrg [(parallel 598 1.19 mrg [(set (match_dup 0) 599 1.19 mrg (sign_extend:SI (match_dup 1))) 600 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 601 1.19 mrg "") 602 1.19 mrg 603 1.19 mrg (define_insn "*extendhisi2<ccn><ccnz><ccz>" 604 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 605 1.19 mrg (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g"))) 606 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 607 1.1 mrg "reload_completed" 608 1.19 mrg "cvtwl %1,%0") 609 1.1 mrg 610 1.1 mrg (define_insn_and_split "extendqihi2" 611 1.1 mrg [(set (match_operand:HI 0 "nonimmediate_operand" "=g") 612 1.19 mrg (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))] 613 1.19 mrg "" 614 1.19 mrg "#" 615 1.19 mrg "reload_completed" 616 1.19 mrg [(parallel 617 1.19 mrg [(set (match_dup 0) 618 1.19 mrg (sign_extend:HI (match_dup 1))) 619 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 620 1.19 mrg "") 621 1.19 mrg 622 1.19 mrg (define_insn "*extendqihi2<ccn><ccnz><ccz>" 623 1.19 mrg [(set (match_operand:HI 0 "nonimmediate_operand" "=g") 624 1.19 mrg (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g"))) 625 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 626 1.1 mrg "reload_completed" 627 1.19 mrg "cvtbw %1,%0") 628 1.1 mrg 629 1.1 mrg (define_insn_and_split "extendqisi2" 630 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 631 1.19 mrg (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))] 632 1.19 mrg "" 633 1.19 mrg "#" 634 1.19 mrg "reload_completed" 635 1.19 mrg [(parallel 636 1.19 mrg [(set (match_dup 0) 637 1.19 mrg (sign_extend:SI (match_dup 1))) 638 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 639 1.19 mrg "") 640 1.19 mrg 641 1.19 mrg (define_insn "*extendqisi2<ccn><ccnz><ccz>" 642 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 643 1.19 mrg (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g"))) 644 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 645 1.1 mrg "reload_completed" 646 1.19 mrg "cvtbl %1,%0") 647 1.1 mrg 648 1.1 mrg (define_insn_and_split "extendsfdf2" 649 1.1 mrg [(set (match_operand:DF 0 "nonimmediate_operand" "=g") 650 1.19 mrg (float_extend:DF (match_operand:SF 1 "general_operand" "gF")))] 651 1.19 mrg "" 652 1.19 mrg "#" 653 1.19 mrg "reload_completed" 654 1.19 mrg [(parallel 655 1.19 mrg [(set (match_dup 0) 656 1.19 mrg (float_extend:DF (match_dup 1))) 657 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 658 1.19 mrg "") 659 1.19 mrg 660 1.19 mrg (define_insn "*extendsfdf2<fccn><fccnz><fccz>" 661 1.19 mrg [(set (match_operand:DF 0 "nonimmediate_operand" "=g") 662 1.19 mrg (float_extend:DF (match_operand:SF 1 "general_operand" "gF"))) 663 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 664 1.1 mrg "reload_completed" 665 1.19 mrg "cvtf%# %1,%0") 666 1.1 mrg 667 1.1 mrg (define_insn_and_split "truncdfsf2" 668 1.1 mrg [(set (match_operand:SF 0 "nonimmediate_operand" "=g") 669 1.19 mrg (float_truncate:SF (match_operand:DF 1 "general_operand" "gF")))] 670 1.19 mrg "" 671 1.19 mrg "#" 672 1.19 mrg "reload_completed" 673 1.19 mrg [(parallel 674 1.19 mrg [(set (match_dup 0) 675 1.19 mrg (float_truncate:SF (match_dup 1))) 676 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 677 1.19 mrg "") 678 1.19 mrg 679 1.19 mrg (define_insn "*truncdfsf2<fccn><fccnz><fccz>" 680 1.19 mrg [(set (match_operand:SF 0 "nonimmediate_operand" "=g") 681 1.19 mrg (float_truncate:SF (match_operand:DF 1 "general_operand" "gF"))) 682 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 683 1.1 mrg "reload_completed" 684 1.19 mrg "cvt%#f %1,%0") 685 1.1 mrg 686 1.1 mrg (define_insn_and_split "zero_extendhisi2" 687 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 688 1.19 mrg (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))] 689 1.19 mrg "" 690 1.19 mrg "#" 691 1.19 mrg "reload_completed" 692 1.19 mrg [(parallel 693 1.19 mrg [(set (match_dup 0) 694 1.19 mrg (zero_extend:SI (match_dup 1))) 695 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 696 1.19 mrg "") 697 1.19 mrg 698 1.19 mrg (define_insn "*zero_extendhisi2<ccn><ccnz><ccz>" 699 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 700 1.19 mrg (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g"))) 701 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 702 1.1 mrg "reload_completed" 703 1.19 mrg "movzwl %1,%0") 704 1.1 mrg 705 1.1 mrg (define_insn_and_split "zero_extendqihi2" 706 1.1 mrg [(set (match_operand:HI 0 "nonimmediate_operand" "=g") 707 1.19 mrg (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))] 708 1.19 mrg "" 709 1.19 mrg "#" 710 1.19 mrg "reload_completed" 711 1.19 mrg [(parallel 712 1.19 mrg [(set (match_dup 0) 713 1.19 mrg (zero_extend:HI (match_dup 1))) 714 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 715 1.19 mrg "") 716 1.19 mrg 717 1.19 mrg (define_insn "*zero_extendqihi2<ccn><ccnz><ccz>" 718 1.19 mrg [(set (match_operand:HI 0 "nonimmediate_operand" "=g") 719 1.19 mrg (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g"))) 720 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 721 1.1 mrg "reload_completed" 722 1.19 mrg "movzbw %1,%0") 723 1.1 mrg 724 1.1 mrg (define_insn_and_split "zero_extendqisi2" 725 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 726 1.19 mrg (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))] 727 1.19 mrg "" 728 1.19 mrg "#" 729 1.19 mrg "reload_completed" 730 1.19 mrg [(parallel 731 1.19 mrg [(set (match_dup 0) 732 1.19 mrg (zero_extend:SI (match_dup 1))) 733 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 734 1.19 mrg "") 735 1.19 mrg 736 1.19 mrg (define_insn "*zero_extendqisi2<ccn><ccnz><ccz>" 737 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 738 1.19 mrg (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g"))) 739 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 740 1.1 mrg "reload_completed" 741 1.1 mrg "movzbl %1,%0") 742 1.1 mrg 744 1.1 mrg ;; Fix-to-float conversion insns. 745 1.1 mrg 746 1.1 mrg (define_insn_and_split "float<VAXint:mode><VAXfp:mode>2" 747 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g") 748 1.19 mrg (float:VAXfp (match_operand:VAXint 1 "nonimmediate_operand" "g")))] 749 1.19 mrg "" 750 1.19 mrg "#" 751 1.19 mrg "reload_completed" 752 1.19 mrg [(parallel 753 1.19 mrg [(set (match_dup 0) 754 1.19 mrg (float:VAXfp (match_dup 1))) 755 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 756 1.19 mrg "") 757 1.19 mrg 758 1.19 mrg (define_insn "*float<VAXint:mode><VAXfp:mode>2<fccn><fccnz><fccz>" 759 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g") 760 1.1 mrg (float:VAXfp (match_operand:VAXint 1 "nonimmediate_operand" "g"))) 761 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 762 1.1 mrg "reload_completed" 763 1.1 mrg "cvt<VAXint:isfx><VAXfp:fsfx> %1,%0") 764 1.19 mrg 765 1.1 mrg ;; Float-to-fix conversion insns. 766 1.3 mrg 767 1.1 mrg (define_insn_and_split "fix_trunc<VAXfp:mode><VAXint:mode>2" 768 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 769 1.19 mrg (fix:VAXint (match_operand:VAXfp 1 "general_operand" "gF")))] 770 1.19 mrg "" 771 1.19 mrg "#" 772 1.19 mrg "reload_completed" 773 1.19 mrg [(parallel 774 1.19 mrg [(set (match_dup 0) 775 1.19 mrg (fix:VAXint (match_dup 1))) 776 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 777 1.19 mrg "") 778 1.19 mrg 779 1.19 mrg (define_insn "*fix_trunc<VAXfp:mode><VAXint:mode>2<ccn><ccnz><ccz>" 780 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 781 1.1 mrg (fix:VAXint (match_operand:VAXfp 1 "general_operand" "gF"))) 782 1.3 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 783 1.3 mrg "reload_completed" 784 1.3 mrg "cvt<VAXfp:fsfx><VAXint:isfx> %1,%0") 785 1.3 mrg 786 1.3 mrg (define_expand "fixuns_trunc<VAXfp:mode><VAXint:mode>2" 787 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "") 788 1.1 mrg (fix:VAXint (match_operand:VAXfp 1 "general_operand")))] 789 1.1 mrg "") 790 1.19 mrg 792 1.1 mrg ;;- All kinds of add instructions. 793 1.1 mrg 794 1.1 mrg (define_insn_and_split "add<mode>3" 795 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g") 796 1.19 mrg (plus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF") 797 1.19 mrg (match_operand:VAXfp 2 "general_operand" "gF,0,gF")))] 798 1.19 mrg "" 799 1.19 mrg "#" 800 1.19 mrg "reload_completed" 801 1.19 mrg [(parallel 802 1.19 mrg [(set (match_dup 0) 803 1.19 mrg (plus:VAXfp (match_dup 1) 804 1.19 mrg (match_dup 2))) 805 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 806 1.19 mrg "") 807 1.19 mrg 808 1.19 mrg (define_insn "*add<mode>3<fccn><fccnz><fccz>" 809 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g") 810 1.1 mrg (plus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF") 811 1.1 mrg (match_operand:VAXfp 2 "general_operand" "gF,0,gF"))) 812 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 813 1.1 mrg "reload_completed" 814 1.1 mrg "@ 815 1.19 mrg add<VAXfp:fsfx>2 %2,%0 816 1.1 mrg add<VAXfp:fsfx>2 %1,%0 817 1.1 mrg add<VAXfp:fsfx>3 %1,%2,%0") 818 1.3 mrg 819 1.1 mrg (define_insn_and_split "add<mode>3" 820 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 821 1.19 mrg (plus:VAXint (match_operand:VAXint 1 "general_operand" "nrmT") 822 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT")))] 823 1.19 mrg "" 824 1.19 mrg "#" 825 1.19 mrg "reload_completed" 826 1.19 mrg [(parallel 827 1.19 mrg [(set (match_dup 0) 828 1.19 mrg (plus:VAXint (match_dup 1) 829 1.19 mrg (match_dup 2))) 830 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 831 1.19 mrg "") 832 1.19 mrg 833 1.19 mrg (define_insn "*add<mode>3<ccn><ccnz><ccz>" 834 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 835 1.1 mrg (plus:VAXint (match_operand:VAXint 1 "general_operand" "nrmT") 836 1.1 mrg (match_operand:VAXint 2 "general_operand" "nrmT"))) 837 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 838 1.1 mrg "reload_completed" 839 1.1 mrg "* return vax_output_int_add (insn, operands, <MODE>mode);") 840 1.1 mrg 841 1.1 mrg (define_expand "adddi3" 842 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 843 1.1 mrg (plus:DI (match_operand:DI 1 "general_operand" "g") 844 1.19 mrg (match_operand:DI 2 "general_operand" "g")))] 845 1.1 mrg "!reload_in_progress" 846 1.1 mrg "vax_expand_addsub_di_operands (operands, PLUS); DONE;") 847 1.1 mrg 848 1.1 mrg (define_insn_and_split "adcdi3" 849 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=Rr") 850 1.19 mrg (plus:DI (match_operand:DI 1 "general_addsub_di_operand" "%0") 851 1.19 mrg (match_operand:DI 2 "general_addsub_di_operand" "nRr")))] 852 1.19 mrg "TARGET_QMATH" 853 1.19 mrg "#" 854 1.19 mrg "&& reload_completed" 855 1.19 mrg [(parallel 856 1.19 mrg [(set (match_dup 0) 857 1.19 mrg (plus:DI (match_dup 1) 858 1.19 mrg (match_dup 2))) 859 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 860 1.19 mrg "") 861 1.19 mrg 862 1.19 mrg (define_insn "*adcdi3<ccn>" 863 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=Rr") 864 1.1 mrg (plus:DI (match_operand:DI 1 "general_addsub_di_operand" "%0") 865 1.1 mrg (match_operand:DI 2 "general_addsub_di_operand" "nRr"))) 866 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 867 1.19 mrg "TARGET_QMATH && reload_completed" 868 1.1 mrg "* return vax_output_int_add (insn, operands, DImode);") 869 1.1 mrg 870 1.1 mrg ;; The add-with-carry (adwc) instruction only accepts two operands. 871 1.1 mrg (define_insn_and_split "adddi3_old" 872 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=ro>,ro>") 873 1.19 mrg (plus:DI (match_operand:DI 1 "general_operand" "%0,ro>") 874 1.19 mrg (match_operand:DI 2 "general_operand" "Fsro,Fs")))] 875 1.19 mrg "!TARGET_QMATH" 876 1.19 mrg "#" 877 1.19 mrg "&& reload_completed" 878 1.19 mrg [(parallel 879 1.19 mrg [(set (match_dup 0) 880 1.19 mrg (plus:DI (match_dup 1) 881 1.19 mrg (match_dup 2))) 882 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 883 1.19 mrg "") 884 1.19 mrg 885 1.19 mrg (define_insn "*adddi3_old<ccn>" 886 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=ro>,ro>") 887 1.1 mrg (plus:DI (match_operand:DI 1 "general_operand" "%0,ro>") 888 1.1 mrg (match_operand:DI 2 "general_operand" "Fsro,Fs"))) 889 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 890 1.1 mrg "!TARGET_QMATH && reload_completed" 891 1.19 mrg "* return vax_output_int_add (insn, operands, DImode);") 892 1.1 mrg 894 1.1 mrg ;;- All kinds of subtract instructions. 895 1.1 mrg 896 1.19 mrg (define_insn_and_split "sub<mode>3" 897 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") 898 1.19 mrg (minus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF") 899 1.19 mrg (match_operand:VAXfp 2 "general_operand" "gF,gF")))] 900 1.19 mrg "" 901 1.19 mrg "#" 902 1.19 mrg "reload_completed" 903 1.19 mrg [(parallel 904 1.19 mrg [(set (match_dup 0) 905 1.19 mrg (minus:VAXfp (match_dup 1) 906 1.19 mrg (match_dup 2))) 907 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 908 1.19 mrg "") 909 1.19 mrg 910 1.19 mrg (define_insn "*sub<mode>3<fccn><fccnz><fccz>" 911 1.1 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") 912 1.1 mrg (minus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF") 913 1.1 mrg (match_operand:VAXfp 2 "general_operand" "gF,gF"))) 914 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 915 1.19 mrg "reload_completed" 916 1.1 mrg "@ 917 1.1 mrg sub<VAXfp:fsfx>2 %2,%0 918 1.3 mrg sub<VAXfp:fsfx>3 %2,%1,%0") 919 1.1 mrg 920 1.19 mrg (define_insn_and_split "sub<mode>3" 921 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 922 1.19 mrg (minus:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT") 923 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,nrmT")))] 924 1.19 mrg "" 925 1.19 mrg "#" 926 1.19 mrg "reload_completed" 927 1.19 mrg [(parallel 928 1.19 mrg [(set (match_dup 0) 929 1.19 mrg (minus:VAXint (match_dup 1) 930 1.19 mrg (match_dup 2))) 931 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 932 1.19 mrg "") 933 1.19 mrg 934 1.19 mrg (define_insn "*sub<mode>3<ccn><ccnz><ccz>" 935 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 936 1.19 mrg (minus:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT") 937 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,nrmT"))) 938 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 939 1.19 mrg "reload_completed" 940 1.19 mrg "@ 941 1.19 mrg sub<VAXint:isfx>2 %2,%0 942 1.19 mrg sub<VAXint:isfx>3 %2,%1,%0") 943 1.19 mrg 944 1.19 mrg (define_insn "*sub<mode>3_cc" 945 1.19 mrg [(set (reg:CC VAX_PSL_REGNUM) 946 1.19 mrg (compare:CC (match_operand:VAXint 1 "general_operand" "0,nrmT") 947 1.1 mrg (match_operand:VAXint 2 "general_operand" "nrmT,nrmT"))) 948 1.1 mrg (set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 949 1.1 mrg (minus:VAXint (match_dup 1) 950 1.1 mrg (match_dup 2)))] 951 1.1 mrg "reload_completed" 952 1.1 mrg "@ 953 1.1 mrg sub<VAXint:isfx>2 %2,%0 954 1.1 mrg sub<VAXint:isfx>3 %2,%1,%0") 955 1.1 mrg 956 1.1 mrg (define_expand "subdi3" 957 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 958 1.19 mrg (minus:DI (match_operand:DI 1 "general_operand" "g") 959 1.14 rin (match_operand:DI 2 "general_operand" "g")))] 960 1.1 mrg "!reload_in_progress" 961 1.1 mrg "vax_expand_addsub_di_operands (operands, MINUS); DONE;") 962 1.1 mrg 963 1.19 mrg (define_insn_and_split "sbcdi3" 964 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=&Rr,&Rr") 965 1.19 mrg (minus:DI (match_operand:DI 1 "general_addsub_di_operand" "0,I") 966 1.19 mrg (match_operand:DI 2 "general_addsub_di_operand" "nRr,Rr")))] 967 1.19 mrg "TARGET_QMATH" 968 1.19 mrg "#" 969 1.19 mrg "&& reload_completed" 970 1.19 mrg [(parallel 971 1.19 mrg [(set (match_dup 0) 972 1.19 mrg (minus:DI (match_dup 1) 973 1.19 mrg (match_dup 2))) 974 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 975 1.19 mrg "") 976 1.19 mrg 977 1.19 mrg (define_insn "*sbcdi3<ccn>" 978 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=&Rr,&Rr") 979 1.1 mrg (minus:DI (match_operand:DI 1 "general_addsub_di_operand" "0,I") 980 1.1 mrg (match_operand:DI 2 "general_addsub_di_operand" "nRr,Rr"))) 981 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 982 1.1 mrg "TARGET_QMATH && reload_completed" 983 1.1 mrg "* return vax_output_int_subtract (insn, operands, DImode);") 984 1.1 mrg 985 1.1 mrg ;; The subtract-with-carry (sbwc) instruction only takes two operands. 986 1.19 mrg (define_insn_and_split "subdi3_old" 987 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=or>,or>") 988 1.19 mrg (minus:DI (match_operand:DI 1 "general_operand" "0,or>") 989 1.19 mrg (match_operand:DI 2 "general_operand" "Fsor,Fs")))] 990 1.19 mrg "!TARGET_QMATH" 991 1.19 mrg "#" 992 1.19 mrg "&& reload_completed" 993 1.19 mrg [(parallel 994 1.19 mrg [(set (match_dup 0) 995 1.19 mrg (minus:DI (match_dup 1) 996 1.19 mrg (match_dup 2))) 997 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 998 1.19 mrg "") 999 1.19 mrg 1000 1.19 mrg (define_insn "*subdi3_old<ccn>" 1001 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=or>,or>") 1002 1.1 mrg (minus:DI (match_operand:DI 1 "general_operand" "0,or>") 1003 1.1 mrg (match_operand:DI 2 "general_operand" "Fsor,Fs"))) 1004 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1005 1.19 mrg "!TARGET_QMATH && reload_completed" 1006 1.1 mrg "* return vax_output_int_subtract (insn, operands, DImode);") 1007 1.1 mrg 1009 1.1 mrg ;;- Multiply instructions. 1010 1.19 mrg 1011 1.19 mrg (define_insn_and_split "mul<mode>3" 1012 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g") 1013 1.19 mrg (mult:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF") 1014 1.19 mrg (match_operand:VAXfp 2 "general_operand" "gF,0,gF")))] 1015 1.19 mrg "" 1016 1.19 mrg "#" 1017 1.19 mrg "reload_completed" 1018 1.19 mrg [(parallel 1019 1.19 mrg [(set (match_dup 0) 1020 1.19 mrg (mult:VAXfp (match_dup 1) 1021 1.19 mrg (match_dup 2))) 1022 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1023 1.19 mrg "") 1024 1.19 mrg 1025 1.1 mrg (define_insn "*mul<mode>3<fccn><fccnz><fccz>" 1026 1.1 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g") 1027 1.1 mrg (mult:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF") 1028 1.1 mrg (match_operand:VAXfp 2 "general_operand" "gF,0,gF"))) 1029 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1030 1.19 mrg "reload_completed" 1031 1.1 mrg "@ 1032 1.1 mrg mul<VAXfp:fsfx>2 %2,%0 1033 1.3 mrg mul<VAXfp:fsfx>2 %1,%0 1034 1.1 mrg mul<VAXfp:fsfx>3 %1,%2,%0") 1035 1.19 mrg 1036 1.19 mrg (define_insn_and_split "mul<mode>3" 1037 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") 1038 1.19 mrg (mult:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT,nrmT") 1039 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,0,nrmT")))] 1040 1.19 mrg "" 1041 1.19 mrg "#" 1042 1.19 mrg "reload_completed" 1043 1.19 mrg [(parallel 1044 1.19 mrg [(set (match_dup 0) 1045 1.19 mrg (mult:VAXint (match_dup 1) 1046 1.19 mrg (match_dup 2))) 1047 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1048 1.19 mrg "") 1049 1.19 mrg 1050 1.1 mrg (define_insn "*mul<mode>3<ccn><ccnz><ccz>" 1051 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") 1052 1.1 mrg (mult:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT,nrmT") 1053 1.1 mrg (match_operand:VAXint 2 "general_operand" "nrmT,0,nrmT"))) 1054 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1055 1.19 mrg "reload_completed" 1056 1.19 mrg "@ 1057 1.19 mrg mul<VAXint:isfx>2 %2,%0 1058 1.19 mrg mul<VAXint:isfx>2 %1,%0 1059 1.19 mrg mul<VAXint:isfx>3 %1,%2,%0") 1060 1.19 mrg 1061 1.19 mrg (define_insn_and_split "mulsidi3" 1062 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1063 1.19 mrg (mult:DI 1064 1.19 mrg (sign_extend:DI (match_operand:SI 1 "general_operand" "nrmT")) 1065 1.19 mrg (sign_extend:DI (match_operand:SI 2 "general_operand" "nrmT"))))] 1066 1.19 mrg "" 1067 1.19 mrg "#" 1068 1.19 mrg "reload_completed" 1069 1.19 mrg [(parallel 1070 1.19 mrg [(set (match_dup 0) 1071 1.19 mrg (mult:DI 1072 1.19 mrg (sign_extend:DI (match_dup 1)) 1073 1.19 mrg (sign_extend:DI (match_dup 2)))) 1074 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1075 1.19 mrg "") 1076 1.19 mrg 1077 1.19 mrg (define_insn "*mulsidi3<ccn><ccnz><ccz>" 1078 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1079 1.19 mrg (mult:DI 1080 1.19 mrg (sign_extend:DI (match_operand:SI 1 "general_operand" "nrmT")) 1081 1.1 mrg (sign_extend:DI (match_operand:SI 2 "general_operand" "nrmT")))) 1082 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1083 1.19 mrg "reload_completed" 1084 1.19 mrg "emul %1,%2,$0,%0") 1085 1.19 mrg 1086 1.19 mrg (define_insn_and_split "*maddsidi4" 1087 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1088 1.19 mrg (plus:DI 1089 1.19 mrg (mult:DI 1090 1.19 mrg (sign_extend:DI (match_operand:SI 1 "general_operand" "nrmT")) 1091 1.19 mrg (sign_extend:DI (match_operand:SI 2 "general_operand" "nrmT"))) 1092 1.19 mrg (sign_extend:DI (match_operand:SI 3 "general_operand" "g"))))] 1093 1.19 mrg "" 1094 1.19 mrg "#" 1095 1.19 mrg "reload_completed" 1096 1.19 mrg [(parallel 1097 1.19 mrg [(set (match_dup 0) 1098 1.19 mrg (plus:DI 1099 1.1 mrg (mult:DI 1100 1.19 mrg (sign_extend:DI (match_dup 1)) 1101 1.1 mrg (sign_extend:DI (match_dup 2))) 1102 1.1 mrg (sign_extend:DI (match_dup 3)))) 1103 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1104 1.19 mrg "") 1105 1.19 mrg 1106 1.19 mrg (define_insn "*maddsidi4_2<ccn><ccnz><ccz>" 1107 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1108 1.19 mrg (plus:DI 1109 1.1 mrg (mult:DI 1110 1.1 mrg (sign_extend:DI (match_operand:SI 1 "general_operand" "nrmT")) 1111 1.1 mrg (sign_extend:DI (match_operand:SI 2 "general_operand" "nrmT"))) 1112 1.19 mrg (sign_extend:DI (match_operand:SI 3 "nonimmediate_operand" "g")))) 1113 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1114 1.19 mrg "reload_completed" 1115 1.19 mrg "emul %1,%2,%3,%0") 1116 1.19 mrg 1117 1.19 mrg ;; 'F' constraint means type CONST_DOUBLE 1118 1.19 mrg (define_insn_and_split "*maddsidi4_const" 1119 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1120 1.19 mrg (plus:DI 1121 1.19 mrg (mult:DI 1122 1.19 mrg (sign_extend:DI (match_operand:SI 1 "general_operand" "nrmT")) 1123 1.19 mrg (sign_extend:DI (match_operand:SI 2 "general_operand" "nrmT"))) 1124 1.19 mrg (match_operand:DI 3 "immediate_operand" "F")))] 1125 1.19 mrg "GET_CODE (operands[3]) == CONST_DOUBLE 1126 1.19 mrg && CONST_DOUBLE_HIGH (operands[3]) == (CONST_DOUBLE_LOW (operands[3]) >> 31)" 1127 1.19 mrg "#" 1128 1.19 mrg "&& reload_completed" 1129 1.19 mrg [(parallel 1130 1.19 mrg [(set (match_dup 0) 1131 1.19 mrg (plus:DI 1132 1.19 mrg (mult:DI 1133 1.19 mrg (sign_extend:DI (match_dup 1)) 1134 1.1 mrg (sign_extend:DI (match_dup 2))) 1135 1.1 mrg (match_dup 3))) 1136 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1137 1.19 mrg "") 1138 1.19 mrg 1139 1.19 mrg (define_insn "*maddsidi4_const_2<ccn><ccnz><ccz>" 1140 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1141 1.1 mrg (plus:DI 1142 1.19 mrg (mult:DI 1143 1.19 mrg (sign_extend:DI (match_operand:SI 1 "general_operand" "nrmT")) 1144 1.1 mrg (sign_extend:DI (match_operand:SI 2 "general_operand" "nrmT"))) 1145 1.1 mrg (match_operand:DI 3 "immediate_operand" "F"))) 1146 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1147 1.1 mrg "GET_CODE (operands[3]) == CONST_DOUBLE 1148 1.1 mrg && CONST_DOUBLE_HIGH (operands[3]) == (CONST_DOUBLE_LOW (operands[3]) >> 31) 1149 1.1 mrg && reload_completed" 1150 1.1 mrg "* 1151 1.1 mrg { 1152 1.1 mrg if (CONST_DOUBLE_HIGH (operands[3])) 1153 1.19 mrg operands[3] = GEN_INT (CONST_DOUBLE_LOW (operands[3])); 1154 1.1 mrg return \"emul %1,%2,%3,%0\"; 1155 1.1 mrg }") 1156 1.1 mrg 1158 1.19 mrg ;;- Divide instructions. 1159 1.19 mrg 1160 1.19 mrg (define_insn_and_split "div<mode>3" 1161 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") 1162 1.19 mrg (div:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF") 1163 1.19 mrg (match_operand:VAXfp 2 "general_operand" "gF,gF")))] 1164 1.19 mrg "" 1165 1.19 mrg "#" 1166 1.19 mrg "reload_completed" 1167 1.19 mrg [(parallel 1168 1.19 mrg [(set (match_dup 0) 1169 1.19 mrg (div:VAXfp (match_dup 1) 1170 1.19 mrg (match_dup 2))) 1171 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1172 1.19 mrg "") 1173 1.1 mrg 1174 1.1 mrg (define_insn "*div<mode>3<fccn><fccnz><fccz>" 1175 1.1 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") 1176 1.1 mrg (div:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF") 1177 1.19 mrg (match_operand:VAXfp 2 "general_operand" "gF,gF"))) 1178 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1179 1.1 mrg "reload_completed" 1180 1.3 mrg "@ 1181 1.1 mrg div<VAXfp:fsfx>2 %2,%0 1182 1.19 mrg div<VAXfp:fsfx>3 %2,%1,%0") 1183 1.19 mrg 1184 1.19 mrg (define_insn_and_split "div<mode>3" 1185 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1186 1.19 mrg (div:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT") 1187 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,nrmT")))] 1188 1.19 mrg "" 1189 1.19 mrg "#" 1190 1.19 mrg "reload_completed" 1191 1.19 mrg [(parallel 1192 1.19 mrg [(set (match_dup 0) 1193 1.19 mrg (div:VAXint (match_dup 1) 1194 1.19 mrg (match_dup 2))) 1195 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1196 1.19 mrg "") 1197 1.1 mrg 1198 1.1 mrg (define_insn "*div<mode>3<ccn><ccnz><ccz>" 1199 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1200 1.1 mrg (div:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT") 1201 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,nrmT"))) 1202 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1203 1.19 mrg "reload_completed" 1204 1.19 mrg "@ 1205 1.19 mrg div<VAXint:isfx>2 %2,%0 1206 1.19 mrg div<VAXint:isfx>3 %2,%1,%0") 1207 1.19 mrg 1208 1.19 mrg ;; This is left out because it is very slow; 1209 1.19 mrg ;; we are better off programming around the "lack" of this insn. 1210 1.19 mrg ;;(define_insn_and_split "divmoddisi4" 1211 1.19 mrg ;; [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1212 1.19 mrg ;; (div:SI (match_operand:DI 1 "general_operand" "g") 1213 1.19 mrg ;; (match_operand:SI 2 "general_operand" "g"))) 1214 1.19 mrg ;; (set (match_operand:SI 3 "nonimmediate_operand" "=g") 1215 1.19 mrg ;; (mod:SI (match_dup 1) 1216 1.19 mrg ;; (match_dup 2)))] 1217 1.19 mrg ;; "" 1218 1.19 mrg ;; "#" 1219 1.19 mrg ;; "reload_completed" 1220 1.19 mrg ;; [(parallel 1221 1.19 mrg ;; [(set (match_dup 0) 1222 1.19 mrg ;; (div:SI (match_dup 1) 1223 1.19 mrg ;; (match_dup 2))) 1224 1.19 mrg ;; (set (match_dup 3) 1225 1.19 mrg ;; (mod:SI (match_dup 1) 1226 1.19 mrg ;; (match_dup 2))) 1227 1.19 mrg ;; (clobber (reg:CC VAX_PSL_REGNUM))])] 1228 1.19 mrg ;; "") 1229 1.19 mrg ;; 1230 1.19 mrg ;;(define_insn "*divmoddisi4<ccn><ccnz><ccz>" 1231 1.19 mrg ;; [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1232 1.19 mrg ;; (div:SI (match_operand:DI 1 "general_operand" "g") 1233 1.1 mrg ;; (match_operand:SI 2 "general_operand" "g"))) 1234 1.1 mrg ;; (set (match_operand:SI 3 "nonimmediate_operand" "=g") 1235 1.1 mrg ;; (mod:SI (match_dup 1) 1236 1.1 mrg ;; (match_dup 2))) 1237 1.1 mrg ;; (clobber (reg:CC VAX_PSL_REGNUM))] 1238 1.3 mrg ;; "reload_completed" 1239 1.1 mrg ;; "ediv %2,%1,%0,%3") 1240 1.1 mrg 1242 1.1 mrg ;; Bit-and on the VAX is done with a clear-bits insn. 1243 1.1 mrg (define_expand "and<mode>3" 1244 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "") 1245 1.1 mrg (and:VAXint (not:VAXint (match_operand:VAXint 1 "general_operand" "")) 1246 1.1 mrg (match_operand:VAXint 2 "general_operand" "")))] 1247 1.1 mrg "" 1248 1.1 mrg " 1249 1.1 mrg { 1250 1.1 mrg rtx op1 = operands[1]; 1251 1.1 mrg 1252 1.1 mrg /* If there is a constant argument, complement that one. */ 1253 1.1 mrg if (CONST_INT_P (operands[2]) && ! CONST_INT_P (op1)) 1254 1.1 mrg { 1255 1.1 mrg operands[1] = operands[2]; 1256 1.1 mrg operands[2] = op1; 1257 1.1 mrg op1 = operands[1]; 1258 1.19 mrg } 1259 1.1 mrg 1260 1.19 mrg if (CONST_INT_P (op1)) 1261 1.19 mrg operands[1] = GEN_INT (~INTVAL (op1)); 1262 1.1 mrg else 1263 1.1 mrg operands[1] = expand_unop (<MODE>mode, one_cmpl_optab, op1, 0, 1); 1264 1.19 mrg }") 1265 1.19 mrg 1266 1.19 mrg (define_insn_and_split "*and<mode>3" 1267 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1268 1.19 mrg (and:VAXint (not:VAXint 1269 1.19 mrg (match_operand:VAXint 1 "general_operand" "nrmT,nrmT")) 1270 1.19 mrg (match_operand:VAXint 2 "general_operand" "0,nrmT")))] 1271 1.19 mrg "" 1272 1.19 mrg "#" 1273 1.19 mrg "reload_completed" 1274 1.19 mrg [(parallel 1275 1.19 mrg [(set (match_dup 0) 1276 1.19 mrg (and:VAXint (not:VAXint 1277 1.19 mrg (match_dup 1)) 1278 1.19 mrg (match_dup 2))) 1279 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1280 1.19 mrg "") 1281 1.1 mrg 1282 1.1 mrg (define_insn "*and<mode>3_2<ccn><ccnz><ccz>" 1283 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1284 1.1 mrg (and:VAXint (not:VAXint 1285 1.1 mrg (match_operand:VAXint 1 "general_operand" "nrmT,nrmT")) 1286 1.1 mrg (match_operand:VAXint 2 "general_operand" "0,nrmT"))) 1287 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1288 1.19 mrg "reload_completed" 1289 1.1 mrg "@ 1290 1.19 mrg bic<VAXint:isfx>2 %1,%0 1291 1.1 mrg bic<VAXint:isfx>3 %1,%2,%0") 1292 1.1 mrg 1293 1.3 mrg ;; The following used to be needed because constant propagation can 1294 1.1 mrg ;; create them starting from the bic insn patterns above. This is no 1295 1.19 mrg ;; longer a problem. However, having these patterns allows optimization 1296 1.19 mrg ;; opportunities in combine.cc. 1297 1.19 mrg 1298 1.19 mrg (define_insn_and_split "*and<mode>3_const_int" 1299 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1300 1.19 mrg (and:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT") 1301 1.19 mrg (match_operand:VAXint 2 "const_int_operand" "n,n")))] 1302 1.19 mrg "" 1303 1.19 mrg "#" 1304 1.19 mrg "reload_completed" 1305 1.19 mrg [(parallel 1306 1.19 mrg [(set (match_dup 0) 1307 1.19 mrg (and:VAXint (match_dup 1) 1308 1.19 mrg (match_dup 2))) 1309 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1310 1.1 mrg "") 1311 1.1 mrg 1312 1.1 mrg (define_insn "*and<mode>3_2_const_int<ccn><ccnz><ccz>" 1313 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1314 1.19 mrg (and:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT") 1315 1.19 mrg (match_operand:VAXint 2 "const_int_operand" "n,n"))) 1316 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1317 1.19 mrg "reload_completed" 1318 1.19 mrg "@ 1319 1.19 mrg bic<VAXint:isfx>2 %<VAXint:iprefx>2,%0 1320 1.19 mrg bic<VAXint:isfx>3 %<VAXint:iprefx>2,%1,%0") 1321 1.19 mrg 1322 1.19 mrg ;; We have no direct AND operation and consequently the RTL sequence 1323 1.19 mrg ;; the "and<mode>3" pattern produces does not match the instruction 1324 1.19 mrg ;; the "*bit<mode>" pattern does for the purpose of the compare 1325 1.19 mrg ;; elimination pass. Try to get rid of the extra operation by hand 1326 1.19 mrg ;; and where the sequence is used to set the condition codes only 1327 1.19 mrg ;; convert MCOM/BIC => BIT. 1328 1.19 mrg (define_peephole2 1329 1.19 mrg [(parallel 1330 1.19 mrg [(set (match_operand:VAXint 0 "register_operand") 1331 1.19 mrg (not:VAXint (match_operand:VAXint 1 "general_operand"))) 1332 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))]) 1333 1.19 mrg (parallel 1334 1.19 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 1335 1.19 mrg (compare:VAXccnz 1336 1.19 mrg (and:VAXint (not:VAXint (match_dup 0)) 1337 1.19 mrg (match_operand:VAXint 3 "general_operand")) 1338 1.19 mrg (const_int 0))) 1339 1.19 mrg (set (match_operand:VAXint 2 "register_operand") 1340 1.19 mrg (and:VAXint (not:VAXint (match_dup 0)) 1341 1.1 mrg (match_dup 3)))])] 1342 1.1 mrg "peep2_reg_dead_p (2, operands[0]) && peep2_reg_dead_p (2, operands[2])" 1343 1.1 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 1344 1.19 mrg (compare:VAXccnz 1345 1.1 mrg (and:VAXint (match_dup 1) 1346 1.1 mrg (match_dup 3)) 1347 1.3 mrg (const_int 0)))] 1348 1.1 mrg "") 1349 1.19 mrg 1351 1.19 mrg ;;- Bit set instructions. 1352 1.19 mrg 1353 1.19 mrg (define_insn_and_split "ior<mode>3" 1354 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") 1355 1.19 mrg (ior:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT,nrmT") 1356 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,0,nrmT")))] 1357 1.19 mrg "" 1358 1.19 mrg "#" 1359 1.19 mrg "reload_completed" 1360 1.19 mrg [(parallel 1361 1.19 mrg [(set (match_dup 0) 1362 1.19 mrg (ior:VAXint (match_dup 1) 1363 1.19 mrg (match_dup 2))) 1364 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1365 1.1 mrg "") 1366 1.1 mrg 1367 1.1 mrg (define_insn "*ior<mode>3<ccn><ccnz><ccz>" 1368 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") 1369 1.1 mrg (ior:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT,nrmT") 1370 1.1 mrg (match_operand:VAXint 2 "general_operand" "nrmT,0,nrmT"))) 1371 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1372 1.1 mrg "reload_completed" 1373 1.1 mrg "@ 1374 1.3 mrg bis<VAXint:isfx>2 %2,%0 1375 1.1 mrg bis<VAXint:isfx>2 %1,%0 1376 1.19 mrg bis<VAXint:isfx>3 %2,%1,%0") 1377 1.19 mrg 1378 1.19 mrg ;;- xor instructions. 1379 1.19 mrg 1380 1.19 mrg (define_insn_and_split "xor<mode>3" 1381 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") 1382 1.19 mrg (xor:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT,nrmT") 1383 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT,0,nrmT")))] 1384 1.19 mrg "" 1385 1.19 mrg "#" 1386 1.19 mrg "reload_completed" 1387 1.19 mrg [(parallel 1388 1.19 mrg [(set (match_dup 0) 1389 1.19 mrg (xor:VAXint (match_dup 1) 1390 1.19 mrg (match_dup 2))) 1391 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1392 1.1 mrg "") 1393 1.1 mrg 1394 1.1 mrg (define_insn "*xor<mode>3<ccn><ccnz><ccz>" 1395 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") 1396 1.19 mrg (xor:VAXint (match_operand:VAXint 1 "general_operand" "0,nrmT,nrmT") 1397 1.1 mrg (match_operand:VAXint 2 "general_operand" "nrmT,0,nrmT"))) 1398 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1399 1.1 mrg "reload_completed" 1400 1.19 mrg "@ 1401 1.19 mrg xor<VAXint:isfx>2 %2,%0 1402 1.19 mrg xor<VAXint:isfx>2 %1,%0 1403 1.19 mrg xor<VAXint:isfx>3 %2,%1,%0") 1404 1.19 mrg 1406 1.19 mrg (define_insn_and_split "neg<mode>2" 1407 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g") 1408 1.19 mrg (neg:VAXfp (match_operand:VAXfp 1 "general_operand" "gF")))] 1409 1.19 mrg "" 1410 1.19 mrg "#" 1411 1.19 mrg "reload_completed" 1412 1.19 mrg [(parallel 1413 1.1 mrg [(set (match_dup 0) 1414 1.1 mrg (neg:VAXfp (match_dup 1))) 1415 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1416 1.1 mrg "") 1417 1.1 mrg 1418 1.1 mrg (define_insn "*neg<mode>2<fccn><fccnz><fccz>" 1419 1.19 mrg [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g") 1420 1.19 mrg (neg:VAXfp (match_operand:VAXfp 1 "general_operand" "gF"))) 1421 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1422 1.19 mrg "reload_completed" 1423 1.19 mrg "mneg<VAXfp:fsfx> %1,%0") 1424 1.19 mrg 1425 1.19 mrg (define_insn_and_split "neg<mode>2" 1426 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 1427 1.19 mrg (neg:VAXint (match_operand:VAXint 1 "general_operand" "nrmT")))] 1428 1.19 mrg "" 1429 1.19 mrg "#" 1430 1.19 mrg "reload_completed" 1431 1.19 mrg [(parallel 1432 1.19 mrg [(set (match_dup 0) 1433 1.19 mrg (neg:VAXint (match_dup 1))) 1434 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1435 1.19 mrg "") 1436 1.19 mrg 1437 1.19 mrg (define_insn "*neg<mode>2<ccn><ccnz><ccz>" 1438 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 1439 1.19 mrg (neg:VAXint (match_operand:VAXint 1 "general_operand" "nrmT"))) 1440 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1441 1.19 mrg "reload_completed" 1442 1.1 mrg "mneg<VAXint:isfx> %1,%0") 1443 1.1 mrg 1444 1.19 mrg (define_insn "*neg<mode>2_cc" 1445 1.1 mrg [(set (reg:CC VAX_PSL_REGNUM) 1446 1.1 mrg (compare:CC (const_int 0) 1447 1.1 mrg (neg:VAXint 1448 1.19 mrg (match_operand:VAXint 1 "general_operand" "0,nrmT")))) 1449 1.19 mrg (set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") 1450 1.19 mrg (neg:VAXint (match_dup 1)))] 1451 1.19 mrg "reload_completed" 1452 1.19 mrg "mneg<VAXint:isfx> %1,%0") 1453 1.19 mrg 1454 1.19 mrg (define_insn_and_split "one_cmpl<mode>2" 1455 1.19 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 1456 1.19 mrg (not:VAXint (match_operand:VAXint 1 "general_operand" "nrmT")))] 1457 1.19 mrg "" 1458 1.19 mrg "#" 1459 1.19 mrg "reload_completed" 1460 1.19 mrg [(parallel 1461 1.1 mrg [(set (match_dup 0) 1462 1.1 mrg (not:VAXint (match_dup 1))) 1463 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1464 1.1 mrg "") 1465 1.1 mrg 1466 1.1 mrg (define_insn "*one_cmpl<mode>2<ccn><ccnz><ccz>" 1467 1.1 mrg [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") 1468 1.1 mrg (not:VAXint (match_operand:VAXint 1 "general_operand" "nrmT"))) 1469 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1470 1.1 mrg "reload_completed" 1471 1.3 mrg "mcom<VAXint:isfx> %1,%0") 1472 1.1 mrg 1474 1.1 mrg ;; Arithmetic right shift on the VAX works by negating the shift count, 1475 1.19 mrg ;; then emitting a right shift with the shift count negated. This means 1476 1.1 mrg ;; that all actual shift counts in the RTL will be positive. This 1477 1.1 mrg ;; prevents converting shifts to ZERO_EXTRACTs with negative positions, 1478 1.1 mrg ;; which isn't valid. 1479 1.19 mrg (define_expand "ashrsi3" 1480 1.1 mrg [(set (match_operand:SI 0 "general_operand" "=g") 1481 1.1 mrg (ashiftrt:SI (match_operand:SI 1 "general_operand" "g") 1482 1.1 mrg (match_operand:QI 2 "general_operand" "g")))] 1483 1.1 mrg "" 1484 1.19 mrg " 1485 1.19 mrg { 1486 1.19 mrg if (! CONST_INT_P(operands[2])) 1487 1.19 mrg operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); 1488 1.19 mrg }") 1489 1.19 mrg 1490 1.19 mrg (define_insn_and_split "*ashlnegsi3_const_int" 1491 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1492 1.19 mrg (ashiftrt:SI (match_operand:SI 1 "general_operand" "nrmT") 1493 1.19 mrg (match_operand:QI 2 "const_int_operand" "n")))] 1494 1.19 mrg "" 1495 1.19 mrg "#" 1496 1.19 mrg "reload_completed" 1497 1.19 mrg [(parallel 1498 1.19 mrg [(set (match_dup 0) 1499 1.1 mrg (ashiftrt:SI (match_dup 1) 1500 1.1 mrg (match_dup 2))) 1501 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1502 1.1 mrg "") 1503 1.1 mrg 1504 1.1 mrg (define_insn "*ashlnegsi3_const_int_2<ccn><ccnz><ccz>" 1505 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1506 1.19 mrg (ashiftrt:SI (match_operand:SI 1 "general_operand" "nrmT") 1507 1.19 mrg (match_operand:QI 2 "const_int_operand" "n"))) 1508 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1509 1.19 mrg "reload_completed" 1510 1.19 mrg "ashl $%n2,%1,%0") 1511 1.19 mrg 1512 1.19 mrg (define_insn_and_split "*ashlnegsi3" 1513 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1514 1.19 mrg (ashiftrt:SI (match_operand:SI 1 "general_operand" "nrmT") 1515 1.19 mrg (neg:QI (match_operand:QI 2 "general_operand" "g"))))] 1516 1.19 mrg "" 1517 1.19 mrg "#" 1518 1.19 mrg "reload_completed" 1519 1.19 mrg [(parallel 1520 1.19 mrg [(set (match_dup 0) 1521 1.1 mrg (ashiftrt:SI (match_dup 1) 1522 1.1 mrg (neg:QI (match_dup 2)))) 1523 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1524 1.1 mrg "") 1525 1.1 mrg 1526 1.1 mrg (define_insn "*ashlnegsi3_2<ccn><ccnz><ccz>" 1527 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1528 1.19 mrg (ashiftrt:SI (match_operand:SI 1 "general_operand" "nrmT") 1529 1.19 mrg (neg:QI (match_operand:QI 2 "general_operand" "g")))) 1530 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1531 1.19 mrg "reload_completed" 1532 1.19 mrg "ashl %2,%1,%0") 1533 1.19 mrg 1534 1.19 mrg (define_insn_and_split "ashlsi3" 1535 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1536 1.19 mrg (ashift:SI (match_operand:SI 1 "general_operand" "nrmT") 1537 1.19 mrg (match_operand:QI 2 "general_operand" "g")))] 1538 1.19 mrg "" 1539 1.19 mrg "#" 1540 1.19 mrg "reload_completed" 1541 1.19 mrg [(parallel 1542 1.19 mrg [(set (match_dup 0) 1543 1.1 mrg (ashift:SI (match_dup 1) 1544 1.1 mrg (match_dup 2))) 1545 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1546 1.1 mrg "") 1547 1.1 mrg 1548 1.1 mrg (define_insn "*ashlsi3<ccn><ccnz><ccz>" 1549 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1550 1.1 mrg (ashift:SI (match_operand:SI 1 "general_operand" "nrmT") 1551 1.1 mrg (match_operand:QI 2 "general_operand" "g"))) 1552 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1553 1.1 mrg "reload_completed" 1554 1.1 mrg "* 1555 1.1 mrg { 1556 1.1 mrg if (operands[2] == const1_rtx && rtx_equal_p (operands[0], operands[1])) 1557 1.1 mrg return \"addl2 %0,%0\"; 1558 1.1 mrg if (REG_P (operands[1]) && CONST_INT_P (operands[2])) 1559 1.1 mrg { 1560 1.1 mrg int i = INTVAL (operands[2]); 1561 1.1 mrg if (i == 1) 1562 1.1 mrg return \"addl3 %1,%1,%0\"; 1563 1.1 mrg if (i == 2 && !optimize_size) 1564 1.1 mrg { 1565 1.1 mrg if (push_operand (operands[0], SImode)) 1566 1.1 mrg return \"pushal 0[%1]\"; 1567 1.1 mrg return \"moval 0[%1],%0\"; 1568 1.1 mrg } 1569 1.1 mrg if (i == 3 && !optimize_size) 1570 1.1 mrg { 1571 1.1 mrg if (push_operand (operands[0], SImode)) 1572 1.1 mrg return \"pushaq 0[%1]\"; 1573 1.1 mrg return \"movaq 0[%1],%0\"; 1574 1.1 mrg } 1575 1.1 mrg } 1576 1.1 mrg return \"ashl %2,%1,%0\"; 1577 1.1 mrg }") 1578 1.1 mrg 1579 1.19 mrg ;; Arithmetic right shift on the VAX works by negating the shift count. 1580 1.1 mrg (define_expand "ashrdi3" 1581 1.1 mrg [(set (match_operand:DI 0 "general_operand" "=g") 1582 1.1 mrg (ashiftrt:DI (match_operand:DI 1 "general_operand" "g") 1583 1.1 mrg (match_operand:QI 2 "general_operand" "g")))] 1584 1.19 mrg "" 1585 1.19 mrg " 1586 1.19 mrg { 1587 1.19 mrg operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); 1588 1.19 mrg }") 1589 1.19 mrg 1590 1.19 mrg (define_insn_and_split "ashldi3" 1591 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1592 1.19 mrg (ashift:DI (match_operand:DI 1 "general_operand" "g") 1593 1.19 mrg (match_operand:QI 2 "general_operand" "g")))] 1594 1.19 mrg "" 1595 1.19 mrg "#" 1596 1.19 mrg "reload_completed" 1597 1.19 mrg [(parallel 1598 1.19 mrg [(set (match_dup 0) 1599 1.1 mrg (ashift:DI (match_dup 1) 1600 1.1 mrg (match_dup 2))) 1601 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1602 1.1 mrg "") 1603 1.1 mrg 1604 1.1 mrg (define_insn "*ashldi3<ccn><ccnz><ccz>" 1605 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1606 1.19 mrg (ashift:DI (match_operand:DI 1 "general_operand" "g") 1607 1.19 mrg (match_operand:QI 2 "general_operand" "g"))) 1608 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1609 1.19 mrg "reload_completed" 1610 1.19 mrg "ashq %2,%D1,%0") 1611 1.19 mrg 1612 1.19 mrg (define_insn_and_split "*ashlnegdi3" 1613 1.19 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1614 1.19 mrg (ashiftrt:DI (match_operand:DI 1 "general_operand" "g") 1615 1.19 mrg (neg:QI (match_operand:QI 2 "general_operand" "g"))))] 1616 1.19 mrg "" 1617 1.19 mrg "#" 1618 1.19 mrg "reload_completed" 1619 1.19 mrg [(parallel 1620 1.19 mrg [(set (match_dup 0) 1621 1.1 mrg (ashiftrt:DI (match_dup 1) 1622 1.1 mrg (neg:QI (match_dup 2)))) 1623 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1624 1.1 mrg "") 1625 1.1 mrg 1626 1.1 mrg (define_insn "*ashlnegdi3_2<ccn><ccnz><ccz>" 1627 1.1 mrg [(set (match_operand:DI 0 "nonimmediate_operand" "=g") 1628 1.1 mrg (ashiftrt:DI (match_operand:DI 1 "general_operand" "g") 1629 1.1 mrg (neg:QI (match_operand:QI 2 "general_operand" "g")))) 1630 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1631 1.1 mrg "reload_completed" 1632 1.1 mrg "ashq %2,%D1,%0") 1633 1.19 mrg 1634 1.1 mrg ;; We used to have expand_shift handle logical right shifts by using extzv, 1635 1.1 mrg ;; but this make it very difficult to do lshrdi3. Since the VAX is the 1636 1.1 mrg ;; only machine with this kludge, it's better to just do this with a 1637 1.1 mrg ;; define_expand and remove that case from expand_shift. 1638 1.1 mrg 1639 1.1 mrg (define_expand "lshrsi3" 1640 1.1 mrg [(set (match_dup 3) 1641 1.1 mrg (minus:QI (const_int 32) 1642 1.1 mrg (match_dup 4))) 1643 1.1 mrg (set (match_operand:SI 0 "nonimmediate_operand" "=g") 1644 1.1 mrg (zero_extract:SI (match_operand:SI 1 "register_operand" "r") 1645 1.1 mrg (match_dup 3) 1646 1.1 mrg (match_operand:SI 2 "register_operand" "g")))] 1647 1.1 mrg "" 1648 1.1 mrg " 1649 1.1 mrg { 1650 1.1 mrg operands[3] = gen_reg_rtx (QImode); 1651 1.1 mrg operands[4] = gen_lowpart (QImode, operands[2]); 1652 1.1 mrg }") 1653 1.1 mrg 1654 1.1 mrg ;; Rotate right on the VAX works by negating the shift count. 1655 1.19 mrg (define_expand "rotrsi3" 1656 1.1 mrg [(set (match_operand:SI 0 "general_operand" "=g") 1657 1.1 mrg (rotatert:SI (match_operand:SI 1 "general_operand" "g") 1658 1.1 mrg (match_operand:QI 2 "general_operand" "g")))] 1659 1.1 mrg "" 1660 1.19 mrg " 1661 1.19 mrg { 1662 1.19 mrg if (! CONST_INT_P (operands[2])) 1663 1.19 mrg operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); 1664 1.19 mrg }") 1665 1.19 mrg 1666 1.19 mrg (define_insn_and_split "rotlsi3" 1667 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1668 1.19 mrg (rotate:SI (match_operand:SI 1 "general_operand" "nrmT") 1669 1.19 mrg (match_operand:QI 2 "general_operand" "g")))] 1670 1.19 mrg "" 1671 1.19 mrg "#" 1672 1.19 mrg "reload_completed" 1673 1.19 mrg [(parallel 1674 1.19 mrg [(set (match_dup 0) 1675 1.1 mrg (rotate:SI (match_dup 1) 1676 1.1 mrg (match_dup 2))) 1677 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1678 1.1 mrg "") 1679 1.1 mrg 1680 1.1 mrg (define_insn "*rotlsi3<ccn><ccnz><ccz>" 1681 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1682 1.19 mrg (rotate:SI (match_operand:SI 1 "general_operand" "nrmT") 1683 1.19 mrg (match_operand:QI 2 "general_operand" "g"))) 1684 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1685 1.19 mrg "reload_completed" 1686 1.19 mrg "rotl %2,%1,%0") 1687 1.19 mrg 1688 1.19 mrg (define_insn_and_split "*rotrsi3_const_int" 1689 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1690 1.19 mrg (rotatert:SI (match_operand:SI 1 "general_operand" "nrmT") 1691 1.19 mrg (match_operand:QI 2 "const_int_operand" "n")))] 1692 1.19 mrg "" 1693 1.19 mrg "#" 1694 1.19 mrg "reload_completed" 1695 1.19 mrg [(parallel 1696 1.19 mrg [(set (match_dup 0) 1697 1.1 mrg (rotatert:SI (match_dup 1) 1698 1.1 mrg (match_dup 2))) 1699 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1700 1.1 mrg "") 1701 1.1 mrg 1702 1.1 mrg (define_insn "*rotrsi3_const_int_2<ccn><ccnz><ccz>" 1703 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1704 1.19 mrg (rotatert:SI (match_operand:SI 1 "general_operand" "nrmT") 1705 1.19 mrg (match_operand:QI 2 "const_int_operand" "n"))) 1706 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1707 1.19 mrg "reload_completed" 1708 1.19 mrg "rotl %R2,%1,%0") 1709 1.19 mrg 1710 1.19 mrg (define_insn_and_split "*rotrnegsi3" 1711 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1712 1.19 mrg (rotatert:SI (match_operand:SI 1 "general_operand" "nrmT") 1713 1.19 mrg (neg:QI (match_operand:QI 2 "general_operand" "g"))))] 1714 1.19 mrg "" 1715 1.19 mrg "#" 1716 1.19 mrg "reload_completed" 1717 1.19 mrg [(parallel 1718 1.19 mrg [(set (match_dup 0) 1719 1.1 mrg (rotatert:SI (match_dup 1) 1720 1.1 mrg (neg:QI (match_dup 2)))) 1721 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1722 1.19 mrg "") 1723 1.19 mrg 1724 1.19 mrg (define_insn "*rotrnegsi3_2<ccn><ccnz><ccz>" 1725 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1726 1.19 mrg (rotatert:SI (match_operand:SI 1 "general_operand" "nrmT") 1727 1.19 mrg (neg:QI (match_operand:QI 2 "general_operand" "g")))) 1728 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1729 1.19 mrg "reload_completed" 1730 1.19 mrg "rotl %2,%1,%0") 1731 1.19 mrg 1732 1.19 mrg ;; This insn is probably slower than a multiply and an add. 1733 1.19 mrg ;;(define_insn_and_split "*amulsi4" 1734 1.19 mrg ;; [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1735 1.19 mrg ;; (mult:SI (plus:SI (match_operand:SI 1 "general_operand" "g") 1736 1.19 mrg ;; (match_operand:SI 2 "general_operand" "g")) 1737 1.19 mrg ;; (match_operand:SI 3 "general_operand" "g")))] 1738 1.19 mrg ;; "" 1739 1.19 mrg ;; "#" 1740 1.19 mrg ;; "reload_completed" 1741 1.19 mrg ;; [(parallel 1742 1.19 mrg ;; [(set (match_dup 0) 1743 1.19 mrg ;; (mult:SI (plus:SI (match_dup 1) 1744 1.19 mrg ;; (match_dup 2)) 1745 1.19 mrg ;; (match_dup 3))) 1746 1.1 mrg ;; (clobber (reg:CC VAX_PSL_REGNUM))])] 1747 1.1 mrg ;; "") 1748 1.1 mrg ;; 1749 1.19 mrg ;;(define_insn "*amulsi4_2<ccn><ccnz><ccz>" 1750 1.19 mrg ;; [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1751 1.1 mrg ;; (mult:SI (plus:SI (match_operand:SI 1 "general_operand" "g") 1752 1.19 mrg ;; (match_operand:SI 2 "general_operand" "g")) 1753 1.19 mrg ;; (match_operand:SI 3 "general_operand" "g"))) 1754 1.19 mrg ;; (clobber (reg:CC VAX_PSL_REGNUM))] 1755 1.19 mrg ;; "reload_completed" 1756 1.19 mrg ;; "index %1,$0x80000000,$0x7fffffff,%3,%2,%0") 1757 1.19 mrg 1759 1.19 mrg ;; Special cases of bit-field insns which we should 1760 1.19 mrg ;; recognize in preference to the general case. 1761 1.19 mrg ;; These handle aligned 8-bit and 16-bit fields 1762 1.19 mrg ;; that can be done with move or convert instructions. 1763 1.19 mrg 1764 1.19 mrg (define_insn_and_split "*insv_aligned" 1765 1.19 mrg [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "+ro") 1766 1.19 mrg (match_operand:QI 1 "const_int_operand" "n") 1767 1.19 mrg (match_operand:SI 2 "const_int_operand" "n")) 1768 1.19 mrg (match_operand:SI 3 "general_operand" "g"))] 1769 1.19 mrg "(INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16) 1770 1.19 mrg && INTVAL (operands[2]) % INTVAL (operands[1]) == 0 1771 1.19 mrg && (!MEM_P (operands[0]) 1772 1.19 mrg || ((!flag_pic 1773 1.19 mrg || vax_acceptable_pic_operand_p (XEXP (operands[0], 0), 1774 1.19 mrg true, true)) 1775 1.19 mrg && !mode_dependent_address_p (XEXP (operands[0], 0), 1776 1.19 mrg MEM_ADDR_SPACE (operands[0])))) 1777 1.5 mrg && (!(REG_P (operands[0]) 1778 1.19 mrg || (SUBREG_P (operands[0]) && REG_P (SUBREG_REG (operands[0])))) 1779 1.19 mrg || INTVAL (operands[2]) == 0)" 1780 1.1 mrg "#" 1781 1.1 mrg "&& reload_completed" 1782 1.19 mrg [(parallel 1783 1.19 mrg [(set (zero_extract:SI (match_dup 0) 1784 1.19 mrg (match_dup 1) 1785 1.1 mrg (match_dup 2)) 1786 1.19 mrg (match_dup 3)) 1787 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1788 1.19 mrg "") 1789 1.19 mrg 1790 1.19 mrg (define_insn "*insv_aligned_2<ccn><ccnz><ccz>" 1791 1.19 mrg [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "+ro") 1792 1.19 mrg (match_operand:QI 1 "const_int_operand" "n") 1793 1.19 mrg (match_operand:SI 2 "const_int_operand" "n")) 1794 1.19 mrg (match_operand:SI 3 "general_operand" "g")) 1795 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1796 1.1 mrg "(INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16) 1797 1.1 mrg && INTVAL (operands[2]) % INTVAL (operands[1]) == 0 1798 1.19 mrg && (!MEM_P (operands[0]) 1799 1.1 mrg || ((!flag_pic 1800 1.1 mrg || vax_acceptable_pic_operand_p (XEXP (operands[0], 0), 1801 1.1 mrg true, true)) 1802 1.1 mrg && !mode_dependent_address_p (XEXP (operands[0], 0), 1803 1.19 mrg MEM_ADDR_SPACE (operands[0])))) 1804 1.19 mrg && (!(REG_P (operands[0]) 1805 1.1 mrg || (SUBREG_P (operands[0]) && REG_P (SUBREG_REG (operands[0])))) 1806 1.1 mrg || INTVAL (operands[2]) == 0) 1807 1.1 mrg && reload_completed" 1808 1.1 mrg "* 1809 1.1 mrg { 1810 1.1 mrg if (!REG_P (operands[0])) 1811 1.19 mrg operands[0] 1812 1.20 kalvisd = adjust_address (operands[0], 1813 1.19 mrg INTVAL (operands[1]) == 8 ? QImode : HImode, 1814 1.18 rin INTVAL (operands[2]) / 8); 1815 1.18 rin else 1816 1.19 mrg gcc_assert (INTVAL (operands[2]) == 0); 1817 1.19 mrg 1818 1.19 mrg if (INTVAL (operands[1]) == 8) 1819 1.19 mrg return \"movb %3,%0\"; 1820 1.19 mrg return \"movw %3,%0\"; 1821 1.19 mrg }") 1822 1.19 mrg 1823 1.19 mrg (define_insn_and_split "*extzv_aligned" 1824 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1825 1.19 mrg (zero_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 1826 1.19 mrg (match_operand:QI 2 "const_int_operand" "n") 1827 1.19 mrg (match_operand:SI 3 "const_int_operand" "n")))] 1828 1.19 mrg "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16) 1829 1.19 mrg && INTVAL (operands[3]) % INTVAL (operands[2]) == 0 1830 1.19 mrg && (!MEM_P (operands[1]) 1831 1.19 mrg || ((!flag_pic 1832 1.19 mrg || vax_acceptable_pic_operand_p (XEXP (operands[1], 0), 1833 1.19 mrg true, true)) 1834 1.19 mrg && !mode_dependent_address_p (XEXP (operands[1], 0), 1835 1.19 mrg MEM_ADDR_SPACE (operands[1])))) 1836 1.18 rin && (!(REG_P (operands[1]) 1837 1.19 mrg || (SUBREG_P (operands[1]) && REG_P (SUBREG_REG (operands[1])))) 1838 1.20 kalvisd || INTVAL (operands[3]) == 0)" 1839 1.19 mrg "#" 1840 1.18 rin "&& reload_completed" 1841 1.19 mrg [(parallel 1842 1.19 mrg [(set (match_dup 0) 1843 1.19 mrg (zero_extract:SI (match_dup 1) 1844 1.19 mrg (match_dup 2) 1845 1.19 mrg (match_dup 3))) 1846 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1847 1.19 mrg "") 1848 1.19 mrg 1849 1.19 mrg (define_insn "*extzv_aligned_2<ccn><ccnz><ccz>" 1850 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1851 1.19 mrg (zero_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 1852 1.19 mrg (match_operand:QI 2 "const_int_operand" "n") 1853 1.19 mrg (match_operand:SI 3 "const_int_operand" "n"))) 1854 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1855 1.18 rin "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16) 1856 1.18 rin && INTVAL (operands[3]) % INTVAL (operands[2]) == 0 1857 1.19 mrg && (!MEM_P (operands[1]) 1858 1.19 mrg || ((!flag_pic 1859 1.19 mrg || vax_acceptable_pic_operand_p (XEXP (operands[1], 0), 1860 1.19 mrg true, true)) 1861 1.19 mrg && !mode_dependent_address_p (XEXP (operands[1], 0), 1862 1.19 mrg MEM_ADDR_SPACE (operands[1])))) 1863 1.19 mrg && (!(REG_P (operands[1]) 1864 1.18 rin || (SUBREG_P (operands[1]) && REG_P (SUBREG_REG (operands[1])))) 1865 1.19 mrg || INTVAL (operands[3]) == 0) 1866 1.19 mrg && reload_completed" 1867 1.19 mrg "* 1868 1.18 rin { 1869 1.1 mrg if (!REG_P (operands[1])) 1870 1.19 mrg operands[1] 1871 1.18 rin = adjust_address (operands[1], 1872 1.19 mrg INTVAL (operands[2]) == 8 ? QImode : HImode, 1873 1.18 rin INTVAL (operands[3]) / 8); 1874 1.18 rin else 1875 1.19 mrg gcc_assert (INTVAL (operands[3]) == 0); 1876 1.18 rin 1877 1.19 mrg if (INTVAL (operands[2]) == 8) 1878 1.19 mrg return \"movzbl %1,%0\"; 1879 1.19 mrg return \"movzwl %1,%0\"; 1880 1.19 mrg }") 1881 1.19 mrg 1882 1.19 mrg (define_insn_and_split "*extv_aligned" 1883 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1884 1.19 mrg (sign_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 1885 1.19 mrg (match_operand:QI 2 "const_int_operand" "n") 1886 1.19 mrg (match_operand:SI 3 "const_int_operand" "n")))] 1887 1.19 mrg "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16) 1888 1.19 mrg && INTVAL (operands[3]) % INTVAL (operands[2]) == 0 1889 1.19 mrg && (!MEM_P (operands[1]) 1890 1.19 mrg || ((!flag_pic 1891 1.19 mrg || vax_acceptable_pic_operand_p (XEXP (operands[1], 0), 1892 1.19 mrg true, true)) 1893 1.19 mrg && !mode_dependent_address_p (XEXP (operands[1], 0), 1894 1.19 mrg MEM_ADDR_SPACE (operands[1])))) 1895 1.1 mrg && (!(REG_P (operands[1]) 1896 1.19 mrg || (SUBREG_P (operands[1]) && REG_P (SUBREG_REG (operands[1])))) 1897 1.1 mrg || INTVAL (operands[3]) == 0)" 1898 1.19 mrg "#" 1899 1.1 mrg "&& reload_completed" 1900 1.19 mrg [(parallel 1901 1.19 mrg [(set (match_dup 0) 1902 1.1 mrg (sign_extract:SI (match_dup 1) 1903 1.1 mrg (match_dup 2) 1904 1.19 mrg (match_dup 3))) 1905 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1906 1.19 mrg "") 1907 1.19 mrg 1908 1.19 mrg (define_insn "*extv_aligned_2<ccn><ccnz><ccz>" 1909 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1910 1.19 mrg (sign_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 1911 1.19 mrg (match_operand:QI 2 "const_int_operand" "n") 1912 1.19 mrg (match_operand:SI 3 "const_int_operand" "n"))) 1913 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1914 1.1 mrg "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16) 1915 1.1 mrg && INTVAL (operands[3]) % INTVAL (operands[2]) == 0 1916 1.19 mrg && (!MEM_P (operands[1]) 1917 1.1 mrg || ((!flag_pic 1918 1.1 mrg || vax_acceptable_pic_operand_p (XEXP (operands[1], 0), 1919 1.1 mrg true, true)) 1920 1.1 mrg && !mode_dependent_address_p (XEXP (operands[1], 0), 1921 1.19 mrg MEM_ADDR_SPACE (operands[1])))) 1922 1.19 mrg && (!(REG_P (operands[1]) 1923 1.1 mrg || (SUBREG_P (operands[1]) && REG_P (SUBREG_REG (operands[1])))) 1924 1.1 mrg || INTVAL (operands[3]) == 0) 1925 1.1 mrg && reload_completed" 1926 1.1 mrg "* 1927 1.1 mrg { 1928 1.1 mrg if (!REG_P (operands[1])) 1929 1.19 mrg operands[1] 1930 1.1 mrg = adjust_address (operands[1], 1931 1.19 mrg INTVAL (operands[2]) == 8 ? QImode : HImode, 1932 1.19 mrg INTVAL (operands[3]) / 8); 1933 1.19 mrg else 1934 1.19 mrg gcc_assert (INTVAL (operands[3]) == 0); 1935 1.1 mrg 1936 1.1 mrg if (INTVAL (operands[2]) == 8) 1937 1.1 mrg return \"cvtbl %1,%0\"; 1938 1.19 mrg return \"cvtwl %1,%0\"; 1939 1.1 mrg }") 1940 1.1 mrg 1942 1.19 mrg ;; Register and non-offsettable-memory SImode cases of bit-field insns. 1943 1.19 mrg 1944 1.19 mrg (define_insn "*cmpv_<mode>" 1945 1.1 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 1946 1.1 mrg (compare:VAXcc 1947 1.1 mrg (sign_extract:SI (match_operand:SI 0 "nonimmediate_operand" "ro") 1948 1.19 mrg (match_operand:QI 1 "general_operand" "g") 1949 1.1 mrg (match_operand:SI 2 "general_operand" "nrmT")) 1950 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 1951 1.1 mrg "reload_completed" 1952 1.1 mrg "cmpv %2,%1,%0,%3") 1953 1.1 mrg 1954 1.1 mrg (define_insn "*cmpzv_<mode>" 1955 1.1 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 1956 1.19 mrg (compare:VAXcc 1957 1.1 mrg (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "ro") 1958 1.19 mrg (match_operand:QI 1 "general_operand" "g") 1959 1.1 mrg (match_operand:SI 2 "general_operand" "nrmT")) 1960 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 1961 1.1 mrg "reload_completed" 1962 1.19 mrg "cmpzv %2,%1,%0,%3") 1963 1.19 mrg 1964 1.19 mrg ;; When the field position and size are constant and the destination 1965 1.19 mrg ;; is a register, extv and extzv are much slower than a rotate followed 1966 1.19 mrg ;; by a bicl or sign extension. Because we might end up choosing ext[z]v 1967 1.19 mrg ;; anyway, we can't allow immediate values for the primary source operand. 1968 1.19 mrg 1969 1.19 mrg (define_insn_and_split "*extv_non_const" 1970 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1971 1.19 mrg (sign_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 1972 1.19 mrg (match_operand:QI 2 "general_operand" "g") 1973 1.19 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 1974 1.19 mrg "" 1975 1.19 mrg "#" 1976 1.19 mrg "reload_completed" 1977 1.19 mrg [(parallel 1978 1.19 mrg [(set (match_dup 0) 1979 1.1 mrg (sign_extract:SI (match_dup 1) 1980 1.1 mrg (match_dup 2) 1981 1.1 mrg (match_dup 3))) 1982 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 1983 1.1 mrg "") 1984 1.1 mrg 1985 1.1 mrg (define_insn "*extv_non_const_2<ccn><ccnz><ccz>" 1986 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 1987 1.1 mrg (sign_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 1988 1.1 mrg (match_operand:QI 2 "general_operand" "g") 1989 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT"))) 1990 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 1991 1.19 mrg "reload_completed" 1992 1.19 mrg "* 1993 1.19 mrg { 1994 1.19 mrg if (! CONST_INT_P (operands[3]) || ! CONST_INT_P (operands[2]) 1995 1.19 mrg || ! REG_P (operands[0]) 1996 1.19 mrg || (INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16)) 1997 1.19 mrg return \"extv %3,%2,%1,%0\"; 1998 1.19 mrg if (INTVAL (operands[2]) == 8) 1999 1.19 mrg return \"rotl %R3,%1,%0\;cvtbl %0,%0\"; 2000 1.19 mrg return \"rotl %R3,%1,%0\;cvtwl %0,%0\"; 2001 1.19 mrg }") 2002 1.19 mrg 2003 1.19 mrg (define_insn_and_split "*extzv_non_const" 2004 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 2005 1.18 rin (zero_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 2006 1.19 mrg (match_operand:QI 2 "general_operand" "g") 2007 1.19 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 2008 1.19 mrg "" 2009 1.19 mrg "#" 2010 1.19 mrg "reload_completed" 2011 1.19 mrg [(parallel 2012 1.19 mrg [(set (match_dup 0) 2013 1.1 mrg (zero_extract:SI (match_dup 1) 2014 1.1 mrg (match_dup 2) 2015 1.19 mrg (match_dup 3))) 2016 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2017 1.19 mrg "") 2018 1.1 mrg 2019 1.1 mrg (define_insn "*extzv_non_const_2<ccn><ccnz><ccz>" 2020 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 2021 1.1 mrg (zero_extract:SI (match_operand:SI 1 "nonimmediate_operand" "ro") 2022 1.1 mrg (match_operand:QI 2 "general_operand" "g") 2023 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT"))) 2024 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2025 1.13 rin "reload_completed" 2026 1.13 rin "* 2027 1.13 rin { 2028 1.13 rin if (! CONST_INT_P (operands[3]) || ! CONST_INT_P (operands[2]) 2029 1.13 rin || ! REG_P (operands[0])) 2030 1.13 rin return \"extzv %3,%2,%1,%0\"; 2031 1.13 rin if (INTVAL (operands[2]) == 8) 2032 1.13 rin return \"rotl %R3,%1,%0\;movzbl %0,%0\"; 2033 1.1 mrg if (INTVAL (operands[2]) == 16) 2034 1.1 mrg return \"rotl %R3,%1,%0\;movzwl %0,%0\"; 2035 1.1 mrg if (INTVAL (operands[3]) & 31) 2036 1.1 mrg return \"rotl %R3,%1,%0\;bicl2 %M2,%0\"; 2037 1.1 mrg if (rtx_equal_p (operands[0], operands[1])) 2038 1.1 mrg { 2039 1.1 mrg if (INTVAL (operands[2]) == 32) 2040 1.19 mrg return \"\"; /* no-op */ 2041 1.19 mrg else 2042 1.19 mrg return \"bicl2 %M2,%0\"; 2043 1.1 mrg } 2044 1.1 mrg if (INTVAL (operands[2]) == 32) 2045 1.1 mrg return \"movl %1,%0\"; 2046 1.1 mrg return \"bicl3 %M2,%1,%0\"; 2047 1.19 mrg }") 2048 1.1 mrg 2049 1.1 mrg ;; Non-register cases. 2050 1.19 mrg ;; nonimmediate_operand is used to make sure that mode-ambiguous cases 2051 1.19 mrg ;; don't match these (and therefore match the cases above instead). 2052 1.19 mrg 2053 1.19 mrg (define_insn "*cmpv_2_<mode>" 2054 1.1 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 2055 1.1 mrg (compare:VAXcc 2056 1.1 mrg (sign_extract:SI (match_operand:QI 0 "memory_operand" "m") 2057 1.19 mrg (match_operand:QI 1 "general_operand" "g") 2058 1.1 mrg (match_operand:SI 2 "general_operand" "nrmT")) 2059 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 2060 1.17 rin "reload_completed" 2061 1.17 rin "cmpv %2,%1,%0,%3") 2062 1.19 mrg 2063 1.17 rin (define_insn "*cmpzv_2_<mode>" 2064 1.19 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 2065 1.17 rin (compare:VAXcc 2066 1.19 mrg (zero_extract:SI (match_operand:QI 0 "memory_operand" "m") 2067 1.17 rin (match_operand:QI 1 "general_operand" "g") 2068 1.19 mrg (match_operand:SI 2 "general_operand" "nrmT")) 2069 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 2070 1.1 mrg "reload_completed" 2071 1.1 mrg "cmpzv %2,%1,%0,%3") 2072 1.1 mrg 2073 1.1 mrg (define_expand "extv" 2074 1.19 mrg [(set (match_operand:SI 0 "general_operand" "") 2075 1.19 mrg (sign_extract:SI (match_operand:SI 1 "general_operand" "") 2076 1.19 mrg (match_operand:QI 2 "general_operand" "") 2077 1.19 mrg (match_operand:SI 3 "general_operand" "")))] 2078 1.19 mrg "" 2079 1.19 mrg "") 2080 1.19 mrg 2081 1.19 mrg (define_insn_and_split "*extv" 2082 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 2083 1.19 mrg (sign_extract:SI (match_operand:QI 1 "memory_operand" "m") 2084 1.19 mrg (match_operand:QI 2 "general_operand" "g") 2085 1.19 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 2086 1.19 mrg "" 2087 1.19 mrg "#" 2088 1.19 mrg "reload_completed" 2089 1.19 mrg [(parallel 2090 1.19 mrg [(set (match_dup 0) 2091 1.1 mrg (sign_extract:SI (match_dup 1) 2092 1.1 mrg (match_dup 2) 2093 1.19 mrg (match_dup 3))) 2094 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2095 1.1 mrg "") 2096 1.1 mrg 2097 1.1 mrg (define_insn "*extv_2<ccn><ccnz><ccz>" 2098 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 2099 1.3 mrg (sign_extract:SI (match_operand:QI 1 "memory_operand" "m") 2100 1.3 mrg (match_operand:QI 2 "general_operand" "g") 2101 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT"))) 2102 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2103 1.1 mrg "reload_completed" 2104 1.1 mrg "* 2105 1.1 mrg { 2106 1.1 mrg if (!REG_P (operands[0]) || !CONST_INT_P (operands[2]) 2107 1.1 mrg || !CONST_INT_P (operands[3]) 2108 1.1 mrg || (INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16) 2109 1.1 mrg || INTVAL (operands[2]) + INTVAL (operands[3]) > 32 2110 1.1 mrg || side_effects_p (operands[1]) 2111 1.19 mrg || (MEM_P (operands[1]) 2112 1.1 mrg && mode_dependent_address_p (XEXP (operands[1], 0), 2113 1.19 mrg MEM_ADDR_SPACE (operands[1])))) 2114 1.18 rin return \"extv %3,%2,%1,%0\"; 2115 1.19 mrg if (INTVAL (operands[2]) == 8) 2116 1.19 mrg return \"rotl %R3,%1,%0\;cvtbl %0,%0\"; 2117 1.19 mrg return \"rotl %R3,%1,%0\;cvtwl %0,%0\"; 2118 1.1 mrg }") 2119 1.1 mrg 2120 1.1 mrg (define_expand "extzv" 2121 1.19 mrg [(set (match_operand:SI 0 "general_operand" "") 2122 1.19 mrg (zero_extract:SI (match_operand:SI 1 "general_operand" "") 2123 1.19 mrg (match_operand:QI 2 "general_operand" "") 2124 1.19 mrg (match_operand:SI 3 "general_operand" "")))] 2125 1.19 mrg "" 2126 1.19 mrg "") 2127 1.19 mrg 2128 1.19 mrg (define_insn_and_split "*extzv" 2129 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 2130 1.19 mrg (zero_extract:SI (match_operand:QI 1 "memory_operand" "m") 2131 1.19 mrg (match_operand:QI 2 "general_operand" "g") 2132 1.19 mrg (match_operand:SI 3 "general_operand" "nrmT")))] 2133 1.19 mrg "" 2134 1.19 mrg "#" 2135 1.19 mrg "reload_completed" 2136 1.19 mrg [(parallel 2137 1.19 mrg [(set (match_dup 0) 2138 1.1 mrg (zero_extract:SI (match_dup 1) 2139 1.1 mrg (match_dup 2) 2140 1.19 mrg (match_dup 3))) 2141 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2142 1.1 mrg "") 2143 1.19 mrg 2144 1.19 mrg (define_insn "*extzv_2<ccn><ccnz><ccz>" 2145 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 2146 1.19 mrg (zero_extract:SI (match_operand:QI 1 "memory_operand" "m") 2147 1.1 mrg (match_operand:QI 2 "general_operand" "g") 2148 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT"))) 2149 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2150 1.1 mrg "reload_completed" 2151 1.1 mrg "* 2152 1.1 mrg { 2153 1.1 mrg if (!REG_P (operands[0]) || !CONST_INT_P (operands[2]) 2154 1.1 mrg || !CONST_INT_P (operands[3]) 2155 1.1 mrg || INTVAL (operands[2]) + INTVAL (operands[3]) > 32 2156 1.1 mrg || side_effects_p (operands[1]) 2157 1.1 mrg || (MEM_P (operands[1]) 2158 1.1 mrg && mode_dependent_address_p (XEXP (operands[1], 0), 2159 1.1 mrg MEM_ADDR_SPACE (operands[1])))) 2160 1.1 mrg return \"extzv %3,%2,%1,%0\"; 2161 1.1 mrg if (INTVAL (operands[2]) == 8) 2162 1.1 mrg return \"rotl %R3,%1,%0\;movzbl %0,%0\"; 2163 1.1 mrg if (INTVAL (operands[2]) == 16) 2164 1.1 mrg return \"rotl %R3,%1,%0\;movzwl %0,%0\"; 2165 1.1 mrg if (MEM_P (operands[1]) 2166 1.1 mrg && GET_CODE (XEXP (operands[1], 0)) == PLUS 2167 1.1 mrg && REG_P (XEXP (XEXP (operands[1], 0), 0)) 2168 1.1 mrg && CONST_INT_P (XEXP (XEXP (operands[1], 0), 1)) 2169 1.1 mrg && CONST_INT_P (operands[2]) 2170 1.1 mrg && CONST_INT_P (operands[3])) 2171 1.1 mrg { 2172 1.1 mrg HOST_WIDE_INT o = INTVAL (XEXP (XEXP (operands[1], 0), 1)); 2173 1.1 mrg HOST_WIDE_INT l = INTVAL (operands[2]); 2174 1.1 mrg HOST_WIDE_INT v = INTVAL (operands[3]); 2175 1.1 mrg if ((o & 3) && (o & 3) * 8 + v + l <= 32) 2176 1.1 mrg { 2177 1.19 mrg rtx tmp; 2178 1.19 mrg tmp = XEXP (XEXP (operands[1], 0), 0); 2179 1.19 mrg if (o & ~3) 2180 1.19 mrg tmp = gen_rtx_PLUS (SImode, tmp, GEN_INT (o & ~3)); 2181 1.19 mrg operands[1] = gen_rtx_MEM (QImode, tmp); 2182 1.19 mrg operands[3] = GEN_INT (v + (o & 3) * 8); 2183 1.19 mrg } 2184 1.19 mrg if (optimize_size) 2185 1.19 mrg return \"extzv %3,%2,%1,%0\"; 2186 1.19 mrg } 2187 1.19 mrg return \"rotl %R3,%1,%0\;bicl2 %M2,%0\"; 2188 1.19 mrg }") 2189 1.19 mrg 2190 1.19 mrg ;; Combine EXTV/CMPL and EXTZV/CMPL sequences where the output of 2191 1.19 mrg ;; extraction is used for the comparison only into CMPV and CMPZV 2192 1.19 mrg ;; respectively. 2193 1.19 mrg (define_peephole2 2194 1.19 mrg [(parallel 2195 1.19 mrg [(set (match_operand:SI 0 "register_operand") 2196 1.19 mrg (any_extract:SI (match_operand 1 "general_operand") 2197 1.19 mrg (match_operand:QI 2 "general_operand") 2198 1.19 mrg (match_operand:SI 3 "general_operand"))) 2199 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))]) 2200 1.19 mrg (set (reg:VAXcc VAX_PSL_REGNUM) 2201 1.1 mrg (compare:VAXcc (match_dup 0) 2202 1.1 mrg (match_operand:SI 4 "general_operand")))] 2203 1.1 mrg "peep2_reg_dead_p (2, operands[0])" 2204 1.1 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 2205 1.19 mrg (compare:VAXcc 2206 1.1 mrg (any_extract:SI (match_dup 1) 2207 1.19 mrg (match_dup 2) 2208 1.19 mrg (match_dup 3)) 2209 1.19 mrg (match_dup 4)))] 2210 1.1 mrg "") 2211 1.1 mrg 2212 1.1 mrg (define_expand "insv" 2213 1.1 mrg [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "") 2214 1.1 mrg (match_operand:QI 1 "general_operand" "") 2215 1.1 mrg (match_operand:SI 2 "general_operand" "")) 2216 1.1 mrg (match_operand:SI 3 "general_operand" ""))] 2217 1.1 mrg "" 2218 1.1 mrg "") 2219 1.1 mrg 2220 1.1 mrg ;; This one actually doesn't change CC. 2221 1.1 mrg (define_insn "*insv" 2222 1.1 mrg [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+m") 2223 1.1 mrg (match_operand:QI 1 "general_operand" "g") 2224 1.1 mrg (match_operand:SI 2 "general_operand" "nrmT")) 2225 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT"))] 2226 1.1 mrg "" 2227 1.1 mrg "* 2228 1.1 mrg { 2229 1.1 mrg if (MEM_P (operands[0]) 2230 1.1 mrg && GET_CODE (XEXP (operands[0], 0)) == PLUS 2231 1.1 mrg && REG_P (XEXP (XEXP (operands[0], 0), 0)) 2232 1.1 mrg && CONST_INT_P (XEXP (XEXP (operands[0], 0), 1)) 2233 1.1 mrg && CONST_INT_P (operands[1]) 2234 1.1 mrg && CONST_INT_P (operands[2])) 2235 1.1 mrg { 2236 1.1 mrg HOST_WIDE_INT o = INTVAL (XEXP (XEXP (operands[0], 0), 1)); 2237 1.1 mrg HOST_WIDE_INT v = INTVAL (operands[2]); 2238 1.1 mrg HOST_WIDE_INT l = INTVAL (operands[1]); 2239 1.19 mrg if ((o & 3) && (o & 3) * 8 + v + l <= 32) 2240 1.19 mrg { 2241 1.19 mrg rtx tmp; 2242 1.1 mrg tmp = XEXP (XEXP (operands[0], 0), 0); 2243 1.1 mrg if (o & ~3) 2244 1.1 mrg tmp = gen_rtx_PLUS (SImode, tmp, GEN_INT (o & ~3)); 2245 1.1 mrg operands[0] = gen_rtx_MEM (QImode, tmp); 2246 1.1 mrg operands[2] = GEN_INT (v + (o & 3) * 8); 2247 1.1 mrg } 2248 1.1 mrg } 2249 1.1 mrg return \"insv %3,%2,%1,%0\"; 2250 1.1 mrg }") 2251 1.1 mrg 2252 1.1 mrg ;; This one actually doesn't change CC. 2253 1.1 mrg (define_insn "*insv_2" 2254 1.1 mrg [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "+ro") 2255 1.1 mrg (match_operand:QI 1 "general_operand" "g") 2256 1.1 mrg (match_operand:SI 2 "general_operand" "nrmT")) 2257 1.1 mrg (match_operand:SI 3 "general_operand" "nrmT"))] 2258 1.19 mrg "" 2259 1.19 mrg "insv %3,%2,%1,%0") 2260 1.19 mrg 2262 1.19 mrg ;; Unconditional jump 2263 1.19 mrg (define_insn "jump" 2264 1.19 mrg [(set (pc) 2265 1.19 mrg (label_ref (match_operand 0 "" "")))] 2266 1.19 mrg "" 2267 1.19 mrg "jbr %l0") 2268 1.19 mrg 2269 1.19 mrg ;; Conditional jumps 2270 1.19 mrg 2271 1.19 mrg (define_expand "cbranch<mode>4" 2272 1.19 mrg [(set (pc) 2273 1.19 mrg (if_then_else 2274 1.19 mrg (match_operator 0 "ordered_comparison_operator" 2275 1.19 mrg [(match_operand:VAXint 1 "general_operand" "") 2276 1.19 mrg (match_operand:VAXint 2 "general_operand" "")]) 2277 1.19 mrg (label_ref (match_operand 3 "" "")) 2278 1.19 mrg (pc)))] 2279 1.19 mrg "" 2280 1.19 mrg "") 2281 1.1 mrg 2282 1.19 mrg (define_insn_and_split "*cbranch<VAXint:mode>4_<VAXcc:mode>" 2283 1.19 mrg [(set (pc) 2284 1.19 mrg (if_then_else 2285 1.19 mrg (match_operator 0 "vax_<VAXcc:mode>_comparison_operator" 2286 1.19 mrg [(match_operand:VAXint 1 "general_operand" "nrmT") 2287 1.19 mrg (match_operand:VAXint 2 "general_operand" "nrmT")]) 2288 1.1 mrg (label_ref (match_operand 3 "" "")) 2289 1.1 mrg (pc)))] 2290 1.19 mrg "" 2291 1.19 mrg "#" 2292 1.19 mrg "reload_completed" 2293 1.19 mrg [(set (reg:VAXcc VAX_PSL_REGNUM) 2294 1.19 mrg (compare:VAXcc (match_dup 1) (match_dup 2))) 2295 1.19 mrg (set (pc) 2296 1.19 mrg (if_then_else 2297 1.19 mrg (match_op_dup 0 [(reg:VAXcc VAX_PSL_REGNUM) 2298 1.19 mrg (const_int 0)]) 2299 1.19 mrg (label_ref (match_operand 3 "" "")) 2300 1.19 mrg (pc)))] 2301 1.19 mrg "") 2302 1.19 mrg 2303 1.19 mrg (define_expand "cbranch<mode>4" 2304 1.19 mrg [(set (pc) 2305 1.19 mrg (if_then_else 2306 1.19 mrg (match_operator 0 "ordered_comparison_operator" 2307 1.19 mrg [(match_operand:VAXfp 1 "general_operand" "") 2308 1.19 mrg (match_operand:VAXfp 2 "general_operand" "")]) 2309 1.19 mrg (label_ref (match_operand 3 "" "")) 2310 1.19 mrg (pc)))] 2311 1.19 mrg "" 2312 1.19 mrg "") 2313 1.1 mrg 2314 1.19 mrg (define_insn_and_split "*cbranch<VAXfp:mode>4_<VAXccnz:mode>" 2315 1.19 mrg [(set (pc) 2316 1.19 mrg (if_then_else 2317 1.19 mrg (match_operator 0 "vax_<VAXccnz:mode>_comparison_operator" 2318 1.19 mrg [(match_operand:VAXfp 1 "general_operand" "gF") 2319 1.19 mrg (match_operand:VAXfp 2 "general_operand" "gF")]) 2320 1.1 mrg (label_ref (match_operand 3 "" "")) 2321 1.19 mrg (pc)))] 2322 1.1 mrg "" 2323 1.19 mrg "#" 2324 1.19 mrg "reload_completed" 2325 1.1 mrg [(set (reg:VAXccnz VAX_PSL_REGNUM) 2326 1.1 mrg (compare:VAXccnz (match_dup 1) (match_dup 2))) 2327 1.1 mrg (set (pc) 2328 1.19 mrg (if_then_else 2329 1.19 mrg (match_op_dup 0 [(reg:VAXccnz VAX_PSL_REGNUM) 2330 1.1 mrg (const_int 0)]) 2331 1.1 mrg (label_ref (match_operand 3 "" "")) 2332 1.19 mrg (pc)))] 2333 1.1 mrg "") 2334 1.19 mrg 2335 1.19 mrg (define_insn "*branch_<mode>" 2336 1.1 mrg [(set (pc) 2337 1.1 mrg (if_then_else (match_operator 0 "vax_<mode>_comparison_operator" 2338 1.1 mrg [(reg:VAXcc VAX_PSL_REGNUM) 2339 1.19 mrg (const_int 0)]) 2340 1.19 mrg (label_ref (match_operand 1 "" "")) 2341 1.1 mrg (pc)))] 2342 1.1 mrg "reload_completed" 2343 1.1 mrg "j%k0 %l1") 2344 1.1 mrg 2345 1.1 mrg ;; Recognize reversed jumps. 2346 1.1 mrg (define_insn "*branch_<mode>_reversed" 2347 1.1 mrg [(set (pc) 2348 1.1 mrg (if_then_else (match_operator 0 "vax_<mode>_comparison_operator" 2349 1.1 mrg [(reg:VAXcc VAX_PSL_REGNUM) 2350 1.1 mrg (const_int 0)]) 2351 1.1 mrg (pc) 2352 1.1 mrg (label_ref (match_operand 1 "" ""))))] 2353 1.1 mrg "reload_completed" 2354 1.1 mrg "j%K0 %l1") ; %K0 negates condition 2355 1.1 mrg 2357 1.1 mrg ;; Recognize jbs, jlbs, jbc and jlbc instructions. Note that the operand 2358 1.1 mrg ;; of jlbs and jlbc insns are SImode in the hardware. However, if it is 2359 1.1 mrg ;; memory, we use QImode in the insn. So we can't use those instructions 2360 1.1 mrg ;; for mode-dependent addresses. 2361 1.1 mrg 2362 1.1 mrg (define_insn "" 2363 1.1 mrg [(set (pc) 2364 1.1 mrg (if_then_else 2365 1.1 mrg (ne (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,g") 2366 1.1 mrg (const_int 1) 2367 1.1 mrg (match_operand:SI 1 "general_operand" "I,nrmT")) 2368 1.1 mrg (const_int 0)) 2369 1.1 mrg (label_ref (match_operand 2 "" "")) 2370 1.1 mrg (pc)))] 2371 1.1 mrg "" 2372 1.1 mrg "@ 2373 1.1 mrg jlbs %0,%l2 2374 1.1 mrg jbs %1,%0,%l2") 2375 1.1 mrg 2376 1.1 mrg (define_insn "" 2377 1.1 mrg [(set (pc) 2378 1.1 mrg (if_then_else 2379 1.1 mrg (eq (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,g") 2380 1.1 mrg (const_int 1) 2381 1.1 mrg (match_operand:SI 1 "general_operand" "I,nrmT")) 2382 1.1 mrg (const_int 0)) 2383 1.1 mrg (label_ref (match_operand 2 "" "")) 2384 1.1 mrg (pc)))] 2385 1.1 mrg "" 2386 1.1 mrg "@ 2387 1.1 mrg jlbc %0,%l2 2388 1.1 mrg jbc %1,%0,%l2") 2389 1.1 mrg 2390 1.1 mrg (define_insn "" 2391 1.1 mrg [(set (pc) 2392 1.1 mrg (if_then_else 2393 1.1 mrg (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r,r") 2394 1.1 mrg (const_int 1) 2395 1.1 mrg (match_operand:SI 1 "general_operand" "I,nrmT")) 2396 1.1 mrg (const_int 0)) 2397 1.1 mrg (label_ref (match_operand 2 "" "")) 2398 1.1 mrg (pc)))] 2399 1.1 mrg "" 2400 1.1 mrg "@ 2401 1.1 mrg jlbs %0,%l2 2402 1.1 mrg jbs %1,%0,%l2") 2403 1.1 mrg 2404 1.1 mrg (define_insn "" 2405 1.1 mrg [(set (pc) 2406 1.1 mrg (if_then_else 2407 1.1 mrg (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r,r") 2408 1.1 mrg (const_int 1) 2409 1.19 mrg (match_operand:SI 1 "general_operand" "I,nrmT")) 2410 1.1 mrg (const_int 0)) 2411 1.1 mrg (label_ref (match_operand 2 "" "")) 2412 1.1 mrg (pc)))] 2413 1.1 mrg "" 2414 1.1 mrg "@ 2415 1.1 mrg jlbc %0,%l2 2416 1.1 mrg jbc %1,%0,%l2") 2417 1.1 mrg 2419 1.1 mrg ;; Subtract-and-jump and Add-and-jump insns. 2420 1.1 mrg ;; These are not used when output is for the Unix assembler 2421 1.19 mrg ;; because it does not know how to modify them to reach far. 2422 1.19 mrg 2423 1.19 mrg ;; Normal sob insns. 2424 1.19 mrg 2425 1.19 mrg (define_insn_and_split "*jsobgtr" 2426 1.19 mrg [(set (pc) 2427 1.19 mrg (if_then_else 2428 1.19 mrg (gt (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2429 1.19 mrg (const_int -1)) 2430 1.19 mrg (const_int 0)) 2431 1.19 mrg (label_ref (match_operand 1 "" "")) 2432 1.19 mrg (pc))) 2433 1.19 mrg (set (match_dup 0) 2434 1.19 mrg (plus:SI (match_dup 0) 2435 1.19 mrg (const_int -1)))] 2436 1.19 mrg "!TARGET_UNIX_ASM" 2437 1.19 mrg "#" 2438 1.19 mrg "&& reload_completed" 2439 1.19 mrg [(parallel 2440 1.19 mrg [(set (pc) 2441 1.19 mrg (if_then_else 2442 1.19 mrg (gt (plus:SI (match_dup 0) 2443 1.19 mrg (const_int -1)) 2444 1.19 mrg (const_int 0)) 2445 1.19 mrg (label_ref (match_dup 1)) 2446 1.19 mrg (pc))) 2447 1.19 mrg (set (match_dup 0) 2448 1.19 mrg (plus:SI (match_dup 0) 2449 1.19 mrg (const_int -1))) 2450 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2451 1.1 mrg "") 2452 1.19 mrg 2453 1.1 mrg (define_insn "*jsobgtr_2" 2454 1.1 mrg [(set (pc) 2455 1.1 mrg (if_then_else 2456 1.1 mrg (gt (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2457 1.1 mrg (const_int -1)) 2458 1.1 mrg (const_int 0)) 2459 1.1 mrg (label_ref (match_operand 1 "" "")) 2460 1.1 mrg (pc))) 2461 1.1 mrg (set (match_dup 0) 2462 1.1 mrg (plus:SI (match_dup 0) 2463 1.1 mrg (const_int -1))) 2464 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2465 1.19 mrg "!TARGET_UNIX_ASM && reload_completed" 2466 1.19 mrg "jsobgtr %0,%l1") 2467 1.19 mrg 2468 1.19 mrg (define_insn_and_split "*jsobgeq" 2469 1.19 mrg [(set (pc) 2470 1.19 mrg (if_then_else 2471 1.19 mrg (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2472 1.19 mrg (const_int -1)) 2473 1.19 mrg (const_int 0)) 2474 1.19 mrg (label_ref (match_operand 1 "" "")) 2475 1.19 mrg (pc))) 2476 1.19 mrg (set (match_dup 0) 2477 1.19 mrg (plus:SI (match_dup 0) 2478 1.19 mrg (const_int -1)))] 2479 1.19 mrg "!TARGET_UNIX_ASM" 2480 1.19 mrg "#" 2481 1.19 mrg "&& reload_completed" 2482 1.19 mrg [(parallel 2483 1.19 mrg [(set (pc) 2484 1.19 mrg (if_then_else 2485 1.19 mrg (ge (plus:SI (match_dup 0) 2486 1.19 mrg (const_int -1)) 2487 1.19 mrg (const_int 0)) 2488 1.19 mrg (label_ref (match_dup 1)) 2489 1.19 mrg (pc))) 2490 1.19 mrg (set (match_dup 0) 2491 1.19 mrg (plus:SI (match_dup 0) 2492 1.19 mrg (const_int -1))) 2493 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2494 1.1 mrg "") 2495 1.1 mrg 2496 1.19 mrg (define_insn "*jsobgeq_2" 2497 1.1 mrg [(set (pc) 2498 1.1 mrg (if_then_else 2499 1.1 mrg (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2500 1.1 mrg (const_int -1)) 2501 1.1 mrg (const_int 0)) 2502 1.1 mrg (label_ref (match_operand 1 "" "")) 2503 1.1 mrg (pc))) 2504 1.1 mrg (set (match_dup 0) 2505 1.1 mrg (plus:SI (match_dup 0) 2506 1.1 mrg (const_int -1))) 2507 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2508 1.19 mrg "!TARGET_UNIX_ASM && reload_completed" 2509 1.19 mrg "jsobgeq %0,%l1") 2510 1.19 mrg 2511 1.19 mrg ;; Normal aob insns. Define a version for when operands[1] is a constant. 2512 1.19 mrg (define_insn_and_split "*jaoblss" 2513 1.19 mrg [(set (pc) 2514 1.19 mrg (if_then_else 2515 1.19 mrg (lt (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2516 1.19 mrg (const_int 1)) 2517 1.19 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2518 1.19 mrg (label_ref (match_operand 2 "" "")) 2519 1.19 mrg (pc))) 2520 1.19 mrg (set (match_dup 0) 2521 1.19 mrg (plus:SI (match_dup 0) 2522 1.19 mrg (const_int 1)))] 2523 1.19 mrg "!TARGET_UNIX_ASM" 2524 1.19 mrg "#" 2525 1.19 mrg "&& reload_completed" 2526 1.19 mrg [(parallel 2527 1.19 mrg [(set (pc) 2528 1.19 mrg (if_then_else 2529 1.19 mrg (lt (plus:SI (match_dup 0) 2530 1.19 mrg (const_int 1)) 2531 1.19 mrg (match_dup 1)) 2532 1.19 mrg (label_ref (match_dup 2)) 2533 1.19 mrg (pc))) 2534 1.19 mrg (set (match_dup 0) 2535 1.19 mrg (plus:SI (match_dup 0) 2536 1.19 mrg (const_int 1))) 2537 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2538 1.1 mrg "") 2539 1.19 mrg 2540 1.1 mrg (define_insn "*jaoblss_2" 2541 1.1 mrg [(set (pc) 2542 1.1 mrg (if_then_else 2543 1.1 mrg (lt (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2544 1.1 mrg (const_int 1)) 2545 1.1 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2546 1.1 mrg (label_ref (match_operand 2 "" "")) 2547 1.1 mrg (pc))) 2548 1.1 mrg (set (match_dup 0) 2549 1.1 mrg (plus:SI (match_dup 0) 2550 1.19 mrg (const_int 1))) 2551 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2552 1.19 mrg "!TARGET_UNIX_ASM && reload_completed" 2553 1.19 mrg "jaoblss %1,%0,%l2") 2554 1.19 mrg 2555 1.19 mrg (define_insn_and_split "*jaoblss_const" 2556 1.19 mrg [(set (pc) 2557 1.19 mrg (if_then_else 2558 1.19 mrg (lt (match_operand:SI 0 "nonimmediate_operand" "+g") 2559 1.19 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2560 1.19 mrg (label_ref (match_operand 2 "" "")) 2561 1.19 mrg (pc))) 2562 1.19 mrg (set (match_dup 0) 2563 1.19 mrg (plus:SI (match_dup 0) 2564 1.19 mrg (const_int 1)))] 2565 1.19 mrg "!TARGET_UNIX_ASM && CONST_INT_P (operands[1])" 2566 1.19 mrg "#" 2567 1.19 mrg "&& reload_completed" 2568 1.19 mrg [(parallel 2569 1.19 mrg [(set (pc) 2570 1.19 mrg (if_then_else 2571 1.19 mrg (lt (match_dup 0) 2572 1.19 mrg (match_dup 1)) 2573 1.19 mrg (label_ref (match_dup 2)) 2574 1.19 mrg (pc))) 2575 1.19 mrg (set (match_dup 0) 2576 1.19 mrg (plus:SI (match_dup 0) 2577 1.1 mrg (const_int 1))) 2578 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2579 1.19 mrg "") 2580 1.1 mrg 2581 1.1 mrg (define_insn "*jaoblss_const_2" 2582 1.1 mrg [(set (pc) 2583 1.1 mrg (if_then_else 2584 1.1 mrg (lt (match_operand:SI 0 "nonimmediate_operand" "+g") 2585 1.1 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2586 1.1 mrg (label_ref (match_operand 2 "" "")) 2587 1.1 mrg (pc))) 2588 1.1 mrg (set (match_dup 0) 2589 1.1 mrg (plus:SI (match_dup 0) 2590 1.1 mrg (const_int 1))) 2591 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2592 1.19 mrg "!TARGET_UNIX_ASM && CONST_INT_P (operands[1]) && reload_completed" 2593 1.19 mrg "jaoblss %P1,%0,%l2") 2594 1.19 mrg 2595 1.19 mrg (define_insn_and_split "*jaobleq" 2596 1.19 mrg [(set (pc) 2597 1.19 mrg (if_then_else 2598 1.19 mrg (le (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2599 1.19 mrg (const_int 1)) 2600 1.19 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2601 1.19 mrg (label_ref (match_operand 2 "" "")) 2602 1.19 mrg (pc))) 2603 1.19 mrg (set (match_dup 0) 2604 1.19 mrg (plus:SI (match_dup 0) 2605 1.19 mrg (const_int 1)))] 2606 1.19 mrg "!TARGET_UNIX_ASM" 2607 1.19 mrg "#" 2608 1.19 mrg "&& reload_completed" 2609 1.19 mrg [(parallel 2610 1.19 mrg [(set (pc) 2611 1.19 mrg (if_then_else 2612 1.19 mrg (le (plus:SI (match_dup 0) 2613 1.19 mrg (const_int 1)) 2614 1.19 mrg (match_dup 1)) 2615 1.19 mrg (label_ref (match_dup 2)) 2616 1.19 mrg (pc))) 2617 1.19 mrg (set (match_dup 0) 2618 1.19 mrg (plus:SI (match_dup 0) 2619 1.19 mrg (const_int 1))) 2620 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2621 1.1 mrg "") 2622 1.19 mrg 2623 1.1 mrg (define_insn "*jaobleq_2" 2624 1.1 mrg [(set (pc) 2625 1.1 mrg (if_then_else 2626 1.1 mrg (le (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g") 2627 1.1 mrg (const_int 1)) 2628 1.1 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2629 1.1 mrg (label_ref (match_operand 2 "" "")) 2630 1.1 mrg (pc))) 2631 1.1 mrg (set (match_dup 0) 2632 1.1 mrg (plus:SI (match_dup 0) 2633 1.19 mrg (const_int 1))) 2634 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2635 1.19 mrg "!TARGET_UNIX_ASM && reload_completed" 2636 1.19 mrg "jaobleq %1,%0,%l2") 2637 1.19 mrg 2638 1.19 mrg (define_insn_and_split "*jaobleq_const" 2639 1.19 mrg [(set (pc) 2640 1.19 mrg (if_then_else 2641 1.19 mrg (le (match_operand:SI 0 "nonimmediate_operand" "+g") 2642 1.19 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2643 1.19 mrg (label_ref (match_operand 2 "" "")) 2644 1.19 mrg (pc))) 2645 1.19 mrg (set (match_dup 0) 2646 1.19 mrg (plus:SI (match_dup 0) 2647 1.19 mrg (const_int 1)))] 2648 1.19 mrg "!TARGET_UNIX_ASM && CONST_INT_P (operands[1])" 2649 1.19 mrg "#" 2650 1.19 mrg "&& reload_completed" 2651 1.19 mrg [(parallel 2652 1.19 mrg [(set (pc) 2653 1.19 mrg (if_then_else 2654 1.19 mrg (le (match_dup 0) 2655 1.19 mrg (match_dup 1)) 2656 1.19 mrg (label_ref (match_dup 2)) 2657 1.19 mrg (pc))) 2658 1.19 mrg (set (match_dup 0) 2659 1.19 mrg (plus:SI (match_dup 0) 2660 1.1 mrg (const_int 1))) 2661 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2662 1.1 mrg "") 2663 1.1 mrg 2664 1.1 mrg (define_insn "*jaobleq_const_2" 2665 1.19 mrg [(set (pc) 2666 1.1 mrg (if_then_else 2667 1.1 mrg (le (match_operand:SI 0 "nonimmediate_operand" "+g") 2668 1.1 mrg (match_operand:SI 1 "general_operand" "nrmT")) 2669 1.1 mrg (label_ref (match_operand 2 "" "")) 2670 1.1 mrg (pc))) 2671 1.1 mrg (set (match_dup 0) 2672 1.1 mrg (plus:SI (match_dup 0) 2673 1.1 mrg (const_int 1))) 2674 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2675 1.1 mrg "!TARGET_UNIX_ASM && CONST_INT_P (operands[1]) && reload_completed" 2676 1.19 mrg "jaobleq %P1,%0,%l2") 2677 1.19 mrg 2678 1.19 mrg ;; Something like a sob insn, but compares against -1. 2679 1.19 mrg ;; This finds `while (foo--)' which was changed to `while (--foo != -1)'. 2680 1.19 mrg 2681 1.19 mrg (define_insn_and_split "*jsobneq_minus_one" 2682 1.19 mrg [(set (pc) 2683 1.19 mrg (if_then_else 2684 1.19 mrg (ne (match_operand:SI 0 "nonimmediate_operand" "+g") 2685 1.19 mrg (const_int 0)) 2686 1.19 mrg (label_ref (match_operand 1 "" "")) 2687 1.19 mrg (pc))) 2688 1.19 mrg (set (match_dup 0) 2689 1.19 mrg (plus:SI (match_dup 0) 2690 1.19 mrg (const_int -1)))] 2691 1.19 mrg "" 2692 1.19 mrg "#" 2693 1.19 mrg "reload_completed" 2694 1.19 mrg [(parallel 2695 1.19 mrg [(set (pc) 2696 1.19 mrg (if_then_else 2697 1.19 mrg (ne (match_dup 0) 2698 1.19 mrg (const_int 0)) 2699 1.19 mrg (label_ref (match_dup 1)) 2700 1.19 mrg (pc))) 2701 1.19 mrg (set (match_dup 0) 2702 1.19 mrg (plus:SI (match_dup 0) 2703 1.1 mrg (const_int -1))) 2704 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 2705 1.1 mrg "") 2706 1.1 mrg 2707 1.1 mrg (define_insn "*jsobneq_minus_one_2" 2708 1.1 mrg [(set (pc) 2709 1.1 mrg (if_then_else 2710 1.1 mrg (ne (match_operand:SI 0 "nonimmediate_operand" "+g") 2711 1.1 mrg (const_int 0)) 2712 1.1 mrg (label_ref (match_operand 1 "" "")) 2713 1.1 mrg (pc))) 2714 1.1 mrg (set (match_dup 0) 2715 1.1 mrg (plus:SI (match_dup 0) 2716 1.1 mrg (const_int -1))) 2717 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 2718 1.1 mrg "reload_completed" 2719 1.1 mrg "decl %0\;jgequ %l1") 2720 1.1 mrg 2722 1.1 mrg (define_expand "call_pop" 2723 1.1 mrg [(parallel [(call (match_operand:QI 0 "memory_operand" "") 2724 1.1 mrg (match_operand:SI 1 "const_int_operand" "")) 2725 1.1 mrg (set (reg:SI VAX_SP_REGNUM) 2726 1.1 mrg (plus:SI (reg:SI VAX_SP_REGNUM) 2727 1.1 mrg (match_operand:SI 3 "immediate_operand" "")))])] 2728 1.1 mrg "" 2729 1.1 mrg { 2730 1.1 mrg gcc_assert (INTVAL (operands[3]) <= 255 * 4 && INTVAL (operands[3]) % 4 == 0); 2731 1.1 mrg 2732 1.1 mrg /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size 2733 1.1 mrg during EH unwinding. We must include the argument count pushed by 2734 1.1 mrg the calls instruction. */ 2735 1.1 mrg operands[1] = GEN_INT (INTVAL (operands[3]) + 4); 2736 1.1 mrg }) 2737 1.1 mrg 2738 1.1 mrg (define_insn "*call_pop" 2739 1.1 mrg [(call (match_operand:QI 0 "memory_operand" "m") 2740 1.1 mrg (match_operand:SI 1 "const_int_operand" "n")) 2741 1.1 mrg (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM) 2742 1.1 mrg (match_operand:SI 2 "immediate_operand" "i")))] 2743 1.1 mrg "" 2744 1.1 mrg { 2745 1.1 mrg operands[1] = GEN_INT ((INTVAL (operands[1]) - 4) / 4); 2746 1.1 mrg return "calls %1,%0"; 2747 1.1 mrg }) 2748 1.1 mrg 2749 1.1 mrg (define_expand "call_value_pop" 2750 1.1 mrg [(parallel [(set (match_operand 0 "" "") 2751 1.1 mrg (call (match_operand:QI 1 "memory_operand" "") 2752 1.1 mrg (match_operand:SI 2 "const_int_operand" ""))) 2753 1.1 mrg (set (reg:SI VAX_SP_REGNUM) 2754 1.1 mrg (plus:SI (reg:SI VAX_SP_REGNUM) 2755 1.1 mrg (match_operand:SI 4 "immediate_operand" "")))])] 2756 1.1 mrg "" 2757 1.1 mrg { 2758 1.1 mrg gcc_assert (INTVAL (operands[4]) <= 255 * 4 && INTVAL (operands[4]) % 4 == 0); 2759 1.1 mrg 2760 1.1 mrg /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size 2761 1.1 mrg during EH unwinding. We must include the argument count pushed by 2762 1.1 mrg the calls instruction. */ 2763 1.1 mrg operands[2] = GEN_INT (INTVAL (operands[4]) + 4); 2764 1.1 mrg }) 2765 1.1 mrg 2766 1.1 mrg (define_insn "*call_value_pop" 2767 1.1 mrg [(set (match_operand 0 "" "") 2768 1.1 mrg (call (match_operand:QI 1 "memory_operand" "m") 2769 1.1 mrg (match_operand:SI 2 "const_int_operand" "n"))) 2770 1.1 mrg (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM) 2771 1.1 mrg (match_operand:SI 3 "immediate_operand" "i")))] 2772 1.1 mrg "" 2773 1.1 mrg "* 2774 1.1 mrg { 2775 1.1 mrg operands[2] = GEN_INT ((INTVAL (operands[2]) - 4) / 4); 2776 1.3 mrg return \"calls %2,%1\"; 2777 1.1 mrg }") 2778 1.1 mrg 2779 1.1 mrg (define_expand "call" 2780 1.1 mrg [(call (match_operand:QI 0 "memory_operand" "") 2781 1.1 mrg (match_operand:SI 1 "const_int_operand" ""))] 2782 1.1 mrg "" 2783 1.1 mrg " 2784 1.1 mrg { 2785 1.1 mrg /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size 2786 1.1 mrg during EH unwinding. We must include the argument count pushed by 2787 1.1 mrg the calls instruction. */ 2788 1.1 mrg operands[1] = GEN_INT (INTVAL (operands[1]) + 4); 2789 1.1 mrg }") 2790 1.1 mrg 2791 1.1 mrg (define_insn "*call" 2792 1.1 mrg [(call (match_operand:QI 0 "memory_operand" "m") 2793 1.1 mrg (match_operand:SI 1 "const_int_operand" ""))] 2794 1.1 mrg "" 2795 1.1 mrg "calls $0,%0") 2796 1.1 mrg 2797 1.1 mrg (define_expand "call_value" 2798 1.1 mrg [(set (match_operand 0 "" "") 2799 1.1 mrg (call (match_operand:QI 1 "memory_operand" "") 2800 1.1 mrg (match_operand:SI 2 "const_int_operand" "")))] 2801 1.1 mrg "" 2802 1.1 mrg " 2803 1.1 mrg { 2804 1.1 mrg /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size 2805 1.1 mrg during EH unwinding. We must include the argument count pushed by 2806 1.1 mrg the calls instruction. */ 2807 1.1 mrg operands[2] = GEN_INT (INTVAL (operands[2]) + 4); 2808 1.1 mrg }") 2809 1.1 mrg 2810 1.1 mrg (define_insn "*call_value" 2811 1.1 mrg [(set (match_operand 0 "" "") 2812 1.1 mrg (call (match_operand:QI 1 "memory_operand" "m") 2813 1.1 mrg (match_operand:SI 2 "const_int_operand" "")))] 2814 1.1 mrg "" 2815 1.1 mrg "calls $0,%1") 2816 1.1 mrg 2817 1.1 mrg ;; Call subroutine returning any type. 2818 1.1 mrg 2819 1.1 mrg (define_expand "untyped_call" 2820 1.1 mrg [(parallel [(call (match_operand 0 "" "") 2821 1.1 mrg (const_int 0)) 2822 1.1 mrg (match_operand 1 "" "") 2823 1.1 mrg (match_operand 2 "" "")])] 2824 1.1 mrg "" 2825 1.1 mrg " 2826 1.1 mrg { 2827 1.1 mrg int i; 2828 1.1 mrg 2829 1.1 mrg emit_call_insn (gen_call_pop (operands[0], const0_rtx, NULL, const0_rtx)); 2830 1.1 mrg 2831 1.1 mrg for (i = 0; i < XVECLEN (operands[2], 0); i++) 2832 1.1 mrg { 2833 1.1 mrg rtx set = XVECEXP (operands[2], 0, i); 2834 1.1 mrg emit_move_insn (SET_DEST (set), SET_SRC (set)); 2835 1.1 mrg } 2836 1.1 mrg 2837 1.3 mrg /* The optimizer does not know that the call sets the function value 2838 1.3 mrg registers we stored in the result block. We avoid problems by 2839 1.3 mrg claiming that all hard registers are used and clobbered at this 2840 1.3 mrg point. */ 2841 1.3 mrg emit_insn (gen_blockage ()); 2842 1.1 mrg 2843 1.1 mrg DONE; 2844 1.1 mrg }") 2845 1.1 mrg 2846 1.1 mrg ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and 2847 1.3 mrg ;; all of memory. This blocks insns from being moved across this point. 2848 1.3 mrg 2849 1.3 mrg (define_insn "blockage" 2850 1.3 mrg [(unspec_volatile [(const_int 0)] VUNSPEC_BLOCKAGE)] 2851 1.3 mrg "" 2852 1.3 mrg "") 2853 1.3 mrg 2854 1.3 mrg (define_insn "procedure_entry_mask" 2855 1.1 mrg [(unspec_volatile [(match_operand 0 "const_int_operand")] VUNSPEC_PEM)] 2856 1.1 mrg "" 2857 1.1 mrg ".word %x0") 2858 1.1 mrg 2859 1.1 mrg (define_insn "return" 2860 1.1 mrg [(return)] 2861 1.1 mrg "" 2862 1.1 mrg "ret") 2863 1.1 mrg 2864 1.12 rin (define_expand "prologue" 2865 1.12 rin [(const_int 0)] 2866 1.12 rin "" 2867 1.12 rin { 2868 1.12 rin vax_expand_prologue (); 2869 1.12 rin DONE; 2870 1.12 rin }) 2871 1.12 rin 2872 1.12 rin (define_expand "epilogue" 2873 1.12 rin [(return)] 2874 1.12 rin "" 2875 1.12 rin " 2876 1.12 rin { 2877 1.12 rin emit_jump_insn (gen_return ()); 2878 1.12 rin DONE; 2879 1.12 rin }") 2880 1.12 rin 2881 1.12 rin ;; Exception handling 2882 1.12 rin ;; This is used when compiling the stack unwinding routines. 2883 1.12 rin (define_expand "eh_return" 2884 1.12 rin [(use (match_operand 0 "general_operand"))] 2885 1.19 mrg "" 2886 1.12 rin { 2887 1.12 rin if (GET_MODE (operands[0]) != word_mode) 2888 1.12 rin operands[0] = convert_to_mode (word_mode, operands[0], 0); 2889 1.12 rin emit_insn (gen_eh_set_retaddr (operands[0])); 2890 1.12 rin DONE; 2891 1.12 rin }) 2892 1.19 mrg 2893 1.19 mrg (define_insn_and_split "eh_set_retaddr" 2894 1.1 mrg [(unspec [(match_operand:SI 0 "general_operand")] VUNSPEC_EH_RETURN) 2895 1.1 mrg (clobber (match_scratch:SI 1 "=&r")) 2896 1.1 mrg ] 2897 1.1 mrg "" 2898 1.1 mrg "#" 2899 1.1 mrg "reload_completed" 2900 1.1 mrg [(const_int 0)] 2901 1.1 mrg { 2902 1.1 mrg rtx tmp = RETURN_ADDR_RTX(0, frame_pointer_rtx); 2903 1.1 mrg MEM_VOLATILE_P(tmp) = 1; 2904 1.1 mrg tmp = gen_rtx_SET(tmp, operands[0]); 2905 1.1 mrg emit_insn(tmp); 2906 1.1 mrg DONE; 2907 1.1 mrg }) 2908 1.1 mrg 2909 1.1 mrg 2910 1.1 mrg 2911 1.1 mrg (define_insn "nop" 2912 1.1 mrg [(const_int 0)] 2913 1.1 mrg "" 2914 1.1 mrg "nop") 2915 1.1 mrg 2916 1.1 mrg ;; This had a wider constraint once, and it had trouble. 2917 1.1 mrg ;; If you are tempted to try `g', please don't--it's not worth 2918 1.1 mrg ;; the risk we will reopen the same bug. 2919 1.1 mrg (define_insn "indirect_jump" 2920 1.1 mrg [(set (pc) (match_operand:SI 0 "register_operand" "r"))] 2921 1.1 mrg "" 2922 1.1 mrg "jmp (%0)") 2923 1.1 mrg 2924 1.1 mrg ;; This is here to accept 5 arguments (as passed by expand_end_case) 2925 1.1 mrg ;; and pass the first 4 along to the casesi1 pattern that really does 2926 1.1 mrg ;; the actual casesi work. We emit a jump here to the default label 2927 1.1 mrg ;; _before_ the casesi so that we can be sure that the casesi never 2928 1.1 mrg ;; drops through. 2929 1.1 mrg ;; This is suboptimal perhaps, but so is much of the rest of this 2930 1.1 mrg ;; machine description. For what it's worth, HPPA uses the same trick. 2931 1.1 mrg ;; 2932 1.1 mrg ;; operand 0 is index 2933 1.1 mrg ;; operand 1 is the minimum bound (a const_int) 2934 1.1 mrg ;; operand 2 is the maximum bound - minimum bound + 1 (also a const_int) 2935 1.1 mrg ;; operand 3 is CODE_LABEL for the table; 2936 1.1 mrg ;; operand 4 is the CODE_LABEL to go to if index out of range (ie. default). 2937 1.1 mrg ;; 2938 1.1 mrg ;; We emit: 2939 1.1 mrg ;; i = index - minimum_bound 2940 1.1 mrg ;; if (i > (maximum_bound - minimum_bound + 1) goto default; 2941 1.1 mrg ;; casesi (i, 0, table); 2942 1.1 mrg ;; 2943 1.19 mrg (define_expand "casesi" 2944 1.1 mrg [(match_operand:SI 0 "general_operand" "") 2945 1.1 mrg (match_operand:SI 1 "general_operand" "") 2946 1.1 mrg (match_operand:SI 2 "general_operand" "") 2947 1.1 mrg (match_operand 3 "" "") 2948 1.1 mrg (match_operand 4 "" "")] 2949 1.1 mrg "" 2950 1.1 mrg { 2951 1.1 mrg rtx test; 2952 1.1 mrg 2953 1.1 mrg /* i = index - minimum_bound; 2954 1.1 mrg But only if the lower bound is not already zero. */ 2955 1.1 mrg if (operands[1] != const0_rtx) 2956 1.1 mrg { 2957 1.1 mrg rtx index = gen_reg_rtx (SImode); 2958 1.1 mrg emit_insn (gen_addsi3 (index, 2959 1.19 mrg operands[0], 2960 1.1 mrg gen_int_mode (-INTVAL (operands[1]), SImode))); 2961 1.1 mrg operands[0] = index; 2962 1.1 mrg } 2963 1.19 mrg 2964 1.19 mrg /* if (i > (maximum_bound - minimum_bound + 1)) goto default; */ 2965 1.19 mrg test = gen_rtx_fmt_ee (GTU, VOIDmode, operands[0], operands[2]); 2966 1.19 mrg emit_jump_insn (gen_cbranchsi4 (test, operands[0], operands[2], operands[4])); 2967 1.19 mrg 2968 1.1 mrg /* casesi (i, 0, table); */ 2969 1.1 mrg emit_jump_insn (gen_casesi1 (operands[0], operands[2], operands[3])); 2970 1.19 mrg DONE; 2971 1.19 mrg }) 2972 1.19 mrg 2973 1.19 mrg ;; This insn is a bit of a lier. It actually falls through if no case 2974 1.19 mrg ;; matches. But, we prevent that from ever happening by emitting a jump 2975 1.19 mrg ;; before this, see the define_expand above. 2976 1.19 mrg (define_insn_and_split "casesi1" 2977 1.19 mrg [(match_operand:SI 1 "const_int_operand" "n") 2978 1.19 mrg (set (pc) 2979 1.19 mrg (plus:SI (sign_extend:SI 2980 1.19 mrg (mem:HI (plus:SI 2981 1.19 mrg (mult:SI 2982 1.19 mrg (match_operand:SI 0 "general_operand" "nrmT") 2983 1.19 mrg (const_int 2)) 2984 1.19 mrg (pc)))) 2985 1.19 mrg (label_ref:SI (match_operand 2 "" ""))))] 2986 1.19 mrg "" 2987 1.19 mrg "#" 2988 1.19 mrg "reload_completed" 2989 1.19 mrg [(parallel 2990 1.19 mrg [(use (match_dup 1)) 2991 1.19 mrg (set (pc) 2992 1.19 mrg (plus:SI (sign_extend:SI 2993 1.19 mrg (mem:HI (plus:SI 2994 1.19 mrg (mult:SI 2995 1.19 mrg (match_dup 0) 2996 1.19 mrg (const_int 2)) 2997 1.19 mrg (pc)))) 2998 1.19 mrg (label_ref:SI (match_dup 2)))) 2999 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM)) 3000 1.19 mrg (use (label_ref:SI (match_dup 2))) 3001 1.1 mrg ])] 3002 1.1 mrg "") 3003 1.19 mrg 3004 1.1 mrg (define_insn "*casesi1" 3005 1.19 mrg [(use (match_operand:SI 1 "const_int_operand" "n")) 3006 1.1 mrg (set (pc) 3007 1.19 mrg (plus:SI (sign_extend:SI 3008 1.19 mrg (mem:HI (plus:SI 3009 1.19 mrg (mult:SI 3010 1.19 mrg (match_operand:SI 0 "general_operand" "nrmT") 3011 1.19 mrg (const_int 2)) 3012 1.19 mrg (pc)))) 3013 1.19 mrg (label_ref:SI (match_operand 2 "" "")))) 3014 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM)) 3015 1.19 mrg (use (label_ref:SI (match_dup 2))) 3016 1.19 mrg ] 3017 1.19 mrg "reload_completed" 3018 1.19 mrg "casel %0,$0,%1") 3019 1.19 mrg 3021 1.1 mrg (define_insn_and_split "*pushsym" 3022 1.19 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3023 1.1 mrg (match_operand:SI 1 "pic_symbolic_operand" "A"))] 3024 1.19 mrg "" 3025 1.1 mrg "#" 3026 1.19 mrg "reload_completed" 3027 1.19 mrg [(parallel 3028 1.19 mrg [(set (match_dup 0) 3029 1.19 mrg (match_dup 1)) 3030 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3031 1.19 mrg "") 3032 1.19 mrg 3033 1.19 mrg (define_insn "*pushsym_2<ccn><ccnz><ccz>" 3034 1.19 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3035 1.19 mrg (match_operand:SI 1 "pic_symbolic_operand" "A")) 3036 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3037 1.19 mrg "reload_completed" 3038 1.19 mrg "pushab %a1") 3039 1.1 mrg 3040 1.1 mrg (define_insn_and_split "*movsym" 3041 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3042 1.19 mrg (match_operand:SI 1 "pic_symbolic_operand" "A"))] 3043 1.19 mrg "" 3044 1.19 mrg "#" 3045 1.19 mrg "reload_completed" 3046 1.19 mrg [(parallel 3047 1.19 mrg [(set (match_dup 0) 3048 1.19 mrg (match_dup 1)) 3049 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3050 1.19 mrg "") 3051 1.19 mrg 3052 1.19 mrg (define_insn "*movsym_2<ccn><ccnz><ccz>" 3053 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3054 1.19 mrg (match_operand:SI 1 "pic_symbolic_operand" "A")) 3055 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3056 1.1 mrg "reload_completed" 3057 1.19 mrg "movab %a1,%0") 3058 1.19 mrg 3059 1.19 mrg (define_insn_and_split "*pushsymreg" 3060 1.19 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3061 1.19 mrg (plus:SI (match_operand:SI 1 "register_operand" "%r") 3062 1.19 mrg (match_operand:SI 2 "pic_symbolic_operand" "A")))] 3063 1.19 mrg "flag_pic" 3064 1.19 mrg "#" 3065 1.19 mrg "&& reload_completed" 3066 1.19 mrg [(parallel 3067 1.19 mrg [(set (match_dup 0) 3068 1.19 mrg (plus:SI (match_dup 1) 3069 1.19 mrg (match_dup 2))) 3070 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3071 1.19 mrg "") 3072 1.19 mrg 3073 1.19 mrg (define_insn "*pushsymreg_2<ccn><ccnz><ccz>" 3074 1.19 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3075 1.19 mrg (plus:SI (match_operand:SI 1 "register_operand" "%r") 3076 1.1 mrg (match_operand:SI 2 "pic_symbolic_operand" "A"))) 3077 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3078 1.1 mrg "flag_pic && reload_completed" 3079 1.19 mrg "pushab %a2[%1]") 3080 1.19 mrg 3081 1.19 mrg (define_insn_and_split "*movsymreg" 3082 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3083 1.19 mrg (plus:SI (match_operand:SI 1 "register_operand" "%r") 3084 1.1 mrg (match_operand:SI 2 "pic_symbolic_operand" "A")))] 3085 1.1 mrg "flag_pic" 3086 1.1 mrg "#" 3087 1.1 mrg "&& reload_completed" 3088 1.1 mrg [(parallel 3089 1.1 mrg [(set (match_dup 0) 3090 1.1 mrg (plus:SI (match_dup 1) 3091 1.1 mrg (match_dup 2))) 3092 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3093 1.19 mrg "") 3094 1.1 mrg 3095 1.1 mrg (define_insn "*movsymreg_2<ccn><ccnz><ccz>" 3096 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3097 1.19 mrg (plus:SI (match_operand:SI 1 "register_operand" "%r") 3098 1.19 mrg (match_operand:SI 2 "pic_symbolic_operand" "A"))) 3099 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3100 1.19 mrg "flag_pic && reload_completed" 3101 1.19 mrg "movab %a2[%1],%0") 3102 1.19 mrg 3104 1.19 mrg ;;- load or push effective address 3105 1.19 mrg ;; These come after the move and add/sub patterns 3106 1.19 mrg ;; because we don't want pushl $1 turned into pushad 1. 3107 1.19 mrg ;; or addl3 r1,r2,r3 turned into movab 0(r1)[r2],r3. 3108 1.19 mrg 3109 1.19 mrg ;; It does not work to use constraints to distinguish pushes from moves, 3110 1.1 mrg ;; because < matches any autodecrement, not just a push. 3111 1.1 mrg 3112 1.19 mrg (define_insn_and_split "pushaddr<mode>" 3113 1.1 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3114 1.1 mrg (match_operand:VAXintQHSD 1 "address_operand" "p"))] 3115 1.1 mrg "" 3116 1.19 mrg "#" 3117 1.19 mrg "reload_completed" 3118 1.19 mrg [(parallel 3119 1.19 mrg [(set (match_dup 0) 3120 1.19 mrg (match_dup 1)) 3121 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3122 1.19 mrg "") 3123 1.19 mrg 3124 1.19 mrg (define_insn "*pushaddr<mode><ccn><ccnz><ccz>" 3125 1.19 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3126 1.19 mrg (match_operand:VAXintQHSD 1 "address_operand" "p")) 3127 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3128 1.19 mrg "reload_completed" 3129 1.1 mrg "pusha<VAXintQHSD:isfx> %a1") 3130 1.1 mrg 3131 1.19 mrg (define_insn_and_split "movaddr<mode>" 3132 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3133 1.1 mrg (match_operand:VAXintQHSD 1 "address_operand" "p"))] 3134 1.1 mrg "" 3135 1.19 mrg "#" 3136 1.19 mrg "reload_completed" 3137 1.19 mrg [(parallel 3138 1.19 mrg [(set (match_dup 0) 3139 1.19 mrg (match_dup 1)) 3140 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3141 1.19 mrg "") 3142 1.19 mrg 3143 1.19 mrg (define_insn "*movaddr<mode><ccn><ccnz><ccz>" 3144 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3145 1.19 mrg (match_operand:VAXintQHSD 1 "address_operand" "p")) 3146 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3147 1.19 mrg "reload_completed" 3148 1.1 mrg "mova<VAXintQHSD:isfx> %a1,%0") 3149 1.1 mrg 3150 1.19 mrg (define_insn_and_split "pushaddr<mode>" 3151 1.1 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3152 1.1 mrg (match_operand:VAXfp 1 "address_operand" "p"))] 3153 1.1 mrg "" 3154 1.19 mrg "#" 3155 1.19 mrg "reload_completed" 3156 1.19 mrg [(parallel 3157 1.19 mrg [(set (match_dup 0) 3158 1.19 mrg (match_dup 1)) 3159 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3160 1.19 mrg "") 3161 1.19 mrg 3162 1.19 mrg (define_insn "*pushaddr<mode><ccn><ccnz><ccz>" 3163 1.19 mrg [(set (match_operand:SI 0 "push_operand" "=g") 3164 1.19 mrg (match_operand:VAXfp 1 "address_operand" "p")) 3165 1.19 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3166 1.19 mrg "reload_completed" 3167 1.1 mrg "pusha<VAXfp:fsfx> %a1") 3168 1.1 mrg 3169 1.1 mrg (define_insn_and_split "movaddr<mode>" 3170 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3171 1.1 mrg (match_operand:VAXfp 1 "address_operand" "p"))] 3172 1.1 mrg "" 3173 1.1 mrg "#" 3174 1.1 mrg "reload_completed" 3175 1.1 mrg [(parallel 3176 1.1 mrg [(set (match_dup 0) 3177 1.1 mrg (match_dup 1)) 3178 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3179 1.1 mrg "") 3180 1.1 mrg 3181 1.1 mrg (define_insn "*movaddr<mode>" 3182 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=g") 3183 1.1 mrg (match_operand:VAXfp 1 "address_operand" "p")) 3184 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3185 1.1 mrg "reload_completed" 3186 1.1 mrg "mova<VAXfp:fsfx> %a1,%0") 3187 1.1 mrg 3189 1.19 mrg ;; These used to be peepholes, but it is more straightforward to do them 3190 1.19 mrg ;; as single insns. However, we must force the output to be a register 3191 1.19 mrg ;; if it is not an offsettable address so that we know that we can assign 3192 1.19 mrg ;; to it twice. 3193 1.19 mrg 3194 1.19 mrg ;; If we had a good way of evaluating the relative costs, these could be 3195 1.19 mrg ;; machine-independent. 3196 1.19 mrg 3197 1.19 mrg ;; Optimize extzv ...,z; andl2 ...,z 3198 1.19 mrg ;; or ashl ...,z; andl2 ...,z 3199 1.19 mrg ;; with other operands constant. This is what the combiner converts the 3200 1.19 mrg ;; above sequences to before attempting to recognize the new insn. 3201 1.19 mrg 3202 1.19 mrg (define_insn_and_split "*andashlnegsi4" 3203 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=ro") 3204 1.19 mrg (and:SI (ashiftrt:SI (match_operand:SI 1 "general_operand" "nrmT") 3205 1.19 mrg (match_operand:QI 2 "const_int_operand" "n")) 3206 1.1 mrg (match_operand:SI 3 "const_int_operand" "n")))] 3207 1.1 mrg "(INTVAL (operands[3]) & ~((1 << (32 - INTVAL (operands[2]))) - 1)) == 0" 3208 1.1 mrg "#" 3209 1.1 mrg "&& reload_completed" 3210 1.1 mrg [(parallel 3211 1.1 mrg [(set (match_dup 0) 3212 1.1 mrg (and:SI (ashiftrt:SI (match_dup 1) 3213 1.1 mrg (match_dup 2)) 3214 1.1 mrg (match_dup 3))) 3215 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3216 1.1 mrg "") 3217 1.1 mrg 3218 1.1 mrg (define_insn "*andashlnegsi4_2<ccn><ccnz><ccz>" 3219 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=ro") 3220 1.1 mrg (and:SI (ashiftrt:SI (match_operand:SI 1 "general_operand" "nrmT") 3221 1.1 mrg (match_operand:QI 2 "const_int_operand" "n")) 3222 1.19 mrg (match_operand:SI 3 "const_int_operand" "n"))) 3223 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3224 1.1 mrg "(INTVAL (operands[3]) & ~((1 << (32 - INTVAL (operands[2]))) - 1)) == 0 3225 1.1 mrg && reload_completed" 3226 1.1 mrg "* 3227 1.1 mrg { 3228 1.19 mrg unsigned long mask1 = INTVAL (operands[3]); 3229 1.19 mrg unsigned long mask2 = (1 << (32 - INTVAL (operands[2]))) - 1; 3230 1.19 mrg 3231 1.19 mrg if ((mask1 & mask2) != mask1) 3232 1.19 mrg operands[3] = GEN_INT (mask1 & mask2); 3233 1.19 mrg 3234 1.19 mrg return \"rotl %R2,%1,%0\;bicl2 %N3,%0\"; 3235 1.19 mrg }") 3236 1.19 mrg 3237 1.19 mrg ;; left-shift and mask 3238 1.19 mrg ;; The only case where `ashl' is better is if the mask only turns off 3239 1.19 mrg ;; bits that the ashl would anyways, in which case it should have been 3240 1.19 mrg ;; optimized away. 3241 1.19 mrg 3242 1.19 mrg (define_insn_and_split "*andashlsi4" 3243 1.19 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=ro") 3244 1.19 mrg (and:SI (ashift:SI (match_operand:SI 1 "general_operand" "nrmT") 3245 1.1 mrg (match_operand:QI 2 "const_int_operand" "n")) 3246 1.1 mrg (match_operand:SI 3 "const_int_operand" "n")))] 3247 1.1 mrg "" 3248 1.1 mrg "#" 3249 1.1 mrg "reload_completed" 3250 1.1 mrg [(parallel 3251 1.1 mrg [(set (match_dup 0) 3252 1.1 mrg (and:SI (ashift:SI (match_dup 1) 3253 1.1 mrg (match_dup 2)) 3254 1.1 mrg (match_dup 3))) 3255 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))])] 3256 1.1 mrg "") 3257 1.1 mrg 3258 1.1 mrg (define_insn "*andashlsi4_2<ccn><ccnz><ccz>" 3259 1.1 mrg [(set (match_operand:SI 0 "nonimmediate_operand" "=ro") 3260 1.1 mrg (and:SI (ashift:SI (match_operand:SI 1 "general_operand" "nrmT") 3261 1.1 mrg (match_operand:QI 2 "const_int_operand" "n")) 3262 1.1 mrg (match_operand:SI 3 "const_int_operand" "n"))) 3263 1.1 mrg (clobber (reg:CC VAX_PSL_REGNUM))] 3264 1.1 mrg "reload_completed" 3265 1.1 mrg "* 3266 1.1 mrg { 3267 1.1 mrg operands[3] 3268 1.1 mrg = GEN_INT (INTVAL (operands[3]) & ~((1 << INTVAL (operands[2])) - 1)); 3269 1.1 mrg return \"rotl %2,%1,%0\;bicl2 %N3,%0\"; 3270 1.1 mrg }") 3271 1.1 mrg 3272 1.1 mrg ;; Instruction sequence to sync the VAX instruction stream. 3273 1.3 mrg (define_insn "sync_istream" 3274 1.1 mrg [(unspec_volatile [(const_int 0)] VUNSPEC_SYNC_ISTREAM)] 3275 1.1 mrg "" 3276 1.1 mrg "movpsl -(%|sp)\;pushal 1(%|pc)\;rei") 3277 1.1 mrg 3278 1.1 mrg (define_expand "nonlocal_goto" 3279 1.1 mrg [(use (match_operand 0 "general_operand" "")) 3280 1.1 mrg (use (match_operand 1 "general_operand" "")) 3281 1.1 mrg (use (match_operand 2 "general_operand" "")) 3282 1.1 mrg (use (match_operand 3 "general_operand" ""))] 3283 1.1 mrg "" 3284 1.1 mrg { 3285 rtx lab = operands[1]; 3286 rtx stack = operands[2]; 3287 rtx fp = operands[3]; 3288 3289 emit_clobber (gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode))); 3290 emit_clobber (gen_rtx_MEM (BLKmode, hard_frame_pointer_rtx)); 3291 3292 emit_move_insn (hard_frame_pointer_rtx, fp); 3293 emit_stack_restore (SAVE_NONLOCAL, stack); 3294 3295 emit_use (hard_frame_pointer_rtx); 3296 emit_use (stack_pointer_rtx); 3297 3298 /* We'll convert this to direct jump via a peephole optimization. */ 3299 emit_indirect_jump (copy_to_reg (lab)); 3300 emit_barrier (); 3301 DONE; 3302 }) 3303 3304 (include "builtins.md") 3305