This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][ARM] Adjust clz, rbit and rev patterns for -mrestrict-it
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Tue, 05 Aug 2014 10:45:14 +0100
- Subject: Re: [PATCH][ARM] Adjust clz, rbit and rev patterns for -mrestrict-it
- Authentication-results: sourceware.org; auth=none
- References: <53DF7B10 dot 6080101 at arm dot com>
On 04/08/14 13:22, Kyrill Tkachov wrote:
> Hi all,
>
> While working on another patch and looking at the rbit and clz patterns,
> I noticed that in aarch32 the relevant patterns are not adjusted for
> -mrestrict-it.
> A program like:
> int
> foo (int a, int b)
> {
> if (a + 5 == b)
> return __builtin_ctz (a);
>
> return 1;
> }
>
> compiled with -march=armv8-a -mthumb could generate clz and rbit
> instructions inside an IT block, thus earning an assembler warning.
> Whilst there I also noticed that the output templates for the arm_rev
> pattern have a %? that is used to print out condition codes during
> predication but the pattern is not marked as predicable.
> So I set the predicable attribute there and adjusted it for
> -mrestrict-it while at it.
>
> Ok for trunk?
>
> 2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * config/arm/arm.md (clzsi2): Set predicable_short_it attr to no.
> (rbitsi2): Likewise.
> (*arm_rev): Set predicable and predicable_short_it attributes.
>
OK.
R.