Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

PPC32 support #144

Open
rc-matthew-l-weber opened this issue Nov 6, 2019 · 5 comments
Open

PPC32 support #144

rc-matthew-l-weber opened this issue Nov 6, 2019 · 5 comments

Comments

@rc-matthew-l-weber
Copy link

I've got a older system with would like to run nodejs. I've captured this ticket upstream but have a feeling I may need to start with this fork?

nodejs/node#30323

@richardlau
Copy link

The PPC code in this fork is no longer maintained as it was all merged back upstream years ago and development continues in the upstream repositories. (This fork remains for unmerged platforms such as z/OS.)

Copying from nodejs/node#30323 (comment):

The IBM fork of Node.js for PPC was merged into this repository years ago (around Node.js 4) but only 64-bit was supported. IBM did build 32-bit PPC binaries for a while but I don't think we supported Power5 and we definitely had reports that the fork didn't work on e500 (#67).

@andrewlow
Copy link
Collaborator

The challenge isn't really about 32/64 bit - but the fact that many of the PPC flavours (e500 for example) have a radically different set of instructions for floating point support.

Node.js is deeply dependent on floating point instructions, and thus - is totally broken when you don't have them (or have the same ones we assumed in the PPC code base).

@rc-matthew-l-weber
Copy link
Author

Ok. I'm willing to figure out the backend rewrites/additions for my flavour, any pointers or archtectures I could trace through the system looking at this problem? Right now my issue is a padding assertion bug I note in my other ticket referenced above. Trying to use PPC as my arch (32bit build)

@john-yan
Copy link
Collaborator

john-yan commented Nov 7, 2019

All ppc related code is mostly under ppc directories. You can find them by “find src -name ppc”. As said 32 bit ppc is not supported anymore so any assumption could be false which leads to assertion failures.

@andrewlow
Copy link
Collaborator

It's been a while since I was hacking on this code base. First off this issue is against the node repo, and most of the PPC specifics are going to be in the v8 implementation - which is in a different repository.

The PPC work was done here: https://github.com/ibmruntimes/v8ppc - but has since been merged into the main google code base https://github.com/v8/v8

You'll find the implementation here: https://github.com/v8/v8/tree/master/src/codegen/ppc and unless you're pretty well versed in compiler construction and PowerPC assembly, you've probably taken on a much bigger project than you think.

I still see at least some references to 32bit code https://github.com/v8/v8/blob/master/src/codegen/ppc/assembler-ppc.cc#L335 -- which is good-ish news.

If I haven't scared you off yet -- then I'd suggest you start here: https://github.com/v8/v8/blob/4b9b23521e6fd42373ebbcb20ebe03bf445494f9/src/ppc/simulator-ppc.cc in the simulator code -- and from there, make the changes to remove/re-implement the 64bit specific bits in here - to the CPU you are targeting.

Based on what you change, do some search / replaces for other bits of code that refer to what you removed.

Having a good simulator will be a huge step towards getting close to working on real hardware. Once you are close enough - start debugging on real hardware -- fix bugs in the simulator so it crashes just like the real hardware, then fix the code to not crash on the simulator.

Eventually - you'll have both working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants