Re: f@#$ing MMX emulator

Michael Meissner (meissner@cygnus.com)
Fri, 19 Jun 1998 20:25:42 -0400


| On Fri, Jun 19, 1998 at 08:57:23AM -0400, Michael Meissner wrote:
| > It depends on whether you compile anything at all :-) Gcc's local register
| > allocation uses floating point to sort/pick the registers to allocate to local
| > registers.
|
| Without knowing the code, I'm going to make a blatant statement like "I'm
| sure that wouldn't be hard to address if someone were motivated to do so".

True, but even in the era when making machines used as workstations without
floating point was popular, nobody contributed patches to fix it. If you are
curious, the code is to compare quantities priority inside of a function called
from qsort:

/* Compare two quantities' priority for getting real registers.
We give shorter-lived quantities higher priority.
Quantities with more references are also preferred, as are quantities that
require multiple registers. This is the identical prioritization as
done by global-alloc.

We used to give preference to registers with *longer* lives, but using
the same algorithm in both local- and global-alloc can speed up execution
of some programs by as much as a factor of three! */

/* Note that the quotient will never be bigger than
the value of floor_log2 times the maximum number of
times a register can occur in one insn (surely less than 100).
Multiplying this by 10000 can't overflow.
QTY_CMP_PRI is also used by qty_sugg_compare. */

#define QTY_CMP_PRI(q) \
((int) (((double) (floor_log2 (qty_n_refs[q]) * qty_n_refs[q] * qty_size[q]) \
/ (qty_death[q] - qty_birth[q])) * 10000))

--
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
meissner@cygnus.com,	617-354-5416 (office),	617-354-7161 (fax)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu