PATCH: Additional Thumb instructions for ARMv6K

Richard Earnshaw rearnsha@gcc.gnu.org
Wed Mar 9 11:43:00 GMT 2005


On Wed, 2005-03-09 at 01:19, Zack Weinberg wrote:
> ARMv6K adds five new Thumb instructions.  This patch adds assembler
> support for them.
> 
> The only possibly problematic part of this patch is the NOP changes.
> One of the new instructions is a preferred opcode for NOP (which has
> historically been done with "mov r8,r8"); I changed both what you get
> if you explicitly write "nop" and the opcode used for alignment in
> code sections, when (cpu_variant & ARM_EXT_V6K).  This *might* cause
> problems for existing code.  Please advise.

Hmm, I think we've got a problem here.  Gas is normally configured to
default to the pseudo CPU 'all' which permits instructions from any
architecture.  That means that unless the user has explicitly set a cpu
(or gcc has done it for you) then the new nop will match rather than the
old (because of the way the selection logic works as a bit-field and
mask).

I'm not sure that's desirable because it might break existing code that
did not expect to have to supply a CPU option.  

[You probably won't have noticed this because the basic thumb
instruction set test in gas isn't a dump test -- probably something else
that should be fixed.  In fact, I think all the thumb tests in gas use
an explicit -mcpu= argument.]

However, we might have to break the -mcpu=all assumption anyway when we
come to adding build attributes for the EABI; we don't want to end up
marking all objects as requiring an ARMv6 (or higher) core simply
because the user didn't set something explicitly on the command line. 

One partial solution is to pick some architecture (<ARMv6K) and to make
'all' mean anything up to that architecture -- anything after that must
supply a command-line flag (and we should add some configury magic to
permit selecting a specific cpu as the default).  We could do this and
at the same time deprecate 'all' so that it could be ultimately removed.

I'm open to other suggestions as well.

The changes other than the NOP work are OK to install (if they can
feasibly be separated out).

R.



More information about the Binutils mailing list