111
|
1 /* { dg-require-effective-target divmod } */
|
|
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
|
|
3 /* div comes before mod in same bb. */
|
|
4
|
|
5 typedef int SImode __attribute__((mode(SI)));
|
|
6 typedef unsigned USImode __attribute__((mode(SI)));
|
|
7
|
|
8 typedef int DImode __attribute__((mode(DI)));
|
|
9 typedef unsigned UDImode __attribute__((mode(DI)));
|
|
10
|
|
11 extern int cond;
|
|
12 void foo(void);
|
|
13
|
|
14 #define FOO(smalltype, bigtype, no) \
|
|
15 bigtype f_##no(smalltype x, bigtype y) \
|
|
16 { \
|
|
17 bigtype q = x / y; \
|
|
18 bigtype r = x % y; \
|
|
19 return q + r; \
|
|
20 }
|
|
21
|
|
22 FOO(SImode, DImode, 1)
|
|
23 FOO(SImode, UDImode, 2)
|
|
24 FOO(USImode, DImode, 3)
|
|
25 FOO(USImode, UDImode, 4)
|
|
26 FOO(DImode, DImode, 5)
|
|
27 FOO(DImode, UDImode, 6)
|
|
28 FOO(UDImode, UDImode, 7)
|
|
29
|
|
30 /* { dg-final { scan-tree-dump-times "DIVMOD" 7 "widening_mul" } } */
|