mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +00:00
don't let gcc automaticly inline functions but make gcc inline bigger
functions when told to. also make gcc warn if it can't inline a function. Explicitly inline several functions (including moving VectorNormalize to mathlib.h so it /can/ be) resulting in a 5.5% speedup for spam2 (88 to 92 fps)
This commit is contained in:
parent
b88d275994
commit
7ead5a91f8
12 changed files with 62 additions and 61 deletions
|
@ -41,6 +41,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
|||
#include <math.h>
|
||||
|
||||
#define IMPLEMENT_R_Cull
|
||||
#define IMPLEMENT_VectorNormalize
|
||||
|
||||
#include "QF/mathlib.h"
|
||||
#include "QF/qtypes.h"
|
||||
|
@ -439,25 +440,6 @@ _VectorLength (const vec3_t v)
|
|||
return length;
|
||||
}
|
||||
|
||||
float
|
||||
VectorNormalize (vec3_t v)
|
||||
{
|
||||
float length;
|
||||
|
||||
length = DotProduct (v, v);
|
||||
if (length) {
|
||||
float ilength;
|
||||
|
||||
length = sqrt (length);
|
||||
ilength = 1.0 / length;
|
||||
v[0] *= ilength;
|
||||
v[1] *= ilength;
|
||||
v[2] *= ilength;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
vec_t
|
||||
_VectorNormalize (vec3_t v)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue