This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: find_mem_givs SMALL_REGISTER_CLASSES patch
- To: toon at moene dot indiv dot nluug dot nl
- Subject: Re: find_mem_givs SMALL_REGISTER_CLASSES patch
- From: john at feith dot com (John Wehle)
- Date: Sun, 28 Jun 1998 18:19:12 -0400
- Cc: egcs-patches at cygnus dot com
> Basically, your patch wouldn't do the right thing on my m68k [if it
> defined SMALL_REGISTER_CLASSES] in most of the cases. The reason
> for this is that on the m68k, complicated addressing modes are
> expensive, and post-increment addressing is free.
Is the m68k likely to define SMALL_REGISTER_CLASSES? :-) In any event
you raise a good point, though wouldn't the machine description be
set up to discourage the use of a complicated addressing mode if it
was expensive?
> So, if you decide not to mark (and hence reduce) a giv, this will
> cost you dearly if there are enough registers (post-increment
> addressing will be used), and if there aren't, you'll trade one
> complicated and expensive addressing mode for storing and retrieving
> a value (most probably to/from cache memory).
This goes right to the central questions of:
1) Do I have enough registers?
2) If I do and I decide to use a complicated addressing mode
anyway how expensive will it be?
3) If I don't and I decide to spill a register anyway in order
to use a simpler addressing mode how expensive will it be?
You're of course. My patch could be a big loss on a machine which
defines SMALL_REGISTER_CLASSES and allows extremely expensive
addressing modes. This could be handled by modifying the patch
so that it used ADDRESS_COST as part of the deciding factor.
-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------