mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 22:51:39 +00:00
SSE2 version of wrap
This commit is contained in:
parent
3269b61ffc
commit
43139276d1
1 changed files with 4 additions and 2 deletions
|
@ -346,8 +346,10 @@ static float wrap(float value)
|
|||
#else
|
||||
static float wrap(float value)
|
||||
{
|
||||
__m128 mvalue = _mm_set_ss(value);
|
||||
return _mm_cvtss_f32(_mm_sub_ss(mvalue, _mm_floor_ss(_mm_setzero_ps(), mvalue)));
|
||||
__m128 f = _mm_set_ss(value);
|
||||
__m128 t = _mm_cvtepi32_ps(_mm_cvttps_epi32(f));
|
||||
__m128 r = _mm_sub_ps(t, _mm_and_ps(_mm_cmplt_ps(f, t), _mm_set_ss(1.0f)));
|
||||
return _mm_cvtss_f32(_mm_sub_ss(f, r));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue