As tide turns against chip industry, Samsung forges ahead of rivals