1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-require-effective-target powerpc_p9vector_ok } */
4 /* { dg-skip-if "" { powerpc*-*-aix* } } */
5 /* { dg-options "-mcpu=power9" } */
6 
7 /* This test should succeed on both 32- and 64-bit configurations.  */
8 #include <altivec.h>
9 
10 __vector unsigned int
doAbsoluteDifferenceUnsignedInt(__vector unsigned int * p,__vector unsigned int * q)11 doAbsoluteDifferenceUnsignedInt (__vector unsigned int *p,
12 				 __vector unsigned int *q)
13 {
14   __vector unsigned int source_1, source_2;
15   __vector unsigned int result;
16 
17   source_1 = *p;
18   source_2 = *q;
19 
20   result = __builtin_vec_vadu (source_1, source_2);
21   return result;
22 }
23 
24 /* { dg-final { scan-assembler "vabsduw" } } */
25