Microsoft gains 3% on layoffs plan