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: Help restricting args of an intrinsic function



On Feb 2, 2004, at 3:56 PM, Richard Henderson wrote:


On Mon, Feb 02, 2004 at 03:44:11PM -0800, Syd Polk wrote:
I don't think that we will need the pointer case. We will need the
following:

- hard-coded integers
- const int variables
- static const int members in C++
- enums

Point the second should be for C++ only, where it has integer constant expression semantics.

At which point, you're in EXACTLY the same situation that already
exists for x86 and altivec intrinsics.  This is not a new problem,
and it does not need a new solution.


#include "altivec.h"


int main(int argc, const *argv[])
{
  const int shift = 3;
  const vector int foo;

  vec_splat (foo, 5);
  vec_splat (foo, shift);
}

produces:

[stravinsky:FSF/TOT-intrinsics/gcc] spolk% ./xgcc -B . -fPIC -maltivec /tmp/altivec.c /tmp/altivec.c: In function `main':
/tmp/altivec.c:9: error: argument 2 must be a 5-bit unsigned literal


This is the problem I am trying to solve. Line 9 should compile as well. Our competition can do it. We cannot. I am trying to make it work.



r~



Syd Polk
Apple Computer
Technology EPM, Mac OS X Development Tools
+1 408 974-0577


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