gmp-discuss Digest, Vol 200, Issue 2

Simon Sobisch simonsobisch at gnu.org
Tue Mar 8 13:26:49 CET 2022


> Date: Tue, 08 Mar 2022 11:06:04 +0100
> From: Torbj?rn Granlund <tg at gmplib.org>
> To: Uwe Falck <uwe at falcknet.de>
> Cc: gmp-discuss at gmplib.org
> Subject: Re: Apple x18 on ARM
> Message-ID: <86cziwu5bn.fsf at shell.gmplib.org>
> Content-Type: text/plain; charset=utf-8
> 
> Uwe Falck <uwe at falcknet.de> writes:
> 
>    I don?t like your comment on Apple reserving x18 for platform purposes on the GMP home page.
> 
> That's unfortunate indeed.
> 
> But despite your disapproval here, I think we should inform our users
> about potential problems with GMP on specific platforms.
> 
>    The ARM ABI documentation
>    https://developer.arm.com/documentation/ihi0055/latest says very
>    clearly for several years
> 
> Your point being?
> 
>    Therefore I would prefer not to blame Apple for using x18 on ARM as you like as GMP developers.
> 
> "Blame"?
> 
> Man, there is no pleasing everybody.
> 

If read with some distance: this is a proposal about changing the text.

@Torbjörn Here's a suggested rewording:

--------
While we added support for Apple's Arm based computers, our support has 
a problem. The problem is that the [ARM 
ABI](https://developer.arm.com/documentation/ihi0055/latest) declares 
CPU register x18 as "platform specific, that should be avoided in 
hand-coded assembler", but GMP's mpn/arm64 assembly code uses that register.
While GMP runs fine in our tests, we expect things to go awry in some 
execution situation on any Arm-based computers. (Apple has not been kind 
enough to specify how they use x18. Therefore, we don't know what the 
consequences of using x18 might be.)
--------

@Uwe: that's no blaming, it just says that Apple wasn't kind enough to 
specify something - but I personally haven't checked if that's 
documented somewhere. Would you mind rechecking this and/or try to reach 
out to Apple about that?

Simon


More information about the gmp-discuss mailing list