[PATCH][ARM] Set "conds" attribute for non-predicable ARMv8-A instructions

Richard Earnshaw rearnsha@arm.com
Thu Nov 28 21:11:00 GMT 2013


On 28/11/13 16:10, Kyrill Tkachov wrote:
> Hi all,
> 
> Some ARMv8-A instructions in the vrint* family as well as the vmaxnm and vminnm 
> ones do not have a conditional variant and have therefore their "predicable" 
> attribute set to "no".
> However we've discovered that they can still end up conditionalised in some 
> cases because of the arm_cond_branch pattern that can remove a conditional and 
> conditionalise the next instruction, unless the "conds" attribute forbids it. To 
> prevent this happeninf with the vrint and vmaxnm, vminnm instructions, this 
> patch sets the "conds" attribute to "unconditional".
> 
> This was caught in a testcase where the vrinta instruction ended up being 
> conditionalised (producing vrintagt) which thankfully the assembler caught and 
> complained. If this had happened on the smin/smax patterns that don't have a 
> '%?' in their output template, we would have ended silently miscompiling!
> 
> This should go into trunk and the 4.8 branch.
> 

OK both.

R.

> Tested arm-none-eabi on a model.
> 
> Ok?
> 
> Thanks,
> Kyrill
> 
> 2013-11-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>      * config/arm/iterators.md (vrint_conds): New int attribute.
>      * config/arm/vfp.md (<vrint_pattern><SDF:mode>2): Set conds attribute.
>      (smax<mode>3): Likewise.
>      (smin<mode>3): Likewise.
> 
> 2013-11-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>      * gcc.target/arm/vrinta-ce.c: New testcase.
> 



More information about the Gcc-patches mailing list