Serbia's Djokovic, this year's Wimbledon champion, suffered a shock 7-6 (8/6), 7-5 loss to Spain's Tommy Robredo.
Second-seeded Federer, a five-time Cincinnati champion, held off Frenchman Gael Monfils 6-4, 4-6, 6-3.
The Basel native booked a tough quarterfinal against eighth-seeded Scot Andy Murray, who battled more than two hours against the huge serve of John Isner, finally dispatching the American 6-7 (3/7), 6-4, 7-6 (7/2).
Federer had a rare show of temper late in the match, arguing with the chair umpire over a decision not to call on electronic line-calling on a particular point.
But Federer quickly recovered his poise, clinching the match with a service winner after breaking Monfils in the penultimate game.
Wawrinka, meanwhile, came from behind with a 3-6, 6-0, 6-1 win over Croatia's Marin Cilic.
The third-seeded Australian Open champion goes on to tackle France's Julien Benneteau, who put out Poland's Jerzy Janowicz 7-5, 6-1, for a place in the semifinals.