/*************************************** Auteur : Pierre Aubert Mail : aubertp7@gmail.com Licence : CeCILL-C ****************************************/ #include #include "phoenix_intrinsics.h" #include "sqrt_vectorize.h" ///Do the sqrt /** @param[out] ptabResult : table of results of sqrt(tabX) * @param ptabX : input table * @param nbElement : number of elements in the tables */ void sqrt_vectorize(float* __restrict__ ptabResult, const float* __restrict__ ptabX, size_t nbElement){ float* tabResult = (float*)__builtin_assume_aligned(ptabResult, PLIB_VECTOR_SIZE_BYTE_FLOAT); const float* tabX = (const float*)__builtin_assume_aligned(ptabX, PLIB_VECTOR_SIZE_BYTE_FLOAT); for(size_t i(0lu); i < nbElement; ++i){ tabResult[i] = std::sqrt(tabX[i]); } }