SynopsisUS stocks ended mixed as AI-driven optimism supported markets but was offset by rising geopolitical tensions and oil prices. Small-cap and semiconductor stocks gained, while software lagged. Alphabet’s massive AI funding plan and Marvell’s rally highlighted ongoing AI momentum, even as inflation fears and rate hike concerns kept investors cautious.ReutersThe S&P 500 and the Dow closed modestly higher ​on Tuesday as risk appetite driven by AI fervor was counterbalanced by tensions arising from U.S.-Iran talks to reopen the Strait of Hormuz and end the months-long war.Gains in most of the 11 major S&P sectors kept the S&P 500 and the Dow in the green, with the small-cap Russell 2000 outperforming its larger-cap peers. The Nasdaq ‌ended the session essentially unchanged.Small-cap ⁠stocks have ⁠been some of the biggest beneficiaries of the ongoing enthusiasm surrounding artificial intelligence stocks, which provided some upside muscle. The Philadelphia SE Semiconductor Index advanced on the day.The Software & Services Index, ​battered in recent months over worries of AI disruption, closed in negative territory.Strong results from Hewlett Packard Enterprise and a funding commitment from Alphabet reinforced confidence in the ​AI buildout."The market is kind of muted at the surface level, but there is a lot going on under the hood, and that describes much of this year," said Mike Dickson, head of portfolio management at Horizon Investments in Charlotte, North Carolina. "There's some massive dispersion in the whole AI infrastructure ​ecosystem.""Markets could be in for one of these heated, melt-up rallies where the momentum keeps ⁠winning," Dickson ‌added. "I would not be surprised at all to be sitting here at the end of the summer a good bit ​higher."Tehran is studying a ​U.S. proposal to bring the war to a halt, but has not been in contact with Washington ⁠for days, according to Iranian media, which also said Iran is taking a "stern" approach, given ​what it views as a history of U.S. noncompliance and mutual distrust. Simultaneously, Israel is continuing its ​strikes on Lebanon, despite Tehran's warnings that the attacks are threatening to derail the fragile truce.The war has sent crude prices soaring, reviving worries over inflation and giving rise to an increasing likelihood that the U.S. Federal Reserve could hike interest rates by year-end. Cleveland Fed President Beth Hammack said on Tuesday that such a hike could become necessary if already-elevated inflation pressures continue to mount. On the economic front, a report from the Labor Department showed an unexpected spike in job openings, driven by the volatile professional and business services sector. Otherwise, hiring, firing and quits all decreased, suggesting a slowdown ‌in labor market churn in the face of uncertainties related to strife in the Middle East and inflationary effects.Analysts look to the May employment report due on Friday, which is expected to show the U.S. economy added 85,000 jobs last ​month, a monthly deceleration ​of 26.1%. The unemployment rate is forecast ⁠to stand pat at 4.3%.According to preliminary data, the S&P 500 gained 10.07 points, or 0.13%, to end at 7,610.03 points, while the Nasdaq Composite gained 8.78 points, or 0.03%, to 27,095.59. The Dow Jones Industrial Average rose 237.13 points, or 0.46%, to 51,316.01.Hewlett Packard Enterprise jumped after ​the AI server maker pulled forward its long-term financial targets by two years. In further evidence of AI buildout, Alphabet said it was looking to raise $80 billion in equity offerings, including an investment from Berkshire Hathaway, to fund a costly expansion of its AI infrastructure. Its shares lost ground on the day. Marvell Technology's shares surged after Nvidia Chief Executive Officer Jensen Huang called the chipmaker the next "trillion-dollar company" at the Computex conference in Taipei. Nvidia invested $2 billion in Marvell in March.A drop in bitcoin hit cryptocurrency firms Coinbase and Strategy Inc.Broadcom is expected to report quarterly results on Wednesday.Read More News on(What's moving Sensex and Nifty Track latest market news, stock tips, Budget 2025, Share Market on Budget 2025 and expert advice, on ETMarkets. Also, ETMarkets.com is now on Telegram. For fastest news alerts on financial markets, investment strategies and stocks alerts, subscribe to our Telegram feeds .) Subscribe to ET Prime and read the Economic Times ePaper Online.and Sensex Today. Top Trending Stocks: SBI Share Price, Axis Bank Share Price, HDFC Bank Share Price, Infosys Share Price, Wipro Share Price, NTPC Share Price...moreless(You can now subscribe to our ETMarkets WhatsApp channel)Read More News on(What's moving Sensex and Nifty Track latest market news, stock tips, Budget 2025, Share Market on Budget 2025 and expert advice, on ETMarkets. Also, ETMarkets.com is now on Telegram. For fastest news alerts on financial markets, investment strategies and stocks alerts, subscribe to our Telegram feeds .) Subscribe to ET Prime and read the Economic Times ePaper Online.and Sensex Today. Top Trending Stocks: SBI Share Price, Axis Bank Share Price, HDFC Bank Share Price, Infosys Share Price, Wipro Share Price, NTPC Share Price...moreless