summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c
blob: 1360f4d4ce950714e7dfcfc73e5beb3171d1c06a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Verify that overloaded built-ins for vec_vsx_st with double
   inputs produce the right code.  */

/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mvsx -O2" } */

#include <altivec.h>

#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)		\
void									\
TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) 	\
{									\
	vec_vsx_st (value, offset, saveto);		\
}

#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)		\
void									\
TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) 			\
{									\
	vec_vsx_st (value, CST_OFFSET, saveto);		\
}

BUILD_VAR_TEST( test1,  vector double, signed long long, double );
BUILD_VAR_TEST( test2,  vector double, signed int, double );
BUILD_CST_TEST( test3,  vector double, 12, double );

BUILD_VAR_TEST( test7,  vector double, signed long long, vector double );
BUILD_VAR_TEST( test8,  vector double, signed int, vector double );
BUILD_CST_TEST( test9,  vector double, 12, vector double );

/* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxvx\M|\mstvx\M|\mpstxv\M} 6 } } */