PDA

View Full Version : x86 Assembly Language Considered Harmful


peterb
November 16th, 2007, 21:51
Please note that the recent changes to hq3x, which rely on x86 assembly language, break all non-intel platforms.

Can we decide now whether we are committed to breaking all non-Intel platforms, or whether we are going to make the effort to keep such changes appropriately isolated? That has major implications for the mac port going forward.

There's no reason not to use x86 assembler where it makes things faster. But we need to remember to provide non-assembly alternatives for other platforms.

Besides, I claim snarkily that a decent C compiler is going to write better assembler than any of us anyway.

I'll work on integrating the C-language alternatives to the x86 assembler this weekend. It would have been nice if this had gone into "dependencies", also, rather than being rolled into the project proper.

djrobx
November 16th, 2007, 22:50
"Recent" changes? The x86 assembler Hq3x and hq4x were not part of the Official VBA sources, but have always been a part of VBA-M. The only reason why the files have been touched lately is due to Nach's integration for the linux port.

There is also an ASM version of 2xSAI that was part of the official VBA sources, so some ASM code is already a part of this project.

The C versions for non-x86 should absolutely also be added but I simply haven't gotten to it yet. If you can do it that would be great! I suggest taking a look at the VBA-S source code. There is a "C" version in there. It should be easy to integrate.

The "c" version of HQ4X as compiled by MSVC runs much, much slower in my experience. I have to think Maxim wrote the asm versions for a reason. :)

The assembly core hq4x and 3x are not third party "dependencies" as they have been customized for this application. We definitely can and should could move all of the x86 specific stuff to a different folder, though.

mudlord
November 17th, 2007, 09:46
We definitely can and should could move all of the x86 specific stuff to a different folder, though.

Indeed. Also, IIRC, blargg and byuu made a optimized C version of HQ2X that is quite zippy. That could be useful for the Mac port.

Dax
November 28th, 2007, 21:31
That has major implications for the mac port going forward.

Macs use Intel processors now, so I don't see how it's an issue, unless you wanted to include PowerPC support(blech.). :o

mudlord
November 28th, 2007, 23:28
Macs use Intel processors now, so I don't see how it's an issue, unless you wanted to include PowerPC support(blech.). :o

I'd have to agree, but still there should be a option to use C/C++ versions if people ever desire such a thing...:yawn:

Dax
December 1st, 2007, 08:02
I guess it would be useful to have both in the end, since PowerPC consoles *cough*360 and PS3*cough* could be very useful for emulators, once chippers figure out how to run Linux with full capabilities on these systems.