1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

symmetrize Mult and MultAddComplex

This commit is contained in:
nmeyer-ur 2020-05-20 22:36:45 +02:00
parent 9a86059761
commit 81484a4760
2 changed files with 6 additions and 8 deletions

View File

@ -400,7 +400,7 @@ struct MultComplex{
struct MultAddComplex{ struct MultAddComplex{
// Complex a*b+c // Complex a*b+c
template <typename T> template <typename T>
inline vec<T> mac(const vec<T> &a, const vec<T> &b, const vec<T> &c){ inline vec<T> mac(const vec<T> &a, const vec<T> b, const vec<T> c){
vec<T> out; vec<T> out;
svbool_t pg1 = acle<T>::pg1(); svbool_t pg1 = acle<T>::pg1();
@ -412,9 +412,7 @@ struct MultAddComplex{
typename acle<T>::vt r_v = svcmla_x(pg1, c_v, a_v, b_v, 0); typename acle<T>::vt r_v = svcmla_x(pg1, c_v, a_v, b_v, 0);
r_v = svcmla_x(pg1, r_v, a_v, b_v, 90); r_v = svcmla_x(pg1, r_v, a_v, b_v, 90);
svst1(pg1, out.v, r_v); svst1(pg1, a.v, r_v);
return out;
} }
}; };

View File

@ -369,18 +369,18 @@ struct MultComplex{
struct MultAddComplex{ struct MultAddComplex{
// Complex a*b+c // Complex a*b+c
// Complex float // Complex float
inline vecf mac(vecf a, vecf b, vecf c){ inline vecf mac(vecf &a, vecf b, vecf c){
pred pg1 = acle<float>::pg1(); pred pg1 = acle<float>::pg1();
// using FCMLA // using FCMLA
vecf r_v = svcmla_x(pg1, c, a, b, 0); vecf r_v = svcmla_x(pg1, c, a, b, 0);
return svcmla_x(pg1, r_v, a, b, 90); a = svcmla_x(pg1, r_v, a, b, 90);
} }
// Complex double // Complex double
inline vecd mac(vecd a, vecd b, vecd c){ inline vecd mac(vecd &a, vecd b, vecd c){
pred pg1 = acle<double>::pg1(); pred pg1 = acle<double>::pg1();
// using FCMLA // using FCMLA
vecd r_v = svcmla_x(pg1, c, a, b, 0); vecd r_v = svcmla_x(pg1, c, a, b, 0);
return svcmla_x(pg1, r_v, a, b, 90); a = svcmla_x(pg1, r_v, a, b, 90);
} }
}; };