Thread overview
bitmanip.FloatRep functions not inlined?
Jul 07
kinke
July 07
Please have a look at the following (incorrect) code:

struct half {
  import std.bitmanip;
    enum uint bias = 15, fractionBits = 10, exponentBits = 5, signBits = 1;

    this(float value) {
        const f_rep = FloatRep(value);
        sign = f_rep.sign;
        exponent = cast(ubyte)(f_rep.exponent - FloatRep.bias + bias);
        fraction = f_rep.fraction;
    }

private:
    mixin(bitfields!(
              uint,  "fraction", fractionBits,
              ubyte, "exponent", exponentBits,
              bool,  "sign",     signBits));
}

Any idea why LDC wouldn't inline the FloatRep's functions ?
https://godbolt.org/g/Pzoebd
July 07
On Friday, 7 July 2017 at 18:34:50 UTC, Guillaume Chatelet wrote:
> Any idea why LDC wouldn't inline the FloatRep's functions ?

Phobos isn't compiled with LTO support. See what huge potential that has here: https://github.com/ldc-developers/ldc/issues/2168#issuecomment-313634616

July 07
On Friday, 7 July 2017 at 20:54:27 UTC, kinke wrote:
> On Friday, 7 July 2017 at 18:34:50 UTC, Guillaume Chatelet wrote:
>> Any idea why LDC wouldn't inline the FloatRep's functions ?
>
> Phobos isn't compiled with LTO support. See what huge potential that has here: https://github.com/ldc-developers/ldc/issues/2168#issuecomment-313634616

Very interesting read. Thx a lot for the explanation.