Chip stocks surged Thursday after four companies beat analyst expectations on earnings. Of the 30 chip stocks on the PHLX Semiconductor Index, only Qualcomm finished the trading day in the negative.

Xilinx, Teradyne and Lam Research all reported earnings and revenue that beat investors' expectations in their reports Wednesday. The three stocks led the index on Thursday, with Xilinx, which makes programmable chips for data centers, up 18.4 percent, and Lam Research and Teradyne, which make equipment that manufactures semiconductors, up 15.7 percent and 12.9 percent, respectively. Calculator manufacturer Texas Instruments also beat on earnings Wednesday and rose 6.9 percent the next day, despite missing on revenue.

The index overall was up 5.7 percent Thursday compared to the 0.7 percent pop in the tech-heavy Nasdaq Composite Index. It was the seventh-best day for the index in the past ten years.

Xilinx, which creates chip technology for a variety of industries including communications and aerospace, said it has benefited from the global push toward next-generation mobile networks. On the earnings call Wednesday, Xilinx CEO Victor Peng said that within wireless, "the strong growth was primarily driven by 5G deployments in South Korea and a very early start of the ramp of 5G deployments in China."

For Lam, "strong earnings were driven by better-than-expected margins," wrote Romit Shah, an analyst at Instinet, in a note after the report. Shah has a "buy" rating on the stock and said the company's gross margin of 46.3 percent topped Instinet's 46 percent estimate.

The sector could be poised to take a dive on Friday after Intel, the biggest U.S. chipmaker, reported revenue that missed analysts' estimates. Intel shares plunged as much as 8 percent in extended trading on Thursday.

Subscribe to CNBC on YouTube.

Watch: How Qualcomm became a chip giant and why its business model is being challenged by Apple and the FTC