Handle T_HRESULT types in CodeView records
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-splat-constant-v8hi.c
blob59418d3bb0a8ef0d1142843f2b73add30f1ef676
1 /* { dg-do compile } */
2 /* { dg-require-effective-target power10_ok } */
3 /* { dg-options "-mdejagnu-cpu=power10 -O2" } */
5 #include <altivec.h>
7 /* Test whether XXSPLTIW is generated for V8HI vector constants. We make sure
8 the power9 support (XXSPLTIB/VUPKLSB) is not done. */
10 vector short
11 v8hi_const_1 (void)
13 return (vector short) { 1, 1, 1, 1, 1, 1, 1, 1 }; /* VSLTPISH. */
16 vector short
17 v8hi_const_126 (void)
19 return (vector short) { 126, 126, 126, 126,
20 126, 126, 126, 126 }; /* XXSPLTIW. */
23 vector short
24 v8hi_const_1023 (void)
26 return (vector short) { 1023, 1023, 1023, 1023,
27 1023, 1023, 1023, 1023 }; /* XXSPLTIW. */
30 vector short
31 v8hi_splats_1 (void)
33 return vec_splats ((short)1); /* VSLTPISH. */
36 vector short
37 v8hi_splats_126 (void)
39 return vec_splats ((short)126); /* XXSPLTIW. */
42 vector short
43 v8hi_splats_1023 (void)
45 return vec_splats ((short)1023); /* XXSPLTIW. */
48 /* Test that we can optimiza V8HI where all of the even elements are the same
49 and all of the odd elements are the same. */
50 vector short
51 v8hi_const_1023_1000 (void)
53 return (vector short) { 1023, 1000, 1023, 1000,
54 1023, 1000, 1023, 1000 }; /* XXSPLTIW. */
57 /* { dg-final { scan-assembler-times {\mxxspltiw\M} 5 } } */
58 /* { dg-final { scan-assembler-times {\mvspltish\M} 2 } } */
59 /* { dg-final { scan-assembler-not {\mxxspltib\M} } } */
60 /* { dg-final { scan-assembler-not {\mvupklsb\M} } } */
61 /* { dg-final { scan-assembler-not {\mlxvx?\M} } } */
62 /* { dg-final { scan-assembler-not {\mplxv\M} } } */