Chipmaking giant Taiwan Semiconductor Manufacturing (TSM 1.27%) just reported its second-quarter 2022 results, and it went a long way toward assuaging fears that the chip industry is headed for a sharp downturn. On the contrary, TSM grew at a healthy clip during the spring quarter. Far and away the largest semiconductor foundry in the world, TSM is indicating the good times for chip businesses are still rolling, and chip stocks look like a fantastic long-term bargain after getting clobbered the first half of this year.

Forget the consumer spending slowdown, chip demand is still rising

If there is one takeaway from TSM's Q2 earnings report, it's this: The semiconductor industry is being propelled forward by industry, not consumers. After two years of heavy spending on work-from-home electronics, many households are tapping the brakes on new device spending. In fact, at the end of June, memory chipmaker Micron Technology said there is an oversupply of items like PCs on the market, and a brief downturn in consumer electronics demand would ensue.

But that doesn't mean all spending on chips is in for a correction. On the contrary, high-performance computing (cloud, AI, etc.), automotive, and industrial Internet of Things is still doing just fine. As a result, TSM's Q2 revenue increased 43.5% year over year to 534 billion New Taiwan dollars (or up 36.6% to $18.1 billion in U.S. dollars, lower due to foreign currency exchange issues). Gross profit margin on product sold was 59%, compared to just 50% last year. And net income and earnings per share both increased 76.4% in New Taiwan dollars.

Talk about knocking it out of the park. Even better than the quarterly earnings beat, management indicated momentum will continue in Q3. At the midpoint of guidance, revenue is expected to rise 36% from a year ago. Gross margin should also be in a range of 57.5% to 59.5% (51.3% in Q3 2021), which means another big increase in earnings is likely.

Mixed signals from semiconductors, but stay the course

TSM's report is confirmation of what we've been hearing from other semiconductor companies in recent months. Softness is showing up in some areas, but not all chip businesses are the same. This is a massive industry that reaches into all sectors of the economy, and weakness in one area doesn't mean the whole space is headed for a downturn. 

Specifically, chip stocks with outsized exposure to large organizational spending look like they should hold up well right now. The cloud and AI are top investment trends, and for good reason. As inflation takes its toll on the global economy, businesses are looking for ways to cut costs and get a quick return on their investment. The cloud and AI do just that, and it all starts with funneling money into next-gen chips and the data centers they power. 

With 43% of total Q2 revenue coming from high-performance computing, TSM is in superb position here. Shares trade for just under 14 times current year expected earnings, which looks mighty cheap if you think this manufacturer will hold on to its technological lead for at least the next few years.  

Rising political tensions between Taiwan and China are of course an omnipresent worry when it comes to owning this stock. As Taiwan boasts more than half of the world's chip production (versus the U.S., where most of the engineering and tech licensing work takes place), an outright conflict between China and Taiwan would have much more far-reaching effects on the world than just Taiwan Semi.

But that's a topic for another time. The takeaway here is that TSM is still firing on all cylinders, and the global economy's hunger for technology's basic building blocks isn't abating anytime soon. Top semiconductor stocks have been blasted this year, down 32% as measured by the iShares Semiconductor ETF. If you're looking for a place to start investing in the top secular technology trends of the next decade, chip designers, manufacturers, and equipment makers are a great place to start.