Bit-Banding. Only 1 bit at a time?

Hi,
    I am developing a fixed-point MP3 & ACELP decoder on an Arduino Due. I realize that bit-banding makes a RMW sequence atomic but I notice fields in the Due hardware are multi-bit fields. Is there an atomic way to alter multiple bits? I realize that the atomic RMW can probably allow the applications/IRQ/NMI to resolve which gets access to the bus but if that is the only real use, wouldn't it have been simpler to use atomic test-and-set as the SuperH does?

Examples like the PERIPH_PTSR (bits 0 & 8 used) are classic. Do you write to separate bytes, perform 2 bit-band operations or write to 16 or 32 bits at once?

I do appreciate that this is very low level. I also note that TCM (tightly coupled memory) is mentioned just once and I'm not quite sure if this refers to part of the cache or a PSX-like scratch-pad. The PSX was another machine that needed hand-written assembly language to get the full performance out of it.

Many thanks,
Sean


Parents Reply
  • 17cy for the multiply isn't bad

    I keep thinking that somewhere in Texas, someone who developed the microcode has a fantastic plan but it either failed to happen or the functionality wasn't shared.

    Yes, I wonder, what the design goal for the M0 were. Maybe they had a maximum gate count.  I don't think they use microcode at all, don't you.
    But actually, I had these thoughts on many architectures in the past (RX, V850, PowerPC VLE). I sometimes wonder if they ever ask assembly programmers about the instructions they want to implement.
    Concering RORS, I think I haven't used it at all in the past 19 years. Oh, twice in our kernel: "// no eRORS" ;-)

Children
More questions in this forum