Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Seeking SSE2 integer intrinsics example

Hello,

I've been unable to find a single example of the use of SSE2 integer intrinsics.

Below is an example of some logic I'd like to implement (of course, the below code won't compile, but it can convey an intent).

[code]
void vFoobar
(
__m128i* pOut,
const __m128i pIn,
const USHORT* phIndices,
UINT kLen
)
{
for (UINT k=0; k<kLen; ++k)
pOut[k] ^= pIn[phIndices[k]];
}
[/code]


As far as I can tell, no one from Microsoft, Intel, or anyone else has ever written an integer SSE2 intrinsics tutorial (with examples).

Actually, as far as I know, no one in the world has created a few (complete, compilable) integer SSE2 intrinsics examples.


Thanks for any feedback

Comments

  • BannerdogBannerdog Posts: 12Member

    Actually, I got the logic to compile as:

    [code]
    void vFoobar
    (
    __m128i* pOut,
    const __m128i* pIn,
    const USHORT* phIndices,
    UINT kLen
    )
    {
    for (UINT k=0; k<kLen; ++k)
    pOut[k] = _mm_xor_si128(pOut[k], pIn[phIndices[k]]);
    }
    [/code]

    Unfortunately, _mm_xor_si128() does not "know" that the destination is the same location as the first IN parameter.

    Therefore, it seems likely to generate less than optimal code.





Sign In or Register to comment.