📄 alpha.md
字号:
(zero_extend:DI (match_operand:SI 1 "register_operand" "r")))] "" "zapnot %1,15,%0" [(set_attr "type" "shift")])(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 "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_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 "*iornot" [(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 "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 "*xornot" [(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 the FFS insn iff we support CIX.(define_expand "ffsdi2" [(set (match_dup 2) (unspec:DI [(match_operand:DI 1 "register_operand" "")] UNSPEC_CTTZ)) (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 "*cttz" [(set (match_operand:DI 0 "register_operand" "=r") (unspec:DI [(match_operand:DI 1 "register_operand" "r")] UNSPEC_CTTZ))] "TARGET_CIX" "cttz %1,%0" ; EV6 calls all mvi and cttz/ctlz/popc class imisc, so just ; reuse the existing type name. [(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: abort(); }} [(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" "")) (use (match_operand:DI 1 "address_operand" ""))] ""{ if (WORDS_BIG_ENDIAN) emit_insn (gen_unaligned_extendqidi_be (operands[0], operands[1])); else emit_insn (gen_unaligned_extendqidi_le (operands[0], operands[1])); DONE;})(define_expand "unaligned_extendqidi_le" [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) (set (match_dup 3) (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -1)) (const_int -8)))) (set (match_dup 4) (ashift:DI (match_dup 3) (minus:DI (const_int 64) (ashift:DI (and:DI (match_dup 2) (const_int 7)) (const_int 3))))) (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0) (ashiftrt:DI (match_dup 4) (const_int 56)))] "! WORDS_BIG_ENDIAN"{ operands[2] = gen_reg_rtx (DImode); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode);})(define_expand "unaligned_extendqidi_be" [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) (set (match_dup 3) (plus:DI (match_dup 2) (const_int -1))) (set (match_dup 4) (mem:DI (and:DI (match_dup 3) (const_int -8)))) (set (match_dup 5) (plus:DI (match_dup 2) (const_int -2))) (set (match_dup 6) (ashift:DI (match_dup 4) (ashift:DI (and:DI (plus:DI (match_dup 5) (const_int 1)) (const_int 7)) (const_int 3)))) (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0) (ashiftrt:DI (match_dup 6) (const_int 56)))] "WORDS_BIG_ENDIAN"{ operands[2] = gen_reg_rtx (DImode); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode); operands[5] = gen_reg_rtx (DImode); operands[6] = gen_reg_rtx (DImode);})(define_expand "unaligned_extendhidi" [(use (match_operand:QI 0 "register_operand" "")) (use (match_operand:DI 1 "address_operand" ""))] ""{ operands[0] = gen_lowpart (DImode, operands[0]); emit_insn ((WORDS_BIG_ENDIAN ? gen_unaligned_extendhidi_be : gen_unaligned_extendhidi_le) (operands[0], operands[1])); DONE;})(define_expand "unaligned_extendhidi_le" [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) (set (match_dup 3) (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -2)) (const_int -8)))) (set (match_dup 4) (ashift:DI (match_dup 3) (minus:DI (const_int 64) (ashift:DI (and:DI (match_dup 2) (const_int 7)) (const_int 3))))) (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 4) (const_int 48)))] "! WORDS_BIG_ENDIAN"{ operands[2] = gen_reg_rtx (DImode); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -