Help with Stencil

Hi,

I want to increment all the values of the stencil at same time, somebody knows how to do that?

How can i put a diferent value in the stencil
when the test pass, i.e.

if ( ref_value & mask == stencil_value & mask ) 
  stencil_value = diferent_value