This has been a bad year for semiconductor stocks following two years of healthy growth when supply was tight and demand was booming. That explains why the PHLX Semiconductor Sector index has lost 35% of its value in 2022.

Reports about high levels of semiconductor inventories and weakening demand have sent shockwaves through this once-high-performing sector. Not surprisingly, shares of Advanced Micro Devices (AMD -0.35%) have borne the brunt of the broader semiconductor industry weakness, losing 47% of their value so far in 2022.

The U.S. government's latest sanctions on sales of artificial intelligence (AI) chips to China have further dented investor confidence in the stock despite AMD's solid results and sunny outlook. However, a closer look at the markets AMD is operating in indicates that it could defy any potential slowdown in semiconductor sales. Let's see why that may be the case.

AMD's market share growth could be its biggest catalyst

Sales of personal computers (PCs) have slowed down this year. As a result, sales of central processing units (CPUs) and graphics processing units (GPUs) that go into PCs have also taken a hit.

Mercury Research estimates that desktop CPU shipments fell to their lowest level in nearly thirty years in the second quarter of 2022. CPU giant Intel's (INTC 0.64%) top and bottom lines were hammered thanks to tepid PC shipments. Chipzilla's non-GAAP revenue was down 17% year-over-year in Q2 to $15.3 billion. Its adjusted earnings fell a whopping 79% to $0.29 per share during the quarter as the non-GAAP operating margin declined a massive 25.7 percentage points over the prior year.

AMD's results, however, had a different story to tell last quarter. The chipmaker's revenue from the client processor segment, which includes sales of desktop and notebook processors, jumped 25% year-over-year to $2.2 billion. AMD recorded stronger average selling prices (ASPs) in this segment, which led to an increase of one percentage point in its operating margin over the prior-year period.

The strong performance from AMD's PC-related processor business was a result of its impressive share gains during the quarter. Mercury Research points out that AMD's desktop processor share increased 3.5 percentage points year-over-year to 20.6% in Q2. Notebook market share was up 4.8 percentage points to 24.8% during the quarter.

Simply put, AMD's market share gains are helping it mitigate the negative impact of a tepid end market. This trend could continue, as AMD's Ryzen 7000 series desktop processors are set to go on sale from Sept. 27.

These processors are based on AMD's new Zen 4 architecture, which uses a 5 nanometer (nm) manufacturing node. The new processors may offer a 15% boost in computing speed without any additional power consumption compared to the previous generation processors based on a 7nm node. What's more, they could reduce power consumption by 30% while running the same computing speed as the previous-generation processors.

Even better, AMD has gone aggressive with the pricing. The upcoming top-end Ryzen 7000 processor is priced $100 less than the erstwhile flagship, which was launched toward the end of 2020. All this indicates that AMD's market share growth in the PC processor market is here to stay. That could stay true for a while -- Intel's upcoming Raptor Lake chips, which are expected to hit the market this year, won't bring a big architectural improvement over its existing lineup, and will still be based on a 10nm platform.

It is the smaller process node that allows AMD to price its upcoming chips more competitively and eke out gains in terms of both power and efficiency. After all, it is less expensive to produce smaller chips, as the silicon wafer contains a larger number of physically smaller processors.

A similar scenario is likely to unfold in the server processor market. AMD gained 4.4 percentage points year-over-year in server processors in Q2. It controlled 13.9% of this market last quarter, indicating that it has huge room for growth in this space. AMD's Zen 4 architecture will also power the company's server processors, and could give it a leg up over Intel, whose Sapphire Rapids server processors (based on a 10nm process) will only hit high-volume production in the first quarter of 2023.

In all, share gains in the PC and server markets should help AMD overcome any weakness in semiconductor demand and sustain its impressive growth streak.

Is the stock worth buying?

Trading at 32 times trailing earnings and just 15 times forward earnings, AMD looks like a solid bargain right now. The stock's five-year average trailing price-to-earnings ratio stands at 101, and the forward multiple stands at 39. So investors can get their hands on AMD stock at a very nice discount right now.

What's more, buying AMD at its current valuation looks like a no-brainer given its terrific pace of growth. The company expects to finish 2022 with a 60% increase in revenue to $26.3 billion. The semiconductor stock could sustain such impressive growth in the long run thanks to its share gains in the lucrative markets that it is operating in. That's why investors would do well to accumulate AMD while it is beaten down, since its outstanding growth could give the stock a boost in the long run.