1 /* Test division by const int generates only one shift. */
3 /* { dg-options "-O2 -fdump-rtl-combine-all" } */
4 /* { dg-require-effective-target int32plus } */
6 extern void abort (void);
8 #define NOINLINE __attribute__((noinline))
43 /* Following replacement pattern of intger division by constant, GCC is expected
44 to generate MULT and (x)SHIFTRT. This test checks that considering division
45 by const 33, gcc generates a single ASHIFTRT by 35, instead of two - LSHIFTRT
46 by 32 and ASHIFTRT by 3. */
48 /* { dg-final { scan-rtl-dump "\\(set \\(subreg:DI \\(reg:SI" "combine" { target aarch64*-*-* } } } */
49 /* { dg-final { scan-rtl-dump "\\(ashiftrt:DI \\(reg:DI" "combine" { target aarch64*-*-* } } } */
50 /* { dg-final { scan-rtl-dump "\\(const_int 35 " "combine" { target aarch64*-*-* } } } */
52 /* Similarly, considering division by const 77, gcc generates a single ASHIFTRT
53 by 36, instead of two - LSHIFTRT by 32 and ASHIFTRT by 4. */
55 /* { dg-final { scan-rtl-dump "\\(const_int 36 " "combine" { target aarch64*-*-* } } } */