i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-u16.c
blob258d253f401459d448d1ae86f56b0c97815d5b61
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-additional-options "-mlasx" { target loongarch*-*-*} } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #define N 64
11 unsigned short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13 unsigned int result[N];
15 /* unsigned short->unsigned int widening-mult. */
16 __attribute__ ((noinline)) int
17 foo1(int len) {
18 int i;
20 for (i=0; i<len; i++) {
21 result[i] = (unsigned int)(X[i] * Y[i]);
25 int main (void)
27 int i;
29 check_vect ();
31 for (i=0; i<N; i++) {
32 X[i] = i;
33 Y[i] = 64-i;
34 __asm__ volatile ("");
37 foo1 (N);
39 #pragma GCC novector
40 for (i=0; i<N; i++) {
41 if (result[i] != X[i] * Y[i])
42 abort ();
45 return 0;
48 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
49 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
50 /* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */