[PATCH] D80440: [OpenCL] Prevent fused mul and add by default

2020-05-27 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm requested changes to this revision. arsenm added a comment. This revision now requires changes to proceed. I think the current handling is correct. As you said, the specified default is FP_CONTRACT ON. The description of the mad function in the table is unrelated, since that's the definit

[PATCH] D80440: [OpenCL] Prevent fused mul and add by default

2020-05-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Contraction is just an optimization technique. Unless a user explicitly requests strict FP semantics, contraction does not break C++ semantics. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80440/new/ https://reviews.llvm.org/D80440 ___

[PATCH] D80440: [OpenCL] Prevent fused mul and add by default

2020-05-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I think "the default value is on" is meant to imply that contraction is allowed by default, not that you can write the pragma without an `on-off-switch` and it means "on". FWIW, that would be consistent with C, which also enables contraction by default. CHANGES SINC

[PATCH] D80440: [OpenCL] Prevent fused mul and add by default

2020-05-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: rjmccall, arsenm. Herald added subscribers: ebevhan, yaxunl, wdng. Currently, clang will generate fused operation `fmuladd` for expressions like `a*b+c`. However, I can't find anything in the spec that explains this behavior. But clang