<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98947>98947</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang doesn't accept LOCK prefix in assembler
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
VorfeedCanal
</td>
</tr>
</table>
<pre>
As you can see all versions of GCC, even ancient ones accept `lock` as prefix: https://godbolt.org/z/q83EP7vc8
```
asm("LOCK CMPXCHGW %DI, 32768(%EDI,%EDI,8)");
```
Clang rejects it and if you put `LOCK` on separate line it comes before other prefixes while GCC puts it after.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxskk-P0zwQxj_N5DLaKhnnT3PIoZtu9n0FiD0BVyeetAbXDrZTWD49clpAQkjRJLEePZ7nNyND0CfL3EH1CNUxk2s8O999cH5mVr200mSjU6_dIeCrW3GSFgMzSmPwyj5oZwO6GZ_7HqhHvrJFaSfNNqKzHFBOEy8Roc6Nm75AnaMMuHie9XcQBzzHuAQQB6ABaDg5NToTd86fgIYfQMPXvXh6aa7THvIj5Id7rfP7s_3KcAHaA9Hb9_0b7N-9fOr_e_6IQNXx_9SUoKbeb4rqaTv5_bEHaoEoVfH4T-9b7Y20J_T8macYUEeUVqGeNyLLuqVLd6d0LvFZpJeR0WjLST25CwcceXae0cUz-zsBDvjtrA0nfMno5j1H9rtMdUK1opUZd0VDRd4UFZXZuROFappa1UKMspmbplBVSbVoZEtqzGuZ6Y5yKpO-aKmicle0chJyVlVViEmJAsqcL1KbnTHXS2Kd6RBW7tp9WzaZkSObsO0D0ZSCJ0LVMfNd0j-M6ylAmRsdYvjjEHU03N04KcfBAjXx1_C3udwSo7YoQ-DLaNhnqzfdXxug43kdd5O7AA3J_f56WLxL9IGGrdkANNz6vXb0MwAA__9pethb">