diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-09-02 14:36:07 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-09-02 14:36:07 +0000 |
commit | b3624a5e692f65b88ed80554379d449dbff9fe72 (patch) | |
tree | 17f94f631501461cb22a0579866fcda5d576ce1d | |
parent | 355b6aa24b26fb25f5f266dc14c7cac1a87e255a (diff) | |
download | vecmathlib-b3624a5e692f65b88ed80554379d449dbff9fe72.zip vecmathlib-b3624a5e692f65b88ed80554379d449dbff9fe72.tar.gz |
QPX: Support additional integer
-rw-r--r-- | vec_qpx_double4.h | 69 |
1 files changed, 61 insertions, 8 deletions
diff --git a/vec_qpx_double4.h b/vec_qpx_double4.h index ca1eee8..abbf085 100644 --- a/vec_qpx_double4.h +++ b/vec_qpx_double4.h @@ -252,14 +252,17 @@ namespace vecmathlib { intvec& operator|=(intvec x) { return *this=*this|x; } intvec& operator^=(intvec x) { return *this=*this^x; } + intvec_t bitifthen(intvec_t x, intvec_t y) const; - intvec lsr(int_t n) const + + intvec_t lsr(int_t n) const { - intvec r; + intvec_t r; for (int d=0; d<size; ++d) r.set_elt(d, U((*this)[d]) >> U(n)); return r; } + intvec_t rotate(int_t n) const; intvec operator>>(int_t n) const { intvec r; @@ -275,12 +278,13 @@ namespace vecmathlib { intvec& operator>>=(int_t n) { return *this=*this>>n; } intvec& operator<<=(int_t n) { return *this=*this<<n; } - intvec lsr(intvec n) const + intvec_t lsr(intvec_t n) const { - intvec r; + intvec_t r; for (int d=0; d<size; ++d) r.set_elt(d, U((*this)[d]) >> U(n[d])); return r; } + intvec_t rotate(intvec_t n) const; intvec operator>>(intvec n) const { intvec r; @@ -296,12 +300,10 @@ namespace vecmathlib { intvec& operator>>=(intvec n) { return *this=*this>>n; } intvec& operator<<=(intvec n) { return *this=*this<<n; } + intvec_t clz() const; + intvec_t popcount() const; - boolvec_t isignbit() const - { - return *this < IV(I(0)); - } boolvec_t operator==(intvec x) const { @@ -339,6 +341,11 @@ namespace vecmathlib { for (int d=0; d<size; ++d) r.set_elt(d, (*this)[d] >= x[d]); return r; } + + intvec_t abs() const; + boolvec_t isignbit() const; + intvec_t max(intvec_t x) const; + intvec_t min(intvec_t x) const; }; @@ -727,16 +734,62 @@ namespace vecmathlib { // intvec definitions + inline intvec<double,4> intvec<double,4>::abs() const + { + return MF::vml_abs(*this); + } + inline realvec<double,4> intvec<double,4>::as_float() const { return v; } + inline intvec<double,4> intvec<double,4>::bitifthen(intvec_t x, + intvec_t y) const + { + return MF::vml_bitifthen(*this, x, y); + } + + inline intvec<double,4> intvec<double,4>::clz() const + { + return MF::vml_clz(*this); + } + inline realvec<double,4> intvec<double,4>::convert_float() const { return vec_cfid(v); } + inline boolvec<double,4> intvec<double,4>::isignbit() const + { + return MF::vml_isignbit(*this); + } + + inline intvec<double,4> intvec<double,4>::max(intvec_t x) const + { + return MF::vml_max(*this, x); + } + + inline intvec<double,4> intvec<double,4>::min(intvec_t x) const + { + return MF::vml_min(*this, x); + } + + inline intvec<double,4> intvec<double,4>::popcount() const + { + return MF::vml_popcount(*this); + } + + inline intvec<double,4> intvec<double,4>::rotate(int_t n) const + { + return MF::vml_rotate(*this, n); + } + + inline intvec<double,4> intvec<double,4>::rotate(intvec_t n) const + { + return MF::vml_rotate(*this, n); + } + } // namespace vecmathlib #endif // #ifndef VEC_QPX_DOUBLE4_H |