PIWAR_SZ_MASK
piwar |= ((mem_log - 1) & PIWAR_SZ_MASK);
piwar = (piwar & ~PIWAR_SZ_MASK) | (mem_log - 1);