Commit 5345cde8 authored by Berenger Bramas's avatar Berenger Bramas

Update altivec -- use xst for not aligned store

parent 50e77c11
......@@ -202,21 +202,11 @@ public:
// Constructor from vec
inline explicit InaVecALTIVEC(const double ptr[]){
// TODO use vec_xld2
vec = vec_xl(0, ptr);
// TODO indian problem might need permutation
//__vector unsigned char perm2301 = {0x8U, 0x9U, 0xAU, 0xBU, 0xCU, 0xDU, 0xEU, 0xFU,
// 0x0U, 0x1U, 0x2U, 0x3U, 0x4U, 0x5U, 0x6U, 0x7U};
//vec = vec_perm( vec, vec, perm2301);
}
inline InaVecALTIVEC& setFromArray(const double ptr[]){
// TODO use vec_xld2
vec = vec_xl(0, ptr);
// TODO indian problem might need permutation
//__vector unsigned char perm2301 = {0x8U, 0x9U, 0xAU, 0xBU, 0xCU, 0xDU, 0xEU, 0xFU,
// 0x0U, 0x1U, 0x2U, 0x3U, 0x4U, 0x5U, 0x6U, 0x7U};
//vec = vec_perm( vec, vec, perm2301);
return *this;
}
......@@ -246,12 +236,8 @@ public:
// Move back to array
inline void storeInArray(double ptr[]) const {
// TODO use vec_ste
// vec_ste( reinterpret_cast<__vector unsigned int>(vec), 0, reinterpret_cast<unsigned int*>(ptr));
alignas(16) double tmpptr[2];
vec_st( reinterpret_cast<__vector unsigned int>(vec), 0, reinterpret_cast<unsigned int*>(tmpptr));
ptr[0] = tmpptr[0];
ptr[1] = tmpptr[1];
// TODO remove cast
vec_xst( reinterpret_cast<__vector unsigned int>(vec), 0, reinterpret_cast<unsigned int*>(ptr));
}
inline void storeInAlignedArray(double ptr[]) const {
......
......@@ -194,21 +194,11 @@ public:
// Constructor from vec
inline explicit InaVecALTIVEC(const float ptr[]){
// TODO use vec_xlw4(0, ptr);
vec = vec_xl(0, ptr);
// TODO indian problem might need permutation
//__vector unsigned char perm3210 = {0xCU, 0xDU, 0xEU, 0xFU, 0x8U, 0x9U, 0xAU, 0xBU,
// 0x4U, 0x5U, 0x6U, 0x7U, 0x0U, 0x1U, 0x2U, 0x3U};
//vec = vec_perm( vec, vec, perm3210);
}
inline InaVecALTIVEC& setFromArray(const float ptr[]){
// TODO use vec_xlw4(0, ptr);
vec = vec_xl(0, ptr);
// TODO indian problem might need permutation
//__vector unsigned char perm3210 = {0xCU, 0xDU, 0xEU, 0xFU, 0x8U, 0x9U, 0xAU, 0xBU,
// 0x4U, 0x5U, 0x6U, 0x7U, 0x0U, 0x1U, 0x2U, 0x3U};
//vec = vec_perm( vec, vec, perm3210);
return *this;
}
......@@ -238,13 +228,7 @@ public:
// Move back to array
inline void storeInArray(float ptr[]) const {
// TODO vec_ste( vec, 0, ptr); does not work
alignas(16) float tmpptr[4];
vec_st(vec, 0, tmpptr);
ptr[0] = tmpptr[0];
ptr[1] = tmpptr[1];
ptr[2] = tmpptr[2];
ptr[3] = tmpptr[3];
vec_xst(vec, 0, ptr);
}
inline void storeInAlignedArray(float ptr[]) const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment