summaryrefslogtreecommitdiffstats
path: root/vec_double_sse2.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-01-30 14:08:28 -0500
committerErik Schnetter <schnetter@gmail.com>2013-01-30 14:08:28 -0500
commit56e82a48448becfc39f8686cd26c3f31a30594a3 (patch)
treee11c2af5c4d957b03c24b5227eb7d16704804a57 /vec_double_sse2.h
parent4377afc41abd3b5ab156d7dd69a27788a90125a3 (diff)
downloadvecmathlib-56e82a48448becfc39f8686cd26c3f31a30594a3.zip
vecmathlib-56e82a48448becfc39f8686cd26c3f31a30594a3.tar.gz
Avoid compiler warning
Diffstat (limited to 'vec_double_sse2.h')
-rw-r--r--vec_double_sse2.h8
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; }
OpenPOWER on IntegriCloud