<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60562>60562</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Incorrect lowering for SVE predicate permute builtins.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AArch64,
clang:codegen,
SVE
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
paulwalker-arm
</td>
</tr>
</table>
<pre>
When lowering predicate permute builtins we incorrectly assume only the typically "active" bits for the specified element type play a role with all other bits zero'd. This is not the case because all bits are significant, with the element type specifying how they are grouped:
b8 - permute using a block size of 1 bit
b16 - permute using a block size of 2 bits
b32 - permute using a block size of 4 bits
b64 - permute using a block size of 8 bits
The affected builtins are svrev, svtrn1, svtrn2, svuzp1, svuzp2, svzip1 and svzip2.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU0uPozwQ_DXm0gqC5pHkwCHfNxNpzzOaPRvTgHeMjfxIRH79ypBNZi87J0qmqh_V3dw5OWiihlX_seol4cGPxjYzD-rK1SfZHbdT0ppuaX6OpEGZK1mpB5gtdVJwTzCTnYInaINUXmoHVwKphbGWhFcLcOfCRGC0WsCPBH6ZpeBKLcAQufDyQgwRWukd9MauHDeTkL2kDkjRRNpHFcGs-AIcrFEEV-lH4EqB8SPZTX4jaxjuuxTgfZQOpANt_BpRcEfQkuDB0SpbBdwSRANkLwXXnuH_W9yo-CvzVtASOx_NNf5fVvFgTZipY8WJZS8sOwEAbKg9AOwe5gQXpRxaZcQnOHkjMD3ksYo7Pa-_pW8m3fkFfssvv_Lr8lv-4Qv_2cj7SMD7noSn7jnk1bmLpUv0zF281fkD4YbCbc4f6P52k3MOXHcbxDTpmqI7FkeeUJPX-6o-FkV2SMamq3FfYNnXoqgO_ZFawWukDsv2WNfVHhPZYIZFhlmdl5iXh7TPqqLHQ4HHkrjoWlZmNHGpUqUuU2rskEjnAjV1VtWYKN6ScuvaI7ZcfJKOUzydrBjrkmGslyEKxfXAipMwHQ2kH-9vH68RVy-JbWL8XRsGx8pMSefdM6OXXlHz4881PM8nLvrbx-s_zihNglXN6P3s4nbhmeF5kH4MbSrMxPAck9w_u9maXyQ8w_Pao2N4Xtv8HQAA__-CjUkz">