Re: AVX - cast from YMM to XMM without overhead?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marc Glisse <marc.glisse@xxxxxxxx> writes:

> On Sun, 24 Jun 2012, Dag Lem wrote:
> 

[...]

> Casting a vector to a vector with a different number of elements: I am
> not sure what that is supposed to mean. Casting a pointer: I know this
> means reinterpreting what is in memory there. In C++ you could also
> consider casting to a reference to v4sf (equivalent to the pointer
> cast) but I am not sure that it is supported yet (related to bug
> 53121).

I guess you're right. Casting as in my naïve approach would also have
limited usefulness in that it would only be able to extract the lower
(and not the higher) bits of a vector register. However I can't help
thinking that some kind of intrinsic/operator/whatever to extract
vector register parts would be useful. How does one even specify the
following using pointer casts? Please try, and then tell me the result
is not ugly ;-)

  *z = (v2sf)d;  // Naïve attempt to generate vmovlps d, z

[...]

> > OK, so *((v4sf*)&a) is not supposed to be a no-op, but presently
> > isn't?
> 
> Strike the "not" in your sentence, and yes. It manages it for
> *(float*)&a (taking the first element) but not for subvectors (yet).

Thank you, that's good news!

-- 
Best regards,

Dag Lem



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux