This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: dangerous cleverness? ppc int<->float conversions, subreg


On Oct 26, 2001, Zack Weinberg <zack@codesourcery.com> wrote:

> On Fri, Oct 26, 2001 at 11:47:42AM -0200, Alexandre Oliva wrote:
>> On Oct 25, 2001, Zack Weinberg <zack@codesourcery.com> wrote:
>> 
>> > I'm currently thinking of setting a flag somewhere that says "this
>> > function uses floating point", and having HARD_REGNO_MODE_OK look at
>> > that as well as the global flag_implicit_fp.
>> 
>> I don't think setting HARD_REGNO_MODE_OK is going to be enough.  I
>> think this won't affect the choice of register class, and will end up
>> resulting in GCC committing to the FP class before realizing no
>> hardware register in that class is going to be usable.

> Well, unlike everything else I've tried, it works on my test case :-)

Yup.  I was that lucky too, when trying to avoid adding FP-disabled
patterns in a new port I worked on, until I got to compile more
complex testcases, in which the compiler thought it to be profitable
to assign a register to a FP register, since the constraints to
support it were there, but then reload failed because no FP register
was available, given that they were all disabled.  So I had to come up
with separate patters to make sure the register allocator wouldn't
even consider assigning pseudos to FP registers, and there goes your
platform-independence :-(

>> As for setting a flag, it may be easy enough to add a hook before
>> register allocation, such that you can scan the insn stream looking
>> for insns with a certain attribute, that marks insns requiring FP.

> Yah.  I'm thinking of doing this in regclass, right now.

Hmm...  This is different from what I had done.  I simply marked all
registers of the FP regclass as fixed/call-used.  Perhaps zeroing out
the regclass would cause the register allocator to never consider the
regclass eligible.  I'm not sure this assumption holds, though.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]