digitalmars.D.ldc - [work on blas] fp-contract
- Ilya (6/6) Dec 30 2015 Hi,
- Johan Engelen (6/10) Dec 31 2015 Clang implements the pragma `#pragma STDC FP_CONTRACT` (you can
- Johan Engelen (7/8) Dec 31 2015 I take that back. It is simple to implement the pragma itself,
Hi, Can fp-constract flag be added to LDC to allow auto fusion of mull/add operations? Is it possible to make `fp-constract` a function attribute? Thanks, Ilya
Dec 30 2015
On Thursday, 31 December 2015 at 04:32:27 UTC, Ilya wrote:Hi, Can fp-constract flag be added to LDC to allow auto fusion of mull/add operations? Is it possible to make `fp-constract` a function attribute?Clang implements the pragma `#pragma STDC FP_CONTRACT` (you can enable it per compound statement). I think it's good to do the same. This should be relatively simple to implement. See: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/fp-contract-pragma.cpp?view=markup
Dec 31 2015
On Thursday, 31 December 2015 at 13:07:47 UTC, Johan Engelen wrote:This should be relatively simple to implement.I take that back. It is simple to implement the pragma itself, but actually fusing ops (in the frontend) will be some more work / requires deeper knowledge of LDC. For a future implementer: you may want to have a look at clang's "tryEmitFMulAdd()" in lib/CodeGen/CGExprScalar.cpp.
Dec 31 2015