[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem
From: |
Ned Konz |
Subject: |
Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem |
Date: |
Thu, 2 Dec 2004 16:08:20 -0800 |
User-agent: |
KMail/1.7.1 |
On Thursday 02 December 2004 3:00 pm, E. Weddington wrote:
> The canonical way to change bits in ports in C language is not through
> the use of bitfields. You need to learn to use the C language's bitwise
> operators, in conjunction with a simple macro include in avr-libc:
>
> #include <avr/io.h>
> PORTA |= _BV(1); // Set bit 1
> PORTA &= ~_BV(1); // Clear bit 1
Actually, GCC does a nice job (when the optimizer is on) of using bitfields.
It just looks like it's producing inefficient code to access const fields in
const structs.
--
Ned Konz
http://bike-nomad.com
- [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, Albert Seward, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, E. Weddington, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, Albert Seward, 2004/12/02
- RE: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, Larry Barello, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, Russell Shaw, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, E. Weddington, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, Albert Seward, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, E. Weddington, 2004/12/02
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, Joerg Wunsch, 2004/12/03
- Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem, E. Weddington, 2004/12/03
Re: [avr-gcc-list] Efficient I/O handling w. bitfields codegen problem,
Ned Konz <=