1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3
4 int
ldr_uxtw(int * arr,unsigned int i)5 ldr_uxtw (int *arr, unsigned int i)
6 {
7 /* { dg-final { scan-assembler "ldr\tw\[0-9\]+,.*uxtw #?2]" } } */
8 return arr[i];
9 }
10
11 int
ldr_uxtw0(char * arr,unsigned int i)12 ldr_uxtw0 (char *arr, unsigned int i)
13 {
14 /* { dg-final { scan-assembler "ldr\tw\[0-9\]+,.*uxtw]" } } */
15 return arr[i];
16 }
17
18 int
ldr_sxtw(int * arr,int i)19 ldr_sxtw (int *arr, int i)
20 {
21 /* { dg-final { scan-assembler "ldr\tw\[0-9\]+,.*sxtw #?2]" } } */
22 return arr[i];
23 }
24
25 int
ldr_sxtw0(char * arr,int i)26 ldr_sxtw0 (char *arr, int i)
27 {
28 /* { dg-final { scan-assembler "ldr\tw\[0-9\]+,.*sxtw]" } } */
29 return arr[i];
30 }
31
32 unsigned long long
adddi_uxtw(unsigned long long a,unsigned int i)33 adddi_uxtw (unsigned long long a, unsigned int i)
34 {
35 /* { dg-final { scan-assembler "add\tx\[0-9\]+,.*uxtw #?3" } } */
36 return a + ((unsigned long long)i << 3);
37 }
38
39 unsigned long long
adddi_uxtw0(unsigned long long a,unsigned int i)40 adddi_uxtw0 (unsigned long long a, unsigned int i)
41 {
42 /* { dg-final { scan-assembler "add\tx\[0-9\]+,.*uxtw\n" } } */
43 return a + i;
44 }
45
46 long long
adddi_sxtw(long long a,int i)47 adddi_sxtw (long long a, int i)
48 {
49 /* { dg-final { scan-assembler "add\tx\[0-9\]+,.*sxtw #?3" } } */
50 return a + ((long long)i << 3);
51 }
52
53 long long
adddi_sxtw0(long long a,int i)54 adddi_sxtw0 (long long a, int i)
55 {
56 /* { dg-final { scan-assembler "add\tx\[0-9\]+,.*sxtw\n" } } */
57 return a + i;
58 }
59
60 unsigned long long
subdi_uxtw(unsigned long long a,unsigned int i)61 subdi_uxtw (unsigned long long a, unsigned int i)
62 {
63 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*uxtw #?3" } } */
64 return a - ((unsigned long long)i << 3);
65 }
66
67 unsigned long long
subdi_uxtw0(unsigned long long a,unsigned int i)68 subdi_uxtw0 (unsigned long long a, unsigned int i)
69 {
70 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*uxtw\n" } } */
71 return a - i;
72 }
73
74 long long
subdi_sxtw(long long a,int i)75 subdi_sxtw (long long a, int i)
76 {
77 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*sxtw #?3" } } */
78 return a - ((long long)i << 3);
79 }
80
81 long long
subdi_sxtw0(long long a,int i)82 subdi_sxtw0 (long long a, int i)
83 {
84 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*sxtw\n" } } */
85 return a - (long long)i;
86 }
87
88 unsigned long long
subdi_uxth(unsigned long long a,unsigned short i)89 subdi_uxth (unsigned long long a, unsigned short i)
90 {
91 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*uxth #?1" } } */
92 return a - ((unsigned long long)i << 1);
93 }
94
95 unsigned long long
subdi_uxth0(unsigned long long a,unsigned short i)96 subdi_uxth0 (unsigned long long a, unsigned short i)
97 {
98 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*uxth\n" } } */
99 return a - i;
100 }
101
102 long long
subdi_sxth(long long a,short i)103 subdi_sxth (long long a, short i)
104 {
105 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*sxth #?1" } } */
106 return a - ((long long)i << 1);
107 }
108
109 long long
subdi_sxth0(long long a,short i)110 subdi_sxth0 (long long a, short i)
111 {
112 /* { dg-final { scan-assembler "sub\tx\[0-9\]+,.*sxth\n" } } */
113 return a - (long long)i;
114 }
115
116 unsigned int
subsi_uxth(unsigned int a,unsigned short i)117 subsi_uxth (unsigned int a, unsigned short i)
118 {
119 /* { dg-final { scan-assembler "sub\tw\[0-9\]+,.*uxth #?1" } } */
120 return a - ((unsigned int)i << 1);
121 }
122
123 unsigned int
subsi_uxth0(unsigned int a,unsigned short i)124 subsi_uxth0 (unsigned int a, unsigned short i)
125 {
126 /* { dg-final { scan-assembler "sub\tw\[0-9\]+,.*uxth\n" } } */
127 return a - i;
128 }
129
130 int
subsi_sxth(int a,short i)131 subsi_sxth (int a, short i)
132 {
133 /* { dg-final { scan-assembler "sub\tw\[0-9\]+,.*sxth #?1" } } */
134 return a - ((int)i << 1);
135 }
136
137 int
subsi_sxth0(int a,short i)138 subsi_sxth0 (int a, short i)
139 {
140 /* { dg-final { scan-assembler "sub\tw\[0-9\]+,.*sxth\n" } } */
141 return a - (int)i;
142 }
143
144 unsigned int
addsi_uxth(unsigned int a,unsigned short i)145 addsi_uxth (unsigned int a, unsigned short i)
146 {
147 /* { dg-final { scan-assembler "add\tw\[0-9\]+,.*uxth #?1" } } */
148 return a + ((unsigned int)i << 1);
149 }
150
151 unsigned int
addsi_uxth0(unsigned int a,unsigned short i)152 addsi_uxth0 (unsigned int a, unsigned short i)
153 {
154 /* { dg-final { scan-assembler "add\tw\[0-9\]+,.*uxth\n" } } */
155 return a + i;
156 }
157
158 int
addsi_sxth(int a,short i)159 addsi_sxth (int a, short i)
160 {
161 /* { dg-final { scan-assembler "add\tw\[0-9\]+,.*sxth #?1" } } */
162 return a + ((int)i << 1);
163 }
164
165 int
addsi_sxth0(int a,short i)166 addsi_sxth0 (int a, short i)
167 {
168 /* { dg-final { scan-assembler "add\tw\[0-9\]+,.*sxth\n" } } */
169 return a + (int)i;
170 }
171