This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/25671] test_bit() compilation does not expand to "bt" instruction



------- Comment #2 from steven at gcc dot gnu dot org  2006-04-10 20:18 -------
The resulting code for -march=opteron:

test_bit:
.LFB2:
        leal    63(%rsi), %edx
        testl   %esi, %esi
        movl    %esi, %eax
        cmovns  %esi, %edx
        sarl    $31, %eax
        shrl    $26, %eax
        sarl    $6, %edx
        leal    (%rsi,%rax), %ecx
        movslq  %edx,%rdx
        andl    $63, %ecx
        subl    %eax, %ecx
        movl    $1, %eax
        sall    %cl, %eax
        cltq
        testq   %rax, (%rdi,%rdx,8)
        setne   %al
        movzbl  %al, %eax
        ret

For -march=nocona the code is even uglier.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25671


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]