This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: if/then/else hint ?
>>>>> "Jamie" == Jamie Lokier <jamie@shareable.org> writes:
Jamie> When a branch is not already in the branch target buffer (BTB;
Jamie> a small cache of previously taken brances to predict them
Jamie> subsequently), a Pentium guesses that a forward branch is not
Jamie> taken and a backward branch is taken. So you're right to
Jamie> observe that the code is not optimal.
Interestingly enough, that is true also for many other processors, but
not all. The Moto 68040 always predicts branches to be taken no
matter whether they are forward or backward branches.
paul