<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67950>67950</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Aarch64] Backend Bugs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
witbring
</td>
</tr>
</table>
<pre>
I separate the bug report #67787 since the report has distinct bugs.
Clang takes incorrect arm syntax and silently change registers.
```
$ cat buggy2.s
sxtw X0, X2
sxth X0, X4
sxtb X0, X6
$ ./bin/clang -c --target=aarch64-linux-eabi buggy2.s -o buggy2.o
$ objdump -d buggy2.o
Disassembly of section .text:
0000000000000000 <.text>:
0: 93407c40 sxtw x0, w2
4: 93403c80 sxth x0, w4
8: 93401cc0 sxtb x0, w6
```
In case of S2, D2 registers, Clang produces error message.
```
$ cat buggy2.s
sxtw X0, X2
sxth X0, S2
sxtb X0, D2
$/bin/clang -c --target=aarch64-linux-eabi buggy2.s -o buggy2.o
buggy2.s:2:14: error: invalid operand for instruction
sxth X0, S2
^
buggy2.s:3:14: error: invalid operand for instruction
sxtb X0, D2
^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVMty8ywMfRq80dhD5PvCi7RpZrrupluMFZvWgQzgJnn7f3BuTf5ON1-ZDAFx0EE6soRzqtdEDcufWL6KxOQHY5u98q1Vuo9a0x2bV3C0E1Z4Aj8QtFMPlnbGemCYFmVZlQBOaXk6Ph8NwkGnnFda-nDFJYyvGF-e5udR6B68-CQHSktjLUkPwm7BHbUXBxC6A6dG0n48ghyE7oPnXjlP9t4VK_j5d9piBlLMlP0RE3eyAgC4g9_DO2f4DO94Zx4u5uzO3F7MxR0fZpAwXLdKM1zLOZBYQhx7YXvyLF0JYeVQZPGo9HSISbQKrs-B2FzW5tGraT-6abuDuPsRslJOOEfbdjyC2YAj6ZXRkHg6eJYuv0P5wwCWPp9xL1coAPB5U9dpxkuZcWC8DllivD7Mke9vecpu0FRWF-jAeA1n7C151Q27kPKCbW9ui98EnOdXDVI4CoG-Ybizwpv-YX-qoJ013STJAVlrLGzJOdFT8ueV8YY_VsYKHzT8w7q4PjNdIkuXiyDAKcywUPpLjKoDsyMbvpWNsaC083aaq-L3IFj-8j-O9N84HjMC38eV76pI1DVpV6e1iKhZFHWBmOXFIhoaUdKmrqjLK6w2RZ2lWLaCZy3JRV5jlUWqQY7pgnPkOda4SDosEWVVSY64kaJlGaetUGMyjl_bxNg-Us5N1BRlnfNoFC2Nbm53iJr2MB8yxND9bBPuxKFbsYyPynl38-KVH-c-uTzJyPIVPAn5SbqDp6l30WTHZvB-F7LJcM1w3Ss_TG0izZbhOjg6_8U7az5Ieobrmd4xXM_P-y8AAP__GX6YGw">