How to use swizzling ?

How to use swizzling ?

Dear all,

The software development guide makes a great case at presenting the possiblities offered by hardware swizzling on Xeon Phi. But I could not understand how to use swizzling in practice.

There appear to be some intrinsic available in "zmmintrin.h"  (the only header file that appears to provide 512 bits SIMD intrinsic. included from "immintrin.h"). Some mention swizzling but not all operations appear to support it. And only a handful of swizzling option appear to be supported. In particular I could not find how to apply "lane shifting".

Where can I find documentation on how to use swizzling in pratice? Is swizzling supposed to be used only from assembly?



4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Erik,

I am researching your question and get back to you very soon.


In the Intel® C++ Compiler XE 13.0 User and Reference Guides (go to Developer Tools at the top of this page, then select Product Documentation and look under C++ Composer 2013), if you search on "swizzle", it will lead you to descriptions of various mm512 instrinsics that perform a swizzle or support some sort of swizzle flag.
Also, it sound like you have found the system software developers guide. If you haven't already looked at the instruction
set architecture reference manual (there is a link on the web page), you might find that useful. It will tell you which instrinsics, if any, correspond to the different vector operations.

I think I understand now. Most vectorial instruction can take one of its operand from the swizzle/conversion/broadcast unit. And the patterns available for swizzle is actually limited. They are not all available. It is a shame that operations at the lane level are limited to 1 element to all or 1 lane to all. Lane shift operations would have been most useful.

Thank you for the help.

Leave a Comment

Please sign in to add a comment. Not a member? Join today