In what could be Silicon Valley’s largest layoff ever, tech giant Hewlett-Packard (HPQ) is expected to announce — as early as next week — cuts of up to 35,000 employees.

HP is the world’s biggest personal computer-maker, but the legendary company’s sales and profits have slumped as consumers have turned to mobile devices. That shift was highlighted last year when Apple (AAPL) — with one-sixth as many employees — became Silicon Valley’s biggest business by revenue, a title HP previously had held every year since this newspaper began ranking local firms in 1986.

Quoting an unnamed HP source, the online publication Business Insider on Thursday said the cuts could amount to 10 percent or more of HP’s nearly 350,000 workers. AllThingsD, a website affiliated with The Wall Street Journal, reported that the cuts would more likely be in the range of 30,000.

“While a difficult decision, in our view, a reduction in force will improve confidence” in HP, Brian Marshall, an analyst with the International Strategy & Investment Group, concluded in a note to his clients Thursday. Earlier this month, he had forecast a layoff of about 5 percent of the workforce, which he estimated would save the company $1.2 billion.

HP has been racked by turmoil since August 2010, when CEO Mark Hurd resigned after being accused of falsifying expense reports in a scandal that involved sexual harassment allegations by an HP contract employee. The CEO who replaced Hurd, Léo Apotheker, was ousted after 11 months when his efforts to redirect the company were not well-received.

In February, HP reported its first-quarter profit fell 44 percent from a year earlier and that sales were down in three major divisions.

Although an announcement about layoffs is expected by Wednesday, when HP reports its second-quarter earnings, company spokesman Michael Thacker declined to comment on the speculation.

If HP goes through with the cuts, it isn’t clear how many people might lose their jobs in the Bay Area. The company repeatedly has declined to disclose the number of workers it has in various locations.

However, CEO Meg Whitman said during a talk at Stanford University in March that HP had 87,500 employees in the U.S., including about 16,000 in California. Officials in Palo Alto, where HP is based, and in Cupertino reported last year that the company’s combined workforce in those two cities was about 5,000.

Among those expecting layoffs is Baird & Co. analyst Jayson Noland, who says the recently combined PC and printer division could be hit hard, along with the HP sales staff. He noted that HP customers have complained of having to deal with up to eight different sales teams, each operating like separate fiefdoms.

“You have an HP sales guy trying to sell you servers, another trying to sell you software, another PCs,” Noland said. “That’s crazy.”

Silicon Valley’s last major layoff was announced by HP in September 2008, when it said it was cutting 24,600 jobs over the next three years. That layoff was the 11th-largest corporate layoff in the country since 1993, according to 24/7 Wall St., an online financial news site.

Whitman, who was named in September to replace Apotheker, has hinted previously at the possibility of layoffs as she attempts to restructure and revitalize the storied Silicon Valley company. In a February conference call with analysts, she said the company must find ways to cut spending so it can funnel more money into developing new products and getting them on the market more quickly.

“There is still much more we can do to streamline operations,” she said. “We have to save to invest. We have to save to grow.”

Brent Bracelin, an analyst with Pacific Crest Securities, said in a note to his clients this week that HP’s PC business is losing steam as consumers shift increasingly to smartphones and other mobile computer devices. And while the company’s PC and printer segments “still account for slightly over 50 percent of revenue and 46 percent of profits,” he noted, HP’s server, software, networking and storage products offer higher profit margins.

“HP is going to have to right-size its operations,” he said in an interview.

If Whitman does significantly reduce HP’s head count, it would make sense to do that now, said tech analyst Rob Enderle.

The best way for a new CEO to do layoffs is to “do them once, do them deep and don’t do them again.” He noted that Whitman has been in her position long enough to have sized up the company’s deficiencies and come up with a general road map for where it should head. So it wouldn’t be a surprise if she trimmed the company’s staff as “part of that measured approach to fixing HP.”

HP’s shares rose 3 cents, or about 0.1 percent, to $22.06 at the close of trading.

Staff writer Brandon Bailey contributed to this report. Contact Steve Johnson at 408-920-5043.