Re: Battle-plan for CTFE

2016-10-26 Thread Stefam Koch via Digitalmars-d-announce
On Wednesday, 26 October 2016 at 16:24:49 UTC, MakersF wrote: On Wednesday, 26 October 2016 at 15:02:28 UTC, Stefam Koch wrote: Who can guess what this code does ? char[] obfuscatedFn(string a, string b, uint aLength = 0, uint bLength = 0, uint cLength = 0, uint pos = 0, uint bPos = 0,

Re: Battle-plan for CTFE

2016-10-26 Thread Stefam Koch via Digitalmars-d-announce
On Wednesday, 26 October 2016 at 15:38:30 UTC, Kagamin wrote: On Wednesday, 26 October 2016 at 15:02:28 UTC, Stefam Koch wrote: bLength = cast(uint)a.length; Reads past the end of b if b is shorter than a. you are right. Thanks for spotting it :)

Re: Battle-plan for CTFE

2016-10-26 Thread Stefam Koch via Digitalmars-d-announce
Who can guess what this code does ? char[] obfuscatedFn(string a, string b, uint aLength = 0, uint bLength = 0, uint cLength = 0, uint pos = 0, uint bPos = 0, char[] result = []) { aLength = cast(uint)a.length; bLength = cast(uint)a.length; cLength = aLength + bLength;

Re: Battle-plan for CTFE

2016-10-25 Thread Stefam Koch via Digitalmars-d-announce
On Tuesday, 25 October 2016 at 17:19:26 UTC, Jacob Carlborg wrote: Very impressive :) Thanks. I just got the following code to compile and execute correctly. bool strEq(string a, string b) { if (a.length != b.length) { return false; } uint length = cast(uint)

Re: Battle-plan for CTFE

2016-10-25 Thread Stefam Koch via Digitalmars-d-announce
On Tuesday, 25 October 2016 at 15:57:33 UTC, Wyatt wrote: On Tuesday, 25 October 2016 at 12:36:56 UTC, Stefam Koch wrote: LLVM Backend (-ctfe-bc -version=UseLLVMBackend) : real0m0.039s user0m0.027s sys 0m0.010s I think 20,000% is a pretty good speedup! ;) Great stuff. Now that

Re: Battle-plan for CTFE

2016-10-25 Thread Stefam Koch via Digitalmars-d-announce
On Tuesday, 25 October 2016 at 09:36:12 UTC, Stefam Koch wrote: On Monday, 24 October 2016 at 06:37:12 UTC, Rory McGuire wrote: Cool, thanks for the feedback. I have take care of the blocker for now. I turns out my tests contained wrong code that reused a register for multiple purposes.

Re: Battle-plan for CTFE

2016-10-25 Thread Stefam Koch via Digitalmars-d-announce
On Monday, 24 October 2016 at 06:37:12 UTC, Rory McGuire wrote: Cool, thanks for the feedback. I have take care of the blocker for now. I turns out my tests contained wrong code that reused a register for multiple purposes. LLVM does not like that. So it assumed the wrong things while

Re: Battle-plan for CTFE

2016-10-24 Thread Stefam Koch via Digitalmars-d-announce
On Monday, 24 October 2016 at 05:57:42 UTC, Stefam Koch wrote: On Sunday, 16 October 2016 at 00:27:50 UTC, Uplink_Coder wrote: Little update here: The LLVM backend is almost on feature parity. Meaning that that soon the new CTFE engine is a real jit. In the process I discoverd quite a few

Re: Battle-plan for CTFE

2016-10-24 Thread Stefam Koch via Digitalmars-d-announce
On Sunday, 16 October 2016 at 00:27:50 UTC, Uplink_Coder wrote: Little update here: The LLVM backend is almost on feature parity. Meaning that that soon the new CTFE engine is a real jit. In the process I discoverd quite a few horrible bugs and inconsistency in the API. I am quite astonished