NEW YORK — U.S. stock indexes were mixed Wednesday as energy companies skidded along with oil prices, but technology stocks rose and reversed a portion of their recent losses.

After O’Reilly Automotive reported weak sales growth in the second quarter, the three biggest losers on the Standard & Poor’s 500 index were all auto parts companies. Car makers slumped, too.

An eight-day rally in U.S. crude oil prices ended with a thud and energy companies took sharp losses. Retailers and small, domestically-focused companies also struggled.

Technology companies bucked the trend and finished higher. Those companies have hit a wall in the last month. Banks and industrial and health care companies also rose on another quiet day of trading after the Independence Day holiday.

The Federal Reserve is trying to decide when it will start letting its $4.5 trillion bond portfolio shrink.

The Standard & Poor’s 500 index added 4.55 points, or 0.2 percent, to 2,432.54. The Dow Jones industrial average slid 1.10 points to 21,478.17. Nasdaq composite rose 40.80 points, or 0.7 percent, to 6,150.86. The Russell 2000 index of smaller-company stocks sank 6.54 points, or 0.5 percent, to 1,420.15.

Benchmark U.S. crude dropped $1.94, or 4.1 percent, to $45.13 a barrel in New York. Brent crude, used to price international oils, sank $1.82, or 3.7 percent, to $47.79 a barrel in London.