<html><body><p><tt><font size="2">Serge Pavlov <sepavloff@gmail.com> wrote on 20.01.2020 09:12:55:<br><br>> One of the viewpoints on the constrained intrinsics is that it is a <br>> way to represent floating point environment. In this case they are <br>> just variants of corresponding IR nodes and in theory we could use <br>> the constrained intrinsics everywhere instead of the regular nodes. <br>> From this viewpoint it make sense to keep symmetry between <br>> constrained intrinsics and corresponding regular IR nodes.<br></font></tt><br><tt><font size="2">Agreed with this.</font></tt><br><tt><font size="2"> <br>> So for the first question the variant `a` (generate a constrained <br>> version of the llvm.fmuladd instrinsic) looks preferable.</font></tt><br><br><tt><font size="2">But not with this.  Note that in Andrew's example we are operating</font></tt><br><tt><font size="2">under -ffp-contract=fast, in which case clang never emits fmuladd,</font></tt><br><tt><font size="2">so it shouldn't in the constrained case either.  Instead, it will</font></tt><br><tt><font size="2">emit fmul/fadd nodes with the contract FMF set, so in constrained</font></tt><br><tt><font size="2">mode it should emit constrained fmul/fadd with the contract FMF set.</font></tt><br><tt><font size="2">(This was Andrew's variant (b).)</font></tt><br><br><tt><font size="2">fmuladd is only emitted in the -ffp-contract=on case, which is</font></tt><br><tt><font size="2">intended to allow contractions only within a single source statement.</font></tt><br><tt><font size="2">Since the LLVM back-end no longer knows the boundaries of source</font></tt><br><tt><font size="2">statemtents, this requires help from clang; this is why clang will</font></tt><br><tt><font size="2">emit fmuladd in those cases where the mul and add originate from</font></tt><br><tt><font size="2">within the same source statement.</font></tt><br><br><tt><font size="2">To fully map all these cases onto constrained intrinsics, we need</font></tt><br><tt><font size="2">both to allow contract (and other) FMFs on constrained intrinsics</font></tt><br><tt><font size="2">*and* allow a constrained fmuladd.</font></tt><br><br><tt><font size="2">Bye,</font></tt><br><tt><font size="2">Ulrich</font></tt><br><BR>
</body></html>