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: ARM patch: Add a Thumb-1 ldrsb peephole


On Fri, 2010-07-09 at 12:10 +0200, Bernd Schmidt wrote:
> Here's a small by-product of my attempts to tune Thumb-1 code.
> 
> -       add     r3, r3, #124
> -       mov     r7, #0
> +       mov     r7, #124
>         ldrsb   r7, [r3, r7]
> 
> Tested in the same run as mentioned in
>   http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00756.html
> 
> Ok?
> 

This is OK.

Hmm, makes me think.  Could we also have a peephole to optimize the
thumb-2 case?

	add	r3, r3, r4
	ldrsb	r7, [r3, #124] // 32-bit, r3 dead

into
	add	r3, r3, #124
	ldrsb	r7, [r3, r4]  // 16-bit
	


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