1 /* { dg-do compile } */
2 /* { dg-options "-mno-mips16 -mfp64 -mhard-float -mmsa" } */
3
4 typedef int v4i32 __attribute__ ((vector_size(16)));
5 typedef long long v2i64 __attribute__ ((vector_size(16)));
6
7 /* Test MSA dot product family for CSE optimization. */
8
9 static v4i32 g = {0, 92, 93, 94};
10 static v4i32 h = {12, 24, 36, 48};
11 static v2i64 l = {84, 98};
12
13 void
dotp_d_msa(v2i64 * c)14 dotp_d_msa (v2i64 *c)
15 {
16 l = __builtin_msa_dotp_s_d (g, h);
17 }
18 /* { dg-final { scan-assembler "dotp_s.d" } } */
19
20 void
dpadd_d_msa(v2i64 * c)21 dpadd_d_msa (v2i64 *c)
22 {
23 *c = __builtin_msa_dpadd_s_d (l, g, h);
24 }
25 /* { dg-final { scan-assembler "dpadd_s.d" } } */
26
27 void
dpsub_d_msa(v2i64 * c)28 dpsub_d_msa (v2i64 *c)
29 {
30 *c = __builtin_msa_dpsub_s_d (l, g, h);
31 }
32 /* { dg-final { scan-assembler "dpsub_s.d" } } */
33