Re: Target Macro for scaling addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ayonam Ray <ayonam@xxxxxxxxx> writes:

> I'm looking for a target macro or a hook by which I can tell the
> optimizer that in Base + Index addressing, my hardware scales the
> Index register by the size of the data being accessed and hence the
> Index register increments (for subsequent accesses) should be by 1 and
> not by the size of the data being accessed.
>
> Is there something like that or do we have to do something different
> in the legitimize_address target hook?

This is a fairly common addressing mode supported by a number of
processors.  For a scale factor you should represent the address as
    (plus (reg base) (mult (reg index) (const_int scale)))
Make sure that your TARGET_LEGITIMATE_ADDRESS_P hook recognizes that
sort of address, with the appropriate scale factor depending on the
mode.  You shouldn't need to do much else.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux