]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.target/aarch64/vect-widen-shift.c
AArch64: Undo vec_widen_<sur>shiftl optabs [PR106346]
[gcc.git] / gcc / testsuite / gcc.target / aarch64 / vect-widen-shift.c
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -save-temps" } */
3 /* { dg-final { check-function-bodies "**" "" "" } } */
4 #include <stdint.h>
5 #include <string.h>
6
7 #pragma GCC target "+nosve"
8
9 #define ARR_SIZE 1024
10
11 /* Should produce an shll,shll2 pair*/
12 /*
13 ** sshll_opt1:
14 ** ...
15 ** shll v[0-9]+.4s, v[0-9]+.4h, 16
16 ** shll2 v[0-9]+.4s, v[0-9]+.8h, 16
17 ** ...
18 */
19 void sshll_opt1 (int32_t *foo, int16_t *a, int16_t *b)
20 {
21 for( int i = 0; i < ARR_SIZE - 3;i=i+4)
22 {
23 foo[i] = a[i] << 16;
24 foo[i+1] = a[i+1] << 16;
25 foo[i+2] = a[i+2] << 16;
26 foo[i+3] = a[i+3] << 16;
27 }
28 }
29
30 /*
31 ** sshll_opt2:
32 ** ...
33 ** sxtl v[0-9]+.4s, v[0-9]+.4h
34 ** sxtl2 v[0-9]+.4s, v[0-9]+.8h
35 ** sshl v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s
36 ** sshl v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s
37 ** ...
38 */
39 void sshll_opt2 (int32_t *foo, int16_t *a, int16_t *b)
40 {
41 for( int i = 0; i < ARR_SIZE - 3;i=i+4)
42 {
43 foo[i] = a[i] << 16;
44 foo[i+1] = a[i+1] << 15;
45 foo[i+2] = a[i+2] << 14;
46 foo[i+3] = a[i+3] << 17;
47 }
48 }
49
50
This page took 0.037731 seconds and 5 git commands to generate.