Inlining problem of core.bitops

John Colvin via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Oct 20 02:13:43 PDT 2015


On Tuesday, 20 October 2015 at 09:12:28 UTC, John Colvin wrote:
> On Tuesday, 20 October 2015 at 07:15:52 UTC, Marco Leise wrote:
>> Am Sat, 28 Dec 2013 17:04:09 +0000
>> schrieb "bearophile" <bearophileHUGS at lycos.com>:
>>
>>> David Nadlinger:
>>> 
>>> > https://github.com/ldc-developers/ldc/issues/561
>>> 
>>> Given the intensity Manu wants this feature, I think this 
>>> needs to be discussed in the main D newsgroup, to bring a 
>>> @alwaysinline or @forceinline as D standard. The differences 
>>> between D compilers should be minimized.
>>> 
>>> Bye,
>>> bearophile
>>
>> Funny enough, when working on fast.json I had to avoid bsr(),
>> too because of missed inlining. (It is a common need for
>> emulated floating point calculations.)
>
> If you copy the definition of bsr from ldc's druntime to the 
> current module then ldc will inline it. Ugly but effective.

I also noticed better optimisations if I made bsr return a uint 
instead of an int.


More information about the digitalmars-d-ldc mailing list