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 "-mcpu=generic" { target aarch64*-*-* } } */
4 /* { dg-additional-options "-mfma" { target i?86-*-* x86_64-*-* } } */
5 /* { dg-additional-options "-march=2.0" { target hppa*-*-* } } */
7 #define LOOP_COUNT 800000000
10 /* Check that FMAs with backedge dependency are avoided. Otherwise there won't
11 be FMA generated with "--param avoid-fma-max-bits=512". */
14 foo1 (data_e a
, data_e b
, data_e c
, data_e d
)
18 for (int ic
= 0; ic
< LOOP_COUNT
; ic
++)
20 result
+= (a
* b
+ c
* d
);
32 foo2 (data_e a
, data_e b
, data_e c
, data_e d
)
36 for (int ic
= 0; ic
< LOOP_COUNT
; ic
++)
38 result
= a
* b
+ result
+ c
* d
;
50 foo3 (data_e a
, data_e b
, data_e c
, data_e d
)
54 for (int ic
= 0; ic
< LOOP_COUNT
; ic
++)
56 result
= result
+ a
* b
+ c
* d
;
67 /* { dg-final { scan-tree-dump-times "Generated FMA" 3 "widening_mul"} } */