From 3e816de4fb3f8be4746643f5b9c5c07186e16b6c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 18 Mar 2019 20:58:48 -0700 Subject: Use SSE intrinsics in a few more places --- Alc/effects/pshifter.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Alc/effects') diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp index c76cd6a8..aa7dae87 100644 --- a/Alc/effects/pshifter.cpp +++ b/Alc/effects/pshifter.cpp @@ -20,6 +20,10 @@ #include "config.h" +#ifdef HAVE_SSE_INTRINSICS +#include +#endif + #include #include #include @@ -48,8 +52,12 @@ using complex_d = std::complex; inline int double2int(double d) { -#if ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \ - !defined(__SSE2_MATH__)) || (defined(_MSC_VER) && defined(_M_IX86_FP) && _M_IX86_FP < 2) +#if defined(HAVE_SSE_INTRINSICS) + return _mm_cvttsd_si32(_mm_set_sd(d)); + +#elif ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \ + !defined(__SSE2_MATH__)) || (defined(_MSC_VER) && defined(_M_IX86_FP) && _M_IX86_FP < 2) + int sign, shift; int64_t mant; union { -- cgit v1.2.3