[PATCH] [AArch64]Improper diagnostics about offset range of load/store instructions.

Kevin Qin kevinqindev at gmail.com
Mon Mar 3 02:06:20 PST 2014


Hi Tim and other reviewers,

LDP for example, its Post-index ASM format in ARMARM is,

32-bit variant (opc = 00)
LDP <St1>, <St2>, [<Xn|SP>], #<imm>
64-bit variant (opc = 01)
LDP <Dt1>, <Dt2>, [<Xn|SP>], #<imm>
128-bit variant (opc = 10)
LDP <Qt1>, <Qt2>, [<Xn|SP>], #<imm>

<imm> 32-bit signed offset: is the immediate offset which defaults to 0 and is a multiple of 4 in the range -256 to 252, with the "imm7" field encoding <imm>/4.
<imm> 64-bit signed offset: is the immediate offset which defaults to 0 and is a multiple of 8 in the range -512 to 504, with the "imm7" field encoding <imm>/8.
<imm> 128-bit signed offset: is the immediate offset which defaults to 0 and is a multiple of 16 in the range -1024 to 1008, with the "imm7" field encoding <imm>/16.

Current diagnostics for 64-bit signed offset is "error: expected integer multiple of 8 in range [-512, 508]", and for 128-bit signed offset is "error: expected integer multiple of 16 in range [-1024, 1016]". Although the ranges are not wrong (504 is the largest multiple of 8 in range [-512, 508], and  1008 is the largest multiple of 16 in range [-1024, 1008]), diagnostics still may get end-user confused.  So change them to ARMARM is  much easier to understand.

http://llvm-reviews.chandlerc.com/D2925

Files:
  lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  test/MC/AArch64/basic-a64-diagnostics.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2925.1.patch
Type: text/x-patch
Size: 11518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140303/3f35b3aa/attachment.bin>


More information about the llvm-commits mailing list