Patchwork [AArch64,1/2] Remove UNSPEC_CLS and use clrsb RTL code in its' place

login
register
mail settings
Submitter Kyrylo Tkachov
Date July 22, 2014, 11:23 a.m.
Message ID <53CE49BB.9050507@arm.com>
Download mbox | patch
Permalink /patch/372441/
State New
Headers show

Comments

Kyrylo Tkachov - July 22, 2014, 11:23 a.m.
Hi all,

I noticed that we use UNSPEC_CLS for the clrsb optab when we could be using the RTL code for it. I don't see any reason not to use the RTL code and some execution tests confirm that the cls instruction implements the expected clrsb semantics. This patch removes the UNSPEC_CLS definition and usage.


Bootstrapped and tested on aarch64-linux.

Ok for trunk?

Thanks,
Kyrill

2014-07-22  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/aarch64/aarch64.md: Delete UNSPEC_CLS.
	(clrsb<mode>2): Use clrsb RTL code instead of UNSPEC_CLS.
Marcus Shawcroft - July 22, 2014, 1:24 p.m.
On 22 July 2014 12:23, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Hi all,
>
> I noticed that we use UNSPEC_CLS for the clrsb optab when we could be using
> the RTL code for it. I don't see any reason not to use the RTL code and some
> execution tests confirm that the cls instruction implements the expected
> clrsb semantics. This patch removes the UNSPEC_CLS definition and usage.
>
>
> Bootstrapped and tested on aarch64-linux.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2014-07-22  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>         * config/aarch64/aarch64.md: Delete UNSPEC_CLS.
>         (clrsb<mode>2): Use clrsb RTL code instead of UNSPEC_CLS.

Looks Ok. /Marcus

Patch

commit 9840d6c97f3413355852995a5bb7273e10acc1b8
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Tue Jul 15 15:23:59 2014 +0100

    [AArch64] Remove UNSPEC_CLS, use clrsb RTL code

diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 042a3b5..0adec11 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -67,7 +67,6 @@ 
 
 (define_c_enum "unspec" [
     UNSPEC_CASESI
-    UNSPEC_CLS
     UNSPEC_CRC32B
     UNSPEC_CRC32CB
     UNSPEC_CRC32CH
@@ -2863,7 +2862,7 @@ 
 
 (define_insn "clrsb<mode>2"
   [(set (match_operand:GPI 0 "register_operand" "=r")
-	(unspec:GPI [(match_operand:GPI 1 "register_operand" "r")] UNSPEC_CLS))]
+        (clrsb:GPI (match_operand:GPI 1 "register_operand" "r")))]
   ""
   "cls\\t%<w>0, %<w>1"
   [(set_attr "type" "clz")]