Pre-tax profit more than halved at HSBC in the first six months of 2009 and the bank has warned that the economic outlook remains uncertain.The banking giant posted a profit before tax of $5bn (£3bn) during the period to 30 June, down from $10.2bn (£6bn) a year ago, but that was just ahead of forecasts. HSBC shares surged as much as 7% at one stage to their highest since mid-December. They had traded as low as 304p in May.Europe's biggest lender was "pleased" with the results, with profits at its investment banking business soaring to a record $6.3bn from $2.7bn last time. Commercial banking also did well, boosting income by 48% to $2.4bn.But Personal Financial Services suffered a loss of $1.2bn versus a profit of $2.3bn this time last year. US consumer lending business, Household International, lost $2.9bn.HSBC took a big sub-prime lending hit last year and is in the process of shutting its US retail lending operations. It's already closed 813 branches there.But it hasn't had to go cap in hand to the British government, unlike rivals Lloyds and Royal bank of Scotland. Instead, it raised $17.8bn from a rights issue in April. And, although its US adventure with Household proved a complete disaster, the push into mainland China is proving more fruitful. The value of its three largest strategic investments there has grown "significantly" since they were bought and added $8.2bn since the start of 2009."Mainland China remains key to our growth strategy," explained the firm, which remains on track to have around 100 HSBC-branded outlets there by the year-endMeanwhile, loan impairment charges and other credit risk provisions were $13.9bn, up from $10bn in the first half of 2008. Analysts had predicted bad debts of over $15bn."Operating conditions in the financial sector have continued to improve as the effects of government and central bank policies work through the system and it may be that we have passed, or are about to pass, the bottom of the cycle in the financial markets," chairman Stephen Green said."Nonetheless, the timing, shape and scale of any recovery in the wider economy remains highly uncertain. Our view continues to be cautious as long as a number of serious impediments to growth remain."