[m-rev.] diff: use global registers on aarch64

Julien Fischer jfischer at opturion.com
Wed Jan 13 20:34:06 AEDT 2021

Hi Zoltan,

On Wed, 13 Jan 2021, Zoltan Somogyi wrote:

> 2021-01-13 14:03 GMT+11:00 "Julien Fischer" <jfischer at opturion.com>:
>> The diff below is sufficient to allow Mercury to bootcheck in grade
>> reg.gc on my aarch64 Linux system.
> That's great.
> BTW, how did you *get* an aarch64 linux system?

I'm building it on my Chromebook for the moment, although the end game
here is to be able to run stuff on AWS's Graviton 2 based instances.

>> configure.ac:
>>      Compile with -fomit-frame-pointer on aarch64.
> I see no evidence of this in the diff to configure.ac.

@@ -2420,10 +2420,11 @@ case "$ac_cv_prog_gcc" in yes)
-        # The test for GCC labels goes into a loop on AArch64.
+            # The test for GCC labels goes into a loop on AArch64.
               MERCURY_MSG("gcc labels do not work on AArch64")
+            CFLAGS_FOR_REGS="-fno-omit-frame-pointer"

>> (Doing so, frees
>>      up register x29.)
> Nor do I see any reference to x29 in aarch64_regs.h.

It frees it up for use by GCC, we don't use it as a global register
variable.  It will be used to hold the frame pointer unless we compile
with -fno-omit-frame-pointer.

We could potentially use more global registers on aarch64 -- there are
plenty of callee-save registers available.  That said, I seem to recall
having more than handful not having much benefit when we experimented
with the x86_64 and powerpc ports.


More information about the reviews mailing list