📄 alpha.md
字号:
;; generates better code. We have the anonymous addsi3 pattern below in;; case combine wants to make it.(define_expand "addsi3" [(set (match_operand:SI 0 "register_operand" "") (plus:SI (match_operand:SI 1 "reg_or_0_operand" "") (match_operand:SI 2 "add_operand" "")))] "" "{ if (optimize) { rtx op1 = gen_lowpart (DImode, operands[1]); rtx op2 = gen_lowpart (DImode, operands[2]); if (! cse_not_expected) { rtx tmp = gen_reg_rtx (DImode); emit_insn (gen_adddi3 (tmp, op1, op2)); emit_move_insn (gen_lowpart (DImode, operands[0]), tmp); } else emit_insn (gen_adddi3 (gen_lowpart (DImode, operands[0]), op1, op2)); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r,r,r,r") (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ,rJ,rJ") (match_operand:SI 2 "add_operand" "rI,O,K,L")))] "" "@ addl %r1,%2,%0 subl %r1,%n2,%0 lda %0,%2(%r1) ldah %0,%h2(%r1)")(define_split [(set (match_operand:SI 0 "register_operand" "") (plus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "const_int_operand" "")))] "! add_operand (operands[2], SImode)" [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3))) (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))] "{ HOST_WIDE_INT val = INTVAL (operands[2]); HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000); HOST_WIDE_INT rest = val - low; operands[3] = GEN_INT (rest); operands[4] = GEN_INT (low);}")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,r") (sign_extend:DI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:SI 2 "sext_add_operand" "rI,O"))))] "" "@ addl %r1,%2,%0 subl %r1,%n2,%0")(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (plus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "const_int_operand" "")))) (clobber (match_operand:SI 3 "reg_not_elim_operand" ""))] "! sext_add_operand (operands[2], SImode) && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) % 4 == 0" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (sign_extend:DI (plus:SI (mult:SI (match_dup 3) (match_dup 5)) (match_dup 1))))] "{ HOST_WIDE_INT val = INTVAL (operands[2]) / 4; int mult = 4; if (val % 2 == 0) val /= 2, mult = 8; operands[4] = GEN_INT (val); operands[5] = GEN_INT (mult);}")(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (plus:SI (match_operator:SI 1 "comparison_operator" [(match_operand 2 "" "") (match_operand 3 "" "")]) (match_operand:SI 4 "add_operand" "")))) (clobber (match_operand:DI 5 "register_operand" ""))] "" [(set (match_dup 5) (match_dup 6)) (set (match_dup 0) (sign_extend:DI (plus:SI (match_dup 7) (match_dup 4))))] "{ operands[6] = gen_rtx_fmt_ee (GET_CODE (operands[1]), DImode, operands[2], operands[3]); operands[7] = gen_lowpart (SImode, operands[5]);}")(define_insn "adddi3" [(set (match_operand:DI 0 "register_operand" "=r,r,r,r") (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ,rJ,rJ") (match_operand:DI 2 "add_operand" "rI,O,K,L")))] "" "*{ const char * const pattern[4] = { \"addq %r1,%2,%0\", \"subq %r1,%n2,%0\", \"lda %0,%2(%r1)\", \"ldah %0,%h2(%r1)\" }; /* The NT stack unwind code can't handle a subq to adjust the stack (that's a bug, but not one we can do anything about). As of NT4.0 SP3, the exception handling code will loop if a subq is used and an exception occurs. The 19980616 change to emit prologues as RTL also confused some versions of GDB, which also interprets prologues. This has been fixed as of GDB 4.18, but it does not harm to unconditionally use lda here. */ int which = which_alternative; if (operands[0] == stack_pointer_rtx && GET_CODE (operands[2]) == CONST_INT && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')) which = 2; return pattern[which];}");; ??? Allow large constants when basing off the frame pointer or some;; virtual register that may eliminate to the frame pointer. This is;; done because register elimination offsets will change the hi/lo split,;; and if we split before reload, we will require additional instructions.(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (match_operand:DI 1 "reg_no_subreg_operand" "r") (match_operand:DI 2 "const_int_operand" "n")))] "REG_OK_FP_BASE_P (operands[1])" "#");; Don't do this if we are adjusting SP since we don't want to do it;; in two steps. Don't split FP sources for the reason listed above.(define_split [(set (match_operand:DI 0 "register_operand" "") (plus:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "const_int_operand" "")))] "! add_operand (operands[2], DImode) && operands[0] != stack_pointer_rtx && operands[1] != frame_pointer_rtx && operands[1] != arg_pointer_rtx" [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3))) (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))] "{ HOST_WIDE_INT val = INTVAL (operands[2]); HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000); HOST_WIDE_INT rest = val - low; operands[3] = GEN_INT (rest); operands[4] = GEN_INT (low);}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r,r") (match_operand:SI 2 "const48_operand" "I,I")) (match_operand:SI 3 "sext_add_operand" "rI,O")))] "" "@ s%2addl %1,%3,%0 s%2subl %1,%n3,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,r") (sign_extend:DI (plus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r,r") (match_operand:SI 2 "const48_operand" "I,I")) (match_operand:SI 3 "sext_add_operand" "rI,O"))))] "" "@ s%2addl %1,%3,%0 s%2subl %1,%n3,%0")(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (plus:SI (mult:SI (match_operator:SI 1 "comparison_operator" [(match_operand 2 "" "") (match_operand 3 "" "")]) (match_operand:SI 4 "const48_operand" "")) (match_operand:SI 5 "add_operand" "")))) (clobber (match_operand:DI 6 "reg_not_elim_operand" ""))] "" [(set (match_dup 6) (match_dup 7)) (set (match_dup 0) (sign_extend:DI (plus:SI (mult:SI (match_dup 8) (match_dup 4)) (match_dup 5))))] "{ operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[1]), DImode, operands[2], operands[3]); operands[8] = gen_lowpart (SImode, operands[6]);}")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,r") (plus:DI (mult:DI (match_operand:DI 1 "reg_not_elim_operand" "r,r") (match_operand:DI 2 "const48_operand" "I,I")) (match_operand:DI 3 "sext_add_operand" "rI,O")))] "" "@ s%2addq %1,%3,%0 s%2subq %1,%n3,%0");; These variants of the above insns can occur if the third operand;; is the frame pointer. This is a kludge, but there doesn't;; seem to be a way around it. Only recognize them while reloading.(define_insn "" [(set (match_operand:DI 0 "some_operand" "=&r") (plus:DI (plus:DI (match_operand:DI 1 "some_operand" "r") (match_operand:DI 2 "some_operand" "r")) (match_operand:DI 3 "some_operand" "rIOKL")))] "reload_in_progress" "#")(define_split [(set (match_operand:DI 0 "register_operand" "") (plus:DI (plus:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "register_operand" "")) (match_operand:DI 3 "add_operand" "")))] "reload_completed" [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2))) (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] "") (define_insn "" [(set (match_operand:SI 0 "some_operand" "=&r") (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "some_operand" "rJ") (match_operand:SI 2 "const48_operand" "I")) (match_operand:SI 3 "some_operand" "r")) (match_operand:SI 4 "some_operand" "rIOKL")))] "reload_in_progress" "#")(define_split [(set (match_operand:SI 0 "register_operand" "r") (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "") (match_operand:SI 2 "const48_operand" "")) (match_operand:SI 3 "register_operand" "")) (match_operand:SI 4 "add_operand" "rIOKL")))] "reload_completed" [(set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3))) (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))] "")(define_insn "" [(set (match_operand:DI 0 "some_operand" "=&r") (sign_extend:DI (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "some_operand" "rJ") (match_operand:SI 2 "const48_operand" "I")) (match_operand:SI 3 "some_operand" "r")) (match_operand:SI 4 "some_operand" "rIOKL"))))] "reload_in_progress" "#")(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "") (match_operand:SI 2 "const48_operand" "")) (match_operand:SI 3 "register_operand" "")) (match_operand:SI 4 "add_operand" ""))))] "reload_completed" [(set (match_dup 5) (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3))) (set (match_dup 0) (sign_extend:DI (plus:SI (match_dup 5) (match_dup 4))))] "operands[5] = gen_lowpart (SImode, operands[0]);")(define_insn "" [(set (match_operand:DI 0 "some_operand" "=&r") (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "some_operand" "rJ") (match_operand:DI 2 "const48_operand" "I")) (match_operand:DI 3 "some_operand" "r")) (match_operand:DI 4 "some_operand" "rIOKL")))] "reload_in_progress" "#")(define_split [(set (match_operand:DI 0 "register_operand" "=") (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "") (match_operand:DI 2 "const48_operand" "")) (match_operand:DI 3 "register_operand" "")) (match_operand:DI 4 "add_operand" "")))] "reload_completed" [(set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (match_dup 2)) (match_dup 3))) (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))] "")(define_insn "negsi2" [(set (match_operand:SI 0 "register_operand" "=r") (neg:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")))] "" "subl $31,%1,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (neg:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI"))))] "" "subl $31,%1,%0")(define_insn "negdi2" [(set (match_operand:DI 0 "register_operand" "=r") (neg:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))] "" "subq $31,%1,%0")(define_expand "subsi3" [(set (match_operand:SI 0 "register_operand" "") (minus:SI (match_operand:SI 1 "reg_or_0_operand" "") (match_operand:SI 2 "reg_or_8bit_operand" "")))] "" "{ if (optimize) { rtx op1 = gen_lowpart (DImode, operands[1]); rtx op2 = gen_lowpart (DImode, operands[2]); if (! cse_not_expected) { rtx tmp = gen_reg_rtx (DImode); emit_insn (gen_subdi3 (tmp, op1, op2)); emit_move_insn (gen_lowpart (DImode, operands[0]), tmp); } else emit_insn (gen_subdi3 (gen_lowpart (DImode, operands[0]), op1, op2)); DONE; }} ")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") (match_operand:SI 2 "reg_or_8bit_operand" "rI")))] "" "subl %r1,%2,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") (match_operand:SI 2 "reg_or_8bit_operand" "rI"))))] "" "subl %r1,%2,%0")(define_insn "subdi3" [(set (match_operand:DI 0 "register_operand" "=r") (minus:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_8bit_operand" "rI")))] "" "subq %r1,%2,%0")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r") (match_operand:SI 2 "const48_operand" "I")) (match_operand:SI 3 "reg_or_8bit_operand" "rI")))] "" "s%2subl %1,%3,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (minus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r") (match_operand:SI 2 "const48_operand" "I")) (match_operand:SI 3 "reg_or_8bit_operand" "rI"))))] "" "s%2subl %1,%3,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (minus:DI (mult:DI (match_operand:DI 1 "reg_not_elim_operand" "r") (match_operand:DI 2 "const48_operand" "I")) (match_operand:DI 3 "reg_or_8bit_operand" "rI")))] "" "s%2subq %1,%3,%0")(define_insn "mulsi3" [(set (match_operand:SI 0 "register_operand" "=r") (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") (match_operand:SI 2 "reg_or_8bit_operand" "rI")))] "" "mull %r1,%2,%0" [(set_attr "type" "imul") (set_attr "opsize" "si")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") (match_operand:SI 2 "reg_or_8bit_operand" "rI"))))] "" "mull %r1,%2,%0" [(set_attr "type" "imul") (set_attr "opsize" "si")])(define_insn "muldi3" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -