[PATCH] D136436: [Clang][LoongArch] Add register alias handling without `$` prefix

Lu Weining via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 20:16:03 PDT 2023


SixWeining added a comment.

In D136436#4314612 <https://reviews.llvm.org/D136436#4314612>, @xen0n wrote:

> Hi, any update on this? Given the `$`-less style has been long established at this time, and present in released GCC versions, it seems we indeed have to follow suit (and later make GCC accept ABI names for FPRs too). It will also make the ClangBuiltLinux work easier.

I tend to adopt @xry111's suggestion that "emulating" GCC's behavior in Clang (not in LLVM):

> GCC supports register variable definition like register u64 a0 asm("a0"); but does not support addi.d a0, a0, a1 (because in GCC such a line in inline assembly is passed to GNU as directly).
> Is it possible to "emulate" the behavior in Clang?

And for `FPRs`, I suggest to keep current implementation until GCC support non-prefixed names.

This means:

- Non-prefixed `GPRs` names ( and ABI names ) are allowed in register variable definition and clobber list.
- Only `$` prefixed register names is allowed in assembler template.
- Do not support non-prefixed names for other registers ( including `FPRs` ) anywhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136436/new/

https://reviews.llvm.org/D136436



More information about the cfe-commits mailing list