Microsoft gains 3% on layoff plans