<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94306>94306</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[RISC-V] attribute target arch=+zvfh doesn't add builtins
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
antonblanchard
</td>
</tr>
</table>
<pre>
This fails when building with `-march=rv64gc`:
```
#include <riscv_vector.h>
__attribute__((target("arch=+v,+zvfh")))
void testcase(_Float16 *src, _Float16 *dst, int len)
{
size_t nr = __riscv_vsetvl_e16m2(len);
vfloat16m2_t a = __riscv_vle16_v_f16m2(src, nr);
__riscv_vse16_v_f16m2(dst, a, nr);
}
```
with:
```
testcase.c:7:19: error: call to undeclared function '__riscv_vle16_v_f16m2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
```
It works with `-march=rv64gcv_zvfh`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U12P6yYQ_TXjl1EiMsR2_OCHfDTSPlXqrdpHCwOJaQlEMPaq99dXTrx3d9u9FsJjYM7heOaonN01WNtCeYDyVKiRh5haFTiG3qugB5VM0UfzT_v74DJelPMZXwcbsB-dNy5c8dXxgFCJ1U0lPYA8panaXjVUAuQexAnE21yJZTw_Sbqg_Wgsgjwml_XUTVZzTOsB5C8fM7tOMSfXj2y7DmgHtGOVrpYfMS28QIcJ6Ah0-D5dBiACapbxQJmiM8g2s1bZAu26s4-KNxUC7XPSQEf8uGQyz0suMHobfqBAfXgGuDzZfbcdY0gI8oRdtyjJliff2U11I6DdgiD_kztdnnw36hjVZwBvN1U3dZcFYblhSF_hfGD9lLRoUP_PhPr0ZVXmar7X7fPe279ba5D7GuR-04Dco00ppjnQynvkiGMwVnuVrMHLGDS7GBCo_omyGuQBX779isemQRUMesU2oYkYImMe7_eYGN3t7p12_I745FBznBHKw-rPtzOrtzOrD2eg_Frwc35hfI3p7_yzbp66R09VojCtNI1sVGHbTb2pt_VmV4liaC-burSikbSjvrY70r2hi-kbXWtb1VIUriVBW1GJrZByI8RaKUXWVn1Zb3VVqh1shb0p59feT7d1TNfC5TzattlKURVe9dbnh1GJgn3Fx-bc5eWpSO2cs-rHa4at8C5zfkdhx_7h8N9evh1Xf0B5wh92wqeP8N1Cs0400eYAVDMqYx5WZxdyMSbfDsz3PHcInYHOV8fD2K91vAGdZ8bltbqn-JfVDHR-3DMDnZ86ppb-DQAA__9mBlm0">