[Issue 7181] Make bswap a recognized sequence, rather than an intrinsic
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 16 02:16:44 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7181
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #5 from Walter Bright <bugzilla at 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: -------
More information about the Digitalmars-d-bugs
mailing list