Djokovic battled past fellow Serb Filip Krajinovic 7-6 (9/7), 6-3, to remain on a collision course for a final showdown with Nadal for a second conscutive year.
The top-ranked Djokovic had said on Monday that he learned "a big lesson" after he was thrown out of the US Open for unintentionally hitting a line judge in the throat with a ball in a fit of anger.
"A thousand people isn't insignificant, it's a thousand motivations", said Berrettini.
The World No.1 battled from 3-0 down to edge the tiebreak 9-7 and win the opening set in 88 minutes. But every time is different, because she's playing so hard.
The former French Open victor will next face US Open finalist Victoria Azarenka who advanced after Russian Daria Kasatkina retired injured in their first set tiebreak.
She won the Dubai title in February, before the coronavirus lockdown, coming back to claim victory in Prague last month having skipped the US Open.
Earlier, Novak Djokovic lost his cool again midway through a 6-3, 4-6, 6-3 win over German qualifier Dominik Koepfer - less than two weeks after getting defaulted from the U.S. Open. Karolina has defeated Barbora Strycova 6-3 6-3, Anna Blinkova 6-4 6-3 and Elise Mertens 6-3 3-6 6-0 to reach the semifinal where she will face Marketa Vondrousova.
The British No.1 will head to Paris next week on the back of a demoralising 6-4 6-1 defeat to Spaniard Garbine Muguruza at the Italian Open in Rome.
Halep, the top seed, next faces Yulia Putintseva, who recovered from 6-4 5-2 down to beat 10th seed Elena Rybakina.
The world number two was leading 6-2, 2-0 in the quarter-final clash on clay in Rome when Putintseva signalled that she was retiring after 45 minutes of play with a lower back injury.
"The victory is really important against Muguruza, always", Halep said afterwards.
"It will interesting and nice to have some people in the stands".
A small number of fans saw top seed Halep hold off a late Muguruza fightback to advance 6-3, 4-6, 6-4 in just over two hours, in a battle of former French Open champions before Roland Garros starts in a week's time.