📄 alpha.md
字号:
(define_expand "umoddi3" [(parallel [(set (reg:DI 27) (umod:DI (match_operand:DI 1 "general_operand" "") (match_operand:DI 2 "general_operand" ""))) (clobber (reg:DI 23))]) (set (match_operand:DI 0 "general_operand" "") (reg:DI 27))] "" "{ rtx in0 = gen_rtx (REG, DImode, 24); rtx in1 = gen_rtx (REG, DImode, 25); emit_move_insn (in0, operands[1]); emit_move_insn (in1, operands[2]); operands[1] = in0, operands[2] = in1;}")(define_insn "" [(set (reg:SI 27) (match_operator:SI 1 "divmod_operator" [(reg:SI 24) (reg:SI 25)])) (clobber (reg:DI 23))] "" "%E1 $24,$25,$27")(define_insn "" [(set (reg:DI 27) (match_operator:DI 1 "divmod_operator" [(reg:DI 24) (reg:DI 25)])) (clobber (reg:DI 23))] "" "%E1 $24,$25,$27");; 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" "iaddlog,iaddlog,shiftcm")]);; There are times when we can split and 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 to 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_insn "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand" "=r") (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))] "" "zapnot %1,1,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendqisi2" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))] "" "zapnot %1,1,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendqidi2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))] "" "zapnot %1,1,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:HI 1 "register_operand" "r")))] "" "zapnot %1,3,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendhidi2" [(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" "iaddlog")])(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" "iaddlog")])(define_insn "" [(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" "iaddlog")])(define_insn "iordi3" [(set (match_operand:DI 0 "register_operand" "=r") (ior:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ") (match_operand:DI 2 "reg_or_8bit_operand" "rI")))] "" "bis %r1,%2,%0" [(set_attr "type" "iaddlog")])(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" "iaddlog")])(define_insn "" [(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" "iaddlog")])(define_insn "xordi3" [(set (match_operand:DI 0 "register_operand" "=r") (xor:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_8bit_operand" "rI")))] "" "xor %r1,%2,%0" [(set_attr "type" "iaddlog")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (xor:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_8bit_operand" "rI"))))] "" "eqv %r1,%2,%0" [(set_attr "type" "iaddlog")]);; 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_8bit_operand" "P,rI")))] "" "*{ 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\"; }}" [(set_attr "type" "iaddlog,shiftcm")]);; This is the same as (sign_extend (shift X [123])).(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashiftrt:DI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "const_int_operand" "i")) (const_int 32)))] "INTVAL (operands[2]) >= 33 && INTVAL (operands[2]) <= 35" "*{ switch (INTVAL (operands[2])) { case 33: return \"addl %r1,%r1,%0\"; case 34: return \"s4addl %r1,0,%0\"; case 35: return \"s8addl %r1,0,%0\"; default: abort (); }}" [(set_attr "type" "iaddlog")]) (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_8bit_operand" "rI")))] "" "srl %r1,%2,%0")(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_8bit_operand" "rI")))] "" "sra %r1,%2,%0")(define_expand "extendqihi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "register_operand" "") (const_int 56))) (set (match_operand:HI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] "" "{ operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendqisi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "register_operand" "") (const_int 56))) (set (match_operand:SI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] "" "{ operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendqidi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "register_operand" "") (const_int 56))) (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] "" "{ operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendhisi2" [(set (match_dup 2) (ashift:DI (match_operand:HI 1 "register_operand" "") (const_int 48))) (set (match_operand:SI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 48)))] "" "{ operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendhidi2" [(set (match_dup 2) (ashift:DI (match_operand:HI 1 "register_operand" "") (const_int 48))) (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 48)))] "" "{ operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "mode_width_operand" "n") (match_operand:DI 3 "mul8_operand" "I")))] "" "ext%M2l %r1,%s3,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "mode_width_operand" "n") (ashift:DI (match_operand:DI 3 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "ext%M2l %r1,%3,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (const_int 8) (ashift:DI (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int -1)) (const_int 3))) (const_int 56)))] "" "extqh %r1,%2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (const_int 16) (ashift:DI (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int -2)) (const_int 3))) (const_int 48)))] "" "extwh %r1,%2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (const_int 32) (ashift:DI (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int -4)) (const_int 3))) (const_int 32)))] "" "extlh %r1,%2,%0");; This converts an extXl into an extXh with an appropriate adjustment;; to the address calculation.(define_split [(set (match_operand:DI 0 "register_operand" "") (ashift:DI (zero_extract:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "mode_width_operand" "") (ashift:DI (match_operand:DI 3 "" "") (const_int 3))) (match_operand:DI 4 "const_int_operand" ""))) (clobber (match_operand:DI 5 "register_operand" ""))] "INTVAL (operands[4]) == 64 - INTVAL (operands[2])" [(set (match_dup 5) (match_dup 6)) (set (match_dup 0) (ashift:DI (zero_extract:DI (match_dup 1) (match_dup 2) (ashift:DI (plus:DI (match_dup 5) (match_dup 7)) (const_int 3))) (match_dup 4)))] "{ operands[6] = plus_constant (operands[3], INTVAL (operands[2]) / BITS_PER_UNIT); operands[7] = GEN_INT (- INTVAL (operands[2]) / BITS_PER_UNIT);}") (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" "r")) (match_operand:DI 2 "mul8_operand" "I")))] "" "insbl %1,%s2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r")) (match_operand:DI 2 "mul8_operand" "I")))] "" "inswl %1,%s2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) (match_operand:DI 2 "mul8_operand" "I")))] "" "insll %1,%s2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" "r")) (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "insbl %1,%2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r")) (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "inswl %1,%2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "insll %1,%2,%0");; We do not include the insXh insns because they are complex to express;; and it does not appear that we would ever want to generate them.(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (ashift:DI (match_operand:DI 2 "mode_mask_operand" "n") (ashift:DI (match_operand:DI 3 "reg_or_8bit_operand" "rI") (const_int 3))) (match_operand:DI 1 "reg_or_0_operand" "rJ")))] "" "msk%U2l %r1,%3,%0");; We do not include the mskXh insns because it does not appear we would ever
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -