1 /* Verify that overloaded built-ins for __builtin_vec_xl with double 2 inputs produce the right code. */ 3 4 /* { dg-require-effective-target powerpc_vsx_ok } */ 5 /* { dg-options "-mvsx -O2" } */ 6 7 #include <altivec.h> 8 9 #define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ 10 RETTYPE \ 11 TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ 12 { \ 13 return __builtin_vec_xl (offset, loadfrom); \ 14 } 15 16 #define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ 17 RETTYPE \ 18 TESTNAME1 ## _cst (LOADFROM * loadfrom) \ 19 { \ 20 return __builtin_vec_xl (CST_OFFSET, loadfrom); \ 21 } 22 23 BUILD_VAR_TEST( test1, vector double, signed long long, double); 24 BUILD_VAR_TEST( test2, vector double, signed int, double); 25 BUILD_CST_TEST( test3, vector double, 12, double); 26 27 BUILD_VAR_TEST( test4, vector double, signed long long, vector double); 28 BUILD_VAR_TEST( test5, vector double, signed int, vector double); 29 BUILD_CST_TEST( test6, vector double, 12, vector double); 30 31 /* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxvx\M|\mlvx\M} 6 } } */ 32