1 /* Verify that overloaded built-ins for vec_vsx_st with long long 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, VALUE, VAR_OFFSET, SAVETO) \ 10 void \ 11 TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ 12 { \ 13 vec_vsx_st (value, offset, saveto); \ 14 } 15 16 #define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ 17 void \ 18 TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ 19 { \ 20 vec_vsx_st (value, CST_OFFSET, saveto); \ 21 } 22 23 BUILD_VAR_TEST( test1, vector signed long long, signed long long, signed long long ); 24 BUILD_VAR_TEST( test2, vector signed long long, signed int, signed long long ); 25 BUILD_CST_TEST( test3, vector signed long long, 12, signed long long ); 26 27 BUILD_VAR_TEST( test4, vector unsigned long long, signed long long, unsigned long long ); 28 BUILD_VAR_TEST( test5, vector unsigned long long, signed int, unsigned long long ); 29 BUILD_CST_TEST( test6, vector unsigned long long, 12, unsigned long long ); 30 31 BUILD_VAR_TEST( test7, vector signed long long, signed long long, vector signed long long ); 32 BUILD_VAR_TEST( test8, vector signed long long, signed int, vector signed long long ); 33 BUILD_CST_TEST( test9, vector signed long long, 12, vector signed long long ); 34 35 BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long ); 36 BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long ); 37 BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long ); 38 39 /* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxvx\M|\mstvx\M|\mpstxv\M} 12 } } */ 40