Why is arm64 built with -ffixed-r9 ?

Tom Rini trini at konsulko.com
Mon Aug 8 17:41:54 CEST 2022


On Mon, Aug 08, 2022 at 04:34:00PM +0200, Rasmus Villemoes wrote:

> Looking at one of the .o.cmd files, I noticed that we build arm64 with
> both -ffixed-r9 and -ffixed-x18. The latter is obviously what we use for
> gd, but the former doesn't seem to serve any purpose on arm64, and just
> seems to be an accident of the makefile fragment organization.
> 
> When I just remove -ffixed-r9 from arch/arm/config.mk, it builds and
> boots just fine (a real patch would of course do some ifndef
> CONFIG_ARM64 thing). The code does change, generally of the form "use x9
> instead of x10, x10 instead of x11" etc., i.e. the expected register
> allocation changes. But the total space saving from having that extra
> scratch reg is almost non-existing; a mere 44 bytes for u-boot proper;
> apparently aarch64 has plenty of scratch registers even if one is
> reserved-and-never-used.
> 
> Still, it's somewhat confusing, so if for some reason this is really
> needed in some cases (calling into some 32 bit firmware???), I'd like a
> comment somewhere.

I strongly suspect this is just a remnant of how the Makefile logic is,
and that since nothing failed with -ffixed-r9 it just kept being used.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220808/813bfbba/attachment.sig>


More information about the U-Boot mailing list