Forum

ASM Sources!!!!!!!!!!!!!!!!!!!!!!

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

ASM Sources!!!!!!!!!!!!!!!!!!!!!!

Postby Stroggos » Thu Sep 10, 2009 7:28 am

How would I go about getting rid of these ASM source files in GLQuake
Stroggos
 
Posts: 50
Joined: Tue Apr 14, 2009 11:40 am
Location: Australia

Postby Spirit » Thu Sep 10, 2009 9:12 am

REWRITE THE CODE TO NOT USE ASM!!!!!!!!!!!!!!!!!!!!!!

edit: Heh, same number of exclamation marks. Must be the threshold of sanity there.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1031
Joined: Sat Nov 20, 2004 9:00 pm

Postby metlslime » Thu Sep 10, 2009 9:23 am

it's pretty easy -- there are about a dozen ASM functions in the glquake source. Of those, only about a third are necessary and they all have C replacements, another third have C replacements that are empty (i.e. not needed at all, they just set some flags on the CPU), and the last third are never actually called.

So you just use the C versions for the first category, and rip out the second and third categories entirely.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby Spike » Thu Sep 10, 2009 11:31 am

yeah, the assembler code is entirely optional.
its slightly faster, but tbh that's more because it has a better algorithm in a few places (its not 100% identical to the C code). Of course, that really only affects the sw renderer.
Just remove the files and then figure out how to enable the C versions of the functions.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: ASM Sources!!!!!!!!!!!!!!!!!!!!!!

Postby JasonX » Fri Jan 27, 2012 1:51 am

Sorry to bump this, but i'm trying to remove the .S files from my SDLQuake build and having no luck with. Does anyone know how to properly get rid of ASM files?
JasonX
 
Posts: 411
Joined: Tue Apr 21, 2009 2:08 pm

Re: ASM Sources!!!!!!!!!!!!!!!!!!!!!!

Postby Baker » Fri Jan 27, 2012 1:57 am

1. Remove the .s files from your project.

Find anything that says:

#if id386

or

#ifdef id386

And delete it the block of code through the #else or #endif. Or change those to #if conditions to #if 0 if you want to be conservative.

Find anything that is

#if !id386 or #ifndef id386 and change to #if 1

Make sure nonintel.c is not in your project.

That's the short version. And the short version will do want you want. You'll have unnecessary stuff loitering around that is harmless. Like empty functions that are shells for NOT setting floating precision for ASM and other remnants but it doesn't hurt anything.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: ASM Sources!!!!!!!!!!!!!!!!!!!!!!

Postby leileilol » Fri Jan 27, 2012 2:51 am

Baker wrote:That's the short version. And the short version will do want you want.


Or you could just turn off ASM by switching one little define in quakedef.h


i'd still use asm even if it's glquake - asm for sound mixing is still relevant
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: ASM Sources!!!!!!!!!!!!!!!!!!!!!!

Postby Baker » Fri Jan 27, 2012 3:16 am

leileilol wrote:
Baker wrote:That's the short version. And the short version will do want you want.


Or you could just turn off ASM by switching one little define in quakedef.h


i'd still use asm even if it's glquake - asm for sound mixing is still relevant


Sometimes the define is in the source and with some of projects it is in the compile arguments, depending on the source base. I kinda wanted to avoid discussing that so I avoided that. But yeah, true.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest