- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Experts,
Can we optimize following checksum calculation using SIMD somehow ?
Thank you
Zooli
Can we optimize following checksum calculation using SIMD somehow ?
for(int i = 0 ; i < buffSize_ ; i++) {
hashVal = (hashVal<<5) + hashVal + pBuffer_;
}
Thank you
Zooli
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting zoolii
Hi Experts,
Can we optimize following checksum calculation using SIMD somehow ?
Thank you
Zooli
Can we optimize following checksum calculation using SIMD somehow ?
for(int i = 0 ; i < buffSize_ ; i++) {
hashVal = (hashVal<<5) + hashVal + pBuffer_;
}
Thank you
Zooli
Yes, with and without SSE. Also, you didn't specifytypes of'hashVal' and'pBuffer_'variables.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sergy,
Thanks for the reply. hashVal can be an unsigned int or long . pBuffer_ is an unsigned char array.
Regards
Zooli
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to consider a set of SSE3 instructions for a horizontal addition.
Best regards,
Sergey
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please take a look at anarticle:
http://software.intel.com/en-us/articles/implement-a-horizontal-addsubtract-with-sse3-instructions/
http://software.intel.com/en-us/articles/implement-a-horizontal-addsubtract-with-sse3-instructions/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the array is at all large, the vector sum reductions implemented by the compilers (nearly any compiler other than MSVC) may be superior.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page