AltiVec [RFH] Overload resolution of vec_subs intrinsic fails

Fariborz Jahanian fjahanian@apple.com
Fri Apr 9 00:27:00 GMT 2004


In the following test case, gcc3.5, etc. incorrectly generate 'vsubuhs' 
instead of the
signed variety. It is because overload resolution of vec_subs selects
__builtin_altivec_vsubuhs, instead of __builtin_altivec_vsubshs. Our 
AltiVec
front-end guy is out on vacation and I appreciate help in resolving 
this issue. I
have spent enough time on this that I think I need to ask some one.

- Thanks, Fariborz (fjahanian@apple.com)


Test case:

#include <altivec.h>
int main()
{
         __vector signed short  res;
         __vector signed short t8;
         __vector signed short t9;
         res = vec_subs(t8, t9);
}


...
        lvx v1,r30,r0
         li r0,64
         lvx v0,r30,r0
         vsubuhs v0,v1,v0	<-----
         li r0,32
         stvx v0,r30,r0
...



More information about the Gcc mailing list