AltiVec too pedantic about type qualifiers [UPDATE]

Aldy Hernandez aldyh@redhat.com
Sun Feb 24 18:10:00 GMT 2002


On Monday, February 25, 2002, at 10:55  AM, Daniel Egger wrote:

> Hija,
>
> I further discovered that my words in the last mail are not
> only partially valid for a "vector shift left".
>
> #include <altivec.h>
>
> void test (const char *test)
> {
>   vector signed char vec;
>
>   vec = vec_lvsl (0, test);
> }

there are a few things wrong here:

first, vec_lvsl accepts "char *" not "const char *", so you'll
have to cast.

second, and most importantly, the altivec specs say that
vec_lvsl() returns a "vector unsigned char" for any of its
variants... so you'll have to cast the return to "vector signed
char".  gcc will not do the conversion for you like with
scalars of signed int/unsigned int.

i had a patch to allow copying within vector unsigned and
vector signed automatically, but it was vetoed for
"safety" reasons.

aldy



More information about the Gcc mailing list