<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/109694>109694</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `__riscv_vmulh_vv_i64m1` doesn't work with `__attribute__((target("arch=+v")))`
        </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>
    The code:

```c
#include <riscv_vector.h>

__attribute__((target("arch=+v")))
vint64m1_t mulh_i64(vint64m1_t a, vint64m1_t b) {
  return __riscv_vmulh_vv_i64m1(a, b, 2);
}
```
does not compile with `-march=rv64gc`, giving the error:

```
<source>:5:10: error: builtin requires at least one of the following extensions: v
    5 |   return __riscv_vmulh_vv_i64m1(a, b, 2);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

even though `+v` is explicitly added. `-march=rv64gcv` works, and so does an equivalent 32-bit operation. https://godbolt.org/z/qYYzeoxGa

[related (but listing different problems)](https://github.com/llvm/llvm-project/issues/56592)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclM1yozgQx5-muXTFBS0-DxwSe7wvsJc5UQK1QbsCeSRBMjnss28hO7PZqckcolLJbuDfH7-WJL3X48LcQvEExSmRa5isa9Wr1LNMequ-t39OjINVDOIR0hOkb2uZ3uZwt0noZTCrYgRxdNoPW7fxEKw7TCC-vJd2nQzB6X4N3HVANVAdpBs5xP8k3TCBOAE9bUAE1Nxn1G56CWU-Z13AeTVTp8scqH73VAId8Z3dAzUI1dNNjug4rG7BrrunGL1s2-5ozoDqqO_3JYYWdyFUp5_qvpnKssfFBhzsfNWG8VmHCaFMH-Z7HW4r83HYBXTEUW96GTFMjOycdR9BvZvi6O3qBt4BiscCxGOWgnj8ocV-1SboBR1_W7VjjzKgYekD2oXRXmKkizXGPu9x-SXw4rVd_C7e3pggFgjVET9NB-O4ubgPKL7889vx64rjyhsvGCa7jhFl3Allitojv1yNHnQw31EqxerwC9Tx22fr_vZ7nnJR6C3GPskFd06bNLwEFPTQ64D2yk4GbZcDTiFcdzJAZ6DzaFVvTThYNwKdX4HO375-fWX78of8X8-KJ8dGBlYIVPdrQKN92Gkrfbmw20Ndne0Nz35nVpyA6p8i6TCt_WGwM9DZmO3t5-Hq7F88BKCz9n5lD3QuyqLZ2SeqFaoRjUy4zSqqskyQyJKprYXiOs_ynsosbbhQ-YWrWvaXps6o6kWiW0opTxsSWZWnIjtUlyETfd5LVRSKZAp5yrPU5rDnsJefxOhtljZlkydG9mx8vDGIFn7G-HY_qsUpcW1MvF9HD3m6k_D_uQk6GG6hTD_YX2Ua-7QAVSF28Mdp-uSVUabJ6kz7edr3kreW_g0AAP___liSKg">