Williams faced her biggest threat in the first set of her contest against Sharapova, who had placed her hopes of ending a 12-year losing streak against the world number one on a rejuvenated serve.
The Russian had racked up a career-high 21 aces in her fourth-round match but her serve deserted her when she needed it most in the 10th game and Williams broke to win the first set before racing away with the second.
"I think if you're serving maybe 180 (kph) against somebody else compared to Serena, that's an ace," said Sharapova.
"Against Serena, as we all know, the return is one of her great strengths. She's very explosive."
Williams twice had treatment for the after-effects of food poisoning before securing an 18th successive win over the five-times grand slam champion.
The 34-year-old American has won all eight matches against Pole Radwanska but said she was taking nothing for granted as she continues her bid for a 22nd grand slam title.
"Nothing's guaranteed in sports," she said. "I still have to win two matches against potentially two extremely tough opponents."
Federer is also 34 and it has been quite some time since he was able to take for granted advancement to the last four at grand slams.
Czech Berdych had triumphed in their last two meetings at majors but, after a tight opening set, was no match for the clinical Swiss.
Federer found the target with nearly 70 percent of his first serves and won 83 percent of those points, hit 48 winners and made only 26 unforced errors to smother the sixth seed in two hours and 16 minutes.
"I think I played well overall," he said. "I think the first set was definitely key to the rest of the match because I think it maybe might've taken some energy out of Tomas. Who knows? If not physical, also mental."
Federer and Djokovic have played 44 times with the wins split equally between them, although the Serbian won their meetings in finals at Wimbledon and the U.S. Open last year.
"We are big rivals, we played so many times against each other," said Djokovic. "There's a lot of tension. There's a lot at stake. I'm expecting a great fight in two days."