Posts

Showing posts with the label sse

How to divide 16-bit integer by 255 with using SSE?

Image
Clash Royale CLAN TAG #URR8PPP How to divide 16-bit integer by 255 with using SSE? I deal with image processing. I need to divide 16-bit integer SSE vector by 255. I can't use shift operator like _mm_srli_epi16(), because 255 is not a multiple of power of 2. I know of course that it is possible convert integer to float, perform division and then back conversion to integer. But might somebody knows another solution... Does this help? – Anton Savin Feb 9 '16 at 6:43 Typically you would divide by 256 (with rounding rather than truncation) - is there some reason why it has to be 255 and not 256 ? – Paul R Feb 9 '16 at 7:25 Maybe this question is interesting fo...