Skip to content

Commit

Permalink
Implement trunc for SSE2
Browse files Browse the repository at this point in the history
  • Loading branch information
FigBug committed Feb 22, 2024
1 parent 70e2ca0 commit 828e2fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/gin_simd/mipp/mipp_impl_SSE.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -3557,6 +3557,16 @@
inline reg trunc<double>(const reg v) {
return _mm_castpd_ps(_mm_round_pd(_mm_castps_pd(v), _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC));
}
#elif __SSE2__
template <>
inline reg trunc<float>(const reg v) {
return _mm_cvtepi32_ps (_mm_cvttps_epi32 (v));
}

template <>
inline reg trunc<float>(const reg v) {
return _mm_cvtepi32_pd (_mm_cvttpd_epi32 (v));
}
#endif

// ------------------------------------------------------------------------------------------------------------ cvt
Expand Down

0 comments on commit 828e2fd

Please sign in to comment.