an empty asm, as long as you used the
__volatile attribute to scare gcc away from reordering code in the
loop. So, for () { __asm __volatile () ; }
(I note I wasn't able to get gcc 3.3 to optimize away the loop on i386)
--
Ben Jackson AD7GD
[EMAIL PROTECTED]
http://www.ben.com
void change() {
var = 1;
}
That's a shift, not a rotation, so var is going to become 0.
while (1) {
int var=1;
while (var != 0) {
PORTB = var;
var = 1;
}
}
Also, 'int var' is going to be 16 bits wide, so in this version which
rotates the bit it's going to
__mulqi3, else __mulhi3
You can probably also just move the literal '20' in for y;
--
Ben Jackson
[EMAIL PROTECTED]
http://www.ben.com/
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
of the development going on now, 3.x or 4.x? I guess I
need to buckle down and read the gcc internals docs and start
submitting patches.
--
Ben Jackson
[EMAIL PROTECTED]
http://www.ben.com/
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http
the re-ordering
of the memory accesses.
--
Ben Jackson
[EMAIL PROTECTED]
http://www.ben.com/
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Due to the size of sts instructions, it's actually fewer bytes to
memset(somelong, 0, sizeof(long)). The memset is 12 bytes (count,
hi, lo, sts, dec, loop, all 2 bytes) vs 16 for 4 straight sts's.
If you're doing more than one variable of course the savings are
bigger.
--
Ben Jackson
[EMAIL
eor r19, r19
c4: 22 27 eor r18, r18
--
Ben Jackson
[EMAIL PROTECTED]
http://www.ben.com/
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
welcome dissenting
opinions, but I wanted to put the recommendation out there for any other
newbies.
--
Ben Jackson
[EMAIL PROTECTED]
http://www.ben.com/
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc
The AT90S2313, for example, has only 128 bytes of memory. Is there any
reason why -mtiny-stack shouldn't be the default for these devices?
Looks like there are half a dozen ATtiny devices with 0 and =256 bytes
of SRAM and several of the old AT90S* devices.
--
Ben Jackson
[EMAIL PROTECTED]
http