Patch to enable build on s390x

Andreas Krebbel krebbel at linux.vnet.ibm.com
Fri Sep 16 09:06:35 CEST 2011


Hi Torbjorn,

I would like to rework the patch to get it integrated.  I haven't been subscribed to the
mailing list until now so I missed most of the questions.

Regarding the questions from the mailthread:

> Do these systems support a 32-bit ABI?  If they do, the compiler
> should have an option controlling ABI.  Please try it, using something
> trivial like hello.c.

Yes. The toolchain for System z supports 2 differents ABIs:
-m31 for 32 bit GPRs, 31 bit addressing - s390 <-- machine id (uname -r)
-m64 for 64 bit GPRs, 64 bit addressing - s390x

> What 64-bit multiply support do these system provide?  The 32-bit s390
> systems have a signed 32x32->64 bit multiply.  GMP really needs a
> 64x64->128 bit multiply, preferably unsigned, to support the s390x
> well.

s390x has unsigned 64x64 -> 128 integer multiplication in a reg, reg and a reg, mem
variant. The instructions are mlgr and mlg.

> Which compiler predefines are defined in 64-bit mode?  If there is an
> 32-bit ABI, what symbols are predefined when that ABI is chosen?

With -m31 the __s390__ is defined by the compiler. For 64 bit __s390__ AND __s390x__ is
defined.

-Andreas-


More information about the gmp-bugs mailing list