[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-store-builtin_vec_xst-char.c
blob162563caed4aefea15fc57ab21cfde82400a999b
1 /* Verify that overloaded built-ins for __builtin_vec_xst with char
2 inputs produce the right code. */
4 /* { dg-require-effective-target powerpc_vsx_ok } */
5 /* { dg-options "-mvsx -O2" } */
7 #include <altivec.h>
9 #define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \
10 void \
11 TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \
12 { \
13 __builtin_vec_xst (value, offset, saveto); \
16 #define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \
17 void \
18 TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \
19 { \
20 __builtin_vec_xst (value, CST_OFFSET, saveto); \
23 BUILD_VAR_TEST( test1, vector signed char, signed long long, signed char );
24 BUILD_VAR_TEST( test2, vector signed char, signed int, signed char );
25 BUILD_CST_TEST( test3, vector signed char, 12, signed char );
27 BUILD_VAR_TEST( test4, vector unsigned char, signed long long, unsigned char );
28 BUILD_VAR_TEST( test5, vector unsigned char, signed int, unsigned char );
29 BUILD_CST_TEST( test6, vector unsigned char, 12, unsigned char );
31 BUILD_VAR_TEST( test7, vector signed char, signed long long, vector signed char );
32 BUILD_VAR_TEST( test8, vector signed char, signed int, vector signed char );
33 BUILD_CST_TEST( test9, vector signed char, 12, vector signed char );
35 BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char );
36 BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char );
37 BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char );
39 /* { dg-final { scan-assembler-times {\mstxvw4x\M|\mstxvd2x\M|\mstxvx\M|\mstvx\M|\mpstxv\M} 12 } } */