Federer beat Richard Gasquet in the quarters and is set to meet Juan Martin del Potro tomorrow.
That comes Del Potro beat Victor Troicki in three sets today to book his place in the last four.
Rafael Nadal and Marin Cilic meet in the other semi-final tomorrow – but that could be the only game played on Saturday in Shanghai.
Del Potro injured his wrist today and may now have to withdraw from the tournament.
It would mean Federer has an extra day to prepare for a potential final with his arch enemy Nadal.
The Argentine fell on his left hand at the start of the third set of this tightly-contested quarter-final.
Roger Federer could be fast-tracked into the Shanghai Masters final
He was seen to by a physio and was evidently in pain as he sat on his chair.
The 2016 Olympic finalist then refused to play any double-handed backhands in order to avoid the pain.
Not that his reduced arsenal affected his game, with Del Potro readjusting his tactics to play more off the forehand and utilise his backhand slice.
Troicki was broken in the same game Del Potro went down and the match went with severe until the 29-year-old rounded it off 4-6 6-1 6-4.
But the Argentine will no doubt have someone look at his left thumb and wrist to assess the extent of the damage done today.
Juan Martin del Petro was given treatment during the Shanghai Masters quarter-final
ATP Race to London rankings: Who will qualify for the World Tour Finals?
Mon, October 9, 2017
Express Sport runs through the ATP rankings, with the top 8 set to feature at the season-ending World Tour Finals
1 of 16
Which eight players will qualify for the season-ending ATP World Tour Finals?
Speaking ahead of the Gasquet clash, Sky Sports pundit Annabel Croft reckons Federer has surprised himself by his form this season.
She said: “I don’t think he expected to come out and in the very first event which was the Australian Open, the first Grand Slam of the year as well, that he would come out and to play the sort of tennis that he managed to play that week in January.
“I think he thought his body would take longer to make adjustments to playing competitive tennis again after six months off.
“I mean it’s unthinkable that he could come out and play the way he has. One thing he talked a lot about was playing with so much freedom.
“That’s something he keeps reminding himself throughout the course of 2017, that he wants to get back to that.”