"Roland Persson" <[EMAIL PROTECTED]> 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

Reply via email to