Thread overview | |||||
---|---|---|---|---|---|
|
December 31, 2015 [work on blas] fp-contract | ||||
---|---|---|---|---|
| ||||
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 |
December 31, 2015 Re: [work on blas] fp-contract | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya | 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 |
December 31, 2015 Re: [work on blas] fp-contract | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Engelen | 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.
|
Copyright © 1999-2021 by the D Language Foundation