Sponsored Content
Full Discussion: Vectorization
Special Forums UNIX and Linux Applications High Performance Computing Vectorization Post 302895149 by a3mlord on Friday 28th of March 2014 05:03:17 PM
Old 03-28-2014
Signal Vectorization

Hi,

I have the following vectorized code:
Code:
long valor = 0, i=0;

 __m128i vsum, vecPi, vecCi, vecQCi;

 vsum = _mm_set1_epi32(0);

 int32_t * const pA = A->data;
 int32_t * const pB = B->data;

 int sumDot[1];

 for( ; i<SIZE-3 ;i+=4){

 vecPi = _mm_loadu_si128((__m128i *)&(pA)[i] );
 vecCi = _mm_loadu_si128((__m128i *)&(pB)[i] );
 vecQCi = _mm_mullo_epi32(vecPi,vecCi);
 vsum = _mm_add_epi32(vsum,vecQCi);

 } 
 vsum = _mm_hadd_epi32(vsum, vsum);
 vsum = _mm_hadd_epi32(vsum, vsum);
 _mm_storeu_si128((__m128i *)&(sumDot), vsum);

 for( ; i<SIZE; i++)
 valor += A->data[i] * B->data[i];   valor += sumDot[0];

However, as I get overflows, I need to handle those cases. Could you please help me with that?

Thanks

Last edited by bartus11; 03-28-2014 at 06:06 PM.. Reason: Please use [code][/code] tags.
 
VHDLABLVECTOR(3)						   ABL FUNCTIONS						  VHDLABLVECTOR(3)

NAME
vhdlablvector - gives the index and the name of a vectorized name. ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
#include "abl101.h" char *vhdlablvector( Name, Index ) char *Name; long *Index; PARAMETERS
Name A vectorized name. Index A pointer to long. DESCRIPTION
vhdlablvector searches the index of a vectorized name, and the vector's name. RETURN VALUE
If Name is a vectorized name, vhdlablvector returns the vector's name using namealloc, and its index throw Index. Otherwise, it returns a null pointer. EXAMPLE
#include "abl101.h" long Index; char *Name; Name = vhdlablvector( "vec 2", &Index ); /* displays Name:vec, Index:2 */ printf( "Name:%s, Index:%d0, Name, Index ); SEE ALSO
abl(1), ablvhdlname(3). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 VHDLABLVECTOR(3)
All times are GMT -4. The time now is 04:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy