Hi Kelvin, On Mon, Jun 06, 2016 at 05:58:00PM -0600, Kelvin Nilsen wrote: > Index: gcc/config/rs6000/altivec.h > =================================================================== > --- gcc/config/rs6000/altivec.h (revision 237045) > +++ gcc/config/rs6000/altivec.h (working copy) > @@ -401,6 +401,11 @@ > #define vec_vprtybq __builtin_vec_vprtybq > #endif > > +#define vec_adu __builtin_vec_vadu > +#define vec_adub __builtin_vec_vadub > +#define vec_aduh __builtin_vec_vaduh > +#define vec_aduw __builtin_vec_vaduw
I think the API says vec_absd? Please double-check. > +;; Vector absolute difference unsigned > +(define_expand "vadu<mode>3" > + [(set (match_operand:VI 0 "register_operand" "") > + (unspec:VI [(match_operand:VI 1 "register_operand" "") > + (match_operand:VI 2 "register_operand" "")] > + UNSPEC_VADU))] > + "TARGET_P9_VECTOR") You can leave off those constraints "", they are default. > +;; Vector absolute difference unsigned > +(define_insn "*p9_vadu<mode>3" > + [(set (match_operand:VI 0 "register_operand" "=v") > + (unspec:VI [(match_operand:VI 1 "register_operand" "v") > + (match_operand:VI 2 "register_operand" "v")] > + UNSPEC_VADU))] > + "TARGET_P9_VECTOR" > + "vabsdu<wd> %0, %1, %2" Don't use spaces after comma in asm. > + [(set_attr "type" "add") That's the wrong attr type; it should be something vector. "add" is for GPRs. > + (set_attr "length" "4")]) You don't need to say the default length. Segher