1 /* { dg-do compile } */
2 /* { dg-options "-Ofast --param avoid-fma-max-bits=512 --param tree-reassoc-width=4 -fdump-tree-widening_mul-details" } */
3 /* { dg-additional-options "-march=armv8.2-a" { target aarch64-*-* } } */
4 /* { dg-additional-options "-march=2.0" { target hppa*-*-* } } */
6 #define LOOP_COUNT 800000000
9 /* Check that FMAs with backedge dependency are avoided. Otherwise there won't
10 be FMA generated with "--param avoid-fma-max-bits=512". */
13 foo1 (data_e a
, data_e b
, data_e c
, data_e d
)
17 for (int ic
= 0; ic
< LOOP_COUNT
; ic
++)
19 result
+= (a
* b
+ c
* d
);
31 foo2 (data_e a
, data_e b
, data_e c
, data_e d
)
35 for (int ic
= 0; ic
< LOOP_COUNT
; ic
++)
37 result
= a
* b
+ result
+ c
* d
;
49 foo3 (data_e a
, data_e b
, data_e c
, data_e d
)
53 for (int ic
= 0; ic
< LOOP_COUNT
; ic
++)
55 result
= result
+ a
* b
+ c
* d
;
66 /* { dg-final { scan-tree-dump-times "Generated FMA" 3 "widening_mul"} } */