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.
 
SoConvexDataCache(3)						       Coin						      SoConvexDataCache(3)

NAME
SoConvexDataCache - The SoConvexDataCache class is used to cache convexified polygons. SoConvexDataCache is used to speed up rendering of concave polygons by tessellating all polygons into triangles and storing the newly generated primitives in an internal cache. SYNOPSIS
#include <Inventor/caches/SoConvexDataCache.h> Inherits SoCache. Public Types enum Binding { NONE = 0, PER_FACE, PER_FACE_INDEXED, PER_VERTEX, PER_VERTEX_INDEXED } The Binding enum is used to specify bindings. Public Member Functions SoConvexDataCache (SoState *const state) virtual ~SoConvexDataCache () void generate (const SoCoordinateElement *const coords, const SbMatrix &matrix, const int32_t *coordindices, const int numcoordindices, const int32_t *matindices, const int32_t *normindices, const int32_t *texindices, const Binding matbinding, const Binding normbinding, const Binding texbinding) const int32_t * getCoordIndices (void) const int getNumCoordIndices (void) const const int32_t * getMaterialIndices (void) const int getNumMaterialIndices (void) const const int32_t * getNormalIndices (void) const int getNumNormalIndices (void) const const int32_t * getTexIndices (void) const int getNumTexIndices (void) const Additional Inherited Members Detailed Description The SoConvexDataCache class is used to cache convexified polygons. SoConvexDataCache is used to speed up rendering of concave polygons by tessellating all polygons into triangles and storing the newly generated primitives in an internal cache. This class is not part of the original SGI Open Inventor v2.1 API, but is a Coin extension. Member Enumeration Documentation enum SoConvexDataCache::Binding The Binding enum is used to specify bindings. Binding applies to normals, materials and texture coordinates. Constructor &; Destructor Documentation SoConvexDataCache::SoConvexDataCache (SoState *conststate) Constructor with state being the current state. SoConvexDataCache::~SoConvexDataCache () [virtual] Destructor. Member Function Documentation void SoConvexDataCache::generate (const SoCoordinateElement *constcoords, const SbMatrix &matrix, const int32_t *vind, const intnumv, const int32_t *mind, const int32_t *nind, const int32_t *tind, const Bindingmatbind, const Bindingnormbind, const Bindingtexbind) Generates the convexified data. FIXME: doc const int32_t * SoConvexDataCache::getCoordIndices (void) const Returns a pointer to the convexified coordinate indices. See also: SoConvexDataCache::getNumCoordIndices() int SoConvexDataCache::getNumCoordIndices (void) const Returns the number of coordinate indices. See also: SoConvexDataCache::getCoordIndices() const int32_t * SoConvexDataCache::getMaterialIndices (void) const Returns the convexified material indices. See also: SoConvexDataCache::getNumMaterialIndices() int SoConvexDataCache::getNumMaterialIndices (void) const Returns the number of material indices. See also: SoConvexDataCache::getMaterialIndices() const int32_t * SoConvexDataCache::getNormalIndices (void) const Returns the convexified normal indices. See also: SoConvexDataCache::getNumNormalIndices() int SoConvexDataCache::getNumNormalIndices (void) const Returns the number of normal indices. See also: SoConvexDataCache::getNormalIndices() const int32_t * SoConvexDataCache::getTexIndices (void) const Returns the convexified texture coordinate indices. See also: SoConvexDataCache::getNumTexIndices() int SoConvexDataCache::getNumTexIndices (void) const Returns the number of texture coordinate indices. See also: SoConvexDataCache::getTexIndices() Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoConvexDataCache(3)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy