1 /* { dg-require-effective-target p9vector_hw } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-options "-mcpu=power9 -O3 --param tree-reassoc-width=1" } */
5 /* Originally from gcc.dg/vect/pr45752.c. */
11 extern void abort (void);
12 extern void exit (int);
49 void foo (unsigned int *__restrict__ pInput
,
50 unsigned int *__restrict__ pOutput
,
51 unsigned int *__restrict__ pInput2
,
52 unsigned int *__restrict__ pOutput2
)
54 unsigned int i
, a
, b
, c
, d
, e
;
56 for (i
= 0; i
< N
/ 5; i
++)
64 *pOutput
++ = M00
* a
+ M01
* b
+ M02
* c
+ M03
* d
+ M04
* e
;
65 *pOutput
++ = M10
* a
+ M11
* b
+ M12
* c
+ M13
* d
+ M14
* e
;
66 *pOutput
++ = M20
* a
+ M21
* b
+ M22
* c
+ M23
* d
+ M24
* e
;
67 *pOutput
++ = M30
* a
+ M31
* b
+ M32
* c
+ M33
* d
+ M34
* e
;
68 *pOutput
++ = M40
* a
+ M41
* b
+ M42
* c
+ M43
* d
+ M44
* e
;
77 *pOutput2
++ = M00
* a
+ M01
* b
+ M02
* c
+ M03
* d
+ M04
* e
;
78 *pOutput2
++ = M10
* a
+ M11
* b
+ M12
* c
+ M13
* d
+ M14
* e
;
79 *pOutput2
++ = M20
* a
+ M21
* b
+ M22
* c
+ M23
* d
+ M24
* e
;
80 *pOutput2
++ = M30
* a
+ M31
* b
+ M32
* c
+ M33
* d
+ M34
* e
;
81 *pOutput2
++ = M40
* a
+ M41
* b
+ M42
* c
+ M43
* d
+ M44
* e
;
86 int main (int argc
, const char* argv
[])
88 unsigned int input
[N
], output
[N
], i
, input2
[N
], output2
[N
];
89 unsigned int check_results
[N
]
90 = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399,
91 22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, 31619 };
92 unsigned int check_results2
[N
]
93 = {7136, 2702, 84604, 57909, 6633, 16956, 6122, 224204, 113484, 16243,
94 26776, 9542, 363804, 169059, 25853, 36596, 12962, 503404, 224634, 35463 };
96 for (i
= 0; i
< N
; i
++)
102 __asm__
volatile ("");
105 foo (input
, output
, input2
, output2
);
107 for (i
= 0; i
< N
; i
++)
108 if (output
[i
] != check_results
[i
]
109 || output2
[i
] != check_results2
[i
])