summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vec_altivec_float4.h41
-rw-r--r--vec_vsx_double2.h41
2 files changed, 69 insertions, 13 deletions
diff --git a/vec_altivec_float4.h b/vec_altivec_float4.h
index 26f798e..36f0281 100644
--- a/vec_altivec_float4.h
+++ b/vec_altivec_float4.h
@@ -201,15 +201,12 @@ namespace vecmathlib {
intvec& operator|=(intvec const& x) { return *this=*this|x; }
intvec& operator^=(intvec const& x) { return *this=*this^x; }
- intvec_t bitifthen(intvec_t x, intvec_t y) const
- {
- return MF::vml_bitifthen(*this, x, y);
- }
+ intvec_t bitifthen(intvec_t x, intvec_t y) const;
intvec_t lsr(int_t n) const { return lsr(IV(n)); }
- intvec_t rotate(int_t n) const { MF::vml_rotate(*this, n); }
+ intvec_t rotate(int_t n) const;
intvec operator>>(int_t n) const { return *this >> IV(n); }
intvec operator<<(int_t n) const { return *this << IV(n); }
intvec& operator>>=(int_t n) { return *this=*this>>n; }
@@ -219,7 +216,7 @@ namespace vecmathlib {
{
return vec_sr(v, (__vector unsigned int)n.v);
}
- intvec_t rotate(intvec_t n) const { MF::vml_rotate(*this, n); }
+ intvec_t rotate(intvec_t n) const;
intvec operator>>(intvec n) const
{
return vec_sra(v, (__vector unsigned int)n.v);
@@ -231,8 +228,8 @@ namespace vecmathlib {
intvec& operator>>=(intvec n) { return *this=*this>>n; }
intvec& operator<<=(intvec n) { return *this=*this<<n; }
- intvec_t clz() const { return MF::vml_clz(*this); }
- intvec_t popcount() const { return MF::vml_popcount(*this); }
+ intvec_t clz() const;
+ intvec_t popcount() const;
@@ -244,9 +241,9 @@ namespace vecmathlib {
boolvec_t operator>=(intvec const& x) const { return !(*this < x); }
intvec_t abs() const { return vec_abs(v); }
+ boolvec_t isignbit() const { return (*this >> (bits-1)).as_bool(); }
intvec_t max(intvec_t x) const { return vec_max(v, x.v); }
intvec_t min(intvec_t x) const { return vec_min(v, x.v); }
- boolvec_t isignbit() const { return MF::vml_isignbit(*this); }
};
@@ -590,11 +587,37 @@ namespace vecmathlib {
return (__vector float)v;
}
+ inline intvec<float,4> intvec<float,4>::bitifthen(intvec_t x,
+ intvec_t y) const
+ {
+ return MF::vml_bitifthen(*this, x, y);
+ }
+
+ inline intvec<float,4> intvec<float,4>::clz() const
+ {
+ return MF::vml_clz(*this);
+ }
+
inline realvec<float,4> intvec<float,4>::convert_float() const
{
return vec_ctf(v, 0);
}
+ inline intvec<float,4> intvec<float,4>::popcount() const
+ {
+ return MF::vml_popcount(*this);
+ }
+
+ inline intvec<float,4> intvec<float,4>::rotate(int_t n) const
+ {
+ return MF::vml_rotate(*this, n);
+ }
+
+ inline intvec<float,4> intvec<float,4>::rotate(intvec_t n) const
+ {
+ return MF::vml_rotate(*this, n);
+ }
+
} // namespace vecmathlib
#endif // #ifndef VEC_ALTIVEC_FLOAT4_H
diff --git a/vec_vsx_double2.h b/vec_vsx_double2.h
index 6505cdb..5104293 100644
--- a/vec_vsx_double2.h
+++ b/vec_vsx_double2.h
@@ -282,9 +282,12 @@ namespace vecmathlib {
intvec& operator|=(intvec const& x) { return *this=*this|x; }
intvec& operator^=(intvec const& x) { return *this=*this^x; }
+ intvec_t bitifthen(intvec_t x, intvec_t y) const;
+
intvec lsr(int_t n) const { return lsr(IV(n)); }
+ intvec_t rotate(int_t n) const;
intvec operator>>(int_t n) const { return *this >> IV(n); }
intvec operator<<(int_t n) const { return *this << IV(n); }
intvec& operator>>=(int_t n) { return *this=*this>>n; }
@@ -299,6 +302,7 @@ namespace vecmathlib {
}
return r;
}
+ intvec_t rotate(intvec_t n) const;
intvec operator>>(intvec n) const
{
// return vec_sra(v, (__vector unsigned long long)n.v);
@@ -320,12 +324,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 >> (bits-1)).as_bool();
- }
boolvec_t operator==(intvec const& x) const
{
@@ -364,6 +366,11 @@ namespace vecmathlib {
{
return ! (*this < x);
}
+
+ intvec_t abs() const { return vec_abs(v); }
+ boolvec_t isignbit() const { return (*this >> (bits-1)).as_bool(); }
+ intvec_t max(intvec_t x) const { return vec_max(v, x.v); }
+ intvec_t min(intvec_t x) const { return vec_min(v, x.v); }
};
@@ -675,12 +682,38 @@ namespace vecmathlib {
return (__vector double)v;
}
+ inline intvec<float,4> intvec<float,4>::bitifthen(intvec_t x,
+ intvec_t y) const
+ {
+ return MF::vml_bitifthen(*this, x, y);
+ }
+
+ inline intvec<double,2> intvec<double,2>::clz() const
+ {
+ return MF::vml_clz(*this);
+ }
+
inline realvec<double,2> intvec<double,2>::convert_float() const
{
// return vec_ctd(v, 0);
return MF::vml_convert_float(*this);
}
+ inline intvec<double,2> intvec<double,2>::popcount() const
+ {
+ return MF::vml_popcount(*this);
+ }
+
+ inline intvec<double,2> intvec<double,2>::rotate(int_t n) const
+ {
+ return MF::vml_rotate(*this, n);
+ }
+
+ inline intvec<double,2> intvec<double,2>::rotate(intvec_t n) const
+ {
+ return MF::vml_rotate(*this, n);
+ }
+
} // namespace vecmathlib
#endif // #ifndef VEC_VSX_DOUBLE2_H
OpenPOWER on IntegriCloud