File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1262,11 +1262,16 @@ inline int Floor2Int( float a )
12621262{
12631263 int RetVal;
12641264#if defined( PLATFORM_INTEL )
1265+ // Valve original
1266+ #if 0
12651267 // Convert to int and back, compare, subtract one if too big
12661268 __m128 a128 = _mm_set_ss(a);
12671269 RetVal = _mm_cvtss_si32(a128);
12681270 __m128 rounded128 = _mm_cvt_si2ss(_mm_setzero_ps(), RetVal);
12691271 RetVal -= _mm_comigt_ss( rounded128, a128 );
1272+ #else
1273+ RetVal = _mm_cvt_ss2si (_mm_set_ss (a + a - 0 .5f )) >> 1 ;
1274+ #endif
12701275#else
12711276 RetVal = static_cast <int >( floor (a) );
12721277#endif
@@ -1319,11 +1324,16 @@ inline int Ceil2Int( float a )
13191324{
13201325 int RetVal;
13211326#if defined( PLATFORM_INTEL )
1327+ // Valve original
1328+ #if 0
13221329 // Convert to int and back, compare, add one if too small
13231330 __m128 a128 = _mm_load_ss(&a);
13241331 RetVal = _mm_cvtss_si32(a128);
13251332 __m128 rounded128 = _mm_cvt_si2ss(_mm_setzero_ps(), RetVal);
13261333 RetVal += _mm_comilt_ss( rounded128, a128 );
1334+ #else
1335+ RetVal = -(_mm_cvt_ss2si (_mm_set_ss (-0 .5f - (a + a))) >> 1 );
1336+ #endif
13271337#else
13281338 RetVal = static_cast <int >( ceil (a) );
13291339#endif
You can’t perform that action at this time.
0 commit comments