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
Anton Korobeynikov
2011-Jan-30 20:09 UTC
[LLVMdev] question on assembler for systemz backend
> I'd still like to know if anyone has sucessfully assembled SystemZ generated > assembly language with a binutils assembler, and if so, how.Almost all testsuite passed ~ 1.5 years ago (with clang + gas). I doubt anyone tried to assembler anything else after that time. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
On 01/30/2011 02:09 PM, Anton Korobeynikov wrote:>> I'd still like to know if anyone has sucessfully assembled SystemZ generated >> assembly language with a binutils assembler, and if so, how. > Almost all testsuite passed ~ 1.5 years ago (with clang + gas). I > doubt anyone tried to assembler anything else after that time. >Lots of things have changed in 1.5 years with respect to assembly output, so I guess it got broken. I'll file a bug report, but it appears that no one uses this backend, so I suspect it won't get fixed very soon. Too bad, it is possible to run SystemZ code via the simulator "hercules". I had hoped to do some testing that way. regards, bagel
Reasonably Related Threads
- [LLVMdev] question on assembler for systemz backend
- [LLVMdev] question on assembler for systemz backend
- [LLVMdev] question on assembler for systemz backend
- [LLVMdev] question on assembler for systemz backend
- [LLVMdev] [RFC/PATCH][1/4] New SystemZ backend: LLVM code changes