mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3
[mesa.git] / src / mesa / main / imports.h
index af780b2498f02bc1322d663f26d2c3be16ef927c..09e55ebf0ff7eeb3a4aee5c0dc28df9caa4bf911 100644 (file)
@@ -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