What happened

Shares of Taiwan Semiconductor Manufacturing (TSM 1.26%) were up 2.4% as of 11:17 a.m. ET on Tuesday. The bump stands out on a flat day for the broader market, as the leading chip foundry announced plans to invest $2.9 billion in a new chip-packaging facility in Taiwan. 

So what

It's been a rough year for the chip industry. The company reported a sequential decline in revenue in the second quarter, reflecting weak end-market demand for processors.  

But the planned investment in new facilities fits management's view about the long-term opportunity to grow revenue. There are powerful secular trends driving demand for advanced chip technologies, including 5G wireless adoption and artificial intelligence applications.

In the second-quarter earnings call, TSMC said it is continuing to invest to support the development of new chip technologies, such as 3-nanometer and 2nm chips. This is despite ongoing uncertainty about when this current down cycle in chip demand will end.

Now what

The stock has rebounded 35% this year and now trades at a fair forward price-to-earnings ratio of 20 based on this year's consensus earnings estimate. Obviously, the market is anticipating a recovery in demand soon. While the trends toward more-advanced computing applications will drive higher chip demand over the long term, a prolonged recovery in the market might weigh on the stock.

Management's guidance for the third quarter calls for stabilizing revenue, although when asked on the earnings call about where we are in the cycle, it said that will depend on the macroeconomic conditions, which remain weak globally.