Porting SpiderMonkey to LoongArch64

Hi,

I’m from Loongson Technology (R & D CPU), and we have developed a new RISC ISA named LoongArch. We want to add loongarch64 support in SpiderMonkey.

Now we have ported spidermonkey v97 to Linux/LoongArch64 platform, without wasm-simd support. Now loongarch64 port can pass almost all jit-test and jstests, except that jit-test ion/bug1433496.js will crash due to lack of spectre-mitigations support.
This is the optimized debug build loong64-simulator tests result:

And after my cleanup work, I will try to submit the patch to mozilla-central repo.
Now I have filed a meta bug to keep track of LoongArch64’s porting work, welcome to cc, and any advice is appreciated!

Thanks!
Zhao Jiazhong

5 Likes

Very exciting, thank you for sharing!

Very good news! Thank your for upstreaming.

@codehag @lazyparser Thanks for reply!
And I have submitted the full patch to phabricator at D134285, welcome to review!

I think we’re going to have to have an internal discussion about whether/how to accept a new architecture into the tree, as this is a fairly big deal - it affects everyone. That discussion probably won’t happen until the new year, as people are away now. After that, we’re also going to have to assign reviewers for the various parts of the tree. I see we have a scheduled team meeting on Jan 12, so if we don’t get to it before then we could at least discuss it at that meeting.

In the mean time, as time allows, it would be good if you could update the patch occasionally so that it is current with the tree and passes tests.

–lars

Ok, I will keep update the patch, hope to have good news.

And happy holidays!

Now we have ported spidermonkey v97 to Linux/LoongArch64 platform, without wasm-simd support. Now loongarch64 port can pass almost all jit-test and jstests, except that jit-test ion/bug1433496.js will crash due to lack of spectre-mitigations support.

Hi my name is Oliver Propst and well I have been involved with the Mozilla community for quite some time (specially in Sweden). Now I must state that the project of your research group seems very interesting indeed and I really wish the team the best of luck with the effort going forward :slight_smile:

Hi Oliver,

Thanks for your blessing! We think Firefox and SpiderMonkey are brilliant, so we want to port them to our platform. And I would like to be more involved in the Mozilla community work in the future just like you :smile:.

Best wishes!

2 Likes

Hi Zhao. I hope sincerely hope that you are doing fine (should not complain to much myself). Now I must state that I would be very curious to know how your work and efforts with regards to porting SpiderMonkey LoongArch64 is going. So it would be reailly cool to see an update with regards to potential progress

I’m sure that I’m not the only community member who would be interested with an update about the progress (because I again think that your efforts is an super interesting project which I’m sure the Mozilla and tech community could benefit from. :slight_smile:

Kind wishes.

1 Like

Right so I just noticed that some activity in Phabricator with regards to the bug. So I guess if we are being lucky SpiderMonkey will soon have LoongArch64 support.
That being said if you @Zhao_Jiazhong still have something that feel welcome to do so :slight_smile:.

I do think regardless that the Mozilla and tech Community should be very greatful for your work and efforts with regards to the work you have done so far :slight_smile:

*which I again think is very interesting to say the least.

Hi Oliver,

Thanks for your concern! :grinning:

Thankfully, the SpiderMonkey team has agreed to accept LoongArch64 port last week. And now the patch is under review, I think it would be landed in the near future. I will update this thread after the patch is landed. :slightly_smiling_face:

Thanks for all the concern and support from the Mozilla and community members!

Best wishes!

Now the LoongArch64 backend has landed in SpiderMonkey, see D134285.

Again, thanks for everyone’s help and support! Best wishes! :grinning: