<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143744>143744</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] vsetvli/vsetivli does not permit lmul operand to be optional
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ThinkOpenly
</td>
</tr>
</table>
<pre>
The following instructions should all produce the same encoding:
```
[vsetvli.s.txt](https://github.com/user-attachments/files/20694598/vsetvli.s.txt)
[vsetvli.s.txt](https://github.com/user-attachments/files/20694603/vsetvli.s.txt)
vsetvli t0, a0, 192
vsetvli t0, a0, e8, m1, ta, ma
vsetvli t0, a0, e8, ta, ma
```
However, clang (20) does not accept the 3rd syntax that omits the lmul operand "m1", which is the default value:
```
$ clang -c vsetvli.s
vsetvli.s:21:25: error: operand must be e[8|16|32|64],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
vsetvli t0, a0, e8, ta, ma
^
```
Originally reported https://github.com/riscv-software-src/riscv-unified-db/pull/838.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VM2yrCYQfhrcUGMhij8LFzNOrOzu5r4ASqskKBY0M3fePoVn7pycJOdUNteyGho-aPi-pqX3et4AWiIuRFwTGXCxrv2-6O3Pbzts5pEMVj3a7wvQyRpj73qbqd48ujCitpunfrHBKCqNobuzKoxAcQHq5QoUttEqvc0kPxN2JiV7_uxwxeXmAW9Gpz7FH0jElfB6Qdx9xPOe8H7WuIQhHe1KeB88uJNElOOywoae8H7SBmLLWdkUoqkJ7z_uyZtfFKxk-afBnqMUGeEdlYfNGv7JDNTRrlm0KI--_BL6N9A_KP3d3uEGLk6PRm4zJbzmjPCGKguebhapHEfY8ZAod4r6x4byB8VFIrWrRn_MmDUYandwclOUcB4Px-Ou90WPC9VvKAWTDAbpTZoA_yExL56nOI30RdT7zdLIPM-iESQ_U3DOutj5GXgNHukAFIi41KTqspJUXc5J1ZXFoV-3EnHJSNXFsYJUXURN0ZmiN9VvKCIuKEnVYXj5a_TXw2dn-vz-F-P0k4-I3_6txzenZ71JYx7UwW4dgqJf5JzTfrydvJ3wLh2cvBtfg2HTkwZ1UgPh_R6MIbyv8zpNVJurJm9kAm1WFU0pGpGzZGnzqRRK1FxUMIwwNEqVooapUI0QUrIh0S1nXLAyy7Iy56xJWVblDcvrgiteMyZIwWCV2qTG3NbUujnR3gdosyKviiIxcgDjj8LB-aFzzBFxTVwbF5yGMHtSMKM9-vctUKM5qs3bCnH9yfrzMekowCtZd3Crxo_piDbmhN1j9ZEmCc60X1AaAz-b0-7sHzAi4f1xkfiUn3e5tfyvAAAA__9XYIf4">