[Issue 7181] Make bswap a recognized sequence, rather than an intrinsic

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 29 12:23:42 PST 2011


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


Andrei Alexandrescu <andrei at metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at metalanguage.com


--- Comment #3 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-12-29 12:23:38 PST ---
Wonder if other patterns would need to be figured as well, e.g. 

    auto p1 = cast(char*) &x;
    int y = void;
    auto p2 = cast(char*) &y;
    p2[0] = p1[3];
    p2[1] = p1[2];
    p2[2] = p1[1];
    p2[3] = p1[0];

Or (probably more realistically) patterns involving temporaries and 2
expressions:

    auto y = ( x << 24 ) | ( x << 8 ) & 0xff0000;
    y |= ( x >> 8 ) & 0xff00 | ( x >> 24 );

-- 
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