<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143975>143975</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[RISCV] Permutation intrinsics in Zvfhmin unnecessarily require Zvfh
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dzaima
</td>
</tr>
</table>
<pre>
Basic 16-bit float permutation intrinsics (`vslideup` / `vslidedown` / `vrgather`), which can be in `Zvfhmin` (as they need just the `vfloat16*` type and a basic `e16` `Zve32x` instruction), unnecessarily also require `Zvfh`.
This happens both with `__attribute__((target))`: https://riscvc.godbolt.org/z/x6nnb6YoG
and with `-march`: https://riscvc.godbolt.org/z/b4dMrda3e
Copied-out code sample that should work but doesn't, for reference:
```c
#include<riscv_vector.h>
__attribute__((target("arch=+v,+zvfhmin")))
vfloat16m1_t vrgather(vfloat16m1_t op1, vuint16m1_t index, size_t vl) {
return __riscv_vrgatherei16_vv_f16m1(op1, index, vl);
}
__attribute__((target("arch=+v,+zvfhmin")))
vfloat16m1_t vslideup(vfloat16m1_t dest, vfloat16m1_t src, size_t offset, size_t vl) {
return __riscv_vslideup_vx_f16m1(dest, src, offset, vl);
}
__attribute__((target("arch=+v,+zvfhmin")))
vfloat16m1_t vslidedown(vfloat16m1_t src, size_t offset, size_t vl) {
return __riscv_vslidedown_vx_f16m1(src, offset, vl);
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8lM9u4zYQxp9mfBnEoEaybB10cJK66KFA0RYF2otAkSOLW5lUSUr58_QFFTmbBNuie-gCAgQOyW_mNyQ_GYI5W-Yadrewu9_IKfbO1_pZmovctE4_1bcyGIVZedOaiN3gZMSR_WWKMhpn0djojQ1GBQQ6QCnmMBjN0wilQKATvoa0e7Bvg_4sY88eSgFUAd3hQ29Uj0pabBmNTYv-mLv-YtZtBxkw9vyEllnjpynENFy0lrqyEuiYlsankVFajRLbpXooBWflopI0OafHNDA2RD-pxLGWMFnLikOQ3gxPKIfg0PNfk_F8rQZKsQVxBHH8tTcBezmObAO2Lvb4YGKf1jWNjNGbdorcNKkrdIjSnzkuWapEnB-xj3EMkB-BTkAnb4Ka1fbsdOuGuHX-DHR6Bjo9lta25e_uexDHxHRNcnORXvVfp9UW-kevZc4vBHduNKxv3BRROc0Y5GUcGGMvI4beTYPGB-f_xHaKqB0HC7SPqU2d8-i5Y89WcUorUt9fPpUGlBurhkkz5HdLNc3MKjq_7SH_7iX5vzTpAEQLXH4PdDsD3QHdPq9XgWjtIlUgjteTv2RNxNcrRYd3cTdmqep5MvYaMlbzYwoG88xp6wBUIexvQRwRET3HyVtsmrX6VZlNVjbz3HRJBuiwKr-qLTKQJxXY3_9_oNc39gFUc1jO510wePUG1HVd4PhP5B-x1zzN_PiKfM2xyn7W-6bsi5l8oP8a0C8c8avuW9r_QHm9-Btd57rKK7nhOtsX1b7MizLf9PVOc0m5kvsDVfusUCTKLKt4JzrV0aHINqYmQTtRZkQZFZRvs_1OF0KUqjsInZUZFIIv0gzbYZgv6T1vTAgT11mRV_vdZpAtD2HxcCLLD7jMpibu7je-Tptu2ukcoBCDCTF8lokmDov5__zDL3e_we4ef_qytxuLqxd_8MirPabZzeSH-r0VnU3sp3ar3AXolNKuv5vRu0-sItBpKTYAnVaauaa_AwAA__9nQxRQ">