S&P 500, Nasdaq hit records as chip stocks extend 18-day rally