Federer was broken for the first time in three matches but handled his debut meeting with Sergiy Stakhovsky of Ukraine 6-3, 6-4, while two-time defending champion Novak Djokovic beat Florian Mayer of Germany 7-5, 6-4.
Federer will play Richard Gasquet, who overcame Gilles Simon 5-7, 6-2, 6-4 in an all-French match. Djokovic will play Tomas Berdych in a rematch of their Australian Open quarterfinal. Djokovic won that, then beat Federer in the semis and Andy Murray in the final.
"Yeah, tough one. (Berdych is) playing really well in the last year and a half," Djokovic said. "He's a quite consistent player right now. He has a very powerful serve, very fast baseline strokes, very flat, so I guess I need to be patient and wait for my chances." Stakhovsky saved three match points but Federer finally won when Stakhovsky hit a return wide.
"I thought it was a tough match, tougher than the last couple," Federer said.
Djokovic trailed Mayer 5-3 in the first set but the unseeded German's serve abandoned him and Djokovic wasn't troubled again.
"The ball was going faster today, and he took it to me from the start," Djokovic said. "Already first game he was on the net, twice, three times. I was not moving my legs well.
I was making lots of unforced errors." Djokovic finished better than he started, however, winning the last four games in the first set and the last five in the second.
Next up was Berdych, who beat Phillip Petzschner of Germany 7-5, 6-4 in just under two hours.
The third-seeded Czech broke Petzschner three times in the first set but dropped serve twice. Berdych wasted six set points, closing it out when Petzschner hit a forehand long.
The second set was just as close, with Berdych making the decisive break for 5-4.
Berdych conceded he had trouble with the big-serving Petzschner, whom he lost to last year.
"Philipp likes to play big serves, sometimes come to the net, a lot of slice in the backhand side and then he just makes a winner like that," Berdych said. "He does not give you a rhythm on court at all."