https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93819
--- Comment #1 from Carl Love <cel at us dot ibm.com> --- Created attachment 47873 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47873&action=edit Patch to fix vec_vrlnm() functionality The issue with the vec_rlnm() builtin is the order of the arguments in the builtin macro definition in gcc/config/rs6000/altivec.h. I have attached a patch to fix the issue. Here is the fix as well --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -182,7 +182,7 @@ #define vec_recipdiv __builtin_vec_recipdiv #define vec_rlmi __builtin_vec_rlmi #define vec_vrlnm __builtin_vec_rlnm -#define vec_rlnm(a,b,c) (__builtin_vec_rlnm((a),((b)<<8)|(c))) +#define vec_rlnm(a,b,c) (__builtin_vec_rlnm((a),((c)<<8)|(b))) #define vec_rsqrt __builtin_vec_rsqrt #define vec_rsqrte __builtin_vec_rsqrte #define vec_signed __builtin_vec_vsigned Basically the second and third arguments to the macro need to be reversed.