2 /* { dg-require-effective-target lp64 } */
3 /* { dg-options "-O2 -ftree-vectorize" } */
6 #define ALIGN16 __attribute__((__aligned__(32)))
50 unsigned short us
[16];
53 static union ui2 i32_sa ALIGN16
;
54 static union ui2 i32_ua ALIGN16
;
56 static union us i16_b ALIGN16
= {
75 static union us i16_c ALIGN16
= {
94 static long i32_sr
[16] ALIGN16
= {
95 ((int)I16_B0
) * ((int)I16_C0
),
96 ((int)I16_B1
) * ((int)I16_C1
),
97 ((int)I16_B2
) * ((int)I16_C2
),
98 ((int)I16_B3
) * ((int)I16_C3
),
99 ((int)I16_B4
) * ((int)I16_C4
),
100 ((int)I16_B5
) * ((int)I16_C5
),
101 ((int)I16_B6
) * ((int)I16_C6
),
102 ((int)I16_B7
) * ((int)I16_C7
),
103 ((int)I16_B8
) * ((int)I16_C8
),
104 ((int)I16_B9
) * ((int)I16_C9
),
105 ((int)I16_B10
) * ((int)I16_C10
),
106 ((int)I16_B11
) * ((int)I16_C11
),
107 ((int)I16_B12
) * ((int)I16_C12
),
108 ((int)I16_B13
) * ((int)I16_C13
),
109 ((int)I16_B14
) * ((int)I16_C14
),
110 ((int)I16_B15
) * ((int)I16_C15
),
113 static unsigned long i32_ur
[16] ALIGN16
= {
114 ((unsigned int)(unsigned short)I16_B0
) * ((unsigned int)(unsigned short)I16_C0
),
115 ((unsigned int)(unsigned short)I16_B1
) * ((unsigned int)(unsigned short)I16_C1
),
116 ((unsigned int)(unsigned short)I16_B2
) * ((unsigned int)(unsigned short)I16_C2
),
117 ((unsigned int)(unsigned short)I16_B3
) * ((unsigned int)(unsigned short)I16_C3
),
118 ((unsigned int)(unsigned short)I16_B4
) * ((unsigned int)(unsigned short)I16_C4
),
119 ((unsigned int)(unsigned short)I16_B5
) * ((unsigned int)(unsigned short)I16_C5
),
120 ((unsigned int)(unsigned short)I16_B6
) * ((unsigned int)(unsigned short)I16_C6
),
121 ((unsigned int)(unsigned short)I16_B7
) * ((unsigned int)(unsigned short)I16_C7
),
122 ((unsigned int)(unsigned short)I16_B8
) * ((unsigned int)(unsigned short)I16_C8
),
123 ((unsigned int)(unsigned short)I16_B9
) * ((unsigned int)(unsigned short)I16_C9
),
124 ((unsigned int)(unsigned short)I16_B10
) * ((unsigned int)(unsigned short)I16_C10
),
125 ((unsigned int)(unsigned short)I16_B11
) * ((unsigned int)(unsigned short)I16_C11
),
126 ((unsigned int)(unsigned short)I16_B12
) * ((unsigned int)(unsigned short)I16_C12
),
127 ((unsigned int)(unsigned short)I16_B13
) * ((unsigned int)(unsigned short)I16_C13
),
128 ((unsigned int)(unsigned short)I16_B14
) * ((unsigned int)(unsigned short)I16_C14
),
129 ((unsigned int)(unsigned short)I16_B15
) * ((unsigned int)(unsigned short)I16_C15
),
133 #define ALIGN32 __attribute__((__aligned__(32)))
140 #define I32_B4 101112
142 #define I32_B6 141516
146 #define I32_C1 45678910
164 static union ul i64_sa ALIGN32
;
165 static union ul i64_ua ALIGN32
;
167 static union ui i32_b ALIGN32
= {
178 static union ui i32_c ALIGN32
= {
189 static long i64_sr
[8] ALIGN32
= {
190 ((long)I32_B0
) * ((long)I32_C0
),
191 ((long)I32_B1
) * ((long)I32_C1
),
192 ((long)I32_B2
) * ((long)I32_C2
),
193 ((long)I32_B3
) * ((long)I32_C3
),
194 ((long)I32_B4
) * ((long)I32_C4
),
195 ((long)I32_B5
) * ((long)I32_C5
),
196 ((long)I32_B6
) * ((long)I32_C6
),
197 ((long)I32_B7
) * ((long)I32_C7
),
200 static unsigned long i64_ur
[8] ALIGN32
= {
201 ((unsigned long)(unsigned)I32_B0
) * ((unsigned long)(unsigned)I32_C0
),
202 ((unsigned long)(unsigned)I32_B1
) * ((unsigned long)(unsigned)I32_C1
),
203 ((unsigned long)(unsigned)I32_B2
) * ((unsigned long)(unsigned)I32_C2
),
204 ((unsigned long)(unsigned)I32_B3
) * ((unsigned long)(unsigned)I32_C3
),
205 ((unsigned long)(unsigned)I32_B4
) * ((unsigned long)(unsigned)I32_C4
),
206 ((unsigned long)(unsigned)I32_B5
) * ((unsigned long)(unsigned)I32_C5
),
207 ((unsigned long)(unsigned)I32_B6
) * ((unsigned long)(unsigned)I32_C6
),
208 ((unsigned long)(unsigned)I32_B7
) * ((unsigned long)(unsigned)I32_C7
),
216 /* Signed 16x16 -> 32-bit tests */
217 for (i
= 0; i
< 16; i
++)
218 i32_sa
.si
[i
] = ((long)i16_b
.ss
[i
]) * ((long)i16_c
.ss
[i
]);
220 for (i
= 0; i
< 16; i
++)
221 if (i32_sa
.si
[i
] != i32_sr
[i
])
224 /* Unsigned 16x16 -> 32-bit tests */
225 for (i
= 0; i
< 16; i
++)
226 i32_ua
.ui
[i
] = ((long)i16_b
.us
[i
]) * ((long)i16_c
.us
[i
]);
228 for (i
= 0; i
< 16; i
++)
229 if (i32_ua
.ui
[i
] != i32_ur
[i
])
232 /* Signed 32x32 -> 64-bit tests */
233 for (i
= 0; i
< 8; i
++)
234 i64_sa
.sl
[i
] = ((long)i32_b
.si
[i
]) * ((long)i32_c
.si
[i
]);
236 for (i
= 0; i
< 8; i
++)
237 if (i64_sa
.sl
[i
] != i64_sr
[i
])
240 /* Unsigned 32x32 -> 64-bit tests */
241 for (i
= 0; i
< 8; i
++)
242 i64_ua
.ul
[i
] = ((long)i32_b
.ui
[i
]) * ((long)i32_c
.ui
[i
]);
244 for (i
= 0; i
< 8; i
++)
245 if (i64_ua
.ul
[i
] != i64_ur
[i
])