HSBC announced a rise in pre tax profits to $10.2bn for the first half of 2017 despite spending $500m on splitting its retail and investment banking operations.