Chip stocks have gotten crushed in 2022. A quick glance at the iShares Semiconductor ETF, which has lost 40% of its value this year, shows the extent of the damage.

Shifting consumer spending patterns are leading to lower demand for chips used in personal computers and electronics, while supply chain disruptions are making it difficult to produce enough of the products that remain in high demand. With signs of potential sales shortfalls mounting, traders aren't waiting around to see what comes next.

Advanced Micro Devices (AMD -5.44%) hasn't been spared from the wreckage. In fact, its shares are down more than 50% this year. But with the semiconductor leader's stock price now cut in half, could it be the time to buy AMD's shares?

The bull case for AMD's stock

AMD's market-share gains are helping offset the weakness in the PC market. Over the past year, AMD has taken an additional 8.9% of the PC central processing unit (CPU) market from rival Intel (NASDAQ: INTC), bringing its overall market share to 31.4%, according to Mercury Research. AMD's advance was broad-based; it increased its share of the desktop (+3.5%), mobile (+4.8%), and increasingly important server (+4.4%) segments, according to Mercury's analysts.

Evidence of this market-share expansion can be seen in AMD's impressive financial results. The chipmaker's revenue soared 70% year over year to $6.6 billion in the second quarter, while its adjusted earnings per share surged 67% to $1.05.

Despite the downturn in the PC market, AMD's client segment revenue, which includes sales of desktop and notebook PC processors and chipsets, jumped 25% to $2.2 billion. Growth in AMD's data center business was even more impressive, with revenue rocketing 83% to $1.5 billion. Additionally, AMD's acquisition of semiconductor company Xilinx, in February, helped drive strong growth in its embedded segment, which houses its adaptive computing offerings. 

Better still, AMD's market-share gains are likely to continue in the quarters ahead. Its popular Ryzen processors offer significant performance and efficiency advantages over Intel's currently available chips. AMD is also pricing its new CPUs aggressively -- with savings of up to $100 compared to prior models -- to make them even more attractive to buyers.

Some risks for investors to consider

Supply chain constraints could continue to crimp chip production. COVID-related lockdowns in China, a key chip manufacturing hub, are an ongoing concern. Yet rising semiconductor inventory levels across the industry suggest many of these production challenges could be beginning to abate.

Inflation is another concern. Higher prices for food, housing, and energy are forcing many consumers to pare back their discretionary spending. These cost pressures are likely to drive many people to postpone their purchases of PCs and other devices. The downturn in tech spending could be even more severe if the economy falls into a prolonged recession. Still, evidence is mounting that inflation may have already peaked, which could allow governments to shift from restrictive, cost-containment measures to more expansionary and economically friendly policies sooner than many investors might expect.

A compelling valuation 

Following its steep decline, AMD's stock is now priced far more attractively than it has been in years. Its shares can currently be had for about 27 trailing earnings, a price-to-earnings (P/E) ratio that's near its lowest point in the past five years. 

AMD PE Ratio Chart

AMD PE Ratio data by YCharts.

AMD's valuation is even more compelling when we look ahead. AMD's forward P/E falls to roughly 15 based on analysts' estimates for 2022 and less than 14 based on their projections for 2023. That's a bargain for a high-quality business that's forecast to grow profits by 26% annually over the next half-decade. 

So, is AMD's stock a buy?

AMD is competing and winning within the massive PC and data center processor industries. Its market-share gains should continue to drive its sales and earnings higher, despite near-term macroeconomic challenges.

Moreover, the Xilinx acquisition gives AMD a powerful presence in rapidly expanding areas such as artificial intelligence (AI) and edge computing, thereby providing it with additional long-term growth drivers. Best of all, investors currently have the opportunity to purchase the chip leader's shares at a sharp discount from their recent highs.

For all these reasons, AMD's stock looks like a solid buy today.