This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AltiVec too pedantic about type qualifiers [UPDATE]



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]