Commit 53e38f02 by Renlin Li Committed by Renlin Li

[PATCH][AARCH64]Use mov for add with large immediate.

gcc/

2015-05-05  Renlin Li  <renlin.li@arm.com>

	* config/aarch64/aarch64.md (add<mode>3): Use mov when allowed.

From-SVN: r222800
parent ae8ffbbb
2015-05-05 Renlin Li <renlin.li@arm.com>
* config/aarch64/aarch64.md (add<mode>3): Use mov when allowed.
2015-05-05 Yvan Roux <yvan.roux@linaro.org> 2015-05-05 Yvan Roux <yvan.roux@linaro.org>
* config/aarch64/aarch64-elf-raw.h (CA53_ERR_843419_SPEC): Define. * config/aarch64/aarch64-elf-raw.h (CA53_ERR_843419_SPEC): Define.
......
...@@ -1414,18 +1414,28 @@ ...@@ -1414,18 +1414,28 @@
" "
if (! aarch64_plus_operand (operands[2], VOIDmode)) if (! aarch64_plus_operand (operands[2], VOIDmode))
{ {
rtx subtarget = ((optimize && can_create_pseudo_p ())
? gen_reg_rtx (<MODE>mode) : operands[0]);
HOST_WIDE_INT imm = INTVAL (operands[2]); HOST_WIDE_INT imm = INTVAL (operands[2]);
if (imm < 0) if (aarch64_move_imm (imm, <MODE>mode) && can_create_pseudo_p ())
imm = -(-imm & ~0xfff); {
rtx tmp = gen_reg_rtx (<MODE>mode);
emit_move_insn (tmp, operands[2]);
operands[2] = tmp;
}
else else
imm &= ~0xfff; {
rtx subtarget = ((optimize && can_create_pseudo_p ())
emit_insn (gen_add<mode>3 (subtarget, operands[1], GEN_INT (imm))); ? gen_reg_rtx (<MODE>mode) : operands[0]);
operands[1] = subtarget;
operands[2] = GEN_INT (INTVAL (operands[2]) - imm); if (imm < 0)
imm = -(-imm & ~0xfff);
else
imm &= ~0xfff;
emit_insn (gen_add<mode>3 (subtarget, operands[1], GEN_INT (imm)));
operands[1] = subtarget;
operands[2] = GEN_INT (INTVAL (operands[2]) - imm);
}
} }
" "
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment