AI spending narrative dominated markets as investors favored chipmakers and infrastructure firms while software stocks faced pressure.