<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61986>61986</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64] Inconsistent -mgeneral-regs-only for assembly
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AArch64
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jrtc27
</td>
</tr>
</table>
<pre>
With GCC, -mgeneral-regs-only applies solely to its code generation, and is not forwarded to GNU as (though it could by passing an equivalent `-march=...`). With LLVM, -mgeneral-regs-only affects the assembler, not just code generation, but only partially; `fadd d0, d0, d0` is rejected, but `str q0, [x0]` is permitted. Ideally Clang and GCC would match their behaviour, but LLVM's does make more sense, so long as it's consistent and applies the appropriate predicates to every instruction that uses a non-general-purpose register, not just an arbitrary subset, rather than being somewhere in the middle.
(See https://github.com/openzfs/zfs/pull/14715/files#r1159951957 for a case where this difference showed up in the real world)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VE2P4zYM_TXKhYghy7ETH3zITJDFAtteirZnWaJtzcqSV6QnTX99IWfSD2C7F_mgR_K9Rz1rIjcGxE7UL6K-7PTKU0zdW2Kjjrs-2nv3u-MJPr2-CvUK-3nEgEn7fcKR9jH4O-hl8Q4JKHr0d-AIjglMtAgPMLsYcrEOFhxBiAxDTDedLNoM__Tzr6AJhDrxFNdxAsdg4uot9HdYMsMwgg6A31b3rj0GBtHI_ayTmUR1KYpCNFKotoCN6pcvv_30v1yHAQ0T8ISgiXDuPaYMzqTeVuLv8e5Xhq160Ymd9v4uqpdMYdDWgpUZ8_fZyKwx4RsaRvssF40kTvBtQ4n65Q8p6ssHdsE0O2a0BXy2mNvDq9ebZJt9h9vmxazZTJm4S9DjpN9dXNOz_0PzkcBGJJj1V4Q5JgTCQJhBFMHH3JPA8YY0MZAjzm7mQc8tbs4sS4pLcpoRloTWGc35KgK-Y7qDC8RpNdkf4EkzrIQEGkIM-6fny5qWSAgJxzzlvybrADr1jpNOd6C1J-R8nzRPmHLLAD3mrVOc8TZhQnBhozY7az0WQl6EPH-c6vQLIkzMC4nqLNRVqOvoeFr7wsRZqGtcMPw5kFDXx7ms3gt1LQ_HshbqOjiPJFSVyrJu27ps62N-oKDBaEJ4zOfJEVg3DJgwGASa4g0trMuTWULt4RaTt0K1O9tVtq1avcOubE7y2Nb1Ue2mruzNUWJVDtZU1VCVdpCHxgx1X_ZS2pPcuU5JVcmDbMq6aitVHPHUK2uqU2Oqg6q0OEictfOF9-9zEdO4c0Qrdk3Znpqd1z162tKsVK_NVwxWVOfzOZmpOQilcshTl2v3_TqSOEjviOmfbuzYb7-DZ019gc_hX6_le7na7Hrk6b5bk-9-sI086eOzX1LMQRHquonIy9l0_BUAAP__ATSHPw">