As others have pointed out, there are often *many* factors that are contributing to a stock's movement other than the latest news.  In particular, the overall market sentiment and price movement very often is the primary driver in any stock's change on a given day.  

But in this case, I'd say your anecdotal observation is correct:
All else equal, announcements of layoffs tend to drive stock prices upwards.

Here's why:

**To the public, layoffs are almost always a sign that a company is willing to do whatever is needed to fix an *already known and serious problem.***

Mass layoffs are *brutally* hard decisions.  Even at companies that go through cycles of them pretty regularly, they're still painful every time.  There's a strong personal drain on the chain of executives that has to decide who loses their livelihood.  And even if you think most execs don't care (and I think you'd be wrong) it's still incredibly *distracting*.   The process takes many weeks, during which productivity plummets. And it's demoralizing to everyone when it happens.

So companies very rarely do it until they think they *have to*.  By that point, they are likely struggling with some very publicly known problems - usually contracting (or negative) margins.  

**So, the market's view of the company at the time just before layoffs occur is almost always, "this company has problems, but is unable or unwilling to solve them."**. 

**Layoffs signal that *both* of those possibilities are incorrect.  They suggest that the company believes that layoffs will fix the problem, *and* that they're willing to make hard calls to do so.**

And that's why they usually drive prices up.