[LLVMdev] question on assembler for systemz backend

bagel bagel99 at gmail.com
Sun Jan 30 11:59:11 PST 2011


Hi Anton,

On 01/30/2011 12:44 PM, Anton Korobeynikov wrote:
> Hello
>
>> I am trying to assemble the output of the SystemZ backend with the GNU
>> binutils assembler (build with --target=s390x-linux).  I get errors when
>> assembling instructions with literals that are negatives.  For example,
>> the test case test/CodeGen/SystemZ/01-RetImm.ll gives errors:
> There are different instruction sets for z/System. Basically, you have
> to provide proper -march / -mcpu to assembler, otherwise the very old
> ISA is assumed.
> I don't recall offhand, but you need to provide either z990 or z9-109,
> because LLVM assumes that long displacements and ext imm stuff is
> available (this is rather fair assumption).
>

I have tried:
   s390x-as -m64 -march=z900
   s390x-as -m64 -march=z990
   s390x-as -m64 -march=z9-109
All give the same error messages.  This is with binutils-2.20.51.

>>         llill   %r2, -1<<<  why -1
> Because it sets lowest (ll) 16 bit word of 64 bits.

The way I read the gas code for s390, "llill" expects the second operand 
to be unsigned, and the parsed expression is cast to unsigned before the 
range check.  This does not appear to be -march dependent.

>
>> Why are negative literals being generated.
> Because of z/Systems ISA :)
>

I'd still like to know if anyone has sucessfully assembled SystemZ 
generated assembly language with a binutils assembler, and if so, how.

regards,
bagel



More information about the llvm-dev mailing list