diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2016-01-15 17:29:16 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2016-01-15 17:29:16 +0000 |
commit | 345854d804e3bc056da0db708904bbb5d41c997a (patch) | |
tree | c58daa4be17abe282c2e86e92a40b15dd1673c99 | |
parent | 16d129928bbb3cf6a59695a8ce95353a416080b8 (diff) | |
download | gcc-345854d804e3bc056da0db708904bbb5d41c997a.zip gcc-345854d804e3bc056da0db708904bbb5d41c997a.tar.gz gcc-345854d804e3bc056da0db708904bbb5d41c997a.tar.bz2 |
[AArch64] Handle compare of zero_extract form of TST-immediate in rtx costs
* config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
Handle COMPARE of ZERO_EXTRACT against zero form of TST-immediate.
From-SVN: r232441
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 371ec82..edfc0b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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. + +2016-01-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + * config/aarch64/aarch64.c (aarch64_process_one_target_attr): Return false when argument string is not found in the attributes table at all. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index cb57fe2..fee917f 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6490,6 +6490,23 @@ aarch64_rtx_costs (rtx x, machine_mode mode, 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), GET_MODE (op0), + ZERO_EXTRACT, 0, speed); + return true; + } + if (GET_CODE (op1) == NEG) { /* CMN. */ |