Some simple examples
For example; a vector double splat looks like this:
Another example:
Note in the example above the cast to __v2df for the operation. Both
__m128d and __v2df are vector double, but __v2df does no have the __may_alias__
attribute. And one more example:
Note this requires a cast for the compiler to generate the correct
code for the intended operation. The parameters and result are the generic
interface
type __m128i, which is a vector long long with the
__may_alias__ attribute. But
operation is a vector multiply low on unsigned short elements.
So not only do we use the cast to drop the __may_alias__
attribute but we also need to cast to
the correct type (__v8hu or vector unsigned short)
for the specified operation.
I have successfully copied these (and similar) source snippets over
to the PPC64LE implementation unchanged. This of course assumes the associated
types are defined and with compatible attributes.