Roddick has won the San Jose stop three times and reached the semis in eight of his nine appearances in the tournament.
Roddick and Berdych combined to hit 34 aces.
"He forced me to play well," Roddick said. "I made no bones about the fact that I would have to work my way into this event. You don't always have to feel comfortable to win a tennis match."
Spain's Fernando Verdasco also advanced with a 6-3, 7-6 (5) win against qualifier Ricardas Berankis despite being bothered by a sore right hamstring.
"I've been getting treatment for it and that's all I can do," said Verdasco, who had nine aces. "Since the first moment I played here it's feeling pretty good and even more so now."
The second-seeded Verdasco next plays Uzebkistan's Denis Istomin, who beat sixth-seeded Philipp Kohlschreiber of Germany 6-1, 1-6, 6-3 in the quarters.
The 19-year-old Berankis became the first Lithuanian-born player to reach an ATP World Tour quarterfinal.
"He's going to be a good player," Verdasco said of the former world No. 1 junior. "He has a good serve and he's young."
Americans Michael Russell and Sam Querrey were playing in the late match, with the winner to face Roddick.
Roddick's semifinal opponent will be fellow American Sam Querrey, the No.7 seed, who beat Michael Russell of the US 6-4, 6-3.