Earnings at the company’s core semiconductor business rose sharply on demand for advanced chips needed for the artificial-intelligence infrastructure buildout.