Re: Branch prediction hints in an ISA

Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
12 Oct 2000 21:59:10 -0400

          From comp.compilers

Related articles
Branch prediction hints in an ISA timgleason@my-deja.com (2000-10-10)
Re: Branch prediction hints in an ISA broeker@physik.rwth-aachen.de (Hans-Bernhard Broeker) (2000-10-12)
Re: Branch prediction hints in an ISA peter_flass@my-deja.com (2000-10-12)
Re: Branch prediction hints in an ISA djimenez@cs.utexas.edu (2000-10-12)
Re: Branch prediction hints in an ISA Kahrs.Juergen@stn-atlas.de (Juergen Kahrs) (2000-10-12)
Re: Branch prediction hints in an ISA erik@arbat.com (Erik Corry) (2000-10-12)
Re: Branch prediction hints in an ISA vbdis@aol.com (2000-10-12)
Re: Branch prediction hints in an ISA zs@ender.cs.mu.oz.au (2000-10-15)
[4 later articles]
| List of all articles for this month |

From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
Newsgroups: comp.compilers
Date: 12 Oct 2000 21:59:10 -0400
Organization: Aachen University of Technology (RWTH)
References: 00-10-078
Keywords: architecture, comment

timgleason@my-deja.com wrote:
> Hey I was just thinking. Does anyone know of any Instruction Sets
> that have an extra bit in the branch instruction to be used as a
> "hint" for the branch prediction logic?


I don't think there'd be a need for a separate bit to store this hint
in. It's inherent in the choice of branching operation made by the
compiler, and the design of the CPU. If the CPU doesn't apply runtime
branch prediction, but still has speculative execution, it'll
pre-execute only one outcome of any given branch (either always
branch, or always not). Any sensible optimizing compiler is bound to
know about this, and will thus arrange the code to make sure that the
automatic choice by the CPU is more frequently correct than not.


A different way of looking at this would be that this bit is actually
present in many ISA's, thus: it's the bit that distinguishes between
the 'branch if' and 'branch if not' opcodes. If the compiler applies
those cleverly, that is.


--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
[Evidently not, many architectures do have explicit static branch
prediction bits. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.