This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64] Add handling of bswap operations in rtx costs
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Wed, 19 Mar 2014 09:56:50 +0000
- Subject: [PATCH][AArch64] Add handling of bswap operations in rtx costs
- Authentication-results: sourceware.org; auth=none
Hi all,
This patch depends on the series started at
http://gcc.gnu.org/ml/gcc-patches/2014-03/msg00933.html but is not really a part
of it. It just adds costing of the bswap operation using the new rev field in
the rtx cost tables since we have patterns in aarch64.md that handle bswap by
generating rev16 instructions.
Tested aarch64-none-elf.
Ok for stage1 after that series goes in?
2014-03-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.c (aarch64_rtx_costs): Handle BSWAP.
commit b9771a71dbf62522d423e16ce03353624c1ccd5a
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Thu Feb 27 11:55:27 2014 +0000
[AArch64] Cost bswap operations properly
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 901ad3d..28c8841 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4678,6 +4678,14 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED,
return false;
+ case BSWAP:
+ *cost = COSTS_N_INSNS (1);
+
+ if (speed)
+ *cost += extra_cost->alu.rev;
+
+ return false;
+
case IOR:
case XOR:
case AND: