From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107f24,6f568a2e6507575 X-Google-Attributes: gid107f24,public X-Google-Thread: f891f,6f568a2e6507575 X-Google-Attributes: gidf891f,public X-Google-Thread: 103376,6f568a2e6507575 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-26 11:23:54 PST Path: newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.cwix.com!newsfeed.nyc.globix.net!news.stealth.net!newspeer.cts.com!galanthis.cts.com!127.0.0.1.MISMATCH!not-for-mail Sender: kst@king.cts.com Newsgroups: comp.lang.ada,comp.lang.functional,comp.lang.misc Subject: Re: Thoughts and Opinions or something like that References: <9c642e$of323@news.kvaerner.com> <9c6evg$em1$1@marduk.litech.org> From: Keith Thompson Date: 26 Apr 2001 11:23:51 -0700 Message-ID: X-Newsreader: Gnus v5.5/Emacs 20.3 NNTP-Posting-Host: 209.68.192.180 X-Trace: 988309434 nntp.cts.com 47992 209.68.192.180 Xref: newsfeed.google.com comp.lang.ada:6962 comp.lang.functional:5335 comp.lang.misc:1155 Date: 2001-04-26T11:23:51-07:00 List-Id: jmv16@cornell.edu (Jeffrey M. Vinocur) writes: [...] > Well, the goal isn't to lessen branch prediction -- the silicon > is there either way -- but rather to reduce mispredicted > branches. The most basic approach, I guess, is assume all > backwards branches will be taken -- this gets loops. One > not-very-complicated approach is to cache whether a branch was > taken last time through and predict the same. This approach, > however, does exactly what you suggest; it gets loop iterations > 2,3,4,...,n-1 all correct. Note that if you have multiple threads/processes/coroutines/whatever, the threads can interfere with each other's cached branch information. In practice, I suspect this doesn't make much difference. You could cache the branch information separately in each thread, but I suspect this wouldn't be worth the effort. It might even be harmful if it prevents one thread from "learning" from the experience of another. -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Cxiuj via bazo apartenas ni.