From: Kyrylo Tkachov Date: Tue, 22 Jul 2014 13:39:16 +0000 (+0000) Subject: [AArch64][2/2] Add rtx cost function handling of clz, clrsb, rbit. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=781aeb73bccb86d892e1f565e807a2dfa647e4ee;p=gcc.git [AArch64][2/2] Add rtx cost function handling of clz, clrsb, rbit. * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle CLRSB, CLZ. (case UNSPEC): Handle UNSPEC_RBIT. From-SVN: r212913 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c972bb462b..f40cfd95b00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-07-22 Kyrylo Tkachov + + * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle CLRSB, CLZ. + (case UNSPEC): Handle UNSPEC_RBIT. + 2014-07-22 Kyrylo Tkachov * config/aarch64/aarch64.md: Delete UNSPEC_CLS. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 5f8db1dc01e..56a0e443ce1 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5151,6 +5151,13 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED, return false; + case CLRSB: + case CLZ: + if (speed) + *cost += extra_cost->alu.clz; + + return false; + case COMPARE: op0 = XEXP (x, 0); op1 = XEXP (x, 1); @@ -5796,6 +5803,14 @@ cost_plus: return false; } + + if (XINT (x, 1) == UNSPEC_RBIT) + { + if (speed) + *cost += extra_cost->alu.rev; + + return false; + } break; case TRUNCATE: