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: Matching of non-standard instructions


"Roland Persson" <roland.persson@blaze.com> writes:

> For example, I have an add instruction that can add a 32-bit integer (with
> or without sign extension) to a 64-bit operand and store the result as 64
> bits.
> 
> C code like:
> __int64_t a = 1;
> int b = 2;
> a += b;
> 
> will generate code that sign or zero extends b into a 64 bit operand and
> then apply the adddi3 pattern.
> 
> I've unsuccessfully tried to figure out how to do this from the gcc
> internals documentation and looking at some other ports. Some hints to get
> me going in the right direction would be much appreciated.
> 
> I've tried adding unnamed patterns for these instructions, using
> zero_extend or sign_extend but I guess those will not get used because the
> generation has already applied the adddi3 pattern when it generates the RTL
> in the first place.

Adding unnamed patterns is correct.  Although they won't be used when
expanding trees into RTL, they will be available for use by the
combine pass.

Ian


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