This is the mail archive of the gcc-patches@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: [patch,avr] tweak sign extensions, take #2


2014-10-24 14:37 GMT+04:00 Georg-Johann Lay <avr@gjlay.de>:
> Am 10/23/2014 08:16 PM schrieb Denis Chertykov:
>>>
>>> This optimization makes most sign-extensions one instruction shorter in
>>> the
>>> case when the source register may be clobbered and the register numbers
>>> are
>>> different.  Source and destination may overlap.
>>>
>>> Ok for trunk?
>>>
>>> Johann
>>>
>>> gcc/
>>>          * config/avr/avr.md (extendqihi2, extendqipsi2, extendqisi2)
>>>          (extendhipsi2, extendhisi2): Optimize if source reg is unused
>>>          after the insns and has different REGNO than destination.
>>
>>
>> Approved.
>>
>> Denis.
>
>
> Finally I switched to a solution that avoids all the ugly asm snippets and
> special casing, and which is exact w.r.t code size.  So allow me drop the
> patch from above and to propose this one for trunk.  Sorry for the
> inconvenience.
>
> In any case it uses LSL/SBC idiom instead of the old CLR/SBRC/COM.
>
>
> Johann
>
>         * avr-protos.h (avr_out_sign_extend): New.
>         * avr.c (avr_adjust_insn_length) [ADJUST_LEN_SEXT]: Handle.
>         (avr_out_sign_extend): New function.
>         * avr.md (extendqihi2, extendqipsi2, extendqisi2, extendhipsi2)
>         (extendhisi2, extendpsisi2): Use it.
>         (adjust_len) [sext]: New.
>
>
>

I'm agree with you. It's better.
Approved.

Denis.


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