On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote:
I have a pure function that has constant inputs, known at
compile-time, contains no funny stuff internally - looked at
the generated code, and no RTL calls at all. But in a test call
with constant literal values (arrays initialised
On Monday, 28 August 2017 at 03:16:24 UTC, Mike Parker wrote:
On Sunday, 27 August 2017 at 17:47:54 UTC, Cecil Ward wrote:
[...]
The rules for CTFE are outlined in the docs [1]. What is
described there is all there is to it. If those criteria are
not met, the function cannot be executed at c
On Sunday, 27 August 2017 at 00:08:45 UTC, Jonathan M Davis wrote:
[...]
Indeed. I used the term CTFE too loosely.
On Sunday, 27 August 2017 at 17:47:54 UTC, Cecil Ward wrote:
I wonder if there is anything written up anywhere about what
kinds of things are blockers to either CTFE or to successful
constant-folding optimisation in particular compilers or in
general?
Would be useful to know what to stay aw
On Sunday, 27 August 2017 at 17:36:54 UTC, Cecil Ward wrote:
On Sunday, 27 August 2017 at 00:20:47 UTC, ag0aep6g wrote:
[...]
Static had already been tried. Failed. Thanks to your tip, I
tried enum next. Failed as well, wouldn't compile with GDC.
[...]
I wonder if there is anything writte
On Sunday, 27 August 2017 at 00:20:47 UTC, ag0aep6g wrote:
On 08/27/2017 01:53 AM, Cecil Ward wrote:
On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote:
[...]
I think I understand, but I'm not sure. I should have
explained properly. I suspect what I should have said was
that I was
On 08/27/2017 01:53 AM, Cecil Ward wrote:
On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote:
[...]
I think I understand, but I'm not sure. I should have explained
properly. I suspect what I should have said was that I was expecting
an _optimisation_ and I didn't see it. I thought t
On Saturday, August 26, 2017 23:53:36 Cecil Ward via Digitalmars-d-learn
wrote:
> On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote:
> > On Saturday, 26 August 2017 at 18:16:07 UTC, ag0aep6g wrote:
> >> On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote:
> >>> Any ideas as t
On Saturday, 26 August 2017 at 23:53:36 UTC, Cecil Ward wrote:
On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote:
[...]
I was expecting this optimisation to 'return literal constant
only' because I have seen it before in other cases with GDC.
Obviously generating a call that invo
On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote:
On Saturday, 26 August 2017 at 18:16:07 UTC, ag0aep6g wrote:
On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote:
Any ideas as to why GDC might just refuse to do CTFE on
compile-time-known inputs in a truly pure situation?
On Saturday, 26 August 2017 at 18:16:07 UTC, ag0aep6g wrote:
On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote:
Any ideas as to why GDC might just refuse to do CTFE on
compile-time-known inputs in a truly pure situation?
That's not how CTFE works. CTFE only kicks in when the *resul
On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote:
Any ideas as to why GDC might just refuse to do CTFE on
compile-time-known inputs in a truly pure situation?
That's not how CTFE works. CTFE only kicks in when the *result*
is required at compile time. For example, when you assign
I have a pure function that has constant inputs, known at
compile-time, contains no funny stuff internally - looked at the
generated code, and no RTL calls at all. But in a test call with
constant literal values (arrays initialised to literal) passed to
the pure routine GDC refuses to CTFE the
13 matches
Mail list logo