From: Kyrylo Tkachov Date: Fri, 15 Jan 2016 17:29:16 +0000 (+0000) Subject: [AArch64] Handle compare of zero_extract form of TST-immediate in rtx costs X-Git-Tag: basepoints/gcc-7~1590 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=345854d804e3bc056da0db708904bbb5d41c997a;p=thirdparty%2Fgcc.git [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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 371ec82a5410..edfc0b4a46e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index cb57fe2bb8c5..fee917f135b7 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. */