aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-29 03:51:46 -0700
committerChris Robinson <[email protected]>2011-09-29 03:51:46 -0700
commitb6b3ca6e6ffab6aa943c760be1290954190ae66e (patch)
treec5281372ec06e7995aa412266205b62d596d1b49 /Alc/ALu.c
parent53572da7de8d2cf22ed996dec4b992ca378f371c (diff)
Use inline assembly for fast float-to-int conversions
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index c02b0fdc..19683653 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -168,7 +168,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Step = maxstep<<FRACTIONBITS;
else
{
- ALSource->Params.Step = (ALint)(Pitch*FRACTIONONE);
+ ALSource->Params.Step = fastf2i(Pitch*FRACTIONONE);
if(ALSource->Params.Step == 0)
ALSource->Params.Step = 1;
}
@@ -683,7 +683,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Step = maxstep<<FRACTIONBITS;
else
{
- ALSource->Params.Step = (ALint)(Pitch*FRACTIONONE);
+ ALSource->Params.Step = fastf2i(Pitch*FRACTIONONE);
if(ALSource->Params.Step == 0)
ALSource->Params.Step = 1;
}
@@ -814,7 +814,7 @@ static __inline ALshort aluF2S(ALfloat val)
{
if(val > 1.0f) return 32767;
if(val < -1.0f) return -32768;
- return (ALint)(val*32767.0f);
+ return fastf2i(val*32767.0f);
}
static __inline ALushort aluF2US(ALfloat val)
{ return aluF2S(val)+32768; }