aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/imports.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/imports.h')
-rw-r--r--mesalib/src/mesa/main/imports.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h
index af780b249..09e55ebf0 100644
--- a/mesalib/src/mesa/main/imports.h
+++ b/mesalib/src/mesa/main/imports.h
@@ -274,10 +274,12 @@ static inline int IROUND_POS(float f)
return (int) (f + 0.5F);
}
+#ifdef __x86_64__
+# include <xmmintrin.h>
+#endif
/**
* Convert float to int using a fast method. The rounding mode may vary.
- * XXX We could use an x86-64/SSE2 version here.
*/
static inline int F_TO_I(float f)
{
@@ -292,6 +294,8 @@ static inline int F_TO_I(float f)
fistp r
}
return r;
+#elif defined(__x86_64__)
+ return _mm_cvt_ss2si(_mm_load_ss(&f));
#else
return IROUND(f);
#endif