[MLton] Re: [MLton-commit] r7458

Wesley W. Terpstra wesley at terpstra.ca
Mon May 10 13:24:11 PDT 2010


On Mon, May 10, 2010 at 8:19 PM, Matthew Fluet <matthew.fluet at gmail.com>wrote:

> > I really want to hurt whoever decided to take this idiom away. There are
> no
> > alternatives except calling out to memcpy (or similar) via a char*. The
> cost
> > to performance for a simple endian-swap is absurd.
> Looking at the assembly code using memcpy vs. using a union with
> __attribute__((__may_alias__)), they are nearly identical at all but
> -O0.  Certainly, no explicit memcpy calls, and sometimes the code that
> had memcpy is compiled to a shorter assembly sequence.
>
So gcc optimizes the memcpy away? Interesting/Impressive.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20100510/5d16d538/attachment.html


More information about the MLton mailing list