CTFE Status

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 20 07:37:50 PST 2016


On Sunday, 20 November 2016 at 09:02:30 UTC, Stefan Koch wrote:
> On Saturday, 19 November 2016 at 11:22:18 UTC, Stefan Koch 
> wrote:
>> On Saturday, 19 November 2016 at 09:42:33 UTC, Stefan Koch 
>> wrote:
>>> Another small update.
>>> I got rid of the heapClearing overhead.
>>> By using ddmds allocator.
>>> Because of that I was able to shave off 20ms overhead.
>>
>> Allocation of dynamic arrays works :)
>> The following code will work just fine with the new engine.
>> uint[] repeat(uint[] a, uint cnt)
>> {
>>   uint[] result = [];
>>   uint pos;
>>   result.length = cast(uint) (a.length * cnt);
>>   while(cnt--) foreach(c;a)
>>   {
>>     result[pos++] = c;
>>   }
>>
>>   return result;
>> }
>>
>> static assert(repeat([1,2,3,4], 4) ==
>>   [1,2,3,4, 1,2,3,4, 1,2,3,4, 1,2,3,4]
>> );
>
> There is an important change coming up.
> I am going to rewrite the 64 bit support.
>
> The after the change the interpreter will be slower when 
> working with 64bit values.
> However it will be much easier for the jit.
>
> Also I have a lead on howto fix the bugs in break and continue 
> handling.
>
> A nice weekend to all of you!

I discovered a new bug in the handling of do-while statements.
Which I subsequently fixed.

I also fixed the C backend.
It would interpret a certain conditional different from all other 
back-ends.

This makes it oblivious that better documentation of the code-gen 
interface is needed.
Furthermore I need to extend my bc_tests. to make sure the 
interpretation is the same.
Such that this bug cannot happen again.

As always a happy weekend to all of you.
- I really need a drink ... preferably root-beer.



More information about the Digitalmars-d mailing list