1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-05 11:45:56 +01:00

replaced _x form with _m form when using even/odd predication

This commit is contained in:
nmeyer-ur 2020-05-14 23:17:35 +02:00
parent d15ccad8a7
commit db8c0e7584
2 changed files with 22 additions and 14 deletions

View File

@ -422,7 +422,8 @@ struct Conj{
svbool_t pg1 = acle<T>::pg1();
svbool_t pg_odd = acle<T>::pg_odd();
typename acle<T>::vt a_v = svld1(pg1, a.v);
typename acle<T>::vt r_v = svneg_x(pg_odd, a_v);
//typename acle<T>::vt r_v = svneg_x(pg_odd, a_v);
typename acle<T>::vt r_v = svneg_m(pg_odd, a_v);
svst1(pg1, out.v, r_v);
return out;
@ -442,7 +443,7 @@ struct TimesMinusI{
typename acle<T>::svuint tbl_swap_v = svld1(pg1, tbl_swap.v);
typename acle<T>::vt a_v = svld1(pg1, a.v);
a_v = svtbl(a_v, tbl_swap_v);
typename acle<T>::vt r_v = svneg_x(pg_odd, a_v);
typename acle<T>::vt r_v = svneg_m(pg_odd, a_v);
svst1(pg1, out.v, r_v);
return out;
@ -462,7 +463,8 @@ struct TimesI{
typename acle<T>::svuint tbl_swap_v = svld1(pg1, tbl_swap.v);
typename acle<T>::vt a_v = svld1(pg1, a.v);
a_v = svtbl(a_v, tbl_swap_v);
typename acle<T>::vt r_v = svneg_x(pg_even, a_v);
//typename acle<T>::vt r_v = svneg_x(pg_even, a_v);
typename acle<T>::vt r_v = svneg_m(pg_even, a_v);
svst1(pg1, out.v, r_v);
return out;
@ -593,7 +595,7 @@ struct Exchange{
/* FIXME use svcreate etc. or switch to table lookup directly
/* FIXME use svcreate etc. or switch to table lookup directly
template <typename T>
static inline void Exchange1(vec<T> &out1, vec<T> &out2, const vec<T> &in1, const vec<T> &in2){
@ -613,11 +615,11 @@ struct Exchange{
svst4(pg4, (typename acle<double>::pt*)out1.v, out1_v4);
svst4(pg4, (typename acle<double>::pt*)out2.v, out2_v4);
}
*/
*/
#define VECTOR_FOR(i, w, inc) \
for (unsigned int i = 0; i < w; i += inc)
template <typename T>
static inline void Exchange1(vec<T> &out1, vec<T> &out2, const vec<T> &in1, const vec<T> &in2){
// FIXME
@ -625,14 +627,14 @@ struct Exchange{
const int w = W<T>::r;
unsigned int mask = w >> (n + 1);
// std::cout << " Exchange "<<n<<" nsimd "<<w<<" mask 0x" <<std::hex<<mask<<std::dec<<std::endl;
VECTOR_FOR(i, w, 1) {
VECTOR_FOR(i, w, 1) {
int j1 = i&(~mask);
if ( (i&mask) == 0 ) { out1.v[i]=in1.v[j1];}
else { out1.v[i]=in2.v[j1];}
int j2 = i|mask;
if ( (i&mask) == 0 ) { out2.v[i]=in1.v[j2];}
else { out2.v[i]=in2.v[j2];}
}
}
}
#undef VECTOR_FOR

View File

@ -384,12 +384,14 @@ struct Conj{
// Complex float
inline vecf operator()(vecf a){
pred pg_odd = acle<float>::pg_odd();
return svneg_x(pg_odd, a);
//return svneg_x(pg_odd, a);
return svneg_m(pg_odd, a);
}
// Complex double
inline vecd operator()(vecd a){
pred pg_odd = acle<double>::pg_odd();
return svneg_x(pg_odd, a);
//return svneg_x(pg_odd, a);
return svneg_m(pg_odd, a);
}
};
@ -401,7 +403,8 @@ struct TimesMinusI{
pred pg_odd = acle<float>::pg_odd();
vecf a_v = svtbl(a, tbl_swap);
return svneg_x(pg_odd, a_v);
//return svneg_x(pg_odd, a_v);
return svneg_m(pg_odd, a_v);
}
// Complex double
inline vecd operator()(vecd a, vecd b){
@ -410,7 +413,8 @@ struct TimesMinusI{
pred pg_odd = acle<double>::pg_odd();
vecd a_v = svtbl(a, tbl_swap);
return svneg_x(pg_odd, a_v);
//return svneg_x(pg_odd, a_v);
return svneg_m(pg_odd, a_v);
}
};
@ -422,7 +426,8 @@ struct TimesI{
pred pg_even = acle<float>::pg_even();
vecf a_v = svtbl(a, tbl_swap);
return svneg_x(pg_even, a_v);
//return svneg_x(pg_even, a_v);
return svneg_m(pg_even, a_v);
}
// Complex double
inline vecd operator()(vecd a, vecd b){
@ -431,7 +436,8 @@ struct TimesI{
pred pg_even = acle<double>::pg_even();
vecd a_v = svtbl(a, tbl_swap);
return svneg_x(pg_even, a_v);
//return svneg_x(pg_even, a_v);
return svneg_m(pg_even, a_v);
}
};