edlib icon indicating copy to clipboard operation
edlib copied to clipboard

How to use word size is 256 bits data.

Open stormalex opened this issue 7 years ago • 1 comments

Hi, My hardware supports SIMD instructions,SIMD instructions supports word size 256 bits calculate, so I want use 256 bits word replace 64 bits word. I replace all 64bits data with 256 bits data, so my MaxBlocks is 4. but some query string and target string result is not equal 64 bits word result, If use 256 bits word, the MaxBlocks is 4, so block number is less. I observe calculation process and find that “hout” and ”blk->score” is wrong. I have no idea to adjustment calculateBlock function. So, could you have any suggest or experience tell me how to modify calculateBlock function, make it return to the right "hout".

Thank you very much!

stormalex avatar Feb 28 '18 08:02 stormalex

Assuming you are using mainstream (eg. Intel) hardware, my understanding is that SIMD does not give you a 256bit (or 128 or 512 bit for that matter) word size, but rather the ability to perform 4x64bit or 8x32bit word operations in parallel. For the purpose of Myers' algorithm, used by Edlib, it is the size of each word that is processed that matters - specifically it needs to be able to perform bitwise and/or ops and addition on words of that size.

robertknight avatar Jun 11 '19 12:06 robertknight