diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2015-07-28 11:00:07 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2015-07-28 11:00:07 +0000 |
commit | e47c403137a6c1de1676543d0bb031ec8cb4ecc4 (patch) | |
tree | 59e2c29f80f3d316d619c6d45f3d898e8f714f53 | |
parent | 4b1cbcee3e1725c7796ad8c55a84a7a95ab77871 (diff) | |
download | gcc-e47c403137a6c1de1676543d0bb031ec8cb4ecc4.zip gcc-e47c403137a6c1de1676543d0bb031ec8cb4ecc4.tar.gz gcc-e47c403137a6c1de1676543d0bb031ec8cb4ecc4.tar.bz2 |
[AArch64] Properly handle simple arith+extend ops in rtx costs
* config/aarch64/aarch64.c (aarch64_rtx_arith_op_extract_p):
Handle simple SIGN_EXTEND or ZERO_EXTEND.
(aarch64_rtx_costs): Properly strip extend or extract before
passing down to rtx costs again.
From-SVN: r226309
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bbee98a..54a0da3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-07-28 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64.c (aarch64_rtx_arith_op_extract_p): + Handle simple SIGN_EXTEND or ZERO_EXTEND. + (aarch64_rtx_costs): Properly strip extend or extract before + passing down to rtx costs again. + 2015-07-28 Nick Clifton <nickc@redhat.com> * config/rl78/rl78.c (rl78_addsi3_internal): New function. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 020f63c..9ba1629 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5617,6 +5617,11 @@ aarch64_rtx_arith_op_extract_p (rtx x, machine_mode mode) return true; } } + /* The simple case <ARITH>, XD, XN, XM, [us]xt. + No shift. */ + else if (GET_CODE (x) == SIGN_EXTEND + || GET_CODE (x) == ZERO_EXTEND) + return REG_P (XEXP (x, 0)); return false; } @@ -6128,7 +6133,8 @@ cost_minus: if (speed) *cost += extra_cost->alu.extend_arith; - *cost += rtx_cost (XEXP (XEXP (op1, 0), 0), VOIDmode, + op1 = aarch64_strip_extend (op1); + *cost += rtx_cost (op1, VOIDmode, (enum rtx_code) GET_CODE (op1), 0, speed); return true; } @@ -6206,7 +6212,8 @@ cost_plus: if (speed) *cost += extra_cost->alu.extend_arith; - *cost += rtx_cost (XEXP (XEXP (op0, 0), 0), VOIDmode, + op0 = aarch64_strip_extend (op0); + *cost += rtx_cost (op0, VOIDmode, (enum rtx_code) GET_CODE (op0), 0, speed); return true; } |