[Issue 6829] Unsigned rotate standard function in Phobos

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 9 10:58:08 PDT 2013


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


kai at redstar.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kai at redstar.de


--- Comment #45 from kai at redstar.de 2013-09-09 10:58:01 PDT ---
(In reply to comment #43)
> And currently LDC2 back-end is not optimizing the rotations well
> enough.

I had a closer look to this. The root cause is the uint nBits declaration.
Because of this the x value is promoted to uint if T is ubyte or ushort
(according to TDPL, 2.3.3). In this case LLVM is not smart enough to deduce
that the zero extension is not necessary. If both types are ubyte or ushort,
then the rolb/rolw and rorb/rorw instructions are generated.

I try to make LLVM smarter. :-)

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