This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/25671] test_bit() compilation does not expand to "bt" instruction
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Apr 2006 20:18:15 -0000
- Subject: [Bug target/25671] test_bit() compilation does not expand to "bt" instruction
- References: <bug-25671-10612@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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