[GSoC 2019] Interested in Baremetal D Runtime and project ideas

Iain Buclaw ibuclaw at gdcproject.org
Wed Apr 10 14:12:02 UTC 2019


On Wed, 10 Apr 2019 at 16:07, Iain Buclaw <ibuclaw at gdcproject.org> wrote:
>
> On Wed, 10 Apr 2019 at 15:10, Stefanos Baziotis via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
> >
> > On Wednesday, 10 April 2019 at 12:56:39 UTC, Radu wrote:
> > > Actually, this is what you might look for:
> > >
> > > https://godbolt.org/z/Zvyc3G
> > >
> > > Notice that at -O the memcmp is inlined.
> >
> > Yes, thanks Radu, as I said in the previous post, I don't have
> > LDC on my machine
> > right now to test but I also didn't know that godbolt supports D.
> > That's good.
> > GDC interestingly does not inline it.
> >
>
> You need to cast(bool), or memcmp() == 0.
>

If you are interested in the number returned from memcmp(), I guess
the reason why it wouldn't inline might be to do with the endianess,
and that the order memcmp compares is in the other direction - I think
you'll need to bswap all values before you compare.

-- 
Iain


More information about the Digitalmars-d mailing list