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 Thu, 29 Nov 2001, Daniel Berlin wrote:

> I want to know if it's even acceptable as a principle before I attempt 
> to write up docs.

Acceptability depends on what exactly you're trying to do, which depends
on the 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.

Exact list please.  For example, do you allow the << and >> operators on
vectors of integers?  If so, what do they mean?  Shifts of individual
elements?  What do logic operations such as ! mean on vectors?

The C type system is complicated.  C99 complicated it further with complex
types.  I won't ask right now for the rules for the vector types to be put
in suitable form for input to a theorem-proving system, but it needs to be
absolutely clear exactly what can be done and what it means, and the
meanings need to be clear to readers of the code.

> > 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.

But float - int is allowed - the arguments both get promoted to float.  
What promotions apply to the vectors?  (Note that arithmetic on char will 
promote it to int, but you might not want operations on vectors of char to 
promote them to vectors of int.)

> 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.

I don't think it's particularly clear to a reader of a program what *
means on vectors, either.

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

Some RTL and tree operations can already only be obtained by built-in
functions (target-independent functions, but with insn patterns only
provided on some targets).

> Not yet, but i will.
> As I said, i'm just testing the waters, not looking for approval (except 

In that case, send docs, not code.

-- 
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]