Hacker News new | ask | show | jobs
by PaulHoule 626 days ago
It would be slower to get or set one bit in a byte than to treat the whole byte as a bit. Pipelining could hide the read overhead but memory operations are slow and setting one bit would be mean reading the byte, doing an AND or OR and then writing the byte back.
1 comments

The smallest load/store the original Alpha ISA supported was 32 bits. :-)
Likewise with the Texas Instruments C40 DSP. sizeof(char)==sizeof(int) in that case, both representing 32-bit values.
Down that road, I'll argue that the smallest load/store any modern CPU can do is a cacheline.
... and it's not just the overhead but also that a memory update on just part of a "word" is not atomic which is a problem for a multiprocessor machine but also for a single processor machine which is multitasking if there isn't some barrier to stop the process from being interrupted between the read and the write.