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: question about AltiVec builtins



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


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