> DJ Delorie wrote > Revisiting an old thread... >> > On Fri, Sep 02, 2005 at 09:40:20PM -0400, DJ Delorie wrote: >> > So... why is it illegal to put a constant into a single bit field? >> >> Probably because it was more efficient to use some other pattern >> for some other target. > > That's a bad reason to put it in the MI code, since the target could > simply reject those requests itself. Does anyone remember which > target needed this? If not, can we remove that test? > >> But there's absolutely zero chance you can reliably use a volatile >> bit field to emit a given insn sequence necessary for accessing a >> hardware register. > > I don't need reliable, I'm working on optimal. If/when the compiler > can detect that a single "bit insert" opcode can be used instead of a > read/change/write opcode sequence, it's a big win. The fact that the > bitfield is volatile means that a lot of other optimizations get > bypassed, the only way to get it in there is to use insv.
If of any significance, as the AVR aliases GPR's and I/O registers into low order memory addresses, and supports limited bit operations on a subset of those registers; it's therefore possible to consider the AVR as being capable of correspondingly directly manipulating bits mapped into a limited subset of low-order memory addresses; although truly representing I/O ports, not generalized memory per-se.