CTFE Status
Stefan Koch via Digitalmars-d
digitalmars-d at puremagic.com
Sun Dec 11 00:37:28 PST 2016
On Sunday, 11 December 2016 at 08:33:49 UTC, Stefan Koch wrote:
> On Monday, 31 October 2016 at 13:29:01 UTC, Stefan Koch wrote:
>> Hi Guys, since I got a few complaints about giving minor
>> status updates in the announce group, I am opening this thread.
>>
>> I will start with giving an overview of what works and what
>> does not work.
>>
>> Currently the only basic type you can do arithmetic on is int.
>> Altough you can compare longs since a few days.
>>
>> These are the constructs that will work.
>>
>> - foreach on static arrays strings and range-foreach (those
>> kinds (0 .. 64)).
>> - switches (even deeply nested ones)
>> - for and while loops
>> - ternary expressions (? :)
>> - if and else statements (as long as you don't use && and || )
>> - lables and gotos
>> - arithmetic expressions as well as post and pre increment and
>> decrement
>>
>> Constructs that will not work (but are actively worked on)
>>
>> - assignment to static array cells
>> - long ulong arithmetic.
>> - function calls
>> - dynamic arrays and slices
>> - pointers
>> - structs
>> - && and ||
>> - sliceing
>>
>> Constructs that will not work and are futher down the list.
>>
>> - classes
>> - closures
>> - boundschecks
>> - asserts
>>
>> Please note that there will probably be bugs all over the
>> place.
>> So even the working features might not be working completely.
>
> Remember those numbers ?
> [root at localhost dmd]# time src/dmd -c testSettingArrayLength.d
> -bc-ctfe
> 2147385345u
> 536821761u
> 4294639619u
>
> real 0m0.114s
> user 0m0.110s
> sys 0m0.003s
>
> This is how they look like after my performance fixes:
>
> real 0m0.047s
> user 0m0.043s
> sys 0m0.000s
Disregard That!
I wasn't paying attention
The lower numbers are produced by ldc!
The performance fixes did lower the overall overhead even more
though.
Which means bytecode generation will not even show up among the
top 50 functions in dmd,
More information about the Digitalmars-d
mailing list