This is the mail archive of the gcc@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]

Re: Suboptimal code generated for _Bool


Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl> writes:


> .L4:
>         testb   %dl, %dl
>         jne     .L3
>         xorl    %eax, %eax
> .L3:
>         rep ; ret
>
> BTW, what is the "rep ; ret" in the last line?

That works around a limitation in the Athlon branch predictor.
In some cases it cannot predict a branch to ret, and adding the prefix
avoids that.

-Andi


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