This is the mail archive of the
mailing list for the binutils project.
Re: [Patch, avr] Relax LDS/STS to IN/OUT if symbol is in I/O address range
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Georg-Johann Lay <gjl at gcc dot gnu dot org>
- Date: Mon, 29 Sep 2014 20:08:37 +0400
- Subject: Re: [Patch, avr] Relax LDS/STS to IN/OUT if symbol is in I/O address range
- Authentication-results: sourceware.org; auth=none
- References: <20140929104545 dot GA984 at atmel dot com>
2014-09-29 14:45 GMT+04:00 Senthil Kumar Selvaraj
> The patch below adds linker relaxation support for rewriting LDS/STS
> instructions to IN/OUT where appropriate. The IN/OUT instruction is
> shorter by a couple of bytes, and executes a cycle quicker. The
> compiler already does this optimization for addresses known at
> compile time - this linker patch does it for the rest.
> The patch looks for R_AVR_16 relocations, and if it finds an
> LDS/STS instruction with the symbol value (i.e. address) in I/O range,
> rewrites it to use IN/OUT instead, adjusting the address for SFR offsets.
> The patch also includes a couple of test cases to verify that it works
> for tiny, mega and xmega archs, and to ensure I/O range check is
> implemented correctly.
> If ok, could someone commit please? I don't have commit access.
Generally, I don't like this.
The compiler already does this optimization.
May be somebody want to have LDS/STS instead of IN/OUT.