[Issue 21041] core.bitop.byteswap(ushort) should used ROL/ROR instead of XCHG

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 12 13:52:35 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21041

--- Comment #4 from safety0ff.bugz <safety0ff.bugz at gmail.com> ---
(In reply to safety0ff.bugz from comment #3)
> (In reply to Bruce Carneal from comment #1)
> > Current dmd -O emits 7 instructions to accomplish the rolw in the code body.
> 
> D converts many operations on narrow types to int, which DMD's backend then
> fails to optimize away when it is possible/advantageous.

Further investigation: dmd/backend/cod2.d function cdshift also converts
rotates of 8 in upper/lower 8 of word into XCHG's

--


More information about the Digitalmars-d-bugs mailing list