https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83832

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
bset, bclr, bnot insns can be utiized with inline asm:

  asm volatile ("bclr   %1,%0.B"
                : "+Q" (*(volatile unsigned char*)byte_addr) : "ir" (bitnum) :
"memory");

When the bitnum is not a constant and passed in a register, it should be taken
into account that only the lower 3 bits will be used, i.e. it effectively does
an "bitnum & 3" operation.  It should be encoded in the pattern so that
explicit ands get eliminated.

Reply via email to