ARM GNU Assembler and conditional suffix/infix

View: New views
4 Messages — Rating Filter:   Alert me  

ARM GNU Assembler and conditional suffix/infix

by Kirill A. Shutemov-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

According to ARM Assembler Reference Manual conditional flags
should be placed after name of instruction, but GNU Assembler
doesn't accept instructions like 'ldrbge'. It wants 'ldrgeb'.

What's the point? 'b' is a part of instruction name, not a suffix.

Moreover 'objdump -d' generates 'ldrbge', which cannot be
processed by GNU Assembler.

// Kirill A. Shutemov

Re: ARM GNU Assembler and conditional suffix/infix

by Phil Blundell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-11-06 at 17:08 +0200, Kirill A. Shutemov wrote:
> Hello,
>
> According to ARM Assembler Reference Manual conditional flags
> should be placed after name of instruction, but GNU Assembler
> doesn't accept instructions like 'ldrbge'. It wants 'ldrgeb'.
>
> What's the point? 'b' is a part of instruction name, not a suffix.

This is a fairly recent policy change.  "ldrgeb" was originally the
canonical form but nowadays, as you say, ARM's position seems to be to
prefer condition codes as suffixes not infixes.  

GAS has never been 100% compatible with armasm's input syntax, and in
one sense this is just another such difference in assembly dialects, but
I guess patches to make GAS understand the new arrangement of suffixed
condition-codes would be welcome.  There'd need to be some mechanism for
retaining the old infix behaviour, of course, for compatibility with
existing source files and the output from GCC.

> Moreover 'objdump -d' generates 'ldrbge', which cannot be
> processed by GNU Assembler.

Again, I don't think this is a massive deal since the output from
"objdump -d" has never been suitable for feeding straight back into GAS.
But I agree it would be nice for them to be consistent.

p.



Re: ARM GNU Assembler and conditional suffix/infix

by Daniel Jacobowitz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 06, 2009 at 05:08:03PM +0200, Kirill A. Shutemov wrote:

> Hello,
>
> According to ARM Assembler Reference Manual conditional flags
> should be placed after name of instruction, but GNU Assembler
> doesn't accept instructions like 'ldrbge'. It wants 'ldrgeb'.
>
> What's the point? 'b' is a part of instruction name, not a suffix.
>
> Moreover 'objdump -d' generates 'ldrbge', which cannot be
> processed by GNU Assembler.

Please see the documentation of ".syntax unified".

--
Daniel Jacobowitz
CodeSourcery

Re: ARM GNU Assembler and conditional suffix/infix

by Kirill A. Shutemov-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 6, 2009 at 11:04 PM, Daniel Jacobowitz <drow@...> wrote:

> On Fri, Nov 06, 2009 at 05:08:03PM +0200, Kirill A. Shutemov wrote:
>> Hello,
>>
>> According to ARM Assembler Reference Manual conditional flags
>> should be placed after name of instruction, but GNU Assembler
>> doesn't accept instructions like 'ldrbge'. It wants 'ldrgeb'.
>>
>> What's the point? 'b' is a part of instruction name, not a suffix.
>>
>> Moreover 'objdump -d' generates 'ldrbge', which cannot be
>> processed by GNU Assembler.
>
> Please see the documentation of ".syntax unified".

Thanks. It works.