From cae27678d82b29c1d2ddeee6d1f2288d54391267 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 6 Oct 2023 13:39:19 -0400 Subject: [PATCH] gpermute --- Grid/simd/Grid_vector_types.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Grid/simd/Grid_vector_types.h b/Grid/simd/Grid_vector_types.h index daf41cae..1c5ac785 100644 --- a/Grid/simd/Grid_vector_types.h +++ b/Grid/simd/Grid_vector_types.h @@ -1130,6 +1130,14 @@ static_assert(sizeof(SIMD_Ftype) == sizeof(SIMD_Itype), "SIMD vector lengths inc #endif #endif +// Fixme need coalesced read gpermute +template void gpermute(vobj & inout,int perm){ + vobj tmp=inout; + if (perm & 0x1 ) { permute(inout,tmp,0); tmp=inout;} + if (perm & 0x2 ) { permute(inout,tmp,1); tmp=inout;} + if (perm & 0x4 ) { permute(inout,tmp,2); tmp=inout;} + if (perm & 0x8 ) { permute(inout,tmp,3); tmp=inout;} +} NAMESPACE_END(Grid);