Status of Assembly?

Discussion of development and patch submission.
Post Reply
Danfun64
Posts: 2
Joined: Mon 18 Dec, 2017 9:39 pm

Status of Assembly?

Post by Danfun64 » Wed 20 Dec, 2017 12:48 am

I'm curious as to how much assembly code is left in PCem, especially how much is necessary to even run this software. Mainly because I was hoping you could replace it all so it can run on other architectures like ARM. Can any of you say how much assembly remains in PCem?

User avatar
leilei
Posts: 599
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Status of Assembly?

Post by leilei » Wed 20 Dec, 2017 1:45 am

It's only in the recompilers. The immediate issue is only really in that references to the recompilers are still there after disabling them, so interpreter-only builds aren't possible for the time being (but could be with a bunch more ifdefs)

Also if it's the Pi you're thinking of, don't expect much optimism on a platform whose popular operating system had recently regressed its video driver and can't run glxgears past 30fps anymore, and an ARM recompiler would be necessary to make that work well anyway, along with a EGL or OMX backend to get around the VC4 driver's GL incapabilities. Be aware that the popular console emulators on Pi (which make up its secondhand marketing for gamer appeal) were already optimized years prior for the GP2X and other ARM devices.

Not a fan of the general "replace/remove all assembly" mindset of the GNU world especially when it comes to emulators. Gutting the recompilers for their ideal "clean and portable" codebase under the pressure of a vocal minority would make it another Bochs. That's what this thread seems to come across as for me anyway

See also: this thread

User avatar
Chilly Willy
Posts: 16
Joined: Tue 12 Dec, 2017 1:16 am
Contact:

Re: Status of Assembly?

Post by Chilly Willy » Wed 20 Dec, 2017 3:24 am

Removing ASM code from any app would be a horrible idea. ASM helps a lot with performance. If one wants to compile on multiple operating system, then check for the OS version used at compile time. You can write code for multiple operating systems and only compile the code that is needed by doing a simple OS check in your code. You can even have an OS check for different operating systems to use the code that is supported by that OS. Works very good for keeping support on older operating systems. Anyways, never remove ASM code. It's the base/foundation for all programming languages. ;)

User avatar
omarsis81
Posts: 636
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Status of Assembly?

Post by omarsis81 » Wed 20 Dec, 2017 3:41 am

You might find some answers here viewtopic.php?f=3&t=495

Danfun64
Posts: 2
Joined: Mon 18 Dec, 2017 9:39 pm

Re: Status of Assembly?

Post by Danfun64 » Wed 20 Dec, 2017 3:59 am

Well, I imagine that the assembly code could be kept as long as it was completely optional/not necessary to run the program period...

Hypothetically speaking of course...

edit: I already saw that thread, and ironically the OP was advocating for more assembly. Also there wasn't any indication that it would have been made optional.

User avatar
SarahWalker
Site Admin
Posts: 1588
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Status of Assembly?

Post by SarahWalker » Wed 20 Dec, 2017 9:21 am

You could probably hack the emulator to remove any references to any of the recompilers, which _might_ get it running on ARM (assuming there aren't any other issues there). Performance would be absolutely dreadful though.

One of my aims with the new recompiler is to make is easier to port to other architectures, and an ARM port is definitely on my list. You're unlikely to see anything of this until towards the end of next year I'm afraid.

A. Naim
Posts: 103
Joined: Thu 09 Jul, 2015 5:06 pm

Re: Status of Assembly?

Post by A. Naim » Wed 20 Dec, 2017 6:25 pm

I like the general idea of WebASM, but think it's too tied to the ideas and needs of webpages.

If there was some sort of generic, retargetable ASM that could be optimized per-platform that was aimed at speed first... But I don't know enough about ASM to say how feasible it is.

Certainly, it would be feasible for some purposes.

User avatar
SarahWalker
Site Admin
Posts: 1588
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Status of Assembly?

Post by SarahWalker » Thu 21 Dec, 2017 10:04 am

Not feasible for PCem's purposes I'm afraid. PCem needs to generate object code directly for the host CPU on the fly for performance reasons.

A. Naim
Posts: 103
Joined: Thu 09 Jul, 2015 5:06 pm

Re: Status of Assembly?

Post by A. Naim » Thu 21 Dec, 2017 7:59 pm

SarahWalker wrote:Not feasible for PCem's purposes I'm afraid. PCem needs to generate object code directly for the host CPU on the fly for performance reasons.
Good to know.

Post Reply