Hewlett-Packard is saying goodbye Compaq, and hello IBM. The US tech giant may spin off its PC unit and stop making mobile devices running its own operating system. It has also made a surprise offer to buy UK software group Autonomy for a hefty $10 billion. Leaving the cutthroat hardware market for higher margin software can work, as IBM's success shows. But it won't be quick or easy. HP is the biggest PC firm in the world partly thanks to its merger with Compaq back in 2002, and the division accounted for close to a third of the firm's $130 billion-odd revenue in the year to October 2010. The unit did wring out $2 billion of profit last year. But long run profitability is poor, due to multiple rounds of expensive restructuring. Moreover, things are getting worse. If corporate customers have cash to spend on new gadgets they currently prefer to spend it on cellphones and tablets, as HP concedes. The company's efforts to crack these markets with devices using the WebOS operating system it bought with Palm last year aren't working. That's partly why HP also had to slash its revenue and earnings estimates for the rest of the year. Spinning off the PC division should help. IBM did something similar several years ago, and benefited from concentrating on more profitable businesses. Pulling the plug on efforts to compete directly with Apple in mobile devices also is sensible. It's expensive, and rival operating systems are well entrenched. Selling the associated patents could bring a cash windfall if recent deals are a guide. While dismantling is easy, however, building HP back up will be more difficult. Buying Autonomy takes a page out of IBM's strategy of focusing on software. Autonomy's business of managing and searching things like email, video and audio has years of 15 per cent or higher growth ahead of it, according to Redburn Partners. Yet HP is paying a rich cash price -- 11.5 times last year's revenue, a whopping 64 per cent premium to Wednesday's market price. HP will probably need a slew of such acquisitions if it wants to reach IBM's 30 per cent software margins, and that could prove a quick way to drain its cash resources. HP's shakeup makes sense, but it's only the beginning and the chances of missteps are high.