[LLVMdev] question on assembler for systemz backend

Anton Korobeynikov anton at korobeynikov.info
Sun Jan 30 10:44:45 PST 2011


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).

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

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

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-dev mailing list