Help restricting args of an intrinsic function

Syd Polk spolk@apple.com
Tue Feb 3 00:29:00 GMT 2004


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



More information about the Gcc mailing list