[PATCH] D50004: [PowerPC] Emit xscpsgndp instead of xxlor when copying floating point scalar registers for P9

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 13 04:28:09 PDT 2018


nemanjai added a comment.

In https://reviews.llvm.org/D50004#1195212, @jsji wrote:

>




> ??? Can you please double check what ISA are you referring to?

ISA 3.0

> The description in PowerISA_public.v3.0B https://ibm.ent.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv is:
> 
> As an example, to preserve the XT source register in the xxperm instruction, the following sequence will optimize performance.
> 
>   xxlor XT,XC,XC /* Copy (XC) to XT
>    xxperm XT,XA,XB /* Permute, overwriting XT
> 
> The set of instructions listed below, when immediately preceded by the xxlor XT,XC,XC instruction in a sequence similar to the above example, will provide optimal performance.
> 
> This should be exact the same pattern as in my example: xxlor XT,XC,XC to Copy (XC) to XT, not xxlor XC,XT,XT in your description.

It would appear that the version of the document I have has a bug in it (I had ISA 3.0 - without the `B`). Yes, I agree that the description in the corrected ISA document matches both of the provided examples.
However, I don't think this should preclude this patch. Register/register copies are far more common than destructive operations so we should emit the best instruction for the copy. As a follow-up, we should detect copies that are inputs to destructive operations and emit the `XXLOR` for those.


https://reviews.llvm.org/D50004





More information about the llvm-commits mailing list