[Issue 6829] Unsigned rotate standard function in Phobos

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 10 06:55:10 PDT 2013


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



--- Comment #15 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-07-10 06:55:08 PDT ---
(In reply to comment #13)
> (In reply to comment #11)
> 
> > It has no problem detecting all those cases.  :o)
> 
> Perhaps you want to show the asm generated by gdc for those functions?
> 
> (Perhaps here there's material for a small enhancement request for LLVM.)

You see the assembler output for roll/rorl.  It's identical with exception to
the operand suffix - eg: rolb/rorb for ubyte.

But to give you a comparison.

// LDC

__D5temp210__T3rolThZ3rolFNaNbNfxhxkZh:
    pushl   %esi
    movzbl  8(%esp), %edx
    movb    %al, %cl
    movl    %edx, %esi
    shll    %cl, %esi
    movl    $8, %ecx
    subl    %eax, %ecx
    shrl    %cl, %edx
    orl %esi, %edx
    movzbl  %dl, %eax
    popl    %esi
    ret $4

vs.

// GDC

__D5temp210__T3rolThZ3rolFNaNbNfxhxkZh:
    movl    %edi, %eax
    movl    %esi, %ecx
    rolb    %cl, %al
    ret

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