JIT and futures on aarch64

38 views
Skip to first unread message

Dominik Pantůček

unread,
May 16, 2020, 11:21:35 AM5/16/20
to Racket Users
Hello fellow racketeers,

after pushing futures on x86 and x86_64 to their limits (and helping
fixing two bugs), I turned my focus on ARM. Apparently everything should
work with 32bit arm without any hurdles (I am going to test that later
today), however on aarch64 (64bit arm), there is no JIT and therefore no
futures.

A quick look at the implementation hints that being stuck with forked
GNU Lightning 1.2 is the major problem here. Apparently latest versions
of Lightning support aarch64.

I am willing to invest some time into porting that, but the question is
how much work is needed. Also - is it relevant for CS variant? (I would
guess not). And of course, how to do the actual porting - it seems to me
the Racket's port is more than just a few minor changes. Maybe porting
only the aarch64 part might be a reasonable way to go?

Any suggestions would be really appreciated.


Cheers,
Dominik

Matthew Flatt

unread,
May 16, 2020, 12:15:08 PM5/16/20
to Dominik Pantůček, Racket Users
At Sat, 16 May 2020 17:21:28 +0200, Dominik Pantůček wrote:
> after pushing futures on x86 and x86_64 to their limits (and helping
> fixing two bugs), I turned my focus on ARM. Apparently everything should
> work with 32bit arm without any hurdles (I am going to test that later
> today),

Futures and places are not currently supported on ARM for Racket BC.
I'm not sure how much effort it will be to support, because I'm unclear
on how much the current implementation relies on TSO --- but I suspect
that it's some, and that write fences are be needed in some places.

> Apparently latest versions
> of Lightning support aarch64.
>
> I am willing to invest some time into porting that, but the question is
> how much work is needed.

It will not be easy.

> Also - is it relevant for CS variant? (I would
> guess not).

You're right: support for 64-bit ARM on Racket CS is completely
separate. Jesse Alama and Paulo Matos are working on that:

https://groups.google.com/forum/#!msg/racket-dev/TaU3S0GZZbo/jtPD4IVTBwAJ

> And of course, how to do the actual porting - it seems to me
> the Racket's port is more than just a few minor changes. Maybe porting
> only the aarch64 part might be a reasonable way to go?

Yes, probably.

Before doing anything, I recommend investigating whether Racket CS is
more the right long-term choice. I think it is, although it has the
same immediate obstacles: no threaded configurations for ARM (just a
configuration issue or deeper?) and no 64-bit ARM. There's potentially
also the extra obstacle that we have not yet put as much effort into
futures for CS, yet, but my experience has been that catching up CS is
easier than improving Racket BC. Also, Chez Scheme doesn't yet unbox
floating-point arithmetic, which may or may not be relevant for your
purposes, but that's next on my list.


Matthew

Reply all
Reply to author
Forward
0 new messages