Semiconductor stocks have continued to do well on the market in 2024, which is evident from the 33% gains clocked by the PHLX Semiconductor Sector index as of this writing. It is worth noting that this sector has outperformed the broader S&P 500 index's gains of 15% by quite a large margin.

However, not all semiconductor stocks have benefited from the sector's surge. Shares of Advanced Micro Devices (AMD 1.72%) and Marvell Technology (MRVL 1.70%) have recorded gains of just 9% and 19%, respectively, so far this year. They have underperformed the broader semiconductor market by a big margin even though both companies have been getting a boost from the growing demand for artificial intelligence (AI) chips.

However, a closer look at their businesses will tell us that they can witness a nice turnaround as AI adoption grows. But if you're in the market to add an AI semiconductor stock to your portfolio, which one of these two underperforming chipmakers should you be betting on? Let's find out.

The case for AMD

AMD's chips are primarily used in personal computers (PCs) and data centers, and both these markets are benefiting from the proliferation of AI. The data center market, for instance, is witnessing a construction boom thanks to AI. According to McKinsey, data center construction could increase at 10% a year through 2030, though there is a chance that the construction of hyperscale data centers could increase at an annual rate of 20%.

At the same time, existing data centers are being rapidly upgraded to tackle AI workloads. All this explains why AMD is expecting the market for AI-focused data center chips to grow from an estimated $45 billion last year to $400 billion by 2027. The good news for AMD investors is that it is gradually gaining traction in this market.

The company is forecasting more than $4 billion in revenue from sales of its AI data center chips this year. That's double what AMD was expecting last year. Of course, AMD is still a smaller player in the AI chip market, considering that Nvidia has established an almost monopoly-like position in this space. However, the good part is that it is looking to increase its market share by launching more competitive chips. Even better, the company is now planning to launch a new AI chip every year so that it can close the gap with Nvidia.

Investors should note that AMD's data center revenue increased an impressive 80% year over year in the first quarter of 2024 to $2.3 billion as its AI chips hit the market. That trend is likely to continue as this market grows further.

AMD has another potential growth driver thanks to AI because of its growing share in the market for PC processors. Sales of AI-enabled PCs are expected to clock a compound annual growth rate of 44% through 2028, according to Canalys. AMD is already benefiting from this opportunity as its revenue from sales of PC processors increased 85% year over year in Q1.

As these markets continue to gain traction and AMD comes out with new products to tap them, its growth rate should continue improving. Analysts are forecasting AMD's earnings to increase 32% in 2024 to $3.51 per share. The chipmaker is expected to sustain this strong growth trend over the next couple of years as well.

AMD EPS Estimates for Current Fiscal Year Chart

AMD EPS Estimates for Current Fiscal Year data by YCharts

Meanwhile, AMD's earnings could increase at an annual rate of 33% for the next five years, as per consensus estimates. So, there is a good chance that this semiconductor stock could put its underperformance behind and start rising once again thanks to AI-related catalysts.

The case for Marvell Technology

Just like AMD, even Marvell Technology is taking advantage of the growth in the data center market fueled by AI. However, Marvell is targeting a different niche of this market as it sells custom chips programmed to perform specific tasks as compared to AMD's data center GPUs (graphics processing units) that are meant for general-purpose computing.

Morgan Stanley is forecasting that the market for custom AI chips could grow at a whopping 85% a year through 2027 and generate $30 billion in revenue in 2027. Marvell's data center business is already benefiting from this fast-growing trend. The company reported an 87% year-over-year increase in data center revenue in the previous quarter thanks to "the start of a ramp in our custom AI programs" to $816 million.

The company's data center segment produced 70% of its top line last quarter. More importantly, it looks set to move the needle in a bigger way in the current fiscal year and beyond. In the company's May earnings conference call, CEO Matt Murphy said, "Our custom compute AI programs are beginning to ship in the first half of this fiscal year. And we are expecting a very substantial ramp in ... [the] second half of this year followed by a full year of high-volume production in fiscal 2026."

What's more, Murphy is forecasting that its addressable opportunity in the custom AI chip market could be worth as much as $45 billion in 2028. As a result, the company now sees a bigger addressable market in data centers that's expected to be worth $75 billion in 2028 as compared to $21 billion last year. This probably explains why Marvell's earnings are expected to grow at a tremendous pace over the next couple of years.

MRVL EPS Estimates for Current Fiscal Year Chart

MRVL EPS Estimates for Current Fiscal Year data by YCharts

So, just like AMD, even Marvell Technology has the potential to become a top AI investment in the long run, and that could help the stock soar following a tepid performance so far this year.

The verdict

We have seen that both AMD and Marvell are set to benefit from AI, and they could deliver robust earnings growth in the future. That's why we will now take a look at their valuations to check which one of them offers more value to investors right now.

As the following chart tells us, both AMD and Marvell are quite evenly matched in terms of their sales multiples and forward earnings multiples.

AMD PE Ratio (Forward) Chart

AMD PE Ratio (Forward) data by YCharts

Also, both companies have their own set of challenges right now. While AMD's impressive data center and PC growth has been overshadowed by the weakness in its gaming and embedded segments, Marvell is facing challenges in the networking, carrier, consumer, and automotive markets. However, both companies are expected to emerge with strong future growth because of AI.

So, investors may have a tough time choosing from one of these two AI stocks for their portfolios, though it won't be surprising to see AMD becoming the preferred choice because it has a bigger AI-related addressable market in the form of AI GPUs and PCs that could help it grow at a faster pace in the long run.