[LLVMdev] Sparc assembly syntax

Nathan Keynes Nathan.Keynes at Sun.COM
Sun Aug 3 04:40:43 PDT 2008


On 01/08/2008, at 3:18 AM, Chris Lattner wrote:

>
> On Jul 31, 2008, at 9:57 AM, Dale Johannesen wrote:
>
>>
>> On Jul 31, 2008, at 4:52 AMPDT, Richard Pennington wrote:
>>
>>> Any code that I generate for the Sparc fails at assembly time  
>>> using a
>>> gas assembler built for the Sparc.
>>>
>>> I get code like the following from the code generator:
>>>
>>>       save -96, %o6, %o6
>>>
>>> and get a syntax error on the save instruction.
>>>
>>> I think sparc syntax should be:
>>>
>>> main:
>>>       save %o6, -96, %o6
>>>
>>> Is that correct? Should I file a bug report?
>>
>>        save %o6, -96, %o6
>>
>> is the usual syntax for Sparc assemblers.  But this instruction is so
>> fundamental nothing could ever have worked if it's broken, so there
>> may be something deeper going on.
>
> This is probably a difference between the sun and GNU assemblers.
> There is no current sparc maintainer, so feel free to change it if one
> way works better for you.

Pretty much yes, Sun as will accept either form (with the same  
meaning), but GNU gas will only accept 'save %o6, -96, %o6'.

Cheers,
Nathan



More information about the llvm-dev mailing list