Re: Help needed: Code generation for CASE/SWITCH statements

Raymond Hayes <hayes@epigram.com>
17 Dec 1997 14:12:53 -0500

          From comp.compilers

Related articles
[12 earlier articles]
Re: Help needed: Code generation for CASE/SWITCH statements a_s_t_o_r@guardian.no (Alexander Kjeldaas) (1997-12-10)
Re: Help needed: Code generation for CASE/SWITCH statements vonbrand@inf.utfsm.cl (Horst von Brand) (1997-12-12)
Re: Help needed: Code generation for CASE/SWITCH statements wi534@victoria.tc.canada (William A. Barath) (1997-12-12)
Re: Help needed: Code generation for CASE/SWITCH statements henry@zoo.toronto.edu (Henry Spencer) (1997-12-15)
Re: Help needed: Code generation for CASE/SWITCH statements dietz@interaccess.com (Paul Dietz) (1997-12-16)
Re: Help needed: Code generation for CASE/SWITCH statements kanze@gabi-soft.fr (1997-12-16)
Re: Help needed: Code generation for CASE/SWITCH statements hayes@epigram.com (Raymond Hayes) (1997-12-17)
Re: Help needed: Code generation for CASE/SWITCH statements wi534@victoria.tc.canada (William A. Barath) (1997-12-23)
| List of all articles for this month |
From: Raymond Hayes <hayes@epigram.com>
Newsgroups: comp.compilers,comp.lang.c.moderated
Date: 17 Dec 1997 14:12:53 -0500
Organization: Epigram, Inc.
References: <clcm-19971204-0012@plethora.net> 97-12-051 97-12-065 97-12-100
Keywords: code, optimize, architecture

William A. Barath wrote:


> How so? If the code is called repeatedly (iterative model, one which
> is _worth_ optimising) then the CPU's instruction cache is very likely
> to keep all the relevant data cached, and branch instructions can be
> executed in 1 clock or less.


The problem isn't the cache, it's predicting the branch. Assuming
everything is in the caches, if the branch can't be predicted or is
mispredicted, the pipe needs to be flushed and ifetch needs to be
redirected.


Raymond R. Hayes
Epigram, Inc.
--


Post a followup to this message

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