📄 alpha.md
字号:
str = "__divq"; break; case UDIV: str = "__divqu"; break; case MOD: str = "__remq"; break; case UMOD: str = "__remqu"; break; default: abort (); } operands[4] = GEN_INT (alpha_next_sequence_number++); emit_insn (gen_movdi_er_high_g (operands[0], pic_offset_table_rtx, gen_rtx_SYMBOL_REF (DImode, str), operands[4]));} [(set_attr "type" "jsr") (set_attr "length" "8")])(define_insn "*divmoddi_internal_er_1" [(set (match_operand:DI 0 "register_operand" "=c") (match_operator:DI 3 "divmod_operator" [(match_operand:DI 1 "register_operand" "a") (match_operand:DI 2 "register_operand" "b")])) (use (match_operand:DI 4 "register_operand" "c")) (use (match_operand 5 "const_int_operand" "")) (clobber (reg:DI 23)) (clobber (reg:DI 28))] "TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS" "jsr $23,($27),__%E3%J5" [(set_attr "type" "jsr") (set_attr "length" "4")])(define_insn "*divmoddi_internal" [(set (match_operand:DI 0 "register_operand" "=c") (match_operator:DI 3 "divmod_operator" [(match_operand:DI 1 "register_operand" "a") (match_operand:DI 2 "register_operand" "b")])) (clobber (reg:DI 23)) (clobber (reg:DI 28))] "! TARGET_ABI_OPEN_VMS && ! TARGET_ABI_UNICOSMK" "%E3 %1,%2,%0" [(set_attr "type" "jsr") (set_attr "length" "8")]);; Next are the basic logical operations. These only exist in DImode.(define_insn "anddi3" [(set (match_operand:DI 0 "register_operand" "=r,r,r") (and:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ,rJ") (match_operand:DI 2 "and_operand" "rI,N,MH")))] "" "@ and %r1,%2,%0 bic %r1,%N2,%0 zapnot %r1,%m2,%0" [(set_attr "type" "ilog,ilog,shift")]);; There are times when we can split an AND into two AND insns. This occurs;; when we can first clear any bytes and then clear anything else. For;; example "I & 0xffff07" is "(I & 0xffffff) & 0xffffffffffffff07".;; Only do this when running on 64-bit host since the computations are;; too messy otherwise.(define_split [(set (match_operand:DI 0 "register_operand" "") (and:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "const_int_operand" "")))] "HOST_BITS_PER_WIDE_INT == 64 && ! and_operand (operands[2], DImode)" [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 3))) (set (match_dup 0) (and:DI (match_dup 0) (match_dup 4)))]{ unsigned HOST_WIDE_INT mask1 = INTVAL (operands[2]); unsigned HOST_WIDE_INT mask2 = mask1; int i; /* For each byte that isn't all zeros, make it all ones. */ for (i = 0; i < 64; i += 8) if ((mask1 & ((HOST_WIDE_INT) 0xff << i)) != 0) mask1 |= (HOST_WIDE_INT) 0xff << i; /* Now turn on any bits we've just turned off. */ mask2 |= ~ mask1; operands[3] = GEN_INT (mask1); operands[4] = GEN_INT (mask2);})(define_expand "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))] ""{ if (! TARGET_BWX) operands[1] = force_reg (QImode, operands[1]);})(define_insn "*zero_extendqihi2_bwx" [(set (match_operand:HI 0 "register_operand" "=r,r") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] "TARGET_BWX" "@ and %1,0xff,%0 ldbu %0,%1" [(set_attr "type" "ilog,ild")])(define_insn "*zero_extendqihi2_nobwx" [(set (match_operand:HI 0 "register_operand" "=r") (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))] "! TARGET_BWX" "and %1,0xff,%0" [(set_attr "type" "ilog")])(define_expand "zero_extendqisi2" [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] ""{ if (! TARGET_BWX) operands[1] = force_reg (QImode, operands[1]);})(define_insn "*zero_extendqisi2_bwx" [(set (match_operand:SI 0 "register_operand" "=r,r") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] "TARGET_BWX" "@ and %1,0xff,%0 ldbu %0,%1" [(set_attr "type" "ilog,ild")])(define_insn "*zero_extendqisi2_nobwx" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))] "! TARGET_BWX" "and %1,0xff,%0" [(set_attr "type" "ilog")])(define_expand "zero_extendqidi2" [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "")))] ""{ if (! TARGET_BWX) operands[1] = force_reg (QImode, operands[1]);})(define_insn "*zero_extendqidi2_bwx" [(set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] "TARGET_BWX" "@ and %1,0xff,%0 ldbu %0,%1" [(set_attr "type" "ilog,ild")])(define_insn "*zero_extendqidi2_nobwx" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))] "! TARGET_BWX" "and %1,0xff,%0" [(set_attr "type" "ilog")])(define_expand "zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))] ""{ if (! TARGET_BWX) operands[1] = force_reg (HImode, operands[1]);})(define_insn "*zero_extendhisi2_bwx" [(set (match_operand:SI 0 "register_operand" "=r,r") (zero_extend:SI (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_extendhisi2_nobwx" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:HI 1 "register_operand" "r")))] "! TARGET_BWX" "zapnot %1,3,%0" [(set_attr "type" "shift")])(define_expand "zero_extendhidi2" [(set (match_operand:DI 0 "register_operand" "") (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 "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)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -