Breaking from past practice, Qualcomm plans to have its next-generation Snapdragon 820 processor manufactured at Samsung’s chip-making plants, according to sources familiar with Qualcomm’s roadmap and Samsung’s foundry operations.

Historically, Qualcomm has manufactured its leading-edge chips largely at contract chip maker Taiwan Semiconductor Manufacturing Co. as well as other foundries. However, Samsung has had an edge over TSMC and other chip plants because it is cranking out chips using thinner 14-nanometer wiring, compared with 20-nanometer transistors at TSMC. All other things being equal, thinner wires mean smaller and less costly chips as well as better battery performance.

Qualcomm saw its current high-end chip, the Snapdragon 810, shut out of Samsung’s new Galaxy S6 in favor of Samsung’s homegrown Exynos chip. As a result, Qualcomm had to cut its financial outlook for the year even as the 810 won a spot in other flagship products, such as the latest HTC One and LG Flex 2.

The Snapdragon 820 is the next generation of Qualcomm’s top-end chip family, designed for the 2016 flagship models from the leading phone makers. Qualcomm is hoping that the move to use Samsung’s factories will help it win back business for the next Galaxy S flagship, the sources said. Qualcomm declined to comment on its manufacturing plans for the chip. A Samsung representative was not immediately available for comment.

As previously reported by Re/code, Apple also plans to make its high-end chip, the A9, at Samsung’s plants.

“Samsung’s fabs for mobile processors are the hottest thing going,” said longtime chip industry analyst Patrick Moorhead. “This is a great example of ‘co-opetition.’”

The deals with Qualcomm and Apple mean more revenue and profit for Samsung’s chip-making arm. In theory, though, Samsung appears to be taking away an advantage from its own phones — given that currently only its Exynos processor is using the 14-nanometer process.

However, in order to use its own processor for the Galaxy S6, Samsung had to use a separate modem chip, which adds back cost. The Snapdragon 820 will have its own built-in LTE modem as well as a custom-designed Qualcomm processor and graphics core. That could ultimately help Samsung compete against Apple, even if it has to scale back use of its own Exynos.

Qualcomm’s decision also could be bad news for Taiwan’s TSMC, which has been getting the bulk of Qualcomm’s high-end chip-making business. Still, both Apple and Samsung may tap TSMC as a secondary source to ensure capacity, said Moorhead, president of Moor Insights and Strategy.

Qualcomm said in January that the Snapdragon 820 would reach the sampling stage later this year and use a more advanced manufacturing process, but it did not elaborate at the time. Qualcomm also plans to move back to its own processing core rather than using an outside design as it did with the 810, doing so as part of an effort to rapidly get a 64-bit core into the market.