[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Zeroing longs: use memset for -Os?

From: Ben Jackson
Subject: [avr-gcc-list] Zeroing longs: use memset for -Os?
Date: Fri, 29 Jul 2005 00:07:23 -0700
User-agent: Mutt/1.5.6i

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

Ben Jackson

reply via email to

[Prev in Thread] Current Thread [Next in Thread]