Jump to page: 1 2
Thread overview
[Issue 16474] CTFE pow
Sep 09, 2016
Manu
Aug 02, 2017
Manu
Aug 02, 2017
Manu
Aug 05, 2017
ZombineDev
Aug 05, 2017
ZombineDev
Aug 05, 2017
kinke@gmx.net
Aug 06, 2017
kinke@gmx.net
Dec 12, 2017
Iain Buclaw
Mar 23, 2018
Walter Bright
September 09, 2016
https://issues.dlang.org/show_bug.cgi?id=16474

uplink.coder@googlemail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uplink.coder@googlemail.com

--- Comment #1 from uplink.coder@googlemail.com ---
are 64bit floating point operations good enough for you ?
(And anyone else)
If so the fix is rather straight-forward.

--
September 09, 2016
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #2 from Manu <turkeyman@gmail.com> ---
Sure, or reals, whatever precision the compiler does floating point constant folding would be fine.

--
August 02, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #3 from Manu <turkeyman@gmail.com> ---
Come on... surely it's reasonable to expect all builtin operators should work at ctfe!! ;)

--
August 02, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #4 from uplink.coder@googlemail.com ---
newCTFE is eventually going to fix that.
and other compile-time floating-point issues as well.

--
August 02, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #5 from Manu <turkeyman@gmail.com> ---
True, but that could still be a long way off, and this should have already been working like, 10 years ago... it'd be good to have a default fix in existing ctfe code.

--
August 05, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

ZombineDev <petar.p.kirov@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |petar.p.kirov@gmail.com

--- Comment #6 from ZombineDev <petar.p.kirov@gmail.com> ---
Manu, you may be interested in trying LDC as it will soon support much more intrinsics at CTFE than dmd. For reference: https://github.com/ldc-developers/ldc/pull/2259 I'm not sure if specifically the pow operator is supported (though pow is supported as a function call).

--
August 05, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #7 from uplink.coder@googlemail.com ---
(In reply to ZombineDev from comment #6)
> Manu, you may be interested in trying LDC as it will soon support much more intrinsics at CTFE than dmd. For reference: https://github.com/ldc-developers/ldc/pull/2259 I'm not sure if specifically the pow operator is supported (though pow is supported as a function call).

Do they interface with the CTFE engine ?
That'd be crazy :)

--
August 05, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #8 from ZombineDev <petar.p.kirov@gmail.com> ---
I don't think so, but see the PR for yourself ;)

--
August 05, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #9 from kinke@gmx.net ---
(In reply to uplink.coder from comment #7)
> (In reply to ZombineDev from comment #6)
> > Manu, you may be interested in trying LDC as it will soon support much more intrinsics at CTFE than dmd. For reference: https://github.com/ldc-developers/ldc/pull/2259 I'm not sure if specifically the pow operator is supported (though pow is supported as a function call).

I started that work due to a recent ping of this issue and me accidentally
noticing it. ;)
So the pow operator is working with that PR for LDC; there a static assert in
the last line of the test.

> Do they interface with the CTFE engine ?
> That'd be crazy :)

I detect a few more key primitive functions (ldexp, isNaN, isInfinity, isFinite...) as builtins and forward to proper implementations in CTFloat. I also had to make std.math.exp2() CTFE-able for 80-bit reals by not using the inline assembly code for CTFE. DMD may need a few more builtins or CTFE-friendly Phobos implementations to get all of this working as well; I'll open a DMD PR for the ones required by LDC.

So how does newCTFE interact with CTFloat at the moment? This is an important piece for cross-compilers. And is there an estimate for when newCTFE will land?

--
August 05, 2017
https://issues.dlang.org/show_bug.cgi?id=16474

--- Comment #10 from uplink.coder@googlemail.com ---
(In reply to kinke from comment #9)
> 
> So how does newCTFE interact with CTFloat at the moment? This is an important piece for cross-compilers. And is there an estimate for when newCTFE will land?

It does currently not use CTFloat at all.
It only implements add, sub, mul and div and mod for floats/doubles.
As well as float <=> double <=> long/int casts.

--
« First   ‹ Prev
1 2