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: New gcc port (ATMEL AVR) and question


Jeffrey A Law <law@cygnus.com> writes:
>  In message <m0zuMHO-000IfhC@medo.fov.uni-mb.si>you write:
>  > 
>  > GO_IF_LEGITIMATE_ADDRESS macro in strict mode disable to using
>  > X pointer with displacement -
>  > (plus:HI (reg:HI 26 r26) (const_int any-number)) - not allowed.
>This is where you're going wrong.
>
>You should have GO_IF_LEGITIMATE_ADDRESS return nonzero only for those
>displacements which are always valid for each particular mode.
>
>You can have special constraints which allow the larger displacements for
>those register pairs which allow larger displacements.

Hmm, easier said than done. When GO_IF_LEGITIMATE_ADDRESS is first called
the registers will be pseudos. If at that point the large offsets are 
permitted then allocate/reload must ensure that appropriate register
class gets used. On the other hand if large offsets are dis-allowed
then the index operation will be computed some other way
and put in a register. In either case it is most unlikely that "special 
constraints" will match.  You would need a CSE-after-reload to re-permute
the RTL.

I had similar issues trying to port gcc to a TI DSP where 
the subset of valid index registers depends on the (hard) reg used as
the base. In the end I gave up as it seemed impossible to allocate/reload
to an appropriate index register based on the associated base (or vice versa).

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


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