<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [PowerPC][InlineAsm][Altivec] Cannot map altivec registers to VSX registers using %x"
href="https://llvm.org/bugs/show_bug.cgi?id=31837">31837</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[PowerPC][InlineAsm][Altivec] Cannot map altivec registers to VSX registers using %x
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bruno.rosa@eldorado.org.br
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=17923" name="attach_17923" title="Test case">attachment 17923</a> <a href="attachment.cgi?id=17923&action=edit" title="Test case">[details]</a></span>
Test case
The attached test case compiles with gcc-6. Clang complains about invalid
operands for xxpermdi:
clang-3.9 -Werror -Wall -std=c99 -save-temps -g -maltivec test.c -o test
error: invalid operand in inline asm: 'vor $0,$1,$2
xxpermdi ${0:x},${1:x},${2:x},3
' at line 571687
The idea here is to use an Altivec register for both Altivec and VSX
instructions. When using it in a VSX instruction, a given reg vN (e.g. v0)
should be referenced as vs(N+32) (e.g. vs32).
The assembly generated by gcc:
vor 13,1,0
xxpermdi 45,33,32,3
(v13 <=> vs45, v1 <=> vs33, v0 <=> vs32).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>