From 56e82a48448becfc39f8686cd26c3f31a30594a3 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 30 Jan 2013 14:08:28 -0500 Subject: Avoid compiler warning --- vec_double_sse2.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vec_double_sse2.h') diff --git a/vec_double_sse2.h b/vec_double_sse2.h index 9a09806..83ff66a 100644 --- a/vec_double_sse2.h +++ b/vec_double_sse2.h @@ -311,11 +311,13 @@ namespace vecmathlib { real_t operator[](int n) const { // return ((real_t const*)&v)[n]; + realvec x = *this; switch (n){ - case 0: return _mm_cvtsd_f64(v); - case 1: return _mm_cvtsd_f64(_mm_shuffle_pd(v, v, _MM_SHUFFLE2(0,1))); + case 0: /* do nothing */ break; + case 1: x = _mm_shuffle_pd(x.v, x.v, _MM_SHUFFLE2(0,1)); break; + default: assert(0); } - assert(0); + return _mm_cvtsd_f64(x.v); } realvec& set_elt(int n, real_t a) { return ((real_t*)&v)[n]=a, *this; } -- cgit v1.1