Chip makers who specialize in semiconductors—after being caught up in optimism about artificial intelligence for the past two years, have had a rough couple of months. President Donald Trump’s tariffs ...