[Speex-dev] SSE2 code won't compile in VC

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Sun Nov 30 16:49:07 PST 2008


Hi John,

Thanks for the patch. It's applied in git now.

Cheers,

	Jean-Marc

John Ridges a écrit :
> Jean-Marc,
> 
> At least VS2005 (what I'm using) won't compile resample_sse.h with 
> _USE_SSE2 defined because it refuses to cast __m128 to __m128d and vice 
> versa. While there are intrinsics to do the casts, I thought it would be 
> simpler to just use an intrinsic that accomplishes the same thing 
> without all the casting. Thanks,
> 
> --John
> 
> 
> @@ -91,7 +91,7 @@ static inline double inner_product_double(const float 
> *a, const float *b, unsign
>        sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
>        sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
>     }
> -   sum = _mm_add_sd(sum, (__m128d) _mm_movehl_ps((__m128) sum, (__m128) 
> sum));
> +   sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
>     _mm_store_sd(&ret, sum);
>     return ret;
>  }
> @@ -120,7 +120,7 @@ static inline double 
> interpolate_product_double(const float *a, const float *b,
>    sum1 = _mm_mul_pd(f1, sum1);
>    sum2 = _mm_mul_pd(f2, sum2);
>    sum = _mm_add_pd(sum1, sum2);
> -  sum = _mm_add_sd(sum, (__m128d) _mm_movehl_ps((__m128) sum, (__m128) 
> sum));
> +  sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
>    _mm_store_sd(&ret, sum);
>    return ret;
>  }
> 
> 
> 
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
> 
> 


More information about the Speex-dev mailing list