diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2016-01-19 09:54:12 +0100 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2016-01-27 12:24:08 +0000 |
commit | 9c09c7919c24d1ecf9e96843f2e62369602d0a34 (patch) | |
tree | cd0fb1eafc1249d688f11ef2e17470648aa92b09 | |
parent | 5b84e0ab7292bd130c5ac2e170b7c7ed5ea80be3 (diff) |
gcc/
Backport from trunk r232441.
2016-01-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
Handle COMPARE of ZERO_EXTRACT against zero form of TST-immediate.
Change-Id: I6c022007b3c58ad0126c59edde3409beb057735e
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 7758316df48..6020259dea7 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6099,6 +6099,22 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED, goto cost_minus; } + if (GET_CODE (op0) == ZERO_EXTRACT && op1 == const0_rtx + && GET_MODE (x) == CC_NZmode && CONST_INT_P (XEXP (op0, 1)) + && CONST_INT_P (XEXP (op0, 2))) + { + /* COMPARE of ZERO_EXTRACT form of TST-immediate. + Handle it here directly rather than going to cost_logic + since we know the immediate generated for the TST is valid + so we can avoid creating an intermediate rtx for it only + for costing purposes. */ + if (speed) + *cost += extra_cost->alu.logical; + + *cost += rtx_cost (XEXP (op0, 0), ZERO_EXTRACT, 0, speed); + return true; + } + if (GET_CODE (op1) == NEG) { /* CMN. */ |