What happened

Semiconductor-focused rising star Advanced Micro Devices (AMD 0.11%) is living up to its name this afternoon, advancing 8% through 12:45 p.m. ET -- a gain about four times as big as what the rest of the Nasdaq is scoring today.

And you can thank Piper Sandler for that.

An ascending green arrow against a candlestick chart.

Image source: Getty Images.

So what

Upgrading AMD shares to overweight this morning, investment bank Piper Sandler also raised its price target on the semiconductor company to $140 per share -- a 43% hike from the old price target of $98, and one that implies AMD shares could rise another 38% over the course of the next year.  

In so doing, Piper Sandler expressed a surprising reversal of its opinion just two weeks ago, when in the aftermath of AMD's blowout first-quarter earnings report, Piper Sandler decided to lower its price target on the shares to $98.  

What changed Piper Sandler's mind about AMD? As the analyst explains today, its "downgrade thesis of a slowing PC market and the lack of near-term accretion from Xilinx doesn't appear to be playing out as expected." Instead, the opposite is happening, with server sales strong, commercial PC sales offsetting weaker consumer PC sales, and the company's recent Xilinx acquisition helping to accelerate growth at AMD.

Now what

Now what does this mean for investors in AMD? First and foremost, I think Piper Sandler is providing a sterling lesson in not sticking to your guns after making a bad decision, but rather fixing that decision as soon as it's clear it's the wrong one. And Piper Sandler may very well have been wrong to cut its rating on AMD two weeks ago.

Now 33% cheaper than it started the year, AMD stock currently sells for about 33 times earnings, with a 33% long-term projected earnings growth rate (i.e., a price/earnings-to-growth ratio of almost precisely 1 -- the magic number for value investors) and strong free cash flow that backs up almost 100% of reported earnings. While it's certainly possible that predictions of a crash in PC demand will slow down growth going forward, it's hard to predict the future (as Yogi Berra once opined). As investors, the best we can really do is work with the information available to us at present.

At present, I see AMD stock as a fairly valued tech stock in a still pretty pricy stock market overall. Relatively speaking, that makes AMD a bargain -- and a buy.