aboutsummaryrefslogtreecommitdiff
path: root/celt/float_cast.h
diff options
context:
space:
mode:
authorFelicia Lim <flim@google.com>2017-07-05 17:36:56 -0700
committerFelicia Lim <flim@google.com>2017-07-07 09:42:55 -0700
commit0c2090c324e4f2ba2a8621c8b083559bab74c7c5 (patch)
treefea1ab0038bc4102569d1ab4ee57a0f973895570 /celt/float_cast.h
parenta7703b70699299f078a189e19b6915120cded732 (diff)
downloadlibopus-0c2090c324e4f2ba2a8621c8b083559bab74c7c5.tar.gz
Change-Id: I551f1de5c5e121ac1275334e67c7e0f96ab18114 Test: - verified builds for arm*/mips*/x86* - checked functionality using an emulator and stagefright
Diffstat (limited to 'celt/float_cast.h')
-rw-r--r--celt/float_cast.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/celt/float_cast.h b/celt/float_cast.h
index ed5a39b5..98b40abc 100644
--- a/celt/float_cast.h
+++ b/celt/float_cast.h
@@ -61,7 +61,13 @@
** the config.h file.
*/
-#if (HAVE_LRINTF)
+/* With GCC, when SSE is available, the fastest conversion is cvtss2si. */
+#if defined(__GNUC__) && defined(__SSE__)
+
+#include <xmmintrin.h>
+static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_ss(x));}
+
+#elif defined(HAVE_LRINTF)
/* These defines enable functionality introduced with the 1999 ISO C
** standard. They must be defined before the inclusion of math.h to