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 strangeness?


Am Fre, 2002-02-22 um 23.35 schrieb Aldy Hernandez:

> the above should be:
> blah vector signed short test = (vector signed short){1,2,3,etc};

I got it. It's like the Motorola crazyness but with {}'s instead of
parens.
 
> the altivec specs mention that you need a cast.  this is a context
> sensitivity issue.  gcc can't know what {1,2,3,etc} is.  perhaps
> the compiler you are using now uses context magic to figure out
> what type the initializer is... gcc won't do that.

Doesn't make sense to me. Isn't the compiler assuming that the rvalue
is of the same time as the lvalue of the assignment? Seems not, but why?
in 
vector signed short test = rhs;
for example it should be pretty clear that the right hand side is a 
vector signed short and if it's not the compiler should bail out with an
error.

> seriously, the (1) nonsense will work with jason merrill's patches
> but you'll have to apply those on your own.  but please don't.
> the hope is to wean people off of the parentheses nonsense-- alongside
> that, wean them off of the {1} stuff.  that just goes against
> C syntax.

It does, but how we one be able to represent a constant vector of
common values without typing them all? This is 
a) nasty because it requires a lot of typing.
b) not the fastest way because it will take memory and be loaded into
   memory while splatting might be faster and schedule better.

> warning will robbinson!  the vector initializer code is not, ahem,
> efficient. 

I noticed that. :)

> it will need to be rewritted with vector constants to
> yield better code, perhaps for 3.2.  but imo, that's not a big issue
> because you never initialize a vector inside a loop.

Why shouldn't I? If it's not invariant I might make sense to do that in
a loop for example to get working data into a vector register.

-- 
Servus,
       Daniel


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