diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-06-06 11:25:28 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-06-06 11:25:28 -0400 |
commit | ce8ddcf9432f3829364e4dafebb810683264e980 (patch) | |
tree | 34666abc9b4a57dd8aa12063cde27a48ac8bc394 /vec_double_vsx.h | |
parent | 059030503652d508c62ce95d067f16c9c2a240fd (diff) | |
download | vecmathlib-ce8ddcf9432f3829364e4dafebb810683264e980.zip vecmathlib-ce8ddcf9432f3829364e4dafebb810683264e980.tar.gz |
Optimize scalarized shift operations
Diffstat (limited to 'vec_double_vsx.h')
-rw-r--r-- | vec_double_vsx.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vec_double_vsx.h b/vec_double_vsx.h index d940408..08ce5af 100644 --- a/vec_double_vsx.h +++ b/vec_double_vsx.h @@ -282,27 +282,27 @@ namespace vecmathlib { intvec lsr(intvec n) const { // return vec_sr(v, (__vector unsigned long long)n.v); - intvec r = *this; + intvec r; for (int i=0; i<size; ++i) { - r.set_elt(i, U(r[i]) >> U(n[i])); + r.set_elt(i, U((*this)[i]) >> U(n[i])); } return r; } intvec operator>>(intvec n) const { // return vec_sra(v, (__vector unsigned long long)n.v); - intvec r = *this; + intvec r; for (int i=0; i<size; ++i) { - r.set_elt(i, r[i] >> n[i]); + r.set_elt(i, (*this)[i] >> n[i]); } return r; } intvec operator<<(intvec n) const { // return vec_sl(v, (__vector unsigned long long)n.v); - intvec r = *this; + intvec r; for (int i=0; i<size; ++i) { - r.set_elt(i, r[i] << n[i]); + r.set_elt(i, (*this)[i] << n[i]); } return r; } |