[Bug target/90984] PowerPC cast from vector unsigned long long to vector double does not do an integer to float conversion

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 24 18:22:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90984

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So if you read the original Altivec PEM (and I think it is included in Power
ISA books and maybe others) and GCC document:
https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Vector-Extensions.html#Vector-Extensions


Casts are just bitwise conversion, rather than element wise conversion.

To do element wise conversion, __builtin_convertvector can be used if you have
new enough GCC.


Vector conversion is available using the __builtin_convertvector (vec, vectype)
function. vec must be an expression with integral or floating vector type and
vectype an integral or floating vector type with the same number of elements.
The result has vectype type and value of a C cast of every element of vec to
the element type of vectype.


Otherwise, there are some vec_* functions which can be used for Altivec/PowerPC
vectors.


More information about the Gcc-bugs mailing list