He will face Janko Tipsarevic, who knocked out world number one Novak Djokovic, for a place in Sunday's semi final.
Federer was unwilling to get dragged into the controversy over the court conditions.
"If you want to be a good claycourt player, you must be able to play everywhere," said Federer.
"Madrid has taken a gamble with blue clay. It's always a little different here because of the altitude and we must sit down with the other players to discuss it.
"It is slippy, there's no doubt about that but that has been the case here for a few years. They haven't yet found the perfect balance. Our job each day is to adapt to the conditions that we face."
Federer now stands 26-3 on the season, playing for the first time after a six-week break.
The 16-time Grand Slam champion could move to second in the world behind Djokovic should he win the title on Sunday.
Â