1 /* Check that the compiler properly uses 16-bit encodings where available. */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target arm_thumb2_ok } */
4 /* { dg-options "-Os -fno-builtin -mthumb" } */
12 /* { dg-final { scan-assembler "add r0, r0, r1" } } */
15 f2 (int a
, int b
, int c
)
20 /* { dg-final { scan-assembler "adds r0, r1, r2" } } */
27 /* { dg-final { scan-assembler "adds r0, r0, #255" } } */
35 /* { dg-final { scan-assembler "add r0, r0, #256" } } */
43 /* { dg-final { scan-assembler "subs r0, r0, #255" } } */
51 /* { dg-final { scan-assembler "sub r0, r0, #256" } } */
59 /* { dg-final { scan-assembler "adds r0, r1, #7" } } */
67 /* { dg-final { scan-assembler "add r0, r1, #8" } } */
75 /* { dg-final { scan-assembler "subs r0, r1, #7" } } */
83 /* { dg-final { scan-assembler "sub r0, r1, #8" } } */
91 /* { dg-final { scan-assembler "mov r0, r1" } } */
99 /* { dg-final { scan-assembler "movs r0, #255" } } */
107 /* { dg-final { scan-assembler "mov r0, #256" } } */
115 /* { dg-final { scan-assembler "lsls r0, r1, #15" } } */
123 /* { dg-final { scan-assembler "lsls r0, r0, r1" } } */
126 l2 (int a
, int b
, int c
)
131 /* { dg-final { scan-assembler "lsl r0, r1, r2" } } */
139 /* { dg-final { scan-assembler "asrs r0, r1, #15" } } */
147 /* { dg-final { scan-assembler "asrs r0, r0, r1" } } */
150 n2 (int a
, int b
, int c
)
155 /* { dg-final { scan-assembler "asr r0, r1, r2" } } */
158 o (unsigned int a
, unsigned int b
)
163 /* { dg-final { scan-assembler "lsrs r0, r1, #15" } } */
166 p1 (unsigned int a
, unsigned int b
)
171 /* { dg-final { scan-assembler "lsrs r0, r0, r1" } } */
174 p2 (unsigned int a
, unsigned int b
, unsigned int c
)
179 /* { dg-final { scan-assembler "lsr r0, r1, r2" } } */
187 /* { dg-final { scan-assembler "muls r0, r1, r0" } } */
195 /* { dg-final { scan-assembler "mvns r0, r1" } } */
203 /* { dg-final { scan-assembler "negs r0, r1" } } */