question about AltiVec builtins

Fariborz Jahanian fjahanian@apple.com
Tue May 11 00:51:00 GMT 2004


On May 10, 2004, at 5:28 PM, Janis Johnson wrote:

Do scalar parameters to AltiVec builtins need to have exactly the same
type as the prototype, or promotion rules apply?  This test case fails
2nd argument to vec_dst can be any integral type. This is a gcc bug.

- fariborz


for all invocations of vec_dst where the second parameter is not 'int',
with gcc built from today's mainline:
#include <altivec.h>

vector int vi = { 1, 2, 3, 4 };

int
main ()
{
    unsigned long ul = 2;
    signed long sl = 2;
    unsigned int ui = 2;
    signed int si = 2;
    vec_dst (&vi, ul, 0);
    vec_dst (&vi, sl, 0);
    vec_dst (&vi, ui, 0);
    vec_dst (&vi, si, 0);
    return 0;
}
dufur% $GCC -maltivec -c bug.c
bug.c: In function `main':
bug.c:13: error: invalid parameter combination for `vec_dst' AltiVec 
intrinsic
bug.c:14: error: invalid parameter combination for `vec_dst' AltiVec 
intrinsic
bug.c:15: error: invalid parameter combination for `vec_dst' AltiVec 
intrinsic

Janis




More information about the Gcc mailing list