NEW YORK (AP) — Wall Street drifted higher Wednesday as gains for most stocks outweighed drops for Alphabet and some other big-name companies following their latest profit reports.The S&P 500 rose 0.4% following mixed trading across European and Asian markets. The Dow Jones Industrial Average added 317 points, or 0.7%, and the Nasdaq composite gained 0.2%.Toymaker Mattel jumped 15.3% after blowing past analysts’ forecasts for profit in the latest quarter. Strength for its Hot Wheels brand helped make up for some softness for Barbie and other dolls. Mattel also gave a forecast for profit this upcoming year that topped analysts’ expectations.Amgen rallied 6.5% and was one of the strongest forces pushing upward on the S&P 500. It reported stronger profit for the latest quarter than expected, thanks in part to growth for its Repatha medicine, which can lower bad cholesterol and reduce the risk of heart attack.They helped offset a 7.3% drop for Alphabet, which sank even though Google’s parent company reported stronger profit for the latest quarter than analysts expected. Investors focused instead on slowing growth for its cloud business, whose revenue fell short of forecasts. They also homed in on the $75 billion Alphabet is budgeting for investments this year, roughly $15 billion more than analysts expected, as it remains in the rush to develop artificial-intelligence technology.Advanced Micro Devices fell 6.3% even though the chip company edged past profit expectations for the latest quarter. While analysts called AMD’s results solid, they also asked why CEO Lisa Su did not give more detail about expectations for the performance of its AI offerings specifically.Investors always want companies to deliver bigger profits, but the hopes may be even higher than usual given worries about how much faster stock prices have climbed than corporate profits, causing critics to call them expensive. Uncertainty is also hanging over the global economy because of President Donald Trump’s tariffs.After rocking financial markets around the world at the start of this week, worries about a potentially punishing global trade war have eased a bit after Trump gave 30-day reprieves for tariffs on both Mexico and Canada. That bolstered traders’ hopes that Trump sees tariffs as merely a tool for negotiation, rather than as a long-term policy.Goldman Sachs economist David Mericle says a further extension may happen, but he sees the tariff risk for both countries likely remaining until the end of a review of the United States’ existing trade agreement with the two countries, which could be in the middle of next year.In the meantime, Trump has pressed ahead with tariffs on Chinese goods, and Mericle expects tariffs to hit autos from the European Union, among other potential moves. That could drive a one-time boost to inflation, which could leave a widely followed measure of underlying inflation trends at 2.6% in December, above the Federal Reserve’s ta