[PATCH] [AArch64] Add logical pseudo instructions to MC AsmParser

Arnaud Allard de Grandmaison arnaud.adegm at gmail.com
Thu Jul 10 06:43:20 PDT 2014

This patch teaches the AsmParser to accept some logical+immediate
instructions and convert them as shown:

      bic  Rd, Rn, #imm  ->  and Rd, Rn, #~imm
      bics Rd, Rn, #imm  ->  ands Rd, Rn, #~imm
      orn  Rd, Rn, #imm  ->  orr Rd, Rn, #~imm
      eon  Rd, Rn, #imm  ->  eor Rd, Rn, #~imm

Those instructions are an alternate syntax available to assembly coders,
and are needed in order to support code already compiling with some other
assemblers. For example, the bic construct is used by the linux kernel.

Those pseudos are just syntactic sugar, and this leads to a question about
diagnostics. Which diagnostic should be emitted when the asmparser fails to
match an instruction or a pseudo ? For example, with this patch, the
closest match for the assembler is the pseudo in one of the
basic-a64-diagnostics tests, which leads to a weird diagnostic. Would there
be a non convoluted way to disambiguate this, or give a lower priority to
pseudos ?

Apart from this point, does this patch looks reasonable ?

Arnaud A. de Grandmaison
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140710/ee23a0e5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AArch64-Add-logical-pseudo-instructions-to-MC-AsmPar.patch
Type: text/x-patch
Size: 11705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140710/ee23a0e5/attachment.bin>

More information about the llvm-commits mailing list