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.tkac...@arm.com>

        * config/aarch64/aarch64.md: Delete UNSPEC_CLS.
        (clrsb<mode>2): Use clrsb RTL code instead of UNSPEC_CLS.
commit 9840d6c97f3413355852995a5bb7273e10acc1b8
Author: Kyrylo Tkachov <kyrylo.tkac...@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")]

Reply via email to