This is the mail archive of the gcc-patches@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: [PATCH]: Handle vector modes in genopinit.c, c-typeck.c



On Thursday, November 29, 2001, at 12:33  PM, Joseph S. Myers wrote:

> On Thu, 29 Nov 2001, Daniel Berlin wrote:
>
>> This patch changes c-typeck to allow us to build binary ops on vectors
>> (assuming we have a handler in the backend), and changes genopinit to
>> properly allow addv4sf3, etc, to be recognized as add handlers.
>
> Where are the docs?
I want to know if it's even acceptable as a principle before I attempt 
to write up docs.

>   What operations are allowed?  (For example, do you
> allow unary minus - if not, why not?)
The same operations that are allowed on integers and floats would be 
allowed on vectors of integers and vectors of floats.
> Must the operands be the same type?
If they normally must be of the same type for the underlying type of the 
vector, then yes.
IE if float - int is not allowed, vector float - vector int is not 
allowed.

> Can you do operations between a vector and a scalar?

This i've not thought much about yet. I'd rather keep to vector 
operations at the present, rather than try to figure out what ops are 
allowed between vector and scalar, and their semantics.

The main point isn't to introduce a language extension here (which is 
why i didn't add syntax), just allow the operations that work on various 
modes right now to work on their vector counterparts.  I.E. The fact 
that the modes happen to represent vectors shouldn't matter.

Right now, you can only do this with intrinsics.
But the intrinsics expand to the exact same RTL that you'd get if you 
allowed normal operations on that mode in the type checker.
So why should you need the intrinsics to say this?
	
> testcases for all this (that allowed operations and type combinations
> work, and that non-allowed ones don't)?  What happens if a particular
> operation isn't supported on particular types on a particular 
> processor -
> do you synthesise the operation?
Not yet, but i will.
As I said, i'm just testing the waters, not looking for approval (except 
for the genopinit.c portion).
I should have made that more clear.

>
> --
> Joseph S. Myers
> jsm28@cam.ac.uk


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