- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I am coding a SIMD program (under AMS), I do not succeed my final arrangement of one of

my xmm register. In this 128 bits register, I have 4 double words (int) like that :

AB C D

I would like reorder the register like that :

0 A B C

it seems to be the asm pshufd xmm, xmm, imm8. But I do not find the magical value at imm8, although

I read ten times the doc ...

Thank you

Tim

1 Solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

v = _mm_slli_si128(v, 4); // shift the contents of v to the left by 4 bytes

or

v = _mm_srli_si128(v, 4); // shift to the right by 4 bytes

The little endian confusion is probably also what makes it so hard to get the correct number for pshufd...

Link Copied

4 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

v = _mm_slli_si128(v, 4); // shift the contents of v to the left by 4 bytes

or

v = _mm_srli_si128(v, 4); // shift to the right by 4 bytes

The little endian confusion is probably also what makes it so hard to get the correct number for pshufd...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Vectorization handbook it is on intel SSE2 that why I do not find the reference if this function.

Regard's

Tim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I think a few cases which Microsoft supported but Intel didn't were in line to be fixed.

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