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]
Other format: [Raw text]

Re: Code optimization only in loops


Jean Christophe Beyler wrote:
I've gone back to this problem (since I've solved another one ;-)).
And I've moved forward a bit:

It seems that if I consider an array of characters, there are no
longer any shifts and therefore I do get my two loads with the use of
an offset:

The reason there are shifts instead of multiplies is that multiplications are canonicalized to shifts whenever possible outside addresses, because a shift instruction should be more efficient.


The interesting dump should be fwprop which is where the address generation happens.

From your dumps, however, the problem seems to be that you do not have a shift-by-immediate instruction. You may consider adding it even though it does not apply to your assembly, either with define_insn_and_split or by loosening the predicate and keeping a "r" constraint (or whatever you're using now).

Paolo


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