]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/66474 (Document the use of %x in powerpc asm statements)
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Wed, 10 Jun 2015 17:16:58 +0000 (17:16 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 10 Jun 2015 17:16:58 +0000 (17:16 +0000)
2015-06-10  Michael Meissner  <meissner@linux.vnet.ibm.com>

Backport from mainline:
2015-06-10  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/66474
* doc/md.texi (Machine Constraints): Document that on the PowerPC
if you use a constraint that targets a VSX register, you must use
%x<n> in the template.

From-SVN: r224335

gcc/ChangeLog
gcc/doc/md.texi

index 7b0c4365b11fd05fbf20469e2a8edf791ff164de..17dda0a267636f5a8a4cc13f23b5940ac36ba2cc 100644 (file)
@@ -1,3 +1,13 @@
+2015-06-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       Backport from mainline:
+       2015-06-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR target/66474
+       * doc/md.texi (Machine Constraints): Document that on the PowerPC
+       if you use a constraint that targets a VSX register, you must use
+       %x<n> in the template.
+
 2015-06-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/66470
index 602d7e70ed33f6e9e849b021847a63be9f77768e..7b3e362ba60746d0e74ce6b036aca6a5b5946bbf 100644 (file)
@@ -2117,6 +2117,27 @@ Altivec vector register
 @item wa
 Any VSX register if the -mvsx option was used or NO_REGS.
 
+When using any of the register constraints (@code{wa}, @code{wd},
+@code{wf}, @code{wg}, @code{wh}, @code{wi}, @code{wj}, @code{wk},
+@code{wl}, @code{wm}, @code{ws}, @code{wt}, @code{wu}, @code{wv},
+@code{ww}, or @code{wy}) that take VSX registers, you must use
+@code{%x<n>} in the template so that the correct register is used.
+Otherwise the register number output in the assembly file will be
+incorrect if an Altivec register is an operand of a VSX instruction
+that expects VSX register numbering.
+
+@smallexample
+asm ("xvadddp %x0,%x1,%x2" : "=wa" (v1) : "wa" (v2), "wa" (v3));
+@end smallexample
+
+is correct, but:
+
+@smallexample
+asm ("xvadddp %0,%1,%2" : "=wa" (v1) : "wa" (v2), "wa" (v3));
+@end smallexample
+
+is not correct.
+
 @item wd
 VSX vector register to hold vector double data or NO_REGS.