Skip to content

Commit

Permalink
Renderers: sincosf asm replaced by std sinf and cosf calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 10, 2017
1 parent 7912112 commit 1077e04
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/Layers/xrRender/ParticleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,8 @@ IC void FillSprite_fpu(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const

__forceinline void fsincos(const float angle, float& sine, float& cosine)
{
__asm {
fld DWORD PTR [angle]
fsincos
mov eax , DWORD PTR [cosine]
fstp DWORD PTR [eax]
mov eax , DWORD PTR [sine]
fstp DWORD PTR [eax]
}
sine = std::sinf(angle);
cosine = std::cosf(angle);
}

IC void FillSprite(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const Fvector& pos, const Fvector2& lt,
Expand Down Expand Up @@ -472,12 +466,8 @@ void ParticleRenderStream(LPVOID lpvParams)
if (angle != *((DWORD*)&m.rot.x))
{
angle = *((DWORD*)&m.rot.x);
__asm {
fld DWORD PTR [angle]
fsincos
fstp DWORD PTR [cosa]
fstp DWORD PTR [sina]
}
sina = std::sinf(angle);
cosa = std::cosf(angle);
}

_mm_prefetch(64 + (char*)&particles[i + 1], _MM_HINT_NTA);
Expand Down

0 comments on commit 1077e04

Please sign in to comment.