Advanced Micro Devices, Inc. (NASDAQ: AMD ) is a major battleground stock that has been the tech sector’s main focus recently as the company reported Q2 earnings. The bulls, for the second quarter running, carried the day. AMD stock shot up 6% in after-market trading after it easily managed to clear the hurdle for top- and bottom-line expectations.

AMD reported revenue of $1.02 billion, $68.7 million better than the consensus on Wall Street, and good for 9% year-over-year growth.

Meanwhile, AMD reported a non-GAAP earnings-per-share loss of $0.05 per share, which was a considerable improvement over last quarter’s loss of $0.12 per share and $0.17 during the previous year’s comparable quarter.

Furthermore, the operating profit of $3 million compared well with the operating losses of $55 million and $87 million recorded during Q1 2016 and Q2 2015, respectively.

On a GAAP-basis, AMD posted net income of $69 million (EPS of $0.08) compared to a net loss of $181 million or an EPS loss of $0.23 a year ago.

What’s particularly remarkable about AMD’s latest set of results is that the company managed to snap out of its dismal track record of top- and bottom-line contractions. Over the last eight quarters, AMD has managed to beat earnings just once, leading to a severe hammering of AMD stock.

But during the latest quarter, the company hit a home run by:

Returning to top-line growth after years of declines

Posting a GAAP net profit for the first time in years

Recording the first operating profit after a long string of losses

AMD: Semi-Custom Segment Outshines CPU and Graphics Segment

AMD’s CPU and Graphics unit is usually the company’s largest revenue segment, and the main focus of investors’ attention. But the tables were turned this time around, with the company’s Embedded and Semi-Custom segments stealing the spotlight.

The CPU and Graphics division posted revenue of $435 million after a 5% sequential decline that the company blamed on lower sales of client desktop processors. But the segment posted a healthy 15% year-over-year increase. The operating loss for this segment clocked in at $81 million compared to a loss of $147 million a year ago. Despite the sequential sales decline, this marked the first time in years the segment grew on a year-over-year basis.

However, AMD’s semi-custom segment stole the show.

The segment posted revenue of $592 million, thus eclipsing the CPU and Graphics segment. That revenue was good for a robust 59% sequential growth and 5% Y/Y increase. The segment’s operating profit was $84 million, a 211% Y/Y increase.

AMD supplies integrated CPU/GPUs (APUs) to Microsoft Corporation (NASDAQ: MSFT ) and Sony Corp (ADR) (NYSE: SNE ) for their respective gaming consoles. Both companies released their current consoles years ago and no refreshes have been forthcoming (console upgrade cycles take as long as seven years). With no product refreshes, console sales suffer and AMD finds itself squeezed.

But both Microsoft and Sony have lined up console upgrades in the current year. Microsoft plans to launch a leaner and cheaper Xbox One console that will be capable of VR gaming, as well as a more powerful device some time in 2017. Sony is reported to be prepping a PS4 that will support 4K gaming in the current year. The two companies must have already placed large APU orders to AMD for their upcoming offerings; hence the healthy segment sales growth.

Console sales are typically strongest during the first few years of the upgrade cycle. AMD could therefore continue seeing brisk business in this segment for the next two years. In any case, there are rumors that both Microsoft and Sony might shift to smaller but more frequent upgrade cycles instead of huge ones that comes once every 7 to 8 years. So, AMD’s semi-custom sales might not nosedive the way they had done in the past.

Meanwhile, the Graphics segment could get a much required lease on life when AMD finally launches its Polaris line of cards to take on Nvidia Corporation‘s (NASDAQ: NVDA ) Pascal cards.

Starting at roughly $240, AMD has priced its upcoming Radeon RX 480 cards aggressively and might be able to claw back some market share from Nvidia whose comparable GeForce GTX 1080 retails at $599.

Bottom Line on AMD Stock

The big question investors have is whether AMD stock has turned the corner and is now home and dry. With this recent earnings report, it seems like AMD is heading towards that direction. If the claim that Microsoft and Sony are shooting for more frequent console upgrades is true, then AMD stock could be in for good times.

Meanwhile, the company’s upcoming graphic cards might be able to give Nvidia a run for its money in the mid-range segment of the market. Investors should also keep an ear out for any details on the SoC licensing deal with Intel Corporation (NASDAQ: INTC ) during AMD’s upcoming earnings call.

Although AMD stock has racked up gains of 113% YTD and 267% over the last 12 months, it’s trading 20% below where it stood five years ago, which means there’s still room for good gains to be made.

As of this writing, Brian Wu did not hold a position in any of the aforementioned securities.

More From InvestorPlace