This is the mail archive of the
mailing list for the GCC project.
Re: Patch for stricter implicit conversions between vectors
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Mark Shinwell <shinwell at codesourcery dot com>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 13 Dec 2006 23:48:52 -0800
- Subject: Re: Patch for stricter implicit conversions between vectors
- References: <4559B33A.firstname.lastname@example.org>
A couple of comments about this patch.
First I think it will break the following for VMX:
vector unsigned short f(vector unsigned char a, vector unsigned char b)
return vec_vmuloub(a, b);
Which is valid.
> Index: gcc/config/rs6000/altivec.h
I rather have you patch builtins to have the correct type, this will
help memory usage with code with a lot of intrinsics and also fix
vec_vmuloub testcase (as I think it is the same issue).
The patch to gcc/config/i386/i386.c makes little sense as intQI should
be the same type as char. I think the real issue is the use of
"TREE_TYPE (t1) == TREE_TYPE (t2)" in vector_types_convertible_p, I
would use lang_hooks.types_compatible_p instead.
The reason why I say TREE_TYPE (t1) == TREE_TYPE (t2) is a bad idea is I
don't think it works nicely with typedefs:
#define vector __attribute__((vector_size(16) ))
typedef int myint;
vector myint a;
vector int b;
a = b;
We do get the "correct" debug info for this case though I wonder if they
really should be variant of each other if they are not already.
I wonder if most of this function can be reduced since we create less
vector types now down to:
if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))