mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 20:57:06 +01:00
Vectorise the XYZT face gathering better.
Hard coded for simd_layout <= 2 in any given spread out direction; full generality is inconsistent with efficiency.
This commit is contained in:
@ -105,6 +105,11 @@ class iScalar {
|
||||
friend strong_inline void rotate(iScalar<vtype> &out,const iScalar<vtype> &in,int rot){
|
||||
rotate(out._internal,in._internal,rot);
|
||||
}
|
||||
friend strong_inline void exchange(iScalar<vtype> &out1,iScalar<vtype> &out2,
|
||||
const iScalar<vtype> &in1,const iScalar<vtype> &in2,int type){
|
||||
exchange(out1._internal,out2._internal,
|
||||
in1._internal, in2._internal,type);
|
||||
}
|
||||
|
||||
// Unary negation
|
||||
friend strong_inline iScalar<vtype> operator-(const iScalar<vtype> &r) {
|
||||
@ -248,6 +253,13 @@ class iVector {
|
||||
rotate(out._internal[i],in._internal[i],rot);
|
||||
}
|
||||
}
|
||||
friend strong_inline void exchange(iVector<vtype,N> &out1,iVector<vtype,N> &out2,
|
||||
const iVector<vtype,N> &in1,const iVector<vtype,N> &in2,int type){
|
||||
for(int i=0;i<N;i++){
|
||||
exchange(out1._internal[i],out2._internal[i],
|
||||
in1._internal[i], in2._internal[i],type);
|
||||
}
|
||||
}
|
||||
|
||||
// Unary negation
|
||||
friend strong_inline iVector<vtype, N> operator-(const iVector<vtype, N> &r) {
|
||||
@ -374,6 +386,14 @@ class iMatrix {
|
||||
rotate(out._internal[i][j],in._internal[i][j],rot);
|
||||
}}
|
||||
}
|
||||
friend strong_inline void exchange(iMatrix<vtype,N> &out1,iMatrix<vtype,N> &out2,
|
||||
const iMatrix<vtype,N> &in1,const iMatrix<vtype,N> &in2,int type){
|
||||
for(int i=0;i<N;i++){
|
||||
for(int j=0;j<N;j++){
|
||||
exchange(out1._internal[i][j],out2._internal[i][j],
|
||||
in1._internal[i][j], in2._internal[i][j],type);
|
||||
}}
|
||||
}
|
||||
|
||||
// Unary negation
|
||||
friend strong_inline iMatrix<vtype, N> operator-(const iMatrix<vtype, N> &r) {
|
||||
|
Reference in New Issue
Block a user