[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega)
From: |
Erik Walthinsen |
Subject: |
Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access? |
Date: |
Wed, 10 Oct 2012 20:13:10 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 |
On 10/10/2012 02:24 PM, Weddington, Eric wrote:
But as you said: Does it do that with recent versions? I'm afraid that no one
yet knows.
Nope: (stock binutils 2.22, gcc 4.72, avr-libc 1.80)
void structwrite(uint8_t v) {
TCC0.CTRLE = v;
a58: e0 e0 ldi r30, 0x00 ; 0
a5a: f8 e0 ldi r31, 0x08 ; 8
a5c: 84 83 std Z+4, r24 ; 0x04
a5e: 08 95 ret
}
void straightwrite(uint8_t v) {
TCC0_CTRLE = v;
a60: 80 93 04 08 sts 0x0804, r24
a64: 08 95 ret
}
#define FS(s,m) (*(typeof(s.m) *)((void *)&s + offsetof(typeof(s),m)))
void macrowrite(uint8_t v) {
FS(TCC0,CTRLE) = v;
a66: 80 93 04 08 sts 0x0804, r24
a6a: 08 95 ret
}
(both -O2 and -O6 produce the same, compiled with -fno-inline)
- [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, Erik Walthinsen, 2012/10/10
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, Georg-Johann Lay, 2012/10/10
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, Georg-Johann Lay, 2012/10/11
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, David Kelly, 2012/10/11
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, Erik Walthinsen, 2012/10/11
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, Weddington, Eric, 2012/10/11
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, David Brown, 2012/10/11
- Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?, Georg-Johann Lay, 2012/10/12