[patch,avr] Introduce absdata attribute to allow LDS /STS on Tiny

Georg-Johann Lay avr@gjlay.de
Wed Oct 12 11:33:00 GMT 2016


This patch introduces a new variable attribute "absdata".

Reduced Tiny cores have only a limited range of addresses 0x40..0xbf which can 
be handled by LDS / STS directly.  The attribute allows the user to assert that 
it is legitimate to use absolute addressing for such addresses and that there 
is no need for bulky load of address + indirect addressing.

Allowed addresses actually range from 0x0 to 0xbf because IN / OUT can handle 
absolute addresses in the lower range 0x0..0x3f.

Ok for trunk?

Johann


gcc/
	* doc/extend.texi (AVR Variable Attributes) [absdata]: Document it.
	* config/avr/avr.c (AVR_SYMBOL_FLAG_TINY_ABSDATA): New macro.
	(avr_address_tiny_absdata_p): New static function.
	(avr_legitimate_address_p, avr_legitimize_address) [AVR_TINY]: Use
	it to determine validity of constant addresses.
	(avr_attribute_table) [absdata]: New variable attribute...
	(avr_handle_absdata_attribute): ...and handler.
	(avr_decl_absdata_p): New static function.
	(avr_encode_section_info) [AVR_TINY]: Use it to add flag
	AVR_SYMBOL_FLAG_TINY_ABSDATA to respective symbols_refs.
	(avr_address_cost) [AVR_TINY]: absdata addresses cost 2.

gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_avr_tiny): New proc.
	* gcc.target/avr/torture/tiny-absdata-1.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tiny-absdata-3.diff
Type: text/x-patch
Size: 10673 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161012/e1b98ad6/attachment.bin>


More information about the Gcc-patches mailing list