diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-01-30 14:08:28 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-01-30 14:08:28 -0500 |
commit | 56e82a48448becfc39f8686cd26c3f31a30594a3 (patch) | |
tree | e11c2af5c4d957b03c24b5227eb7d16704804a57 | |
parent | 4377afc41abd3b5ab156d7dd69a27788a90125a3 (diff) | |
download | vecmathlib-56e82a48448becfc39f8686cd26c3f31a30594a3.zip vecmathlib-56e82a48448becfc39f8686cd26c3f31a30594a3.tar.gz |
Avoid compiler warning
-rw-r--r-- | vec_double_sse2.h | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |