Liste des Groupes | Revenir à c arch |
According to Michael S <already5chosen@yahoo.com>:There was a PHD Thesis CMU circa 1978 called the "maximal munchingYes, compilers often generate such code.>
When coding in asm, I typically know at least something about
probability of branches, so I tend to code it differently:
The first version of FORTRAN had a FREQUENCY statement which let you
tell it the
relative likelihood of each of the results of a three-way IF, and the
expected number of
iterations of a DO loop. It turned out to be useless, because
programmers usually
guessed wrong.
>
The final straw was a compiler where they realized FREQUENCY was
implemented backward and nobody noticed.
Unless you've profiled the code and you data to support your branch
guesses, just write it in the clearest way you can.
Les messages affichés proviennent d'usenet.