Thread overview
[Issue 23538] Power operator does not work with floating point in -betterC
[Issue 23538] Power operator does not work in -betterC
Dec 04, 2022
Richard Cattermole
Dec 04, 2022
Nick Treleaven
Dec 04, 2022
Richard Cattermole
Dec 17, 2022
Iain Buclaw
Feb 07, 2023
Iain Buclaw
December 04, 2022
https://issues.dlang.org/show_bug.cgi?id=23538

Richard Cattermole <alphaglosined@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |betterC

--
December 04, 2022
https://issues.dlang.org/show_bug.cgi?id=23538

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org
            Summary|Power operator does not     |Power operator does not
                   |work in -betterC            |work with floating point in
                   |                            |-betterC

--- Comment #1 from Nick Treleaven <nick@geany.org> ---
Each exp2 overload forwards to template exp2Impl, and each are marked pragma(inline, true). So this should work if the inlining is done. (Though currently it makes no difference using -inline -O or not).

--
December 04, 2022
https://issues.dlang.org/show_bug.cgi?id=23538

--- Comment #2 from Richard Cattermole <alphaglosined@gmail.com> ---
Unfortunately, run.dlang.io's run-all D compiler option appears to be broken, so I can't test if the recent changes to dmd's inliner caused this to break and hence be a regression.

But yeah I see three possibilities here:

1) Fix inlining
2) Template exp functions
3) Use libc pow instead

Of course, all these options are ignoring the forest. Why are there compiler hooks implemented in Phobos?

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=23538

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
February 07, 2023
https://issues.dlang.org/show_bug.cgi?id=23538

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Any `T ^^ float` operation is by definition non-trivial, so I'm tempted to just close this as wontfix.

--