By Mackenzie Tatananni and Kit Norton

The S&P 500 closed out the second quarter with a 14.9% gain, its largest in six years. While semiconductor and memory stocks drove the index higher, an animal health firm and consulting companies rounded out the laggards.

The top performer from April to June was, unsurprisingly, Sandisk. The stock maintained its relentless momentum, surging 258% over the three-month period.

Sandisk is benefiting from artificial-intelligence demand and a memory supply shortage that have boosted prices. Over the past 12 months, shares have skyrocketed 4,804%. On June 25, Sandisk soared, riding the coattails of Micron Technology's earnings. The fellow memory chip maker's financial report showed the NAND flash memory market will stay tight through next year. Wall Street attributes the strong NAND demand to rise of agentic AI, which requires lots of memory storage.

Micron Technology stock gained 242% in the second quarter, its strongest ever quarterly performance. That was despite falling after reporting strong third-quarter earnings last week. Guidance for the fiscal fourth quarter was similarly positive, suggesting Micron's memory sales are set to reach yet more highs in the current quarter. Much like Sandisk, the memory chip maker is riding the wave of historic demand for memory chips due to AI. Over the past 12 months, shares have advanced 854%.

Intel spiked 216% in the quarter. The chip maker got a big boost after President Donald Trump earlier this month said Intel had won a chip-manufacturing deal with Apple, in another positive sign of demand for chips. The company also hired former SK Hynix CEO Seok-Hee Lee as executive vice president of Intel Foundry, its chip-manufacturing business. Much of the stock's recent performance is based on expectations that the company's Foundry unit can attract external customers to offset the billions of losses the company has booked on its chip-manufacturing operations. Intel was a Barron's stock pick on April 14.

Marvell Technology added 201%. Marvell's business designing custom AI chips — called application-specific integrated circuits, or ASICS — has long been what investors were interested in. However, excitement around Marvell's networking products is what has catapulted the stock 284% over the past 12 months. Wall Street is growing even more optimistic about Marvell's optical-networking opportunity with analysts believing it could be more durable than Marvell's custom AI chip business.

Advanced Micro Devices rounded out the top five, with shares of the chip maker gaining just shy of 186%. The stock has been driven higher mostly by demand for the company's AI-optimized central processing units and Wall Street doesn't expect that to change any time soon. In May, AMD reported that data-center sales rose 57% in the first quarter and expected strong sales and adjusted gross profit in the second quarter.

As for the worst performers: Intuit fell 40%, continuing its descent after finishing May as one of the biggest laggards in the benchmark index. The losses are pegged to last month's sweeping layoffs, which came amid the software provider's attempt to streamline operations. In an interview with Barron's , CEO Sasan Goodarzi pushed back on market concerns that artificial intelligence was to blame.

Zoetis cratered 39% in the quarter. The animal health company slashed its full-year profit and revenue guidance at the start of last month. CEO Kristin Peck cited a pullback in consumer spending, noting that budget-conscious pet owners were cutting back on vet visits and opting out of premium products.

Accenture plunged 37%. Last month, mixed fiscal third-quarter earnings triggered the stock's worst single-day percentage decline on record. Ahead of the report — which included Accenture's second guidance tweak of the year — the company doubled down on its controversial acquisition strategy by purchasing two cybersecurity firms and taking a majority stake in a third.

Shares of Cognizant Technology Solutions fell almost as much. Blame Accenture's May guidance cut, which sparked a wider selloff in the consulting sector. As AI disruption continues to threaten the industry, Cognizant faced another major blow at the end of June, when the stock was removed from the Nasdaq-100 after more than two decades in the index.

LyondellBasell Industries declined nearly 35%. Shares of the plastics and chemicals giant have been battered by a combination of cyclical industry downturns, global oversupply, and margin pressure. While LyondellBasell and peers experienced a massive surge in early 2026 amid conflict in the Middle East, that rally reversed sharply after cease-fire agreements eased turbulent oil prices.

Write to Mackenzie Tatananni at mackenzie.tatananni@barrons.com and Kit Norton at kit.norton@barrons.com

This content was created by Barron's, which is operated by Dow Jones & Co. Barron's is published independently from Dow Jones Newswires and The Wall Street Journal.