U.S. stocks ended the week broadly higher, thanks to growing optimism about a debt-ceiling deal and a string of strong earnings reports from microchip makers that delivered a fifth straight weekly gain for the Nasdaq Composite, leaving it at a nine-month high.