<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60528>60528</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
failure to parse asm emitted by AArch64 + global isel
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AArch64,
llvm:asmparser,
globalisel
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
regehr
</td>
</tr>
</table>
<pre>
this looks like probably a different issue than https://github.com/llvm/llvm-project/issues/60369, but I'm not certain about that
this function:
```llvm
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
define i64 @f(i64 %0) {
%2 = mul i64 %0, %0
%3 = sub i64 %2, -2105098
ret i64 %3
}
```
compiled to AArch64 with global isel gives:
```
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0
.globl _f ; -- Begin function f
.p2align 2
_f: ; @f
.cfi_startproc
; %bb.0:
add x8, xzr, #513, lsl #12 ; =2101248
add x8, x8, #3850
madd x0, x0, x0, x8
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
```
but then this doesn't parse back:
```
Johns-MacBook-Pro:tmp regehr$ llvm-mc r2.s
.section __TEXT,__text,regular,pure_instructions
r2.s:2:2: warning: .build_version macos used while targeting darwin22.3.0
.build_version macos, 13, 0
^
.build_version macos, 13, 0
.globl _f
.p2align 2
_f:
.cfi_startproc
r2.s:8:15: error: invalid operand for instruction
add x8, xzr, #513, lsl #12 ; =2101248
^
add x8, x8, #3850
madd x0, x0, x0, x8
ret
.cfi_endproc
.subsections_via_symbols
Johns-MacBook-Pro:tmp regehr$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VkGPozgT_TXOpZQIykDgkANJpqXvk1Zaaeewt8jggnjb2JFtuqf3169s0p30aKZnpFltFAzYz1Xl8nsuhPdqNEQ7Vu5ZeVyJOZyt2zka6exWnZUvu3BWHrS1jx60eiS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