📄 alpha.md
字号:
(zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "")))] ""{ if (! TARGET_BWX) operands[1] = force_reg (HImode, operands[1]);})(define_insn "*zero_extendhidi2_bwx" [(set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] "TARGET_BWX" "@ zapnot %1,3,%0 ldwu %0,%1" [(set_attr "type" "shift,ild")])(define_insn "*zero_extendhidi2_nobwx" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))] "" "zapnot %1,3,%0" [(set_attr "type" "shift")])(define_insn "zero_extendsidi2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))] "" "zapnot %1,15,%0" [(set_attr "type" "shift")])(define_insn "*andnotsi3" [(set (match_operand:SI 0 "register_operand" "=r") (and:SI (not:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")) (match_operand:SI 2 "reg_or_0_operand" "rJ")))] "" "bic %r2,%1,%0" [(set_attr "type" "ilog")])(define_insn "andnotdi3" [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")) (match_operand:DI 2 "reg_or_0_operand" "rJ")))] "" "bic %r2,%1,%0" [(set_attr "type" "ilog")])(define_insn "*iorsi_internal" [(set (match_operand:SI 0 "register_operand" "=r,r") (ior:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:SI 2 "or_operand" "rI,N")))] "" "@ bis %r1,%2,%0 ornot %r1,%N2,%0" [(set_attr "type" "ilog")])(define_insn "iordi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (ior:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:DI 2 "or_operand" "rI,N")))] "" "@ bis %r1,%2,%0 ornot %r1,%N2,%0" [(set_attr "type" "ilog")])(define_insn "*one_cmplsi_internal" [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")))] "" "ornot $31,%1,%0" [(set_attr "type" "ilog")])(define_insn "one_cmpldi2" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))] "" "ornot $31,%1,%0" [(set_attr "type" "ilog")])(define_insn "*iornotsi3" [(set (match_operand:SI 0 "register_operand" "=r") (ior:SI (not:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")) (match_operand:SI 2 "reg_or_0_operand" "rJ")))] "" "ornot %r2,%1,%0" [(set_attr "type" "ilog")])(define_insn "*iornotdi3" [(set (match_operand:DI 0 "register_operand" "=r") (ior:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")) (match_operand:DI 2 "reg_or_0_operand" "rJ")))] "" "ornot %r2,%1,%0" [(set_attr "type" "ilog")])(define_insn "*xorsi_internal" [(set (match_operand:SI 0 "register_operand" "=r,r") (xor:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:SI 2 "or_operand" "rI,N")))] "" "@ xor %r1,%2,%0 eqv %r1,%N2,%0" [(set_attr "type" "ilog")])(define_insn "xordi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:DI 2 "or_operand" "rI,N")))] "" "@ xor %r1,%2,%0 eqv %r1,%N2,%0" [(set_attr "type" "ilog")])(define_insn "*xornotsi3" [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (xor:SI (match_operand:SI 1 "register_operand" "%rJ") (match_operand:SI 2 "register_operand" "rI"))))] "" "eqv %r1,%2,%0" [(set_attr "type" "ilog")])(define_insn "*xornotdi3" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (xor:DI (match_operand:DI 1 "register_operand" "%rJ") (match_operand:DI 2 "register_operand" "rI"))))] "" "eqv %r1,%2,%0" [(set_attr "type" "ilog")]);; Handle FFS and related insns iff we support CIX.(define_expand "ffsdi2" [(set (match_dup 2) (ctz:DI (match_operand:DI 1 "register_operand" ""))) (set (match_dup 3) (plus:DI (match_dup 2) (const_int 1))) (set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (eq (match_dup 1) (const_int 0)) (const_int 0) (match_dup 3)))] "TARGET_CIX"{ operands[2] = gen_reg_rtx (DImode); operands[3] = gen_reg_rtx (DImode);})(define_insn "clzdi2" [(set (match_operand:DI 0 "register_operand" "=r") (clz:DI (match_operand:DI 1 "register_operand" "r")))] "TARGET_CIX" "ctlz %1,%0" [(set_attr "type" "mvi")])(define_insn "ctzdi2" [(set (match_operand:DI 0 "register_operand" "=r") (ctz:DI (match_operand:DI 1 "register_operand" "r")))] "TARGET_CIX" "cttz %1,%0" [(set_attr "type" "mvi")])(define_insn "popcountdi2" [(set (match_operand:DI 0 "register_operand" "=r") (popcount:DI (match_operand:DI 1 "register_operand" "r")))] "TARGET_CIX" "ctpop %1,%0" [(set_attr "type" "mvi")]);; Next come the shifts and the various extract and insert operations.(define_insn "ashldi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ") (match_operand:DI 2 "reg_or_6bit_operand" "P,rS")))] ""{ switch (which_alternative) { case 0: if (operands[2] == const1_rtx) return "addq %r1,%r1,%0"; else return "s%P2addq %r1,0,%0"; case 1: return "sll %r1,%2,%0"; default: gcc_unreachable (); }} [(set_attr "type" "iadd,shift")])(define_insn "*ashldi_se" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (subreg:SI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "const_int_operand" "P")) 0)))] "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3"{ if (operands[2] == const1_rtx) return "addl %r1,%r1,%0"; else return "s%P2addl %r1,0,%0";} [(set_attr "type" "iadd")])(define_insn "lshrdi3" [(set (match_operand:DI 0 "register_operand" "=r") (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_6bit_operand" "rS")))] "" "srl %r1,%2,%0" [(set_attr "type" "shift")])(define_insn "ashrdi3" [(set (match_operand:DI 0 "register_operand" "=r") (ashiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_6bit_operand" "rS")))] "" "sra %r1,%2,%0" [(set_attr "type" "shift")])(define_expand "extendqihi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "some_operand" "") (const_int 56))) (set (match_operand:HI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] ""{ if (TARGET_BWX) { emit_insn (gen_extendqihi2x (operands[0], force_reg (QImode, operands[1]))); DONE; } /* If we have an unaligned MEM, extend to DImode (which we do specially) and then copy to the result. */ if (unaligned_memory_operand (operands[1], HImode)) { rtx temp = gen_reg_rtx (DImode); emit_insn (gen_extendqidi2 (temp, operands[1])); emit_move_insn (operands[0], gen_lowpart (HImode, temp)); DONE; } operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1])); operands[2] = gen_reg_rtx (DImode);})(define_insn "extendqidi2x" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (match_operand:QI 1 "register_operand" "r")))] "TARGET_BWX" "sextb %1,%0" [(set_attr "type" "shift")])(define_insn "extendhidi2x" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (match_operand:HI 1 "register_operand" "r")))] "TARGET_BWX" "sextw %1,%0" [(set_attr "type" "shift")])(define_insn "extendqisi2x" [(set (match_operand:SI 0 "register_operand" "=r") (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))] "TARGET_BWX" "sextb %1,%0" [(set_attr "type" "shift")])(define_insn "extendhisi2x" [(set (match_operand:SI 0 "register_operand" "=r") (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))] "TARGET_BWX" "sextw %1,%0" [(set_attr "type" "shift")])(define_insn "extendqihi2x" [(set (match_operand:HI 0 "register_operand" "=r") (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))] "TARGET_BWX" "sextb %1,%0" [(set_attr "type" "shift")])(define_expand "extendqisi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "some_operand" "") (const_int 56))) (set (match_operand:SI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] ""{ if (TARGET_BWX) { emit_insn (gen_extendqisi2x (operands[0], force_reg (QImode, operands[1]))); DONE; } /* If we have an unaligned MEM, extend to a DImode form of the result (which we do specially). */ if (unaligned_memory_operand (operands[1], QImode)) { rtx temp = gen_reg_rtx (DImode); emit_insn (gen_extendqidi2 (temp, operands[1])); emit_move_insn (operands[0], gen_lowpart (SImode, temp)); DONE; } operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1])); operands[2] = gen_reg_rtx (DImode);})(define_expand "extendqidi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "some_operand" "") (const_int 56))) (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] ""{ if (TARGET_BWX) { emit_insn (gen_extendqidi2x (operands[0], force_reg (QImode, operands[1]))); DONE; } if (unaligned_memory_operand (operands[1], QImode)) { rtx seq = gen_unaligned_extendqidi (operands[0], get_unaligned_address (operands[1], 1)); alpha_set_memflags (seq, operands[1]); emit_insn (seq); DONE; } operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1])); operands[2] = gen_reg_rtx (DImode);})(define_expand "extendhisi2" [(set (match_dup 2) (ashift:DI (match_operand:HI 1 "some_operand" "") (const_int 48))) (set (match_operand:SI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 48)))] ""{ if (TARGET_BWX) { emit_insn (gen_extendhisi2x (operands[0], force_reg (HImode, operands[1]))); DONE; } /* If we have an unaligned MEM, extend to a DImode form of the result (which we do specially). */ if (unaligned_memory_operand (operands[1], HImode)) { rtx temp = gen_reg_rtx (DImode); emit_insn (gen_extendhidi2 (temp, operands[1])); emit_move_insn (operands[0], gen_lowpart (SImode, temp)); DONE; } operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, force_reg (HImode, operands[1])); operands[2] = gen_reg_rtx (DImode);})(define_expand "extendhidi2" [(set (match_dup 2) (ashift:DI (match_operand:HI 1 "some_operand" "") (const_int 48))) (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 48)))] ""{ if (TARGET_BWX) { emit_insn (gen_extendhidi2x (operands[0], force_reg (HImode, operands[1]))); DONE; } if (unaligned_memory_operand (operands[1], HImode)) { rtx seq = gen_unaligned_extendhidi (operands[0], get_unaligned_address (operands[1], 2)); alpha_set_memflags (seq, operands[1]); emit_insn (seq); DONE; } operands[1] = gen_lowpart (DImode, force_reg (HImode, operands[1])); operands[2] = gen_reg_rtx (DImode);});; Here's how we sign extend an unaligned byte and halfword. Doing this;; as a pattern saves one instruction. The code is similar to that for;; the unaligned loads (see below).;;;; Operand 1 is the address + 1 (+2 for HI), operand 0 is the result.(define_expand "unaligned_extendqidi" [(use (match_operand:QI 0 "register_operand" ""))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -