This is the mail archive of the 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 for stricter implicit conversions between vectors

A couple of comments about this patch.
First I think it will break the following for VMX:
#include <altivec.h>
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;
void f(void)
  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:

  return true;

Andrew Pinski

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