[LLVMdev] ARM thumb-2 instruction used for non-thumb2 CPUs

Jim Grosbach
Wed, 22 Jun 2011 16:15:58 -0000

On Jun 22, 2011, at 9:00 AM, Renato Golin wrote:

> On 22 June 2011 16:50, Jim Grosbach <grosbach at apple.com> wrote:
>>> This sounds like a dead end as newer binutils are GPLv3.
>>
>> Yeah, that's definitely a very real concern and a big motivation to
get the MC based asm parser whipped into usable shape. We're much more in
control of our own destiny then.
>
> So, how do we solve the problem until then?

In general, it's a tricky thing. If it were only a few instructions, we
could just switch to the older mnemonic as a special case w/ a FIXME saying that
we should change it when newer assemblers become available on FreeBSD.
That's unfortunately not really the case, though. For example, all of the
VFP instructions use newer mnemonics, and the predicated condition code setting
arithmetic instructions have changed the order of the 's' and
'cc' suffices (e.g., addseq vs. addeqs).

I suspect we'll care about all of them, as we're wanting to handle
userspace apps, not just kernel code, here, right? This is the system assembler
that's too old.

If so, the best answer is to teach the assembler the new mnemonics. To help with
that, the majority of the work for v7 was released under GPLv2, even though it
didn't make it into an official binutils release until post-v3 changeover.
There are GPLv2 CodeSourcery drops which contain v7 support, for example,
including binutils support for unified syntax. While there are some bugs (Anton
can probably give more details), they do generally work and would likely provide
a good starting point so that the support wouldn't have to be done from
scratch.

-Jim