http://d.puremagic.com/issues/show_bug.cgi?id=7181


Walter Bright <bugzi...@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzi...@digitalmars.com


--- Comment #5 from Walter Bright <bugzi...@digitalmars.com> 2012-04-16 
02:17:30 PDT ---
The following is now recognized and replaced with bswap:

    (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|(p[3]<<0)

where p is a pointer to a ubyte. I realize that there are many, many ways to
write bswap, but this is the recognized one. (The operands to | can at least
appear in any order.)

Also,

    (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|(p[0]<<0)

is now recognized and replaced with *cast(uint*)p, at least for x86 byte
ordering.

What remains to be done is to provide such a body for core.bitop.bswap() and
remove bswap from the compiler intrinsics.

For reference:

   http://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to