[PATCH] fix alignment specifier syntax on Neon instructions

Jim Grosbach grosbach at apple.com
Tue Feb 12 14:34:15 PST 2013


Hi Kristof,

You're correct that the cctools Darwin 'as' does not accept the syntax sans-comma. Newer toolchains, however, rely on LLVM's integrated assembler as the system assembler on Darwin for both x86 and ARM.

Conceptually, I really like this change, as it's bringing the toolchain more into conformance with the published syntax. You're right that we need to tread carefully to make sure current users are not disrupted by the transition. I've added Bob and Evan for additional insight on that. I feel it'll be OK, as the proposed patch continues to accept the old syntax, but would like their buy-in before proceeding.

-Jim

On Feb 12, 2013, at 7:56 AM, Kristof Beyls <kristof.beyls at arm.com> wrote:

> 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<accept_correct_alignment_specifier_syntax.patch><print_correct_alignment_specifier_syntax.patch>




More information about the llvm-commits mailing list