[PATCH] fix alignment specifier syntax on Neon instructions

Kristof Beyls kristof.beyls at arm.com
Tue Feb 12 07:56:46 PST 2013


Hi,

The attached 2 patches fix the alignment specifier syntax on Neon
instructions.
The background to these patches is that currently, LLVM expects the
alignment specifier in some Neon instructions to be specified using ", :"
syntax, e.g.
	vld1.8	{d16}, [r0, :64]
However, the correct syntax is to use ":" instead of ", :", e.g.
	vld1.8	{d16}, [r0:64]

Old versions of the GNU assembler got this wrong in a similar way, but this
was fixed in GNU as 2.20.xx (I'm not sure which minor version of 2.20 this
was fixed in first). I believe that the current implementation in LLVM aimed
at being compatible with GNU as. Since this has been fixed in GNU as since
at least 2010, I think this should now also be fixed in LLVM.

Please review the attached 2 patches.

The first patch, accept_correct_alignment_specifier_syntax.patch, just makes
ARMAsmParser accept both syntaxes (both ", :" and ":"). I think it's
important to keep on accepting the old syntax, so assembly written using the
old syntax still get accepted. Most of the patch consists of changing test
cases to use the correct syntax + also adding a few tests to make sure the
old syntax still gets accepted.

The second patch, print_correct_alignment_specifier_syntax.patch, might be
slightly more controversial. This patch makes the ARMInstPrinter generate
the correct syntax (":") instead of the old incorrect syntax (", :"). This
means that assembly output produced by LLVM cannot be assembled by GNU as
older than 2.20 anymore, and also potentially with some versions of darwin
as. I'd assume that GNU as 2.20 has been released long enough ago that this
should be OK. Is there anyone who knows whether darwin as also accepts the
correct syntax now, and whether this change would be OK to make?
 
Thanks,

Kristof
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accept_correct_alignment_specifier_syntax.patch
Type: application/octet-stream
Size: 29760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130212/d336268e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: print_correct_alignment_specifier_syntax.patch
Type: application/octet-stream
Size: 114654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130212/d336268e/attachment-0001.obj>


More information about the llvm-commits mailing list