The top-seeded Nadal, the World No. 1 from Spain, defeated sixth-seeded Bulgarian Grigor Dimitrov 6-4, 6-7 (4), 6-3 for the second time in as many weeks.
"It was a very tough match," Nadal said afterward. "I think both of us, we played at a very high level of tennis. The conditions, of course, have been different today than my two previous matches. I think (it was) a great battle between two players who are playing all the time very focused, very intense points all the time. I think both of us served very well during the whole match, so yeah, it was decided on just a few balls, and anything can happen."
The second-seeded Federer moved another step closer to earning his second Shanghai Rolex Masters title as the Swiss defeated Richard Gasquet of France 7-5, 6-4.
"I thought it was a really good match. Some big points, important shots at the right time for both guys sometimes to stay even, and we both created chances," Federer said. "I thought we were able to keep up the level from the beginning till the very end. ... I enjoyed it because it was slices and topspins and angles and power and finesse. I think the match had a bit of everything."
Nadal will face No. 4 seed Marin Cilic of Croatia, who has not dropped a set all week at Qi Zhong Stadium. Cilic beat Spaniard Albert Ramos-Vinolas 6-3, 6-4.
"He always is very dangerous opponent, and I think this surface, this court helps him," Nadal said when asked about playing Cilic. "It's a very fast court. He's able to go for the shots from the baseline. It will be a tough one. I know that I need to be very focused with my serve again, and I need to play aggressive and don't let him play from comfortable positions. If not, I will be almost dead because he is going to go for the shots."
Federer will play Juan Martin del Potro of Argentina, but the No. 16 seed from Argentina suffered a left wrist contusion on a fall during his quarterfinal win and was taken to a hospital.
After defeating Viktor Troicki of Serbia 4-6, 6-1, 6-4, del Potro said he will decide Saturday whether or not to play his semifinal match against Federer.
Jorge Viale, who is del Potro's agent, said on Twitter that "more serious problems were ruled out."
Federer, who lost to del Potro in the U.S. Open quarterfinals earlier this year, said during his press conference that he saw del Potro fall and hurt his left wrist.
"I hope for him that it's nothing serious," Federer said. "Of course it's on the wrist, as well, that he's had problems in the past, so this is where he's worried, rightfully so. For me, at the end of the day, nothing changes. I'm ready to come out here tomorrow and see the match like it's a revenge chance for the U.S. Open, where it was tight and I couldn't win. So I see that more than his injury. "But I hope for now that Juan Martin can recover and we can play a normal match."
Del Potro, who has undergone surgery on both wrists, said he is unsure if he will be able to play.
"I don't know how my wrist is after I fell down," del Potro said before leaving for a local hospital. "I felt something wrong in that moment, but I continued to play, just playing (backhand) slices just to finish the match. I'm going to the hospital to see what the MRI says, and what the doctor says. Then I will make a decision for tomorrow. I would like to play and be 100 percent."