From 26677894bee4d7c6e218f375436f62fc666f4a66 Mon Sep 17 00:00:00 2001 From: ktkachov Date: Fri, 15 Jan 2016 17:29:16 +0000 Subject: [PATCH] [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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232441 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 371ec82a541..edfc0b4a46e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2016-01-15 Kyrylo Tkachov + * 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 + * 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 cb57fe2bb8c..fee917f135b 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. */ -- 2.11.4.GIT